/* =====================================================================
   Inspector Dice: the shared look (see review/DESIGN_BRIEF.md).
   Loaded after style.css / play.css on every page, and alone on the landing and onboarding pages.
   Tokens first, then the components (3D buttons, choice cards, speech bubble, progress bar,
   bottom bar), then the older pages' classes mapped onto them so everything matches.
   Move-label colours (--k-*) stay as style.css sets them.
   ===================================================================== */
:root {
  --bg: #18181B; --panel: #1F1F24; --raised: #2A2A31; --line: #34343C;
  --text: #F2F2F5; --text2: #B4B4BE; --muted: #9A9AA6;
  --accent: #17B26A; --accent-h: #1DC878; --accent-d: #0E7C49; --ledge: #0E7C49;
  --accent-text: #1DC878; --selected: #16352A;
  --card-ledge: #131316;
  --k-brilliant: #26C2A3; --k-great: #749BBF; --k-best: #81B64C; --k-mistake: #FFA459; --k-blunder: #FA412D;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 600; }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }

/* ---------- 3D button: a face with a 4px ledge; pressing moves it down onto the ledge ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px;
  font: 800 15px/1.1 var(--font); text-transform: uppercase; letter-spacing: .8px; text-decoration: none; text-align: center;
  color: #0B2417; background: var(--accent); border: 0; border-radius: 12px; box-shadow: 0 4px 0 var(--ledge);
  cursor: pointer; transition: background .12s, transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--accent-h); border: 0; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ledge); }
.btn.secondary { background: var(--raised); color: var(--text); box-shadow: 0 4px 0 var(--card-ledge), inset 0 0 0 2px var(--line); }
.btn.secondary:hover { background: #33333B; }
.btn.secondary:active { box-shadow: 0 0 0 var(--card-ledge), inset 0 0 0 2px var(--line); }
.btn:disabled, .btn.disabled { background: var(--raised); color: var(--muted); box-shadow: none; cursor: default; transform: none; opacity: 1; }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 12px; border-radius: 10px; box-shadow: 0 3px 0 var(--ledge); }
.btn.small.secondary { box-shadow: 0 3px 0 var(--card-ledge), inset 0 0 0 2px var(--line); }
.btn.small:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ledge); }
.textlink { color: var(--accent-text); font-weight: 800; text-decoration: none; }
.textlink:hover { text-decoration: underline; }

/* ---------- choice card ---------- */
.choices { display: grid; gap: 12px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 12px 16px; text-align: left;
  font: 800 17px/1.25 var(--font); color: var(--text); background: var(--panel); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: 12px; cursor: pointer; transition: transform .1s, background .12s, border-color .12s; -webkit-tap-highlight-color: transparent; }
.choice-card:hover { background: var(--raised); border-color: #4A4A55; }
.choice-card:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.choice-card .ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 24px; line-height: 1; }
.choice-card .sub { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-top: 2px; }
.choice-card[aria-pressed="true"], .choice-card[aria-checked="true"] { background: var(--selected); border-color: var(--accent); color: #fff; animation: card-pop .18s ease-out; }
.choice-card[aria-pressed="true"] .sub, .choice-card[aria-checked="true"] .sub { color: #D5C6F2; }
@keyframes card-pop { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ---------- speech bubble (the tail points left, at the mascot) ---------- */
.speech { position: relative; display: inline-block; padding: 14px 18px; font: 700 18px/1.35 var(--font); color: var(--text);
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px; }
.speech::before { content: ""; position: absolute; left: -11px; top: 26px; width: 18px; height: 18px; background: var(--panel);
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); border-radius: 0 0 0 4px; }
.speech.down::before { left: 50%; top: auto; bottom: -11px; margin-left: -9px; transform: rotate(-45deg); }

/* ---------- thick progress bar ---------- */
.pbar { position: relative; height: 16px; border-radius: 8px; background: var(--raised); overflow: hidden; }
.pbar > i { position: absolute; left: 0; top: 0; bottom: 0; min-width: 16px; border-radius: 8px; background: var(--accent); transition: width .35s cubic-bezier(.3,1.3,.6,1); }
.pbar > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 2px; background: #ffffff38; }

/* ---------- fixed bottom bar ---------- */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg); border-top: 2px solid var(--line); padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); }
.bottom-bar .inner { max-width: 1000px; margin: 0 auto; display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.bottom-bar .btn { min-width: 170px; }

/* ---------- site header and logo ---------- */
.logo { white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; font: 800 20px/1 var(--font); color: var(--text); text-decoration: none; letter-spacing: 0; text-transform: none; }
.logo img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.logo .tag { font: 700 10px/1 var(--font); }
.site-head { display: flex; align-items: center; gap: 18px; padding: 14px 24px; max-width: 1100px; margin: 0 auto; }
.site-head nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.site-head nav a { color: var(--text2); font-weight: 800; text-decoration: none; font-size: 14px; }
.site-head nav a:hover { color: var(--text); }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; font-weight: 800; font-size: 14px; color: var(--text2); text-align: left; }
.field input, .input { width: 100%; min-height: 48px; padding: 0 14px; font: 700 16px var(--font); color: var(--text); background: var(--panel);
  border: 2px solid var(--line); border-radius: 12px; }
