/* ============ Jev Game Theory Lab — design system ============ */
:root {
  --font: 'Inter', 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Fraunces', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* ---- tabletop materials (same in light & dark: a real table doesn't change colour) ---- */
  --felt-1: #17714f;          /* felt centre */
  --felt-2: #0b3f2d;          /* felt edge */
  --felt-line: rgba(255, 255, 255, .14);
  --rail-1: #4a3020;          /* walnut / leather rail */
  --rail-2: #1c120b;
  --gold: #c9a45c;            /* brass trim, dealer button, highlights */
  --gold-2: #ecd9a6;
  --paper: #fbfaf6;           /* playing-card / die face */
  --card-red: #c62f3b;
  --card-black: #18181c;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --radius: 18px;
  --radius-sm: 12px;
  --accent: #4f46e5;
  --good: #0f9f6e;
  --bad: #e0435a;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-theme='light'] {
  --bg: #f5f3ee;
  --bg-grad:
    radial-gradient(1100px 620px at 88% -8%, rgba(201, 164, 92, .16), transparent 62%),
    radial-gradient(900px 520px at -12% 6%, rgba(79, 70, 229, .07), transparent 60%);
  --surface: #fffdf9;
  --surface-2: #f1eee7;
  --text: #16150f;
  --muted: #6f6a60;
  --border: rgba(22, 21, 15, .09);
  --border-strong: rgba(22, 21, 15, .16);
  --shadow: 0 1px 2px rgba(22, 21, 15, .04), 0 10px 30px -14px rgba(22, 21, 15, .16);
  --shadow-lg: 0 2px 6px rgba(22, 21, 15, .05), 0 30px 70px -28px rgba(22, 21, 15, .32);
  --brand: #a77b2f;
  --s-human: #2a78d6; --s-jev-raw: #eb6834; --s-jev-hinted: #1baf7a; --s-bot: #eda100;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #0c0d10;
  --bg-grad:
    radial-gradient(1100px 620px at 88% -8%, rgba(201, 164, 92, .12), transparent 62%),
    radial-gradient(900px 520px at -12% 6%, rgba(79, 70, 229, .12), transparent 60%);
  --surface: #14161b;
  --surface-2: #1c1f26;
  --text: #eeece6;
  --muted: #8f8b82;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 30px 70px -28px rgba(0, 0, 0, .9);
  --brand: #d8b46c;
  --s-human: #3987e5; --s-jev-raw: #d95926; --s-jev-hinted: #199e70; --s-bot: #c98500;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before { /* paper grain */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--noise); opacity: .035; mix-blend-mode: multiply;
}
[data-theme='dark'] body::before { mix-blend-mode: screen; opacity: .025; }
#app { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 750; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 1em; }
.display, .display-sm { font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; font-optical-sizing: auto; }
.display em, .display-sm em { font-style: italic; font-weight: 400; color: var(--brand); }
.muted { color: var(--muted); }
small { font-size: 12px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ico { display: inline-flex; line-height: 0; }
.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: inline-flex; align-items: flex-end; gap: 3px; height: 30px; padding: 6px 7px; border-radius: 9px; background: var(--text); flex: none; }
.logo span { width: 4px; border-radius: 2px; background: var(--bg); }
.logo span:nth-child(1) { height: 7px; opacity: .55; }
.logo span:nth-child(2) { height: 11px; opacity: .8; }
.logo span:nth-child(3) { height: 17px; background: var(--gold); }
.nav { display: flex; align-items: center; gap: 4px; flex: none; }
.nav-link { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 550; white-space: nowrap; transition: .2s var(--ease); }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: .2s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.sm { width: 28px; height: 28px; }
.lang {
  display: inline-flex; padding: 3px; margin-left: 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.lang span { padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--muted); transition: .2s var(--ease); }
.lang span.on { background: var(--text); color: var(--bg); }
@media (max-width: 720px) { .brand-text small { display: none; } }
@media (max-width: 520px) {
  .nav-link { padding: 6px 8px; }
  .nav .icon-btn[title='GitHub'] { display: none; }
  .brand-text b { font-size: 15px; }
}
@media (max-width: 400px) {
  .brand-text { display: none; }
  .nav { gap: 2px; }
  .nav-link { padding: 6px 6px; }
  .lang { margin-left: 2px; }
  .lang span { padding: 2px 8px; }
}

