/* =====================================================================
   Duel Review: dark charcoal theme (2026-12-02).
   All site colours are set here once, as variables. Game art (cards, wonders, war track, coins,
   card colours) keeps its own colours and sits on the dark table area.
   Contrast (WCAG): main text 14.7:1 on panels, secondary 8.0, muted 5.9; white on the emerald
   buttons use dark ink #0B2417, 5.95; emerald *text* uses --accent-text (7.5); label badges use dark text on the label colour.
   ===================================================================== */
:root {
  --bg: #18181B; --panel: #1F1F24; --raised: #2A2A31; --line: #34343C;
  --text: #F2F2F5; --text2: #B4B4BE; --muted: #9A9AA6;
  --accent: #17B26A; --accent-h: #1DC878; --accent-d: #0E7C49;
  --accent-text: #1DC878;   /* the accent emerald, lightened so it passes 4.5:1 as text and 3:1 as thin lines */
  --selected: #16352A;
  /* move labels: fill colour, and the dark text used on that fill */
  --k-brilliant: #26C2A3; --k-brilliant-ink: #062B24;   /* Superb */
  --k-great: #749BBF;     --k-great-ink: #0B1B2A;       /* Clutch */
  --k-best: #81B64C;      --k-best-ink: #12260A;
  --k-mistake: #FFA459;   --k-mistake-ink: #3A1C02;     /* shown as "Not optimal" */
  --k-mistake2: #E8893A;  --k-mistake2-ink: #2E1706;    /* "Mistake": reserved, no tier uses it yet */
  --k-blunder: #FA412D;   --k-blunder-ink: #FFFFFF; --k-blunder-text: #FF5D49;   /* -text: the red lightened to pass 4.5:1 as small text */
  /* game colours (card types): vivid, as on the table. White text passes 4.5:1 on brown, red, blue and purple;
     grey, yellow and green take the dark --card-ink instead. */
  --brown: #8B5A2B; --gray: #8E99A4; --blue: #2474CF; --green: #2E9E4F; --yellow: #F2B01E; --red: #D8322A; --purple: #7B4BC2;
  --card-ink: #14161A; --coin: #F5B81F;
  --p0: #2e9e5b; --p1: #d9483b;
  --cw: 74px; --ch: 114px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.35 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent-text); }
h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
select, button { font: inherit; font-weight: 600; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; }
button { cursor: pointer; } button:hover { border-color: var(--muted); } button:disabled { opacity: .4; cursor: default; }

/* ---------- top bar ---------- */
header { display: flex; align-items: center; gap: 16px; padding: 6px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: "Trajan Pro", "Cinzel", Georgia, "Times New Roman", serif; letter-spacing: .06em; text-transform: uppercase; font-size: 16px; font-weight: 700; color: var(--text); }
.tag { font-family: ui-rounded, system-ui, sans-serif; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0; background: var(--raised);
  border: 1px solid var(--line); padding: 1px 6px; border-radius: 9px; color: var(--text2); vertical-align: middle; }
header a, header a.ghost-small { color: var(--accent-text) !important; }
.ghost { margin-left: auto; }
.ghost-small { font-size: 12px; padding: 4px 10px; }
.result { color: var(--text2); }
main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; padding: 10px 16px; align-items: start; }
@media (max-width: 1250px) { main { grid-template-columns: 1fr; } .review { position: static !important; } }
footer { color: var(--muted); font-size: 11px; padding: 6px 16px 14px; }

/* ---------- table ---------- */
.table { min-width: 0; overflow-x: auto; }
.status { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-bottom: 0; font-weight: 700; font-size: 14px;
  text-align: center; padding: 6px; border-radius: 10px 10px 0 0; min-width: 980px; }
