/* Azadira — an arena for algorithmic thinking.
   Swiss editorial × chess clock × generative tree. Monochrome; color carries state only. */

/* ---------- tokens ---------- */
:root {
  /* Deep Focus defaults; js/theme.js overwrites these with the player's theme (see docs/COLOR.md) */
  --bg: #14171d; --bg-elev: #1c1f25; --bg-sunk: #0e1015;
  --fg: #dddfe4; --fg-muted: #a9aaae; --fg-faint: #888c92;
  --rule: #2a2d33; --rule-strong: #3f434a;
  --grown: #6dc7e7; --grown-soft: rgba(109, 199, 231, .12); --accent-glow: rgba(109, 199, 231, .55);
  --tree: #2b4452; --tree-bright: #437c93;
  --signal: #bbacf0; --signal-fg: #0c0e12; --signal-soft: rgba(187, 172, 240, .13); --signal-glow: rgba(187, 172, 240, .5);
  --danger: #f07a86; --danger-soft: rgba(240, 122, 134, .12);
  --ed-bg: #111419; --ed-active: rgba(221, 223, 228, .035); --ed-select: rgba(109, 199, 231, .24);
  --grid-dot: rgba(221, 223, 228, .055);
  --syn-keyword: #bbacf0; --syn-string: #9fd6ea; --syn-number: #e3cf8a; --syn-comment: #888c92; --syn-function: #dddfe4;
  --syn-class: #b3e0f0; --syn-property: #b9bcc2; --syn-builtin: #e0b8e8; --syn-punct: #8e939c;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 54px;
  --gutter: clamp(16px, 4vw, 56px);
  --cut: 10px;
  --editor-size: 14px;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-variant-ligatures: common-ligatures; background-color: var(--bg);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.2px); background-size: 28px 28px; background-attachment: fixed;
  color: var(--fg); font-family: var(--display); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--signal); }
.prose a, a.link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.prose a:hover, a.link:hover { color: var(--signal); text-decoration-color: var(--signal); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, pre, kbd, .mono, .cm-editor { font-family: var(--mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
code { font-size: .88em; background: var(--bg-sunk); padding: .08em .35em; border: 1px solid var(--rule); }
pre { background: var(--bg-sunk); border: 1px solid var(--rule); padding: .8em 1em; overflow: auto; font-size: .86em; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: 1em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-family: var(--mono); font-weight: 500; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
blockquote { margin: 0 0 1em; padding: .6em 1em; border-left: 2px solid var(--signal); background: var(--signal-soft); }
::selection { background: var(--signal); color: var(--signal-fg); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.muted { color: var(--fg-muted); } .faint { color: var(--fg-faint); } .small { font-size: .84em; } .strong { font-weight: 600; }
.row { display: flex; align-items: center; } .gap { gap: .6rem; } .wrap { flex-wrap: wrap; } .grow { flex: 1; } .top-gap { margin-top: 1rem; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.hidden { display: none !important; }
.err { color: var(--danger); }
.warn-text { color: var(--signal); }
.label { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- controls: rectangular, typographic ---------- */
.btn { display: inline-flex; align-items: center; gap: .55em; padding: .62em 1em; border: 1px solid var(--rule-strong); background: transparent; color: var(--fg);
  font-family: var(--mono); font-size: .76rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; white-space: nowrap; border-radius: 0; }
.btn:hover { border-color: var(--fg); color: var(--fg); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-fg); }
.btn-primary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn-success { background: var(--grown); border-color: var(--grown); color: var(--bg); }
.btn-success:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--rule-strong); }
.btn-sm { padding: .42em .7em; font-size: .7rem; }
.btn-icon { padding: .42em .6em; }
.btn-danger-ghost { border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }
.arrow::after { content: " →"; }
.filter-input, .dialog input[type=text], .board-form input, .board-form select, .stdin-box {
  background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid var(--fg-faint); padding: .5em .1em; font: inherit; font-family: var(--mono); font-size: .85rem; border-radius: 0; }
/* input boundaries use --fg-faint (>= 4.5:1, WCAG 1.4.11 needs 3:1); focus adds a 2px signal underline */
.filter-input:focus, .dialog input:focus, .board-form input:focus, .stdin-box:focus { outline: none; border-bottom-color: var(--signal); box-shadow: 0 2px 0 var(--signal); }
select.filter-input { cursor: pointer; }
select.filter-input option { background: var(--bg-elev); color: var(--fg); }

/* difficulty / state markers: monospace, no pills */
.badge { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.badge::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .45em; vertical-align: .05em; border: 1px solid currentColor; }
.badge-easy { color: var(--fg-muted); }
.badge-medium { color: var(--fg); } .badge-medium::before { background: var(--fg); }
.badge-hard { color: var(--signal); } .badge-hard::before { background: var(--signal); border-color: var(--signal); }
.tag { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tree-bright); margin-left: .6em; vertical-align: middle; }
.chip { font-family: var(--mono); font-size: .7rem; color: var(--fg-muted); letter-spacing: .02em; }
.chip + .chip::before { content: "/"; color: var(--fg-faint); margin: 0 .45em; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--fg); color: var(--bg); font-family: var(--mono); font-weight: 700; font-size: .7rem; flex: none; }
.check { color: var(--grown); font-weight: 700; }

/* ---------- header: thin instrument bar ---------- */
#site-header { position: sticky; top: 0; z-index: 30; height: var(--header-h); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.header-inner { height: 100%; padding: 0 var(--gutter); display: flex; align-items: center; gap: 2rem; }
.brand { font-family: var(--mono); font-weight: 700; letter-spacing: .28em; font-size: .8rem; display: flex; align-items: center; gap: .6em; }
.brand .logo { width: 20px; height: 20px; color: var(--grown); fill: var(--grown); filter: drop-shadow(0 0 6px var(--accent-glow)); }
.brand:hover { color: var(--fg); }
.main-nav { display: flex; gap: 1.4rem; flex: 1; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.main-nav a { color: var(--fg-muted); padding: .3em 0; border-bottom: 1px solid transparent; }
.main-nav a:hover { color: var(--fg); }
.main-nav a.active { color: var(--fg); border-bottom-color: var(--signal); }
.main-nav .sep { color: var(--fg-faint); }
.header-actions { display: flex; gap: .4rem; align-items: center; font-family: var(--mono); font-size: .72rem; }
.profile-chip { gap: .6em; border-color: transparent; }
.profile-chip:hover { border-color: var(--rule-strong); }
@media (max-width: 820px) { .main-nav .phase-link, .profile-name, .main-nav .sep { display: none; } .header-inner { gap: 1rem; } }

/* ---------- dialog & toasts ---------- */
.dialog { border: 1px solid var(--rule-strong); background: var(--bg-elev); color: var(--fg); padding: 1.5rem; width: min(560px, calc(100vw - 32px)); border-radius: 0; }
.dialog::backdrop { background: rgba(0, 0, 0, .72); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dialog h2 { margin: 0; font-size: 1.2rem; }
.profile-list { display: flex; flex-direction: column; margin: 1rem 0; border-top: 1px solid var(--rule); }
.profile-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.profile-row.current .strong { color: var(--grown); }
#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 80; }
.toast { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; background: var(--fg); color: var(--bg); padding: .7em 1em; opacity: 0; transform: translateY(6px); transition: all .2s; max-width: 380px; }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--grown); color: var(--bg); } .toast-error { background: var(--danger); color: #fff; }

/* ---------- home: manifesto ---------- */
.manifesto { min-height: calc(92vh - var(--header-h)); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; align-content: end; padding: 6vh var(--gutter) 5vh; border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.manifesto .kicker { grid-column: 1 / -1; font-family: var(--mono); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 2.5rem; display: flex; gap: 1.5rem; }
.manifesto .kicker span:first-child { color: var(--grown); }
.manifesto .quiet { grid-column: 1 / -1; font-size: clamp(1.1rem, 1.8vw, 1.5rem); color: var(--fg-muted); margin: 0 0 .6rem; font-weight: 400; letter-spacing: -0.01em; }
.manifesto .shout { grid-column: 1 / -1; font-size: clamp(3rem, 9.4vw, 9.6rem); line-height: .88; letter-spacing: -0.045em; font-weight: 700; text-transform: uppercase; margin: 0 0 3rem; }
.manifesto .shout em { font-style: normal; color: var(--signal); }
.manifesto .philosophy { grid-column: 7 / span 5; font-size: 1.05rem; color: var(--fg-muted); max-width: 560px; }
.manifesto .philosophy p:first-child { color: var(--fg); }
.manifesto .enter { grid-column: 1 / span 5; grid-row: 5; display: flex; flex-direction: column; gap: .8rem; align-self: end; }
.enter-btn { font-family: var(--mono); font-size: clamp(.9rem, 1.4vw, 1.1rem); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 1rem;
  padding: 1.1em 1.4em; background: var(--signal); color: var(--signal-fg); width: max-content; transition: gap .15s, background .15s; }
.enter-btn:hover { background: var(--fg); color: var(--bg); gap: 1.6rem; }
.enter-sub { font-family: var(--mono); font-size: .74rem; color: var(--fg-muted); letter-spacing: .06em; }
.enter-sub a { border-bottom: 1px solid var(--rule-strong); }
@media (max-width: 900px) { .manifesto .philosophy, .manifesto .enter { grid-column: 1 / -1; grid-row: auto; } .manifesto .enter { margin-top: 2rem; } }

/* player strip: instrument readout */
.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-bottom: 1px solid var(--rule); }
.readout > div { padding: 1.1rem var(--gutter) 1.2rem; border-right: 1px solid var(--rule); }
.readout > div:last-child { border-right: 0; }
.readout .val { font-family: var(--mono); font-size: 1.7rem; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: .3rem; }
.readout .val small { font-size: .55em; color: var(--fg-muted); font-weight: 400; }

/* section headers */
.section-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; padding: 4rem var(--gutter) 1.4rem; border-bottom: 1px solid var(--rule); }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); text-transform: uppercase; letter-spacing: -0.035em; margin: 0; line-height: .95; }
.section-head .label { margin-bottom: .8rem; display: block; }

