:root {
  color-scheme: dark;
  --surface-0: #1f1e1c;
  --surface-1: #262522;
  --surface-2: #312e2b;
  --surface-3: #3b3936;
  --border: rgba(255,255,255,.08);
  --text: #f4f2ed;
  --muted: #a7a39a;
  --green: #81b64c;
  --green-deep: #5f8f35;
  --cream: #eeeed2;
  --board-green: #769656;
  --accent-blue: #5bb7d6;
  --stockfish-red: #c96a63;
  --danger: #e05a47;
  --warning: #e9a743;
  --shadow: 0 24px 70px rgba(0,0,0,.36);
  --board-size: min(calc(100vh - 220px), 760px, calc(100vw - 810px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-0); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 42% 0, #393733 0, var(--surface-0) 43%); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(129,182,76,.65); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; color: #111; background: #fff; padding: .65rem 1rem; border-radius: .4rem; }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; opacity: 1; transition: opacity .25s ease; }
.app-shell[aria-hidden="true"] { opacity: .25; filter: blur(8px); pointer-events: none; user-select: none; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 176px; padding: 24px 16px; background: rgba(38,37,34,.96); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #18200f; background: linear-gradient(145deg, #a6d46b, var(--green)); font-size: 25px; box-shadow: inset 0 1px rgba(255,255,255,.35); }
.brand-name { font-weight: 780; letter-spacing: -.04em; font-size: 18px; }
.brand-name span { color: var(--green); }
.side-nav { display: grid; gap: 8px; margin-top: 38px; }
.side-action { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: 14px; text-align: left; }
.side-action span:first-child { width: 20px; font-size: 19px; }
.side-action:hover { color: var(--text); background: rgba(255,255,255,.05); }
.side-action--active { color: var(--text); background: rgba(129,182,76,.12); }
.sidebar-note { display: flex; align-items: center; gap: 8px; margin-top: auto; color: #807d76; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(129,182,76,.08); }

.review-layout { display: grid; grid-template-columns: minmax(560px, 1fr) minmax(430px, 510px); gap: 24px; height: 100dvh; min-height: 0; margin-left: 176px; padding: 22px 24px; overflow: auto; }
.board-column { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.mobile-header { display: none; }
.game-meta { display: flex; align-items: end; justify-content: space-between; width: min(100%, calc(var(--board-size) + 42px)); margin: 0 0 12px 42px; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.game-meta h1 { margin: 0; font-size: clamp(18px, 1.8vw, 24px); line-height: 1.1; letter-spacing: -.025em; }
.game-meta-detail { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }

.player-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 11px; width: min(100%, var(--board-size)); padding: 9px 0; }
.player-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; font-family: Georgia, serif; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.player-avatar--dark { color: #f0eee8; background: #3d3b38; }
.player-avatar--light { color: #2d2c29; background: #ddd9cd; }
.player-identity { min-width: 0; }
.player-identity > div { display: flex; align-items: baseline; gap: 7px; }
.player-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.elo { color: var(--muted); font-size: 13px; }
.turn-label { color: #817e77; font-size: 10px; }
.player-row.is-active .turn-label { color: var(--green); }
.player-row.is-active .player-avatar { box-shadow: 0 0 0 2px var(--green); }
.result-chip { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; color: #c7c4bd; background: rgba(255,255,255,.06); border-radius: 7px; font-size: 12px; font-weight: 700; }
.clock { min-width: 94px; padding: 8px 11px; color: #1f1e1c; background: #d6d4ca; border-radius: 7px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 20px; font-weight: 800; letter-spacing: .03em; text-align: center; box-shadow: 0 3px 0 #9d9b94; }
.player-row.is-active .clock { background: #f1efe6; }

.board-stage { display: flex; align-items: stretch; gap: 10px; }
.board-wrap { position: relative; width: var(--board-size); height: var(--board-size); overflow: visible; border-radius: 5px; box-shadow: 0 14px 36px rgba(0,0,0,.34); }
.chessboard, .chessboard > div { width: 100%; height: 100%; background: var(--cream); }
.cm-chessboard.chesscom .board .square.white { fill: #ebecd0; }
.cm-chessboard.chesscom .board .square.black { fill: #779556; }
.cm-chessboard.chesscom.border-type-none .board .border { fill: #779556; stroke: #779556; stroke-width: 0; }
.cm-chessboard.chesscom .coordinates { pointer-events: none; user-select: none; }
.cm-chessboard.chesscom .coordinates .coordinate { font-size: 7px; font-weight: 800; }
.cm-chessboard.chesscom .coordinates .coordinate.white { fill: #779556; }
.cm-chessboard.chesscom .coordinates .coordinate.black { fill: #ebecd0; }
.cm-chessboard.chesscom .pieces .piece { filter: drop-shadow(0 1.5px 1px rgba(0,0,0,.24)); }
.cm-chessboard .markers .marker.marker-last-move { fill: #f6f658; opacity: .48; }
.analysis-arrows { position: absolute; inset: 0; z-index: 7; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.analysis-arrow { fill: none; stroke-width: .1; stroke-linecap: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); opacity: .94; }
.analysis-arrow--player { stroke: #f4f2ed; marker-end: url(#arrowHeadPlayer); }
.analysis-arrow--stockfish { stroke: var(--stockfish-red); marker-end: url(#arrowHeadStockfish); }
.analysis-arrow--maia { stroke: #64a8c8; marker-end: url(#arrowHeadMaia); }
.board-classification { position: absolute; z-index: 8; display: grid; place-items: center; width: clamp(23px, calc(var(--board-size) / 18), 34px); aspect-ratio: 1; transform: translate(calc(-100% - 4px), 4px); border: 2px solid rgba(255,255,255,.92); border-radius: 50%; color: white; font-size: clamp(11px, calc(var(--board-size) / 43), 18px); font-weight: 950; line-height: 1; box-shadow: 0 2px 7px rgba(0,0,0,.5); pointer-events: auto; }
.board-classification::after { content: attr(data-label); position: absolute; top: calc(100% + 7px); right: -2px; width: max-content; max-width: 130px; padding: 5px 7px; color: #fff; background: #242321; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; font-size: 10px; font-weight: 750; opacity: 0; transform: translateY(-3px); transition: .14s ease; pointer-events: none; }
.board-classification:hover::after { opacity: 1; transform: none; }
.board-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: rgba(255,255,255,.85); background: rgba(38,37,34,.72); backdrop-filter: blur(5px); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--green); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.eval-bar { position: relative; width: 32px; overflow: hidden; color: #1e1d1b; background: #191816; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.eval-fill { position: absolute; right: 0; bottom: 0; left: 0; height: 50%; background: linear-gradient(180deg, #e58b82, var(--stockfish-red)); transition: height .35s cubic-bezier(.2,.8,.2,1); }
.eval-bar.is-flipped .eval-fill { top: 0; bottom: auto; }
.eval-score { position: absolute; z-index: 1; left: 50%; bottom: 7px; transform: translateX(-50%); font-size: 10px; font-weight: 900; writing-mode: vertical-rl; }
.eval-bar.is-black-favored .eval-score { top: 7px; bottom: auto; color: #f1f0eb; }
.eval-bar.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(129,182,76,.16) 50%, transparent 70%); animation: scan 1.4s ease-in-out infinite; }
.maia-bar { color: #eaf7ff; background: #102638; }
.maia-fill { background: linear-gradient(180deg, #63c7f3, #2789c4); }
.maia-score { color: white !important; text-shadow: 0 1px 2px rgba(0,0,0,.65); }
.engine-tag { position: absolute; z-index: 2; top: 6px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: 9px; font-weight: 900; }
.maia-bar.is-flipped .engine-tag { top: auto; bottom: 6px; }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.board-toolbar { display: grid; grid-template-columns: 48px 48px minmax(86px,1fr) 48px 48px auto 48px; align-items: center; gap: 7px; width: min(100%, var(--board-size)); margin-top: 11px; }
.nav-button, .icon-button { display: grid; place-items: center; height: 44px; color: #dedbd4; background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045)); border: 1px solid rgba(255,255,255,.13); border-radius: 10px; cursor: pointer; font-size: 21px; line-height: 1; box-shadow: 0 2px 0 rgba(0,0,0,.22); transition: background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease; }
.nav-button:hover:not(:disabled), .icon-button:hover { color: white; background: linear-gradient(180deg, rgba(129,182,76,.28), rgba(129,182,76,.11)); border-color: rgba(129,182,76,.55); transform: translateY(-1px); }
.nav-button:active:not(:disabled) { transform: translateY(1px); }
.nav-button:disabled { opacity: .32; cursor: default; box-shadow: none; }
.nav-button--jump { color: #f0eee8; font-size: 19px; }
.nav-button--flip { color: #9fc979; font-size: 24px; }
.ply-indicator { min-width: 0; overflow: hidden; color: #d0cdc5; font-size: 12px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-divider { width: 1px; height: 24px; margin: 0 3px; background: var(--border); }
.arrow-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; width: min(100%, var(--board-size)); margin-top: 8px; color: #98948b; font-size: 10px; }
.arrow-legend span { display: inline-flex; align-items: center; gap: 5px; }
.arrow-key { display: inline-block; width: 18px; height: 3px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.arrow-key--player { background: #f4f2ed; }
.arrow-key--stockfish { background: var(--stockfish-red); }
.arrow-key--maia { background: #64a8c8; }
.arrow-legend b { color: #b4d5e5; font-weight: 800; }

.review-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: rgba(38,37,34,.96); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.2); }
.card { margin: 16px 16px 8px; padding: 14px; background: #302f2c; border: 1px solid var(--border); border-radius: 10px; }
.progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-heading strong { font-size: 13px; }
.progress-percent { color: var(--green); font-size: 15px; font-weight: 800; }
.progress-track { height: 6px; margin-top: 10px; overflow: hidden; background: #1d1c1a; border-radius: 999px; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--green-deep), #a1cf69); border-radius: inherit; transition: width .35s ease; }
.progress-copy { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.analysis-progress.is-complete { border-color: rgba(129,182,76,.35); }
.analysis-progress.is-error { border-color: rgba(224,90,71,.5); }
.analysis-progress.is-error .progress-percent, .analysis-progress.is-error .eyebrow { color: var(--danger); }

.tabs { display: grid; grid-template-columns: repeat(3,1fr); padding: 0 16px; border-bottom: 1px solid var(--border); }
.tab { position: relative; padding: 14px 4px 12px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 12px; font-weight: 700; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); }
.tab.is-active::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: var(--green); border-radius: 2px 2px 0 0; }
.tab-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; scrollbar-width: thin; scrollbar-color: #4b4945 transparent; }
.moves-panel { flex: 1; }
.opening-card { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 12px; background: rgba(255,255,255,.035); border-radius: 8px; }
.opening-icon { display: grid; place-items: center; width: 30px; height: 30px; color: #1d2414; background: #94bd64; border-radius: 6px; font-size: 20px; }
.opening-card div { display: grid; }
.opening-card span:not(.opening-icon) { color: var(--muted); font-size: 9px; }
.opening-card strong { margin-top: 2px; font-size: 11px; }
.move-list { display: grid; }
.move-row { display: grid; grid-template-columns: 34px 1fr 1fr; min-height: 38px; border-radius: 6px; }
.move-row:nth-child(odd) { background: rgba(255,255,255,.024); }
.move-number { padding: 10px 4px 8px 9px; color: #77746d; font-size: 11px; }
.move-button { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; background: transparent; border: 0; border-radius: 6px; cursor: pointer; text-align: left; }
.move-button:hover { background: rgba(255,255,255,.07); }
.move-button.is-pending { color: #77746d; }
.move-button.is-pending::after { content: ""; width: 5px; height: 5px; margin-left: auto; background: #706d66; border-radius: 50%; }
.move-button.is-selected { color: #18200f; background: #9ac66a; font-weight: 800; }
.move-san { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-badge { display: grid; flex: 0 0 auto; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: white; font-size: 10px; font-weight: 900; }
.move-list-empty { padding: 30px 10px; color: var(--muted); font-size: 12px; text-align: center; }

.selected-move-card { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.selected-move-card h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.classification-mark { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: #777; font-size: 22px; font-weight: 900; }
.move-explanation { min-height: 92px; margin: 16px 0; color: #c4c1ba; font-size: 13px; line-height: 1.65; }
.move-metrics { display: grid; gap: 1px; overflow: hidden; margin: 0 0 18px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; }
.move-metrics div { display: flex; align-items: center; justify-content: space-between; padding: 11px; background: #2c2b28; }
.move-metrics dt { color: var(--muted); font-size: 11px; }
.move-metrics dd { margin: 0; font-size: 12px; font-weight: 800; }
.primary-button { min-height: 47px; padding: 0 18px; color: #15200d; background: linear-gradient(180deg, #9dcb68, var(--green)); border: 0; border-radius: 9px; box-shadow: 0 4px 0 #567f31; cursor: pointer; font-weight: 800; }
.primary-button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #567f31; }
.primary-button:disabled { opacity: .48; cursor: not-allowed; }
.full-width { width: 100%; }

.stats-skeleton { display: grid; gap: 14px; padding: 10px 0; }
.skeleton-line, .skeleton-grid span { height: 14px; background: linear-gradient(90deg, #343330 20%, #41403c 50%, #343330 80%); background-size: 300% 100%; border-radius: 5px; animation: shimmer 1.5s infinite; }
.skeleton-line { width: 60%; }
.skeleton-line.wide { width: 100%; }
.skeleton-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.skeleton-grid span { height: 64px; }
@keyframes shimmer { to { background-position: -150% 0; } }
.stats-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 5px 0 12px; color: var(--muted); font-size: 9px; text-align: center; }
.stats-head > div { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 11px; }
.stats-head > div:last-child { justify-content: flex-end; }
.color-dot { width: 8px; height: 8px; border: 1px solid #aaa; border-radius: 50%; }
.color-dot--white { background: #eee; }
.color-dot--black { background: #333; }
.headline-stats { display: grid; gap: 8px; }
.metric-row { display: grid; grid-template-columns: 1fr 1.35fr 1fr; align-items: center; gap: 10px; padding: 15px 12px; background: rgba(255,255,255,.035); border-radius: 10px; text-align: center; }
.metric-row strong { font-size: 22px; }
.metric-row span { color: var(--muted); font-size: 11px; line-height: 1.3; }
.stats-panel h3 { margin: 24px 0 12px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.classification-stats { display: grid; gap: 8px; }
.classification-row { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 10px; font-size: 16px; text-align: center; }
.classification-label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: rgba(255,255,255,.035); border-radius: 8px; text-align: left; }
.classification-label .move-badge { width: 18px; height: 18px; }

.classification--brilliant, [data-classification="brilliant"] { background-color: #1baca6; }
.classification--great, [data-classification="great"] { background-color: #5c9fc6; }
.classification--best-move, [data-classification="best-move"] { background-color: #81b64c; }
.classification--excellent, [data-classification="excellent"] { background-color: #79a95b; }
.classification--good, [data-classification="good"] { background-color: #96a56a; }
.classification--inaccuracy, [data-classification="inaccuracy"] { background-color: #f0c15b; color: #28251f; }
.classification--mistake, [data-classification="mistake"] { background-color: #e6912c; }
.classification--blunder, [data-classification="blunder"] { background-color: #ca4b45; }
.classification--book, [data-classification="book"] { background-color: #a98769; }
.classification--neutral { background: #5b5954; }

.upload-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: radial-gradient(circle at 50% 0, rgba(70,68,62,.75), rgba(20,20,18,.94) 58%); backdrop-filter: blur(10px); }
.upload-card { position: relative; width: min(100%, 560px); padding: 28px 32px 26px; background: rgba(45,43,40,.98); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; box-shadow: var(--shadow); }
.upload-close { position: absolute; top: 17px; right: 17px; display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; font-size: 22px; }
.upload-close:hover { color: white; background: rgba(255,255,255,.1); }
.upload-brand { margin-bottom: 27px; }
.upload-intro h1 { max-width: 460px; margin: 6px 0 9px; font-size: clamp(28px, 5vw, 40px); line-height: 1.04; letter-spacing: -.045em; }
.upload-intro > p:last-child { max-width: 470px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.upload-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 23px 0 13px; padding: 4px; background: #22211f; border-radius: 9px; }
.upload-tab { padding: 9px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 750; }
.upload-tab.is-active { color: var(--text); background: #3b3935; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.drop-zone { display: grid; place-items: center; min-height: 190px; padding: 20px; border: 1.5px dashed #63605a; border-radius: 11px; cursor: pointer; transition: .18s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--green); background: rgba(129,182,76,.06); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 7px; color: var(--green); background: rgba(129,182,76,.12); border-radius: 50%; font-size: 23px; }
.drop-zone strong { font-size: 13px; }
.drop-zone > span:not(.upload-icon) { margin-top: 4px; color: var(--muted); font-size: 11px; }
.drop-zone small { margin-top: 13px; color: #78756e; font-size: 9px; }
.selected-file { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; background: rgba(129,182,76,.08); border: 1px solid rgba(129,182,76,.22); border-radius: 8px; }
.selected-file > span { display: grid; place-items: center; width: 28px; height: 28px; color: #232a1b; background: #a0c974; border-radius: 6px; }
.selected-file div { display: grid; min-width: 0; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.selected-file small { color: var(--muted); font-size: 9px; }
.selected-file button { color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 20px; }
.textarea-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
textarea { display: block; width: 100%; min-height: 192px; resize: vertical; padding: 13px; color: #e8e6e0; background: #211f1d; border: 1px solid #55524d; border-radius: 9px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.5; }
textarea:focus { border-color: var(--green); }
.character-count { display: block; margin-top: 5px; color: #77746d; font-size: 9px; text-align: right; }
.upload-error { margin: 10px 0 0; padding: 9px 11px; color: #ffb4aa; background: rgba(224,90,71,.12); border-radius: 7px; font-size: 11px; }
.upload-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 14px; }
.privacy-note { margin: 14px 0 0; color: #79766f; font-size: 9px; text-align: center; }
.privacy-note span { color: var(--green); }
.toast { position: fixed; z-index: 70; right: 24px; bottom: 24px; max-width: 350px; padding: 12px 15px; color: white; background: #373531; border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 1150px) {
  :root { --board-size: min(66vw, 650px, calc(100vw - 520px)); }
  .sidebar { width: 74px; align-items: center; padding: 20px 11px; }
  .sidebar .brand-name, .side-action span:last-child, .sidebar-note span:last-child { display: none; }
  .side-action { justify-content: center; }
  .review-layout { grid-template-columns: minmax(450px, 1fr) 370px; margin-left: 74px; padding: 18px; }
}

@media (min-width: 901px) and (max-height: 780px) {
  :root { --board-size: min(calc(100dvh - 300px), 640px, calc(100vw - 810px)); }
  .review-layout { padding-top: 14px; padding-bottom: 14px; }
  .game-meta { margin-bottom: 5px; }
  .player-row { padding: 5px 0; }
  .player-avatar { width: 34px; height: 34px; }
  .board-toolbar { margin-top: 6px; }
  .arrow-legend { margin-top: 5px; }
}

@media (max-width: 900px) {
  :root { --board-size: min(78vw, 640px, calc(100vw - 112px)); }
  .sidebar { display: none; }
  .review-layout { display: block; height: auto; min-height: 100vh; margin: 0; padding: 0; overflow: visible; }
  .board-column { padding: 12px 14px 18px; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; width: min(100%, calc(var(--board-size) + 42px)); margin-bottom: 17px; }
  .mobile-header .brand-mark { width: 32px; height: 32px; font-size: 21px; }
  .mobile-header .icon-button { width: 36px; height: 36px; }
  .review-panel { min-height: 520px; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; }
  .tab-panel { max-height: 560px; }
  .game-meta { margin-left: 42px; }
}

@media (max-width: 560px) {
  :root { --board-size: calc(100vw - 102px); }
  .board-column { padding: 10px 9px 14px; }
  .mobile-header, .game-meta { width: 100%; }
  .game-meta { margin-left: 0; padding-left: 40px; }
  .game-meta-detail { max-width: 42%; }
  .eval-bar { width: 30px; }
  .player-row { width: var(--board-size); margin-left: 0; }
  .player-row { grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 7px; }
  .player-avatar { width: 32px; height: 32px; }
  .clock { min-width: 76px; padding: 7px; font-size: 16px; }
  .board-toolbar { width: var(--board-size); margin-left: 0; grid-template-columns: 40px 40px minmax(54px,1fr) 40px 40px 40px; }
  .toolbar-divider { display: none; }
  .nav-button { height: 40px; }
  .upload-overlay { align-items: start; padding: 12px; }
  .upload-card { padding: 22px 18px; border-radius: 14px; }
  .upload-brand { margin-bottom: 20px; }
  .upload-intro h1 { font-size: 29px; }
  .drop-zone { min-height: 168px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