.tablerow { display: flex; min-width: 980px; }
.evalbar { position: relative; width: 26px; flex: none; background: var(--raised); border-right: 1px solid var(--line); border-radius: 0 0 0 10px; overflow: hidden; }
/* win-chance bar: the accent share is the bottom player's chance of winning */
#evalfill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); transition: height .5s cubic-bezier(.2,.75,.25,1); }
#evalnum { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 10px; font-weight: 800; color: #fff; }
.felt { flex: 1; min-width: 0; display: grid; grid-template-columns: 236px minmax(510px, 1fr) 166px; gap: 8px; padding: 8px; color: var(--text);
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.wcol, .mcol, .bcol { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 0; }

/* wonders: landscape cards, two per row */
.wonders { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #ffffff08; padding: 5px; border-radius: 8px; }
.wonder { position: relative; aspect-ratio: 158 / 100; border-radius: 6px; box-shadow: 0 2px 4px #000a; overflow: visible; }
.wonder svg { display: block; width: 100%; height: 100%; }
.wonder.slot { background: #ffffff06; border: 1px dashed var(--line); box-shadow: none; }
/* the pictures are soft-toned paintings: lift them a little. Not built yet = full colour with a dashed inner line (built ones get a gold frame). */
.wonder svg, .card svg { filter: saturate(1.2) contrast(1.05); }
.wonder.unbuilt { outline: 1.5px dashed #fff6d8cc; outline-offset: -4px; }

/* cities: seven colour columns of header strips */
.city { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; min-height: 100px; }
.col { display: flex; flex-direction: column; gap: 1px; border-radius: 4px; padding: 2px; min-height: 100px; border: 1px solid #ffffff0a; }
.city.top .col { flex-direction: column-reverse; }
.t-brown { background: #8B5A2B59; border-color: #8B5A2B; } .t-gray { background: #8E99A44d; border-color: #8E99A4; } .t-yellow { background: #F2B01E47; border-color: #F2B01E; } .t-red { background: #D8322A4d; border-color: #D8322A; }
.t-blue { background: #2474CF4d; border-color: #2474CF; } .t-green { background: #2E9E4F4d; border-color: #2E9E4F; } .t-purple { background: #7B4BC254; border-color: #7B4BC2; }
.strip { position: relative; height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-align: center; cursor: default;
  box-shadow: 0 1px 2px #0008; border-radius: 4px; font-size: 11px; }
.strip svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.strip.named { height: 20px; line-height: 20px; padding: 0 8px; font-weight: 600; }
.c-brown, .strip.named.c-brown { background: var(--brown); } .c-gray, .strip.named.c-gray { background: var(--gray); } .c-blue, .strip.named.c-blue { background: var(--blue); }
.c-green, .strip.named.c-green { background: var(--green); } .c-yellow, .strip.named.c-yellow { background: var(--yellow); }
.c-red, .strip.named.c-red { background: var(--red); } .c-purple, .strip.named.c-purple { background: var(--purple); }
.strip.named.c-gray, .strip.named.c-yellow, .strip.named.c-green { color: var(--card-ink); }

/* pyramid: portrait cards */
.pyramid-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; padding: 6px 0; }
.pyramid { position: relative; perspective: 900px; }
.card { position: absolute; width: var(--cw); height: var(--ch); border-radius: 7px; box-shadow: 0 2px 6px #000c; cursor: default; display: flex; flex-direction: column; }
.card svg { display: block; width: 100%; height: 100%; }
/* covered cards: full colour, only a 6% shade, so the takeable ones still sit a touch brighter */
.card:not(.free):not(.back) svg { filter: saturate(1.2) contrast(1.05) brightness(.94); }
.card.ghost { pointer-events: none; }
.draft { display: grid; grid-template-columns: 190px 190px; gap: 8px; justify-content: center; padding: 10px; background: #ffffff08; border-radius: 8px; }
#startpick { grid-template-columns: auto auto; margin-bottom: 8px; }
.startpick { padding: 8px 16px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font-weight: 600; }

/* board column: player panels, painted war track, progress tokens */
.info { background: var(--raised); border-radius: 10px; padding: 6px 8px; border: 2px solid transparent; min-height: 96px; box-shadow: 0 1px 3px #0006; }
.info.to-move { border-color: var(--accent-text); }
.pname { font-weight: 800; font-size: 15px; color: var(--text) !important; }
.stats { display: flex; gap: 3px; margin: 4px 0; flex-wrap: wrap; }
.stat { position: relative; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 0 5px; font-size: 11px; white-space: nowrap; }
.stat b { font-size: 13px; margin-right: 2px; }
.s-coins { border-color: var(--coin); color: var(--coin); }
.s-coins b { color: var(--text); }
.ptokens { display: flex; gap: 3px; flex-wrap: wrap; }
.turn { display: inline-block; margin-top: 4px; color: #0B2417; background: var(--accent); border-radius: 9px; padding: 0 8px; font-size: 11px; font-weight: 700; }
.board { display: grid; grid-template-columns: 78px 1fr; gap: 4px; align-items: center; }
.track { display: flex; flex-direction: column; gap: 1px; background: linear-gradient(180deg, #E0301E, #FF9A1F 50%, #E0301E) center / 100% 100% no-repeat, url(/static/art/track.jpg) center / 100% 100% no-repeat; background-blend-mode: soft-light, normal; border-radius: 10px; padding: 30px 16px; box-shadow: 0 2px 6px #000a; }
.space { position: relative; height: 16px; line-height: 16px; border-radius: 8px; text-align: center; font-size: 9.5px; color: #ffe9c4; font-weight: 800; text-shadow: 0 1px 2px #000; }
.space::before { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; border-top: 1px solid #ffe9c455; }
.space.z1::before, .space.z2::before, .space.z3::before { display: none; }
.space.cap { color: transparent; height: 4px; }
.space.mid::before { display: block; border-top: 2px solid #ffe9c4aa; }
.pawn { position: absolute; left: 50%; top: 50%; width: 34px; height: 14px; margin: -7px 0 0 -17px; background: linear-gradient(180deg, #FF5A3C, #D8322A 55%, #B01E17); border: 2px solid #FFE08A; border-radius: 7px; box-shadow: 0 0 0 1px #5a0d08, 0 0 8px #FF7A2Ecc, 0 1px 3px #000a; z-index: 5; }
.loot { position: absolute; left: -14px; top: 1px; font-size: 9px; line-height: 14px; padding: 0 3px; background: #A31A12; color: #FFE9A8; border: 1px solid var(--coin); border-radius: 3px; white-space: nowrap; z-index: 4; font-weight: 800; }
.tokens { display: flex; flex-direction: column; gap: 5px; align-items: center; padding: 6px 4px; background: linear-gradient(180deg, #1C8E45, #17803D); border: 2px solid #2FBF5F; border-radius: 10px; min-height: 60px; }
.token { display: inline-block; width: 30px; height: 30px; border-radius: 50%; cursor: default; }
.token svg { display: block; width: 100%; height: 100%; }
.token.offer { outline: 2px solid var(--coin); }
.token.slot { background: #0000001a; border: 1px dashed #ffffff26; }
.boxlabel { font-size: 9px; color: #fff; text-transform: uppercase; letter-spacing: .06em; }
.discard-box { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 6px 10px; min-width: 980px; }
.discard-box h4, .discard .muted { color: var(--muted); }
.discard { display: flex; gap: 3px; flex-wrap: wrap; min-height: 20px; }
.legend { display: none; }

/* move marks on the table: the move played gets its label's colour, the AI's choice green */
.hl-played, .hl-best { position: relative; z-index: 50 !important; }
.card.hl-played, .card.hl-best { position: absolute; }
.hl-played { box-shadow: 0 0 0 4px var(--kc, var(--text2)), 0 4px 14px #000c; }
.hl-best { box-shadow: 0 0 0 3px var(--k-best), 0 4px 14px #000c; }
.k-brilliant { --kc: var(--k-brilliant); --ki: var(--k-brilliant-ink); }
.k-great { --kc: var(--k-great); --ki: var(--k-great-ink); }
.k-best { --kc: var(--k-best); --ki: var(--k-best-ink); }
.k-mistake { --kc: var(--k-mistake); --ki: var(--k-mistake-ink); }
.k-blunder { --kc: var(--k-blunder); --ki: var(--k-blunder-ink); }
.k-ok, .k-forced { --kc: var(--text2); --ki: var(--bg); }
.card.hl-played.k-brilliant, .wonder.hl-played.k-brilliant { box-shadow: 0 0 0 4px var(--k-brilliant), 0 0 18px #26C2A3aa; }
[data-badge]::after { content: attr(data-badge); position: absolute; top: -10px; right: -10px; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px;
  background: var(--kc, var(--text2)); color: var(--ki, var(--bg)); font: 800 13px/24px ui-rounded, system-ui, sans-serif; text-align: center; box-shadow: 0 2px 4px #000a; z-index: 60; }
.hl-best[data-badge]::after { background: var(--k-best); color: var(--k-best-ink); }
.token[data-badge]::after, .strip[data-badge]::after { top: -8px; right: -8px; min-width: 18px; height: 18px; font-size: 10px; line-height: 18px; }
.delta { position: absolute; right: 0; top: -4px; font-weight: 800; font-size: 13px; pointer-events: none; }
.delta.up { color: var(--k-best); } .delta.down { color: var(--k-blunder-text); }

/* ---------- review panel ---------- */
.review { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 0 10px; box-shadow: 0 10px 40px #0008; }
.rv-head { text-align: center; padding: 12px; background: var(--panel); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; color: var(--text);
  font-family: "Trajan Pro", "Cinzel", Georgia, serif; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; font-weight: 800; }
.rv-star { display: inline-block; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; background: var(--accent); color: #0B2417; font-size: 13px; margin-right: 6px; }
.coach { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 4px 14px 0; align-items: start; }
.avatar { width: 64px; height: 64px; }
.bubble { position: relative; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 84px; box-shadow: 0 2px 6px #0006; }
.bubble::before { content: ""; position: absolute; left: -8px; top: 22px; border: 8px solid transparent; border-right-color: var(--line); border-left: 0; }
.bubble.stopped { animation: stop-pulse 1.1s ease-out 1; }
@keyframes stop-pulse { 0% { box-shadow: 0 0 0 0 #1DC878cc; } 100% { box-shadow: 0 0 0 2px #1DC87844; } }
.say-title { font-weight: 800; font-size: 15px; line-height: 1.25; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.say-title .badge { flex: none; }
.say-title .chip { margin-left: auto; background: var(--line); color: var(--text); border-radius: 6px; padding: 1px 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.say-title .chip.neg { background: #3A2224; color: var(--k-blunder-text); }
.say { margin-top: 5px; font-size: 13.5px; line-height: 1.4; }
.say.luck { color: var(--text2); font-size: 12px; }
.say.context { margin-top: 6px; padding: 5px 8px; border-left: 3px solid var(--accent-text); background: var(--selected); border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--text); }
.more { margin-top: 8px; font-size: 12px; color: var(--text2); }
.more summary { cursor: pointer; font-weight: 700; color: var(--text2); }
.more .cand { display: grid; grid-template-columns: 1fr 44px; gap: 6px; border-top: 1px solid var(--line); padding: 3px 0; }
.more .cand.is-played { font-weight: 700; color: var(--text); }
.more .cand span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.explain { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.badge { display: inline-block; min-width: 22px; height: 22px; line-height: 22px; padding: 0 4px; border-radius: 11px; background: var(--kc, var(--text2)); color: var(--ki, var(--bg));
  font-size: 12px; font-weight: 800; text-align: center; }
.themes { margin: 6px 0 4px; padding-left: 18px; font-size: 13px; line-height: 1.4; }
.themes li { margin-bottom: 4px; }

.actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 0 14px; }
.act { padding: 12px; font-size: 15px; font-weight: 800; border: 0; border-radius: 10px; background: var(--raised); color: var(--text); box-shadow: 0 3px 0 #111114; }
.act:hover { background: #33333B; border: 0; }
.act:active { transform: translateY(2px); box-shadow: 0 1px 0 #111114; }
.act.play { background: var(--accent); color: #0B2417; box-shadow: 0 4px 0 var(--accent-d); font-size: 17px; }
.act.play:hover { background: var(--accent-h); }
.act.play:active { box-shadow: 0 1px 0 var(--accent-d); }
.act.play.on { background: #4A4A55; box-shadow: 0 4px 0 #2A2A31; }

.moves-box, .graph-box, .summary { padding: 0 14px; }
.moves { position: relative; list-style: none; margin: 0; padding: 4px; max-height: 190px; overflow: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
.moves li { display: grid; grid-template-columns: 26px 10px 1fr auto; gap: 6px; padding: 3px 6px; border-radius: 4px; cursor: pointer; align-items: center; font-weight: 600; font-size: 12.5px; }
.moves li:hover { background: #33333B; }
.moves li.current { background: var(--selected); color: #fff; box-shadow: inset 3px 0 0 var(--accent-text); }
.moves .num { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.moves li.current .num { color: var(--text2); }
.moves .seat { width: 8px; height: 8px; border-radius: 50%; }
.moves .badge { min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; }
.agebreak { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 4px; cursor: default !important; display: block !important; }
#graph { width: 100%; height: 112px; display: block; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.graph-legend { display: flex; gap: 12px; margin-top: 5px; font-size: 11px; align-items: center; flex-wrap: wrap; color: var(--text2); }
.transport { display: grid; grid-template-columns: auto auto 1fr auto auto auto; gap: 6px; align-items: center; padding: 0 14px; }
.transport button { padding: 8px 12px; font-size: 14px; background: var(--raised); color: var(--text); border: 0; }
.transport select { padding: 7px 6px; font-size: 12px; }
.step-label { text-align: center; color: var(--text2); }
.summary table { width: 100%; border-collapse: collapse; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.summary th { padding: 6px 4px; font-size: 12px; color: var(--text); text-align: center; font-weight: 700; }
.summary td { text-align: center; padding: 5px 4px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
.summary td.lab { text-align: left; padding-left: 10px; font-weight: 700; }
.summary td.n { font-weight: 800; font-size: 15px; color: var(--kc, var(--text)); }
.summary td.n.k-blunder { color: var(--k-blunder-text); }
.summary .explain { padding: 6px 2px 0; }
.warning { margin: 0 14px; padding: 7px 10px; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; color: var(--text2); font-size: 11.5px; }
.warning strong { color: var(--text); }
.tip { position: fixed; z-index: 1000; background: #0E0E10f2; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; max-width: 260px; pointer-events: none; font-size: 12px; }
.tip b { display: block; } .tip i { color: var(--text2); font-style: normal; display: block; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--raised); color: var(--text); border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; z-index: 200; }

/* ---------- summary screen ---------- */
.intro { min-height: calc(100vh - 50px); display: flex; align-items: center; justify-content: center; padding: 30px 16px; background: var(--bg); }
.intro-card { width: min(680px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px 22px; box-shadow: 0 20px 60px #000a; text-align: center; }
.intro .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-text); font-weight: 700; font-family: "Trajan Pro", "Cinzel", Georgia, serif; }
.intro .when { margin-top: 6px; font-size: 14px; color: var(--text2); }
.intro .duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin: 22px 0 14px; }
.intro .vs { align-self: center; font-weight: 800; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.intro .side { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 14px 12px; }
.intro .side.winner { border-color: var(--accent-text); box-shadow: 0 0 0 1px #1DC87855 inset; }
.intro .role { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.intro .name { font-size: 19px; font-weight: 800; margin-top: 3px; word-break: break-word; }
.intro .crown { color: var(--accent-text); }
.intro .score { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 4px; }
.intro .wonders-built { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 10px; }
.intro .chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--selected); color: var(--text); border: 1px solid #4A3B6B; }
.intro .found { margin-top: 10px; font-size: 12px; color: var(--muted); }
.intro .found .br { color: var(--k-brilliant); font-weight: 800; } .intro .found .g { color: var(--k-great); font-weight: 800; }
.intro .found .b { color: var(--k-blunder-text); font-weight: 800; }
.intro .headline { font-size: 17px; font-weight: 700; margin: 4px 0 18px; }
.review-btn { width: 100%; padding: 16px; font-size: 21px; font-weight: 800; color: #0B2417; background: var(--accent); border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 5px 0 var(--accent-d); transition: transform .08s, box-shadow .08s, background .15s; }
.review-btn:hover { background: var(--accent-h); border: 0; }
.review-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-d); }
.review-btn:disabled { background: var(--line); color: var(--text2); box-shadow: none; cursor: default; }
.intro .progress { height: 6px; background: var(--raised); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.intro .progress .bar { height: 100%; background: var(--accent-text); transition: width .6s; }
.intro .progress-text { font-size: 12px; color: var(--text2); margin-top: 6px; }
.intro .facts { margin-top: 14px; font-size: 13px; color: var(--text2); }
.intro .notes { margin-top: 14px; text-align: left; font-size: 12px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: grid; gap: 4px; }
.intro .notes-title { font-weight: 700; }
.intro .fine { margin-top: 14px; font-size: 11px; color: var(--muted); }
.intro-themes { margin-top: 16px; text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.intro-themes .notes-title { font-weight: 800; color: var(--accent-text); font-family: "Trajan Pro", "Cinzel", Georgia, serif; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.intro-themes ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.45; }
.intro-themes li { margin-bottom: 4px; }

/* ---------- luck (apart from the move labels) ---------- */
.luck-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-left: 5px; flex: none; }
.luck-ico svg { display: block; width: 100%; height: 100%; }
.say.luckline { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 7px 9px; border-radius: 8px; background: var(--panel); border: 1px dashed var(--line); font-size: 12.5px; }
.say.luckline .luck-ico { width: 20px; height: 20px; margin: 0; }
.say.outcome { font-weight: 800; color: var(--text); }
.graph-legend .lg { width: 26px; height: 8px; vertical-align: middle; } .graph-legend .lg.tri { width: 10px; height: 9px; }
.skill-luck { margin-top: 16px; text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.skill-luck .notes-title { font-weight: 800; color: var(--accent-text); letter-spacing: .06em; text-transform: uppercase; font-size: 12px; margin-bottom: 8px; }
.sl-rows { display: grid; gap: 6px; }
.sl-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13.5px; }
.sl-row.luck { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sl-track { position: relative; height: 14px; border-radius: 7px; background: var(--panel); }
.sl-track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--muted); }
.sl-track i { position: absolute; top: 0; bottom: 0; background: var(--text2); }
.sl-track i.pos { left: 50%; border-radius: 0 7px 7px 0; } .sl-track i.neg { right: 50%; border-radius: 7px 0 0 7px; }
/* luck is striped as well as coloured, so it reads without colour */
.sl-row.luck .sl-track i { background: repeating-linear-gradient(135deg, #9FB1D1 0 5px, #6F7F9C 5px 9px); }
.sl-num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.sl-sum { margin-top: 10px; font-size: 12.5px; color: var(--text2); }
.sl-verdict { margin-top: 8px; font-size: 15px; font-weight: 800; line-height: 1.35; }
.sl-fine { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* =====================================================================
   Review page only: body.rv is set in index.html (play.html and results.html load this file too,
   and keep the rules above). Neutral charcoal surfaces (green only as the accent and the coach's disc), a big coach, sections that sit straight on the
   panel (spacing or one hairline between them, no boxes inside boxes), and chunky keys: every
   button and the speech bubble has a 6px ledge that it presses down onto.
   Contrast on the panel (#2F2D2A): text 14.6:1, secondary 9.5, muted 6.0. Bubble: 14.9 / 7.6 / 5.4.
   ===================================================================== */
body.rv {
  --bg: #262421; --panel: #2F2D2A; --raised: #3A3835; --line: #45423E;
  --text: #F4F3F1; --text2: #C3C0BB; --muted: #9C9893;
  --selected: #4A4744; --card-ledge: #161513; --btn: #3D3B38; --hover: #4A4845; --band: #1E1C1A;
}
body.rv .ghost-small:hover { background: var(--hover); }
body.rv .tip { background: #1A1917f2; }
@media (min-width: 1251px) { body.rv main { grid-template-columns: minmax(0, 1fr) 430px; } }

/* ---------- the panel: one surface, no frames ---------- */
body.rv .review { gap: 16px; padding: 0 16px 16px; border: 0; border-radius: 16px; box-shadow: none; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
body.rv .rv-head { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 14px 0 12px; background: none; border-bottom: 1px solid var(--line); border-radius: 0;
  font-size: 18px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--text); }
body.rv .rv-star { display: grid; place-items: center; width: 26px; height: 26px; margin: 0; border-radius: 50%; background: var(--accent); color: #0B2417; font-size: 15px; line-height: 1; }

/* label badge: a solid disc in the label's colour */
body.rv .badge { display: inline-grid; place-items: center; flex: none; width: 22px; min-width: 22px; height: 22px; padding: 0; border-radius: 50%;
  background: var(--kc, var(--text2)); color: var(--ki, var(--bg)); font-size: 13px; font-weight: 800; line-height: 1; }

/* ---------- the coach ---------- */
body.rv .coach { grid-template-columns: 104px minmax(0, 1fr); gap: 18px; padding: 0; align-items: start; }
body.rv .coach .avatar { width: 104px; height: 104px; box-shadow: none; }
body.rv .bubble {
  --text: #1C1B19; --text2: #4A4743; --muted: #6A6661; --line: #DDDAD5; --accent-text: #0E7C49; --k-blunder-text: #C4281A;
  background: #FFFFFF; color: var(--text); border: 0; border-radius: 18px; padding: 14px 16px 16px; min-height: 104px; margin-bottom: 6px; box-shadow: 0 6px 0 #BEBAB4; }
body.rv .bubble::before { left: -8px; top: 40px; width: 18px; height: 18px; border: 0; border-radius: 0 0 0 4px; background: #F6F9F7; transform: rotate(45deg); }
body.rv .bubble.stopped { animation: rv-stop .9s ease-out 1; }
@keyframes rv-stop { 0% { outline: 4px solid #1DC878; outline-offset: 0; } 100% { outline: 4px solid #1DC87800; outline-offset: 7px; } }
body.rv .say-title { gap: 8px; flex-wrap: nowrap; align-items: flex-start; font-size: 19.5px; font-weight: 800; line-height: 1.25; }
body.rv .say-title .badge { width: 26px; min-width: 26px; height: 26px; font-size: 15px; }
body.rv .say-title .chip { margin-left: auto; padding: 3px 9px; border: 0; border-radius: 8px; background: #ECEAE6; color: #3C3A36; font-size: 14px; font-weight: 800; }
body.rv .say-title .chip.neg { background: #FBE2DE; color: #B42318; }
body.rv .say { margin-top: 8px; font-size: 17.5px; font-weight: 600; line-height: 1.4; }
body.rv .say.luck { font-size: 14px; color: var(--text2); }
body.rv .say.outcome { font-size: 16px; font-weight: 800; color: var(--text); }
body.rv .say.context { padding: 0 0 0 10px; background: none; border-left: 3px solid #17B26A; border-radius: 0; font-size: 15px; color: var(--text2); }
body.rv .say.luckline { padding: 0; background: none; border: 0; border-radius: 0; font-size: 14px; color: var(--text2); }
body.rv .themes { font-size: 16px; }
body.rv .more { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; }
body.rv .more summary { font-weight: 800; }
body.rv .bubble .explain { font-size: 12px; }
body.rv .live-note { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; font-size: 13px; color: var(--text2); }

/* ---------- keys ---------- */
body.rv .actions { grid-template-columns: 1fr 1.25fr; gap: 12px; padding: 0; }
body.rv .act { min-height: 56px; padding: 0 12px; border: 0; border-radius: 16px; background: var(--btn); color: var(--text); font-size: 14px; font-weight: 800;
  box-shadow: 0 6px 0 var(--card-ledge); transition: transform .08s, box-shadow .08s, background .12s; }
body.rv .act:hover { background: var(--hover); border: 0; }
body.rv .act:active { transform: translateY(6px); box-shadow: 0 0 0 var(--card-ledge); }
body.rv .act.play { background: var(--accent); color: #0B2417; font-size: 18px; box-shadow: 0 6px 0 var(--ledge); }
body.rv .act.play:hover { background: var(--accent-h); }
body.rv .act.play:active { box-shadow: 0 0 0 var(--ledge); }
body.rv .act.play.on { background: var(--btn); color: var(--text); box-shadow: 0 6px 0 var(--card-ledge); }
body.rv .act.play.on:active { box-shadow: 0 0 0 var(--card-ledge); }
body.rv .transport { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0 0 6px; }
body.rv .transport button { display: grid; place-items: center; height: 58px; padding: 0; border: 0; border-radius: 14px; background: var(--btn); color: var(--text);
  box-shadow: 0 6px 0 var(--card-ledge); transition: transform .08s, box-shadow .08s, background .12s; }
body.rv .transport button:hover:not(:disabled) { background: var(--hover); }
body.rv .transport button:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 0 0 var(--card-ledge); }
body.rv .transport svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
body.rv .transport svg .solid { fill: currentColor; }
body.rv #auto .i-pause { display: none; }
body.rv .actions:has(#play.on) ~ .transport #auto .i-play { display: none; }
body.rv .actions:has(#play.on) ~ .transport #auto .i-pause { display: block; }
body.rv .transport-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -6px; font-size: 12.5px; color: var(--muted); }
body.rv .transport-meta select { margin-left: 4px; padding: 3px 6px; border: 0; border-radius: 8px; background: var(--raised); color: var(--text2); font-size: 12.5px; }

/* ---------- move list: one row per round, a column per player ---------- */
body.rv .moves-box, body.rv .graph-box, body.rv .summary { padding: 0; }
body.rv .moves { max-height: 236px; margin: 0; padding: 0; overflow-y: auto; background: none; border: 0; border-radius: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
body.rv .mrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); column-gap: 4px; align-items: center; min-height: 32px; }
body.rv .mrow .num { padding-left: 4px; text-align: left; color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
body.rv .mhead { position: sticky; top: 0; z-index: 2; min-height: 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
body.rv .mh { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); font-size: 12px; font-weight: 800; }
body.rv .mv { display: flex; align-items: center; gap: 6px; min-width: 0; height: 28px; padding: 0 8px; border-radius: 7px; color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; }
body.rv .mv.empty { cursor: default; }
body.rv .mv .mt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.rv .mv .badge { width: 20px; min-width: 20px; height: 20px; font-size: 12px; }
body.rv .mv .luck-ico { margin-left: 0; }
body.rv .mv:not(.empty):hover { background: var(--raised); }
body.rv .mv.current { background: #4B4847; color: #fff; }
body.rv .mv.k-mistake .mt { color: var(--k-mistake); }
body.rv .mv.k-blunder .mt { color: var(--k-blunder-text); }
body.rv .mv.pending { color: var(--muted); }
body.rv .mv.pending .badge { background: none; color: var(--muted); animation: pend 1.2s ease-in-out infinite; }
body.rv .agebreak { padding: 10px 4px 4px 38px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- graph: a light area on a darker band ---------- */
body.rv #graph, body.rv #intro-graph { display: block; width: 100%; background: var(--band); border: 0; border-radius: 10px; cursor: pointer; }
body.rv #graph { height: 96px; }
body.rv #intro-graph { height: 150px; }
body.rv .graph-legend { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.5; }
body.rv .graph-legend b { color: var(--text2); font-weight: 700; }
body.rv .graph-legend .lg.tri { width: 10px; height: 9px; vertical-align: baseline; }

/* ---------- the tally: label, each player's count in the label's colour, the badge between ---------- */
body.rv .summary { padding-top: 12px; border-top: 1px solid var(--line); }
body.rv .tally { width: 100%; table-layout: fixed; border-collapse: collapse; background: none; border: 0; border-radius: 0; }
body.rv .tally td { padding: 7px 4px; border: 0; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
body.rv .tally td.lab { width: 34%; padding-left: 0; text-align: left; color: var(--text); font-size: 15px; font-weight: 800; }
body.rv .tally td.mid { width: 44px; }
body.rv .tally td.n { color: var(--kc, var(--text)); font-size: 21px; font-weight: 800; }
body.rv .tally td.n.k-blunder { color: var(--k-blunder); }
body.rv .tally tr.t-top td { padding-bottom: 12px; }
body.rv .tally tr.t-first td { padding-top: 16px; border-top: 1px solid var(--line); }
body.rv .t-player { display: grid; justify-items: center; gap: 6px; min-width: 0; }
body.rv .t-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 15px; font-weight: 800; }
body.rv .t-tile { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; color: #fff; font-size: 30px; font-weight: 800; box-shadow: inset 0 -5px 0 #0000003a; }
body.rv .t-player.winner .t-tile { outline: 3px solid var(--accent-text); outline-offset: 2px; }
body.rv .t-role { color: var(--muted); font-size: 11.5px; font-weight: 700; }
body.rv .t-result { color: var(--text2); font-size: 15px; font-weight: 800; }
body.rv .t-result.winner { color: var(--accent-text); }
body.rv .t-score { color: var(--text); font-size: 21px; font-weight: 800; }
body.rv .summary .tally td { padding: 4px; }
body.rv .summary .tally td.lab { font-size: 13.5px; }
body.rv .summary .tally td.n, body.rv .summary .t-score { font-size: 17px; }
body.rv .summary .t-name { font-size: 13px; color: var(--text2); }
body.rv .summary .tally tr.t-top td { padding-bottom: 6px; }
body.rv .summary .tally tr.t-first td { padding-top: 8px; border-top: 0; }
body.rv .summary .explain { padding: 6px 0 0; font-size: 11.5px; color: var(--muted); }
body.rv .warning { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
body.rv .warning strong { color: var(--text2); }

/* ---------- summary screen: the same panel, on its own ---------- */
body.rv .intro { align-items: flex-start; padding: 22px 16px 40px; }
body.rv .intro-card { display: flex; flex-direction: column; gap: 18px; width: min(540px, 100%); padding: 0 22px 22px; background: var(--panel); border: 0; border-radius: 16px; box-shadow: none; text-align: left; }
body.rv .intro .coach { align-items: center; }
body.rv .intro .bubble { min-height: 0; margin-bottom: 6px; }
body.rv .intro .bubble::before { top: 50%; margin-top: -9px; }
body.rv .intro .bubble .say { margin: 0; }
body.rv .review-btn { width: 100%; min-height: 66px; margin-bottom: 6px; padding: 0 24px; border: 0; border-radius: 16px; background: var(--accent); color: #0B2417;
  font-size: 21px; font-weight: 800; letter-spacing: 0; text-transform: none; box-shadow: 0 6px 0 var(--ledge); transition: transform .08s, box-shadow .08s, background .12s; }
body.rv .review-btn:hover { background: var(--accent-h); }
body.rv .review-btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ledge); }
body.rv .review-btn:disabled { background: var(--raised); color: var(--muted); box-shadow: none; transform: none; }
body.rv .intro .progress { margin: 0; background: var(--band); }
body.rv .intro .progress-text { margin: -10px 0 0; font-size: 13px; color: var(--text2); }
body.rv .intro .fine, body.rv .intro .facts { margin: 0; font-size: 11.5px; color: var(--muted); }
body.rv .intro .facts { font-size: 12.5px; }
body.rv .intro .notes { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; font-size: 12.5px; color: var(--text2); }
body.rv .intro .notes-title { margin-bottom: 8px; color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: 0; text-transform: none; }
body.rv .intro-themes, body.rv .skill-luck { margin: 0; padding: 16px 0 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
body.rv .intro-themes ul { margin: 0; font-size: 14.5px; }
body.rv .sl-track { background: var(--band); }
body.rv .sl-row.luck { margin-top: 2px; padding-top: 0; border-top: 0; }
body.rv .intro .kicker { color: var(--accent-text); }
body.rv .intro-card > .kicker:first-child { margin-top: 22px; }
body.rv .intro .headline { margin: 0; }
body.rv .intro .when { margin: 0; }

/* ---------- narrower screens ---------- */
@media (max-width: 1250px) { body.rv .review { max-height: none; overflow: visible; } }
@media (max-width: 760px) {
  body.rv main { padding: 8px; gap: 10px; }
  body.rv .review { gap: 14px; padding: 0 12px 14px; border-radius: 14px; }
  body.rv .coach { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  body.rv .coach .avatar { width: 72px; height: 72px; }
  body.rv .bubble { min-height: 76px; padding: 12px 13px 14px; border-radius: 16px; }
  body.rv .bubble::before { top: 27px; }
  body.rv .say-title { font-size: 17.5px; }
  body.rv .say { font-size: 16px; }
  body.rv .act { min-height: 52px; font-size: 13px; }
  body.rv .act.play { font-size: 16px; }
  body.rv .transport { gap: 8px; }
  body.rv .transport button { height: 54px; }
  body.rv .mv { font-size: 13.5px; padding: 0 6px; }
  body.rv .intro { padding: 0 0 24px; }
  body.rv .intro-card { width: 100%; gap: 16px; padding: 0 14px 20px; border-radius: 0; }
  body.rv #intro-graph { height: 120px; }
  body.rv .t-tile { width: 52px; height: 52px; font-size: 24px; }
  body.rv .tally td.lab { font-size: 14px; }
  body.rv .review-btn { min-height: 60px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  body.rv .act, body.rv .transport button, body.rv .review-btn { transition: none; }
  body.rv .bubble.stopped { animation: none; }
}
.sfx-btn { min-width: 38px; height: 34px; border-radius: 10px; border: 2px solid var(--line, #34343C); background: var(--raised, #2A2A31); color: inherit; font-size: 16px; cursor: pointer; margin-right: 6px; }

/* =====================================================================
   Review page: nothing moves between moves except what the move itself changes (2026-12-03).
   Every box whose content changes from move to move has a fixed height, so its neighbours stay put.
   ===================================================================== */
/* player boxes: room for a two-line name, the stats, the tokens and the "to move" tag */
body.rv .info { height: 138px; min-height: 0; overflow: hidden; }
/* built cards: a fixed-height row; a long column squeezes its strips (cropped, not squashed) instead of growing */
body.rv .city { height: 112px; min-height: 0; }
body.rv .col { min-height: 0; overflow: hidden; }
body.rv .col .strip { flex: 0 1 22px; min-height: 9px; }
body.rv .col .strip.named { flex-basis: 20px; }
body.rv .col .strip svg { inset: 0 0 auto 0; height: 22px; }
body.rv .city.top .col .strip svg { inset: auto 0 0 0; }
/* the pyramid area is as tall as the tallest age needs */
body.rv .pyramid-wrap { height: 416px; min-height: 0; }
/* the war track keeps its place when the token box beside it grows */
body.rv .board { height: 358px; }
body.rv .tokens { align-self: start; margin-top: 38px; }
/* discard pile: room for two rows from the start */
body.rv .discard { min-height: 43px; }
/* the coach: a fixed-height area, so the keys, the move list and the graph below never move.
   A long text scrolls inside the bubble; opening "Moves the AI measured" lets the area grow. */
@media (min-width: 761px) {
  body.rv main .coach { height: 200px; flex: none; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; }   /* flex: none, or the scrolling panel squeezes it back to its content */
  body.rv main .coach .avatar { width: 88px; height: 88px; }
  body.rv main .coach .bubble { min-height: 88px; max-height: 194px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #C9C5BF transparent; }
  body.rv main .coach:has(details[open]) { height: auto; }
  body.rv main .coach:has(details[open]) .bubble { max-height: none; }
}

/* ---------- summary screen on a wide window: three columns, no scrolling ---------- */
body.rv .intro { min-height: 0; }
body.rv .intro-a, body.rv .intro-b, body.rv .intro-c { display: contents; }
@media (min-width: 1240px) {
  body.rv .intro { padding: 10px 16px 4px; }
  body.rv > footer { padding-bottom: 6px; }
  body.rv .intro-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) minmax(0, 1.1fr); column-gap: 30px; row-gap: 14px; align-items: start;
    width: min(1340px, 100%); padding: 0 24px 18px; }
  body.rv .intro-card > .rv-head { grid-column: 1 / -1; padding: 11px 0 9px; }
  body.rv .intro-a, body.rv .intro-b, body.rv .intro-c { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  body.rv .intro-b { padding: 0 30px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 -15px; }
  body.rv #intro-graph { height: 132px; }
  body.rv .intro .t-tile { width: 48px; height: 48px; font-size: 23px; }
  body.rv .intro .tally td { padding: 4px; }
  body.rv .intro .tally tr.t-top td { padding-bottom: 8px; }
  body.rv .intro .tally tr.t-first td { padding-top: 10px; }
  body.rv .intro .tally td.n, body.rv .intro .t-score { font-size: 19px; }
  body.rv .intro-themes, body.rv .skill-luck { padding-top: 0; border-top: 0; }
  body.rv .intro-c .intro-themes { padding-top: 12px; border-top: 1px solid var(--line); }
  body.rv .intro-themes ul { font-size: 13.5px; }
  body.rv .intro-themes li { margin-bottom: 2px; }
  body.rv .sl-verdict { font-size: 14px; }
}
@media (min-width: 1240px) { body.rv .intro .t-name { white-space: normal; overflow: visible; text-align: center; line-height: 1.2; } }
/* beside the board the panel should fit the window: the move list gives up height so the playback keys stay on screen */
/* never fewer than four turns (28px head + 4 x 32px rows + an age line) */
@media (min-width: 1251px) { body.rv .moves { max-height: clamp(186px, calc(100vh - 615px), 320px); } }

/* =====================================================================
   Review page: no top bar. A games menu on the left (every reviewed game, like a list of chats),
   with "Play against Inspector Dice" at its bottom. It can be hidden; the table scales to the room left (app.js fitTable).
   ===================================================================== */
/* the menu is fixed to the window's left edge; the page makes room for it with padding */
body.rv { padding-left: 232px; transition: padding-left .18s; }
body.rv.side-closed { padding-left: 0; }
body.rv .side { position: fixed; left: 0; top: 0; z-index: 40; width: 232px; height: 100vh; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--band); border-right: 1px solid var(--line); }
body.rv.side-closed .side { visibility: hidden; border: 0; }
body.rv .side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 14px 10px 10px 14px; }
body.rv .side-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; font-size: 16px; font-weight: 800; white-space: nowrap; }
body.rv .side-brand img { width: 26px; height: 26px; border-radius: 7px; }
body.rv .side-toggle { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text2); }
body.rv .side-toggle:hover { background: var(--raised); color: var(--text); border: 0; }
body.rv .side-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
body.rv .side-open { display: none; position: fixed; left: 8px; top: 8px; z-index: 50; background: var(--btn); color: var(--text); box-shadow: 0 4px 0 var(--card-ledge); }
body.rv.side-closed .side-open { display: grid; }
body.rv.side-closed > main, body.rv.side-closed > .intro { padding-left: 52px; }
body.rv .side-label { padding: 8px 16px 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
body.rv .game-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
body.rv .game-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; }
body.rv .game-item:hover { background: var(--panel); border: 0; }
body.rv .game-item.current { background: var(--raised); }
body.rv .gi-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
body.rv .gi-dot.won { background: var(--accent); } body.rv .gi-dot.lost { background: var(--k-blunder); }
body.rv .gi-text { display: grid; min-width: 0; }
body.rv .gi-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 800; }
body.rv .gi-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; font-weight: 600; }
body.rv .side-foot { display: grid; gap: 12px; padding: 10px 12px 18px; border-top: 1px solid var(--line); }
body.rv .side-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
body.rv .side-link { padding: 2px 0; border: 0; background: none; color: var(--text2); font-size: 12px; font-weight: 700; text-decoration: none; }
body.rv .side-link:hover { color: var(--text); border: 0; text-decoration: underline; }
/* the menu's main key: same build as the review's Next button */
body.rv .side-play { display: grid; place-items: center; min-height: 52px; padding: 6px 10px; border-radius: 16px; background: var(--accent); color: #0B2417; text-align: center; text-decoration: none;
  font-size: 13px; font-weight: 800; letter-spacing: .8px; line-height: 1.2; text-transform: uppercase; box-shadow: 0 6px 0 var(--ledge); transition: transform .08s, box-shadow .08s, background .12s; }
body.rv .side-play:hover { background: var(--accent-h); }
body.rv .side-play:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ledge); }
body.rv .game-item:focus-visible, body.rv .side-play:focus-visible, body.rv .side-toggle:focus-visible, body.rv .side-link:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
/* the scaled table never needs its own sideways scrollbar */
body.rv main .table { overflow: visible; }
/* small windows: the menu lies over the page instead of beside it */
@media (max-width: 899px) {
  body.rv, body.rv.side-closed { padding-left: 0; }
  body.rv .side { z-index: 80; width: min(280px, 86vw); box-shadow: 0 0 0 100vmax #0009; }
  body.rv.side-closed > main, body.rv.side-closed > .intro { padding-left: 8px; padding-top: 50px; }
}
@media (prefers-reduced-motion: reduce) { body.rv { transition: none; } body.rv .side-play { transition: none; } }

/* End-of-game bubble: compact so title + two tips fit the fixed coach height. */
body.rv #move-card .themes { margin: 2px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.3; }
body.rv #move-card .themes li { margin: 3px 0; }
body.rv #move-card .say-title + .say { margin-top: 4px; }

/* Start review is a main button: same lettering as Next (the standard). */
body.rv .review-btn { text-transform: uppercase; letter-spacing: .8px; font-weight: 800; color: #0B2417; }

/* ---------------------------------------------------------------- 3 Dec: board, bar, discards, coach faces */
/* Win-chance bar: white fill on the dark track; the number flips colour where it crosses the fill. */
body.rv #evalfill { background: #F4F3F1; }
body.rv #evalnum { color: #fff; mix-blend-mode: difference; }

/* Conflict board: pale frame with pointed ends, our painting inside, marks on top. */
body.rv .board { grid-template-columns: minmax(0, 1fr) 42px; gap: 4px; }
body.rv .track { position: relative; gap: 1px; padding: 18px 0; background: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 2px 4px #0009); }
body.rv .track::before, body.rv .track::after { content: ""; position: absolute; z-index: 0;
  clip-path: polygon(50% 0, 86% 2.6%, 100% 5.2%, 100% 94.8%, 86% 97.4%, 50% 100%, 14% 97.4%, 0 94.8%, 0 5.2%, 14% 2.6%); }
body.rv .track::before { inset: 0; background: linear-gradient(90deg, #CDB78F, #E6D5B2 30%, #E9DAB9 70%, #CDB78F); }
body.rv .track::after { inset: 4px; background: url(/static/art/track2.jpg) center / 100% 100% no-repeat; }
body.rv .space { z-index: 1; height: 16px; flex: none; font-size: 0; text-shadow: none; }
body.rv .space::before { display: none; }
body.rv .space.cap { height: 16px; color: inherit; }
body.rv .space.zline::before { display: block; content: ""; position: absolute; left: 8px; right: 8px; top: -1px; border-top: 1px dashed #FFF6DDB0; }
body.rv .space .oval { position: absolute; left: 47%; right: 9px; top: 0; bottom: 0; border: 1.3px solid #FFF8E6C8; border-radius: 50%; box-shadow: 0 0 3px #0005, inset 0 0 4px #0003;
  font: normal 800 9px/14px inherit; color: #FFF3D2; text-align: center; }
body.rv .space.cap .oval { background: #6B1A1455; }
body.rv .pawn { left: calc(73.5% - 4.5px); top: 50%; width: 52px; height: 19px; margin: -9.5px 0 0 -26px; background: none; border: 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 2px 2px #000a); z-index: 5; }
body.rv .pawn svg { display: block; width: 100%; height: 100%; }
body.rv .loot, body.rv .vpmark { position: absolute; z-index: 3; left: 9px; transform: translateY(-50%); }
body.rv .loot { width: 31px; height: 44px; padding: 0; border: 1px solid #5E0D0A; border-radius: 5px; background: linear-gradient(160deg, #C22A22, #9E1712 60%, #84110D); box-shadow: 0 1px 3px #000a, inset 0 0 0 1px #E0564A55;
  display: grid; place-items: center; }
body.rv .loot b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE680, #E9B62A 70%, #B98412); border: 1px solid #7A5200; color: #fff; font-size: 14px; font-weight: 900; line-height: 1; text-shadow: 0 1px 1px #5a3a00, 0 0 2px #5a3a00; }
body.rv .vpmark { width: 24px; height: 24px; left: 12px; }
body.rv .vpmark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
body.rv .vpmark b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #23401F; line-height: 1; }
body.rv .tokens { padding: 5px 3px; }

/* Discard pile: small real cards, fanned. */
body.rv .discard { min-height: 78px; gap: 0; flex-wrap: nowrap; align-items: flex-start; padding-left: 0; }
body.rv .discard .dcard { position: relative; flex: none; width: 50px; height: 77px; border-radius: 5px; margin-right: 5px; box-shadow: 0 1px 4px #000b; }
body.rv .discard.tight .dcard { margin-right: -16px; }
body.rv .discard .dcard.hl-played, body.rv .discard .dcard.hl-best { position: relative; }
body.rv .discard .dcard:hover { z-index: 60; transform: translateY(-3px); }

/* Coach: upper half of Inspector Dice, his head rising out of the green disc. */
body.rv .coach .avatar { position: relative; background: none; overflow: visible; border-radius: 0; }
body.rv .coach .avatar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #14432F; }
/* The clip is wider and taller than the disc: above the disc's middle everything shows (so the head and
   a raised hand or glass stick out a little), below it only what is inside the disc. */
body.rv .coach .avatar .face-clip { position: absolute; left: -20%; right: -20%; bottom: 0; top: -22%; overflow: hidden; pointer-events: none;
  -webkit-mask: radial-gradient(circle closest-side, #000 98%, transparent 100%) bottom center / 71.43% 81.97% no-repeat, linear-gradient(#000, #000) right top / 85.7% 59% no-repeat;
  mask: radial-gradient(circle closest-side, #000 98%, transparent 100%) bottom center / 71.43% 81.97% no-repeat, linear-gradient(#000, #000) right top / 85.7% 59% no-repeat; }
body.rv .coach .avatar img { position: absolute; left: -20.1%; top: -20.7%; width: 125%; max-width: none; display: block; }

/* ---------------------------------------------------------------- 4 Dec: coach on emerald, flat table */
/* Coach: emerald disc, black suit lines (the dice-rv-* pictures). Faces are stacked; one shows. */
body.rv .coach .avatar::before { background: #14432F; }
body.rv .coach .avatar img { opacity: 0; transition: opacity .14s linear; }
body.rv .coach .avatar img.on { opacity: 1; }

/* The table: one surface like the review panel. No frames around its parts. */
body.rv main .table { background: var(--panel); border-radius: 16px; padding: 0 12px 10px; }
body.rv .status { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 6px 10px; font-size: 15px; font-weight: 800; }
body.rv .felt { background: none; box-shadow: none; padding: 10px 0 8px 10px; gap: 10px; }
body.rv .evalbar { margin: 10px 0 8px; border: 0; border-radius: 8px; background: var(--band); }
body.rv .wonders { background: none; padding: 0; }
body.rv .wonder.slot { border: 0; background: #ffffff0a; }
body.rv .city { height: var(--city-h, 112px); gap: 5px; }
body.rv .col { background: none; border-style: solid; border-width: 3px 0 0; border-radius: 0; padding: 3px 0 0; }
body.rv .city.top .col { border-width: 0 0 3px; padding: 0 0 3px; }
body.rv .info { background: none; border: 0; box-shadow: none; padding: 2px 4px; }
body.rv .info.to-move { border: 0; }
body.rv .stat { border: 0; background: var(--raised); padding: 1px 7px; }
body.rv .s-coins { color: var(--coin); }
body.rv .tokens { background: none; border: 0; padding: 0; }
body.rv .token.slot { border: 0; background: #ffffff0f; }
body.rv .draft { background: none; }
body.rv .discard-box { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 8px 0 0 10px; }
body.rv .legend { padding-left: 10px; }

/* ---- demo mode (?demo=review or ?demo=table): the page shown in a frame on the landing page ---- */
body.demo { padding-left: 0 !important; overflow: hidden; transition: none !important; }
body.demo .side, body.demo .side-toggle, body.demo #toast, body.demo #tip { display: none !important; }
body.demo-table main { grid-template-columns: minmax(0, 1fr) !important; }
body.demo-table .review, body.demo-table .evalbar, body.demo-table .legend { display: none !important; }
body.demo-table .hl-played, body.demo-table .hl-best { box-shadow: none !important; }
body.demo-table .hl-played::after, body.demo-table .hl-best::after, body.demo-table .hl-played::before, body.demo-table .hl-best::before { display: none !important; }
body.demo-table main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
body.demo-table footer, body.demo-table .footer, body.demo-table .disclaimer { display: none !important; }
body.demo-table, body.demo-table main .table { background: var(--panel); border-radius: 0; }

/* "Who starts the age": laid over the middle of the new pyramid, as on the play page. In the flow
   above it, it pushed the seven rows of age III down over the player's built cards. */
.pyramid-wrap { position: relative; }
#startpick { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 70; margin: 0; gap: 10px; padding: 14px;
  background: var(--panel); border-radius: 14px; box-shadow: 0 0 0 2px var(--line), 0 14px 36px #000b; white-space: nowrap; }