/* ---------- layout ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.page.narrow { max-width: 780px; padding-top: 36px; }
.section { padding: 40px 0 16px; }
.section-head { margin-bottom: 24px; max-width: 640px; }
.display-sm { font-size: clamp(26px, 3.2vw, 36px); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: clamp(44px, 8vw, 104px) 0 clamp(28px, 5vw, 56px);
}
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; margin-bottom: 22px; }
.hero-title .line { white-space: nowrap; }
:lang(zh) .hero h1 { font-size: clamp(32px, 4.6vw, 62px); line-height: 1.15; letter-spacing: -.01em; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 5px 14px 5px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); background: var(--surface);
}
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.lead { font-size: clamp(16px, 1.5vw, 18px); color: var(--muted); max-width: 540px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.hero-visual { position: relative; }
.hero-glow {
  position: absolute; inset: 10% 5% -5% 10%; border-radius: 40px; filter: blur(50px); opacity: .45;
  background: radial-gradient(circle at 30% 30%, var(--gold), transparent 60%), radial-gradient(circle at 70% 70%, #4f46e5, transparent 60%);
}
.hero-card {
  position: relative; padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transition: transform .6s var(--ease);
}
.hero-card:hover { transform: translateY(-4px); }
.hc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.hc-game { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13.5px; color: var(--accent); }
.hc-model { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.hc-q { font-family: var(--font-display); font-size: 17px; line-height: 1.45; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); margin-bottom: 18px; min-height: 76px; }
.hc-foot { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.hc-foot b { color: var(--text); font-family: var(--mono); font-size: 12px; }
.hc-dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.hc-dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong); transition: .4s var(--ease); }
.hc-dots span.on { width: 18px; background: var(--accent); }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.lg { padding: 13px 24px; font-size: 15px; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.action { min-width: 140px; }
.btn.action.good { background: var(--good); color: #fff; }
.btn.action.bad { background: var(--bad); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent);
}

/* ---------- game cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card-art {
  position: relative; height: 150px; display: grid; place-items: center; overflow: hidden;
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  background:
    radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%),
    color-mix(in srgb, var(--accent) 6%, var(--surface-2));
}
.card-art::before { content: ''; position: absolute; inset: 0; background-image: var(--noise); opacity: .18; mix-blend-mode: overlay; }
.card-art::after { /* fine grid */
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 12%, transparent) 1px, transparent 1px),
                    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
}
.card-icon { position: relative; z-index: 1; filter: drop-shadow(0 8px 18px color-mix(in srgb, var(--accent) 35%, transparent)); transition: transform .5s var(--ease); }
.card:hover .card-icon { transform: scale(1.08) rotate(-3deg); }
.card-num { position: absolute; top: 14px; left: 16px; z-index: 1; font-family: var(--font-display); font-size: 13px; color: var(--muted); }
.card-body { padding: 18px 20px 22px; flex: 1; }
.card-body h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin: 10px 0 6px; }
.card-body p { color: var(--muted); font-size: 14px; margin: 0; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.card-go {
  position: absolute; right: 16px; top: 128px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); transform: scale(.85); opacity: 0; transition: .35s var(--ease);
}
.card:hover .card-go { transform: scale(1); opacity: 1; }

/* ---------- game page ---------- */
.game-page { padding-top: 22px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 14px; transition: color .2s; }
.back:hover { color: var(--text); }
.game-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.gh-title { display: flex; align-items: center; gap: 16px; max-width: 720px; flex: 1 1 420px; min-width: 0; }
.game-head .controls { flex: none; }
/* phones: the two control groups stack full-width, and the options share the row equally */
@media (max-width: 640px) {
  .game-head .controls { flex: 1 1 100%; flex-direction: column; gap: 10px; }
  .game-head .controls .control, .game-head .controls .seg { width: 100%; }
  .mode-control .seg button { min-width: 0; padding: 8px 6px; }
}
.gh-title h1 { margin: 0 0 2px; }
.gh-title p { margin: 0; font-size: 14.5px; }
.title-icon {
  flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px;
  color: color-mix(in srgb, var(--accent) 90%, var(--text));
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--accent) 8%, var(--surface-2)));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
}
.controls { display: flex; gap: 14px; flex-wrap: wrap; }
.control { position: relative; display: flex; flex-direction: column; gap: 5px; }
.control-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.info-btn { display: inline-grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; transition: color .2s; }
.info-btn:hover { color: var(--accent); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.seg button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: .25s var(--ease);
}
.seg button.on { background: var(--text); color: var(--bg); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: min(380px, 88vw); padding: 18px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: rise .25s var(--ease);
}
.pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pop-item { margin-bottom: 12px; }
.pop-item p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.pop-note { margin: 0; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .popover { left: 0; right: auto; } }

