:root {
  --bg: #0c1f1a;
  --panel: #1c2a2c;
  --panel-2: #26383b;
  --edge: #3f5659;
  --text: #ffffff;
  --muted: #9fb5b3;
  --gold: #f7c548;
  --blue: #0a93f5;   --blue-d: #0561a6;
  --red: #fe5048;    --red-d: #a8302b;
  --orange: #ff9a1f; --orange-d: #b0620a;
  --green: #2fbf7f;  --green-d: #1a7a50;
  --grey: #5b6d70;   --grey-d: #37474a;
  --card: #f4efe4;
  --ink: #26324a;
  --suit-red: #e0443a;
  --cw: min(21vw, 92px, 13.5dvh);
  --ch: calc(var(--cw) * 1.4);
  --pad-x: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: -0.02em;
}

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated;
  z-index: 0;
}
#bg.fallback { background: radial-gradient(circle at 50% 40%, #2f7a4f, #16453a 55%, #0c1f1a); }

.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .09) 0 1px, transparent 1px 3px);
}

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }

#app {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 10px) var(--pad-x) calc(env(safe-area-inset-bottom) + 12px);
}
#app.shake { animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 3px) rotate(-.6deg); }
  40% { transform: translate(6px, -3px) rotate(.5deg); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(3px, -1px); }
}

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 8px; }
.chips-box {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--panel); border: 3px solid var(--edge); border-radius: 12px;
  padding: 6px 10px 6px 12px; min-width: 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .4);
}
.chips-box .lbl { font-size: 10px; color: var(--muted); }
.chips-box .val { font-size: 18px; font-weight: 700; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); white-space: nowrap; }
.chips-box .plus {
  align-self: center; margin-left: 2px;
  background: var(--blue); color: #fff; border-radius: 6px;
  width: 22px; height: 22px; display: grid; place-items: center; font-size: 18px; line-height: 1;
  box-shadow: 0 2px 0 var(--blue-d);
}
.chips-box.pop .val { animation: pop .35s; }
.chips-box.deny { animation: shake .35s; }

.streak {
  position: absolute; left: 0; top: 40px; z-index: 3;
  background: var(--orange); color: #fff; border-radius: 8px; padding: 4px 8px;
  font-size: 11px; font-weight: 700; box-shadow: 0 3px 0 var(--orange-d);
  animation: bob 1.2s ease-in-out infinite; white-space: nowrap;
}
.top-btns { margin-left: auto; display: flex; gap: 6px; }
.mini {
  white-space: nowrap;
  background: var(--panel); border: 3px solid var(--edge); border-radius: 10px;
  font-size: 11px; padding: 7px 7px; color: var(--muted);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.mini:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }

/* ---------- table ---------- */
.table {
  flex: 1; min-height: 0; position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 0 8px;
}
.dealer-zone { position: relative; }
.zone-head { display: flex; justify-content: center; align-items: center; gap: 6px; margin-bottom: 8px; min-height: 26px; }
.tag, .score {
  background: rgba(12, 22, 24, .82); border: 2px solid var(--edge); border-radius: 8px;
  padding: 2px 8px; font-size: 12px; font-weight: 700;
}
.tag { color: var(--muted); }
.score { color: #fff; min-width: 34px; text-align: center; }
.score.bust { background: var(--red); border-color: var(--red-d); }
.score.hot { background: var(--gold); border-color: #b88a1c; color: #2a1d00; }
.score.bump { animation: pop .25s; }

.shoe {
  position: absolute; right: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.shoe-cards { position: relative; width: calc(var(--cw) * .5); height: calc(var(--ch) * .5); }
.shoe-cards i {
  position: absolute; inset: 0; border-radius: 5px; border: 2px solid var(--card);
  background: repeating-linear-gradient(45deg, #c93a31 0 4px, #e0534a 4px 8px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.shoe-cards i:nth-child(1) { transform: translate(4px, 4px); }
.shoe-cards i:nth-child(2) { transform: translate(2px, 2px); }
#shoeCount { font-size: 11px; color: var(--muted); background: rgba(12, 22, 24, .7); border-radius: 4px; padding: 0 4px; }

.player-zone { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: calc(var(--ch) + 64px); }

.banner {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 20; pointer-events: none; text-align: center;
}
.banner .title {
  display: inline-block; font-size: clamp(26px, 8.4vw, 42px); font-weight: 700; line-height: 1;
  color: #fff; letter-spacing: .02em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .55), 0 0 18px rgba(0, 0, 0, .35);
  animation: slam .5s cubic-bezier(.2, 1.6, .4, 1) both, wobble 2.4s ease-in-out .5s infinite;
}
.banner .title.win { color: var(--gold); }
.banner .title.bj { color: var(--gold); background: linear-gradient(180deg, #fff3b0, #f7c548 55%, #ff9a1f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)); }
.banner .title.lose { color: var(--red); }
.banner .title.push { color: #d6e2e1; }
.banner .sub {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700;
  background: rgba(12, 22, 24, .85); border: 3px solid var(--edge); border-radius: 12px; padding: 6px 10px;
  animation: rise .35s ease-out .2s both;
}
.bx { border-radius: 7px; padding: 2px 8px; color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.bx.blue { background: var(--blue); }
.bx.red { background: var(--red); }
.sub .x { color: var(--red); }
.sub .eq { color: var(--muted); }
.sub .pos { color: var(--gold); }
.sub .neg { color: var(--red); }
.banner.small .title { font-size: 26px; }

/* ---------- cards ---------- */
.hand { display: flex; justify-content: center; align-items: flex-start; min-height: var(--ch); }
.card { width: var(--cw); height: var(--ch); position: relative; flex: none; will-change: transform; }
.card + .card { margin-left: calc(var(--cw) * -0.56); }
.sway { width: 100%; height: 100%; perspective: 700px; animation: sway 4.2s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: rotate(-1.1deg) translateY(0); }
  50% { transform: rotate(1.1deg) translateY(-2px); }
}
.flip { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .42s cubic-bezier(.3, 1.35, .5, 1); }
.flip.down { transform: rotateY(180deg); }
.card.peek .flip { animation: peek .55s ease-in-out; }
@keyframes peek {
  0%, 100% { transform: rotateY(180deg); }
  40%, 60% { transform: rotateY(180deg) translateY(-6px) rotateX(24deg); }
}
.face {
  position: absolute; inset: 0; border-radius: calc(var(--cw) * .09);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .38);
  overflow: hidden;
}
.front { background: var(--card); border: 2px solid #d4c9b3; color: var(--ink); }
.front.red { color: var(--suit-red); }
.back {
  transform: rotateY(180deg);
  border: calc(var(--cw) * .06) solid var(--card);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(0, 0, 0, 0) 31%),
    repeating-linear-gradient(45deg, #c93a31 0 5px, #e0534a 5px 10px);
}
.back::after {
  content: ''; position: absolute; inset: 12%; border: 2px solid rgba(255, 255, 255, .55); border-radius: 4px;
  background: radial-gradient(circle, rgba(255, 255, 255, .5) 0 14%, transparent 15%);
}
.corner {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  line-height: .9; font-weight: 700; font-size: calc(var(--cw) * .19); letter-spacing: -.1em;
}
.corner i { font-style: normal; font-size: calc(var(--cw) * .19); font-family: system-ui, sans-serif; }
.corner.tl { top: 5%; left: 6%; }
.corner.br { bottom: 5%; right: 6%; transform: rotate(180deg); }
.pips { position: absolute; inset: 0; }
.pips i {
  position: absolute; font-style: normal; font-family: system-ui, sans-serif;
  font-size: calc(var(--cw) * .2); line-height: 1; transform: translate(-50%, -50%);
}
.pips i.f { transform: translate(-50%, -50%) rotate(180deg); }
.ace { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .56); font-family: system-ui, sans-serif; }
.court {
  position: absolute; inset: 20% 22%; border-radius: 4px; border: 2px solid currentColor;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .04) 0 3px, transparent 3px 6px);
}
.court b { font-size: calc(var(--cw) * .36); line-height: .9; }
.court i { font-style: normal; font-size: calc(var(--cw) * .22); font-family: system-ui, sans-serif; }

/* player hands */
.hands { display: flex; justify-content: center; align-items: flex-end; gap: 10px; width: 100%; }
.hands.n2 { --cw: min(17vw, 78px, 12dvh); gap: 16px; }
.hands.n3 { --cw: min(12.5vw, 64px, 10dvh); gap: 10px; }
.hands.n4 { --cw: min(10.5vw, 56px, 9dvh); gap: 8px; }
.phand { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .25s, opacity .25s; }
.phand .meta { display: flex; gap: 4px; margin-top: 8px; align-items: center; }
.phand .hbet { color: var(--gold); background: rgba(12, 22, 24, .82); border: 2px solid var(--edge); border-radius: 8px; padding: 2px 6px; font-size: 11px; white-space: nowrap; }
.hands.multi .phand { opacity: .62; }
.hands.multi .phand.active { opacity: 1; transform: translateY(-8px); }
.hands.multi .phand.active::after {
  content: '▲'; position: absolute; bottom: -18px; color: var(--gold); font-size: 12px; animation: bob 1s ease-in-out infinite;
}
.hands .phand.settled { opacity: 1; transform: none; }

.stamp {
  position: absolute; left: 50%; top: calc(var(--ch) * .38); z-index: 5;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: clamp(11px, calc(var(--cw) * .2), 19px); font-weight: 700; padding: 2px 8px;
  border-radius: 7px; color: #fff; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .4);
  animation: stamp .35s cubic-bezier(.2, 1.7, .4, 1) both;
}
.stamp.win { background: var(--green); }
.stamp.bj { background: var(--gold); color: #3a2600; }
.stamp.lose, .stamp.bust { background: var(--red); }
.stamp.push { background: var(--grey); }
.dealer-zone .stamp { top: calc(26px + 8px + var(--ch) * .5); }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-12deg) scale(2.4); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; } }

/* ---------- betting ---------- */
.bet-area { display: flex; align-items: center; gap: 18px; }
.bet-area[hidden], .bet-amt[hidden] { display: none; }
.bet-spot {
  width: calc(var(--cw) * 1.2); height: calc(var(--cw) * 1.2); border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .45); background: rgba(0, 0, 0, .22);
  position: relative; padding: 0;
}
.bet-spot.has { border-color: var(--gold); border-style: solid; }
.stack { position: absolute; left: 50%; bottom: 50%; transform: translate(-50%, 50%); width: 42px; height: 42px; }
.stack .chip { position: absolute; left: 0; width: 42px; height: 42px; font-size: 11px; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--edge);
  background: var(--panel); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45);
}
.round-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.round-btn:disabled { opacity: .35; }
.bet-amt {
  margin-top: 10px; font-size: 13px; color: var(--muted);
  background: rgba(12, 22, 24, .8); border-radius: 8px; padding: 3px 10px;
}
.bet-amt.has { color: var(--gold); font-size: 17px; }

