/* Blackjack: table, chips, cards, dock, study panels and reading-page widgets.
   Loaded after style.css on the /blackjack/ pages. */

/* ---------- intro ---------- */

.intro {
  padding: 18px 0 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4px 28px;
}

.intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.2;
  color: var(--ivory);
}

.intro-lead {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- game bar ---------- */

.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 24px;
  margin-bottom: 12px;
}

.bank {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.bank-label {
  font-size: 13px;
  color: var(--muted);
}

.bank-value {
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
}

.text-btn {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:hover:not(:disabled) {
  color: var(--brass-hi);
}

.text-btn[data-armed="1"] {
  color: var(--warn);
}

.text-btn:disabled {
  opacity: 0.4;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
}

.set {
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-label {
  font-size: 12px;
  color: var(--muted);
}

.seg,
.stepper {
  display: inline-flex;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
}

.seg button,
.stepper button {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: none;
  font-size: 13px;
}

.seg button + button {
  border-left: 1px solid rgba(212, 175, 106, 0.25);
}

.seg button[aria-pressed="true"] {
  background: var(--brass);
  color: var(--room-deep);
  font-weight: 700;
}

.stepper output {
  min-width: 28px;
  display: grid;
  place-items: center;
  font-weight: 700;
  border-left: 1px solid rgba(212, 175, 106, 0.25);
  border-right: 1px solid rgba(212, 175, 106, 0.25);
}

.stepper button:disabled,
.seg button:disabled {
  opacity: 0.45;
}

.select {
  height: 30px;
  padding: 0 26px 0 10px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23D4AF6A'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13px;
}

.select option {
  background: var(--room-deep);
}

.select:disabled {
  opacity: 0.45;
}

/* ---------- table ---------- */

.table-wrap {
  position: relative;
  width: 100%;
  max-width: max(940px, calc((100vh - 430px) * 2.15 + 32px));
  margin: 0 auto;
}

.table-rim {
  position: relative;
  width: 100%;
  padding: 16px;
  border-radius: 34px 34px 50% 50% / 34px 34px 78% 78%;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 40%),
    linear-gradient(180deg, #3a2219, #1c0e09 60%, #0d0604);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6);
}

.table-rim::before {
  /* thin brass edge between rail and felt */
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 30px 30px 50% 50% / 30px 30px 78% 78%;
  border: 1px solid rgba(212, 175, 106, 0.45);
  pointer-events: none;
}

.felt {
  position: relative;
  aspect-ratio: 2.15 / 1;
  border-radius: 22px 22px 50% 50% / 22px 22px 76% 76%;
  overflow: hidden;
  background-color: var(--felt);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
    radial-gradient(90% 70% at 50% 28%, var(--felt-hi), var(--felt) 55%, var(--felt-deep));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 18px 40px -10px rgba(0, 0, 0, 0.55), inset 0 -30px 60px -20px rgba(0, 0, 0, 0.6);
}

.felt-print {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.felt-print text {
  font-family: "Bodoni Moda", serif;
}

.fp-bj {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 5px;
  fill: rgba(241, 217, 154, 0.78);
}

.fp-rule {
  font-size: 14px;
  font-style: italic;
  letter-spacing: 1.4px;
  fill: rgba(244, 235, 214, 0.55);
}

.fp-ins {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 7px;
  fill: rgba(241, 217, 154, 0.62);
}

.fp-band {
  fill: none;
  stroke: rgba(212, 175, 106, 0.45);
  stroke-width: 1.4;
}

.fp-mini {
  display: none;
}

/* shoe & discard */

.shoe,
.discard {
  position: absolute;
  top: 5%;
  z-index: 2;
}

.shoe {
  right: 5%;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.shoe-box {
  position: relative;
  height: 56px;
  border-radius: 6px 10px 6px 6px;
  background: linear-gradient(160deg, #3d2a22, #160c08 70%);
  clip-path: polygon(0 18%, 70% 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.35);
}

.shoe-card {
  position: absolute;
  left: 8px;
  top: 18px;
  width: 54px;
  height: 30px;
  border-radius: 3px;
  background: var(--room-2);
  background-image: repeating-linear-gradient(45deg, rgba(212, 175, 106, 0.35) 0 1px, transparent 1px 5px);
  box-shadow: 0 0 0 2px var(--ivory) inset;
  transform: skewX(-12deg);
}

.shoe.shuffling .shoe-box {
  animation: shuffle 0.25s ease-in-out 6 alternate;
}

@keyframes shuffle {
  from { transform: translateX(-3px) rotate(-2deg); }
  to { transform: translateX(3px) rotate(2deg); }
}

.shoe-meter {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.shoe-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--left, 1) * 100%);
  background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi));
  transition: width 0.3s;
}

.shoe-cut {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: calc(var(--cut, 0.4) * 100%);
  width: 3px;
  background: #e23a4c;
}

.shoe.cut-out .shoe-cut {
  box-shadow: 0 0 6px 2px rgba(255, 90, 100, 0.8);
}

.shoe-left {
  font-size: 11px;
  color: var(--ink);
  text-align: right;
  line-height: 1.2;
}

.discard {
  left: 5%;
  width: 70px;
}

.tray {
  position: relative;
  display: block;
  height: 64px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: rgba(0, 0, 0, 0.18);
}

.tray-fill {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: calc(var(--fill, 0) * 56px);
  min-height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(0deg, var(--ivory) 0 1px, #cfc4ae 1px 2px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: height 0.4s;
}

/* dealer */

.dealer-zone {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.dealer-label {
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.08em;
}

.dealer-hand {
  --ox: calc(var(--cw) * 0.72);
  --oy: 0px;
  min-height: var(--ch);
  min-width: var(--cw);
}

.dealer-hand .hand-total {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}

.felt-msg {
  position: absolute;
  top: calc(4% + var(--ch) + 46px);
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  max-width: min(78%, 560px);
  margin: 0;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(6, 26, 23, 0.72);
  border: 1px solid rgba(212, 175, 106, 0.35);
  color: var(--ivory);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.felt-msg:empty {
  display: none;
}

.felt-msg[data-tone="good"] {
  color: var(--good);
  border-color: rgba(127, 211, 168, 0.5);
}

.felt-msg[data-tone="bad"] {
  color: var(--bad);
  border-color: rgba(255, 138, 143, 0.5);
}

.felt-msg[data-tone="warn"] {
  color: var(--warn);
  border-color: rgba(255, 210, 122, 0.55);
}

.felt-msg.pop {
  animation: pop 0.25s ease-out;
}

@keyframes pop {
  from { opacity: 0.4; transform: translate(-50%, -50%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* seats */

.seat {
  position: absolute;
  z-index: 2;
  width: 150px;
  margin-left: -75px;
  margin-top: calc(var(--spot) / -2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seat[data-seat="1"] { left: 86.5%; top: 55%; }

.seat[data-seat="2"] { left: 73%; top: 70%; }

.seat[data-seat="3"] { left: 57.5%; top: 78.5%; }

.seat[data-seat="4"] { left: 42.5%; top: 78.5%; }

.seat[data-seat="5"] { left: 27%; top: 70%; }

.seat[data-seat="6"] { left: 13.5%; top: 55%; }

.seat-hands {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  --k: 1;
}

.seat-hands[data-count="2"] { --k: 0.78; }

.seat-hands[data-count="3"],
.seat-hands[data-count="4"] { --k: 0.62; gap: 4px; }

.seat-hands .hand {
  --cw: calc(62px * var(--k));
  --ch: calc(87px * var(--k));
}

.seat-chips {
  position: relative;
}

.spot {
  position: relative;
  width: var(--spot);
  height: var(--spot);
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--ink-soft);
  background: rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  cursor: default;
}

.spot-no {
  font-family: "Bodoni Moda", serif;
  font-size: 18px;
  color: var(--ink-soft);
}

.seat.has-bet .spot-no {
  display: none;
}

.seat[data-kind="player"] .spot {
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(212, 175, 106, 0.14);
}

.seat[data-kind="vacant"] .spot {
  border-style: dashed;
}

.can-sit .seat[data-kind="vacant"] .spot {
  cursor: pointer;
}

.can-sit .seat[data-kind="vacant"] .spot:hover {
  border-color: var(--brass-hi);
  background: rgba(212, 175, 106, 0.12);
}

.spot-bet {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.stack {
  position: relative;
  width: 34px;
  height: calc(18px + var(--h, 1) * 4px);
  margin-top: -6px;
}

.disc {
  position: absolute;
  left: 0;
  bottom: calc(var(--k) * 4px);
  width: 34px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, var(--chip) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--chip) 0 30deg, #f4ebd6 30deg 45deg);
  box-shadow: 0 2px 0 var(--chip-side), 0 3px 3px rgba(0, 0, 0, 0.5);
}

.amt {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--brass-hi);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.ins-chip {
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(212, 175, 106, 0.88);
  color: var(--room-deep);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.plate {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  padding: 2px 10px 2px 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  max-width: 100%;
}

.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--av, transparent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.seat[data-kind="player"] .plate {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: var(--room-deep);
  font-weight: 700;
}

.seat[data-kind="player"] .avatar {
  background: var(--room-deep);
  -webkit-mask: none;
}

.seat[data-kind="player"] .avatar::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brass-hi);
}

.seat[data-kind="vacant"] .plate {
  background: none;
  color: var(--ink-soft);
  padding-left: 10px;
}

.seat[data-kind="vacant"] .avatar {
  display: none;
}

.seat.is-active .spot {
  border-color: var(--brass-hi);
  box-shadow: 0 0 0 4px rgba(241, 217, 154, 0.25), 0 0 22px rgba(241, 217, 154, 0.45);
}

.seat.is-active .plate {
  outline: 1px solid var(--brass-hi);
}

/* hands & cards */

.hand {
  position: relative;
}

.hand .cards {
  position: relative;
  width: calc(var(--cw) + (var(--n, 1) - 1) * var(--ox));
  height: calc(var(--ch) + (var(--n, 1) - 1) * var(--oy));
  min-width: var(--cw);
  min-height: var(--ch);
}

.card {
  position: absolute;
  left: calc(var(--i, 0) * var(--ox));
  bottom: calc(var(--i, 0) * var(--oy));
  width: var(--cw);
  height: var(--ch);
  perspective: 700px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.38s cubic-bezier(0.3, 0.7, 0.3, 1);
}

.card.down .card-inner {
  transform: rotateY(180deg);
}

.card.peeking .card-inner {
  transform: rotateY(180deg) rotateX(-18deg) translateY(-4px);
  transition-duration: 0.25s;
}

.face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * 0.09);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.front {
  background: linear-gradient(160deg, #fffdf8, var(--card-face) 60%, #efe8d8);
  color: var(--card-black);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(0, 0, 0, 0.18), -2px 3px 6px rgba(0, 0, 0, 0.35);
}

.card.red .front {
  color: var(--card-red);
}

.back {
  transform: rotateY(180deg);
  background-color: var(--room-2);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23D4AF6A' stroke-opacity='.55' stroke-width='3'%3E%3Cpath d='M0 14h14V0M42 0v14h14M0 42h14v14M42 56V42h14M14 14h28v28H14z'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 calc(var(--cw) * 0.06) var(--ivory), inset 0 0 0 calc(var(--cw) * 0.075) var(--brass-lo), 0 0 0 1px rgba(0, 0, 0, 0.3), -2px 3px 6px rgba(0, 0, 0, 0.35);
}

.idx {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
}

.idx b {
  font-size: calc(var(--cw) * 0.29);
}

.card[data-rank="10"] .idx b {
  letter-spacing: -0.09em;
  margin-left: -0.09em;
}

.idx i {
  font-style: normal;
  font-family: system-ui, sans-serif;
  font-size: calc(var(--cw) * 0.21);
}

.idx.tl {
  top: 5%;
  left: 6%;
}

.idx.br {
  bottom: 5%;
  right: 6%;
  transform: rotate(180deg);
}

.pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 8%;
  font-family: system-ui, sans-serif;
  font-size: calc(var(--cw) * 0.5);
  line-height: 1;
}

.pip.ace {
  font-size: calc(var(--cw) * 0.68);
}

.court {
  position: absolute;
  inset: 20% 19% 20% 21%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, rgba(212, 175, 106, 0.25) 0 2px, rgba(212, 175, 106, 0.08) 2px 5px);
  line-height: 1;
}

.court b {
  font-family: "Bodoni Moda", serif;
  font-style: italic;
  font-weight: 700;
  font-size: calc(var(--cw) * 0.4);
}

.court i {
  font-style: normal;
  font-family: system-ui, sans-serif;
  font-size: calc(var(--cw) * 0.2);
}

.hand-total {
  position: absolute;
  left: -10px;
  top: -12px;
  z-index: 5;
  min-width: 26px;
  padding: 0 7px;
  border-radius: 10px;
  background: rgba(10, 6, 4, 0.82);
  border: 1px solid rgba(212, 175, 106, 0.5);
  color: var(--ivory);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hand-total[data-tone="bj"] {
  background: var(--brass);
  color: var(--room-deep);
}

.hand-total[data-tone="bust"] {
  border-color: var(--bad);
  color: var(--bad);
}

.hand-bet {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--brass-hi);
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
}

.hand-result {
  position: absolute;
  left: 50%;
  top: 45%;
  z-index: 6;
  transform: translate(-50%, -50%) rotate(-6deg);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Bodoni Moda", serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: var(--ivory);
  color: var(--room-deep);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.hand-result[data-result="win"],
.hand-result[data-result="even"] {
  background: #1f7a5a;
  color: #fff;
}

.hand-result[data-result="bj"] {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: var(--room-deep);
}

.hand-result[data-result="lose"],
.hand-result[data-result="bust"] {
  background: #7d1c2b;
  color: #ffe9ea;
}

.hand-result[data-result="surrender"] {
  background: #4b4643;
  color: #f1ece5;
}

.hand.is-bust .cards,
.hand.is-surrender .cards {
  opacity: 0.55;
}

.hand.is-active .card .face {
  box-shadow: 0 0 0 2px var(--brass-hi), 0 0 16px rgba(241, 217, 154, 0.6);
}

/* ---------- dock ---------- */

.dock {
  position: relative;
  z-index: 6;
  margin-top: 14px;
  padding: 10px 16px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 14, 10, 0.94), rgba(14, 6, 5, 0.96));
  border: 1px solid rgba(212, 175, 106, 0.4);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  display: grid;
  grid-template-areas: "head" "group";
  gap: 8px;
}

.dock-head {
  grid-area: head;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 175, 106, 0.18);
}

.dock .bank {
  grid-column: 1;
  justify-self: start;
}

.dock .bank-value {
  font-size: 24px;
}

.advice {
  grid-column: 2;
  margin: 0;
  min-height: 1.5em;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.advice[data-tone="good"] {
  color: var(--good);
}

.advice[data-tone="bad"] {
  color: var(--bad);
}

.dock-group {
  grid-area: group;
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 60px;
}

.dock[data-phase="betting"] .dock-bet,
.dock[data-phase="insurance"] .dock-ins,
.dock[data-phase="playing"] .dock-play,
.dock[data-phase="dealing"] .dock-play {
  display: flex;
}

.dock-bet {
  justify-content: center;
  gap: 14px;
}

.dock .btn-sitout {
  margin-left: 36px;
  min-width: 96px;
  border-color: #c85566;
  background: linear-gradient(180deg, #b23a4d, #74202d);
  color: #fff;
  box-shadow: 0 3px 0 #4a1219;
}

.chips {
  display: flex;
  gap: 8px;
}

.chip {
  --chip: #2463b4;
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--chip) 0 54%, transparent 55%),
    repeating-conic-gradient(var(--chip) 0 30deg, #f4ebd6 30deg 45deg);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 6px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s;
}

.chip span {
  position: absolute;
  inset: 22%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.6);
  font-family: "Bodoni Moda", serif;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.chip:hover:not(:disabled) {
  transform: translateY(-3px);
}

.chip:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
}

.chip:disabled {
  opacity: 0.35;
  filter: saturate(0.4);
}

.c10 { --chip: #2463b4; --chip-side: #173f73; }

.c25 { --chip: #2e8b57; --chip-side: #1b5636; }

.c100 { --chip: #2a2a2e; --chip-side: #0c0c0e; }

.c500 { --chip: #6b3fa0; --chip-side: #3f235f; }

.c1000 { --chip: #d98f20; --chip-side: #8a5a12; }

.c1000 span,
.c100 span {
  color: #fff;
}

.bet-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  min-width: 84px;
}

.bet-label {
  font-size: 11px;
  color: var(--muted);
}

.bet-box strong {
  font-family: "Bodoni Moda", serif;
  font-size: 24px;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
}

.bet-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-rebuy {
  flex-basis: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.dock-play .btn,
.dock-ins .btn {
  min-width: 112px;
  min-height: 52px;
  font-size: 15px;
  color: #fff;
}

.act-hit { background: linear-gradient(180deg, #2a8a75, #17604f); border-color: #3fae94; }

.act-stand { background: linear-gradient(180deg, #a63546, #74202d); border-color: #c85566; }

.act-double { background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); border-color: var(--brass-hi); color: var(--room-deep) !important; }

.act-split { background: linear-gradient(180deg, #4766b0, #2c4482); border-color: #6684cf; }

.act-surrender { background: linear-gradient(180deg, #6c6560, #45403c); border-color: #8d857f; }

.act-ins { background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); border-color: var(--brass-hi); color: var(--room-deep) !important; }

.act-no { background: rgba(255, 255, 255, 0.06); }

kbd {
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid currentColor;
  font-family: inherit;
  font-size: 10px;
  line-height: 15px;
  opacity: 0.65;
}

/* ---------- study panels ---------- */

.study {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid rgba(212, 175, 106, 0.38);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 8, 10, 0.88), rgba(14, 5, 7, 0.92));
  overflow: hidden;
}

.panel > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
}

.panel > summary::-webkit-details-marker {
  display: none;
}

.panel > summary::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--brass);
  border-bottom: 2px solid var(--brass);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.panel[open] > summary::before {
  transform: rotate(45deg);
}

.p-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--brass-hi);
}

.p-toggle {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 999px;
  padding: 1px 10px;
}

.panel .when-open,
.panel[open] .when-closed {
  display: none;
}

.panel[open] .when-open {
  display: inline;
}

.panel-body {
  padding: 0 18px 18px;
}

.p-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.p-foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.trainer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 81, 72, 0.28);
  border: 1px solid rgba(212, 175, 106, 0.2);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-ui {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.15s;
  flex-shrink: 0;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ivory);
  transition: transform 0.15s;
}

.switch input:checked + .switch-ui {
  background: var(--brass);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(14px);
  background: var(--room-deep);
}

.switch input:focus-visible + .switch-ui {
  outline: 2px solid var(--brass-hi);
  outline-offset: 2px;
}

.basis {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.basis .seg button {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.record {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 22px;
  margin-top: 14px;
}

.record .score dd {
  font-family: "Bodoni Moda", serif;
  font-size: 26px;
  line-height: 1;
  color: var(--brass-hi);
}

.score {
  display: flex;
  gap: 18px;
  margin: 0;
}

.score div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score dt {
  font-size: 12px;
  color: var(--muted);
}

.score dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-now {
  margin: 12px 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.chart-now[data-active="1"] {
  color: var(--brass-hi);
  font-weight: 700;
}

.charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.chart {
  margin: 0;
  min-width: 0;
}

.chart figcaption {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ivory);
}

.chart table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 12px;
  table-layout: fixed;
}

.chart th {
  font-weight: 700;
  color: var(--muted);
  padding: 3px 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.chart th.corner {
  width: 3.4em;
  font-size: 10px;
  font-weight: 500;
}

.chart tbody th {
  text-align: right;
  padding-right: 6px;
  white-space: nowrap;
}

.chart td {
  height: 24px;
  text-align: center;
  font-weight: 700;
  border-radius: 3px;
  color: #fff;
}

.c-H { background: #1d6a5b; }

.c-S { background: #8b2a3a; }

.c-D { background: #c79a45; color: #2a0c12 !important; }

.c-Ds { background: repeating-linear-gradient(135deg, #c79a45 0 5px, #b38536 5px 10px); color: #2a0c12 !important; }

.c-P { background: #3d5ba3; }

.c-Rh { background: #f1ece5; color: #2a0c12 !important; }

.c-Rs { background: repeating-linear-gradient(135deg, #f1ece5 0 5px, #d9cfc2 5px 10px); color: #2a0c12 !important; }

.chart thead th.is-col,
.chart tbody tr.is-row th {
  color: var(--brass-hi);
}

.chart tr.is-row td,
.chart td.is-col {
  filter: brightness(1.15);
}

.chart td {
  position: relative;
}

.count-mode .chart td:not(.is-dev) {
  opacity: 0.72;
}

.chart td.is-dev {
  opacity: 1;
  box-shadow: inset 0 0 0 2px #fff6d6, 0 0 10px 2px rgba(255, 214, 120, 0.85);
  z-index: 1;
}

.idx-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  padding: 0 3px;
  border-radius: 6px;
  background: #fff6d6;
  color: #2a0c12;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 12px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.chart td.has-dev::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff6d6;
  opacity: 0.85;
}

.legend-dev {
  display: none !important;
}

.count-mode .legend-dev {
  display: flex !important;
}

.sw-dev {
  position: relative;
  background: #c79a45;
  color: #2a0c12;
  box-shadow: inset 0 0 0 2px #fff6d6, 0 0 8px 1px rgba(255, 214, 120, 0.8);
}

.sw-dev i {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 0 2px;
  border-radius: 5px;
  background: #fff6d6;
  font-style: normal;
  font-size: 8px;
  line-height: 10px;
}

.chart-tc {
  margin: 0;
  font-size: 13px;
  color: var(--warn);
}

.chart td.is-hit {
  outline: 2px solid var(--ivory);
  outline-offset: 1px;
  box-shadow: 0 0 14px 3px rgba(241, 217, 154, 0.8);
  position: relative;
  z-index: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* table rules panel */

.p-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.panel[open] .p-summary {
  visibility: hidden;
}

.rules-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 10px 28px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(15, 81, 72, 0.22);
  border: 1px solid rgba(212, 175, 106, 0.2);
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  border-bottom: 1px dashed rgba(212, 175, 106, 0.15);
}

.rule-label {
  font-size: 13px;
  color: var(--ivory);
}

.rule-row .seg button {
  min-width: 58px;
  height: 32px;
}

.rule-row .select {
  min-width: 110px;
  height: 32px;
}

.rules-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.rules-actions .btn {
  min-height: 40px;
  font-size: 13px;
}

.btn[data-armed="1"] {
  border-color: var(--warn);
  color: var(--warn);
}

.rules-form[title]:not([title=""]) {
  opacity: 0.6;
}

/* count board */

.count-board {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 14px;
}

.cb-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cb-big,
.cb-list {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 106, 0.2);
}

.cb-big {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cb-label {
  font-size: 12px;
  color: var(--muted);
}

.cb-big output {
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 46px;
  line-height: 1.05;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
}

.cb-big output[data-tone="good"] {
  color: var(--good);
}

.cb-big output[data-tone="bad"] {
  color: var(--bad);
}

.sgn {
  display: inline-block;
  margin-right: 0.04em;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.72em;
  vertical-align: 0.12em;
}

.cb-hint {
  font-size: 11px;
  color: var(--muted);
}

.cb-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.cb-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cb-list dt {
  font-size: 12px;
  color: var(--muted);
}

.cb-list dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cb-head dt {
  color: var(--ivory);
  font-weight: 700;
}

.pen {
  flex-direction: column;
  align-items: stretch !important;
}

.pen dd {
  width: 100%;
}

.pen-bar {
  position: relative;
  display: block;
  height: 8px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.pen-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--dealt, 0) * 100%);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi));
}

.pen-cut {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: calc(var(--cut, 0.5) * 100%);
  width: 3px;
  border-radius: 1px;
  background: #e23a4c;
}

/* true count badge at the table's lower right */

.tc-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 19px;
  border: 1px solid rgba(212, 175, 106, 0.5);
  background: rgba(14, 6, 5, 0.88);
  color: var(--muted);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.8);
}

.tc-badge svg {
  width: 18px;
  height: 18px;
}

.tc-badge .tc-eye-on,
.tc-badge[aria-pressed="true"] .tc-eye-off {
  display: none;
}

.tc-badge[aria-pressed="true"] .tc-eye-on {
  display: block;
}

.tc-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.tc-badge[aria-pressed="true"] {
  color: var(--brass-hi);
  border-color: var(--brass);
}

.tc-value {
  min-width: 2.6em;
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
}

.tc-value[data-tone="good"] {
  color: var(--good);
}

.tc-value[data-tone="bad"] {
  color: var(--bad);
}

/* widgets */

.widget {
  margin: 18px 0 22px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 106, 0.38);
  background: linear-gradient(180deg, rgba(20, 8, 10, 0.92), rgba(14, 5, 7, 0.95));
  font-size: 14px;
  line-height: 1.6;
}

.ex-controls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 8px 24px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(212, 175, 106, 0.2);
}

.ex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ex-label {
  font-size: 13px;
}

.ex-row .seg button {
  min-width: 64px;
  height: 30px;
  font-size: 13px;
}

.ex-count {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.ex-tc {
  flex: 1;
  min-width: 120px;
  accent-color: var(--brass);
}

.ex-tc:disabled {
  opacity: 0.4;
}

.ex-tc-out {
  min-width: 2.4em;
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--brass-hi);
  text-align: right;
}

.ex-note {
  margin: 10px 0;
  font-size: 13px;
  color: var(--warn);
}

.ex-ins {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.widget .charts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bust-chart figcaption {
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--brass-hi);
}

.bars {
  display: grid;
  gap: 6px;
}

.bar {
  display: grid;
  grid-template-columns: 2.4em 1fr 4em;
  align-items: center;
  gap: 10px;
}

.bar-up {
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  color: var(--ivory);
}

.bar-track {
  height: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  border-radius: 8px;
  background: linear-gradient(90deg, #1d6a5b, #3fae94);
}

.bar.weak .bar-fill {
  background: linear-gradient(90deg, #8b2a3a, #e0525f);
}

.bar-val {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bars-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.bars-legend .key {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: #3fae94;
}

.bars-legend .key.weak {
  background: #e0525f;
}

.drill-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
}

.drill-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.drill-field .seg button {
  height: 32px;
  font-size: 13px;
}

.drill-stage {
  --cw: 96px;
  --ch: 134px;
  display: grid;
  place-items: center;
  min-height: 170px;
  margin: 16px 0 6px;
  border-radius: 12px;
  background: radial-gradient(90% 90% at 50% 40%, var(--felt-hi), var(--felt) 60%, var(--felt-deep));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.35);
}

.drill-stage .card {
  position: relative;
  left: auto;
  bottom: auto;
  animation: drillIn 0.18s ease-out;
}

@keyframes drillIn {
  from { transform: translateY(-10px) rotate(-4deg); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.drill-idle {
  margin: 0;
  padding: 0 16px;
  color: var(--ink);
  text-align: center;
}

.drill-progress {
  margin: 0 0 8px;
  min-height: 1.4em;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.drill-answer,
.tc-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.drill-answer input,
.tc-form input {
  width: 6em;
  height: 40px;
  margin-left: 6px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 106, 0.5);
  background: rgba(0, 0, 0, 0.4);
  font-size: 18px;
  font-family: "Bodoni Moda", serif;
}

.drill-answer .btn,
.tc-form .btn {
  min-height: 40px;
  min-width: 0;
  font-size: 14px;
}

.drill-verdict,
.tc-result {
  margin: 12px 0 8px;
  font-weight: 700;
}

.drill-verdict[data-tone="good"],
.tc-result[data-tone="good"] {
  color: var(--good);
}

.drill-verdict[data-tone="bad"],
.tc-result[data-tone="bad"] {
  color: var(--bad);
}

.drill-hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.drill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 2px;
}

.drill-strip .pc {
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
  padding: 2px 4px;
}

.drill-strip .pc em {
  display: block;
  font-style: normal;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  color: #6b5d4a;
}

.tc-q {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-bottom: 12px;
}

.tc-fact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-fact > span:not(.tray-pic) {
  font-size: 12px;
  color: var(--muted);
}

.tc-fact b {
  font-family: "Bodoni Moda", serif;
  font-size: 30px;
  line-height: 1;
  color: var(--brass-hi);
}

.tray-pic {
  position: relative;
  width: 34px;
  height: 40px;
  border: 1px solid rgba(212, 175, 106, 0.5);
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.tray-pic i {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: calc(var(--fill, 0.5) * 34px);
  background: repeating-linear-gradient(0deg, var(--ivory) 0 1px, #cfc4ae 1px 2px);
}

@media (max-width: 1080px) {
  :root {
    --cw: 52px;
    --ch: 73px;
    --spot: 50px;
  }

  .seat-hands .hand {
    --cw: calc(52px * var(--k));
    --ch: calc(73px * var(--k));
  }

  .seat {
    width: 128px;
    margin-left: -64px;
  }

  .fp-bj { font-size: 28px; }

  .count-board {
    grid-template-columns: 1fr 1fr;
  }

  .cb-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .widget .charts {
    grid-template-columns: 1fr 1fr;
  }

  .charts {
    grid-template-columns: 1fr 1fr;
  }

  .chart-hard {
    grid-row: span 2;
  }
}

@media (max-width: 760px) {
  :root {
    --cw: 40px;
    --ch: 56px;
    --ox: calc(var(--cw) * 0.38);
    --oy: 4px;
    --spot: 40px;
  }

  .intro {
    grid-template-columns: 1fr;
    padding: 16px 4px 10px;
  }

  .intro-lead {
    font-size: 13px;
  }

  .game-bar {
    padding: 0 4px;
  }

  .bank-value {
    font-size: 26px;
  }

  .settings {
    width: 100%;
    gap: 8px 14px;
  }

  .table-rim {
    padding: 10px;
    border-radius: 24px 24px 38% 38% / 24px 24px 8% 8%;
  }

  .table-rim::before {
    inset: 7px;
    border-radius: 20px 20px 38% 38% / 20px 20px 8% 8%;
  }

  .felt {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "discard dealer shoe"
      "msg msg msg"
      "print print print"
      "s3 s2 s1"
      "s4 s5 s6";
    align-items: start;
    row-gap: 4px;
    padding: 12px 6px 34px;
    border-radius: 18px 18px 38% 38% / 18px 18px 7% 7%;
  }

  .felt-print {
    display: none;
  }

  .fp-mini {
    grid-area: print;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2px 0 0;
    font-family: "Bodoni Moda", serif;
    line-height: 1.3;
    pointer-events: none;
  }

  .fp-mini span:first-child {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: rgba(241, 217, 154, 0.75);
  }

  .fp-mini span:last-child {
    margin-top: 3px;
    padding: 1px 14px;
    border-top: 1px solid rgba(212, 175, 106, 0.45);
    border-bottom: 1px solid rgba(212, 175, 106, 0.45);
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(241, 217, 154, 0.6);
  }

  .discard,
  .shoe,
  .dealer-zone,
  .felt-msg {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
  }

  .discard {
    grid-area: discard;
    width: 46px;
    margin: 4px 0 0 6px;
  }

  .tray {
    height: 44px;
  }

  .tray-fill {
    height: calc(var(--fill, 0) * 36px);
  }

  .shoe {
    grid-area: shoe;
    width: 66px;
    justify-self: end;
    margin: 4px 6px 0 0;
  }

  .shoe-box {
    height: 40px;
  }

  .shoe-card {
    width: 36px;
    height: 20px;
    top: 14px;
    left: 6px;
  }

  .shoe-left {
    font-size: 10px;
  }

  .dealer-zone {
    grid-area: dealer;
    justify-self: center;
    min-height: calc(var(--ch) + 22px);
  }

  .dealer-hand {
    --ox: calc(var(--cw) * 0.62);
  }

  .dealer-hand .hand-total {
    left: 50%;
    top: auto;
    bottom: -20px;
    transform: translateX(-50%);
  }

  .felt-msg {
    grid-area: msg;
    justify-self: center;
    max-width: 96%;
    margin-top: 18px;
    padding: 4px 12px;
    font-size: 12.5px;
    white-space: normal;
  }

  .felt-msg.pop {
    animation: none;
  }

  .seats {
    display: contents;
  }

  .seat {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: auto;
    min-width: 0;
    margin: 0;
    padding-top: 84px;
  }

  .seat[data-seat="1"] { grid-area: s1; }

  .seat[data-seat="2"] { grid-area: s2; }

  .seat[data-seat="3"] { grid-area: s3; }

  .seat[data-seat="4"] { grid-area: s4; }

  .seat[data-seat="5"] { grid-area: s5; }

  .seat[data-seat="6"] { grid-area: s6; }

  .seat-hands {
    top: 0;
    bottom: auto;
    height: 80px;
    max-width: 100%;
  }

  .seat-hands .hand {
    --cw: calc(40px * var(--k));
    --ch: calc(56px * var(--k));
  }

  .seat-hands[data-count="2"] { --k: 0.8; gap: 4px; }

  .seat-hands[data-count="3"],
  .seat-hands[data-count="4"] { --k: 0.6; gap: 2px; }

  .hand-total {
    left: -4px;
    top: -18px;
    font-size: 11px;
    line-height: 16px;
    padding: 0 5px;
    min-width: 22px;
  }

  .hand-result {
    font-size: 10px;
    padding: 1px 5px;
  }

  .spot-no {
    font-size: 14px;
  }

  .stack {
    transform: scale(0.8);
  }

  .plate {
    margin-top: 11px;
    font-size: 11px;
    padding-right: 7px;
    overflow: hidden;
  }

  .pname {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ins-chip {
    right: auto;
    left: 50%;
    top: auto;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
  }

  .dock {
    position: sticky;
    bottom: 0;
    margin: 10px -10px 0;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
  }

  .dock-head {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding-bottom: 6px;
  }

  .dock .bank {
    gap: 6px;
  }

  .dock .bank-label {
    font-size: 11px;
  }

  .dock .bank-value {
    font-size: 21px;
  }

  .advice {
    grid-column: 2;
    font-size: 11.5px;
    line-height: 1.35;
    min-height: 1.4em;
    text-align: right;
  }

  .tc-badge {
    right: 4px;
    bottom: 4px;
    height: 32px;
    padding: 0 10px;
  }

  .tc-value {
    font-size: 17px;
  }

  .dock-group {
    min-height: 0;
    gap: 8px;
  }

  .dock-bet {
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .dock[data-phase="betting"] .dock-bet {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "chips chips chips" "box actions sitout";
    align-items: center;
  }

  .dock .btn-sitout {
    grid-area: sitout;
    margin-left: 10px;
    min-width: 0;
    padding: 0 12px;
  }

  .chips {
    grid-area: chips;
    justify-content: space-between;
  }

  .chip {
    width: 50px;
    height: 50px;
  }

  .bet-box {
    grid-area: box;
    align-items: flex-start;
    min-width: 58px;
  }

  .bet-label {
    white-space: nowrap;
  }

  .bet-box strong {
    font-size: 22px;
  }

  .bet-actions {
    grid-area: actions;
    gap: 6px;
    justify-content: flex-start;
  }

  .btn {
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
  }

  .btn-deal {
    min-width: 0;
    padding: 0 16px;
  }

  .btn-rebuy {
    grid-column: 1 / -1;
  }

  .dock-play,
  .dock-ins {
    display: none;
  }

  .dock[data-phase="playing"] .dock-play,
  .dock[data-phase="dealing"] .dock-play {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
  }

  .dock-play .btn {
    min-width: 0;
    min-height: 50px;
    padding: 0 4px;
    font-size: 14px;
    grid-column: span 2;
  }

  .dock-play .act-hit,
  .dock-play .act-stand {
    grid-column: span 3;
  }

  .dock[data-phase="insurance"] .dock-ins {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dock-ins .btn {
    min-width: 0;
  }

  kbd {
    display: none;
  }

  .study {
    margin-top: 20px;
  }

  .panel > summary {
    padding: 12px 14px;
  }

  .p-title {
    font-size: 17px;
  }

  .p-summary {
    display: none;
  }

  .rules-form {
    padding: 10px 12px;
  }

  .panel-body {
    padding: 0 12px 14px;
  }

  .score {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .charts {
    grid-template-columns: 1fr;
  }

  .chart-hard {
    grid-row: auto;
  }

  .chart table {
    border-spacing: 1.5px;
    font-size: 11px;
  }

  .chart td {
    height: 22px;
  }

  .count-board {
    grid-template-columns: 1fr;
  }

  .cb-big output {
    font-size: 38px;
  }

  .widget {
    padding: 12px;
  }

  .widget .charts {
    grid-template-columns: 1fr;
  }

  .ex-row .seg button {
    min-width: 54px;
  }
}

@media (hover: none) {
  kbd {
    display: none;
  }
}

/* ---------- shoe-end report (same look as the baccarat table) ---------- */

.sq {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(10, 30, 26, 0.75), rgba(5, 1, 2, 0.9));
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.sq[hidden] {
  display: none;
}

.sq-panel {
  width: min(94vw, 600px);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 2px solid var(--side, var(--brass));
  background-color: var(--felt);
  background-image: radial-gradient(90% 80% at 50% 20%, var(--felt-hi), var(--felt) 60%, var(--felt-deep));
  box-shadow: 0 0 0 6px #24120b, 0 0 0 7px rgba(212, 175, 106, 0.55), 0 30px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
}

body.sq-open {
  overflow: hidden;
}


.rp-panel {
  width: min(94vw, 680px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-color: var(--brass);
}

.rp-panel .kicker {
  margin: 0 0 2px;
}

.rp-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ivory);
}

.rp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.rp-box {
  padding: 10px 14px 12px;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.rp-box h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--brass-hi);
}

.rp-list {
  margin: 0;
}

.rp-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(212, 175, 106, 0.14);
}

.rp-list > div:last-child {
  border-bottom: 0;
}

.rp-list dt {
  font-size: 12.5px;
  color: var(--muted);
}

.rp-list dd {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--ivory);
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

.rp-main dd {
  font-family: "Bodoni Moda", serif;
  font-size: 20px;
  color: var(--brass-hi);
}

/* Bodoni's minus sign reads like a strike-through next to "$". */
.rp-main #rp-net {
  font-family: inherit;
  font-size: 19px;
}

.rp-list dd[data-tone="good"] { color: var(--good); }
.rp-list dd[data-tone="bad"] { color: var(--bad); }

.rp-note {
  margin: 14px auto 12px;
  max-width: 52ch;
  font-size: 12.5px;
  color: rgba(244, 235, 214, 0.85);
}

#rp-next {
  min-width: 240px;
}


/* ---------- console: pops up from the bottom while the table is in view ---------- */

.dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  border-radius: 14px 14px 0 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 28px -10px rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: dock-up 0.45s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes dock-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

/* Each set of controls slides up as it comes into play. */
.dock[data-phase="betting"] .dock-bet,
.dock[data-phase="insurance"] .dock-ins,
.dock[data-phase="playing"] .dock-play {
  animation: group-up 0.32s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes group-up {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
}

.tc-label {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .rp-grid {
    grid-template-columns: 1fr;
  }

  .rp-title {
    font-size: 18px;
  }

  #rp-next {
    width: 100%;
    min-width: 0;
  }

  .tc-label {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dock,
  .dock-group {
    animation: none !important;
  }
}

/* ---------- practice pages (basic strategy drill, counting drill) ---------- */

.drill .table-rim,
.cdrill .table-rim {
  border-radius: 30px;
}

.drill .table-rim::before,
.cdrill .table-rim::before {
  border-radius: 26px;
}

.drill-bar,
.cdrill .game-bar {
  justify-content: space-between;
}

.drill-rules,
.hilo-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.drill-rules #d-rules {
  color: var(--ivory);
}

.hilo-hint {
  padding: 4px 12px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  border-radius: 999px;
  color: var(--brass-hi);
  background: rgba(0, 0, 0, 0.25);
}

.drill-felt,
.cd-felt {
  aspect-ratio: auto;
  border-radius: 22px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  padding: 18px 16px 20px;
}

.drill-felt {
  --cw: 78px;
  --ch: 109px;
  --ox: calc(var(--cw) * 0.6);
  --oy: 0px;
  min-height: 400px;
  grid-template-rows: auto auto 1fr auto;
}

.drill-felt .shoe,
.cd-felt .shoe {
  top: 14px;
  right: 18px;
}

.drill-felt .shoe {
  width: 70px;
}

.drill-felt .dealer-zone,
.cd-felt .dealer-zone {
  position: static;
  transform: none;
}

.drill-felt .dealer-hand,
.cd-felt .dealer-hand {
  --ox: calc(var(--cw) * 0.62);
}

.drill-verdict {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(94%, 660px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 106, 0.45);
  background: rgba(6, 26, 23, 0.88);
  color: var(--ivory);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.7);
  position: relative;
  z-index: 30;
}

.drill-verdict b {
  font-size: 22px;
  line-height: 1;
}

.drill-verdict[data-ok="1"] {
  border-color: rgba(127, 211, 168, 0.7);
}

.drill-verdict[data-ok="1"] b {
  color: var(--good);
}

.drill-verdict[data-ok="0"] {
  border-color: rgba(255, 138, 143, 0.75);
}

.drill-verdict[data-ok="0"] b {
  color: var(--bad);
}

.drill-verdict.pop {
  animation: verdict-pop 0.3s ease-out;
}

@keyframes verdict-pop {
  from { transform: scale(0.94); opacity: 0.3; }
}

.drill-hands {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 26px;
  align-self: end;
  min-height: calc(var(--ch) + 16px);
  padding-top: 16px;
}

.drill-hands[data-count="3"],
.drill-hands[data-count="4"] {
  --cw: 60px;
  --ch: 84px;
  gap: 18px;
}

.drill-msg {
  margin: 0;
  min-height: 1.5em;
  max-width: 92%;
  font-size: 13.5px;
  color: var(--ivory);
  text-align: center;
}

.drill-msg[data-tone="bad"] {
  color: var(--bad);
}

/* console */

.drill-score {
  grid-area: head;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 175, 106, 0.18);
}

.drill-score div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.drill-score dt {
  font-size: 12px;
  color: var(--muted);
}

.drill-score dd {
  margin: 0;
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
}

.drill-dock[data-phase="idle"] .drill-next,
.drill-dock[data-phase="ins"] .dock-ins,
.drill-dock[data-phase="play"] .dock-play,
.drill-dock[data-phase="dealing"] .dock-play {
  display: flex;
  animation: group-up 0.32s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.drill-next .btn-deal {
  min-width: 200px;
  min-height: 52px;
  font-size: 17px;
}

.act-no {
  background: linear-gradient(180deg, #6c6560, #45403c);
  border-color: #8d857f;
}

/* mistakes */

.mistakes {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.mistakes li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.mistakes .none {
  display: block;
  color: var(--muted);
}

.m-y {
  color: var(--bad);
  text-decoration: line-through;
}

.m-a {
  color: var(--good);
  font-weight: 700;
}

.mistakes li:has(.m-cards) {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
}

.m-cards {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: 14px;
}

.m-cards .pc {
  margin: 0;
}

.m-who {
  margin: 0 3px 0 6px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.m-who:first-child {
  margin-left: 0;
}

/* hand count + unlimited switch */

.drill-score .d-unl {
  margin-left: 4px;
  font-family: inherit;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.switch-sm {
  gap: 6px;
  font-size: 12px;
}

.switch-sm .switch-ui {
  width: 30px;
  height: 18px;
}

.switch-sm .switch-ui::after {
  width: 12px;
  height: 12px;
}

.switch-sm input:checked + .switch-ui::after {
  transform: translateX(12px);
}

/* run report */

.rp-mistakes {
  max-height: 280px;
  margin: 0;
  overflow-y: auto;
  font-size: 12.5px;
}

.rp-mistakes li:has(.m-cards) {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.rp-mistakes .m-cards {
  grid-column: 1 / -1;
}

#dr-r-grade:empty {
  display: none;
}

#dr-r-grade {
  margin-bottom: 0;
  font-weight: 700;
  color: var(--brass-hi);
}

@media (max-width: 640px) {
  .mistakes li:has(.m-cards) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px 10px;
  }

  .mistakes .m-cards {
    grid-column: 1 / -1;
  }
}

/* counting drill */

.cd-felt {
  --cw: 50px;
  --ch: 70px;
  --ox: calc(var(--cw) * 0.42);
  --oy: 0px;
  min-height: 470px;
  grid-template-rows: auto auto 1fr;
}

.cd-felt .shoe {
  width: 104px;
}

.cd-msg {
  align-self: center;
}

.cseats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-self: end;
  align-items: end;
}

.cseat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  min-height: calc(var(--ch) + 64px);
}

.cseat .seat-hands {
  position: static;
  transform: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 6px;
}

.cseat .seat-hands[data-count] {
  height: auto;
  gap: 22px 6px;
}

.cseat .plate {
  margin-top: 0;
}

.cseat.is-active .plate {
  outline: 1px solid var(--brass-hi);
  box-shadow: 0 0 12px rgba(241, 217, 154, 0.5);
}

.cseat .hand-result {
  font-size: 10px;
  padding: 1px 5px;
}

/* a player's basic strategy decision, called out above the hand */
.act-tag {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 7;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: #2f6f9a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: act-tag var(--dur, 1000ms) ease-out both;
}

.act-tag[data-act="stand"] { background: #8a3a3a; }
.act-tag[data-act="double"] { background: #b0832e; }
.act-tag[data-act="split"] { background: #4a5bb5; }
.act-tag[data-act="surrender"] { background: #5f5a55; }

@keyframes act-tag {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

@media (prefers-reduced-motion: reduce) {
  .act-tag {
    animation: none;
  }
}

.cd-quiz {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 8;
  display: grid;
  gap: 12px;
  width: min(92%, 440px);
  padding: 16px 18px 18px;
  border-radius: 16px;
  border: 1px solid var(--brass);
  background: rgba(14, 5, 7, 0.95);
  box-shadow: 0 0 0 5px rgba(36, 18, 11, 0.9), 0 24px 50px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%);
  text-align: center;
  animation: verdict-pop 0.3s ease-out;
}

.cd-quiz[hidden] {
  display: none;
}

.q-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--brass-hi);
}

.q-form {
  display: grid;
  gap: 10px;
}

.q-form[hidden] {
  display: none;
}

.q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  font-size: 14px;
}

.q-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 106, 0.45);
  border-radius: 10px;
  overflow: hidden;
}

.q-step button {
  width: 40px;
  height: 42px;
  border: 0;
  background: rgba(212, 175, 106, 0.12);
  color: var(--brass-hi);
  font-size: 20px;
}

.q-step input {
  width: 70px;
  height: 42px;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  color: var(--ivory);
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  -moz-appearance: textfield;
}

.q-step input::-webkit-outer-spin-button,
.q-step input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.q-fb {
  display: grid;
  gap: 6px;
  text-align: left;
  font-size: 14px;
}

.q-fb[hidden] {
  display: none;
}

.q-fb p {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.q-fb b {
  font-size: 18px;
  line-height: 1.1;
}

.q-fb p[data-ok="1"] b { color: var(--good); }
.q-fb p[data-ok="0"] b { color: var(--bad); }

.cd-dock {
  grid-template-areas: "head" "group";
}

.cd-start-row {
  display: flex;
}

.cd-start-row .btn-deal {
  min-width: 200px;
  min-height: 52px;
  font-size: 17px;
}

.cdrill:not([data-phase="idle"]) .cd-start-row {
  display: none;
}

.cdrill:not([data-phase="idle"]) .cd-dock .drill-score {
  padding-bottom: 0;
  border-bottom: 0;
}

.cd-prog {
  position: relative;
  display: inline-block;
  width: 140px;
  height: 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  vertical-align: middle;
}

.cd-prog i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p, 0) * 100%);
  background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi));
  transition: width 0.3s;
}

.rp-one {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  /* The practice felts stack in one column, not the table's three-column grid. */
  .drill-felt,
  .cd-felt {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
  }

  .drill-felt > *,
  .cd-felt > * {
    grid-area: auto;
  }

  .drill-felt .dealer-zone,
  .cd-felt .dealer-zone {
    justify-self: center;
  }

  .drill-felt {
    --cw: 60px;
    --ch: 84px;
    min-height: 360px;
    padding: 14px 10px 16px;
  }

  .drill-felt .shoe {
    display: none;
  }

  .drill-hands {
    gap: 16px;
  }

  .drill-hands[data-count="3"],
  .drill-hands[data-count="4"] {
    --cw: 44px;
    --ch: 62px;
    gap: 10px;
  }

  .drill-verdict {
    font-size: 12.5px;
    padding: 8px 12px;
  }

  .drill-score {
    gap: 2px 14px;
  }

  .drill-score dd {
    font-size: 16px;
  }

  .drill-dock[data-phase="play"] .dock-play,
  .drill-dock[data-phase="dealing"] .dock-play {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
  }

  .drill-dock[data-phase="ins"] .dock-ins {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cd-felt {
    --cw: 40px;
    --ch: 56px;
    min-height: 560px;
    padding: 12px 8px 14px;
  }

  .cd-felt .shoe {
    top: 10px;
    right: 10px;
    width: 76px;
  }

  .cseats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 18px;
  }


  .cseat .plate {
    font-size: 11px;
  }

  .q-row {
    font-size: 13px;
  }

  .cd-prog {
    width: 96px;
  }
}