/* ---------- the tree ---------- */
.tree-stage { position: relative; border-bottom: 1px solid var(--rule); background:
  radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--tree) 22%, transparent), transparent 60%), var(--bg); }
.tree-wrap { overflow-x: auto; }
.neem { width: 100%; height: auto; display: block; min-width: 860px; }
.neem .trunk { stroke: var(--tree); fill: none; stroke-linecap: round; }
.neem .branch { stroke: var(--tree); fill: none; stroke-linecap: round; transition: stroke .4s; }
.neem .branch.done { stroke: var(--grown); }
.neem .twig { stroke: var(--tree); fill: none; stroke-width: 1; opacity: .9; transition: stroke .4s, stroke-width .4s; }
.neem .twig.grown { stroke: var(--tree-bright); stroke-width: 1.6; }
.neem .twig.done { stroke: var(--grown); stroke-width: 2; }
.neem .ground { stroke: var(--rule-strong); stroke-width: 1; }
.neem .phase-num { font-family: var(--mono); font-size: 44px; font-weight: 700; fill: var(--fg); letter-spacing: -2px; }
.neem .phase-name { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; fill: var(--fg-muted); text-transform: uppercase; }
.neem .phase-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; fill: var(--fg-faint); }
.neem .topic-name { font-family: var(--mono); font-size: 8.5px; letter-spacing: .6px; fill: var(--fg-faint); text-transform: uppercase; pointer-events: none; }
.neem .cluster:hover .topic-name { fill: var(--fg); }
.leaf { cursor: pointer; }
.leaf .l { transition: r .2s, fill .2s, opacity .2s; }
.leaf-dormant .l { fill: var(--fg-faint); opacity: .32; }
.leaf-seen .l { fill: none; stroke: var(--fg-muted); stroke-width: 1; opacity: .9; }
.leaf-attempted .l { fill: var(--signal); opacity: .85; }
.leaf-solved .l { fill: var(--grown); }
.leaf-mastered .l { fill: var(--grown); filter: drop-shadow(0 0 3px var(--grown)); }
.leaf-core .l { stroke: var(--fg); stroke-width: 1.2; }
.leaf-dormant.leaf-core .l { opacity: .7; fill: var(--bg); }
.leaf-competitive .ring { fill: none; stroke: var(--signal); stroke-width: 1.2; }
.cluster:hover .leaf-dormant .l { opacity: .6; }
.leaf:hover .l { fill: var(--signal); opacity: 1; stroke: var(--fg); }
.leaf.just .l { animation: leaf-grow 1.4s cubic-bezier(.2, .9, .2, 1.2) both; }
.leaf.just .burst { animation: leaf-burst 1.4s ease-out both; fill: none; stroke: var(--grown); }
@keyframes leaf-grow { 0% { transform: scale(0); } 55% { transform: scale(2.2); } 100% { transform: scale(1); } }
@keyframes leaf-burst { 0% { r: 2; opacity: 1; stroke-width: 2; } 100% { r: 26; opacity: 0; stroke-width: .2; } }
.leaf .l, .leaf .burst { transform-box: fill-box; transform-origin: center; }
.tree-tip { position: absolute; pointer-events: none; background: var(--bg-elev); border: 1px solid var(--rule-strong); padding: .7rem .8rem; font-family: var(--mono); font-size: .72rem; min-width: 220px; max-width: 300px; z-index: 5; opacity: 0; transition: opacity .12s; }
.tree-tip.show { opacity: 1; }
.tree-tip .t-num { color: var(--fg-muted); letter-spacing: .1em; }
.tree-tip .t-title { font-family: var(--display); font-size: .95rem; font-weight: 600; margin: .25rem 0 .45rem; color: var(--fg); letter-spacing: -0.01em; }
.tree-tip .t-row { display: flex; justify-content: space-between; gap: 1rem; color: var(--fg-muted); }
.tree-tip .t-row b { color: var(--fg); font-weight: 500; }
.tree-legend { display: flex; flex-wrap: wrap; gap: 1.4rem; padding: 1rem var(--gutter); border-top: 1px solid var(--rule); font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); }
.tree-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .5em; vertical-align: 0; }
.tree-legend .dormant { background: var(--fg-faint); opacity: .5; } .tree-legend .seen { border: 1px solid var(--fg-muted); }
.tree-legend .attempted { background: var(--signal); } .tree-legend .solved { background: var(--grown); }
.tree-legend .mastered { background: var(--grown); box-shadow: 0 0 5px var(--grown); } .tree-legend .core { border: 1.5px solid var(--fg); }
.tree-legend .competitive { border: 1.5px solid var(--signal); }

