/* Chessbroz · estilos
   Oscuro por defecto; claro con data-theme="light" (o preferencia del sistema). */
:root {
  color-scheme: dark;
  --bg: #111315; --surface: #181b1e; --surface-2: #1f2327; --surface-3: #272c31; --line: #2c3237; --line-2: #3a4147;
  --ink: #ebe8e1; --ink-2: #aab0ac; --ink-3: #798079;
  --brand: #e0b347; --brand-ink: #16130b; --brand-soft: rgba(224, 179, 71, .13);
  --good: #6fbf73; --bad: #e5624f; --warn: #e39a3b; --info: #6aa7e0;
  --sq-light: #e9e4d2; --sq-dark: #769469; --sq-last: rgba(224, 179, 71, .5); --sq-sel: rgba(106, 167, 224, .5);
  --coord-light: #6d8762; --coord-dark: #eee9d8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .28);
  --f-disp: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --fig: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
  --p-teal: #3fa89f; --p-rust: #d06a45; --p-blue: #5a92dc; --p-olive: #95b04a;
  --side-w: 236px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #efede7; --surface: #ffffff; --surface-2: #f5f3ee; --surface-3: #ebe8e1; --line: #dcd8cf; --line-2: #c9c4b8;
  --ink: #1b1d1f; --ink-2: #555b58; --ink-3: #858a85;
  --brand: #b3841c; --brand-ink: #ffffff; --brand-soft: rgba(179, 132, 28, .12);
  --good: #3b8a44; --bad: #c4452f; --warn: #b8741c; --info: #2f6ca8;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 8px 24px rgba(20, 20, 20, .08);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    color-scheme: light;
    --bg: #efede7; --surface: #ffffff; --surface-2: #f5f3ee; --surface-3: #ebe8e1; --line: #dcd8cf; --line-2: #c9c4b8;
    --ink: #1b1d1f; --ink-2: #555b58; --ink-3: #858a85;
    --brand: #b3841c; --brand-ink: #ffffff; --brand-soft: rgba(179, 132, 28, .12);
    --good: #3b8a44; --bad: #c4452f; --warn: #b8741c; --info: #2f6ca8;
    --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 8px 24px rgba(20, 20, 20, .08);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body { color: var(--ink); font-family: var(--f-body); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- estructura ---------- */
#app { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px 14px; gap: 18px; overflow-y: auto; z-index: 20;
}
.main { min-height: 100vh; padding: 22px 26px 40px; }
.has-side .main { margin-left: var(--side-w); }
.mtop, .mbar { display: none; }

.wordmark { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
.wordmark .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex: 0 0 30px; }
.wordmark .mark img { width: 24px; height: 24px; }
.wordmark b { font-family: var(--f-disp); font-weight: 700; font-size: 25px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }

.me { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.me-top { display: flex; align-items: center; gap: 10px; }
.me-top .who b { display: block; font-size: 15.5px; line-height: 1.2; }
.me-top .who span { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); }
.swap { display: flex; gap: 6px; }
.swap button { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; opacity: .55; transition: opacity .15s; }
.swap button:hover, .swap button[aria-current="true"] { opacity: 1; }
.swap button[aria-current="true"] .av { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--pc, var(--brand)); }

