/* DW2 Online Planner. Colours follow the game's Mastery window: near-black green ground, dark green panels,
   red for Negatives, sextant colours for the tree. Pixel font only for headings and counters. */
@font-face { font-family: "m6x11"; src: url("/fonts/m6x11plus.ttf") format("truetype"); font-display: swap; }
:root {
  --bg: #0e1411; --panel: #131d18; --panel2: #18251f; --line: #2a3d33; --line2: #3d5747;
  --text: #e4ece6; --muted: #93a69a; --accent: #57c08a; --btn: #1f6b4a; --btn-h: #26835a;
  --neg: #e2614f; --up: #8fdc9f; --gold: #e8c547;
  --r: 4px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #7fd8a7; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, .brand, .chip, .btn { font-family: "m6x11", system-ui, sans-serif; font-weight: 400; letter-spacing: 0; }
h1 { font-size: 44px; line-height: 1.05; margin: 0 0 12px; }
h2 { font-size: 30px; line-height: 1.1; margin: 40px 0 12px; }
h3 { font-size: 24px; line-height: 1.15; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
.lede { color: var(--muted); font-size: 18px; max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
kbd { border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; font-size: 14px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 58px; }
.brand { color: var(--text); text-decoration: none; font-size: 28px; white-space: nowrap; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--r); font-size: 15px; transition: color .15s, background-color .15s; }
nav a:hover { color: var(--text); background: var(--panel2); }
nav a[aria-current] { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.menu { display: none; margin-left: auto; background: none; border: 1px solid var(--line2); color: var(--text); border-radius: var(--r); padding: 6px 12px; font: inherit; }
@media (max-width: 1080px) {
  .menu { display: block; }
  nav { display: none; position: absolute; left: 0; right: 0; top: 58px; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 14px; flex-direction: column; }
  nav.open { display: flex; }
}

.hero { padding-top: 34px; padding-bottom: 10px; }

/* planner */
.planner { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; padding-bottom: 20px; }
.tree-box { position: relative; background: #070a08; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tree-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tree-bar .spacer { flex: 1; }
.chip { display: inline-block; border: 1px solid var(--line2); padding: 2px 10px; font-size: 20px; border-radius: 2px; color: var(--text); background: #0b120e; }
.chip.neg { color: var(--neg); border-color: #7a3229; }
.chip.full { border-color: var(--accent); color: var(--up); }
.tree { height: min(76vh, 760px); touch-action: none; cursor: grab; user-select: none; }
.tree:active { cursor: grabbing; }
.tree svg { width: 100%; height: 100%; display: block; }
.tree .edge { stroke: #24332b; stroke-width: 3; }
.tree .edge.on { stroke: var(--c); stroke-width: 4; }
.tree .edge.near { stroke: #3a5246; }
.tree .node { cursor: pointer; }
.tree .node .hex { fill: #0b100d; stroke: var(--c); stroke-opacity: .35; stroke-width: 2.5; transition: fill .12s, stroke-opacity .12s; }
.tree .node.near .hex { stroke-opacity: .95; }
.tree .node.on .hex { fill: var(--c); fill-opacity: .9; stroke-opacity: 1; }
.tree .node.hl .hex { stroke: #fff; stroke-opacity: 1; stroke-width: 3.5; }
.tree .node .mark { fill: var(--c); opacity: .5; pointer-events: none; }
.tree .node.on .mark { fill: #07100b; opacity: .85; }
.tree .node.preview .hex { stroke: #fff; stroke-opacity: .8; stroke-dasharray: 4 3; }
.tree .node:hover .hex { stroke-opacity: 1; }
.card { position: absolute; right: 12px; top: 60px; width: min(360px, calc(100% - 24px)); background: #0f1a14; border: 2px solid var(--line2); border-radius: 2px; padding: 12px 14px; pointer-events: none; z-index: 5; }
.card h3 { margin: 0 0 6px; font-size: 24px; display: flex; justify-content: space-between; gap: 10px; }
.card .pathc { color: var(--neg); font-family: "m6x11", sans-serif; font-size: 20px; margin: 6px 0 0; }
.card .pathc.ok { color: var(--up); }
.lines { list-style: none; padding: 0; margin: 0; }
.lines li { padding-left: 16px; position: relative; font-size: 15px; line-height: 1.45; }
.lines li::before { content: ""; position: absolute; left: 2px; top: .55em; border: 5px solid transparent; }
.lines li.up::before { border-bottom-color: var(--up); top: .2em; }
.lines li.down::before, .lines li.harder::before { border-top-color: var(--neg); top: .6em; }
.lines li.harder { color: #f0a497; }
.lines.big li { font-size: 17px; }

.side { display: grid; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 26px; }
.panel label { display: block; margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.panel select, .panel input[type=range], .filters input, .filters select { display: block; width: 100%; margin-top: 4px; }
select, input[type=search], input[type=email] { background: #0b120e; color: var(--text); border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 10px; font: inherit; font-size: 15px; }
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=range] { accent-color: var(--accent); }
output { float: right; color: var(--text); font-family: "m6x11", sans-serif; font-size: 20px; }
fieldset.tol { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 14px; padding: 8px 10px; }
fieldset.tol legend { font-size: 15px; color: var(--muted); padding: 0 4px; }
fieldset.tol label { display: inline-flex; align-items: center; gap: 6px; margin: 2px 12px 2px 0; color: var(--text); }
.btn { display: inline-block; background: var(--btn); color: #fff; border: 1px solid #2f8f62; border-radius: var(--r); padding: 8px 18px; font-size: 22px; cursor: pointer; transition: background-color .15s, transform .08s; text-decoration: none; }
.btn:hover { background: var(--btn-h); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn.ghost:hover { background: var(--panel2); }
.btn.small { font-size: 18px; padding: 3px 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.out:empty { display: none; }
.out { margin-top: 14px; }
.totals { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.totals li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.totals li b { font-family: "m6x11", sans-serif; font-weight: 400; font-size: 19px; }
.totals li.neg { color: #f0a497; }
.build { border: 1px solid var(--line2); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.build h3 { margin: 0 0 4px; font-size: 22px; display: flex; justify-content: space-between; gap: 8px; }
.build .ks { color: var(--gold); }
.build .row { margin-top: 8px; }
.locked { color: var(--muted); font-size: 14px; }
.wall { margin-top: 12px; border: 2px solid var(--gold); border-radius: var(--r); padding: 14px; background: #1b1d12; }
.wall h3 { margin: 0 0 6px; font-size: 24px; color: var(--gold); }
.wall ul { margin: 0 0 12px; padding-left: 18px; font-size: 15px; }
.wall .plans { display: grid; gap: 8px; }
.wall .plans .btn { width: 100%; text-align: center; }
.restore { margin-top: 12px; font-size: 14px; color: var(--muted); }
.restore input { width: 62%; margin-right: 6px; }

/* prose & tables */
.prose { padding-top: 24px; padding-bottom: 40px; max-width: 900px; }
.prose.wide { max-width: 1240px; }
.prose > p, .prose > ul { max-width: 76ch; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.scroll { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; }
table.data tbody tr:hover { background: #121c17; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data.narrow { max-width: 520px; }
.dot { display: inline-block; width: 10px; height: 10px; background: var(--c); border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.tag { font-size: 12px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line2); margin-left: 6px; white-space: nowrap; }
.tag.g { color: #f08cc0; border-color: #7a2f55; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 12px; }
.filters input { flex: 1 1 260px; width: auto; margin: 0; }
.filters select { width: auto; margin: 0; }
.shot { margin: 22px 0; max-width: 880px; }
.shot img { border: 1px solid var(--line); border-radius: var(--r); }
.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.ks, .boss { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 18px; }
.ks h2 { margin-top: 10px; }
.meta { color: var(--muted); font-size: 15px; }
.stats { font-family: "m6x11", sans-serif; font-size: 22px; color: var(--up); }

/* DNA */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 10px; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.plus { font-family: "m6x11", sans-serif; font-size: 34px; color: var(--muted); padding-bottom: 14px; }
.out.big .child { font-family: "m6x11", sans-serif; font-size: 40px; line-height: 1; color: var(--gold); margin: 4px 0; }
.rev { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; font-size: 15px; }
.rev li { padding: 4px 0; border-bottom: 1px solid var(--line); }
[data-ex] { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 22px 0 40px; color: var(--muted); font-size: 14px; }
.foot p { max-width: 100ch; }

@media (max-width: 900px) {
  .planner { grid-template-columns: 1fr; }
  .tree { height: 62vh; }
  .tool { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 14px; }
  .pair { grid-template-columns: 1fr; }
  .plus { display: none; }
  .chip { font-size: 17px; padding: 1px 7px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* rewrite 2026-11-26: guide tiles, solver card, take order, keep option */
.panel label.check { display: flex; gap: 8px; align-items: center; color: var(--text); margin-bottom: 4px; }
.panel label.check input { width: 16px; height: 16px; accent-color: var(--accent); }
[data-keep-note]:empty { display: none; }
.more { margin-top: 36px; }
.more h2 { font-size: 26px; margin: 0 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 0 0 12px; overflow: hidden; transition: border-color .15s, transform .12s; }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: translateY(1px); }
.tile img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.tile b { font-size: 20px; padding: 4px 12px 0; }
.tile span { font-size: 14px; color: var(--muted); padding: 0 12px; line-height: 1.45; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.solver-card { border: 1px solid var(--accent); border-radius: var(--r); background: var(--panel); padding: 14px 16px; margin: 20px 0; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.solver-card p { margin: 0; flex: 1 1 320px; }
.order-box { margin-top: 8px; font-size: 14px; }
.order-box summary { cursor: pointer; color: var(--up); }
ol.order { list-style: none; margin: 6px 0 0; padding: 0; max-height: 320px; overflow-y: auto; border-top: 1px solid var(--line); }
ol.order li { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px solid var(--line); }
ol.order li .at { min-width: 2.4em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
ol.order li.keystone { color: var(--gold); }
ol.order li.notable { font-weight: 600; }
.results { grid-column: 1 / -1; margin-top: 0; }
.results .builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.results .builds .build { margin: 0; }
.results .builds .wall { margin: 0; grid-row: span 2; }
.results > p.small { margin: 0 0 8px; }
.results { scroll-margin-top: 72px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
select, input[type=search], input[type=email] { border-color: #6b8a78; }
.prose p, .prose li { max-width: 72ch; }
h1, h2, h3 { text-wrap: balance; }
.results .builds .wall { grid-column: span 2; }
@media (max-width: 700px) { .results .builds .wall { grid-column: auto; } }
.wall .plans { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
ol.order.teaser { max-height: none; }
ol.order li.lock { color: var(--gold); }
.prose table.data, .prose .scroll { margin-bottom: 18px; }