/* ---------- territories (phases) as editorial rows ---------- */
.territories { border-bottom: 1px solid var(--rule); }
.territory { display: grid; grid-template-columns: minmax(90px, 1.4fr) 4fr 3fr 2fr auto; gap: 1.5rem; align-items: start; padding: 2rem var(--gutter); border-top: 1px solid var(--rule); transition: background .2s; }
.territory:first-child { border-top: 0; }
.territory:hover { background: var(--bg-elev); }
.territory .t-num { font-family: var(--mono); font-size: clamp(3rem, 6vw, 5.4rem); font-weight: 700; line-height: .82; letter-spacing: -0.06em; color: var(--fg-faint); transition: color .2s; }
.territory:hover .t-num { color: var(--fg); }
.territory.done .t-num { color: var(--grown); }
.territory h3 { font-size: clamp(1.3rem, 2.2vw, 1.9rem); text-transform: uppercase; letter-spacing: -0.025em; line-height: .98; margin: 0 0 .7rem; }
.territory .level { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.territory .concepts { font-family: var(--mono); font-size: .72rem; color: var(--fg-muted); line-height: 1.8; }
.territory .stats { font-family: var(--mono); font-size: .76rem; line-height: 1.9; }
.territory .stats b { font-weight: 500; font-size: 1.05rem; }
.territory .actions { display: flex; flex-direction: column; gap: .4rem; align-items: stretch; }
.meter { height: 2px; background: var(--rule-strong); margin-top: .7rem; position: relative; }
.meter > div { position: absolute; inset: 0 auto 0 0; background: var(--grown); transition: width .6s; }
@media (max-width: 960px) { .territory { grid-template-columns: 80px 1fr; } .territory .concepts, .territory .stats, .territory .actions { grid-column: 2; } .territory .actions { flex-direction: row; } }

.principles { padding: 5rem var(--gutter); display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5rem; border-bottom: 1px solid var(--rule); }
.principles .lines { grid-column: 1 / span 7; font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 700; line-height: .95; letter-spacing: -0.04em; text-transform: uppercase; }
.principles .lines span { display: block; }
.principles .lines span:nth-child(3) { color: var(--signal); }
.principles .loop { grid-column: 8 / -1; align-self: end; font-family: var(--mono); font-size: .8rem; color: var(--fg-muted); line-height: 2; }
.principles .loop b { color: var(--fg); font-weight: 500; }
@media (max-width: 900px) { .principles .lines, .principles .loop { grid-column: 1 / -1; } }
.footer { padding: 2rem var(--gutter) 3rem; color: var(--fg-faint); font-family: var(--mono); font-size: .7rem; letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.footer a { border-bottom: 1px solid var(--rule-strong); }

/* ---------- phase page ---------- */
.phase-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: end; padding: 3.5rem var(--gutter) 2rem; border-bottom: 1px solid var(--rule); }
.phase-hero .big-num { font-family: var(--mono); font-size: clamp(5rem, 12vw, 10rem); font-weight: 700; line-height: .78; letter-spacing: -0.07em; }
.phase-hero h1 { text-transform: uppercase; letter-spacing: -0.04em; margin: .3rem 0 .6rem; }
.phase-hero .side { font-family: var(--mono); font-size: .76rem; text-align: right; line-height: 1.9; min-width: 200px; }
@media (max-width: 860px) { .phase-hero { grid-template-columns: 1fr; } .phase-hero .side { text-align: left; } }
.tabs { display: flex; gap: 2rem; border-bottom: 1px solid var(--rule); padding: 0 var(--gutter); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .9em 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--signal); }
.tabs button:hover { color: var(--fg); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.tutorial-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem; align-items: start; padding: 2.5rem var(--gutter) 5rem; }
.toc { position: sticky; top: calc(var(--header-h) + 1.5rem); font-family: var(--mono); font-size: .72rem; }
.toc a { display: block; padding: .35em 0 .35em .8em; color: var(--fg-muted); border-left: 1px solid var(--rule); }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--fg); border-left: 2px solid var(--signal); padding-left: calc(.8em - 1px); }
.prose { max-width: 760px; font-size: 1rem; line-height: 1.65; }
.prose h1 { font-size: 2.4rem; text-transform: uppercase; letter-spacing: -0.035em; }
.prose h2 { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: 1.55rem; }
.prose h3 { margin-top: 1.6rem; }
.prose li { margin-bottom: .3em; }
.prose .problem-link { font-family: var(--mono); font-size: .9em; text-decoration: none; border-bottom: 1px solid var(--signal); }
.prose .problem-link::before { content: "▸ "; color: var(--signal); }
@media (max-width: 900px) { .tutorial-layout { grid-template-columns: 1fr; } .toc { display: none; } }

.filter-bar { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: end; padding: 1.4rem var(--gutter) 1rem; }
.filter-input[type=search] { min-width: 240px; flex: 1; }
.problem-table { font-size: .92rem; }
.problem-table th:first-child, .problem-table td:first-child { padding-left: var(--gutter); }
.problem-table th:last-child, .problem-table td:last-child { padding-right: var(--gutter); text-align: right; }
.problem-table tbody tr { transition: background .12s; }
.problem-table tbody tr:hover { background: var(--bg-elev); }
.problem-table tbody tr:hover .play { color: var(--signal); }
.problem-table .pnum { font-family: var(--mono); font-size: .76rem; color: var(--fg-faint); width: 7rem; }
.problem-table .ptitle a { font-weight: 500; }
.problem-table .prating { font-family: var(--mono); font-size: .8rem; }
.problem-table .play { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--fg-muted); }
.state-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.state-dormant { background: var(--fg-faint); opacity: .4; } .state-seen { border: 1px solid var(--fg-muted); }
.state-attempted { background: var(--signal); } .state-solved { background: var(--grown); } .state-mastered { background: var(--grown); box-shadow: 0 0 6px var(--grown); }

