/* ── PALETTE ──────────────────────────────────────────────────────────────
   Action colours are the ones sampled from the source charts (see
   docs/DATA.md) so the app and the original screenshots read identically.
   Everything else is a dark card-room theme built around them.            */
:root {
  --p-bg:          #0b1410;
  --p-surface:     #11201a;
  --p-surface-2:   #172b22;
  --p-border:      #22402f;
  --p-border-2:    #2f5a41;
  --p-text:        #dfe9e2;
  --p-muted:       #7f9a8a;
  --p-strong:      #ffffff;
  --p-felt:        #1d5c3f;
  --p-felt-dk:     #123f2b;
  --p-gold:        #e0b64a;
  --p-shadow:      rgba(0, 0, 0, .45);

  --a-fold:        #3e7cb9;
  --a-call_check:  #5ab967;
  --a-raise:       #f03c3d;
  --a-all_in:      #7d1f1f;

  --a-fold-ink:       #ffffff;
  --a-call_check-ink: #0b1410;
  --a-raise-ink:      #ffffff;
  --a-all_in-ink:     #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, #14251c 0%, var(--p-bg) 60%);
  color: var(--p-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* ── TOPBAR ─────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: .6rem .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0;
  color: var(--p-gold);
}
.brand-sub { color: var(--p-muted); font-size: .85rem; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: .9rem .9rem 3rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.panel {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: .9rem;
}

/* ── SPOT HEADER ────────────────────────────────────────────────────────── */
.spot-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.badge-stack {
  background: var(--p-surface-2);
  border: 1px solid var(--p-border-2);
  color: var(--p-gold);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
}
.spot-desc { color: var(--p-text); font-size: .95rem; }

/* ── TABLE ──────────────────────────────────────────────────────────────── */
.table-felt {
  position: relative;
  background: radial-gradient(ellipse at 50% 40%, var(--p-felt) 0%, var(--p-felt-dk) 75%);
  border: 3px solid #2a1a10;
  border-radius: 46% / 34%;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .45);
  /* Aspect ratio instead of a fixed height so the oval keeps its shape from
     a 320px phone up to the 720px column. Taller on narrow screens, where the
     three seat boxes need the vertical room not to collide. */
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 320px;
  display: grid;
  place-items: center;
}
@media (min-width: 576px) {
  .table-felt { aspect-ratio: 5 / 3; }
}

.felt-centre { text-align: center; pointer-events: none; }
.felt-label {
  color: rgba(255, 255, 255, .35);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .62rem;
}
.seat {
  position: absolute;
  background: var(--p-surface);
  border: 1px solid var(--p-border-2);
  border-radius: 10px;
  padding: .25rem .45rem;
  min-width: 4.9rem;
  text-align: center;
  box-shadow: 0 2px 6px var(--p-shadow);
}
.seat-a     { top: 6%;  left: 6%; }
.seat-b     { top: 6%;  right: 6%; }
.seat-hero  { bottom: 5%; left: 50%; transform: translateX(-50%); }

.seat-name {
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
}
.seat-stack { color: var(--p-muted); font-size: .7rem; }
.seat-act {
  display: block;
  margin-top: .2rem;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .1rem .3rem;
}
.seat-act[data-act="fold"]   { background: var(--a-fold);       color: var(--a-fold-ink); }
.seat-act[data-act="limp"],
.seat-act[data-act="call"]   { background: var(--a-call_check);  color: var(--a-call_check-ink); }
.seat-act[data-act="raise"]  { background: var(--a-raise);       color: var(--a-raise-ink); }
.seat-act[data-act="all_in"] { background: var(--a-all_in);      color: var(--a-all_in-ink); }
.seat-act[data-act="wait"]   { background: var(--p-surface-2);   color: var(--p-muted); }

.seat-hero {
  border-color: var(--p-gold);
  box-shadow: 0 0 0 2px rgba(224, 182, 74, .25), 0 2px 6px var(--p-shadow);
}
.seat-hero .seat-name { color: var(--p-gold); }

/* The dealer button chip on whichever seat is the BTN. */
.dealer-chip {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #f4f1e8;
  color: #1b1b1b;
  font-size: .58rem;
  font-weight: 800;
}

/* ── HERO HAND ──────────────────────────────────────────────────────────── */
.hand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  margin-top: .9rem;
}
.cards { display: flex; gap: .45rem; }
.card-face {
  width: 3.1rem;
  height: 4.4rem;
  background: #f7f5ef;
  border-radius: 8px;
  box-shadow: 0 3px 8px var(--p-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #14181c;
}
.card-face.red { color: #c62828; }
.card-rank { font-size: 1.55rem; font-weight: 700; }
.card-suit { font-size: 1.15rem; }
.hand-shape {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--p-strong);
  letter-spacing: .03em;
}

/* ── CHOICES ────────────────────────────────────────────────────────────── */
.prompt {
  margin: 0 0 .6rem;
  font-weight: 600;
  text-align: center;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
@media (min-width: 576px) {
  .choices { grid-template-columns: repeat(4, 1fr); }
}
.choice {
  border: 1px solid transparent;
  border-radius: 10px;
  /* 44px+ tap target — the app is used one-handed on a phone. */
  min-height: 3.1rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--p-strong);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  transition: filter .12s ease, transform .12s ease;
}
.choice:hover:not(:disabled) { filter: brightness(1.12); }
.choice:active:not(:disabled) { transform: translateY(1px); }
.choice:disabled { opacity: .45; cursor: default; }
.choice-key { font-size: .62rem; opacity: .75; font-weight: 600; }

/* After a decision the buttons themselves become the answer key. */
.choice-mark { font-size: .8rem; font-weight: 700; }

.choice[data-action="fold"]       { background: var(--a-fold);       color: var(--a-fold-ink); }
.choice[data-action="call_check"] { background: var(--a-call_check); color: var(--a-call_check-ink); }
.choice[data-action="raise"]      { background: var(--a-raise);      color: var(--a-raise-ink); }
.choice[data-action="all_in"]     { background: var(--a-all_in);     color: var(--a-all_in-ink); }

.keys { color: var(--p-muted); font-size: .78rem; margin: .7rem 0 0; text-align: center; }
kbd {
  /* Bootstrap paints kbd as body-colour-on-body-background, which is invisible
     against this panel — restate both. */
  background: var(--p-surface-2);
  color: var(--p-text);
  border: 1px solid var(--p-border-2);
  border-radius: 4px;
  padding: .05rem .3rem;
  font-size: .72rem;
}

/* ── REVEAL ─────────────────────────────────────────────────────────────── */
.verdict {
  border-radius: 10px;
  padding: .7rem .8rem;
  font-weight: 600;
  border: 1px solid var(--p-border-2);
  background: var(--p-surface-2);
}
.verdict.ok   { border-color: #2f7d45; background: rgba(90, 185, 103, .14); }
.verdict.bad  { border-color: #8c3030; background: rgba(240, 60, 61, .13); }
.verdict-head { display: block; font-size: 1.02rem; margin-bottom: .15rem; }
.verdict-sub  { color: var(--p-muted); font-weight: 400; font-size: .87rem; }

.mix { margin-top: .7rem; }
.mix:empty { display: none; }
.mix-bar {
  display: flex;
  height: 1.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--p-border-2);
}
.mix-seg {
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.mix-note { color: var(--p-muted); font-size: .8rem; margin: .35rem 0 0; }

/* ── CHART ──────────────────────────────────────────────────────────────── */
.chart-block { margin-top: 1rem; }
.chart-caption { color: var(--p-muted); font-size: .82rem; margin: 0 0 .45rem; }

/* The 13x13 grid plus its rank headers needs ~420px to stay legible, so on
   narrow phones it scrolls inside this box rather than squeezing the page. */
.chart-scroll { overflow-x: auto; padding-bottom: .25rem; }
.chart {
  display: grid;
  /* Narrow gutter for the rank headers, 13 square cells for the grid — the
     whole thing then fits a 390px phone without scrolling. */
  grid-template-columns: 1.1rem repeat(13, 1fr);
  gap: 1px;
  min-width: 320px;
}
.chart-axis {
  display: grid;
  place-items: center;
  color: var(--p-muted);
  font-size: .62rem;
  font-weight: 700;
}
.chart-cell {
  aspect-ratio: 1;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
}
/* One <i> per action in a mixed cell, width = how often it is played — the
   same horizontal frequency bar the source charts use. */
.chart-cell i { display: block; height: 100%; }
.chart-cell.hero {
  outline: 2px solid var(--p-gold);
  outline-offset: -1px;
  border-radius: 3px;
  z-index: 1;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin-top: .5rem;
  color: var(--p-muted);
  font-size: .78rem;
}
.chart-legend span { display: inline-flex; align-items: center; gap: .3rem; }

.swatch {
  display: inline-block;
  width: .85rem;
  height: .85rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .18);
  vertical-align: -.1em;
}
.swatch[data-action="fold"]       { background: var(--a-fold); }
.swatch[data-action="call_check"] { background: var(--a-call_check); }
.swatch[data-action="raise"]      { background: var(--a-raise); }
.swatch[data-action="all_in"]     { background: var(--a-all_in); }

.btn-next {
  width: 100%;
  margin-top: 1rem;
  background: var(--p-gold);
  border: none;
  color: #16130a;
  font-weight: 700;
  min-height: 3.1rem;
}
.btn-next:hover { background: #f0c65c; color: #16130a; }

.legend-list { list-style: none; padding: 0; margin: 0 0 .9rem; }
.legend-list li { padding: .12rem 0; }

.load-error {
  color: #ff9d9d;
  text-align: center;
  font-size: .9rem;
}