.chip {
  --c: var(--red); --cd: var(--red-d); --t: #fff;
  width: min(58px, 15vw); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; position: relative; padding: 0;
  font-weight: 700; font-size: 12px; color: var(--t);
  border: 0;
  background:
    radial-gradient(circle, var(--c) 0 54%, transparent 55%),
    repeating-conic-gradient(var(--c) 0 22.5deg, #fff 22.5deg 45deg);
  box-shadow: 0 4px 0 var(--cd), inset 0 0 0 3px var(--cd);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.chip::before { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .6); }
.chip span { position: relative; }
.chip.d1 { --c: #e8e8e8; --cd: #9aa5a6; --t: #26324a; }
.chip.d5 { --c: var(--red); --cd: var(--red-d); }
.chip.d25 { --c: var(--green); --cd: var(--green-d); }
.chip.d100 { --c: #2d3950; --cd: #151c29; }
.chip.d500 { --c: #8e5ad8; --cd: #5a3491; }
.chip.d1000 { --c: var(--orange); --cd: var(--orange-d); }
button.chip:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--cd), inset 0 0 0 3px var(--cd); }
button.chip:disabled { filter: grayscale(1) brightness(.5); }
.chip.flying { position: fixed; z-index: 46; width: 42px; height: 42px; font-size: 11px; pointer-events: none; transition: transform .32s cubic-bezier(.3, .8, .4, 1), opacity .32s; }

/* ---------- controls ---------- */
.controls { height: 140px; flex: none; }
.panel-bet { display: flex; flex-direction: column; gap: 14px; }
.tray { display: flex; justify-content: space-between; gap: 6px; padding: 0 2px; }
.row { display: flex; gap: 8px; }
.grow { flex: 1; }
.panel-play { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.panel-bet[hidden], .panel-play[hidden] { display: none; }

.btn {
  --c: var(--grey); --cd: var(--grey-d);
  font-weight: 700; color: #fff; border: 0; border-radius: 11px;
  height: 54px; padding: 0 14px; font-size: 18px; letter-spacing: 0;
  background: var(--c);
  box-shadow: 0 5px 0 var(--cd);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--cd); }
.btn:disabled { filter: grayscale(1) brightness(.5); cursor: default; }
.btn.blue { --c: var(--blue); --cd: var(--blue-d); }
.btn.red { --c: var(--red); --cd: var(--red-d); }
.btn.orange { --c: var(--orange); --cd: var(--orange-d); }
.btn.green { --c: var(--green); --cd: var(--green-d); }
.btn.grey { --c: var(--grey); --cd: var(--grey-d); }
.btn.wide { width: 100%; }
.btn.pulse:not(:disabled) { animation: pulse 1.1s ease-in-out infinite; }
.panel-bet .btn.red, .panel-bet .btn.orange { font-size: 13px; padding: 0 10px; }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(3, 10, 10, .72); padding: 16px;
}
.modal[hidden] { display: none; }
.sheet {
  width: min(100%, 400px); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--panel); border: 3px solid var(--edge); border-radius: 16px;
  padding: 18px 16px 20px; box-shadow: 0 8px 0 rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 12px;
  animation: slam .35s cubic-bezier(.2, 1.5, .4, 1) both;
}
.sheet h2 { margin: 0; text-align: center; font-size: 24px; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.note { margin: 0; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.35; }
.note:empty { display: none; }
.note.hot { color: var(--gold); }
.kv { display: flex; justify-content: space-between; align-items: baseline; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.kv b { color: #fff; font-size: 15px; }
.kv.big b { color: var(--gold); font-size: 21px; }
.kv b.pos { color: var(--green); }
.kv b.neg { color: var(--red); }
.field {
  display: flex; align-items: center; gap: 6px;
  background: #0f1819; border: 3px solid var(--edge); border-radius: 12px; padding: 0 12px;
}
.field span { font-size: 22px; color: var(--gold); }
.field input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: #fff; font: inherit; font-size: 22px; font-weight: 700; padding: 10px 0;
  user-select: text; -webkit-user-select: text;
}
.field input::placeholder { color: #4d6264; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick button {
  background: var(--panel-2); border: 2px solid var(--edge); border-radius: 9px; padding: 8px 0; font-size: 12px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.quick button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-grid div { background: var(--panel-2); border-radius: 10px; padding: 8px 10px; }
.stat-grid span { display: block; font-size: 10px; color: var(--muted); }
.stat-grid b { font-size: 16px; }
.rules { margin: 0; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.4; font-weight: 400; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 70px); z-index: 80;
  transform: translateX(-50%);
  background: var(--panel); border: 3px solid var(--edge); border-radius: 10px;
  padding: 6px 14px; font-size: 13px; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .45);
  animation: rise .25s ease-out both;
}

/* ---------- fx ---------- */
.px { position: absolute; width: 8px; height: 8px; animation: burst .9s cubic-bezier(.2, .7, .4, 1) forwards; }
.px.round { border-radius: 50%; width: 12px; height: 12px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
@keyframes burst {
  from { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  to { transform: translate(calc(var(--dx) - 50%), calc(var(--dy) - 50%)) rotate(var(--r)); opacity: 0; }
}
.float {
  position: absolute; font-size: 18px; font-weight: 700; transform: translate(-50%, -50%);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .6); animation: floatUp 1.3s ease-out forwards; white-space: nowrap;
}
.float.pos { color: var(--gold); }
.float.neg { color: var(--red); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@keyframes slam { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes rise { from { transform: translate(var(--tx, 0), 12px); opacity: 0; } to { transform: translate(var(--tx, 0), 0); opacity: 1; } }
.toast { --tx: -50%; }

/* ---------- modes, hints, insurance ---------- */
.mode-tags { position: absolute; left: 0; top: 10px; display: flex; gap: 4px; z-index: 3; }
.mode-tags span { font-size: 9px; padding: 2px 6px; border-radius: 6px; color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.mode-tags .m-hint { background: var(--blue); }
.mode-tags .m-easy { background: var(--green); }
.shoe-lbl { font-size: 10px; color: var(--gold); margin-top: 4px; }

.hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 15;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(12, 22, 24, .9); border: 3px solid var(--blue); border-radius: 12px;
  padding: 6px 14px; text-align: center; pointer-events: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .45);
  animation: hintIn .3s cubic-bezier(.2, 1.5, .4, 1) both;
}
.hint[hidden] { display: none; }
.hint b { font-size: 19px; color: #fff; }
.hint small { font-size: 11px; color: var(--muted); font-weight: 400; }
.hint .lbl { font-size: 10px; color: var(--blue); letter-spacing: .08em; }
@keyframes hintIn { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.btn.suggest:not(:disabled) { outline: 3px solid #fff; outline-offset: 3px; animation: pulse .9s ease-in-out infinite; }

.panel-play.easy { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; height: 100%; }
.panel-play.easy .btn { height: 100%; max-height: 118px; font-size: 24px; }
.panel-play.easy #btnDbl, .panel-play.easy #btnSplit { display: none; }
.panel-ins { display: flex; flex-direction: column; gap: 12px; }
.panel-ins[hidden] { display: none; }
.ins-q { text-align: center; font-size: 18px; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); background: rgba(12, 22, 24, .8); border-radius: 10px; padding: 6px; }
.ins-q span { color: #fff; font-size: 13px; }

/* ---------- home ---------- */
.home {
  position: fixed; inset: 0; z-index: 55; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 30%, rgba(10, 20, 20, .35), rgba(5, 10, 10, .78));
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 20px);
}
.home[hidden] { display: none; }
.home-inner { max-width: 420px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.marquee { position: relative; padding: 16px; border-radius: 22px; background: linear-gradient(180deg, #3a2a0a, #1d1404); border: 4px solid #c9962b; box-shadow: 0 8px 0 rgba(0, 0, 0, .5), 0 0 40px rgba(255, 190, 60, .25); animation: slam .6s cubic-bezier(.2, 1.5, .4, 1) both; }
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%);
  background: #6b4f1c; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35);
  animation: bulb 0.9s steps(1) infinite;
}
.bulb.b1 { animation-delay: -.3s; }
.bulb.b2 { animation-delay: -.6s; }
@keyframes bulb {
  0% { background: #fff6c8; box-shadow: 0 0 6px 2px #ffd65a, 0 0 14px 4px rgba(255, 170, 40, .6); }
  33.3%, 100% { background: #6b4f1c; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35); }
}
.sign {
  position: relative; border-radius: 12px; padding: 14px 10px 12px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, #a3172b, #5c0816 70%);
  border: 3px solid #f7c548; box-shadow: inset 0 0 0 3px #5c0816, inset 0 0 30px rgba(0, 0, 0, .5);
}
.sign-top { font-size: 20px; color: var(--gold); letter-spacing: .08em; text-shadow: 0 3px 0 #3a0510, 0 0 12px rgba(247, 197, 72, .6); }
.sign-main {
  font-size: clamp(38px, 12.5vw, 60px); line-height: 1; font-weight: 700; color: #fff4f0; letter-spacing: -.02em;
  text-shadow: 0 0 6px #ff6b8a, 0 0 18px #ff2d55, 0 0 36px #ff2d55, 0 5px 0 #3a0510;
  animation: neon 5s infinite;
}
@keyframes neon {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: .55; text-shadow: 0 5px 0 #3a0510; }
}
.sign-suits { display: flex; justify-content: center; gap: 14px; font-size: 22px; color: #fff; margin-top: 4px; font-family: system-ui, sans-serif; }
.sign-suits .r { color: #ffb3c0; }
.ribbon { text-align: center; font-size: 11px; color: var(--gold); background: rgba(12, 22, 24, .85); border: 2px solid var(--edge); border-radius: 10px; padding: 6px; }
.home-chips {
  display: flex; align-items: center; gap: 10px; background: var(--panel); border: 3px solid var(--edge); border-radius: 12px;
  padding: 10px 12px; box-shadow: 0 4px 0 rgba(0, 0, 0, .4);
}
.home-chips span { font-size: 10px; color: var(--muted); }
.home-chips b { font-size: 21px; color: var(--gold); flex: 1; text-align: left; }
.home-chips em { font-style: normal; font-size: 11px; background: var(--blue); border-radius: 8px; padding: 6px 10px; box-shadow: 0 3px 0 var(--blue-d); }
.toggles { display: flex; flex-direction: column; gap: 8px; }
.toggle {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--panel); border: 3px solid var(--edge); border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .4);
}
.toggle:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.t-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.t-txt b { font-size: 15px; }
.t-txt small { font-size: 10px; line-height: 1.35; color: var(--muted); font-weight: 400; }
.switch { width: 50px; height: 28px; border-radius: 14px; background: var(--grey-d); position: relative; flex: none; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .3); transition: transform .15s cubic-bezier(.3, 1.5, .5, 1); }
.toggle[aria-pressed="true"] { border-color: var(--green); }
.toggle[aria-pressed="true"] .switch { background: var(--green); }
.toggle[aria-pressed="true"] .switch i { transform: translateX(22px); }
.btn.play { height: 64px; font-size: 26px; }

@media (min-height: 780px) {
  .controls { height: 150px; }
  .btn { height: 58px; }
}
@media (max-height: 600px) {
  .controls { height: 124px; }
  .btn { height: 46px; font-size: 16px; }
  .panel-bet { gap: 10px; }
  .chip { width: min(48px, 13vw); }
}

@media (prefers-reduced-motion: reduce) {
  .bulb, .sign-main, .sway, .banner .title, .streak, .btn.pulse, .hands.multi .phand.active::after { animation: none !important; }
  #app.shake { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bulb.b0 { background: #fff6c8; box-shadow: 0 0 6px 2px #ffd65a; }
}

/* ---------- felted (bankroll hit zero) ---------- */
body.felted #app, body.felted #bg {
  filter: grayscale(1) brightness(.55) contrast(1.1);
  transform: scale(1.05);
  transition: filter 1.3s ease-in, transform 2.5s ease-out;
}
#app, #bg { transition: filter .4s, transform .4s; }
.felted-screen {
  position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; pointer-events: none;
  animation: feltIn .5s ease-out both;
}
.felted-screen.out { animation: feltOut .4s ease-in both; }
.felted-screen .band {
  width: 100%; text-align: center; padding: 22px 0 18px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .78) 18%, rgba(0, 0, 0, .78) 82%, transparent);
}
.felted-word {
  font-size: clamp(48px, 16vw, 84px); font-weight: 700; color: #c9302c; line-height: 1; letter-spacing: .02em;
  text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000, 0 6px 0 #000;
  animation: feltSlam .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.felted-sub { margin-top: 10px; font-size: 13px; color: #cfcfcf; letter-spacing: .2em; }
@keyframes feltIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes feltOut { to { opacity: 0; } }
@keyframes feltSlam { from { transform: scale(1.8); opacity: 0; filter: blur(4px); } to { transform: scale(1); opacity: 1; filter: blur(0); } }
