[hidden] { display: none !important; }

/* Mobile-first. Four-colour deck: clubs green, diamonds blue, hearts red, spades black. */
:root {
  --felt: #0f3d2e;
  --felt-light: #165a43;
  --text: #f2f5f3;
  --muted: #a9c2b6;
  --panel: rgba(0, 0, 0, 0.25);
  --clubs: #1e9e4a;
  --diamonds: #1f6fd1;
  --hearts: #d32f2f;
  --spades: #1b1b1b;
  --good: #2ecc71;
  --bad: #ff6b6b;
  --warn: #f5c542;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, var(--felt-light), var(--felt) 70%);
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 1.3rem; margin: 0; }

.mode-toggle { display: flex; background: var(--panel); border-radius: 999px; padding: 3px; }
.mode-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
}
.mode-btn.active { background: var(--text); color: var(--felt); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  background: var(--panel); border-radius: var(--radius); padding: 10px 6px; text-align: center;
}
.stats span { display: block; font-size: 1.25rem; font-weight: 700; }
.stats small { color: var(--muted); font-size: 0.75rem; }

.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (max-width: 420px) {
  .controls { grid-template-columns: repeat(2, 1fr); }
}
.control { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.control span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.control select {
  width: 100%; min-width: 0; min-height: 44px;
  background: var(--panel); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px;
  padding: 8px 6px; font-size: 0.85rem; font-family: inherit; cursor: pointer;
}
.control select:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }

.scenario { margin: 0; color: var(--muted); line-height: 1.4; font-size: 0.95rem; }
.scenario strong { color: var(--text); }
.drill-note { margin: -6px 0 0; color: var(--muted); font-size: 0.8rem; }

.table { display: flex; flex-direction: column; gap: 8px; }
.label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.board-label { margin-top: 8px; }

.cards { display: flex; gap: 6px; justify-content: center; }

.card {
  flex: 1 1 0;
  max-width: 92px;
  aspect-ratio: 5 / 7;
  border-radius: 10px;
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  user-select: none;
}
.card .rank { font-size: clamp(1.4rem, 7vw, 2.2rem); line-height: 1; }
.card .suit { font-size: clamp(1.1rem, 5.5vw, 1.7rem); line-height: 1; margin-top: 4px; }
.board .card { max-width: 64px; }
.board .card .rank { font-size: clamp(1.1rem, 5vw, 1.5rem); }
.board .card .suit { font-size: clamp(0.9rem, 4vw, 1.2rem); }

.suit-c { background: var(--clubs); }
.suit-d { background: var(--diamonds); }
.suit-h { background: var(--hearts); }
.suit-s { background: var(--spades); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act {
  border: 0; border-radius: var(--radius); padding: 16px 0; min-height: 56px;
  font-size: 1.05rem; font-weight: 700; color: #fff; cursor: pointer;
  transition: transform 0.08s, opacity 0.2s;
}
.act:active { transform: scale(0.97); }
.act:disabled { opacity: 0.35; cursor: default; }
.act.chosen { outline: 3px solid #fff; opacity: 1; }
.fold { background: #6b7280; }
.call { background: #2563eb; }
.raise { background: #c2410c; }

.feedback { background: var(--panel); border-radius: var(--radius); padding: 12px 14px; border-left: 5px solid var(--muted); }
.feedback.good { border-left-color: var(--good); }
.feedback.bad { border-left-color: var(--bad); }
.feedback.close { border-left-color: var(--warn); }
.feedback h2 { margin: 0 0 4px; font-size: 1.1rem; }
.feedback p { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.feedback ul { margin: 0; padding-left: 18px; font-size: 0.9rem; line-height: 1.5; }
.feedback .pos { color: var(--good); }
.feedback .neg { color: var(--bad); }
.feedback .muted { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
.feedback .equity { color: var(--text); font-size: 0.9rem; margin: 8px 0 0; font-weight: 600; }
.feedback .notes-heading {
  margin: 10px 0 4px; color: var(--muted); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.mix { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; }
.mix-row { display: grid; grid-template-columns: 4.5rem 1fr 2.5rem 3.5rem; align-items: center; gap: 8px; }
.mix-row.chosen .mix-label { color: var(--text); font-weight: 700; }
.mix-label { color: var(--muted); font-size: 0.85rem; }
.mix-track {
  display: block; height: 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.mix-fill { display: block; height: 100%; border-radius: 999px; }
.mix-fill.act-fold { background: #6b7280; }
.mix-fill.act-call { background: #2563eb; }
.mix-fill.act-raise { background: #c2410c; }
.mix-pct { color: var(--muted); font-size: 0.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.mix-row.chosen .mix-pct { color: var(--text); font-weight: 700; }
.mix-ev { color: var(--muted); font-size: 0.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.mix-row.chosen .mix-ev { color: var(--text); font-weight: 700; }

.ev-lost { margin: 8px 0 0; font-size: 0.9rem; font-weight: 700; }
.ev-lost.pos { color: var(--good); }
.ev-lost.neg { color: var(--bad); }

.leak-panel { border-left-color: var(--muted); }
.leak-panel ul { margin: 0 0 4px; padding-left: 18px; font-size: 0.9rem; line-height: 1.5; }
.leak-panel li { margin-bottom: 4px; }
.leak-panel li.muted { list-style: none; margin-left: -18px; color: var(--muted); }
.leak-panel strong { color: var(--text); }

.footer-btns { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.next {
  width: 100%; border: 0; border-radius: var(--radius); padding: 16px; min-height: 56px;
  background: var(--text); color: var(--felt); font-size: 1.05rem; font-weight: 700; cursor: pointer;
}
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px; }
