/* Same look as okak0.com: dark dot-grid page, charcoal cards, white pill buttons.
   Theme follows the system (dark unless it prefers light) until the visitor picks one with
   the toggle, which is stored as data-theme on <html>. */
:root {
  --bg: #121212;
  --dot: rgba(255, 255, 255, 0.075);
  --card: #1d1d1d;
  --card-line: rgba(255, 255, 255, 0.07);
  --panel: #161616;
  --panel-line: rgba(255, 255, 255, 0.05);
  --chip: #232323;
  --text: #ececec;
  --dim: #9a9a9a;
  --faint: #6a6a6a;
  --yellow: #f2d633;
  --green: #3fd77f;
  --red: #ff5b54;
  --blue: #4c9dff;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --btn: #f5f5f5;
  --btn-hover: #ffffff;
  --btn-ink: #121212;
  --hover: #2a2a2a;
  --shadow: rgba(0, 0, 0, 0.4);
  --card-hover-line: rgba(255, 255, 255, 0.12);
  --dot-main: #f0f0f0;
  --dot-ring: rgba(255, 255, 255, 0.06);
  --dot-off: #5c5c5c;
  --dashed: rgba(255, 255, 255, 0.14);
  --toggle: #5a5a5a;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f3f1;
    --toggle: #2b2b2b;
    --dot: rgba(0, 0, 0, 0.11);
    --card: #ffffff;
    --card-line: rgba(0, 0, 0, 0.08);
    --panel: #f6f6f4;
    --panel-line: rgba(0, 0, 0, 0.05);
    --chip: #e9e9e6;
    --text: #161616;
    --dim: #5d5d5d;
    --faint: #8a8a8a;
    --btn: #161616;
    --btn-hover: #000000;
    --btn-ink: #f5f5f5;
    --hover: #e2e2de;
    --shadow: rgba(0, 0, 0, 0.08);
    --card-hover-line: rgba(0, 0, 0, 0.16);
    --dot-main: #161616;
    --dot-ring: rgba(0, 0, 0, 0.06);
    --dot-off: #b5b5b5;
    --dashed: rgba(0, 0, 0, 0.18);
    --yellow: #d9b600;
    --green: #1fa85a;
    --red: #e0443d;
    --blue: #2f7fe0;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f3f1;
  --toggle: #2b2b2b;
  --dot: rgba(0, 0, 0, 0.11);
  --card: #ffffff;
  --card-line: rgba(0, 0, 0, 0.08);
  --panel: #f6f6f4;
  --panel-line: rgba(0, 0, 0, 0.05);
  --chip: #e9e9e6;
  --text: #161616;
  --dim: #5d5d5d;
  --faint: #8a8a8a;
  --btn: #161616;
  --btn-hover: #000000;
  --btn-ink: #f5f5f5;
  --hover: #e2e2de;
  --shadow: rgba(0, 0, 0, 0.08);
  --card-hover-line: rgba(0, 0, 0, 0.16);
  --dot-main: #161616;
  --dot-ring: rgba(0, 0, 0, 0.06);
  --dot-off: #b5b5b5;
  --dashed: rgba(0, 0, 0, 0.18);
  --yellow: #d9b600;
  --green: #1fa85a;
  --red: #e0443d;
  --blue: #2f7fe0;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.4px);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
main.wrap { max-width: 880px; }

/* ---------- header ---------- */

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 400; font-size: 17px; }
.logo svg { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: 8px; }
.tab {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--dim);
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: var(--chip); }

/* ---------- dots ---------- */

.dot { display: inline-block; width: 9px; height: 1.5px; border-radius: 1px; background: currentColor; flex: none; }
.dot.status.green { background: var(--green); }
.dot.status.yellow { background: var(--yellow); }
.dot.status.red { background: var(--red); }
.dot.status.blue { background: var(--blue); }
.dot.status.gray { background: var(--dot-off); }
.eyebrow .dot.green, .dot.status { width: 8px; height: 8px; border-radius: 50%; }
.eyebrow .dot.green { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }

/* ---------- hero ---------- */

.hero { padding: 56px 0 32px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--card-line);
  font-size: 13px;
  color: var(--dim);
}
.hero h1 {
  font-size: clamp(38px, 6vw, 60px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 22px 0 16px;
}
.hero .lead { color: var(--dim); font-size: 18px; margin: 0; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 22px 0 0; padding: 0; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-line);
  font-size: 13.5px;
  color: var(--dim);
}

