/* Blackjack trainer styles. Depends on the tokens in style.css. */

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.table-col, .side-col { min-width: 0; display: grid; gap: 16px; }
@media (max-width: 960px) {
  .game-layout { grid-template-columns: 1fr; gap: 12px; }
  .table-col, .side-col { display: contents; }
  .felt { order: 1; } .feedback { order: 2; } .chart-panel { order: 3; } .scoreboard-wrap { order: 4; } .about { order: 5; } .rules-panel { order: 6; }
  .felt.controls { order: 8; position: sticky; bottom: 0; z-index: 5; margin: 0 -18px -48px; border-radius: 14px 14px 0 0; padding: 10px 14px 14px; box-shadow: 0 -4px 16px rgba(0,0,0,.35); }
}

/* The table */
.felt {
  position: relative; border-radius: 16px; padding: 22px 20px 18px;
  background: radial-gradient(ellipse at 50% 0%, #2a7a55 0%, #1d5c40 55%, #174b34 100%);
  border: 1px solid #0f3a27; box-shadow: inset 0 0 0 6px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.25);
  color: #fff; min-height: 360px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px;
}
/* a steady table: the same height whether waiting for a bet, playing or settling (phones and the special modes have their own sizes) */
@media (min-width: 601px) {
  #felt:not(.flash):not(.counting) { min-height: 560px; }
  #felt.idle { min-height: 560px; }
  #felt.idle .banner { align-self: center; }
}
/* dense: three hands or many cards shrink and overlap so the hands stay on one row */
@media (min-width: 601px) {
  .felt.dense .hands { flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
  .felt.dense .felt-mid { align-items: start; }
  .felt.dense .hand { padding: 6px 8px 8px; min-width: 0; }
  .felt.dense .hand .cards { gap: 0; min-height: 66px; flex-wrap: wrap; }
  .felt.dense .hand .pcard { width: 46px; height: 64px; box-shadow: -2px 0 3px rgba(0,0,0,.25); }
  .felt.dense .hand .pcard + .pcard { margin-left: -16px; }
  .felt.dense .hand .pcard .r { font-size: .95rem; top: 3px; left: 4px; }
  .felt.dense .hand .pcard .s { font-size: 1.1rem; bottom: 2px; right: 4px; }
  .felt.dense .hand-meta { font-size: .8rem; }
}
.seat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.7); margin-bottom: 6px; display: flex; gap: 10px; align-items: baseline; }
.seat-label .total { font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; text-transform: none; letter-spacing: 0; color: #fff; }
.cards { display: flex; gap: 8px; min-height: 84px; align-items: center; flex-wrap: wrap; }
.pcard {
  width: 58px; height: 82px; border-radius: 7px; background: #fff; color: #1a231e; position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,.35); font-family: "Fraunces", Georgia, serif; font-weight: 600;
  flex: none;
}
.pcard.new { animation: dealin .28s ease-out; }
.pcard.red { color: #b93030; }
.pcard .r { position: absolute; top: 5px; left: 7px; font-size: 1.15rem; line-height: 1; }
.pcard .s { position: absolute; bottom: 4px; right: 7px; font-size: 1.6rem; line-height: 1; }
.pcard.back { background: repeating-linear-gradient(45deg, #7c2a2a 0 6px, #9a3a3a 6px 12px); border: 4px solid #fff; }
@keyframes dealin { from { transform: translateY(-14px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pcard.new { animation: none; } }

.banner { min-height: 30px; text-align: center; font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.banner.win { color: #ffe08a; } .banner.lose { color: #ffb3b3; }

.hands { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; }
.hand { padding: 8px 10px 10px; border-radius: 10px; border: 2px solid transparent; }
.hand.active { border-color: rgba(255,224,138,.9); background: rgba(0,0,0,.14); }
.hand .hand-meta { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; font-size: .85rem; color: rgba(255,255,255,.8); }
.hand .hand-meta .t { font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; color: #fff; }
.hand .outcome { font-weight: 600; }
.hand .outcome.win { color: #ffe08a; } .hand .outcome.lose { color: #ffb3b3; } .hand .outcome.push { color: #d9e6df; }
.chip-stack { display: inline-flex; align-items: center; gap: 4px; }
.chip { width: 22px; height: 22px; border-radius: 50%; border: 3px dashed rgba(255,255,255,.85); display: inline-grid; place-items: center; font-size: .6rem; font-weight: 600; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.chip.c5 { background: #b8353b; } .chip.c10 { background: #2f63b3; } .chip.c25 { background: #2b8a4f; } .chip.c50 { background: #d88b1e; } .chip.c100 { background: #222; }

.controls { display: grid; gap: 10px; min-height: 0; padding: 14px 20px; grid-template-rows: auto; }
.bet-box { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; min-height: 44px; }
.bet-amount { font-size: .95rem; white-space: nowrap; } .bet-amount strong { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; margin-left: 3px; }
.chips { display: flex; gap: 5px; }
.chips button { width: 36px; height: 36px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.85); color: #fff; font-weight: 600; font-size: .8rem; box-shadow: 0 2px 4px rgba(0,0,0,.4); cursor: pointer; }
.chips button:disabled { opacity: .4; cursor: default; }
.bet-actions { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: nowrap; }
.bet-actions .ghost { padding: 8px 10px; }
.deal-group .deal { padding: 8px 12px; }
#seatNote:empty { display: none; }
.felt.controls { min-height: 0; }
.felt button.primary { background: #ffe08a; color: #1a231e; }
.felt button.primary:hover { background: #ffd35a; }
.felt button.primary:disabled { opacity: .5; }
.felt button.big { padding: 11px 22px; font-size: 1.05rem; }
.felt button.ghost { border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 8px; padding: 8px 12px; }
.felt button.ghost:hover { background: rgba(255,255,255,.12); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .act { border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 600; background: #fff; color: #1a231e; }
.actions .act:hover:not(:disabled) { background: #ffe08a; }
.actions .act:disabled { opacity: .35; cursor: default; }
kbd { font: 600 .7rem "IBM Plex Sans", sans-serif; background: rgba(0,0,0,.12); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.actions .act kbd { background: rgba(0,0,0,.1); }
.next-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.next-box span { font-size: 1.05rem; }
.insurance-box { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; }
.insurance-box .ins-text { flex: 1 1 auto; min-width: 0; }
.insurance-box .primary, .insurance-box .ghost { flex: none; white-space: nowrap; }
@media (max-width: 600px) { .insurance-box { flex-wrap: wrap; } }
.muted { color: var(--muted); }
.felt .muted { color: rgba(255,255,255,.7); }
.small { font-size: .85rem; }

/* Feedback */
.feedback { display: none; }
.feedback.show { display: block; }
.feedback .verdict { font-weight: 600; font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; }
.feedback .verdict.good { color: var(--felt); } .feedback .verdict.bad { color: var(--loss); } .feedback .verdict.close { color: var(--act-double); }
.feedback .detail { color: var(--muted); margin-top: 4px; }

/* Scoreboard */
.scoreboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.scoreboard .stat span { display: block; color: var(--muted); font-size: .8rem; }
.scoreboard .stat strong { font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; font-weight: 600; }
.scoreboard .stat strong.pos { color: var(--felt); } .scoreboard .stat strong.neg { color: var(--loss); }
button.ghost.small { border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 6px; padding: 6px 10px; font-size: .85rem; }
button.ghost.small.on { background: var(--felt); color: #fff; border-color: var(--felt); }
button.ghost.small:disabled { opacity: .5; cursor: default; }
.score-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.scoreboard-wrap .risk { margin-top: 10px; }

/* Side panels */
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head select { border: 1px solid var(--line-strong); background: var(--chip); border-radius: 6px; padding: 4px 6px; font-size: .85rem; }
.toggle { display: flex; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); }
.toggle input { accent-color: var(--felt); }
.odds table { width: 100%; border-collapse: collapse; }
.odds th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 4px 6px; border-bottom: 1px solid var(--line-strong); }
.odds td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.odds td.num { text-align: right; font-weight: 500; }
.odds td.num.pos { color: var(--felt); } .odds td.num.neg { color: var(--loss); }
.odds tr.best td { background: var(--felt-tint); font-weight: 600; }
.odds tr.na td { color: var(--muted); }
.odds .advice { margin-top: 10px; font-weight: 600; }
.odds .fine { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.odds .blur { filter: blur(6px); pointer-events: none; user-select: none; }
.pen { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.pen i { display: block; height: 100%; background: var(--felt); width: 0; transition: width .2s; }
.shoe-line { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin: 6px 0 8px; }
.count-line { font-size: .95rem; margin: 4px 0 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.count-line strong { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; }
.comp { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; align-items: end; height: 70px; margin: 8px 0 6px; }
.comp .bar { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; font-size: .72rem; color: var(--muted); }
.comp .bar i { display: block; align-self: end; background: var(--line-strong); border-radius: 3px 3px 0 0; min-height: 2px; }
.comp .bar i.rich { background: var(--felt); } .comp .bar i.poor { background: var(--loss); }
.comp .bar b { font-weight: 600; color: var(--ink); }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details:not(.pl) > summary::after { content: " \25BE"; color: var(--muted); }
details:not(.pl)[open] > summary::after { content: " \25B4"; }

.deal-group { display: inline-flex; align-items: center; gap: 0; border-radius: 10px; overflow: hidden; }
.deal-group .deal-lbl { color: #ffe08a; font-weight: 600; padding: 0 8px 0 2px; letter-spacing: .02em; white-space: nowrap; font-size: .9rem; }
.felt .deal-group .deal { width: auto; min-width: 40px; padding: 8px 11px; font-size: inherit; font-weight: 600; text-align: center; border-radius: 0; white-space: nowrap; display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; }
.felt .deal-group .deal:first-of-type { border-radius: 8px 0 0 8px; }
.felt .deal-group .deal:last-of-type { border-radius: 0 8px 8px 0; }
.deal-group .deal + .deal { border-left: 1px solid rgba(0,0,0,.18); }
.hand .idx { color: var(--muted); font-size: .75rem; margin-right: 6px; }




/* Phones */
@media (max-width: 600px) {
  .wrap { padding: 14px 12px 40px; }
  header.top { margin-bottom: 12px; gap: 8px; }
  header.top h1 { font-size: 1.35rem; }
  header.top .sub { display: none; }
  .felt { padding: 14px 12px 12px; min-height: 0; gap: 10px; border-radius: 12px; }
  .pcard { width: 46px; height: 66px; }
  .pcard .r { font-size: 1rem; top: 4px; left: 5px; } .pcard .s { font-size: 1.25rem; bottom: 3px; right: 5px; }
  .cards { min-height: 68px; gap: 6px; }
  .hands { gap: 10px; }
  .hand { padding: 6px 6px 8px; }
  .banner { font-size: 1.1rem; min-height: 24px; }
  .controls { margin: 0 -12px -40px; padding: 10px 10px 12px; }
  .bet-box { gap: 8px 10px; }
  .chips button { width: 40px; height: 40px; font-size: .72rem; border-width: 3px; }
  .bet-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .deal-group { width: 100%; }
  .felt .deal-group .deal { flex: 1; width: auto; }
  .deal-group .deal-lbl { padding-left: 0; }
  .felt button.big { padding: 9px 12px; font-size: .95rem; }
  .felt .deal-group .deal { padding: 8px 0; }
  .actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .actions .act, .actions .ghost { padding: 11px 6px; text-align: center; }
  kbd { display: none; }
  .game-layout { gap: 10px; }
  section.panel { padding: 12px; border-radius: 8px; }
  .panel-head { flex-wrap: wrap; gap: 6px; }
  .scoreboard { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .scoreboard .stat strong { font-size: 1.1rem; }
  .comp { gap: 3px; }
}

/* Learning aids */
.mistake-list { margin: 8px 0 0; padding-left: 18px; }
.mistake-list li { margin: 2px 0; }
.felt.testing { box-shadow: inset 0 0 0 6px rgba(0,0,0,.18), 0 0 0 3px var(--act-double); }
.count-line span + span { margin-left: 12px; }


/* Overlays on the felt */
.felt-top { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.felt-mid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; min-width: 0; }
.felt-mid > * { min-width: 0; }
.ev-box { max-width: 100%; }
.ev-box .v.why { font-size: .72rem; color: rgba(255,255,255,.6); white-space: nowrap; }
.overlay { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 8px 12px; font-size: .8rem; color: rgba(255,255,255,.88); }
.overlay .k { color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .06em; font-size: .66rem; }
.overlay .dimtxt, .dimtxt { color: rgba(255,255,255,.6); }
/* dealer finishing distribution */
.dealer-box { justify-self: start; min-width: 200px; }
.dealer-box .bust { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; font-weight: 600; color: #fff; }
.dealer-box .dist { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; align-items: end; }
.dealer-box .dist div { text-align: center; font-size: .66rem; color: rgba(255,255,255,.75); }
.dealer-box .dist i { display: block; height: 26px; position: relative; margin-bottom: 2px; }
.dealer-box .dist i::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 0; height: var(--h); background: rgba(255,255,255,.45); border-radius: 2px 2px 0 0; }
.dealer-box .dist div.b i::after { background: #ffe08a; }
.dealer-box .dist b { display: block; color: #fff; font-weight: 600; }
/* count badge */
.count-badge strong { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; color: #fff; font-weight: 600; }
.count-badge .k { align-self: end; }
.count-badge .bet { grid-column: 1 / -1; color: #ffe08a; font-weight: 600; }
/* EV box for the hand in play */
.ev-box { min-width: 240px; justify-self: end; }
.ev-box .title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ev-box .title b { color: #fff; font-size: .85rem; }
.ev-box .row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 3px 6px; border-radius: 5px; margin: 0 -6px; }
.ev-box .row.best { background: rgba(255,224,138,.22); color: #ffe08a; font-weight: 600; }
.ev-box .row.na { color: rgba(255,255,255,.45); }
.ev-box .row .v { font-variant-numeric: tabular-nums; }
.ev-box .row .v.pos { color: #9fe3bd; } .ev-box .row.best .v { color: #ffe08a; }
.ev-box .advice { margin-top: 6px; color: #fff; }
.ev-box .fine { color: rgba(255,255,255,.6); font-size: .72rem; margin-top: 2px; }
.ev-box .blur { filter: blur(6px); pointer-events: none; user-select: none; }
.ev-box p { margin: 0; color: rgba(255,255,255,.7); }
/* shoe strip along the bottom of the felt */
.shoe-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.14); padding-top: 10px; font-size: .75rem; color: rgba(255,255,255,.85); }
.shoe-strip .pen { flex: 1 1 120px; height: 6px; background: rgba(0,0,0,.35); border-radius: 3px; overflow: hidden; }
.shoe-strip .pen i { display: block; height: 100%; background: #ffe08a; width: 0; }
.shoe-strip .shoe-txt { white-space: nowrap; }
.shoe-strip .comp { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.shoe-strip .comp .bar { width: 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.shoe-strip .comp .bar i { display: block; width: 100%; background: rgba(255,255,255,.35); border-radius: 2px 2px 0 0; min-height: 2px; }
.shoe-strip .comp .bar i.rich { background: #9fe3bd; } .shoe-strip .comp .bar i.poor { background: #ffb3b3; }
.shoe-strip .comp .bar span { font-size: .6rem; line-height: 1.1; text-align: center; color: rgba(255,255,255,.8); }
.shoe-strip .comp .bar span b { color: #fff; }
.hint-select { border: 1px solid var(--line-strong); background: var(--chip); border-radius: 6px; padding: 4px 6px; font-size: .8rem; }
@media (max-width: 700px) {
  .felt-top { grid-template-columns: 1fr; }
  .felt-mid { grid-template-columns: 1fr; }
  .dealer-box, .ev-box { justify-self: stretch; min-width: 0; }
  .shoe-strip .comp .bar { width: 18px; }
}

@media (max-width: 600px) { .view-bar { gap: 6px 12px; font-size: .85rem; margin-bottom: 10px; } }

/* Idle table */
.felt.idle { min-height: 0; }
.felt.idle .seat.dealer .cards, .felt.idle .hands { min-height: 0; }
.felt.idle .felt-top { grid-template-columns: auto 1fr auto; }
.banner.idle { color: rgba(255,255,255,.55); font-size: 1.1rem; font-weight: 400; }
.felt-top .seat.dealer { grid-column: 1; } .felt-top .dealer-box { grid-column: 2; } .felt-top .count-badge { grid-column: 3; justify-self: end; }
@media (max-width: 700px) { .felt-top .seat.dealer, .felt-top .dealer-box, .felt-top .count-badge { grid-column: auto; justify-self: stretch; } }

/* Phone: two-column felt so a whole round fits above the action bar */
@media (max-width: 600px) {
  header.top { align-items: center; margin-bottom: 8px; }
  header.top h1 { font-size: 1.25rem; }
  .head-right .tabs button, .head-right .tablink { padding: 6px 10px; font-size: .85rem; }
  .theme-btn, .menu-btn { width: 32px; height: 32px; }
  .view-bar { margin: 0 0 8px; gap: 4px 10px; font-size: .8rem; }
  .view-bar .k { display: none; }
  .felt { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "dealer player" "banner banner" "dbox dbox" "hbox hbox" "count count" "shoe shoe"; gap: 8px 10px; padding: 12px 10px 10px; }
  .felt.idle { grid-template-areas: "dealer count" "banner banner" "shoe shoe"; }
  .felt-top, .felt-mid { display: contents; }
  .felt-top .seat.dealer { grid-area: dealer; }
  .seat.player { grid-area: player; }
  .banner { grid-area: banner; min-height: 0; }
  .banner:empty { display: none; }
  .felt-top .dealer-box { grid-area: dbox; }
  .ev-box { grid-area: hbox; }
  .felt-top .count-badge { grid-area: count; }
  .shoe-strip { grid-area: shoe; padding-top: 6px; gap: 8px; }
  .shoe-strip .comp { display: none; }
  .felt.count-on .shoe-strip .comp { display: flex; }
  .seat-label { font-size: .7rem; }
  .pcard { width: 40px; height: 58px; }
  .pcard .r { font-size: .9rem; top: 3px; left: 4px; } .pcard .s { font-size: 1.1rem; bottom: 2px; right: 4px; }
  .cards { min-height: 60px; gap: 4px; }
  .hand { padding: 4px 4px 6px; }
  .hand-meta { font-size: .8rem; }
  .overlay { padding: 6px 8px; font-size: .72rem; }
  .dealer-box { min-width: 0; }
  .dealer-box .bust { font-size: .95rem; }
  .dealer-box .dist { gap: 2px; margin-top: 3px; }
  .dealer-box .dist i { display: none; }
  .dealer-box .dist div { font-size: .6rem; }
  .ev-box .title b { font-size: .75rem; }
  .ev-box .row { padding: 1px 4px; margin: 0 -4px; gap: 6px; font-size: .72rem; line-height: 1.3; }
  .ev-box .advice { margin-top: 3px; font-size: .74rem; }
  .ev-box .fine { display: none; }
  .actions { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .actions .act { padding: 10px 0; font-size: .8rem; width: 100%; justify-content: center; }
  .actions .ghost { grid-column: 1 / -1; padding: 8px; }
  .controls { padding: 8px 10px 10px; }
  .chips button { width: 36px; height: 36px; font-size: .68rem; }
  .bet-actions .ghost { padding: 7px 10px; font-size: .85rem; }
}

.short { display: none; }
@media (max-width: 600px) {
  .long { display: none; } .short { display: inline; }
  .bet-box { gap: 6px 8px; }
  .bet-actions { gap: 6px; }
}

/* Phone fixes: controls must not inherit the two-column felt grid; compact header, count and shoe */
@media (max-width: 600px) {
  .felt.controls { grid-template-columns: 1fr; grid-template-areas: none; gap: 8px; padding: 8px 10px 10px; margin-bottom: -40px; }
  .felt.controls > * { grid-area: auto; }
  .felt { align-items: start; }
  header.top h1 { display: none; }
  header.top { margin-bottom: 6px; }
  .head-right { width: 100%; justify-content: space-between; }
  .count-badge { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; text-align: left; padding: 5px 10px; }
  .count-badge .cb { display: inline-flex; align-items: baseline; gap: 6px; }
  .count-badge strong { font-size: 1rem; }
  .count-badge .bet { margin-left: auto; }
  .shoe-strip { gap: 6px 10px; font-size: .7rem; }
  .shoe-strip .comp { height: 20px; gap: 2px; }
  .shoe-strip .comp .bar { width: 15px; }
  .shoe-strip .comp .bar span { font-size: .55rem; }
  .shoe-strip .comp .bar span small { display: none; }
}
@media (min-width: 601px) {
  .count-badge { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-end; justify-content: flex-end; max-width: 300px; }
  .count-badge .cb { display: grid; gap: 1px; text-align: center; }
  .count-badge .bet { width: 100%; text-align: right; }
}
.count-badge .cb strong { display: block; }

.ev-help { border: 0; background: transparent; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ev-help:hover { color: #fff; }

/* Display menu in the header */
.menu { position: relative; }
.menu-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--felt); }
.menu-body { position: absolute; right: 0; top: 42px; z-index: 20; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.menu-body label { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.menu-body input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--felt); margin: 0; }
.menu-body select { border: 1px solid var(--line-strong); background: var(--chip); border-radius: 6px; padding: 5px 8px; font-size: .9rem; }
.menu-title { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; margin-top: 2px; }
/* Strategy panel collapse */
.edge-box { margin-top: 10px; display: grid; gap: 6px; justify-items: start; }
.edge-main { margin: 4px 0 2px; }
.edge-list { margin: 4px 0 0; padding-left: 18px; }
.edge-list li { margin: 2px 0; }
.edge-list .neg { color: var(--loss); } .edge-list .pos { color: var(--felt); }
.risk { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.small-select { border: 1px solid var(--line-strong); background: var(--chip); border-radius: 6px; padding: 2px 6px; font-size: .85rem; }
.feedback .why { margin-top: 6px; color: var(--muted); font-size: .85rem; }
/* Phones: roomier buttons, chart collapsed by default (handled in JS), no title */
@media (max-width: 600px) {
  .actions { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .actions .act { padding: 13px 0; font-size: .95rem; grid-column: span 2; }
  .actions .act[data-a="split"], .actions .act[data-a="surrender"] { grid-column: span 3; }
  .actions .ghost { grid-column: 1 / -1; }
  .felt.controls { padding: 10px 12px 12px; }
  .chips { gap: 6px; }
  .chips button { width: 40px; height: 40px; font-size: .74rem; }
  .bet-actions { margin-left: 0; width: 100%; flex-wrap: nowrap; }
  .bet-actions .ghost { padding: 9px 10px; }
  .felt .deal-group { margin-left: auto; }
  .felt .deal-group .deal { padding: 9px 14px; }
  .next-box .primary { padding: 12px 18px; }
  .menu-body { position: fixed; left: 12px; right: 12px; top: auto; }
  .head-right { justify-content: flex-start; gap: 6px; }
  .head-right .tabs { margin-right: auto; }
}
.game-layout.no-chart { grid-template-columns: 1fr; }
.game-layout.no-chart .side-col { display: none; }
details.about { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); }
@media (max-width: 600px) {
  .actions .act .short { display: none; } .actions .act .long { display: inline; }
  details.about { padding: 12px; border-radius: 8px; }
}

/* Phone drawer ("shade") */
.shade-handle, .mini-fb, .shade { display: none; }
@media (max-width: 600px) {
  .felt.controls { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 30; border-radius: 14px 14px 0 0; }
  .shade-handle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: 0; background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); border-radius: 8px; padding: 6px; font-size: .8rem; font-weight: 500; }
  .shade-handle:active { background: rgba(255,255,255,.18); }
  .mini-fb { display: block; grid-area: fb; width: 100%; text-align: left; border: 0; border-radius: 8px; padding: 7px 10px; font-weight: 600; font-size: .85rem; background: rgba(0,0,0,.28); color: #fff; }
  .mini-fb.good { background: rgba(63,169,122,.35); } .mini-fb.close { background: rgba(232,194,90,.35); } .mini-fb.bad { background: rgba(217,95,95,.4); }
  .mini-fb::after { content: " \203A"; opacity: .7; }
  .mini-fb.hidden { display: none; }
  .felt { grid-template-areas: "dealer player" "banner banner" "fb fb" "dbox dbox" "hbox hbox" "count count" "shoe shoe"; }
  .felt.idle { grid-template-areas: "dealer count" "banner banner" "fb fb" "shoe shoe"; }
  .shade { display: block; position: fixed; left: 0; right: 0; top: 10vh; bottom: 160px; z-index: 25; background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.35); transform: translateY(110%); transition: transform .22s ease; overflow: hidden; display: flex; flex-direction: column; }
  body.shade-open .shade { transform: translateY(0); }
  .shade-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
  .shade-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); display: grid; place-items: center; }
  .shade-body { overflow: auto; padding: 10px 12px 16px; display: grid; gap: 10px; align-content: start; -webkit-overflow-scrolling: touch; }
  .shade-body .feedback { order: 1; } .shade-body .chart-panel { order: 2; } .shade-body .scoreboard-wrap { order: 3; } .shade-body details.about { order: 4; } .shade-body .rules-panel { order: 5; }
  .shade-body .feedback:not(.show) { display: none; }
  body.shade-open { overflow: hidden; }
  .game-layout { gap: 0; }
}

/* Phone: several hands sit in a row with fanned cards, player area full width */
@media (max-width: 600px) {
  .felt.multi { grid-template-areas: "dealer dealer" "player player" "banner banner" "fb fb" "dbox dbox" "hbox hbox" "count count" "shoe shoe"; }
  .felt.multi .seat.player { justify-self: stretch; }
  .felt.multi .hands { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-start; }
  .felt.multi .hand { padding: 4px 6px 5px; }
  .felt.multi .hand .cards { min-height: 54px; gap: 0; }
  .felt.multi .hand .pcard { width: 36px; height: 52px; box-shadow: -2px 0 3px rgba(0,0,0,.25); }
  .felt.multi .hand .pcard + .pcard { margin-left: -17px; }
  .felt.multi .hand .pcard .r { font-size: .85rem; top: 2px; left: 3px; }
  .felt.multi .hand .pcard .s { display: none; }
  .felt.multi .hand-meta { font-size: .74rem; gap: 4px; }
  .felt.multi .hand .idx { display: none; }
  .felt.multi .seat.dealer .cards { gap: 4px; }
}

/* Table with other seats */
.seats { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; width: 100%; }
.seat-block { border-radius: 10px; padding: 6px 8px 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.14); min-width: 96px; }
.seat-block.mine { background: transparent; border-color: transparent; padding: 0; }
.seat-block.mine .seat-name { margin-bottom: 4px; }
.seat-block.empty { opacity: .5; min-height: 40px; }
.seat-block.acting { border-color: #ffe08a; box-shadow: 0 0 0 2px rgba(255,224,138,.35); }
.seat-name { font-size: .72rem; color: rgba(255,255,255,.85); font-weight: 600; letter-spacing: .02em; }
.seat-name .seat-no { color: rgba(255,255,255,.55); font-weight: 400; margin-left: 4px; }
.bot-hands { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bot-hand .cards { min-height: 52px; gap: 0; display: flex; }
.bot-hand .pcard { width: 36px; height: 52px; box-shadow: -2px 0 3px rgba(0,0,0,.25); }
.bot-hand .pcard + .pcard { margin-left: -17px; }
.bot-hand .pcard .r { font-size: .85rem; top: 2px; left: 3px; }
.bot-hand .pcard .s { display: none; }
.bot-hand .hand-meta { font-size: .72rem; gap: 6px; margin-top: 3px; }
.bot-hand .hand-meta .t { font-size: .9rem; }
.bot-hand .bet-txt { color: rgba(255,255,255,.7); }
.felt.table .felt-mid { grid-template-columns: 1fr; }
.felt.table .ev-box { justify-self: end; }
.felt.table .seat.player { width: 100%; }
.timer { position: relative; height: 8px; border-radius: 4px; background: rgba(0,0,0,.35); overflow: visible; margin: 2px 0 4px; }
.timer i { display: block; height: 100%; border-radius: 4px; background: #ffe08a; width: 100%; transition: width .1s linear; }
.timer span { position: absolute; right: 0; top: -18px; font-size: .72rem; color: #ffe08a; font-weight: 600; }
.wait-box { color: rgba(255,255,255,.75); font-size: .9rem; padding: 6px 2px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.menu-row select { max-width: 150px; }
@media (max-width: 600px) {
  .felt.table { grid-template-areas: "dealer dealer" "player player" "banner banner" "fb fb" "dbox dbox" "hbox hbox" "count count" "shoe shoe"; }
  .felt.table .seat.player { justify-self: stretch; }
  .seats { gap: 6px 8px; }
  .seat-block { padding: 4px 6px 6px; min-width: 0; }
  .seat-name { font-size: .64rem; }
  .bot-hand .pcard { width: 30px; height: 44px; } .bot-hand .pcard + .pcard { margin-left: -15px; }
  .bot-hand .pcard .r { font-size: .75rem; }
  .bot-hand .hand-meta { font-size: .66rem; }
}
.timer { display: flex; align-items: center; gap: 8px; height: auto; background: transparent; }
.timer i { height: 8px; flex: 1; background: #ffe08a; border-radius: 4px; }
.timer span { position: static; min-width: 30px; text-align: right; }

.shade-handle svg { transition: transform .2s; }
body.shade-open .shade-handle svg { transform: rotate(180deg); }
body.shade-open .shade-handle { background: rgba(255,224,138,.22); color: #ffe08a; }

/* Count panel */
.count-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.count-now .cn { background: var(--chip); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.count-now .k { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .66rem; }
.count-now strong { font-family: "Fraunces", Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.count-now strong.pos { color: var(--felt); } .count-now strong.neg { color: var(--loss); }
table.dev { border-collapse: collapse; width: 100%; font-size: .82rem; }
table.dev th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 6px; border-bottom: 1px solid var(--line-strong); }
table.dev td { padding: 3px 6px; border-bottom: 1px solid var(--line); }
table.dev tr.on td { color: var(--felt); font-weight: 600; }
table.dev tr.here td { background: var(--felt-tint); }
table.dev td:last-child { color: var(--felt); font-weight: 600; }
.ev-box .fresh { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.14); font-size: .74rem; color: rgba(255,255,255,.85); }
.ev-box .fresh .pos { color: #9fe3bd; } .ev-box .fresh .neg { color: #ffb3b3; }
@media (max-width: 600px) {
  .shade-body .count-panel { order: 3; } .shade-body .scoreboard-wrap { order: 4; } .shade-body details.about { order: 5; } .shade-body .rules-panel { order: 6; }
  .count-now { grid-template-columns: 1fr 1fr; }
}

.menu-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

.ev-box .rows.riskcols .row { grid-template-columns: 1fr auto auto auto auto; gap: 10px; font-variant-numeric: tabular-nums; }
.ev-box .rows.riskcols .row span:nth-child(n+3) { font-size: .72rem; color: rgba(255,255,255,.75); text-align: right; min-width: 30px; }
.ev-box .rows.riskcols .row.best span:nth-child(n+3) { color: rgba(255,224,138,.9); }
.ev-box .rows.riskcols .row.head { padding: 0 6px 2px; margin-bottom: 2px; border-bottom: 1px solid rgba(255,255,255,.14); background: transparent; }
.ev-box .rows.riskcols .row.head span { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); font-weight: 500; }
.ev-box .rows.riskcols .row .dim { color: rgba(255,255,255,.45); }
.ev-box.wide { min-width: 300px; }
.ev-box .rows.riskcols i { font-style: normal; margin-left: 1px; }
@media (max-width: 600px) { .ev-box .rows.riskcols .row { gap: 5px; } .ev-box .rows.riskcols .row span:nth-child(n+3) { font-size: .62rem; min-width: 24px; } }

.dev-brief { margin-top: 8px; display: grid; gap: 4px; font-size: .85rem; }
.dev-brief .pos { color: var(--felt); font-weight: 600; }
.dev-all { margin-top: 8px; }
.dev-all summary { cursor: pointer; }
.dev-all[open] summary { margin-bottom: 6px; }

/* Flash cards */
.flash-box { grid-area: hbox; justify-self: stretch; }
.felt.flash .hand .cards, .felt.flash .seat.dealer .cards { flex-wrap: nowrap; }
.felt.flash { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 20px; }
.felt.flash .felt-top { grid-column: 1; grid-row: 1; }
.felt.flash .banner { grid-column: 1; grid-row: 2; }
.felt.flash .felt-mid { grid-column: 1; grid-row: 3; display: block; }
.felt.flash .flash-box { grid-column: 2; grid-row: 1 / span 3; align-self: start; justify-self: start; width: 100%; max-width: 560px; }
.felt.flash .ev-box, .felt.flash .dealer-box, .felt.flash .count-badge, .felt.flash .shoe-strip { display: none !important; }
.felt.flash { min-height: 0; }
.flash-score { display: flex; gap: 14px; font-size: .8rem; color: rgba(255,255,255,.75); margin-bottom: 6px; }
.flash-score span:first-child { color: #fff; font-weight: 600; }
.flash-tc { font-size: .95rem; margin-bottom: 6px; }
.flash-tc strong { font-family: "Fraunces", Georgia, serif; font-size: 1.4rem; color: #ffe08a; margin-left: 4px; }
.flash-q { font-size: 1rem; color: #fff; }
.flash-v { font-size: 1.05rem; font-weight: 600; }
.flash-v.good { color: #9fe3bd; } .flash-v.bad { color: #ffb3b3; }
.flash-why { margin-top: 4px; font-size: .82rem; color: rgba(255,255,255,.85); }
.flash-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.flash-filter { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; overflow: hidden; }
.flash-filter button { border: 0; background: transparent; color: rgba(255,255,255,.8); padding: 6px 10px; font-size: .85rem; }
.flash-filter button + button { border-left: 1px solid rgba(255,255,255,.2); }
.flash-filter button[aria-selected="true"] { background: #ffe08a; color: #1a231e; font-weight: 600; }
.toggle.light { color: rgba(255,255,255,.85); display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; }
.toggle.light input { accent-color: #ffe08a; }
.flash-bar .ghost { margin-left: auto; }
.flash-bar .ghost + .ghost { margin-left: 0; }
@media (max-width: 600px) {
  .felt.flash { grid-template-areas: "dealer player" "banner banner" "fb fb" "hbox hbox" "count count" "shoe shoe"; }
  .flash-filter button { padding: 6px 7px; font-size: .78rem; }
  .flash-bar { gap: 6px 8px; }
}


.flash-opts { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.14); }
.flash-box .row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 2px 6px; border-radius: 5px; margin: 0 -6px; font-size: .78rem; }
.flash-box .rows.riskcols .row { grid-template-columns: 1fr auto auto auto auto; }
.flash-box .row.best { background: rgba(255,224,138,.22); color: #ffe08a; font-weight: 600; }
.flash-box .row.chosen { outline: 1px dashed rgba(255,179,179,.8); }
.flash-box .row .v.pos { color: #9fe3bd; } .flash-box .row.best .v { color: #ffe08a; }
.flash-box .rows.riskcols .row span:nth-child(n+3) { font-size: .7rem; color: rgba(255,255,255,.75); text-align: right; min-width: 28px; }
.flash-box .rows.riskcols .row.head { padding: 0 6px 2px; margin-bottom: 2px; border-bottom: 1px solid rgba(255,255,255,.14); background: transparent; }
.flash-box .rows.riskcols .row.head span { font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); font-weight: 500; }
.flash-why { line-height: 1.4; }

.flash-select { border: 1px solid rgba(255,255,255,.3); background: #1c3a2c; color: #fff; border-radius: 8px; padding: 5px 8px; font-size: .85rem; max-width: 240px; }
.flash-select option { color: #1a231e; background: #fff; }
.flash-next { margin-top: 6px; font-size: .75rem; }

.flash-v.close { color: #ffe08a; }


.flash-why .pat { color: #ffe08a; }
.flash-why { line-height: 1.45; }

@media (max-width: 600px) { .felt.flash { grid-template-columns: 1fr 1fr; grid-template-rows: auto; column-gap: 10px; } .felt.flash .felt-top, .felt.flash .banner, .felt.flash .felt-mid { grid-column: auto; grid-row: auto; display: contents; } .felt.flash .flash-box { grid-area: hbox; grid-column: auto; grid-row: auto; max-width: none; } }


/* Mode switch on the control bar */
.mode-bar { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.mode-bar button { border: 0; background: transparent; color: rgba(255,255,255,.85); padding: 7px 12px; font-size: .88rem; font-weight: 500; }
.mode-bar button + button { border-left: 1px solid rgba(255,255,255,.2); }
.mode-bar button[aria-selected="true"] { background: #ffe08a; color: #1a231e; font-weight: 600; }
.mode-bar button:disabled { opacity: .45; cursor: default; }
@media (max-width: 600px) { .mode-bar { width: 100%; } .mode-bar button { flex: 1; padding: 8px 4px; font-size: .8rem; } }

/* Play menu in the header */
.play-menu { position: relative; }
.play-tab { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 500; }
.play-tab svg { transition: transform .15s; }
.play-tab[aria-expanded="true"] svg { transform: rotate(180deg); }
.play-body { left: 0; right: auto; top: 44px; min-width: 260px; padding: 6px; gap: 2px; }
.mode-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); padding: 8px 10px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; }
.mode-item:hover { background: var(--chip); }
.mode-item[aria-selected="true"] { background: var(--felt); color: #fff; }
.mode-item[aria-selected="true"] .menu-hint { color: rgba(255,255,255,.8); }
.mode-item:disabled { opacity: .45; cursor: default; }
.menu-hint { font-size: .74rem; color: var(--muted); font-weight: 400; }
@media (max-width: 600px) { .play-body { position: fixed; left: 12px; right: 12px; top: 56px; } }
.tabs { overflow: visible; }
.tabs > :first-child, .tabs > :first-child .play-tab { border-radius: 7px 0 0 7px; }
.tabs > :last-child { border-radius: 0 7px 7px 0; }





/* Account */
.acct-btn { width: auto; padding: 0 10px; gap: 6px; grid-template-columns: auto auto; }
.acct-nick { font-size: .85rem; font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-nick:empty { display: none; }
.acct-body { min-width: 260px; }
.acct-body input[type=text], .acct-body input[type=password] { border: 1px solid var(--line-strong); background: var(--chip); border-radius: 6px; padding: 7px 9px; font-size: .9rem; width: 100%; }
.acct-actions { display: flex; gap: 8px; }
.acct-actions .primary.small { border: 0; background: var(--felt); color: #fff; border-radius: 6px; padding: 6px 12px; font-size: .85rem; }
.acct-err { color: var(--loss); min-height: 1.2em; }
.acct-name { font-family: "Fraunces", Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.acct-body label { display: flex; gap: 8px; align-items: center; font-size: .88rem; }
.acct-body input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--felt); margin: 0; }
.board-panel details summary { cursor: pointer; }
table.board { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
table.board th { font-weight: 500; color: var(--muted); text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line-strong); }
table.board th:first-child, table.board th:nth-child(2), table.board td:first-child, table.board td:nth-child(2) { text-align: left; }
table.board td { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--line); }
table.board tr.me td { background: var(--felt-tint); font-weight: 600; }
@media (max-width: 600px) { .shade-body .board-panel { order: 3; } .acct-body { position: fixed; left: 12px; right: 12px; top: 56px; } }


.count-panel.collapsed .count-now, .count-panel.collapsed .dev-brief, .count-panel.collapsed .dev-all { display: none; }
.count-panel.collapsed .collapse-btn svg { transform: rotate(-90deg); }
.count-panel h2 .muted { font-family: "IBM Plex Sans", sans-serif; font-weight: 400; margin-left: 6px; }

/* popovers must scroll on small screens */
.menu-body { max-height: calc(100vh - 70px); overflow: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 600px) { .menu-body { top: 56px !important; bottom: auto; max-height: calc(100vh - 260px); } }

table.progress { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
table.progress th { font-weight: 500; color: var(--muted); text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line-strong); }
table.progress th:first-child, table.progress td:first-child, table.progress td:last-child { text-align: left; }
table.progress td { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .shade-body .progress-panel { order: 4; } table.progress th:last-child, table.progress td:last-child { display: none; } }

.passkey-row { margin-top: 2px; }
.btnlike { display: inline-block; text-decoration: none; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: .85rem; color: var(--muted); }
.menu-body label.gated { opacity: .55; }
.gate-note { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px 10px; }

/* layout customizing */
.drag-handle { display: none; }
body.customizing .drag-handle { display: block; cursor: grab; text-align: center; font-size: .75rem; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 3px; margin-bottom: 8px; user-select: none; }
body.customizing [data-dnd] { outline: 1px dashed var(--line-strong); outline-offset: 4px; }
body.customizing [data-dnd].dragging { opacity: .5; }
@media (max-width: 600px) { .drag-handle { display: none !important; } }

/* account menu, signed in */
.acct-body { min-width: 280px; }
.acct-name { font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; font-weight: 600; padding: 2px 4px 6px; }
.menu-list { display: grid; gap: 2px; margin: 0 -4px 6px; }
.menu-list .mode-item { text-decoration: none; }
.acct-opt { padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
#acctSync { padding: 0 4px; }

.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .03em; padding: 1px 7px; border-radius: 10px; margin-right: 4px; vertical-align: 1px; }
.tag.excite { background: rgba(232,194,90,.25); color: var(--act-double); }
.tag.safe { background: var(--felt-tint); color: var(--felt); }
.flash-box .tag.excite { background: rgba(255,224,138,.25); color: #ffe08a; } .flash-box .tag.safe { background: rgba(159,227,189,.25); color: #9fe3bd; }

.layout-bar { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px; margin: 0 0 10px; background: #ffe08a; color: #1a231e; border-radius: 10px; font-size: .9rem; font-weight: 500; }
.layout-bar .lb-actions { display: flex; gap: 8px; }
.layout-bar .primary.small { border: 0; background: #1a231e; color: #fff; border-radius: 6px; padding: 5px 12px; font: inherit; }
.layout-bar .ghost.small { border: 1px solid rgba(26,35,30,.4); color: #1a231e; background: transparent; }

.update-bar { position: sticky; top: 0; z-index: 80; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px; margin: 0 0 10px; background: var(--felt); color: #fff; border-radius: 10px; font-size: .9rem; }
.update-bar .primary.small { border: 0; background: #ffe08a; color: #1a231e; border-radius: 6px; padding: 5px 12px; font: inherit; font-weight: 600; }
@media (max-width: 600px) { .tabs { overflow: hidden; overflow-x: auto; } }

/* things that only make sense with a keyboard or a wide screen */
@media (max-width: 600px), (hover: none) and (pointer: coarse) { kbd { display: none !important; } }
@media (max-width: 600px) { .desktop-only { display: none !important; } }

/* the Play tab lives in a wrapper; stretch both so it matches the other tabs' height */
.tabs .play-menu { display: flex; align-self: stretch; }
.tabs .play-tab { align-self: stretch; height: auto; }

/* Count drill */
.count-box { grid-area: auto; z-index: 5; }
.felt.counting { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 20px; }
.felt.counting .felt-top { grid-column: 1; grid-row: 1; }
.felt.counting .count-box { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; width: 100%; max-width: 420px; min-height: 96px; }
.felt.counting .banner { grid-column: 1 / -1; grid-row: 2; }
.felt.counting .felt-mid { grid-column: 1 / -1; grid-row: 3; display: block; }
.felt.counting .seats { width: 100%; flex-wrap: wrap; }
.felt.counting .shoe-strip, .felt.counting .count-badge, .felt.counting .ev-box, .felt.counting .dealer-box { display: none !important; }
.felt.counting .seat.player { width: 100%; }
.cq { display: grid; gap: 10px; text-align: center; }
.cq-title { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; color: #fff; }
.cq-title.small { font-size: .95rem; }
.cq-row { display: flex; justify-content: center; align-items: center; gap: 8px; }
.cq-row input { width: 90px; text-align: center; font-size: 1.4rem; font-family: "Fraunces", Georgia, serif; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.25); color: #fff; padding: 6px; }
.cq-row .ghost { width: 44px; height: 44px; font-size: 1.3rem; padding: 0; }
.cq-actions { display: flex; justify-content: center; gap: 8px; }
.cq-v { font-size: 1.05rem; font-weight: 600; }
.cq-v.good { color: #9fe3bd; } .cq-v.bad { color: #ffb3b3; } .cq-v.small { font-size: .9rem; }
.hilo-how p { margin: 6px 0; line-height: 1.45; }
#countBar select { border: 1px solid rgba(255,255,255,.3); background: #1c3a2c; color: #fff; border-radius: 6px; padding: 4px 6px; font: inherit; }
#countBar select option { color: #1a231e; background: #fff; }

#countSys { max-width: 160px; }

/* What the numbers mean: grouped sections */
.about-body details.ab { border-top: 1px solid var(--line); padding: 6px 0; }
.about-body details.ab:first-child { border-top: 0; }
.about-body details.ab > summary { cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.about-body details.ab > summary::-webkit-details-marker { display: none; }
.about-body details.ab > summary::before { content: "\25B8"; color: var(--muted); font-size: .8rem; }
.about-body details.ab[open] > summary::before { content: "\25BE"; }
.about-body details.ab > p { margin: 6px 0 6px 18px; }
.about-body details.ab > summary::after { content: none; }

.act-pill { display: inline-block; background: #ffe08a; color: #1a231e; font-size: .66rem; font-weight: 700; letter-spacing: .04em; padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: 1px; }
.act-pill.pop { animation: pillin .25s ease-out; }
@keyframes pillin { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* compact chip stacks on other seats */
.chip-stack.mini { gap: 0; margin: 0 4px 0 2px; }
.chip-stack.mini .chip { width: 16px; height: 16px; border-width: 2px; font-size: .48rem; }
.chip-stack.mini .chip + .chip { margin-left: -7px; }
.bot-hand .hand-meta { align-items: center; }

@media (max-width: 600px) {
  /* phone drill: dealer's cards left, the question in the empty space to the right; the slot stays reserved between questions */
  .felt.counting { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: auto auto auto; column-gap: 8px; }
  .felt.counting .felt-top { display: block; grid-column: 1; grid-row: 1; min-height: 150px; }
  .felt.counting .seat.dealer .cards { flex-wrap: nowrap; gap: 0; min-height: 66px; }
  .felt.counting .seat.dealer .pcard { width: 46px; height: 64px; box-shadow: -2px 0 3px rgba(0,0,0,.25); }
  .felt.counting .seat.dealer .pcard + .pcard { margin-left: -18px; }
  .felt.counting .seat.dealer .pcard .r { font-size: .95rem; top: 3px; left: 4px; }
  .felt.counting .seat.dealer .pcard .s { font-size: 1.1rem; bottom: 2px; right: 4px; }
  .felt.counting .count-box { grid-column: 2; grid-row: 1; max-width: none; min-height: 150px; align-self: start; padding: 8px; }
  .felt.counting .count-box.hidden { display: block !important; visibility: hidden; }
  .felt.counting .banner { grid-column: 1 / -1; grid-row: 2; }
  .felt.counting .felt-mid { grid-column: 1 / -1; grid-row: 3; }
  .felt.counting .cq { gap: 6px; }
  .felt.counting .cq-title { font-size: 1rem; }
  .felt.counting .cq-v { font-size: .92rem; }
  .felt.counting .cq-v.small { font-size: .8rem; }
  .felt.counting .cq .muted.small { font-size: .72rem; }
  .felt.counting .cq-actions .primary, .felt.counting .cq-actions .ghost { padding: 6px 10px; font-size: .85rem; }
  .felt.counting .cq-row input { width: 72px; font-size: 1.2rem; }
  .felt.counting .cq-row .ghost { width: 38px; height: 38px; }
  /* seats on a fixed grid so players keep their places all shoe */
  .felt.counting .seats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .felt.counting .seats.many { grid-template-columns: 1fr 1fr 1fr; }
  .felt.counting .seat-block { min-height: 108px; }
  .felt.counting .seat-block .seat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* card designs */
body.deck-fourcolor .pcard[data-suit="\2666"] { color: #2f63b3; }
body.deck-fourcolor .pcard[data-suit="\2663"] { color: #2b8a4f; }
body.deck-large .pcard .r { font-size: 1.5rem; top: 4px; left: 6px; font-weight: 700; }
body.deck-large .pcard .s { font-size: 1.2rem; bottom: 4px; right: 6px; }
body.deck-minimal .pcard { border-radius: 6px; box-shadow: none; border: 1px solid rgba(0,0,0,.15); font-family: "IBM Plex Sans", sans-serif; }
body.deck-minimal .pcard .r { font-weight: 600; font-size: 1.05rem; }
body.deck-minimal .pcard .s { font-size: 1.1rem; opacity: .85; }
body.back-blue .pcard.back { background: repeating-linear-gradient(45deg, #24407a 0 6px, #2f57a8 6px 12px); }
body.back-black .pcard.back { background: repeating-linear-gradient(45deg, #1b1b1b 0 6px, #333 6px 12px); }

.google-row { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.about-item { text-decoration: none; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }

.nudge { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 14px; border: 1px dashed var(--felt); border-radius: 10px; background: var(--felt-tint); font-size: .9rem; }
.nudge-actions { display: flex; gap: 8px; }
.nudge .primary.small { border: 0; background: var(--felt); color: #fff; border-radius: 6px; padding: 6px 12px; font: inherit; font-weight: 600; }
.flash-ins { display: flex; gap: 10px; margin-top: 8px; }
.flash-ins .primary { border: 0; background: #ffe08a; color: #1a231e; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; }
.flash-ins .ghost { padding: 8px 16px; }

.menu-body .gated, .menu-body .gated select { opacity: .35; }
.menu-body button.gated { opacity: .35; cursor: default; }

.bank-inline { margin-left: 10px; font-weight: 400; }
.bank-inline b { font-family: "Fraunces", Georgia, serif; font-size: 1.05rem; color: #fff; font-weight: 600; }
.deal:disabled { opacity: .45; }

.deal.noseat { opacity: .45; }
#seatNote { flex-basis: 100%; margin-top: 6px; }

table.money td.pos { color: var(--felt); font-weight: 600; } table.money td.neg { color: var(--loss); font-weight: 600; }
.money-wrap { margin: 6px 0 10px; }
@media (max-width: 600px) { table.money th:nth-child(6), table.money td:nth-child(6), table.money th:nth-child(7), table.money td:nth-child(7), table.money th:nth-child(8), table.money td:nth-child(8) { display: none; } }
table.money th:last-child, table.money td:last-child { text-align: right; }

.banner .refill, .bet-amount .refill { border: 0; background: #ffe08a; color: #1a231e; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .9rem; font-weight: 600; margin-left: 8px; vertical-align: middle; cursor: pointer; }
.banner .refill { display: block; margin: 10px auto 0; }

/* hand-count switch and the Deal button */
.hands-sel { display: inline-flex; align-items: center; gap: 0; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; overflow: hidden; }
.hands-sel .deal-lbl { color: rgba(255,255,255,.8); font-weight: 500; font-size: .85rem; padding: 0 7px; }
.hands-sel button { border: 0; border-left: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.2); color: #fff; padding: 8px 11px; font: inherit; font-weight: 600; cursor: pointer; min-width: 36px; }
.hands-sel button[aria-pressed="true"] { background: #ffe08a; color: #1a231e; }
.hands-sel button.unavailable { color: rgba(255,255,255,.45); background: repeating-linear-gradient(135deg, rgba(0,0,0,.28) 0 4px, rgba(0,0,0,.08) 4px 8px); cursor: not-allowed; }
.hands-sel button.unavailable[aria-pressed="true"] { color: #1a231e; background: repeating-linear-gradient(135deg, #d9be6f 0 4px, #ffe08a 4px 8px); }
.deal-btn { padding: 8px 18px !important; }
.deal-btn:disabled { opacity: .45; }
@media (max-width: 600px) { .hands-sel button { padding: 9px 12px; } .deal-btn { flex: 1; } }

.next-box .tap-hint { margin-left: auto; }
@media (min-width: 601px) { .next-box .tap-hint { display: none; } }
@media (max-width: 600px) { .next-box { justify-content: flex-end; } .next-box #roundResult { flex-basis: 100%; } .next-box .primary.big { min-width: 44%; } .next-box .tap-hint { order: 3; flex-basis: 100%; text-align: center; margin: 2px 0 0; } }
@media (max-width: 600px) { .felt .ev-box, .felt .dealer-box { justify-self: stretch; width: auto; max-width: none; } }

/* moneyline */
.moneyline-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 4px; }
.moneyline-wrap { position: relative; }
.moneyline { width: 100%; display: block; background: var(--chip); border-radius: 8px; touch-action: pan-y; }
.ml-grid { stroke: var(--line); stroke-width: 1; }
.ml-lbl { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.ml-start { stroke: var(--line-strong); stroke-dasharray: 4 4; stroke-width: 1; }
.ml-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.ml-area.up { fill: var(--felt); opacity: .18; } .ml-area.down { fill: var(--loss); opacity: .18; }
.ml-peak { fill: var(--felt); } .ml-low { fill: var(--loss); }
.ml-cursor { stroke: var(--ink); stroke-width: 1; opacity: .5; }
.ml-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.ml-tip { position: absolute; top: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 8px; font-size: .78rem; white-space: nowrap; pointer-events: none; }
.ml-note { margin-top: 4px; }
@media (max-width: 600px) { .flash-bar #flashNextBtn { display: none; } .next-box .primary.big { min-width: 0; } }