.field input:focus, .input:focus { outline: none; border-color: var(--accent); }
.field input::placeholder, .input::placeholder { color: var(--muted); font-weight: 600; }

/* =====================================================================
   Older pages (review, play, results): same components under their existing class names
   ===================================================================== */
select, button { font-family: var(--font); }
header { gap: 14px; padding: 8px 16px; }
.brand { font-family: var(--font) !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 18px !important; font-weight: 800 !important;
  display: inline-flex; align-items: center; gap: 8px; }
.brand a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.tag { font-family: var(--font) !important; }
.rv-head, .intro .kicker, .intro-themes .notes-title { font-family: var(--font) !important; }
header .ghost-small, .ghost-small { font: 800 12px/1 var(--font); text-transform: uppercase; letter-spacing: .6px; padding: 9px 12px; border-radius: 10px; border: 0;
  background: var(--raised); color: var(--text) !important; box-shadow: 0 3px 0 var(--card-ledge), inset 0 0 0 2px var(--line); transition: transform .08s, box-shadow .08s; }
.ghost-small:hover { background: #33333B; border: 0; }
.ghost-small:active { transform: translateY(3px); box-shadow: 0 0 0 var(--card-ledge), inset 0 0 0 2px var(--line); }
.review-btn { min-height: 54px; padding: 0 24px; font: 800 17px/1.1 var(--font); text-transform: uppercase; letter-spacing: .8px; border-radius: 12px;
  background: var(--accent); box-shadow: 0 4px 0 var(--ledge); transition: transform .08s, box-shadow .08s, background .12s; }
.review-btn:hover { background: var(--accent-h); }
.review-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ledge); }
.review-btn:disabled { background: var(--raised); color: var(--muted); box-shadow: none; transform: none; }
.act { font-family: var(--font); text-transform: uppercase; letter-spacing: .8px; font-size: 13px; border-radius: 12px; box-shadow: 0 4px 0 var(--card-ledge), inset 0 0 0 2px var(--line); transition: transform .08s, box-shadow .08s; }
.act:active { transform: translateY(4px); box-shadow: 0 0 0 var(--card-ledge), inset 0 0 0 2px var(--line); }
.act.play { font-size: 15px; background: var(--accent); box-shadow: 0 4px 0 var(--ledge); }
.act.play:hover { background: var(--accent-h); }
.act.play:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ledge); }
.act.play.on { box-shadow: 0 4px 0 var(--card-ledge); }
.opt { font-family: var(--font); border-radius: 12px; box-shadow: 0 4px 0 var(--ledge); transition: transform .08s, box-shadow .08s; }
.opt:hover { background: var(--accent-h); }
.opt:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ledge); }
.opt.off, .opt:disabled { transform: none; }
.transport button { border-radius: 10px; box-shadow: 0 3px 0 var(--card-ledge); transition: transform .08s, box-shadow .08s; }
.transport button:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.bubble { border: 2px solid var(--line); border-radius: 12px; box-shadow: none; }
.bubble::before { left: -9px; top: 22px; width: 14px; height: 14px; border: 0; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); background: var(--raised); transform: rotate(45deg); }
.coach .avatar, .dice-avatar { border-radius: 50%; }
.coach .avatar { width: 64px; height: 64px; background: #14432F url(/static/img/inspector-dice-head.svg) center / 100% no-repeat; box-shadow: 0 0 0 2px var(--line); }
.intro-card { border: 2px solid var(--line); }
.lvl { border-width: 2px !important; border-bottom-width: 4px !important; border-radius: 12px !important; }
.lvl:has(input:checked) { border-color: var(--accent) !important; }
.intro .progress { height: 16px; border-radius: 8px; }
.intro .progress .bar { background: var(--accent); border-radius: 8px; position: relative; }
.intro .progress .bar::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 2px; background: #ffffff38; }
/* a move the analyser has not reached yet (review opened while the analysis is still running) */
.moves li.pending { color: var(--muted); }
.moves li.pending .badge { visibility: visible !important; background: none; color: var(--muted); animation: pend 1.2s ease-in-out infinite; }
@keyframes pend { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.live-note { margin: 0 14px; padding: 8px 12px; background: var(--selected); border: 2px solid #4A3B6B; border-radius: 12px; font-size: 12.5px; color: var(--text); display: grid; gap: 6px; }
.live-note .pbar { height: 10px; } .live-note .pbar > i::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  .btn, .choice-card, .pbar > i, .review-btn, .act, .opt, .ghost-small { transition: none; animation: none; }
}