.av { width: 38px; height: 38px; border-radius: 10px; background: var(--pc); color: #10110f; display: grid; place-items: center; font-family: var(--f-disp); font-weight: 700; font-size: 17px; letter-spacing: .02em; flex: 0 0 auto; }
.av.sm { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
.av.lg { width: 56px; height: 56px; font-size: 24px; border-radius: 14px; }
.hue-teal { --pc: var(--p-teal); } .hue-rust { --pc: var(--p-rust); } .hue-blue { --pc: var(--p-blue); } .hue-olive { --pc: var(--p-olive); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .sec { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 0; background: none; cursor: pointer; text-align: left; font-family: var(--f-disp); font-size: 19px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.nav .sec svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav .sec:hover { background: var(--surface-2); color: var(--ink); }
.nav .sec[aria-current="true"] { color: var(--ink); }
.nav .sub { display: flex; flex-direction: column; margin: 0 0 6px 20px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav .sub button { border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ink-2); position: relative; }
.nav .sub button:hover { color: var(--ink); background: var(--surface-2); }
.nav .sub button[aria-current="true"] { color: var(--ink); font-weight: 600; background: var(--surface-2); }
.nav .sub button[aria-current="true"]::before { content: ""; position: absolute; left: -13px; top: 7px; bottom: 7px; width: 2px; background: var(--brand); border-radius: 2px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.cd { display: flex; align-items: baseline; gap: 8px; }
.cd b { font-family: var(--f-disp); font-size: 30px; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.cd span { line-height: 1.25; }
.syncline { display: flex; align-items: center; gap: 7px; }
.syncline i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: 0 0 7px; }
.syncline.ok i { background: var(--good); } .syncline.local i { background: var(--warn); } .syncline.busy i { background: var(--info); }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 12.5px; }
.linkbtn:hover { color: var(--ink); }

/* ---------- cabecera de página ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.ph h1 { font-family: var(--f-disp); font-weight: 700; font-size: 34px; letter-spacing: .02em; text-transform: uppercase; margin: 0; line-height: 1; }
.ph .lead { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg.mob { display: none; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); font-weight: 600; }

/* ---------- tablero + panel ---------- */
.stage { display: grid; grid-template-columns: minmax(0, min(620px, calc(100vh - 120px))) minmax(320px, 1fr); gap: 22px; align-items: start; max-width: 1280px; }
.board-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; position: sticky; top: 16px; }
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pl { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; }
.pl:empty { min-height: 0; }
.pl .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.pl .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink-3); }
.pl .dot.w { background: #f5f3ec; } .pl .dot.b { background: #1c1c1c; }
.clock { font-family: var(--f-mono); font-size: 22px; font-weight: 600; padding: 2px 12px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }
.clock.run { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.clock.low { background: var(--bad); color: #fff; border-color: var(--bad); }
.board-row { display: flex; gap: 8px; align-items: stretch; }
.evalbar { width: 20px; flex: 0 0 20px; border-radius: 4px; overflow: hidden; background: #2b2f2f; position: relative; border: 1px solid var(--line); }
.evalbar .fill { position: absolute; left: 0; right: 0; bottom: 0; background: #f2f0e8; height: 50%; transition: height .35s ease; }
.evalbar.flip .fill { top: 0; bottom: auto; }
.evalbar .txt { position: absolute; left: 0; right: 0; font-family: var(--f-mono); font-size: 9.5px; text-align: center; font-weight: 600; z-index: 1; }
.board { position: relative; flex: 1; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; }
.grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.sq { position: relative; }
.sq.l { background: var(--sq-light); } .sq.d { background: var(--sq-dark); }
.sq.last::before, .sq.sel::before, .sq.hov::before, .sq.chk::before { content: ""; position: absolute; inset: 0; }
.sq.last::before { background: var(--sq-last); }
.sq.sel::before { background: var(--sq-sel); }
.sq.hov::before { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .65); }
.sq.chk::before { background: radial-gradient(circle, rgba(230, 40, 30, .9) 0%, rgba(230, 40, 30, .45) 45%, rgba(230, 40, 30, 0) 75%); }
.sq .dotm { position: absolute; inset: 36%; border-radius: 50%; background: rgba(20, 30, 20, .3); z-index: 2; pointer-events: none; }
.sq .ring { position: absolute; inset: 3%; border-radius: 50%; border: 5px solid rgba(20, 30, 20, .3); z-index: 2; pointer-events: none; }
.sq .co { position: absolute; font-family: var(--f-body); font-weight: 600; font-size: clamp(8px, 1.5vw, 11.5px); line-height: 1; z-index: 1; pointer-events: none; }
.sq .co.f { right: 3px; bottom: 2px; } .sq .co.r { left: 3px; top: 3px; }
.sq.l .co { color: var(--coord-light); } .sq.d .co { color: var(--coord-dark); }
.pc { position: absolute; inset: 0; background-size: 100%; background-repeat: no-repeat; z-index: 3; pointer-events: none; will-change: transform; }
.pc.anim { transition: transform .16s ease-out; }
.dragghost { position: absolute; z-index: 20; pointer-events: none; background-size: 100%; transform: translate(-50%, -50%) scale(1.08); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.pc.dragging { opacity: .35; }
svg.arrows { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
.promo { position: absolute; inset: 0; z-index: 30; background: rgba(10, 12, 12, .55); display: flex; align-items: center; justify-content: center; gap: 8px; }
.promo button { width: 18%; aspect-ratio: 1; border-radius: 10px; border: 0; background: var(--sq-light) center / 88% no-repeat; cursor: pointer; }
.lockveil { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(12, 14, 14, .42); pointer-events: all; }
.lockveil div { background: var(--surface); color: var(--ink); border: 1px solid var(--brand); border-radius: 12px; padding: 12px 16px; text-align: center; max-width: 80%; box-shadow: var(--shadow); }
.lockveil b { display: block; font-family: var(--f-disp); font-size: 30px; color: var(--brand); line-height: 1; }
.lockveil span { font-size: 13px; }
.flash-bad { animation: shake .32s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) { .pc.anim { transition: none; } .flash-bad { animation: none; } .evalbar .fill { transition: none; } }
.tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13.5px; font-weight: 500; line-height: 1.2; text-decoration: none; }
.btn:hover { border-color: var(--ink-3); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.pri:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn.sm { padding: 5px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.icon { width: 38px; padding: 7px 0; font-family: var(--f-mono); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h2 { font-family: var(--f-disp); font-size: 24px; font-weight: 700; letter-spacing: .01em; margin: 0 0 4px; line-height: 1.1; text-wrap: balance; }
.card h3 { font-family: var(--f-disp); font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; color: var(--ink-2); }
.muted { color: var(--ink-2); } .dim { color: var(--ink-3); }
.small { font-size: 12.5px; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.oppick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.opbtn { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.opbtn b { font-family: var(--f-disp); font-size: 19px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opbtn span { font-size: 11px; color: var(--ink-3); font-family: var(--f-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opbtn[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.lines { display: flex; flex-direction: column; gap: 1px; max-height: 340px; overflow: auto; margin-inline: -6px; padding-inline: 6px; }
.grp { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 2px; }
.grp:first-child { margin-top: 0; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; border: 0; background: transparent; border-radius: 7px; padding: 6px 8px; cursor: pointer; font-size: 13.5px; width: 100%; }
.item:hover { background: var(--surface-2); }
.item[aria-current="true"] { background: var(--brand-soft); font-weight: 600; }
.item .tags { display: flex; gap: 4px; flex: 0 0 auto; }
.pill { font-family: var(--f-mono); font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-3); white-space: nowrap; }
.pill.ok { color: var(--good); border-color: currentColor; }
.pill.bad { color: var(--bad); border-color: currentColor; }
.pill.warn { color: var(--warn); border-color: currentColor; }
.pill.brand { color: var(--brand); border-color: currentColor; }
.pill.info { color: var(--info); border-color: currentColor; }
.moves { display: flex; flex-wrap: wrap; gap: 2px; font-family: var(--f-mono); font-size: 13.5px; line-height: 1.7; }
.moves .n { color: var(--ink-3); margin-left: 6px; margin-right: 1px; }
.mv { border: 0; background: transparent; border-radius: 4px; padding: 0 4px; cursor: pointer; font-family: inherit; font-size: inherit; }
.mv:hover { background: var(--surface-2); }
.mv.cur { background: var(--ink); color: var(--bg); }
.mv.cm::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); margin-left: 3px; vertical-align: super; }
.mv.dev { box-shadow: inset 0 -2px 0 var(--warn); }
.fig { font-family: var(--fig); font-size: 1.05em; }
.comment { font-size: 14.5px; line-height: 1.55; min-height: 3.2em; max-width: 68ch; }
.mvref { white-space: nowrap; }
.navrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ideas { display: grid; gap: 10px; }
.idea { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.idea i { font-style: normal; font-family: var(--f-disp); font-weight: 700; font-size: 18px; color: var(--brand); line-height: 1.2; }
.idea b { display: block; font-size: 14px; }
.idea p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.plan { border-left: 3px solid var(--brand); padding: 4px 0 4px 12px; margin-top: 10px; font-size: 14px; }
.plan b { font-weight: 600; }
.engine { display: flex; flex-direction: column; gap: 6px; }
.eng-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eng-eval { font-family: var(--f-mono); font-size: 22px; font-weight: 600; }
.eng-words { font-size: 13.5px; color: var(--ink-2); }
.pv { display: flex; gap: 8px; align-items: baseline; font-family: var(--f-mono); font-size: 12.5px; padding: 4px 6px; border-radius: 6px; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.pv:hover { background: var(--surface-2); }
.pv b { min-width: 48px; font-weight: 600; }
.pv span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { left: 16px; }
.status { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 12px; background: var(--surface-2); font-size: 14px; }
.status .tag { font-family: var(--f-disp); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 16px; white-space: nowrap; line-height: 1.3; }
.status.ok .tag { color: var(--good); } .status.bad .tag { color: var(--bad); } .status.info .tag { color: var(--info); } .status.warn .tag { color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-family: var(--f-disp); font-size: 26px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--ink-3); }
.bar { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
select, input[type=text] { font: inherit; font-size: 13.5px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); max-width: 100%; }
input[type=range] { accent-color: var(--brand); width: 100%; }
.cls { font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; padding: 0 5px; border-radius: 4px; margin-left: 2px; color: #fff; vertical-align: 1px; }
.cls.best { background: var(--good); } .cls.good { background: #6f9b7a; } .cls.inac { background: var(--warn); } .cls.mist { background: #db7a34; } .cls.blun { background: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; z-index: 100; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.review-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }
.foot { margin-top: 28px; color: var(--ink-3); font-size: 12px; max-width: 90ch; }
.phasebars { display: grid; gap: 6px; margin-top: 8px; }
.phasebars div { display: grid; grid-template-columns: 118px 1fr 52px; gap: 8px; align-items: center; font-size: 12.5px; }
.phasebars .bar i { background: var(--info); }
.phasebars .bar.over i { background: var(--warn); }
.phasebars em { font-style: normal; font-family: var(--f-mono); text-align: right; color: var(--ink-2); }

/* ---------- camarín (portada) ---------- */
.home { max-width: 1180px; margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px 30px; flex-wrap: wrap; padding: 6px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.hero .wordmark b { font-size: 44px; }
.hero .wordmark .mark { width: 46px; height: 46px; border-radius: 12px; flex-basis: 46px; }
.hero .wordmark .mark img { width: 38px; height: 38px; }
.hero p { margin: 10px 0 0; color: var(--ink-2); max-width: 56ch; }
.hero .big { text-align: right; }
.hero .big b { display: block; font-family: var(--f-disp); font-size: 76px; line-height: .85; color: var(--brand); font-variant-numeric: tabular-nums; }
.hero .big span { font-family: var(--f-disp); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 16px; text-align: left; cursor: pointer; color: var(--ink); overflow: hidden; }
.pcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--pc); }
.pcard:hover { border-color: var(--line-2); }
.pcard .top { display: flex; gap: 12px; align-items: center; }
.pcard .top .nm b { display: block; font-family: var(--f-disp); font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.pcard .top .nm span { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.pcard .top .rt { margin-left: auto; text-align: right; }
.pcard .top .rt b { display: block; font-family: var(--f-disp); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.pcard .top .rt span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.pcard .like { font-size: 13px; color: var(--ink-2); }
.pcard .like b { color: var(--ink); font-weight: 600; }
.pcard .reps { display: flex; gap: 6px; flex-wrap: wrap; }
.pcard .reps span { font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; color: var(--ink-2); }
.pcard .focus { font-size: 13.5px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 4px; }
.pcard .focus .eyebrow { color: var(--ink-3); }
.pcard .meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.meter b { font-family: var(--f-disp); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; display: block; }
.meter span { font-size: 11px; color: var(--ink-3); display: block; margin-bottom: 5px; }
.meter .bar i { background: var(--pc); }
.pcard .games { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.pcard .games .bad { color: var(--bad); } .pcard .games .ok { color: var(--good); }
.pcard .go { position: absolute; right: 16px; bottom: 14px; font-family: var(--f-disp); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pcard:hover .go { color: var(--ink); }
.rules4 { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rules4 .card p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.rules4 .card b.k { display: block; font-family: var(--f-disp); font-size: 20px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }

/* ---------- plan ---------- */
.planwrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1280px; }
.planwrap > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.task { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; padding-top: 4px; }
.task .n { font-family: var(--f-disp); font-weight: 700; font-size: 22px; color: var(--brand); line-height: 1.1; }
.task.done .n { color: var(--good); }
.task.done .t b { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-2); }
.task .t b { display: block; font-size: 15px; }
.task .t p { margin: 2px 0 8px; font-size: 13px; color: var(--ink-2); }
.task .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.radar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radar ul { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
.radar h4 { margin: 0 0 6px; font-family: var(--f-disp); text-transform: uppercase; letter-spacing: .05em; font-size: 15px; }
.radar .pos h4 { color: var(--good); } .radar .neg h4 { color: var(--bad); }
.como { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13.5px; }
.como li { padding-left: 14px; position: relative; color: var(--ink-2); }
.como li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 6px; border-radius: 2px; background: var(--pc, var(--brand)); }
.days { display: flex; flex-direction: column; gap: 6px; }
.day { display: grid; grid-template-columns: auto 74px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.day.today { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.day.done { opacity: .58; }
.day.past:not(.done) .d { color: var(--warn); }
.day input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }
.day .d { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.day .t b { display: block; font-size: 13.5px; }
.day .t span { font-size: 13px; color: var(--ink-2); }
.phase { font-family: var(--f-disp); font-size: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.week { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.week summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 2px 0 8px; }
.week summary::-webkit-details-marker { display: none; }
.week summary::before { content: "▸"; color: var(--ink-3); font-size: 12px; }
.week[open] summary::before { content: "▾"; }
.week summary .phase { flex: 1; }
.tip { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.tip:first-of-type { border-top: 0; }
.tip b.k { font-family: var(--f-disp); font-size: 22px; color: var(--brand); line-height: 1; }
.tip p { margin: 0; font-size: 13.5px; }
.gcount { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gcount .stat.bad b { color: var(--bad); } .gcount .stat.ok b { color: var(--good); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
  .board-col { position: static; }
  .planwrap { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
}
@media (max-width: 820px) {
  :root { --side-w: 0px; }
  .side { display: none; }
  .has-side .main { margin-left: 0; }
  .main { padding: 12px 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .has-side .mtop { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .mtop .wordmark b { font-size: 21px; } .mtop .wordmark .mark { width: 26px; height: 26px; flex-basis: 26px; } .mtop .wordmark .mark img { width: 20px; height: 20px; }
  .has-side .mbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .mbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; cursor: pointer; font-family: var(--f-disp); font-size: 14px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
  .mbar button svg { width: 20px; height: 20px; }
  .mbar button[aria-current="true"] { color: var(--brand); }
  .seg.mob { display: inline-flex; }
  .ph h1 { font-size: 27px; }
  .ph { margin-bottom: 12px; }
  .roster { grid-template-columns: minmax(0, 1fr); }
  .rules4 { grid-template-columns: minmax(0, 1fr); }
  .hero .big b { font-size: 56px; }
  .hero .wordmark b { font-size: 34px; }
  .radar { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .clock { font-size: 19px; min-width: 80px; }
  .two { grid-template-columns: 1fr; }
  .hero { padding-bottom: 16px; margin-bottom: 16px; }
  .hero .big { text-align: left; }
  .pcard .meters { gap: 8px; }
  .seg { width: 100%; } .seg button { flex: 1; padding: 6px 8px; }
  .day { grid-template-columns: auto 60px 1fr; }
}
