/* ---------- Side panels ---------- */
.side { display: flex; flex-direction: column; gap: 14px; padding-top: 2px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel h2 { margin: 0; font: 600 13px var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.link {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  font: 600 13px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
}
.link:hover { color: var(--gold-hi); }
.count-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat-v { font: 700 30px/1.1 var(--f-display); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.stat-v.dim { color: var(--text); }
.stat-v.pos { color: var(--win); }
.stat-v.neg { color: var(--lose); }
.stat-l { font: 600 11.5px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.count-mask { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.bet-advice { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-wrap: pretty; }
.bet-advice:empty { display: none; }
.bet-advice b { color: var(--text); }
.stat-list { margin: 0; display: grid; }
.stat-list div { display: flex; justify-content: space-between; gap: 10px; padding-block: 6px; border-bottom: 1px dashed var(--line); }
.stat-list div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--muted); font-size: 14px; }
.stat-list dd { margin: 0; font: 600 15px var(--f-ui); font-variant-numeric: tabular-nums; }
.field { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 5px; }
.field label { color: var(--muted); font-size: 14px; }
select, input[type="number"] {
  font: 500 15px var(--f-ui); color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px;
}
select { cursor: pointer; max-width: 60%; }
.fine { margin: 8px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.45; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shared headings ---------- */
.h-display {
  margin: 0; font: 500 clamp(32px, 4.6vw, 50px)/1.04 var(--f-display);
  letter-spacing: -.01em; text-wrap: balance;
}
.lede { margin: 10px 0 0; max-width: 62ch; font-size: 17px; color: var(--muted); text-wrap: pretty; }
.eyebrow { margin: 0 0 10px; font: 600 13px var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.seg button {
  background: transparent; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  font: 600 14px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--gold); color: var(--gold-ink); }

/* ---------- Drills ---------- */
.drill-layout { max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-top: 10px; }
.drill-intro { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.felt-panel {
  --cw: clamp(92px, 20vw, 136px);
  position: relative;
  margin: 12px;
  padding: 26px 20px 24px;
  min-height: 460px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  color: var(--felt-text);
  border-radius: 24px;
  background: radial-gradient(ellipse 80% 70% at 50% 30%, var(--felt-hi), var(--felt) 50%, var(--felt-deep));
  box-shadow: 0 0 0 10px var(--rail), 0 0 0 11px var(--rail-hi), 0 0 0 13px #0d0605, 0 22px 50px rgba(0,0,0,.5), inset 0 0 70px rgba(0,0,0,.4);
}
.felt-panel[hidden] { display: none; }
.drill-how { margin: 0; text-align: center; color: var(--felt-muted); max-width: 56ch; text-wrap: balance; }
.drill-how b { color: var(--felt-text); }
.tag-slot { display: grid; place-items: center; min-height: calc(var(--cw) * 1.4); }
.drill-fb { margin: 0; min-height: 1.5em; font: 600 18px var(--f-ui); text-align: center; }
.good { color: var(--win); }
.bad { color: var(--lose); }
.tag-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn.tag { min-width: 104px; font-size: 22px; font-family: var(--f-display); letter-spacing: 0; text-transform: none; }
.btn.tag.hit-good { background: var(--win); color: #06301a; }
.btn.tag.hit-bad { background: var(--lose); color: #3a0c05; }
.drill-stats { display: flex; gap: 8px 24px; flex-wrap: wrap; justify-content: center; font: 600 12.5px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--felt-muted); }
.drill-stats b { margin-left: 6px; font-size: 18px; letter-spacing: 0; color: var(--felt-text); font-variant-numeric: tabular-nums; }

.run-setup { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center; }
.field.inline { gap: 8px; }
.field.inline label { color: var(--felt-muted); font: 600 12.5px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; }
.felt-panel select { background: rgba(0,0,0,.3); border-color: rgba(216,178,92,.45); max-width: none; }
.run-board { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.run-flash { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: calc(var(--cw) * 1.4); }
.run-flash .card + .card { margin-left: 0; }
.run-idle, .run-done { margin: 0; max-width: 30ch; text-align: center; color: var(--felt-muted); font-size: 16px; }
.run-count3 { font: italic 700 88px/1 var(--f-display); color: var(--gold-hi); }
.run-answer { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: center; }
.run-answer .ctrl-q { color: var(--felt-text); }
.felt-panel .stepper { background: rgba(0,0,0,.3); }
.drill-result {
  max-width: 620px; padding: 12px 16px; border-radius: 12px; text-align: center; text-wrap: pretty;
  background: rgba(3, 22, 16, .6); border: 1px solid var(--line-2);
}
.drill-result p { margin: 0; }
.drill-result p + p { margin-top: 6px; }
.drill-result .held { display: inline-flex; vertical-align: middle; --cw: 40px; margin-inline: 4px; }
.run-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; --cw: 40px; max-width: 100%; }
.run-strip:empty { display: none; }
.strip-item { display: flex; flex-direction: column; align-items: center; gap: 1px; font: 600 12px/1.2 var(--f-ui); font-variant-numeric: tabular-nums; }
.strip-item .t-p { color: var(--win); }
.strip-item .t-n { color: var(--lose); }
.strip-item .t-z { color: var(--felt-muted); }
.strip-item .run { color: var(--felt-text); opacity: .75; }

.true-q { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-end; justify-content: center; }
.true-rc { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.big { font: 700 76px/1 var(--f-display); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.true-tray { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gauge {
  position: relative; width: 150px; height: 190px;
  border-radius: 8px; background: rgba(0,0,0,.3);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.35);
  margin-right: 34px;
}
.gauge-fill {
  position: absolute; left: 6px; right: 6px; bottom: 4px; height: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(to top, #eee5d2 0 2px, #c7b99d 2px 3px);
  transition: height .5s ease;
}
.gauge-tick { position: absolute; left: 100%; width: 34px; height: 0; border-top: 1px solid rgba(216,178,92,.6); }
.gauge-tick span { position: absolute; left: 10px; top: -.7em; font: 600 12px/1.4 var(--f-ui); color: var(--felt-muted); }
.gauge-tick.half { width: 8px; opacity: .6; }

/* ---------- Learn ---------- */
.learn { max-width: 960px; margin: 0 auto; display: grid; gap: 34px; padding-top: 14px; }
.learn-head { max-width: 760px; }
.learn-sec { border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.learn-sec h2 { margin: 0; font: 500 30px/1.15 var(--f-display); text-wrap: balance; }
.learn-sec p { margin: 0; max-width: 68ch; text-wrap: pretty; }
.learn-sec b { color: var(--gold-hi); font-weight: 600; }
.value-row { display: flex; flex-wrap: wrap; gap: 12px 10px; --cw: 54px; }
.value-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.value-item span { font: 700 15px var(--f-ui); color: var(--gold-hi); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 70ch; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; align-items: baseline; }
.steps li::before { content: counter(step); font: italic 700 24px/1 var(--f-display); color: var(--gold); }
.moves { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.moves > div { padding-block: 12px; border-bottom: 1px solid var(--line); }
.moves dt { display: flex; align-items: center; gap: 8px; font: 600 16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.moves dt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.moves kbd { padding: 0 5px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 11px; color: var(--muted); }
.moves dd { margin: 4px 0 0; color: var(--muted); }
.table-scroll { overflow-x: auto; max-width: 100%; }
.pay { border-collapse: collapse; min-width: 420px; }
.pay th, .pay td { text-align: left; padding: 9px 18px 9px 0; border-bottom: 1px solid var(--line); }
.pay th { font: 600 12px var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pay .odds { font: italic 700 18px var(--f-display); color: var(--gold-hi); white-space: nowrap; }

.bust-chart { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; height: 210px; max-width: 620px; }
.bar-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; min-width: 0; }
.bar-track { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; border-bottom: 1px solid var(--line-2); }
.bar-val { text-align: center; font: 600 13px var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { border-radius: 4px 4px 0 0; background: var(--felt-hi); min-height: 2px; }
.bar.weak { background: var(--gold); }
.bar-up { text-align: center; font: 700 16px var(--f-display); }

.chart-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.chart-rule { font: italic 500 16px var(--f-display); color: var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 3px; border-radius: 4px; font: normal 700 12px var(--f-ui); }
.chart { border-collapse: separate; border-spacing: 3px; font-family: var(--f-ui); }
.chart th { font: 600 13px var(--f-ui); color: var(--muted); padding: 2px 6px; white-space: nowrap; }
.chart thead th { color: var(--gold-hi); font: 700 15px var(--f-display); }
.chart tbody th { text-align: right; }
.chart td { padding: 0; }
.cell {
  width: 44px; height: 32px; border: 0; border-radius: 5px; cursor: pointer;
  font: 700 13.5px var(--f-ui); letter-spacing: .02em;
}
.cell:hover { filter: brightness(1.15); }
.cell.sel { outline: 2px solid var(--paper); outline-offset: 1px; }
.c-H { background: var(--c-hit); color: #fff; }
.c-S { background: var(--c-stand); color: #2a1e05; }
.c-D { background: var(--c-double); color: #fff; }
.c-Ds { background: linear-gradient(135deg, var(--c-double) 55%, var(--c-stand) 55%); color: #fff; }
.c-P { background: var(--c-split); color: #fff; }
.c-Rh { background: linear-gradient(135deg, var(--c-surr) 55%, var(--c-hit) 55%); color: #fff; }
.c-Rs { background: linear-gradient(135deg, var(--c-surr) 55%, var(--c-stand) 55%); color: #fff; }
.chart-note { min-height: 3em; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.chart-note b { color: var(--gold-hi); }

.hilo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; --cw: 46px; }
.hilo-group {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 12px 14px; border-radius: 16px;
  background: radial-gradient(ellipse at 50% 20%, var(--felt), var(--felt-deep));
  box-shadow: inset 0 0 0 1px rgba(216,178,92,.25);
}
.hilo-tag { font: 700 36px/1 var(--f-display); }
.hilo-tag.p { color: var(--win); }
.hilo-tag.z { color: var(--felt-text); }
.hilo-tag.n { color: var(--lose); }
.hilo-cards { display: flex; }
.hilo-cards .card + .card { margin-left: calc(var(--cw) * -.5); }
.hilo-lbl { font: 600 13px var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--felt-muted); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .table-layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px 16px; }
  .bank { margin-left: 0; flex-direction: row; align-items: baseline; gap: 8px; }
  .tabs { order: 3; width: 100%; gap: 4px 16px; }
  .felt { margin: 10px 8px 22px; padding: 14px 8px 34px; min-height: 430px; box-shadow: 0 0 0 8px var(--rail), 0 0 0 9px var(--rail-hi), 0 0 0 10px #0d0605, 0 18px 40px rgba(0,0,0,.6), inset 0 0 60px rgba(0,0,0,.45); }
  .felt-label { font-size: 9.5px; letter-spacing: .08em; }
  .table-msg { font-size: 15px; padding: 6px 12px; }
  .btn { padding: 8px 12px; font-size: 15px; min-height: 42px; }
  .btn kbd { display: none; }
  .chip { width: 50px; }
  .moves { grid-template-columns: minmax(0, 1fr); }
  .hilo-row { grid-template-columns: minmax(0, 1fr); }
  .bust-chart { gap: 4px; height: 180px; }
  .bar-val { font-size: 11px; }
  .felt-panel { margin: 8px; padding: 22px 12px; box-shadow: 0 0 0 8px var(--rail), 0 0 0 9px var(--rail-hi), 0 18px 40px rgba(0,0,0,.5), inset 0 0 60px rgba(0,0,0,.4); }
  .big { font-size: 60px; }
  .cell { width: 34px; height: 30px; font-size: 12px; }
  .learn-sec h2 { font-size: 26px; }
}