/* ---------- problem workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(360px, 42%) 1fr; height: calc(100vh - var(--header-h)); }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane-left { border-right: 1px solid var(--rule); }
.problem-head { padding: 1.2rem 1.4rem 1rem; border-bottom: 1px solid var(--rule); }
.problem-nav { display: flex; gap: 1rem; align-items: center; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 1rem; }
.problem-nav a:hover { color: var(--fg); }
.piece-num { font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; color: var(--fg-muted); }
.problem-head h1 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); text-transform: uppercase; letter-spacing: -0.035em; margin: .3rem 0 .9rem; line-height: .95; }
.piece-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: .3rem 2rem; font-family: var(--mono); font-size: .72rem; }
.piece-stats .k { color: var(--fg-muted); letter-spacing: .12em; text-transform: uppercase; font-size: .64rem; }
.piece-stats .v { font-size: .95rem; font-variant-numeric: tabular-nums; }
.piece-concepts { margin-top: .8rem; }
.pane-left .tabs { padding: 0 1.4rem; gap: 1.6rem; }
.tab-body { flex: 1; overflow: auto; padding: 1.4rem 1.4rem 3rem; }
.tab-body .prose { font-size: .95rem; }
.goals li { margin-bottom: .45em; }
.hint { border-top: 1px solid var(--rule); padding: .8rem 0; }
.hint:last-child { border-bottom: 1px solid var(--rule); }
.hint summary { cursor: pointer; font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.hint[open] summary { color: var(--signal); }
.editor-toolbar { display: flex; gap: .6rem; align-items: center; padding: .55rem 1rem; border-bottom: 1px solid var(--rule); }
.status { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--fg-muted); display: flex; align-items: center; gap: .5em; text-transform: uppercase; }
.status .dot { width: 6px; height: 6px; background: var(--fg-muted); }
.status.ready .dot { background: var(--grown); } .status.running .dot, .status.loading .dot { background: var(--signal); animation: pulse .9s infinite; } .status.error .dot { background: var(--danger); }
.lang-status { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; color: var(--fg-faint); text-transform: uppercase; }
.lang-status b { color: var(--fg-muted); font-weight: 500; }
@keyframes pulse { 50% { opacity: .25; } }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 500; letter-spacing: .02em; padding: 0 .6rem; border-left: 1px solid var(--rule); }
.clock.best::after { content: " PB"; font-size: .6rem; color: var(--grown); letter-spacing: .1em; }
.clock.stopped { color: var(--grown); }
#editor { flex: 1 1 58%; min-height: 220px; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--ed-bg); }
#editor .cm-editor { height: 100%; }
.editor-fallback { width: 100%; height: 100%; border: 0; resize: none; padding: 1rem; font-family: var(--mono); font-size: 14px; line-height: 1.6; background: var(--ed-bg); color: var(--fg); outline: none; tab-size: 4; }
.editor-keys { font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; color: var(--fg-faint); padding: .35rem 1rem; border-bottom: 1px solid var(--rule); display: flex; gap: 1.2rem; flex-wrap: wrap; }
.editor-keys kbd { color: var(--fg-muted); }
.cm-type-tip { padding: .5rem .7rem; max-width: 520px; }
.cm-type-head { color: var(--fg); white-space: pre-wrap; }
.cm-type-doc { color: var(--fg-muted); margin-top: .4rem; white-space: pre-wrap; font-size: .92em; }
.output { flex: 1 1 42%; min-height: 170px; display: flex; flex-direction: column; }
.output .tabs { padding: 0 1rem; gap: 1.6rem; }
.output-body { flex: 1; overflow: auto; padding: 1rem; font-size: .9rem; }
.output-body pre { margin: 0 0 .6rem; white-space: pre-wrap; word-break: break-word; }
.stdin-box { width: 100%; resize: vertical; min-height: 44px; margin: .3rem 0 .8rem; border: 1px solid var(--fg-faint); padding: .5em; }
.summary { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; padding: .7rem .9rem; margin-bottom: .9rem; border-left: 3px solid; }
.summary.pass { border-color: var(--grown); background: var(--grown-soft); color: var(--grown); }
.summary.fail { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.summary.warn { border-color: var(--signal); background: var(--signal-soft); color: var(--signal); }
.test { border-top: 1px solid var(--rule); }
.test:last-of-type { border-bottom: 1px solid var(--rule); }
.test summary { display: flex; gap: .8rem; align-items: center; padding: .55rem 0; cursor: pointer; list-style: none; font-family: var(--mono); font-size: .78rem; }
.test summary::-webkit-details-marker { display: none; }
.test .mark { width: 1.2em; text-align: center; font-weight: 700; }
.test.pass .mark { color: var(--grown); } .test.fail .mark { color: var(--danger); }
.test .detail { padding: .2rem 0 .9rem 2rem; }
.test .detail .lbl { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: var(--fg-muted); margin: .5rem 0 .2rem; }
.solved-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 1rem 1.1rem; margin-bottom: 1rem; border: 1px solid var(--grown); background: var(--grown-soft); animation: pop .35s ease-out; }
.solved-banner .sb-time { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--grown); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.solved-banner .sb-text { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .pane-left { border-right: 0; border-bottom: 1px solid var(--rule); }
  .tab-body { max-height: 55vh; }
  #editor { min-height: 320px; height: 48vh; }
  .output { min-height: 280px; }
  .piece-stats { grid-template-columns: repeat(2, auto); }
}
kbd { font-size: .92em; }

/* ---------- paths ---------- */
.path-rows { border-bottom: 1px solid var(--rule); }
.path-row { display: grid; grid-template-columns: 120px 1fr 280px auto; gap: 2rem; align-items: start; padding: 2.2rem var(--gutter); border-top: 1px solid var(--rule); }
.path-row.active { background: var(--bg-elev); }
.path-row .p-letter { font-family: var(--mono); font-size: 4.2rem; font-weight: 700; line-height: .8; letter-spacing: -0.06em; color: var(--fg-faint); }
.path-row.active .p-letter { color: var(--signal); }
.path-row h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); text-transform: uppercase; letter-spacing: -0.035em; margin: .2rem 0 .6rem; line-height: .95; }
.path-row .p-stats { font-family: var(--mono); font-size: .76rem; line-height: 1.9; }
@media (max-width: 960px) { .path-row { grid-template-columns: 70px 1fr; } .path-row .p-stats, .path-row .p-act { grid-column: 2; } }
.plan { padding: 1rem var(--gutter) 5rem; }
.path-phase { display: grid; grid-template-columns: 120px 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.path-phase .pp-num { font-family: var(--mono); font-size: 3rem; font-weight: 700; letter-spacing: -0.06em; line-height: .8; }
.path-list { display: flex; flex-direction: column; margin: .6rem 0 1.4rem; }
.path-list .label { margin-bottom: .4rem; }
.path-item { display: grid; grid-template-columns: 1.6em 6.5em 1fr auto auto; gap: .9rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.path-item:hover { color: var(--fg); background: var(--bg-elev); }
.path-item .mark { font-family: var(--mono); color: var(--fg-faint); text-align: center; }
.path-item.done .mark { color: var(--grown); }
.path-item.done .it-title { color: var(--fg-muted); }
.path-item .it-num, .path-item .it-rating { font-family: var(--mono); font-size: .74rem; color: var(--fg-faint); }
@media (max-width: 700px) { .path-phase { grid-template-columns: 1fr; } .path-item { grid-template-columns: 1.4em 1fr auto; } .path-item .it-num, .path-item .it-rating { display: none; } }

/* ---------- arena / boards ---------- */
.arena-hero { padding: 4rem var(--gutter) 2.5rem; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; }
.arena-hero h1 { font-size: clamp(3rem, 8vw, 7.4rem); text-transform: uppercase; letter-spacing: -0.05em; line-height: .85; margin: 0; }
.arena-hero .rules { font-family: var(--mono); font-size: .78rem; line-height: 1.9; color: var(--fg-muted); }
.arena-hero .rules b { color: var(--fg); font-weight: 500; }
@media (max-width: 860px) { .arena-hero { grid-template-columns: 1fr; } }
.arena-forms { display: grid; grid-template-columns: 1.3fr 1fr; border-bottom: 1px solid var(--rule); }
.board-form { padding: 2rem var(--gutter) 2.4rem; display: flex; flex-direction: column; gap: 1rem; border-right: 1px solid var(--rule); }
.board-form:last-child { border-right: 0; }
.board-form h2 { text-transform: uppercase; letter-spacing: -0.03em; font-size: 1.6rem; margin: 0; }
.board-form .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem 1.5rem; }
.board-form .opt { display: flex; gap: .5rem; align-items: center; font-family: var(--mono); font-size: .76rem; cursor: pointer; }
.board-form .opt input { accent-color: var(--signal); }
.code-input { font-family: var(--mono) !important; font-size: 2.6rem !important; letter-spacing: .4em; text-transform: uppercase; width: 100%; font-weight: 700; }
@media (max-width: 860px) { .arena-forms { grid-template-columns: 1fr; } .board-form { border-right: 0; border-bottom: 1px solid var(--rule); } }
.board-top { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; padding: 2.4rem var(--gutter) 1.6rem; border-bottom: 1px solid var(--rule); }
.board-top .b-title { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-muted); }
.board-top .b-title b { color: var(--fg); }
.board-top h1 { text-transform: uppercase; letter-spacing: -0.04em; margin: .5rem 0 0; }
.big-clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(3.6rem, 11vw, 9rem); font-weight: 700; letter-spacing: -0.05em; line-height: .85; text-align: right; }
.big-clock.low { color: var(--signal); }
.big-clock.idle { color: var(--fg-faint); }
.board-status { display: flex; gap: 2rem; flex-wrap: wrap; padding: .9rem var(--gutter); border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
.board-status .ok::before, .board-status .bad::before, .board-status .wait::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .6em; }
.board-status .ok::before { background: var(--grown); } .board-status .bad::before { background: var(--danger); } .board-status .wait::before { background: var(--signal); animation: pulse .9s infinite; }
.board-status .ok, .board-status .bad, .board-status .wait { color: var(--fg); }
.board-grid { display: grid; grid-template-columns: 1fr 1.3fr; }
.board-grid > section { padding: 1.6rem var(--gutter) 3rem; }
.board-grid > section:first-child { border-right: 1px solid var(--rule); }
@media (max-width: 900px) { .board-grid { grid-template-columns: 1fr; } .board-grid > section:first-child { border-right: 0; border-bottom: 1px solid var(--rule); } }
.scoreboard { display: flex; flex-direction: column; }
.score-row { display: grid; grid-template-columns: 2.4rem 1fr auto auto; gap: .4rem 1.2rem; align-items: baseline; padding: 1rem 0 .9rem; border-bottom: 1px solid var(--rule); transition: background .4s; }
.score-row.me .s-name { color: var(--signal); }
.score-row.moved { background: var(--signal-soft); }
.score-row.out { opacity: .45; }
.score-row .s-rank { font-family: var(--mono); font-size: .9rem; color: var(--fg-muted); }
.score-row .s-name { font-weight: 600; font-size: 1.25rem; text-transform: uppercase; letter-spacing: -0.02em; }
.score-row .s-solved { font-family: var(--mono); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.score-row .s-time { font-family: var(--mono); font-size: .8rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.score-row .s-bar { grid-column: 2 / -1; font-family: var(--mono); font-size: .8rem; letter-spacing: 1px; color: var(--grown); white-space: nowrap; overflow: hidden; }
.score-row .s-bar .rest { color: var(--rule-strong); }
.score-row .s-note { grid-column: 2 / -1; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--danger); }
.board-problems .path-item { grid-template-columns: 1.6em 1fr auto auto; }

/* ---------- competition focus guard ---------- */
.focus-warning { position: fixed; top: calc(var(--header-h) + 10px); left: 50%; transform: translateX(-50%); background: var(--signal); color: var(--signal-fg); padding: .7em 1.2em; font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; z-index: 60; }
.focus-overlay { position: fixed; inset: 0; background: rgba(6, 7, 6, .92); z-index: 70; display: grid; place-items: center; padding: 1rem; }
.focus-card { max-width: 520px; }
.focus-card h2 { font-size: clamp(2.6rem, 7vw, 5rem); text-transform: uppercase; letter-spacing: -0.05em; color: var(--danger); margin-bottom: 1rem; }
.focus-card p { color: var(--fg-muted); }

/* highlight.js (lessons) */
.hljs-keyword, .hljs-built_in { color: var(--syn-keyword); }
.hljs-string { color: var(--syn-string); }
.hljs-number, .hljs-literal { color: var(--syn-number); }
.hljs-comment { color: var(--syn-comment); font-style: italic; }
.hljs-title.function_, .hljs-title, .hljs-title.class_ { color: var(--syn-class); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- board states & leader console ---------- */
.big-clock.words { font-size: clamp(2rem, 5.4vw, 4.6rem); text-transform: uppercase; letter-spacing: -0.03em; line-height: .95; max-width: 9em; }
.board-top .b-sub { margin-top: .8rem; text-transform: none; letter-spacing: .04em; font-size: .74rem; }
.presence { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--fg-faint); }
.presence.on { background: var(--grown); border-color: var(--grown); box-shadow: 0 0 6px var(--grown); }
.waiting { padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.waiting .w-big { font-size: clamp(1.6rem, 3.2vw, 2.6rem); font-weight: 700; text-transform: uppercase; letter-spacing: -0.035em; line-height: .95; margin-bottom: .8rem; }
.leader-console { padding: 2rem var(--gutter) 4rem; border-top: 1px solid var(--rule); }
.leader-console:empty { display: none; }
.lc-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lc-head h2 { text-transform: uppercase; letter-spacing: -0.03em; margin: .3rem 0 0; }
.lc-scroll { overflow-x: auto; margin-bottom: .8rem; }
.lc-table { font-size: .86rem; min-width: 640px; }
.lc-table td.num, .lc-table th { white-space: nowrap; }
.lc-table td.hit { color: var(--grown); }
.lc-table tr.out td { opacity: .55; }
.leave-dialog .focus-card h2 { color: var(--signal); }

/* =====================================================================
   2027 arena layer: HUD frames, cut corners, restrained glow, motion that means something
   ===================================================================== */
.btn { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); transition: background .15s, color .15s, box-shadow .2s, border-color .15s; }
.btn-sm { --cut: 7px; }
.btn-primary { background: var(--grown); border-color: var(--grown); color: var(--signal-fg); }
.btn-primary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); box-shadow: 0 0 22px var(--accent-glow); }
.enter-btn { background: var(--grown); color: var(--signal-fg); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); }
.enter-btn:hover { box-shadow: 0 0 40px var(--accent-glow); }
.manifesto .shout em { color: var(--grown); text-shadow: 0 0 36px var(--accent-glow); }
.main-nav a.active { border-bottom-color: var(--grown); }
.tabs button.active { border-bottom-color: var(--grown); }
.toc a.active { border-left-color: var(--grown); }
.prose .problem-link { border-bottom-color: var(--grown); }
.prose .problem-link::before { color: var(--grown); }
.meter > div { background: linear-gradient(90deg, var(--tree-bright), var(--grown)); box-shadow: 0 0 10px var(--accent-glow); }
blockquote { border-left-color: var(--grown); background: var(--grown-soft); }
::selection { background: var(--grown); color: var(--signal-fg); }
:focus-visible { outline-color: var(--grown); }
.warn-text { color: var(--signal); }
.territory .level, .path-row.active .p-letter { color: var(--grown); }
.big-clock.low { color: var(--signal); text-shadow: 0 0 40px var(--signal-glow); }
.badge-hard { color: var(--signal); } .badge-hard::before { background: var(--signal); border-color: var(--signal); }
.tag { color: var(--grown); }

