@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500&display=swap');

/* Wager Cards — tokens, frame, header, scoreboard, trays, controls,
   intro, dialogs. Card faces live in card.css, the report in report.css. */

:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #d2d2d7;
  --soft-line: rgba(0, 0, 0, 0.08);
  --surface: #ffffff;
  --alt: #f5f5f7;
  --blue: #005EA2;
  --blue-dark: #00467a;
  --blue-soft: rgba(0, 94, 162, 0.08);
  --amber: #d99a2b;
  --amber-ink: #8a5300;
  --amber-soft: rgba(217, 154, 43, 0.14);
  --paper: #fbfaf6;
  --right: #1f7a3a;
  --right-soft: rgba(31, 122, 58, 0.1);
  --wrong: #b3261e;
  --wrong-soft: rgba(179, 38, 30, 0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --radius: 16px;
  --top-h: 60px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--alt);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
kbd {
  font: 600 10.5px/1 var(--font);
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--muted);
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--blue); color: #fff; }
.wc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- frame ---------- */
.wc-app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 500px;
  display: grid;
  grid-template-rows: var(--top-h) minmax(0, 1fr) auto;
  overflow: hidden;
}

/* ---------- header ---------- */
.wc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--soft-line);
  z-index: 5;
}
.wc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wc-brand-mark { width: 34px; height: 34px; flex: none; }
.wc-brand-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.wc-brand-sub { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.wc-actions { display: flex; align-items: center; gap: 4px; }
.wc-tool {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 500; text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.wc-tool svg { width: 17px; height: 17px; flex: none; }
.wc-tool:hover { background: var(--alt); }
.wc-tool--strong { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.wc-tool--strong:hover { background: rgba(0, 94, 162, 0.14); }
.wc-tool--link { color: var(--blue); font-weight: 600; }
.wc-tool:disabled { opacity: 0.4; cursor: default; }
.wc-tool:disabled:hover { background: transparent; }
.wc-tool--strong:disabled:hover { background: var(--blue-soft); }

/* ---------- the table ---------- */
.wc-table {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 190px;
  gap: 20px;
  padding: 18px 24px;
  min-height: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, #fbfbfc 0%, var(--alt) 70%);
}

/* scoreboard */
.wc-hud { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wc-score {
  position: relative;
  padding: 14px 16px 13px;
  background: var(--surface);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}
.wc-score-label {
  margin: 0;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.wc-score--points .wc-score-label { color: var(--amber-ink); }
.wc-score--cal .wc-score-label { color: var(--blue); }
.wc-score-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 58px; }
.wc-score-value {
  margin: 0;
  font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
#calValue[data-sign="neg"] { color: var(--wrong); }
#calValue[data-sign="pos"] { color: var(--blue); }
#calValue[data-sign="none"] { color: var(--faint); }
.wc-score-note { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.wc-pile { position: relative; width: 46px; height: 58px; flex: none; }
.wc-pile .wc-stack-chip { bottom: calc(var(--i) * 4.5px); }
.wc-cal-mini { width: 64px; height: 40px; flex: none; margin-bottom: 4px; }
.wc-cal-mini .mini-diag { stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 2 2; }
.wc-cal-mini .mini-axis { stroke: var(--line); stroke-width: 1; }
.wc-cal-mini circle { fill: var(--blue); opacity: 0.85; }
.wc-float {
  position: absolute; right: 16px; top: 10px; margin: 0;
  font-size: 14px; font-weight: 700; color: var(--amber-ink);
  opacity: 0; pointer-events: none;
}
.wc-float[data-sign="neg"] { color: var(--wrong); }
.wc-float.is-on { animation: wc-rise 0.9s var(--ease); }
@keyframes wc-rise {
  0% { opacity: 0; transform: translateY(8px); }
  20% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-14px); }
}
.wc-progress-compact { display: none; }

/* trays */
.wc-trays {
  align-self: start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}
.wc-trays-label {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.wc-tray-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.wc-tray { display: grid; grid-template-columns: 26px 30px 1fr; align-items: end; gap: 8px; font-size: 13px; }
.wc-tray-stack {
  position: relative; height: 28px; width: 22px;
}
.wc-tray-stack::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--h, 0px);
  min-height: 2px;
  border-radius: 3px;
  background: repeating-linear-gradient(0deg, #fff 0 2px, var(--line) 2px 3px);
  border: 1px solid var(--line);
  transition: height 0.3s var(--ease);
}
.wc-tray-stack.is-back::before { background: repeating-linear-gradient(0deg, #fff 0 2px, var(--amber) 2px 3px); border-color: var(--amber); }
.wc-tray-stack.is-kept::before { background: repeating-linear-gradient(0deg, #fff 0 2px, var(--blue) 2px 3px); border-color: var(--blue); }
.wc-tray-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.wc-tray-name { color: var(--muted); }
.wc-meter { margin-top: 14px; height: 6px; border-radius: 99px; background: var(--alt); overflow: hidden; }
.wc-meter span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width 0.35s var(--ease); }
.wc-trays-note { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.wc-loop-tracker { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--soft-line); }
.wc-loop-tracker .wc-trays-label { margin-bottom: 8px; }
.wc-loop-dots { display: flex; gap: 6px; margin: 0; }
.wc-loop-dots span {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px dashed var(--line);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.wc-loop-dots span.is-found {
  border: 1.5px solid #8e8e93;
  background: linear-gradient(135deg, #f4f4f6 0%, #c7c7cc 45%, #f9f9fb 55%, #a1a1a6 100%);
}

/* ---------- controls ---------- */
.wc-controls {
  display: grid; align-content: center;
  background: var(--surface);
  border-top: 1px solid var(--soft-line);
  padding: 14px 24px;
  min-height: 94px;
  z-index: 4;
}
.wc-bar { display: grid; align-items: center; gap: 22px; max-width: 1100px; margin: 0 auto; min-height: 64px; }
.wc-bar--claim { grid-template-columns: auto auto auto 1fr; }
.wc-bar--claim .wc-bar-end { justify-self: end; }
.wc-bar--open, .wc-bar--result { grid-template-columns: 1fr auto; }
.wc-bar--grade { grid-template-columns: auto 1fr; }
.wc-bar-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wc-bar-hint { margin: 0; font-size: 12px; color: var(--muted); }

.wc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.wc-btn svg { width: 18px; height: 18px; }
.wc-btn:hover { border-color: #b9b9c0; }
.wc-btn:active { transform: scale(0.98); }
.wc-btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.wc-btn--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.wc-btn--primary kbd { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.wc-btn--primary[aria-disabled="true"] { background: #9fb9d3; border-color: #9fb9d3; }
.wc-btn--ghost { border-color: transparent; color: var(--blue); }
.wc-btn--big { height: 50px; padding: 0 28px; font-size: 16px; }

.wc-stance-group { display: inline-flex; padding: 4px; gap: 4px; background: var(--alt); border-radius: 999px; }
.wc-stance {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.wc-stance:hover { background: rgba(255, 255, 255, 0.7); }
.wc-stance[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 1.5px var(--ink); }
.wc-stance--agree[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 1.5px var(--blue); color: var(--blue); }

.wc-conf { display: flex; align-items: center; gap: 12px; }
.wc-conf-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.wc-chip-btns { display: flex; gap: 8px; }
.wc-chip-btn {
  position: relative;
  width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s ease;
}
.wc-chip-btn .wc-chipface { width: 48px; height: 48px; display: block; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.18)); }
.wc-chip-btn kbd { position: absolute; right: -4px; bottom: -4px; font-size: 9.5px; padding: 2px 4px; }
.wc-chip-btn:hover { transform: translateY(-2px); }
.wc-chip-btn[aria-pressed="true"] { transform: translateY(-5px); }
.wc-chip-btn[aria-pressed="true"] .wc-chipface { filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.22)); }
.wc-chip-btn[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--ink);
}
@media (max-width: 899px) { .wc-chip-btn[aria-pressed="true"]::after { inset: -2px; } }

.wc-stake-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; justify-self: center; }
.wc-stake { position: relative; width: 52px; height: 46px; }
.wc-stake[data-empty="true"]::before {
  content: ""; position: absolute; left: 3px; right: 3px; bottom: 2px; height: 16px;
  border: 1.5px dashed var(--line); border-radius: 50%;
}
.wc-stake .wc-stack-chip { bottom: calc(var(--i) * 5px); }
.wc-stake-label { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

.wc-think { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); max-width: 62ch; }
.wc-think span { color: var(--muted); }

.wc-result { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 15px; }
.wc-result-word { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.wc-result.is-right .wc-result-word { color: var(--right); }
.wc-result.is-wrong .wc-result-word { color: var(--wrong); }
.wc-result.is-mirror .wc-result-word { color: #48484a; }
.wc-award-total { font-weight: 700; color: var(--amber-ink); font-variant-numeric: tabular-nums; }
.wc-bonus {
  font-size: 12.5px; font-weight: 600; color: var(--amber-ink);
  background: var(--amber-soft); border-radius: 999px; padding: 4px 10px;
}
.wc-bonus--muted { color: var(--muted); background: var(--alt); }
.wc-calchip {
  font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}
.wc-calchip.is-pos { color: var(--blue); background: var(--blue-soft); }
.wc-calchip.is-neg { color: var(--wrong); background: var(--wrong-soft); }
.wc-calchip.is-off { color: var(--muted); background: var(--alt); font-weight: 600; }

.wc-grade-label { margin: 0; font-size: 15px; font-weight: 600; }
.wc-grades { display: flex; gap: 10px; justify-content: flex-end; }
.wc-grade {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-width: 132px; height: 56px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.wc-grade span { font-size: 15px; font-weight: 700; }
.wc-grade small { font-size: 12px; color: var(--muted); }
.wc-grade kbd { position: absolute; right: 9px; top: 9px; }
.wc-grade:hover { transform: translateY(-1px); }
.wc-grade.is-had:hover { border-color: var(--right); background: var(--right-soft); }
.wc-grade.is-partly:hover { border-color: var(--amber); background: var(--amber-soft); }
.wc-grade.is-notyet:hover { border-color: var(--muted); background: var(--alt); }

/* ---------- overlays ---------- */
.wc-overlay {
  position: absolute;
  inset: var(--top-h) 0 0 0;
  overflow-y: auto;
  background: var(--alt);
  z-index: 6;
}
.wc-overlay[hidden] { display: none; }

.wc-intro-inner {
  min-height: 100%;
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(260px, 0.85fr) 1.15fr; align-items: center; gap: 48px;
  padding: 36px 40px;
}
.wc-fan { position: relative; height: 380px; }
.wc-fan-card {
  position: absolute; left: 50%; top: 50%;
  width: 200px; height: 280px; margin: -150px 0 0 -120px;
  display: flex; flex-direction: column;
  padding: 24px 22px 18px;
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 14px 34px rgba(0, 0, 0, 0.1);
  transform-origin: 50% 100%;
}
.wc-fan-card.is-back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.13) 0 1.5px, transparent 1.5px 9px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.13) 0 1.5px, transparent 1.5px 9px),
    var(--blue);
  box-shadow: inset 0 0 0 8px #fff, inset 0 0 0 9px rgba(0, 94, 162, 0.4), 0 10px 26px rgba(0, 0, 0, 0.12);
}
.wc-fan-card.is-back::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 2.5px solid #fff; border-radius: 3px; transform: rotate(45deg);
}
.wc-fan-card--a { transform: rotate(-16deg) translateX(-20px); }
.wc-fan-card--b { transform: rotate(-6deg) translateX(-4px); }
.wc-fan-card--c { transform: rotate(5deg) translateX(18px); }
.wc-fan-kind {
  display: flex; align-items: center; gap: 7px; margin: 0;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
}
.wc-fan-text {
  margin: auto 0;
  font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.24; letter-spacing: -0.01em;
}
.wc-fan-foot { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.wc-fan-suit { display: block; width: 11px; height: 11px; flex: none; }
.wc-fan-suit.is-claim { background: var(--blue); transform: rotate(45deg) scale(0.8); border-radius: 1px; }
.wc-fan-chips { position: absolute; left: 50%; top: 50%; width: 120px; height: 80px; margin: 96px 0 0 76px; }
.wc-fan-chips .wc-stack-chip { width: 50px; height: 17px; margin-left: 0; left: var(--x, 0px); bottom: calc(var(--i) * 6px); }
@media (prefers-reduced-motion: no-preference) {
  .wc-fan-card { transition: transform 0.45s var(--ease); }
  .wc-fan:hover .wc-fan-card--a { transform: rotate(-22deg) translateX(-34px); }
  .wc-fan:hover .wc-fan-card--b { transform: rotate(-9deg) translateX(-10px); }
  .wc-fan:hover .wc-fan-card--c { transform: rotate(8deg) translateX(26px) translateY(-6px); }
}

.wc-eyebrow-top {
  margin: 0 0 10px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
}
.wc-intro-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.4vw, 52px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02;
}
.wc-lede { margin: 0 0 22px; font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 56ch; }
.wc-two-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.wc-mini-tile {
  padding: 13px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--soft-line);
}
.wc-mini-tile p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.wc-mini-tile .wc-mini-label {
  margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.wc-mini-tile.is-points .wc-mini-label { color: var(--amber-ink); }
.wc-mini-tile.is-cal .wc-mini-label { color: var(--blue); }

.wc-themes { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.wc-themes legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.wc-themes legend span { color: var(--blue); }
.wc-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.wc-chip {
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wc-chip:hover { border-color: #a9a9b0; }
.wc-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.wc-chip--all { font-weight: 600; }
.wc-intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.wc-keys-hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- dialogs ---------- */
.wc-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  padding: 0; border: 0; border-radius: 20px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}
.wc-dialog--wide { width: min(760px, calc(100vw - 32px)); }
.wc-dialog::backdrop { background: rgba(29, 29, 31, 0.32); }
.wc-dialog-inner { display: flex; flex-direction: column; max-height: inherit; }
.wc-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 8px;
}
.wc-dialog-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
.wc-close {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--alt); font-size: 20px; line-height: 1; cursor: pointer;
}
.wc-dialog-lede { margin: 0; padding: 0 22px 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.wc-dialog .wc-chip-row { padding: 0 22px 8px; overflow-y: auto; }
.wc-dialog-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px 20px; margin-top: auto;
  font-size: 14px; color: var(--muted);
}
.wc-dialog-foot a { color: var(--blue); font-weight: 600; text-decoration: none; }
.wc-rules { padding: 4px 22px 4px; overflow-y: auto; display: grid; gap: 18px; }
.wc-rules h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.wc-rules ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.wc-rules li, .wc-rules p { font-size: 14px; line-height: 1.55; color: #3a3a3c; }
.wc-rules p { margin: 0 0 6px; }
.wc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.wc-dot.is-points { background: var(--amber); }
.wc-dot.is-cal { background: var(--blue); }
.wc-keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 14px; }
.wc-keys dt { white-space: nowrap; }
.wc-keys dd { margin: 0; color: #3a3a3c; }
.wc-sources-body { padding: 0 22px 22px; overflow-y: auto; }

/* ---------- toast ---------- */
.wc-toast {
  position: absolute; left: 50%; bottom: 112px; z-index: 20;
  margin: 0; padding: 9px 16px; border-radius: 999px;
  background: rgba(29, 29, 31, 0.92); color: #fff; font-size: 13.5px; font-weight: 500;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100% - 32px); text-align: center;
}
.wc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1179px) {
  .wc-table { grid-template-columns: 196px minmax(0, 1fr); }
  .wc-trays { display: none; }
  .wc-progress-compact {
    display: block; padding: 10px 14px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--soft-line);
    font-size: 13px; font-weight: 600; color: var(--muted);
  }
}

@media (max-width: 899px) {
  :root { --top-h: 54px; }
  .wc-top { padding: 0 12px 0 14px; gap: 8px; }
  .wc-brand-sub { display: none; }
  .wc-brand-mark { width: 30px; height: 30px; }
  .wc-tool { width: 36px; padding: 0; justify-content: center; }
  /* Icon-only on phones: the label stays for screen readers. */
  .wc-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .wc-tool--link { display: none; }
  .wc-app { grid-template-rows: var(--top-h) minmax(0, 1fr) auto; }
  .wc-table { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .wc-hud { flex-direction: row; gap: 8px; }
  .wc-score { flex: 1 1 0; padding: 8px 12px; border-radius: 12px; }
  .wc-score-row { min-height: 0; }
  .wc-score-value { font-size: 22px; }
  .wc-score-note, .wc-pile, .wc-cal-mini { display: none; }
  .wc-float { top: 6px; right: 10px; }
  .wc-progress-compact { flex: 0 0 auto; display: flex; align-items: center; padding: 0 12px; font-size: 12px; white-space: nowrap; }
  .wc-controls { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); min-height: calc(118px + env(safe-area-inset-bottom)); }
  .wc-bar { gap: 10px; min-height: 0; }
  .wc-bar--claim {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "stance stance stance" "conf stake flip";
  }
  .wc-bar--claim .wc-stance-group { grid-area: stance; }
  .wc-bar--claim .wc-conf { grid-area: conf; }
  .wc-bar--claim .wc-stake-wrap { grid-area: stake; }
  .wc-bar--claim .wc-bar-end { grid-area: flip; }
  .wc-stance-group { display: grid; grid-template-columns: 1fr 1fr; }
  .wc-stance { justify-content: center; height: 40px; }
  .wc-conf-label, .wc-stake-label, .wc-bar-hint { display: none; }
  .wc-chip-btns { gap: 5px; }
  .wc-chip-btn, .wc-chip-btn .wc-chipface { width: 40px; height: 40px; }
  .wc-stake { width: 40px; height: 40px; }
  .wc-flip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .wc-flip { width: 52px; padding: 0; }
  .wc-bar--grade { grid-template-columns: 1fr; gap: 8px; }
  .wc-grade-label { font-size: 13px; color: var(--muted); }
  .wc-grades { justify-content: stretch; gap: 6px; }
  .wc-grade { flex: 1 1 0; min-width: 0; height: 52px; padding: 0 10px; }
  .wc-grade small { font-size: 11px; }
  .wc-think { font-size: 13.5px; }
  .wc-result { gap: 4px 8px; font-size: 13.5px; }
  .wc-result-word { font-size: 17px; }
  .wc-bonus, .wc-calchip { font-size: 11.5px; padding: 3px 8px; }
  .wc-toast { bottom: 140px; }
  .wc-intro-inner { grid-template-columns: 1fr; gap: 8px; padding: 18px 16px 28px; }
  /* The fan is drawn at full size and scaled down: give the box the scaled height so it can't overlap the title. */
  .wc-fan { height: 210px; scale: 0.62; margin: -24px 0 0; }
  .wc-two-scores { grid-template-columns: 1fr; }
  .wc-lede { font-size: 15.5px; margin-bottom: 16px; }
}

/* Narrow phones and the embedded frame (~343px): keep the header on one line. */
@media (max-width: 380px) {
  .wc-actions { gap: 0; }
  .wc-tool { width: 34px; }
}
@media (max-width: 340px) {
  .wc-brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (hover: none), (max-width: 899px) {
  .wc-stance kbd, .wc-chip-btn kbd, .wc-grade kbd, .wc-flip kbd { display: none; }
}

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