/* ---------- cards & panels ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 18px 40px var(--shadow);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
}
.card > .panel + .panel,
.card > * + .panel { margin-top: 10px; }

/* ---------- buttons (pills) ---------- */

.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  border: 1px solid var(--card-line);
  background: var(--chip);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform .12s, background .15s, color .15s;
}
.btn:hover { background: var(--hover); }
.btn.solid {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: transparent;
  box-shadow: 0 6px 20px var(--shadow);
}
.btn.solid:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); padding: 8px 10px; }
.btn.ghost:hover { background: var(--chip); color: var(--text); }
.btn.ghost.danger:hover { color: var(--red); }
.btn.copied { background: var(--green); border-color: var(--green); color: #fff; }
.btn:focus-visible, .drop input:focus-visible + * { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- footer ---------- */

.foot { margin-top: 96px; border-top: 1px solid var(--card-line); }
.foot .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  padding-bottom: 36px;
  color: var(--faint);
  font-size: 13.5px;
}
.foot a:hover { color: var(--text); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--btn);
  color: var(--btn-ink);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- theme toggle ---------- */

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--chip);
  border: 1px solid var(--card-line);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: background .15s;
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top .wrap { height: 72px; }
  .top nav .hide-sm { display: none; }
  .tab { padding: 10px 12px; }
  .hero { padding-top: 24px; }
  .hero .lead { font-size: 16px; }
}

.top, main, .foot { position: relative; z-index: 1; }
.toast { z-index: 10; }

/* ================= chess ================= */

:root {
  --sq-light: #ecebd3;
  --sq-dark: #6e9a5b;
  --brilliant: #1baca6;
  --great: #5c8bb0;
  --best: #81b64c;
  --excellent: #81b64c;
  --good: #77915f;
  --book: #a88865;
  --forced: #8a8886;
  --inaccuracy: #f0b93a;
  --mistake: #e58f2a;
  --miss: #ee6b55;
  --blunder: #ca3431;
}

body.app .top .wrap { height: 68px; }
body.app .wrap { max-width: 1240px; }
body.app main.wrap { max-width: 1240px; }
body.app .foot { margin-top: 40px; }
.tab.on { color: var(--text); background: var(--chip); }
button.tab { border: 0; background: none; font-family: var(--font); cursor: pointer; }
[hidden] { display: none !important; }

/* ----- home ----- */
.home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.home-card { display: flex; flex-direction: column; }
.home-card .panel { padding: 22px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.home-card h2 { font-size: 24px; font-weight: 400; margin: 0; letter-spacing: -0.01em; }
.home-card p { margin: 0; color: var(--dim); }
.label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }
.link-form { display: flex; gap: 8px; margin-top: auto; }
.input {
  flex: 1; min-width: 0; font-family: var(--font); font-size: 15px; font-weight: 300; color: var(--text);
  background: var(--chip); border: 1px solid var(--card-line); border-radius: 10px; padding: 10px 14px; outline: none;
}
.input:focus { border-color: var(--blue); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 110px; font-family: var(--mono); font-size: 12.5px; width: 100%; }
.marks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.marks span { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--dim); }
.cls-icon { width: 20px; height: 20px; flex: none; display: block; }
.home-card .btn.solid { align-self: flex-start; margin-top: auto; padding: 10px 18px; }