/* HUD frame: four corner ticks, no boxes */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; border-color: var(--grown); opacity: .75; }
.hud::before { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.hud::after { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }

/* scan sweep on the hero (one slow pass, then still) */
.manifesto::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0%, var(--grown-soft) 50%, transparent 100%); background-size: 100% 240px; background-repeat: no-repeat; animation: sweep 3.2s cubic-bezier(.3,.1,.3,1) .3s 1 both; opacity: .6; }
@keyframes sweep { from { background-position: 0 -240px; } to { background-position: 0 120%; } }

/* header HUD chip */
.hud-chip { display: inline-flex; align-items: center; gap: .8rem; padding: .35rem .7rem; border: 1px solid var(--rule-strong); font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--fg-muted); clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); }
.hud-chip:hover { color: var(--fg); border-color: var(--grown); }
.hud-lv b { color: var(--fg); margin-left: .25em; font-weight: 700; }
.hud-xp { width: 64px; height: 3px; background: var(--rule-strong); position: relative; overflow: hidden; }
.hud-xp i { position: absolute; inset: 0 auto 0 0; background: var(--grown); box-shadow: 0 0 8px var(--accent-glow); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.hud-rating { color: var(--fg); }
.hud-streak.on { color: var(--signal); }
@media (max-width: 1100px) { .hud-xp, .hud-rating { display: none; } }

/* settings dialog */
.settings { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin-top: .6rem; }
.theme-tile { text-align: left; padding: .9rem; border: 1px solid; cursor: pointer; display: flex; flex-direction: column; gap: .4rem; font: inherit; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.theme-tile.auto { background: linear-gradient(135deg, #f2f3ef 50%, #14171d 50%); color: #23251d; border-color: var(--rule-strong); }
.theme-tile.auto .tt-note { color: #555a52; background: rgba(242,243,239,.85); padding: .2em .3em; }
.theme-tile.active { box-shadow: 0 0 0 1px var(--grown), 0 0 24px var(--accent-glow); }
.tt-name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.tt-note { font-size: .74rem; line-height: 1.4; }
.tt-swatches { display: flex; gap: .3rem; }
.tt-swatches i { width: 14px; height: 14px; display: inline-block; }
.custom-row { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: end; margin: .6rem 0; }
.color-in { display: flex; flex-direction: column; gap: .3rem; }
.color-in input[type=color] { width: 72px; height: 36px; border: 1px solid var(--fg-faint); background: none; padding: 2px; cursor: pointer; }
.contrast-read { padding: .7rem .9rem; border: 1px solid var(--rule); background: var(--bg-sunk); margin-top: .4rem; }
.comfort { display: flex; flex-direction: column; gap: .7rem; margin-top: .6rem; }
.comfort input[type=range] { accent-color: var(--grown); width: 180px; }
.opt input[type=checkbox] { accent-color: var(--grown); }
#editor .cm-scroller { font-size: var(--editor-size) !important; }

/* tree: structure in the accent's dark tint, solved = lit accent, arena = signal */
.neem .trunk { stroke: var(--tree); }
.neem .branch { stroke: var(--tree); }
.neem .branch.done { stroke: var(--grown); filter: drop-shadow(0 0 4px var(--accent-glow)); }
.neem .twig { stroke: var(--tree); }
.neem .twig.grown { stroke: var(--tree-bright); }
.neem .twig.done { stroke: var(--grown); }
.leaf-attempted .l { fill: var(--signal); opacity: .7; }
.leaf-solved .l { fill: var(--grown); }
.leaf-mastered .l { fill: var(--fg); filter: drop-shadow(0 0 3px var(--grown)) drop-shadow(0 0 6px var(--accent-glow)); }
.leaf-competitive .ring { stroke: var(--signal); }
.leaf:hover .l { fill: var(--signal); }
.leaf.just .burst { stroke: var(--grown); }
.tree-stage { background: radial-gradient(ellipse at 50% 100%, var(--grown-soft), transparent 62%); }
.tree-legend .solved { background: var(--grown); } .tree-legend .mastered { background: var(--fg); box-shadow: 0 0 6px var(--grown); }
.tree-legend .attempted { background: var(--signal); } .tree-legend .competitive { border-color: var(--signal); }
.state-solved { background: var(--grown); } .state-mastered { background: var(--fg); box-shadow: 0 0 6px var(--grown); } .state-attempted { background: var(--signal); }

/* stars */
.stars { font-family: var(--mono); letter-spacing: .1em; color: var(--fg-faint); white-space: nowrap; }
.stars .on { color: var(--grown); text-shadow: 0 0 8px var(--accent-glow); }

/* ---------- debrief (post-solve) ---------- */
.debrief { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(3px); animation: fadein .2s ease-out; padding: 1rem; }
@keyframes fadein { from { opacity: 0; } }
.db-card { width: min(720px, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: var(--bg-elev); border: 1px solid var(--rule-strong); padding: 1.6rem 1.8rem 1.4rem; }
.db-top { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.db-kicker { font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--grown); }
.db-title { font-size: clamp(1.8rem, 4vw, 2.8rem); text-transform: uppercase; letter-spacing: -0.04em; line-height: .92; margin: .4rem 0 .2rem; }
.db-time { font-family: var(--mono); font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; text-align: right; }
.db-time small { display: block; font-size: .66rem; font-weight: 400; letter-spacing: .12em; color: var(--fg-muted); }
.db-stars { font-size: 2rem; margin: .6rem 0 1rem; letter-spacing: .25em; }
.db-stars span { display: inline-block; color: var(--fg-faint); transform: scale(.6); opacity: .4; transition: transform .35s cubic-bezier(.2,1.6,.4,1), opacity .2s, color .2s; }
.db-stars span.on { color: var(--grown); transform: scale(1); opacity: 1; text-shadow: 0 0 18px var(--accent-glow); }
.db-items { border-top: 1px solid var(--rule); margin: .4rem 0 1rem; }
.db-item { display: grid; grid-template-columns: 1fr auto; padding: .45rem 0; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .82rem; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }
.db-item.show { opacity: 1; transform: none; }
.db-item b { font-weight: 500; color: var(--grown); }
.db-item.hot b, .db-item.quest b { color: var(--signal); }
.db-item.pattern span::before { content: "◇ "; color: var(--signal); }
.db-total { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.db-total .xp { font-family: var(--mono); font-size: 2rem; font-weight: 700; color: var(--grown); font-variant-numeric: tabular-nums; }
.db-level { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; color: var(--fg-muted); }
.db-level .bar { height: 4px; background: var(--rule-strong); margin-top: .4rem; position: relative; overflow: hidden; width: 260px; max-width: 60vw; }
.db-level .bar i { position: absolute; inset: 0 auto 0 0; background: var(--grown); box-shadow: 0 0 10px var(--accent-glow); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.db-rating { font-family: var(--mono); font-size: .8rem; }
.db-rating .up { color: var(--grown); } .db-rating .down { color: var(--danger); }
.db-style { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: .4rem 0 1rem; }
.db-style div { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
.db-style b { display: block; font-size: 1.3rem; color: var(--fg); letter-spacing: 0; margin-top: .2rem; }
.db-notes { font-size: .84rem; color: var(--fg-muted); margin: 0 0 1rem; padding-left: 1.1rem; }
.db-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.badge-card { border: 1px solid var(--signal); padding: .55rem .8rem; font-family: var(--mono); font-size: .74rem; background: var(--signal-soft); animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; }
.badge-card b { display: block; font-family: var(--display); font-size: .95rem; color: var(--fg); letter-spacing: -0.01em; }
.levelup { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--signal); animation: pop .6s cubic-bezier(.2,1.6,.4,1) both; }
.db-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- rest break (20-20-20) ---------- */
.rest-card { text-align: center; }
.rest-ring { width: 180px; height: 180px; margin: 1rem auto; }
.rest-ring circle { fill: none; stroke-width: 3; }
.rest-ring .track { stroke: var(--rule-strong); }
.rest-ring .prog { stroke: var(--grown); stroke-linecap: square; transform: rotate(-90deg); transform-origin: center; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.rest-ring text { fill: var(--fg); font-family: var(--mono); font-size: 34px; font-weight: 700; }

/* ---------- today strip (home) ---------- */
.today { display: grid; grid-template-columns: 1.2fr 1fr; border-bottom: 1px solid var(--rule); }
.today > section { padding: 1.8rem var(--gutter) 2rem; }
.today > section:first-child { border-right: 1px solid var(--rule); }
.daily-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 1rem 1.1rem; margin-top: .8rem; }
.daily-card .x2 { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; color: var(--signal); letter-spacing: -0.04em; line-height: 1; text-shadow: 0 0 24px var(--signal-glow); }
.daily-card h3 { margin: 0 0 .2rem; font-size: 1.25rem; }
.daily-card.done .x2 { color: var(--grown); text-shadow: none; }
.quest { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.quest .q-xp { font-family: var(--mono); font-size: .74rem; color: var(--grown); }
.quest .q-bar { grid-column: 1 / -1; height: 2px; background: var(--rule-strong); position: relative; }
.quest .q-bar i { position: absolute; inset: 0 auto 0 0; background: var(--grown); }
.quest.done { color: var(--fg-muted); }
.quest.done .q-xp::before { content: "✓ "; }
@media (max-width: 900px) { .today { grid-template-columns: 1fr; } .today > section:first-child { border-right: 0; border-bottom: 1px solid var(--rule); } }

/* ---------- player card ---------- */
.player-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 2.4rem; align-items: center; padding: 3.2rem var(--gutter) 2.4rem; border-bottom: 1px solid var(--rule); }
.lv-ring { width: 170px; height: 170px; }
.lv-ring circle { fill: none; stroke-width: 4; }
.lv-ring .track { stroke: var(--rule-strong); }
.lv-ring .prog { stroke: var(--grown); transform: rotate(-90deg); transform-origin: center; filter: drop-shadow(0 0 8px var(--accent-glow)); transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.lv-ring .n { fill: var(--fg); font-family: var(--mono); font-size: 46px; font-weight: 700; }
.lv-ring .k { fill: var(--fg-muted); font-family: var(--mono); font-size: 10px; letter-spacing: 3px; }
.player-hero h1 { text-transform: uppercase; letter-spacing: -0.045em; margin: .3rem 0; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: .9; }
.player-hero .rating-big { font-family: var(--mono); font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -0.05em; text-align: right; }
.spark { width: 240px; height: 56px; display: block; margin-left: auto; }
.spark path { fill: none; stroke: var(--grown); stroke-width: 1.5; filter: drop-shadow(0 0 4px var(--accent-glow)); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 1rem 0 2rem; }
.trophy { background: var(--bg); padding: 1rem 1.1rem; min-height: 96px; }
.trophy b { display: block; font-size: 1rem; letter-spacing: -0.01em; margin-bottom: .3rem; }
.trophy span { font-size: .8rem; color: var(--fg-muted); }
.trophy .when { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; color: var(--grown); margin-top: .4rem; }
.trophy.locked { opacity: .45; }
.trophy.locked b::before { content: "□ "; color: var(--fg-faint); }
.trophy:not(.locked) b::before { content: "◆ "; color: var(--grown); }
.pattern-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 2rem; }
.pattern-chip { font-family: var(--mono); font-size: .74rem; padding: .4rem .7rem; border: 1px solid var(--rule-strong); }
.pattern-chip.found { border-color: var(--signal); color: var(--fg); background: var(--signal-soft); }
.pattern-chip.lost { color: var(--fg-faint); }
@media (max-width: 860px) { .player-hero { grid-template-columns: 1fr; } .player-hero .rating-big, .spark { text-align: left; margin-left: 0; } }

[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
.cat-tabs { display: flex; align-items: center; gap: 1.2rem; margin-bottom: .6rem; }
.cat-tab { background: none; border: 0; border-bottom: 1px solid transparent; padding: .2em 0; font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); cursor: pointer; }
.cat-tab.active { color: var(--fg); border-bottom-color: var(--grown); }
.cat-tab sup { color: var(--grown); margin-left: .2em; }
.lc-style { color: var(--signal); font-size: .75em; }
.piece-stats { grid-template-columns: repeat(3, auto); }
.theme-tile.auto { background: var(--bg-elev); color: var(--fg); border-color: var(--rule-strong); }
.theme-tile.auto .tt-note { color: var(--fg-muted); background: none; padding: 0; }
.db-items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.6rem; }
.db-item { font-size: .78rem; padding: .38rem 0; }
.db-card { width: min(780px, 100%); }
.badge-card { padding: .45rem .7rem; font-size: .7rem; }
.badge-card b { font-size: .88rem; }
.badge-card.more { border-style: dashed; }
.plan { padding-bottom: 2.4rem; }
@media (max-width: 700px) { .db-items { grid-template-columns: 1fr; } .db-style { grid-template-columns: repeat(2, 1fr); } }
.focus-overlay { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.challenge-bar { margin-top: .9rem; padding: .55rem .8rem; font-size: .86rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; background: var(--signal-soft); }
.challenge-bar b { color: var(--signal); }
.db-versus { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin: -.4rem 0 .8rem; }
.db-versus.won { color: var(--grown); } .db-versus.lost { color: var(--signal); }
.share-img { width: 100%; height: auto; border: 1px solid var(--rule-strong); margin: .6rem 0; display: block; }
.share-link { word-break: break-all; color: var(--fg-muted); margin-bottom: 1rem; }
.arena-bar { position: sticky; top: var(--header-h); z-index: 20; display: flex; gap: 1.2rem; align-items: center; padding: .4rem var(--gutter); background: var(--bg-elev); border-bottom: 1px solid var(--rule); }
.bar-clock { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-clock.low { color: var(--signal); }
.arena-workspace { height: calc(100vh - var(--header-h) - 46px); }
.preload span { color: var(--fg-faint); margin-right: .9rem; }
.preload span.on { color: var(--grown); }
button.path-item { background: none; border: 0; border-bottom: 1px solid var(--rule); color: var(--fg); font: inherit; text-align: left; cursor: pointer; width: 100%; }
button.path-item:disabled { cursor: default; opacity: .7; }
@media (max-width: 900px) { .arena-workspace { height: auto; } .arena-bar { gap: .6rem; flex-wrap: wrap; } }
.prerendered .problem-head h1 { margin: .3rem 0; }
.prerendered-list { columns: 2; padding: 1rem var(--gutter); }

/* ---------- Tutorial mode (js/tutor.js) */
.tutor-toggle svg { vertical-align: -3px; margin-right: .3rem; }
.tutor-toggle.on { color: var(--signal); border-color: var(--signal); background: color-mix(in srgb, var(--signal) 12%, transparent); }
/* Code together: the session bar above the editor */
.pair-toggle svg { vertical-align: -3px; margin-right: .3rem; }
.pair-toggle.on { color: var(--grown); border-color: var(--grown); background: var(--grown-soft); }
.pair-bar { display: flex; flex-wrap: wrap; gap: .45rem .7rem; align-items: center; padding: .45rem 1rem; border-bottom: 1px solid var(--rule); background: var(--grown-soft); font-size: .85rem; }
.pair-bar .label { color: var(--fg); }
.pair-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); }
.pair-dot.live { background: var(--grown); box-shadow: 0 0 6px var(--grown); }
.pair-dot.connecting, .pair-dot.reconnecting { background: var(--signal); animation: pair-pulse 1.2s ease-in-out infinite; }
@keyframes pair-pulse { 50% { opacity: .35; } }
.pair-peers { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.pair-peer { font-family: var(--mono); font-size: .78rem; padding: .05rem .45rem; border: 1px solid var(--peer); border-left-width: 4px; color: var(--fg); }
.pair-note { font-family: var(--mono); color: var(--fg-muted); }
@media (prefers-reduced-motion: reduce) { .pair-dot.connecting, .pair-dot.reconnecting { animation: none; } }

/* Arena: public boards anyone can join */
.public-boards { padding: 0 var(--gutter); margin: 1.5rem 0 0; }
.public-boards .pb-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.public-boards .pb-row { grid-template-columns: 6em minmax(0, 1fr) auto auto auto; }
.public-boards .pb-meta { font-family: var(--mono); font-size: .78rem; color: var(--fg-muted); }
.public-boards .pb-empty { color: var(--fg-muted); font-size: .9rem; margin: 0; }
@media (max-width: 640px) { .public-boards .pb-row { grid-template-columns: 5em minmax(0, 1fr) auto; } .public-boards .pb-row .pb-meta { display: none; } }
.tutor-guide { font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--fg-muted); padding: .5rem .8rem .6rem 0; border-bottom: 1px dashed var(--rule-strong); margin-bottom: .3rem; white-space: normal; }
.tutor-guide .tg-line { padding-left: 1.6em; text-indent: -1.6em; }
.tutor-guide .tg-hash { color: var(--fg-faint); }
.tutor-guide b { color: var(--fg); font-weight: 600; }
.tutor-guide .tg-muted { color: var(--fg-faint); }
.tg-chip { font: inherit; font-size: 12px; color: var(--signal); background: transparent; border: 1px solid color-mix(in srgb, var(--signal) 55%, transparent); border-radius: 3px; padding: 0 .45em; margin: 0 .25em .2em 0; cursor: pointer; text-indent: 0; }
.tg-chip:hover, .tg-chip:focus-visible { background: color-mix(in srgb, var(--signal) 16%, transparent); }
.tg-step { color: var(--grown); border-color: color-mix(in srgb, var(--grown) 55%, transparent); }
.cm-tutor-term { text-decoration: underline dotted color-mix(in srgb, var(--signal) 70%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.tutor-card { font-family: var(--sans, "Space Grotesk", sans-serif); font-size: 14px; line-height: 1.5; color: var(--fg); max-width: 460px; padding: .9rem 1rem; white-space: normal; }
.tutor-card.floating { position: fixed; z-index: 90; background: var(--bg-elev); border: 1px solid var(--rule-strong); box-shadow: 0 12px 40px rgba(0,0,0,.35); max-height: 70vh; overflow: auto; }
.tutor-card .tc-head { display: flex; align-items: center; gap: .5rem; }
.tutor-card h3 { font-family: var(--mono); font-size: 15px; margin: 0; flex: 1; }
.tutor-card p { margin: .5rem 0; }
.tutor-card .tc-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); margin-top: .7rem; }
.tutor-card .tc-code { font-family: var(--mono); font-size: 12.5px; background: var(--ed-bg); border: 1px solid var(--rule); padding: .5rem .7rem; margin: .3rem 0; overflow-x: auto; white-space: pre; }
.tutor-card .tc-pitfall { border-left: 3px solid var(--signal); padding-left: .6rem; }
.tutor-card .tc-lesson { border-top: 1px solid var(--rule); margin-top: .7rem; }
.tutor-card .tc-actions { display: flex; gap: .7rem; align-items: center; margin-top: .7rem; flex-wrap: wrap; }
.cm-tooltip .tutor-card { max-height: 60vh; overflow: auto; }

/* ---------- play first: one big action, reading is a quiet text link */
.btn-play { font-size: 1.15rem; padding: .95rem 2.2rem; letter-spacing: .12em; min-width: 11rem; justify-content: center; }
.play-first { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; }
.territory .play-first { align-items: stretch; }
.read-links { font-size: .8rem; color: var(--fg-muted); }
.read-links a, .linkish { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 3px; }
.read-links a:hover, .linkish:hover { color: var(--fg); }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.tutor-card code { font-family: var(--mono); font-size: .92em; background: var(--ed-bg); padding: 0 .25em; }

/* ---------- accessibility */
.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 200; background: var(--signal); color: var(--signal-fg); padding: .6rem 1rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.skip-link:focus { top: .5rem; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
[role="tabpanel"]:focus-visible, pre[tabindex]:focus-visible { outline-offset: -2px; }
.trophy.locked { opacity: 1; outline: 1px dashed var(--rule-strong); outline-offset: -1px; }
.trophy.locked b, .trophy.locked span { color: var(--fg-muted); }
@media (forced-colors: active) { .btn, .tg-chip, .cat-tab { border: 1px solid ButtonText; } .meter > div, .s-bar { forced-color-adjust: none; } }
.acc-edit { display: flex; flex-direction: column; gap: .4rem; min-width: 15rem; }
.tag-ai { color: var(--signal); border-color: var(--signal); }

/* ---------- arena server boot panel (js/relay.js) */
.relay-panel { margin: 1.2rem var(--gutter); padding: 1rem 1.2rem; border: 1px solid var(--rule-strong); background: var(--bg-elev); max-width: 760px; }
.relay-panel[data-phase="ready"] { padding: .5rem 1rem; border-color: var(--rule); }
.relay-panel[data-phase="ready"] .rp-bar, .relay-panel[data-phase="ready"] .rp-steps, .relay-panel[data-phase="ready"] .rp-clock { display: none; }
.relay-panel[data-phase="ready"] .rp-title::before { content: "● "; color: var(--grown); }
.relay-panel[data-phase="offline"] { border-color: var(--danger); }
.rp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.rp-title { font-family: var(--mono); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.rp-clock { font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.rp-bar { height: 3px; background: var(--rule); margin: .7rem 0; overflow: hidden; }
.rp-fill { height: 100%; width: 0; background: var(--signal); transition: width .25s linear; }
.relay-panel[data-phase="server"] .rp-fill { background: var(--grown); }
.rp-steps { list-style: none; margin: 0; padding: 0; font-size: .9rem; line-height: 1.9; }
.rp-steps li { color: var(--fg-muted); }
.rp-steps li.done { color: var(--fg); }
.rp-steps li.current { color: var(--fg); }
.rp-steps li.failed { color: var(--danger); }
.rp-mark { display: inline-block; width: 1.4em; font-family: var(--mono); }
.rp-steps li.done .rp-mark { color: var(--grown); }
.rp-steps li.current .rp-mark { color: var(--signal); }
@media (prefers-reduced-motion: reduce) { .rp-fill { transition: none; } }
.relay-panel[hidden], .relay-panel [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- cloud sync chip and dialog (js/cloud.js) */
.sync-chip { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); border-color: var(--rule-strong); }
.sync-chip[data-status="synced"] { color: var(--grown); border-color: color-mix(in srgb, var(--grown) 50%, transparent); }
.sync-chip[data-status="synced"]::before { content: "☁ "; }
.sync-chip[data-status="syncing"], .sync-chip[data-status="waiting"] { color: var(--signal); }
.sync-chip[data-status="offline"], .sync-chip[data-status="error"], .sync-chip[data-status="signedout"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.cloud-form { display: flex; flex-direction: column; gap: .7rem; max-width: 22rem; margin-top: .8rem; }
.cloud-form label { display: flex; flex-direction: column; gap: .25rem; }
.cloud-form input { background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid var(--fg-faint); padding: .5em .1em; font: inherit; font-family: var(--mono); }
.cloud-form input:focus { outline: none; border-bottom-color: var(--signal); box-shadow: 0 2px 0 var(--signal); }
.cloud-form .err:empty { display: none; }
#cloud-dialog .tabs { margin-top: .6rem; }

/* ---------- trophy icons (js/trophies.js) */
.trophy { display: grid; grid-template-columns: 52px 1fr; gap: .8rem; align-items: start; }
.trophy.locked b::before, .trophy:not(.locked) b::before { content: none; }
.trophy-art { display: block; width: 52px; height: 52px; }
.trophy-icon { width: 100%; height: 100%; overflow: visible; color: var(--grown); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.trophy-icon .ti-frame { fill: var(--grown-soft); stroke-width: 1.5; }
.trophy-icon .ti-ring { stroke-width: .8; opacity: .45; }
.trophy-icon .ti-tick { stroke-width: 2.4; }
.trophy-icon .ti-dot { fill: currentColor; stroke: none; }
.trophy-icon .ti-axis { stroke-dasharray: 2 2.2; opacity: .7; }
.trophy-icon .ti-strike { stroke: var(--signal); }
.trophy-icon .ti-label { fill: currentColor; stroke: none; font-family: var(--mono); font-size: 6.4px; font-weight: 700; letter-spacing: .04em; }
.trophy:not(.locked) .trophy-icon, .trophy-won .trophy-icon { filter: drop-shadow(0 0 5px var(--accent-glow)); }
.trophy.locked .trophy-icon { color: var(--fg-faint); filter: none; }
.trophy.locked .trophy-icon .ti-frame { fill: none; stroke-dasharray: 3 2.4; }
.trophy.locked .trophy-icon .ti-strike { stroke: currentColor; }
.badge-card.trophy-won { display: grid; grid-template-columns: 44px 1fr; gap: .7rem; align-items: center; }
.badge-card.trophy-won .trophy-art { width: 44px; height: 44px; }
@media (prefers-reduced-motion: no-preference) {
  .db-badges .trophy-won .trophy-icon { animation: trophy-in .6s cubic-bezier(.2, .9, .3, 1.4) both; }
  @keyframes trophy-in { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
}