.game-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.rules { font-size: 14px; }
.rules summary {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; padding: 6px 14px 6px 12px; border-radius: 999px;
  font-weight: 650; font-size: 13px; color: color-mix(in srgb, var(--accent) 85%, var(--text));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.rules summary:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.rules summary:active { transform: scale(.98); }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: ''; width: 6px; height: 6px; margin-left: 2px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s var(--ease); }
.rules[open] summary::after { transform: rotate(225deg) translateY(-1px); }
.rules[open] { flex-basis: 100%; order: 10; }
.rules p { margin: 10px 0 0; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); color: var(--muted); max-width: 860px; animation: rise .3s var(--ease); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 5px 12px; border-radius: 999px; background: var(--surface-2); }
.badge.offline { color: color-mix(in srgb, #d97706 80%, var(--text)); background: color-mix(in srgb, #f59e0b 12%, transparent); }
.dot-off { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .game-layout { grid-template-columns: 1fr; } }

.board {
  padding: clamp(16px, 3vw, 28px); border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); min-height: 440px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ---------- opponent mode control ---------- */
.mode-control .seg {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
}
.mode-control .seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; } /* equal-width options, whatever the label length */
.mode-control .seg button { padding: 8px 18px; min-width: 76px; text-align: center; }
.mode-control .seg button:not(.on):not(:disabled):hover { color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.mode-control .seg button.on { background: var(--accent); color: #fff; }
.policy-control.off { opacity: .45; }
.pop-sep { height: 1px; margin: 4px 0 12px; background: var(--border); }
.mode-hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); opacity: .85; }
.vs-badge { font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.vs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-bot); }
.vs-hinted .vs-dot { background: var(--s-jev-hinted); }
.vs-raw .vs-dot { background: var(--s-jev-raw); }

/* ---------- limit notice ---------- */
.limit {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: color-mix(in srgb, #f59e0b 10%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 30%, var(--border));
  animation: rise .3s var(--ease);
}
.limit-blocked { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 28%, var(--border)); }
.limit-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px color-mix(in srgb, #f59e0b 20%, transparent); }
.limit-blocked .limit-dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 20%, transparent); }
.limit-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; line-height: 1.5; }
.limit-text span { color: var(--muted); }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.chip-muted { color: var(--muted); background: var(--surface-2); }
@media (max-width: 600px) { .limit { flex-wrap: wrap; } .limit .btn { margin-left: 23px; } }