/* ----- stage: board + side panel ----- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 16px; align-items: start; }
.board-col { width: 100%; max-width: calc(100vh - 190px); min-width: 280px; margin: 0 auto; }
.board-row { display: flex; gap: 8px; }
.board-row .board { flex: 1; }

.player { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 2px; font-size: 15px; }
.player .avatar {
  width: 32px; height: 32px; border-radius: 8px; background: var(--chip) center/cover no-repeat; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 500; color: var(--dim); border: 1px solid var(--card-line); overflow: hidden;
}
.player .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player .avatar.piece-img { background-size: 86%; }
.player .name { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 48px; }
.player .title { font-size: 11px; font-weight: 600; background: #a3312c; color: #fff; padding: 1px 4px; border-radius: 4px; }
.player .rating { color: var(--dim); font-size: 14px; }
.player .taken { color: var(--dim); font-size: 15px; letter-spacing: -2px; white-space: nowrap; overflow: hidden; flex-shrink: 20; min-width: 0; }
.player .rating, .player .title, .player .diff, .player .acc { flex: none; }
.player .diff { color: var(--dim); font-size: 12.5px; }
.player .spacer { flex: 1; }
.player .acc { font-size: 13px; padding: 3px 9px; border-radius: 8px; background: var(--chip); border: 1px solid var(--card-line); color: var(--text); font-weight: 500; }
.player .thinking { color: var(--dim); font-size: 13px; }

/* ----- board ----- */
.board {
  position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; user-select: none; -webkit-user-select: none;
  background: conic-gradient(var(--sq-dark) 90deg, var(--sq-light) 0 180deg, var(--sq-dark) 0 270deg, var(--sq-light) 0) 0 0 / 25% 25%;
  box-shadow: 0 14px 34px var(--shadow);
  -webkit-tap-highlight-color: transparent;
}
.board.interactive { touch-action: none; }
.b-layer { position: absolute; inset: 0; pointer-events: none; }
.piece, .b-mark, .b-hint { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; }
.piece { background: center/100% no-repeat; transition: transform .17s ease-out, opacity .15s; will-change: transform; z-index: 1; }
.piece.moving { z-index: 3; }
.piece.drag { transition: none; z-index: 10; cursor: grabbing; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.piece.nomove, .noanim .piece { transition: none; }
.piece.gone { opacity: 0; z-index: 0; }
.piece.appear { animation: appear .18s; }
@keyframes appear { from { opacity: 0; } }
.board.interactive .piece { cursor: grab; }
.wP, .piece-img.wP { background-image: url(/img/pieces/wP.svg); }
.wN, .piece-img.wN { background-image: url(/img/pieces/wN.svg); }
.wB, .piece-img.wB { background-image: url(/img/pieces/wB.svg); }
.wR, .piece-img.wR { background-image: url(/img/pieces/wR.svg); }
.wQ, .piece-img.wQ { background-image: url(/img/pieces/wQ.svg); }
.wK, .piece-img.wK { background-image: url(/img/pieces/wK.svg); }
.bP, .piece-img.bP { background-image: url(/img/pieces/bP.svg); }
.bN, .piece-img.bN { background-image: url(/img/pieces/bN.svg); }
.bB, .piece-img.bB { background-image: url(/img/pieces/bB.svg); }
.bR, .piece-img.bR { background-image: url(/img/pieces/bR.svg); }
.bQ, .piece-img.bQ { background-image: url(/img/pieces/bQ.svg); }
.bK, .piece-img.bK { background-image: url(/img/pieces/bK.svg); }
.piece-img { background-position: center; background-repeat: no-repeat; background-size: contain; }

.b-mark.last { background: rgba(255, 235, 59, .5); }
.b-mark.sel { background: rgba(255, 235, 59, .6); }
.b-mark.check { background: radial-gradient(circle, rgba(255, 0, 0, .9) 0%, rgba(231, 0, 0, .6) 35%, rgba(169, 0, 0, 0) 72%); }
.b-mark.cls { opacity: .62; }
.b-mark.cls-brilliant { background: var(--brilliant); }
.b-mark.cls-great { background: var(--great); }
.b-mark.cls-best, .b-mark.cls-excellent { background: var(--best); }
.b-mark.cls-good { background: var(--good); }
.b-mark.cls-book { background: var(--book); }
.b-mark.cls-forced { background: var(--forced); }
.b-mark.cls-inaccuracy { background: var(--inaccuracy); }
.b-mark.cls-mistake { background: var(--mistake); }
.b-mark.cls-miss { background: var(--miss); }
.b-mark.cls-blunder { background: var(--blunder); }
.b-hint::after { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: rgba(0, 0, 0, .2); }
.b-hint.capture::after { inset: 0; background: radial-gradient(circle, transparent 57%, rgba(0, 0, 0, .2) 58% 69%, transparent 70%); }
.b-coord { position: absolute; font-size: clamp(8px, 1.5vw, 12.5px); font-weight: 500; line-height: 1; }
.b-coord.rank { left: .35%; margin-top: .5%; padding: 1px 0 0 2px; }
.b-coord.file { bottom: .5%; width: 12.5%; text-align: right; padding-right: 3px; }
.b-coord.on-light { color: var(--sq-dark); }
.b-coord.on-dark { color: var(--sq-light); }
.b-arrows { width: 100%; height: 100%; z-index: 4; }
.arrow { opacity: .82; }
.arrow.best { fill: #81b64c; }
.arrow.alt { fill: #f0b93a; }
.arrow.threat { fill: #ca3431; }
.arrow.hint { fill: #4c9dff; }
.b-badge { position: absolute; width: 5.2%; height: 5.2%; z-index: 5; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); animation: pop .22s cubic-bezier(.3, 1.6, .5, 1); }
.b-badge .cls-icon { width: 100%; height: 100%; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
.b-promo { pointer-events: auto; background: rgba(0, 0, 0, .35); z-index: 20; }
.b-promo-col { position: absolute; width: 12.5%; display: flex; flex-direction: column; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); overflow: hidden; }
.b-promo-col.up { flex-direction: column-reverse; }
.b-promo-btn { aspect-ratio: 1; width: 100%; border: 0; background-color: #fff; cursor: pointer; padding: 0; }
.b-promo-btn:hover { background-color: #e3e3e3; }

/* ----- evaluation bar ----- */
.evalbar { position: relative; width: 26px; flex: none; border-radius: 5px; overflow: hidden; background: #403d39; }
.evalbar .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #f4f4f4; transition: height .5s ease; }
.evalbar.flip .fill { bottom: auto; top: 0; }
.evalbar .num { position: absolute; left: 0; right: 0; text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: -0.3px; }
.evalbar .num.white { bottom: 5px; color: #403d39; }
.evalbar .num.black { top: 5px; color: #f4f4f4; }
.evalbar.flip .num.white { bottom: auto; top: 5px; }
.evalbar.flip .num.black { top: auto; bottom: 5px; }

/* ----- side panel ----- */
.side { display: flex; flex-direction: column; gap: 10px; min-height: 420px; }
.side > .panel { margin: 0 !important; }
.pad { padding: 14px; }
.side h2 { margin: 0; font-size: 17px; font-weight: 400; }
.side .sub { color: var(--dim); font-size: 13.5px; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.seg { display: inline-flex; background: var(--chip); border: 1px solid var(--card-line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font-family: var(--font); font-size: 13.5px; font-weight: 400; color: var(--dim); background: none; border: 0; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--btn); color: var(--btn-ink); }
.err { color: var(--red); font-size: 13.5px; margin: 0; }
.btn.wide { width: 100%; padding: 12px 14px; font-size: 15px; }
.btn.green { background: #81b64c; border-color: transparent; color: #fff; font-weight: 500; box-shadow: 0 4px 0 #5d8a35; }
.btn.green:hover { background: #8fc558; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.icon { padding: 9px 12px; }

/* coach */
.coach { display: flex; gap: 10px; align-items: flex-start; }
.coach-face { width: 64px; height: 64px; flex: none; border-radius: 14px; overflow: hidden; background: #2b4a6b; }
.coach-face svg { width: 100%; height: 100%; display: block; }
.bubble {
  position: relative; flex: 1; min-width: 0; background: #fff; color: #1f1f1f; border-radius: 12px; padding: 11px 13px; font-size: 15px; line-height: 1.4; font-weight: 400;
  box-shadow: 0 4px 14px var(--shadow); min-height: 64px;
}
.bubble::before { content: ""; position: absolute; left: -7px; top: 22px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble .head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; margin-bottom: 3px; }
.bubble .head .cls-icon { width: 22px; height: 22px; }
.bubble .head .ev { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: #ececec; color: #333; }
.bubble .head .ev.dark { background: #403d39; color: #fff; }
.bubble p { margin: 0; }
.bubble .line { margin-top: 6px; font-size: 13px; color: #555; }
.bubble .line b { font-weight: 600; color: #333; }
.c-brilliant { color: var(--brilliant); } .c-great { color: var(--great); } .c-best, .c-excellent { color: #5f9a2c; }
.c-good { color: var(--good); } .c-book { color: var(--book); } .c-forced { color: var(--forced); }
.c-inaccuracy { color: #d19a10; } .c-mistake { color: var(--mistake); } .c-miss { color: var(--miss); } .c-blunder { color: var(--blunder); }
.coach-name { font-size: 12px; color: var(--dim); text-align: center; margin-top: 3px; width: 64px; white-space: nowrap; }

/* progress */
.progress { height: 10px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: #81b64c; transition: width .25s; }

/* eval graph */
.graph { position: relative; height: 84px; border-radius: 8px; overflow: hidden; background: #403d39; cursor: pointer; }
.graph svg { width: 100%; height: 100%; display: block; }
.graph .area { fill: #f4f4f4; }
.graph .mid { stroke: rgba(128, 128, 128, .55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.graph .cur { stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; }
.graph.small { height: 46px; }

/* summary table */
.sum { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sum td { padding: 5px 4px; text-align: center; }
.sum td.lab { text-align: left; color: var(--dim); }
.sum td.ic { width: 28px; }
.sum td.n { width: 64px; font-weight: 500; }
.sum tr.names td { font-size: 13.5px; color: var(--dim); font-weight: 400; padding-bottom: 8px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum tr.accrow td { padding: 4px 4px 12px; }
.accbox { display: inline-block; min-width: 62px; padding: 7px 8px; border-radius: 8px; font-size: 18px; font-weight: 600; }
.accbox.w { background: #f4f4f4; color: #222; }
.accbox.b { background: #403d39; color: #fff; border: 1px solid rgba(255,255,255,.1); }
.sum tr.rating td { padding-top: 12px; }
.sum .zero { opacity: .35; }

/* move list */
.moves { position: relative; overflow-y: auto; max-height: min(260px, calc(100vh - 560px)); min-height: 108px; font-size: 14.5px; padding: 6px; scrollbar-width: thin; }
.moves .mrow { display: grid; grid-template-columns: 34px 1fr 1fr; align-items: center; }
.moves .mrow:nth-child(odd) { background: color-mix(in srgb, var(--chip) 55%, transparent); border-radius: 6px; }
.moves .num { color: var(--faint); padding-left: 8px; font-size: 13px; }
.moves button { font-family: var(--font); font-size: 14.5px; font-weight: 400; color: var(--text); background: none; border: 0; text-align: left; padding: 5px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.moves button:hover { background: var(--hover); }
.moves button.on { background: var(--btn); color: var(--btn-ink); }
.moves .cls-icon { width: 16px; height: 16px; }
.moves .mi { width: 16px; flex: none; }

.navrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.navrow .btn { padding: 11px 0; }
.navrow .btn svg { width: 18px; height: 18px; }

/* game list (username search) */
.games { max-height: 330px; overflow-y: auto; scrollbar-width: thin; padding: 6px; }
.games button { width: 100%; font-family: var(--font); color: var(--text); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; text-align: left; font-size: 14px; font-weight: 300; }
.games button:hover { background: var(--hover); }
.games .when { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.games .vs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.games .vs small { color: var(--faint); }

/* bots */
.bots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; }
.bot { font-family: var(--font); color: var(--text); background: var(--chip); border: 1.5px solid transparent; border-radius: 12px; padding: 8px 4px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 400; }
.bot:hover { background: var(--hover); }
.bot.on { border-color: #81b64c; background: color-mix(in srgb, #81b64c 14%, var(--chip)); }
.bot .face { width: 44px; height: 44px; border-radius: 12px; background-size: 82%; }
.bot small { color: var(--dim); font-size: 12px; }
.bot-info { display: flex; gap: 12px; align-items: center; }
.bot-info .face { width: 56px; height: 56px; border-radius: 14px; flex: none; background-size: 82%; }
.bot-info b { font-weight: 500; }
.result { text-align: center; padding: 16px 14px; }
.result h2 { font-size: 21px; }
.result p { margin: 4px 0 0; color: var(--dim); }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--dim); cursor: pointer; user-select: none; }
.toggle input { accent-color: #81b64c; width: 16px; height: 16px; margin: 0; }

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .board-col { max-width: min(100%, calc(100vh - 150px)); }
  .home-grid { grid-template-columns: 1fr; }
  .moves { max-height: 200px; }
}
@media (max-width: 640px) {
  body.app .wrap { padding: 0 10px; }
  body.app .top .wrap { height: 56px; }
  .evalbar { width: 16px; }
  .evalbar .num { display: none; }
  .board-row { gap: 5px; }
  .player { height: 38px; font-size: 14px; }
  .player .avatar { width: 28px; height: 28px; }
  .bots { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .coach-face, .coach-name { width: 54px; }
  .coach-face { height: 54px; }
  .coach-name { font-size: 10.5px; }
  .link-form { flex-wrap: wrap; }
  .hero h1 { font-size: 34px; }
}

details.panel summary { cursor: pointer; color: var(--dim); font-size: 14px; list-style-position: inside; }
details.panel[open] summary { margin-bottom: 10px; }
.graph .gdot { position: absolute; width: 7px; height: 7px; border-radius: 50%; margin: -3.5px 0 0 -3.5px; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35); pointer-events: none; }
.graph .gcur { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--blue); pointer-events: none; }
.bubble .cta { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.fine { font-size: 12.5px; color: var(--faint); margin: 0; }
