/* Poker Trainer's own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the list down the left, the settings and their "i", the windows, the result, the phone layout, and the wide middle
   column every trainer has). What is here is the card table in that column and the buttons under it. */
:root {
  --felt: #0d2325;
  --felt-edge: #1d4645;
  /* one colour per answer, the same on the chart and on the buttons */
  --raise: #74d6a2;
  --fold: #f2906f;
  --call: #6fd0e8;
  --split: #f0cf6a;
  /* the starting-hand chart: the earlier the seat a hand is raised from, the brighter */
  --seat-utg: #74d6a2;
  --seat-hj: #4fae84;
  --seat-co: #35806a;
  --seat-btn: #24574f;
  --card: #f6efdf;
  --card-red: #c5372c;
  --card-black: #1c1712;
  --w: 72px; /* the width of a card; set on whatever holds the cards */
}

.felt {
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box; position: relative;
  container-type: size; /* lets the cards size themselves from the table's height (cqh units) */
  background: radial-gradient(90% 70% at 50% 0%, #123032 0%, var(--felt) 60%, #0a1b1e 100%);
  border: 1px solid var(--felt-edge); border-radius: 18px;
  padding: 16px; display: grid; align-content: center; justify-items: center; gap: 14px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.felt.is-top { align-content: start; }
.stage.flash-ok .felt { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.stage.flash-bad .felt { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 56ch; text-align: center; margin: 0; text-wrap: pretty; }
.note b { color: var(--fg); font-weight: 600; }
.tag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tag.win { color: var(--ok); } .tag.lose { color: var(--muted); }

/* the drills' numbers in the list down the left, and the one to do next */
.rail .rg span i { font-style: normal; font-family: var(--f-mono); font-weight: 500; font-size: 11px; color: var(--muted); margin-inline-end: 8px; }
.rail .rg em { white-space: nowrap; }
.rail .rg em.next { color: var(--bone); }

/* ---------- playing cards (class pcard: .card is the shell's windows) ---------- */
.pcard {
  direction: ltr; /* a card is the same card in every language: its rank top left */
  width: var(--w); aspect-ratio: 5 / 7; flex: none; position: relative; box-sizing: border-box;
  border-radius: calc(var(--w) * 0.09); background: var(--card); color: var(--card-black);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 0 rgba(0, 0, 0, 0.3), 0 8px 18px rgba(0, 0, 0, 0.35);
  font-weight: 750; font-stretch: 90%; user-select: none; transition: opacity .2s;
}
.pcard.red { color: var(--card-red); }
.pcard .cr { position: absolute; top: 5%; left: 10%; font-size: calc(var(--w) * 0.34); line-height: 1; letter-spacing: -0.04em; }
.pcard .cs { position: absolute; top: calc(5% + var(--w) * 0.36); left: 10%; width: calc(var(--w) * 0.2); height: calc(var(--w) * 0.2); }
.pcard .cp { position: absolute; right: 9%; bottom: 7%; width: calc(var(--w) * 0.46); height: calc(var(--w) * 0.46); }
.pcard svg { display: block; fill: currentColor; }
/* a card still to be dealt */
.pcard.slot { background: none; box-shadow: none; border: 1.5px dashed rgba(232, 237, 240, 0.3); }
.pcard.in { animation: deal .22s ease-out both; }
@keyframes deal { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
/* after the answer: the five cards that make the hand stay lit */
.pcard.dim { opacity: .3; }
.pcard.lit { box-shadow: 0 0 0 2px var(--scan), 0 8px 18px rgba(0, 0, 0, 0.35); }

.grp { display: grid; justify-items: center; gap: 6px; }
.cardrow { display: flex; justify-content: center; gap: calc(var(--w) * 0.1); }
.deal { display: grid; justify-items: center; gap: clamp(10px, 4cqh, 22px); width: 100%; }
.deal .board { --w: min(clamp(38px, 17cqh, 88px), 15.5cqw); }
.deal .mine { --w: min(clamp(44px, 21cqh, 104px), 19cqw); }
.players { display: flex; gap: clamp(18px, 9cqw, 72px); justify-content: center; align-items: start; }
.players { --w: min(clamp(40px, 18cqh, 92px), 17cqw); }
.players .grp { padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; }
.players .grp.is-win { border-color: var(--ok); background: rgba(95, 211, 154, 0.07); }
.players .res { font-size: 12.5px; color: var(--muted); min-height: 1.3em; text-align: center; max-width: 22ch; text-wrap: balance; }
.players .grp.is-win .res { color: var(--fg); }

/* the outs laid out after an answer */
.strip { --w: clamp(26px, 6.2cqw, 38px); display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-width: 560px; }
.strip .pcard { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.strip .pcard .cp { display: none; }
.strip .pcard .cr { font-size: calc(var(--w) * 0.44); top: 8%; }
.strip .pcard .cs { top: calc(8% + var(--w) * 0.5); width: calc(var(--w) * 0.34); height: calc(var(--w) * 0.34); }

/* ---------- pot and bet ---------- */
.tiles { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.chip { background: rgba(10, 15, 20, 0.55); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 14px; display: grid; gap: 1px; min-width: 84px; text-align: center; }
.chip b { font-family: var(--f-mono); font-weight: 600; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--bone); }
.chip small { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chip.big b { font-size: clamp(30px, 9cqh, 52px); line-height: 1.1; }
.chip.big { padding: 12px 22px; min-width: 120px; }
.chip.good { border-color: var(--ok); } .chip.good b { color: var(--ok); }
.chip.poor { border-color: var(--bad); } .chip.poor b { color: var(--bad); }
.versus { font-family: var(--f-mono); color: var(--muted); font-size: 13px; }

/* ---------- the table, seen from above (starting hands) ---------- */
.seats { width: min(100%, 440px); height: auto; max-height: 46cqh; display: block; }
.seats .rail-line { fill: #0f2a2c; stroke: var(--felt-edge); stroke-width: 2; }
.seats .seat circle { fill: var(--bg-lift); stroke: var(--line-strong); stroke-width: 1.5; }
.seats .seat text { font-family: var(--f-mono); font-size: 11px; font-weight: 600; fill: var(--fg); text-anchor: middle; }
.seats .seat .st { font-size: 9px; font-weight: 500; fill: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.seats .seat.out { opacity: .38; }
.seats .seat.you circle { fill: #13232c; stroke: var(--scan); stroke-width: 2.5; }
.seats .seat.you .st { fill: var(--scan); }
.seats .dealer circle { fill: var(--bone); }
.seats .dealer text { font-family: var(--f-mono); font-size: 9px; font-weight: 700; fill: #1b1610; text-anchor: middle; }
.seats .mid { font-family: var(--f-mono); font-size: 10px; fill: var(--muted); text-anchor: middle; letter-spacing: 0.06em; }

/* ---------- the starting-hand chart ---------- */
.gridwrap { width: 100%; max-width: 560px; display: grid; gap: 10px; justify-items: center; }
/* the chart is square: no wider than the table is tall, less the legend under it */
.grid { max-width: max(300px, calc(100cqh - 124px)); }
.grid { width: 100%; display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; }
.grid button {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  font-family: var(--f-mono); font-weight: 600; font-size: clamp(8px, 2.05cqw, 12px); letter-spacing: -0.03em;
  color: #0c1418; background: var(--c, #17242d);
}
.grid button.f { color: #5b6c79; }
.grid button:hover { filter: brightness(1.2); }
.grid button[aria-pressed="true"] { outline: 2px solid var(--fg); outline-offset: 1px; position: relative; z-index: 1; }
.grid button.is-miss { box-shadow: inset 0 0 0 2px #10161c, 0 0 0 2px var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; background: var(--c); }

/* ---------- study pages ---------- */
.ladder { width: 100%; max-width: 600px; display: grid; gap: 7px; }
.ladder .rung { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(10, 15, 20, 0.35); border: 1px solid rgba(232, 237, 240, 0.07); }
.ladder .cardrow { --w: clamp(26px, 7.4cqw, 40px); gap: 3px; }
.ladder .pcard { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.ladder .pcard .cp { display: none; }
.ladder .pcard .cr { font-size: calc(var(--w) * 0.44); top: 8%; }
.ladder .pcard .cs { top: calc(8% + var(--w) * 0.5); width: calc(var(--w) * 0.34); height: calc(var(--w) * 0.34); }
.ladder h4 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--bone); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ladder h4 em { font-style: normal; font-family: var(--f-mono); font-weight: 500; font-size: 11px; color: var(--muted); }
.ladder p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.facts { width: 100%; max-width: 560px; border-collapse: collapse; font-size: 13px; }
.facts caption { text-align: start; padding: 0 8px 4px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--scan); }
.facts th { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: start; padding: 4px 8px; }
.facts td { padding: 6px 8px; border-top: 1px solid rgba(232, 237, 240, 0.09); color: var(--muted); }
.facts td:first-child { font-weight: 650; color: var(--bone); }
.facts td.n { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--fg); }
.facts td.n small { color: var(--muted); font-weight: 400; }
.rules { margin: 0; padding-inline-start: 20px; max-width: 58ch; color: var(--muted); font-size: 13.5px; line-height: 1.55; display: grid; gap: 5px; }
.rules b { color: var(--fg); font-weight: 600; }
.summary { display: grid; gap: 12px; justify-items: center; width: 100%; max-width: 560px; }
.misses { width: 100%; display: grid; gap: 4px; font-size: 13px; }
.misses div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 7px; background: rgba(10, 15, 20, 0.4); color: var(--muted); }
.misses b { color: var(--fg); font-weight: 600; white-space: nowrap; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
.actions:empty { display: none; }
.act {
  font: inherit; font-weight: 700; font-stretch: 105%; font-size: 15px; color: var(--fg); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 16px; min-width: 92px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative;
}
.act kbd { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.act[data-c] { border-bottom: 3px solid var(--c); padding-bottom: 9px; }
.act:hover:not(:disabled) { border-color: var(--scan); }
.act[data-c]:hover:not(:disabled) { border-color: var(--c); }
.act:disabled { opacity: .32; cursor: default; }
.act.primary { background: var(--bone); color: #1b1610; border-color: var(--bone); }
.act.primary kbd { color: #5d5345; border-color: #a99c84; }
.act.is-right { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); opacity: 1; }
.act.is-wrong { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); opacity: 1; }
.act.wide { min-width: 0; padding-inline: 13px; font-size: 14px; }
.act.num { min-width: 68px; font-family: var(--f-mono); font-weight: 600; font-size: 16px; }

/* ---------- phones / narrow ---------- */
@media (max-width: 900px) {
  .felt { padding: 12px 10px; border-radius: 14px; gap: 10px; }
  .act { flex: 1 1 28%; min-width: 0; padding: 13px 8px; font-size: 15px; }
  .act.wide { font-size: 13px; padding: 12px 4px; }
  .act.num { flex: 1 1 14%; min-width: 0; padding: 13px 2px; font-size: 15px; }
  .act kbd { display: none; }

  .ladder .rung { padding: 7px 8px; gap: 3px 10px; }
  .facts { font-size: 12.5px; }
  .facts td, .facts th { padding-inline: 5px; }
}