/* ---------- think panel ---------- */
.think {
  position: sticky; top: 84px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.think-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.think-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.mode-chip { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; color: var(--muted); border: 1px solid var(--border-strong); }
.think-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.think-head { flex-wrap: wrap; }
.think-tools { display: flex; align-items: center; gap: 8px; }
.think-caption { flex-basis: 100%; font-size: 12px; color: var(--muted); margin-top: -2px; }
.eye-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: .2s var(--ease); }
.eye-btn:hover { color: var(--text); border-color: var(--border-strong); }
.think-body { position: relative; }
.think-cover { display: none; }
.odds-hidden .think-body > :not(.think-cover) { filter: blur(7px); opacity: .55; pointer-events: none; user-select: none; }
.odds-hidden .think-cover { display: grid; place-items: center; position: absolute; inset: 0; z-index: 2; }
.odds-hidden .think-cover span { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: default; }
/* game boards that visualise Jev's odds follow the same switch */
.odds-hidden .rps-plot > :not(figcaption), .odds-hidden .rps-mix, .odds-hidden .rps-guess { filter: blur(6px); opacity: .5; pointer-events: none; user-select: none; }
.think-empty { color: var(--muted); font-size: 14px; margin: 0; }
.think-q { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.pulse.local { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.think-loading { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.think-loading .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite; }
.think-loading .dot:nth-child(2) { animation-delay: .15s; }
.think-loading .dot:nth-child(3) { animation-delay: .3s; margin-right: 6px; }
@keyframes bounce { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(72px, auto) 1fr 42px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-label { display: flex; align-items: center; gap: 6px; font-weight: 550; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: color-mix(in srgb, var(--accent) 40%, var(--surface-2)); max-width: 0; transition: max-width .8s var(--ease); }
.bar-fill.in { max-width: 100%; }
.bar-row.picked .bar-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, var(--surface)), var(--accent)); }
.bar-val { text-align: right; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tag { font-size: 9.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; color: #fff; background: var(--accent); }
.conf { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.conf b { color: var(--text); font-family: var(--mono); }
.extras { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.extra { display: grid; grid-template-columns: 1fr 70px 40px; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.extra b { color: var(--text); font-family: var(--mono); font-size: 12px; text-align: right; }
.mini-track { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mini-fill { height: 100%; background: var(--text); opacity: .7; border-radius: 99px; max-width: 0; transition: max-width .8s var(--ease); }
.mini-fill.in { max-width: 100%; }
.sealed { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.seal-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.sealed b { font-size: 14px; }
.sealed p { margin: 3px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.review { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.review-step { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.review-step:last-child { border-bottom: 0; padding-bottom: 0; }
.review-step .think-q { margin-bottom: 8px; font-weight: 600; color: var(--text); }
.review-step .bars { gap: 7px; }
.step-no { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.fallback { margin-top: 14px; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }

/* ---------- shared game widgets ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.sb-side, .sb-mid { display: flex; flex-direction: column; }
.sb-side.right { align-items: flex-end; }
.sb-mid { align-items: center; padding: 6px 18px; border-radius: 999px; background: var(--surface-2); }
.scoreboard small { color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; font-size: 11px; }
.scoreboard b { font-family: var(--font-display); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.sb-mid b { font-family: var(--font); font-size: 15px; font-weight: 700; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.prompt { margin: 0; font-weight: 600; color: var(--muted); }
.result { text-align: center; padding: 16px 0; animation: rise .5s var(--ease); }
.result h2 { font-family: var(--font-display); font-size: 38px; font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; animation: rise .4s var(--ease); }
.rv { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.rv.c { background: color-mix(in srgb, var(--good) 13%, transparent); color: color-mix(in srgb, var(--good) 80%, var(--text)); }
.rv.d { background: color-mix(in srgb, var(--bad) 12%, transparent); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }

/* ---------- about ---------- */
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; margin-top: 40px; }
.prose p { color: var(--muted); font-size: 16px; line-height: 1.75; }
.method { display: grid; grid-template-columns: 170px 1fr; gap: 14px 24px; margin: 0; }
.method dt { font-weight: 650; font-size: 15px; padding-top: 2px; }
.method dd { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
@media (max-width: 640px) { .method { grid-template-columns: 1fr; gap: 4px; } .method dd { margin-bottom: 12px; } }
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.mode-card { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.mode-card b { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.mode-card p { margin: 8px 0 0; font-size: 14.5px; }
.about-games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.about-game { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); transition: .25s var(--ease); }
.about-game:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-2px); }
.about-game > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.ag-icon { color: var(--accent); }
@media (max-width: 600px) { .mode-cards, .about-games { grid-template-columns: 1fr; } }
.dev-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.dev-row .input { flex: 1; min-width: 220px; }

/* ---------- inputs / toast ---------- */
.input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-lg);
  transition: .3s var(--ease);
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.ts-box { position: fixed; right: 16px; bottom: 16px; z-index: 60; }

/* ---------- release notes / update available ---------- */
.update {
  position: fixed; right: 20px; bottom: 20px; z-index: 55; width: min(360px, calc(100vw - 32px)); padding: 16px 18px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: rise .35s var(--ease);
}
.update-head { display: flex; align-items: center; gap: 10px; }
.update-head b { flex: 1; font-size: 14.5px; }
.update-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); }
.update-new .update-dot { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.update p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.update ul { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.update-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 520px) { .update { right: 16px; bottom: 16px; } }

/* ---------- data notice ---------- */
.data-note {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 12px 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13.5px;
}
.data-note > .ico { color: var(--good); flex: none; }
.data-note p { flex: 1; margin: 0; color: var(--muted); line-height: 1.5; }
.data-note-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 640px) { .data-note { flex-wrap: wrap; } .data-note-actions { margin-left: auto; } }

/* ---------- insights ---------- */
.insights { padding-top: 36px; }
.ins-hero { max-width: 720px; margin-bottom: 26px; }
.ins-loading { display: flex; gap: 6px; padding: 40px 0; }
.ins-loading .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite; }
.ins-loading .dot:nth-child(2) { animation-delay: .15s; } .ins-loading .dot:nth-child(3) { animation-delay: .3s; }
.ins-sample {
  margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.55;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--surface)) 0 10px, var(--surface) 10px 20px);
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, var(--border));
}
.ins-updated { font-size: 13px; margin-bottom: 14px; }
.ins-terms { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }
.ins-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.ins-filter small { font-weight: 400; max-width: 560px; }
.ins-none, .ins-empty { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--muted); background: var(--surface-2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.stats.small { grid-template-columns: repeat(3, 1fr); margin: 4px 0 0; }
@media (max-width: 760px) { .stats, .stats.small { grid-template-columns: repeat(2, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.stat small { color: var(--muted); font-weight: 600; font-size: 12px; }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: 30px; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.ins-game { margin-bottom: 22px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ins-game-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ins-game-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 2px 0 6px; }
.ins-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; color: var(--text); background: var(--surface-2); }
.ins-wins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.ins-win { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ins-win i { width: 8px; height: 8px; border-radius: 2px; }
.ins-win b { color: var(--text); font-family: var(--mono); font-size: 12.5px; }
.ins-win small { color: var(--muted); font-size: 11px; }
.ins-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.viz { margin: 0; min-width: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.viz-head figcaption { font-weight: 650; font-size: 14px; }
.viz-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.viz-toggle:hover { color: var(--text); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.viz-key { display: inline-flex; align-items: center; gap: 6px; }
.viz-key i { width: 10px; height: 10px; border-radius: 3px; }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ins-charts > .viz:only-child .viz-svg { max-height: 300px; }
.viz-grid { stroke: var(--border); stroke-width: 1; }
.viz-base { stroke: var(--border-strong); stroke-width: 1; }
.viz-tick, .viz-cat { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.viz-direct { fill: var(--text); font-size: 11px; font-weight: 600; font-family: var(--font); }
.viz-bar { transition: opacity .15s; }
.viz-bar.low { fill-opacity: .38; stroke: currentColor; stroke-width: 1; stroke-dasharray: 3 2; color: var(--muted); }
.viz-dot.low { fill-opacity: .35; }
.viz-lownote { font-style: italic; }
.viz-svg:has(.viz-bar.on) .viz-bar:not(.on) { opacity: .45; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-cross { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.viz-ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .8; }
.viz-reflabel { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ins-cal { margin-bottom: 22px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ins-cal h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin-bottom: 4px; }
.ins-cal > p { color: var(--muted); font-size: 14px; max-width: 760px; }
.viz-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.viz-empty { margin: 6px 0 0; padding: 28px 12px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; font-size: 13px; color: var(--muted); }
.viz-table-wrap { overflow-x: auto; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.viz-table th, .viz-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.viz-table td { font-family: var(--mono); font-size: 12px; }
.viz-tip {
  position: fixed; z-index: 80; pointer-events: none; min-width: 140px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 3px;
}
.viz-tip em { font-style: normal; font-family: var(--mono); font-weight: 700; }
.viz-tip small { opacity: .7; }
.viz-tip-row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 6px; align-items: center; }
.viz-tip-row i { width: 9px; height: 9px; border-radius: 2px; }
.privacy { margin: 10px 0 0; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.privacy h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.privacy > p { color: var(--muted); max-width: 820px; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; border-top: 1px dashed var(--border); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; position: relative; width: 38px; height: 22px; margin-top: 1px; border-radius: 99px; background: var(--border-strong); transition: background .2s var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch-row input:checked + .switch { background: var(--good); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }

/* ---------- footer ---------- */
.foot { margin-top: 56px; padding: 28px 0 36px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.disclaimer {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
}
.disclaimer .ico { color: var(--good); margin-top: 2px; }
.disclaimer p { margin: 0; line-height: 1.6; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot-row a { color: var(--text); font-weight: 550; }
.foot-row a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
