/* Barlow Condensed (SIL OFL 1.1, fonts/OFL.txt), latin subset, for the cabinet's type. */
@font-face { font-family: "Cabinet"; src: url("fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cabinet"; src: url("fonts/barlow-condensed-800.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }

/* Video Poker: a premium cabinet. Original design.
   Layout: topper (marquee) / screen (pay table, message, cards, meters) / button deck.
   Colorways change the screen glass; the cabinet chrome stays. */

:root {
  --flip: 230ms;
  --gap: clamp(5px, 1.2vw, 14px);
  --pad: max(10px, env(safe-area-inset-left));

  /* Sapphire, the classic */
  --glass-1: #1438a8;
  --glass-2: #0a1d6e;
  --glass-3: #040b33;
  --pay: #ffd23f;
  --pay-dim: #e0b532;
  --pay-line: rgb(255 210 63 / 0.28);
  --col: #c4142f;
  --col-hi: #ff3b52;
  --lit: #ffffff;
  --win-bg: #ffd23f;
  --win-fg: #1a0f00;
  --meter: #ffcf3a;
  --meter-glow: rgb(255 190 40 / 0.55);
  --msg: #ffffff;

  --chrome-1: #2b2f3a;
  --chrome-2: #12141b;
  --chrome-edge: #6b7180;
  --chrome-hi: rgb(255 255 255 / 0.14);
  --room: #05060a;

  --red: #cc1626;
  --black: #15171c;
  --gold: #c9a13b;
  --gold-hi: #f4d77a;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Cabinet", "SF Pro Display", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cab: "Cabinet", "Arial Narrow", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

:root[data-colorway="emerald"] {
  --glass-1: #0f7a52; --glass-2: #075236; --glass-3: #022316;
  --col: #b8122c; --col-hi: #ff3b52;
}
:root[data-colorway="crimson"] {
  --glass-1: #a3172b; --glass-2: #6a0a19; --glass-3: #2a0309;
  --col: #1d47b8; --col-hi: #4b7bff;
}
:root[data-colorway="midnight"] {
  --glass-1: #2c3142; --glass-2: #171a25; --glass-3: #07080d;
  --col: #9a7414; --col-hi: #e2b33a;
  --pay: #f3e3b0; --pay-dim: #d8c48c; --pay-line: rgb(243 227 176 / 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 80% at 50% 0%, #1b1f2c 0%, var(--room) 60%) fixed,
    var(--room);
  color: #e9ecf3;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------------------------------------------------------- cabinet */
.cabinet {
  height: 100dvh;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(6px, 1.2vh, 12px);
  padding: max(8px, env(safe-area-inset-top)) var(--pad) max(8px, env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- topper */
.topper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(6px, 1.1vh, 12px) clamp(10px, 2vw, 22px);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.10), transparent 45%),
    linear-gradient(90deg, #0d0f16, #1b1e29 50%, #0d0f16);
  border: 1px solid #2c303c;
  box-shadow: 0 1px 0 var(--chrome-hi) inset, 0 8px 24px rgb(0 0 0 / 0.5);
}
.marquee { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.marquee-game {
  font-family: var(--font-cab);
  font-weight: 800;
  font-size: clamp(18px, min(3.1vw, 4vh), 38px);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  background: linear-gradient(180deg, #fff6cf 0%, #f6d266 38%, #c48d1e 62%, #f9e08c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgb(246 190 60 / 0.35)) drop-shadow(0 1px 0 rgb(0 0 0 / 0.8));
}
.marquee-sub {
  margin-top: 3px;
  font-size: clamp(10px, 1.4vh, 13px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #9aa3b8;
  text-transform: uppercase;
}
.tools { position: absolute; right: clamp(6px, 1.4vw, 16px); top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.tool {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent;
  display: grid; place-items: center; color: #9aa3b8;
}
.tool:hover { background: rgb(255 255 255 / 0.07); color: #fff; }
.tool svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#btn-sound[aria-pressed="true"] .i-off, #btn-sound[aria-pressed="false"] .i-on { display: none; }

/* ---------------------------------------------------------------- screen */
.screen {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(4px, 1vh, 12px);
  padding: clamp(8px, 1.6vh, 18px) clamp(8px, 1.8vw, 22px);
  border-radius: 20px;
  background:
    radial-gradient(140% 90% at 50% 0%, var(--glass-1) 0%, var(--glass-2) 48%, var(--glass-3) 100%);
  border: 2px solid #000;
  box-shadow:
    0 0 0 1px var(--chrome-edge),
    0 0 0 7px #0b0c11,
    0 0 0 8px #3a3f4c,
    inset 0 0 60px rgb(0 0 0 / 0.55),
    inset 0 1px 0 rgb(255 255 255 / 0.18),
    0 20px 50px rgb(0 0 0 / 0.6);
  margin: 8px;
  overflow: hidden;
}
/* The glass: a soft diagonal sheen and a faint pixel weave. */
.screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(115deg, rgb(255 255 255 / 0.10) 0%, rgb(255 255 255 / 0.03) 28%, transparent 42%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.018) 0 1px, transparent 1px 3px);
}

/* Big wins: a band of light sweeps the glass and the frame glows gold. */
.screen::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgb(255 232 160 / 0.30) 47%, rgb(255 255 255 / 0.42) 50%, rgb(255 232 160 / 0.30) 53%, transparent 62%) no-repeat;
  background-size: 260% 100%;
}
.screen.big-win::before { animation: sweep 1.15s ease-in-out 3; }
.screen.jackpot::before { animation: sweep 0.95s ease-in-out 8; }
.screen.big-win { animation: frame-glow 0.6s ease-in-out 6; }
.screen.jackpot { animation: frame-glow 0.45s ease-in-out 18; }
@keyframes sweep {
  0% { opacity: 1; background-position: 120% 0; }
  100% { opacity: 1; background-position: -20% 0; }
}
@keyframes frame-glow {
  50% {
    box-shadow:
      0 0 0 1px #ffe08a,
      0 0 0 7px #2a2208,
      0 0 0 8px #f6d266,
      0 0 46px 6px rgb(255 205 70 / 0.55),
      inset 0 0 60px rgb(0 0 0 / 0.45),
      inset 0 1px 0 rgb(255 255 255 / 0.18),
      0 20px 50px rgb(0 0 0 / 0.6);
  }
}

/* ---------------------------------------------------------------- pay table */
.paytable-wrap {
  border: 2px solid var(--pay-line);
  border-radius: 8px;
  padding: 2px;
  background: rgb(0 0 0 / 0.18);
}
.paytable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(11px, min(1.85vh, 1.75vw), 22px);
  line-height: 1.14;
  color: var(--pay);
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.6), 0 0 8px rgb(0 0 0 / 0.25);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.035em;
}
.paytable th, .paytable td { padding: 0 0.6em; white-space: nowrap; }
.paytable th { text-align: left; width: 30%; font-weight: 800; }
.paytable td { text-align: right; border-left: 1px solid var(--pay-line); }
.paytable[data-bet="1"] td[data-col="1"], .paytable[data-bet="2"] td[data-col="2"],
.paytable[data-bet="3"] td[data-col="3"], .paytable[data-bet="4"] td[data-col="4"],
.paytable[data-bet="5"] td[data-col="5"] {
  background: linear-gradient(180deg, var(--col-hi), var(--col) 60%);
  color: #fff;
  border-left-color: transparent;
}
.paytable tr.lit th, .paytable tr.lit td { color: var(--lit); text-shadow: 0 0 10px rgb(255 255 255 / 0.65); }
.paytable tr.win th, .paytable tr.win td { animation: win-row 0.5s steps(1, end) infinite; }
@keyframes win-row {
  0% { background: var(--win-bg); color: var(--win-fg); text-shadow: none; }
  50% { background: transparent; color: var(--lit); }
}
.paytable tr[data-row="0"] td[data-col="5"] { letter-spacing: 0.04em; }

/* ---------------------------------------------------------------- play area */
.play {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(4px, 0.9vh, 10px);
}
.message {
  text-align: center;
  font-family: var(--font-cab);
  font-weight: 800;
  font-size: clamp(15px, min(2.9vh, 2.5vw), 28px);
  letter-spacing: 0.12em;
  color: var(--msg);
  min-height: 1.5em;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.7), 0 0 14px rgb(0 0 0 / 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message[data-tone="winner"] { color: var(--pay); animation: glow 1.1s ease-in-out infinite; }
.message[data-tone="over"] { color: #ffe3e3; }
.message[data-tone="info"] { color: var(--lit); }
.message[data-tone="insert"] { color: var(--pay); animation: blink 1s steps(1, end) infinite; }
.message.flash { animation: shake 0.35s; }
@keyframes glow { 50% { text-shadow: 0 0 18px rgb(255 214 80 / 0.9), 0 1px 0 rgb(0 0 0 / 0.7); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* The hand: five slots sized to fit both the width and the height available. */
.hand {
  container-type: size;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--gap);
}
.slot {
  --cw: min(calc((100cqw - 4 * var(--gap)) / 5), calc((100cqh - 4.8em) / 1.4), 190px);
  width: var(--cw);
  display: grid;
  grid-template-rows: 1.8em auto auto;
  justify-items: stretch;
  gap: 0.35em;
  font-size: clamp(10px, min(1.5vh, 1.6vw), 15px);
}
.card {
  position: relative;
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: 1.8em auto;
  padding: 0;
  border: 0;
  background: none;
  perspective: 900px;
  gap: 0.35em;
}
.card:disabled, .card:not(.holdable) { cursor: default; }
.held-tag {
  align-self: end;
  justify-self: center;
  font-family: var(--font-cab);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 1.3em;
  line-height: 1;
  margin-bottom: 0.45em;
  color: var(--pay);
  text-shadow: 0 0 10px rgb(255 210 63 / 0.7), 0 1px 0 rgb(0 0 0 / 0.8);
  visibility: hidden;
}
.card.held .held-tag { visibility: visible; }
.flip {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  transform-style: preserve-3d;
  transition: transform var(--flip) cubic-bezier(0.3, 0.1, 0.3, 1), translate 140ms ease;
}
.card.down .flip { transform: rotateY(180deg); }
.card.held .flip { translate: 0 -3%; }
.card.no-anim .flip { transition: none; }
.face, .back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 7%/5%;
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.45), 0 1px 2px rgb(0 0 0 / 0.5);
}
.back { transform: rotateY(180deg); }
.card.held .face { box-shadow: 0 0 0 2px var(--pay), 0 0 18px rgb(255 210 63 / 0.55), 0 8px 18px rgb(0 0 0 / 0.5); }
.card.scoring .face { box-shadow: 0 0 0 2px #fff, 0 0 22px rgb(255 255 255 / 0.6), 0 8px 18px rgb(0 0 0 / 0.5); }
.card.dim .face { filter: brightness(0.6) saturate(0.7); }
.card-svg { display: block; width: 100%; height: 100%; }

.hold-btn {
  grid-row: 3;
  border: 0;
  border-radius: 7px;
  padding: 0.35em 0;
  font-family: var(--font-cab);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 1.2em;
  color: #2a1d00;
  background: linear-gradient(180deg, #ffe590, #e6b328 55%, #b98512);
  box-shadow: 0 2px 0 #6b4a05, 0 4px 8px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.6);
}
.hold-btn:disabled { color: rgb(255 255 255 / 0.35); background: linear-gradient(180deg, #3a3f4c, #262a33); box-shadow: 0 2px 0 #12141a, inset 0 1px 0 rgb(255 255 255 / 0.08); }
.hold-btn.on { background: linear-gradient(180deg, #fff7d0, #ffd84d 55%, #e7a91a); box-shadow: 0 0 14px rgb(255 210 63 / 0.7), 0 1px 0 #6b4a05, inset 0 1px 0 #fff; translate: 0 1px; }

/* ---------------------------------------------------------------- card art */
.face-bg { fill: #fdfcf8; stroke: #c9c3b5; stroke-width: 2; }
.red { fill: var(--red); }
.blk { fill: var(--black); }
.idx { font-family: "Helvetica Neue", Arial, var(--font); font-weight: 800; font-size: 46px; letter-spacing: -1px; }
.idx10 { font-size: 40px; letter-spacing: -4px; }
.court { font-family: var(--font-serif); font-weight: 700; font-size: 92px; paint-order: stroke; stroke: #b8902f; stroke-width: 1.4px; }
.panel { fill: url(#panel-fill); stroke: var(--gold); stroke-width: 3; }
.panel-stop-a { stop-color: #fbf5e4; }
.panel-stop-b { stop-color: #efe2bf; }
.panel-hatch { fill: url(#hatch); }
.hatch-line { stroke: rgb(184 144 47 / 0.16); stroke-width: 1; }
.panel-line { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.85; }
.orn { fill: var(--gold); }
.gold-stop-a { stop-color: #f7dd84; }
.gold-stop-b { stop-color: #d0a53c; }
.gold-stop-c { stop-color: #a87b1c; }
.emblem { fill: url(#gold-fill); stroke: #8a6714; stroke-width: 0.8; }
.gem { stroke: rgb(255 255 255 / 0.65); stroke-width: 0.8; }
.ring { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.ring.thin { stroke-width: 1; opacity: 0.7; }

.back-bg { fill: #f4f1ea; stroke: #c9c3b5; stroke-width: 2; }
.back-field { fill: #8e1020; }
:root[data-colorway="crimson"] .back-field { fill: #13306f; }
.back-lattice { fill: url(#lattice); }
.lattice-line { stroke: rgb(244 215 122 / 0.45); stroke-width: 1; fill: none; }
.lattice-dot { fill: rgb(244 215 122 / 0.6); }
.back-line { fill: none; stroke: var(--gold-hi); stroke-width: 2; }
.back-medal { fill: #8e1020; stroke: var(--gold-hi); stroke-width: 2.5; }
:root[data-colorway="crimson"] .back-medal { fill: #13306f; }
.back-mark { fill: var(--gold-hi); }

/* ---------------------------------------------------------------- meters */
.meters {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1.3fr;
  gap: clamp(6px, 1.2vw, 14px);
}
.meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.35em 0.8em;
  border-radius: 9px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: linear-gradient(180deg, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.35));
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.6);
  font-size: clamp(11px, min(1.9vh, 1.7vw), 20px);
  min-width: 0;
}
.meter-label { font-family: var(--font-cab); font-weight: 700; letter-spacing: 0.18em; font-size: 0.8em; color: rgb(255 255 255 / 0.62); }
.meter-value {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 1.75em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--meter);
  text-shadow: 0 0 12px var(--meter-glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#meter-win .meter-value { color: #fff; text-shadow: 0 0 12px rgb(255 255 255 / 0.4); }
#meter-win.active .meter-value { color: var(--pay); text-shadow: 0 0 16px rgb(255 214 80 / 0.8); }

/* ---------------------------------------------------------------- button deck */
.deck {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: clamp(6px, 1.4vw, 16px);
  padding: clamp(8px, 1.3vh, 14px) clamp(8px, 1.6vw, 18px);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.10), transparent 30%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.015) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--chrome-1), var(--chrome-2));
  border: 1px solid #3a3f4c;
  box-shadow: 0 1px 0 var(--chrome-hi) inset, 0 -2px 10px rgb(0 0 0 / 0.4) inset, 0 10px 30px rgb(0 0 0 / 0.5);
}
.deck-left, .deck-right { display: flex; gap: clamp(6px, 1.2vw, 14px); align-items: stretch; }
.btn {
  --h: clamp(46px, 7.2vh, 66px);
  min-width: clamp(58px, 9vw, 120px);
  height: var(--h);
  padding: 0 0.9em;
  border-radius: 10px;
  border: 1px solid rgb(0 0 0 / 0.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
  font-family: var(--font-cab);
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: clamp(14px, min(2.1vh, 1.9vw), 20px);
  transition: transform 60ms, box-shadow 60ms, filter 120ms;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { filter: brightness(0.42) saturate(0.55); box-shadow: 0 3px 0 #0e1015, inset 0 1px 0 rgb(255 255 255 / 0.12); }
.btn-top, .btn-bottom { display: block; }
.btn-bet {
  color: #2a1a00;
  background: linear-gradient(180deg, #fff1b0 0%, #f6c63a 45%, #c98d10 100%);
  box-shadow: 0 3px 0 #6e4b06, 0 6px 12px rgb(0 0 0 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.8), 0 0 18px rgb(246 198 58 / 0.25);
}
.btn-deal {
  min-width: clamp(84px, 14vw, 180px);
  color: #062a10;
  font-size: clamp(18px, min(2.9vh, 2.6vw), 30px);
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #d4ffd8 0%, #4ee36a 45%, #14a336 100%);
  box-shadow: 0 3px 0 #0a5a1d, 0 6px 14px rgb(0 0 0 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.85), 0 0 24px rgb(78 227 106 / 0.35);
}
.btn-deal.drawing { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 3px 0 #0a5a1d, 0 6px 14px rgb(0 0 0 / 0.45), inset 0 1px 0 #fff, 0 0 36px rgb(78 227 106 / 0.7); } }
.btn-service {
  color: #e8ebf2;
  background: linear-gradient(180deg, #59607a 0%, #353a4b 55%, #22252f 100%);
  box-shadow: 0 3px 0 #0e1015, 0 6px 12px rgb(0 0 0 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.25);
  font-size: clamp(12px, min(1.75vh, 1.6vw), 16px);
}
.no-credit .btn-service { animation: service 1.2s ease-in-out infinite; }
@keyframes service { 50% { box-shadow: 0 3px 0 #0e1015, 0 0 22px rgb(255 210 63 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.25); } }
.btn-denom {
  min-width: var(--h);
  width: var(--h);
  padding: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e8b732 45%, #a8750d 100%);
  box-shadow: 0 3px 0 #5e4005, 0 6px 12px rgb(0 0 0 / 0.45), inset 0 0 0 3px rgb(255 255 255 / 0.25), inset 0 0 0 6px rgb(120 80 0 / 0.35);
  color: #3a2500;
}
.denom-coin { font-weight: 800; font-size: 1.3em; letter-spacing: 0.02em; text-shadow: 0 1px 0 rgb(255 240 190 / 0.6); }

/* ---------------------------------------------------------------- dialogs */
.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid #3a3f4c;
  border-radius: 18px;
  background: linear-gradient(180deg, #1c2030, #11131c);
  color: #e9ecf3;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.08);
  user-select: text;
  -webkit-user-select: text;
}
.sheet-wide { width: min(720px, calc(100vw - 24px)); }
.sheet::backdrop { background: rgb(2 3 8 / 0.72); backdrop-filter: blur(3px); }
.sheet-inner { padding: 22px clamp(16px, 4vw, 28px) 18px; }
.sheet h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-hi);
}
.sheet h3 { margin: 18px 0 8px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #9aa3b8; }
.sheet-lead { margin: 0 0 6px; color: #c9cfdc; }
.hint { margin: 6px 0; font-size: 13px; color: #9aa3b8; line-height: 1.45; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.pill {
  border: 1px solid #3a3f4c;
  background: #262a38;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
}
.pill:hover:not(:disabled) { background: #30354a; }
.pill:disabled { opacity: 0.45; }
.pill-primary { background: linear-gradient(180deg, #f6d266, #c48d1e); color: #231700; border-color: #8a6410; }
.pill-primary:hover { background: linear-gradient(180deg, #ffe08a, #d29a26) !important; }
.pill-quiet { background: transparent; color: #9aa3b8; margin-right: auto; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: center;
  min-width: 84px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid #3a3f4c;
  background: #1f2331;
}
.choice[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(180deg, #3b3220, #2a2416); box-shadow: 0 0 0 1px var(--gold) inset; }
.choice:disabled { opacity: 0.4; }
.choice-label { font-weight: 800; }
.choice-note { font-size: 12px; color: #9aa3b8; margin-top: 2px; font-variant-numeric: tabular-nums; }

.bills { display: flex; gap: 10px; flex-wrap: wrap; }
.bill {
  flex: 1 1 120px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 10px;
  border-radius: 10px;
  border: 1px solid #2f5d3a;
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.04) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #2e6b40, #1a4527);
  color: #e6f5e8;
  box-shadow: inset 0 0 0 3px rgb(0 0 0 / 0.15), 0 4px 10px rgb(0 0 0 / 0.35);
}
.bill:hover { filter: brightness(1.12); }
.bill-amount { font-size: 24px; font-weight: 900; letter-spacing: 0.02em; }
.bill-word { font-size: 10px; letter-spacing: 0.24em; opacity: 0.75; }

.ticket {
  margin: 12px auto 0;
  width: min(300px, 100%);
  padding: 14px 16px;
  background: #f7f3e6;
  color: #1a1a1a;
  border-radius: 4px;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.45);
  animation: print 0.6s ease-out;
}
.ticket-head { font-size: 12px; letter-spacing: 0.2em; font-weight: 700; }
.ticket-amount { font-size: 30px; font-weight: 800; margin: 6px 0; }
.ticket-foot { font-size: 11px; color: #555; }
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-10px); } to { clip-path: inset(0 0 0 0); transform: none; } }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.stat { padding: 10px 12px; border-radius: 12px; background: #1a1e2b; border: 1px solid #2c3140; display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #9aa3b8; }
.freq, .returns { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.freq th, .returns th { text-align: right; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #9aa3b8; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #2c3140; }
.freq td, .returns td { text-align: right; padding: 5px 8px; border-bottom: 1px solid #1f2331; }
.freq th:first-child, .freq td:first-child, .returns th:first-child, .returns td:first-child { text-align: left; }
.freq td.up { color: #7be08f; }
.returns tr.current td { color: var(--gold-hi); font-weight: 700; }

.prose p, .prose li { line-height: 1.55; color: #c9cfdc; font-size: 15px; }
.prose ol { padding-left: 1.3em; }
.prose em { color: #fff; font-style: normal; font-weight: 700; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 5px; text-align: center;
  background: #262a38; border: 1px solid #3a3f4c; border-bottom-width: 2px; font: 700 12px var(--font);
}
.fine { font-size: 12px !important; color: #7c8499 !important; }

/* ---------------------------------------------------------------- layouts */
/* Phones, portrait: the deck tightens, buttons share the width. */
@media (max-width: 560px) {
  .screen { margin: 6px 4px; padding: 8px 6px; border-radius: 14px; }
  .paytable { font-size: clamp(11px, 3.3vw, 15px); line-height: 1.4; }
  .paytable th, .paytable td { padding: 0 0.45em; }
  .paytable th { width: 36%; }
  .deck { padding: 8px; gap: 6px; }
  .deck-left, .deck-right { gap: 6px; }
  .btn { min-width: 0; padding: 0 0.5em; flex: 1; }
  .deck-right { flex: 1; }
  .btn-deal { flex: 1.4; }
  .marquee-game { font-size: clamp(17px, 5.4vw, 24px); letter-spacing: 0.04em; }
  .name-tail { display: none; }
  .topper { padding-right: 146px; padding-left: 12px; }
  .marquee { align-items: flex-start; }
  .tool { width: 34px; }
  .meters { grid-template-columns: 1fr 0.6fr 1.3fr; }
  .meter { flex-direction: column; align-items: flex-start; gap: 0; padding: 0.3em 0.6em; }
  .meter-value { font-size: 1.3em; }
  .slot { font-size: clamp(9px, 2.6vw, 12px); }
}

/* Tall screens (phones and tablets upright): cards sized by width, the pay table larger,
   and the play area spread evenly down the screen. */
@media (max-aspect-ratio: 4/5) {
  .paytable { font-size: clamp(11px, min(2.25vh, 3.2vw), 28px); line-height: 1.5; }
  .play { grid-template-rows: auto auto auto; align-content: space-evenly; }
  .hand { container-type: inline-size; }
  .slot { --cw: min(calc((100cqw - 4 * var(--gap)) / 5), 210px); }
  .meter { font-size: clamp(11px, 2.6vw, 22px); }
}
@media (max-aspect-ratio: 4/5) and (max-width: 560px) {
  .paytable { font-size: clamp(11px, 3.45vw, 15px); line-height: 1.6; }
  :root { --gap: 5px; }
}

/* Laptop-height screens: win back height for the cards. */
@media (max-height: 820px) and (min-aspect-ratio: 4/3) and (min-height: 561px) {
  .marquee { flex-direction: row; align-items: baseline; justify-content: center; gap: 14px; }
  .marquee-sub { margin-top: 0; }
  .topper { padding-block: 6px; }
  .paytable { line-height: 1.06; }
  .screen { margin: 6px; padding-block: 8px; }
  .cabinet { gap: 6px; }
}

/* Short landscape screens (phones on their side): pay table beside the cards. */
@media (max-height: 560px) and (orientation: landscape) {
  .cabinet { gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .topper { padding: 4px 12px; }
  .marquee-sub { display: none; }
  .screen { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr); margin: 5px; padding: 8px; }
  .paytable-wrap { align-self: center; }
  .paytable { font-size: clamp(10px, min(3.4vh, 1.6vw), 15px); line-height: 1.28; }
  .btn { --h: 42px; }
  .meter { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .paytable tr.win th, .paytable tr.win td { animation-duration: 1.2s; }
  .btn-deal.drawing, .message[data-tone="winner"], .no-credit .btn-service { animation: none; }
  .screen.big-win::before, .screen.jackpot::before { animation: none; }
  .screen.big-win, .screen.jackpot { animation-iteration-count: 2; }
}

/* Keyboard focus */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.card:focus-visible { outline-offset: 4px; border-radius: 8px; }
