/* The casino (js/casino.js): the fire's poker table, blackjack, the slot machine and cases. Felt and cards keep their
   colours in both themes; everything around them follows Glød. */

/* ---------- on the fire's stage, opened from the games ---------- */
.casino-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.casino-view > .stage-head { border-bottom: 1px solid var(--line); }
.casino { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.casino { --felt: #1d6b4c; --felt-dark: #0f3d2b; --rail: #6b3f22; --rail-light: #9a6034; --card: #fffdf8; --card-red: #c0262d;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 60%), var(--bg); overflow: hidden; }
.casino-top { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 22px 4px; flex-wrap: wrap; }
.casino-spacer { flex: 1; }
.chip-balance { display: flex; align-items: center; gap: 10px; }
.chip-text { display: flex; flex-direction: column; line-height: 1.1; }
.chip-text b { font-family: var(--font-head); font-size: 26px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
#casino-free.ready { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
#casino-free:disabled { opacity: .75; cursor: default; }

/* A poker chip, drawn: striped edge, ember ring, cream middle. */
.chip-icon { display: inline-block; flex: none; width: 30px; height: 30px; border-radius: 50%; vertical-align: -0.35em;
  background: radial-gradient(circle, #fff6e6 0 34%, var(--ember) 35% 52%, transparent 53%), repeating-conic-gradient(var(--ember) 0 22.5deg, #fff6e6 22.5deg 45deg);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .3); }
.chip-icon.sm { width: 15px; height: 15px; margin-right: 4px; vertical-align: -0.2em; }

.casino-tabs { flex: none; display: flex; gap: 6px; padding: 8px 22px; overflow-x: auto; scrollbar-width: none; }
.casino-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.casino-tabs button:hover { background: var(--hover); color: var(--text-strong); }
.casino-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text-strong); box-shadow: 0 0 0 2px var(--accent); }
.casino-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 22px 10px; }
.casino-pane { min-height: 100%; }
.casino-note { flex: none; margin: 0; padding: 6px 22px 10px; text-align: center; }

/* ---------- playing cards ---------- */
.pcard { --w: 46px; position: relative; display: inline-block; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .12); background: var(--card); color: #1f1813;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 3px 8px rgba(0, 0, 0, .35); font-family: var(--font-head); flex: none; user-select: none; }
.pcard.red { color: var(--card-red); }
.pcard b { position: absolute; top: 4%; left: 9%; font-size: calc(var(--w) * .36); line-height: 1; font-weight: 600; letter-spacing: -.04em; }
.pcard i { position: absolute; top: 34%; left: 10%; font-style: normal; font-size: calc(var(--w) * .26); line-height: 1; }
.pcard em { position: absolute; right: 8%; bottom: 4%; font-style: normal; font-size: calc(var(--w) * .58); line-height: 1; }
.pcard.back { background: repeating-linear-gradient(45deg, #a8420f 0 5px, #c4561c 5px 10px); border: calc(var(--w) * .07) solid var(--card); }
.pcard.back::after { content: ""; position: absolute; inset: 22% 18%; border-radius: 30%; background: url(icon.svg) center / cover; opacity: .9; }
.pcard.slot { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18); }
.pcard.deal { animation: card-deal .38s cubic-bezier(.2, .8, .3, 1.1) both; }
@keyframes card-deal { from { opacity: 0; transform: translateY(-26px) rotate(-10deg) scale(.9); } }

/* ---------- Texas hold 'em ---------- */
.poker { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.poker-stage { width: 100%; padding: 40px 64px 64px; }
.poker-table { position: relative; width: min(100%, 940px); margin: 0 auto; aspect-ratio: 1.85 / 1; container-type: size; }
.poker-felt { position: absolute; inset: 9% 6%; border-radius: 999px; border: 14px solid var(--rail);
  background: radial-gradient(ellipse at 50% 38%, #2a8c63, var(--felt) 45%, var(--felt-dark) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), inset 0 0 60px rgba(0, 0, 0, .45), 0 0 0 3px var(--rail-light), 0 18px 40px rgba(40, 20, 8, .35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.poker-brand { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .22); font-family: var(--font-head); font-size: clamp(12px, 2.2cqw, 20px); text-transform: lowercase; }
.poker-brand .logo-mark { width: 22px; height: 22px; opacity: .45; filter: grayscale(.3); }
.poker-board { display: flex; gap: 6px; }
.poker-board .pcard { --w: clamp(34px, 6.4cqw, 60px); }
.poker-pot { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; min-height: 22px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); background: rgba(0, 0, 0, .25); padding: 2px 12px; border-radius: 999px; }

.p-seat { position: absolute; transform: translate(-50%, -50%); width: 128px; display: flex; flex-direction: column; align-items: center; gap: 3px; z-index: 1; transition: opacity .2s; }
.p-seat.empty { width: auto; }
.p-sit { width: 58px; height: 58px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--accent-text); font: inherit; font-weight: 800; cursor: pointer; }
.p-sit:hover { background: var(--accent); color: var(--accent-ink); border-style: solid; }
.p-open { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--line); opacity: .7; }
.p-cards { display: flex; height: 42px; margin-bottom: -10px; z-index: 0; }
.p-cards .pcard { --w: 32px; }
.p-cards .pcard + .pcard { margin-left: -10px; transform: rotate(6deg); }
.p-cards .pcard:first-child { transform: rotate(-4deg); }
/* Your seat: your cards beside your name, so they don't cover the board. */
.p-seat.me { display: grid; grid-template-areas: "plate cards" "status cards"; width: auto; column-gap: 8px; row-gap: 3px; align-items: center; justify-items: center; }
.p-seat.me .p-cards { grid-area: cards; height: auto; margin: 0; }
.p-seat.me .p-plate { grid-area: plate; }
.p-seat.me .p-status { grid-area: status; }
.p-seat.me .p-bet { transform: translate(-50%, calc(-50% - 54px)); }
.p-seat.me .p-cards .pcard { --w: 48px; }
.p-seat.me .p-cards .pcard + .pcard { margin-left: -12px; }
.p-plate { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; background: rgba(28, 20, 15, .92); color: #fbf4ec; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); min-width: 112px; }
.p-avatar { width: 30px; height: 30px; border-radius: 50%; font-size: 13px; }
.p-info { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.p-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 76px; }
.p-stack { font-size: 12px; color: var(--glow); font-weight: 800; font-variant-numeric: tabular-nums; }
.p-button { position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: #fffdf8; color: #1f1813; font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.p-status { min-height: 20px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.p-action, .p-hand { font-size: 11px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .45); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.p-hand { background: var(--accent); color: #fff; }
.p-won { font-weight: 900; color: var(--glow); font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); animation: won-pop .6s ease-out; }
@keyframes won-pop { from { transform: translateY(8px) scale(.7); opacity: 0; } }
.p-seat.acting .p-plate { box-shadow: 0 0 0 3px var(--glow), 0 0 22px color-mix(in srgb, var(--glow) 60%, transparent); }
.p-seat.won .p-plate { box-shadow: 0 0 0 3px #ffd36b, 0 0 30px rgba(255, 211, 107, .7); }
.p-seat.folded { opacity: .45; }
.p-seat.folded .p-cards { visibility: hidden; }
.p-seat.out:not(.acting) .p-plate { opacity: .7; }
.p-timer { position: absolute; left: 14px; right: 14px; bottom: -5px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.p-timer::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--left, 1)); background: var(--glow); }
.p-bet { position: absolute; left: 50%; top: 50%; transform: translate(calc(-50% + var(--to-x)), calc(-50% + var(--to-y))); color: #fff; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .4); padding: 2px 9px 2px 4px; border-radius: 999px; white-space: nowrap; z-index: 2; pointer-events: none; }

.poker-bar { width: min(100%, 720px); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 0 6px; }
.poker-hint { margin: 0; color: var(--muted); text-align: center; }
.poker-moves { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.poker-moves .btn { min-width: 110px; padding: 12px 22px; font-size: 15px; }
.poker-raise { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.poker-raise input[type="range"] { width: min(320px, 70vw); accent-color: var(--accent); }
.poker-seat-moves { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 14px; }
.poker-log { list-style: none; margin: 0; padding: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.poker-log li:first-child { color: var(--text); font-weight: 700; }

/* ---------- blackjack ---------- */
.bj { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 10px; }
.bj-table { position: relative; width: min(100%, 760px); min-height: 380px; border-radius: 40px 40px 220px 220px / 40px 40px 140px 140px; border: 12px solid var(--rail);
  background: radial-gradient(ellipse at 50% 20%, #2a8c63, var(--felt) 50%, var(--felt-dark));
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .45), 0 0 0 3px var(--rail-light), 0 18px 40px rgba(40, 20, 8, .3);
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 16px 36px; color: #fff; }
.bj-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-label { font-weight: 800; color: rgba(255, 255, 255, .8); }
.bj-label b { margin-left: 4px; background: rgba(0, 0, 0, .3); padding: 1px 9px; border-radius: 999px; }
.bj-label b:empty { display: none; }
.bj-cards { display: flex; gap: 0; min-height: 84px; }
.bj-cards .pcard { --w: 60px; }
.bj-cards .pcard + .pcard { margin-left: -18px; }
.bj-rules { color: rgba(255, 255, 255, .45); font-family: var(--font-head); letter-spacing: .02em; text-align: center; }
.bj-msg { min-height: 28px; font-family: var(--font-head); font-size: 22px; text-align: center; text-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.bj-msg.good { color: #ffd36b; }
.bj-msg.bad { color: rgba(255, 255, 255, .75); }
.bj-hands { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 16px; transition: background .2s; }
.bj-hand.active { background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 2px var(--glow); }
.bj-hand-info { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.bj-hand-info > b { background: rgba(0, 0, 0, .35); padding: 1px 10px; border-radius: 999px; }
.bj-result { padding: 1px 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); }
.bj-hand.win .bj-result, .bj-hand.blackjack .bj-result { background: #ffd36b; color: #3a2408; }
.bj-hand.lose .bj-result, .bj-hand.bust .bj-result { background: rgba(0, 0, 0, .45); color: rgba(255, 255, 255, .8); }
.bj-controls { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bj-moves { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bj-moves .btn, .deal-btn { min-width: 120px; padding: 12px 24px; font-size: 16px; }
.bet-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.bet-chips { display: flex; gap: 6px; }
.bet-chip { --c: #3f6fd8; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-weight: 900; font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  background: radial-gradient(circle, var(--c) 0 46%, #fff 47% 52%, transparent 53%), repeating-conic-gradient(var(--c) 0 22.5deg, #fff 22.5deg 45deg);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .2), 0 3px 6px rgba(0, 0, 0, .25); transition: transform .1s; }
.bet-chip:hover { transform: translateY(-2px); }
.bet-chip.c10 { --c: #3f6fd8; } .bet-chip.c50 { --c: #c0262d; } .bet-chip.c100 { --c: #2b2420; } .bet-chip.c500 { --c: #7d3fc2; } .bet-chip.c1000 { --c: #c98a12; }
.bet-chip.c10000 { --c: #1f8a5b; } .bet-chip.c50000 { --c: #d14f8a; }
.bet-amount { font-family: var(--font-head); font-size: 22px; color: var(--text-strong); min-width: 80px; text-align: center; }

/* ---------- slots: a cabinet with a lit marquee, chrome-rimmed reels, LED meters and a lever ---------- */
.slots { --row: 84px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.slot-cabinet { position: relative; width: min(100%, 520px); padding-right: 46px; }
.slot-machine { position: relative; border-radius: 34px 34px 22px 22px; padding: 14px 16px 0; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 12%, transparent 88%, rgba(0, 0, 0, .35)), linear-gradient(170deg, #5a1a14, #34100c 50%, #1d0907);
  border: 5px solid transparent; background-clip: padding-box; box-shadow: 0 0 0 5px #c9963e, 0 0 0 7px #6b4413, inset 0 2px 0 rgba(255, 255, 255, .15), 0 24px 50px rgba(30, 10, 4, .5); }

.slot-marquee { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 12px 12px; border-radius: 24px 24px 12px 12px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, #a8331c, #3a0f0a 70%); box-shadow: inset 0 0 0 3px #e0b25c, inset 0 0 24px rgba(0, 0, 0, .7); }
.slot-title { position: relative; display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 30px; font-weight: 700; color: #ffe9a8; letter-spacing: .01em;
  text-shadow: 0 0 6px #ffb04f, 0 0 18px #ff6a1b, 0 2px 0 #7a2a0a; }
.slot-title .logo-mark { width: 30px; height: 30px; }
.slot-sub { position: relative; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 233, 168, .7); }
/* Chasing bulbs round the marquee. */
.slot-bulbs { position: absolute; inset: 5px; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: auto 1fr auto; pointer-events: none; }
.slot-bulbs i { width: 9px; height: 9px; border-radius: 50%; justify-self: center; background: #ffe7a0; box-shadow: 0 0 6px #ffc24f, 0 0 12px #ff8a2b; animation: bulb 1s steps(1) infinite; }
.slot-bulbs i:nth-child(n + 10) { grid-row: 3; }
.slot-bulbs i:nth-child(2n) { animation-delay: .5s; }
@keyframes bulb { 50% { background: #7a3a12; box-shadow: none; } }
.slot-machine.won .slot-bulbs i { animation-duration: .25s; }

.slot-bezel { display: flex; align-items: stretch; gap: 6px; padding: 10px 6px; border-radius: 18px;
  background: linear-gradient(#f4f1ec, #9ea3a8 18%, #e7e9eb 40%, #7d8287 70%, #d9dcdf); box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .5); }
.slot-window { position: relative; flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; border-radius: 12px; background: #120a07; box-shadow: inset 0 4px 12px rgba(0, 0, 0, .8); }
.slot-reel { height: calc(var(--row) * 3); overflow: hidden; border-radius: 8px; position: relative; background: linear-gradient(90deg, #d8cfc2, #fffdf8 18%, #fffdf8 82%, #d8cfc2); }
/* The reels are drums: dark at the top and bottom, a glint across the middle. */
.slot-reel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(10, 4, 2, .62), rgba(10, 4, 2, .12) 20%, transparent 32%, rgba(255, 255, 255, .18) 46%, transparent 54%, transparent 68%, rgba(10, 4, 2, .12) 80%, rgba(10, 4, 2, .62)); }
.slot-strip { display: flex; flex-direction: column; will-change: transform; }
.slot-sym { height: var(--row); flex: none; display: grid; place-items: center; }
.slot-sym .sym { width: calc(var(--row) * .74); height: calc(var(--row) * .74); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); }
.slot-sym.hit { animation: sym-hit .7s ease-in-out 3; background: radial-gradient(circle, rgba(255, 211, 107, .85), transparent 70%); }
@keyframes sym-hit { 50% { transform: scale(1.14); } }
.slot-lines { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); pointer-events: none; overflow: visible; }
.slot-lines polyline { fill: none; stroke: #ffd36b; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; filter: drop-shadow(0 0 4px rgba(255, 140, 70, .9)); vector-effect: non-scaling-stroke; }
.slot-paylines { position: relative; width: 20px; flex: none; }
.slot-paylines b { position: absolute; left: 0; width: 20px; height: 18px; margin-top: -9px; display: grid; place-items: center; border-radius: 5px; font-size: 11px; font-weight: 900;
  color: #fbe9c9; background: linear-gradient(#6a2a1a, #3a120c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); transition: background .2s, box-shadow .2s; }
.slot-paylines b:nth-child(1) { top: 7%; }
.slot-paylines b:nth-child(2) { top: calc(6px + (100% - 12px) / 6); }
.slot-paylines b:nth-child(3) { top: 50%; }
.slot-paylines b:nth-child(4) { top: calc(100% - 6px - (100% - 12px) / 6); }
.slot-paylines b:nth-child(5) { top: 93%; }
.slot-paylines b.on { color: #3a1a08; background: linear-gradient(#ffe9a8, #ffb030); box-shadow: 0 0 10px #ffb04f; }

.slot-leds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-led { display: flex; flex-direction: column; align-items: center; padding: 5px 6px 6px; border-radius: 10px; background: #0b0605; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .12); }
.slot-led span { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 200, 140, .6); }
.slot-led b { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; color: #ff9a3c; text-shadow: 0 0 8px rgba(255, 120, 40, .8); font-variant-numeric: tabular-nums; }
.slot-led.win b { color: #ffe066; text-shadow: 0 0 8px rgba(255, 210, 60, .9); }

.slot-result { min-height: 26px; text-align: center; color: #fff4e0; font-weight: 800; }
.slot-result.win { color: #ffd36b; font-family: var(--font-head); font-size: 22px; text-shadow: 0 0 12px rgba(255, 160, 60, .7); }
.slot-result.big { animation: big-win .5s ease-in-out 4; }
@keyframes big-win { 50% { transform: scale(1.12); } }
.slot-controls { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.slot-bet { display: flex; gap: 6px; }
.slot-key { min-width: 42px; height: 42px; padding: 0 10px; border: 0; border-radius: 10px; font: inherit; font-weight: 900; font-size: 20px; color: #fff4e0; cursor: pointer;
  background: linear-gradient(#7a2a1a, #4a140c); box-shadow: 0 4px 0 #240704, inset 0 1px 0 rgba(255, 255, 255, .25); }
.slot-key.wide { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.slot-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #240704; }
.spin-btn { width: 96px; height: 96px; margin: -10px 0 -4px; border: 0; border-radius: 50%; cursor: pointer; font: inherit; font-weight: 900; font-size: 19px; letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: radial-gradient(circle at 38% 30%, #ff9b8a, #e3202f 45%, #8a0a14); box-shadow: 0 0 0 5px #c9963e, 0 0 0 7px #6b4413, 0 7px 0 7px #4a2a0a, 0 12px 20px rgba(0, 0, 0, .5); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.spin-btn:hover { filter: brightness(1.08); }
.spin-btn:active, .spin-btn:disabled { transform: translateY(4px); box-shadow: 0 0 0 5px #c9963e, 0 0 0 7px #6b4413, 0 3px 0 7px #4a2a0a, 0 6px 10px rgba(0, 0, 0, .5); }
.spin-btn:disabled { filter: saturate(.6) brightness(.85); cursor: default; }
.slot-tray { height: 26px; margin: 0 18% 0; border-radius: 0 0 14px 14px; background: linear-gradient(#0b0605, #2a1410); box-shadow: inset 0 6px 8px rgba(0, 0, 0, .8), 0 0 0 3px #c9963e; }
/* On a laptop screen the whole cabinet, Spin button included, fits without scrolling: the reels shrink
   with the window's height, and the marquee and button get a little smaller. */
@media (min-width: 761px) and (max-height: 940px) {
  .slots { --row: clamp(56px, calc((100dvh - 600px) / 3), 84px); gap: 10px; padding-top: 0; }
  .slot-machine { gap: 8px; }
  .slot-marquee { padding: 10px 12px 8px; }
  .slot-title { font-size: 24px; }
  .slot-title .logo-mark { width: 24px; height: 24px; }
  .spin-btn { width: 80px; height: 80px; font-size: 16px; }
  .slot-tray { height: 16px; }
}

/* The lever, on the right of the cabinet. */
.slot-lever { position: absolute; right: 0; top: 34%; width: 40px; height: 170px; padding: 0; border: 0; background: none; cursor: pointer; }
.slot-lever:disabled { cursor: default; }
.lever-base { position: absolute; left: 0; bottom: 0; width: 24px; height: 46px; border-radius: 6px 12px 12px 6px; background: linear-gradient(90deg, #6b7076, #e7e9eb 45%, #7d8287); box-shadow: 0 3px 6px rgba(0, 0, 0, .4); }
.lever-arm { position: absolute; left: 14px; bottom: 30px; width: 8px; height: 130px; border-radius: 4px; transform-origin: 50% 100%;
  background: linear-gradient(90deg, #8d9298, #f4f5f6 45%, #6b7076); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.lever-ball { position: absolute; left: 50%; top: -14px; width: 30px; height: 30px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9b8a, #e3202f 50%, #7a0612); box-shadow: 0 3px 6px rgba(0, 0, 0, .45); }
.slot-lever.pulled .lever-arm { animation: lever-pull .7s cubic-bezier(.3, .7, .4, 1); }
@keyframes lever-pull { 35% { transform: scaleY(-.55); } }
@media (prefers-reduced-motion: reduce) { .slot-bulbs i { animation: none; } .slot-lever.pulled .lever-arm { animation: none; } }

.paytable { width: min(100%, 460px); background: var(--surface); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); }
.paytable summary { cursor: pointer; font-weight: 800; }
.pays { width: 100%; border-collapse: collapse; margin-top: 8px; }
.pays td { padding: 4px 0; }
.pays .sym { display: inline-block; width: 30px; height: 30px; vertical-align: middle; }
.paytable p .sym { display: inline-block; width: 20px; height: 20px; vertical-align: -0.3em; }
.pays td:last-child { text-align: right; font-weight: 800; font-size: 16px; }

/* ---------- cases ---------- */
.cases { display: flex; flex-direction: column; gap: 14px; }
.cases-nav { display: flex; gap: 6px; }
.seg { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-weight: 800; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--text-strong); color: var(--bg); border-color: var(--text-strong); }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.case-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px 14px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.case-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.case-art { width: 160px; height: 110px; }
.case-weapon { position: absolute; top: 58px; left: 50%; width: 150px; transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); }
.case-card b { font-family: var(--font-head); font-size: 18px; color: var(--text-strong); margin-top: 6px; }
.case-price { font-weight: 800; color: var(--accent-text); }
.skin-art { display: block; width: 100%; height: auto; }

.case-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.case-head h3 { margin: 0; flex: 1; font-family: var(--font-head); font-size: 22px; color: var(--text-strong); }
.open-btn { padding: 12px 22px; font-size: 16px; }
.open-btn:disabled { opacity: .6; }
.case-reel { position: relative; overflow: hidden; border-radius: var(--radius); background: #15100d; padding: 12px 0; box-shadow: inset 0 0 30px rgba(0, 0, 0, .7); }
.case-reel::before, .case-reel::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18%; z-index: 1; pointer-events: none; }
.case-reel::before { left: 0; background: linear-gradient(90deg, #15100d, transparent); }
.case-reel::after { right: 0; background: linear-gradient(-90deg, #15100d, transparent); }
.case-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); background: #ffd36b; box-shadow: 0 0 12px #ffb04f; z-index: 2; }
.case-marker::before, .case-marker::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 9px solid transparent; }
.case-marker::before { top: 0; border-top-color: #ffd36b; }
.case-marker::after { bottom: 0; border-bottom-color: #ffd36b; }
.case-strip { display: flex; gap: 8px; width: max-content; will-change: transform; }
.case-strip .item-tile { width: 150px; flex: none; }
.case-strip .item-tile.landed { box-shadow: 0 0 0 3px var(--rarity), 0 0 30px var(--rarity); }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px; border-radius: 12px; overflow: hidden; color: #fbf4ec; text-align: left;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--rarity) 30%, #2e241d), #1c1612 75%); border-bottom: 4px solid var(--rarity); }
.item-art { height: 84px; display: grid; place-items: center; }
.item-art .skin-art { max-height: 82px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.rare-mark { font-size: 46px; color: #ffd36b; text-shadow: 0 0 18px rgba(255, 196, 70, .8); }
.item-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.item-name span { color: rgba(251, 244, 236, .7); }
.item-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-value, .item-meta { color: rgba(251, 244, 236, .75) !important; }
.case-contents { display: flex; flex-direction: column; gap: 14px; }
.case-group h4 { margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--rarity); color: var(--text-strong); }

.drop { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: var(--radius); color: #fbf4ec;
  background: radial-gradient(ellipse at 25% 50%, color-mix(in srgb, var(--rarity) 45%, #2e241d), #1c1612 75%); box-shadow: 0 0 0 2px var(--rarity), 0 0 40px color-mix(in srgb, var(--rarity) 50%, transparent);
  animation: drop-in .5s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes drop-in { from { transform: scale(.85); opacity: 0; } }
.drop-art { width: 46%; max-width: 280px; flex: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.drop-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.drop-info h3 { margin: 0; font-family: var(--font-head); font-size: 22px; color: #fbf4ec; }
#cases-main { display: flex; flex-direction: column; gap: 14px; }
#case-drop:empty { display: none; }
.drop-info .muted { color: rgba(251, 244, 236, .7); }
.drop-rarity { color: var(--rarity); font-weight: 900; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; filter: brightness(1.3); }
.drop-value { font-weight: 900; font-size: 18px; color: #ffd36b; }
.stattrak { color: #f08a4b; font-weight: 900; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
#case-drop { margin-bottom: 8px; }
.drop-modal { max-width: 560px; }

.inv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.inv-head > span { flex: 1; }
.inv-head select { font: inherit; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--surface); color: var(--text); }
.inv-item { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; text-align: left; border-radius: 12px; transition: transform .12s; }
.inv-item:hover { transform: translateY(-2px); }
.empty-inv { text-align: center; padding: 40px 10px; }
.inv-types { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip-filter { border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip-filter span { color: var(--muted); font-weight: 700; margin-left: 2px; }
.chip-filter[aria-pressed="true"] { background: var(--text-strong); color: var(--bg); border-color: var(--text-strong); }
.chip-filter[aria-pressed="true"] span { color: inherit; opacity: .7; }
.inv-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.inv-filters select { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--surface); color: var(--text); }
.inv-filters #inv-sort { margin-left: auto; }
.inv-st { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; }
.inv-st input { width: auto; margin: 0; }
.inv-pick-btn { padding: 6px 14px; }
.inv-pick-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.inv-item { position: relative; }
.pick-mark { display: none; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); background: rgba(0, 0, 0, .35); }
.inv.picking .pick-mark { display: block; }
.inv-item.picked .pick-mark { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6 11-11-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center / 16px no-repeat; border-color: var(--accent); }
.inv-item.picked .item-tile { box-shadow: 0 0 0 3px var(--accent); }
.inv.picking .inv-item:not(.picked) .item-tile { opacity: .8; }
.sell-bar { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 16px;
  background: var(--surface); box-shadow: 0 -4px 20px rgba(0, 0, 0, .15), 0 0 0 1px var(--line); }
.sell-bar > span { flex: 1; color: var(--text-strong); }
.sell-bar .btn:disabled { opacity: .5; }

/* ---------- locks ---------- */
.btn:has(> .lock-icon) { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; }
.lock-icon { width: 15px; height: 15px; fill: currentColor; vertical-align: -2px; margin-right: 5px; }
.lock-mark { position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #ffd86b; }
.lock-mark .lock-icon { margin: 0; width: 13px; height: 13px; }
.inv-item:has(.lock-mark) .item-tile { box-shadow: inset 0 0 0 2px rgba(255, 216, 107, .55); }
.lock-note { text-align: center; margin: 8px 0 0; }

/* ---------- today's top pulls ---------- */
.top-pulls { margin-top: 22px; }
.top-pulls h4 { margin: 0 0 10px; }
.pull-row { display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.pull { display: flex; flex-direction: column; gap: 6px; scroll-snap-align: start; }
.pull-who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; min-width: 0; }
.pull-who > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pull-rank { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 11px; font-weight: 900; color: var(--muted); }
.pull:first-child .pull-rank { background: #c98a12; color: #fff; }

/* ---------- trade up ---------- */
.tradeup h4 { margin: 18px 0 10px; }
.contract { padding: 16px; border-radius: 18px; background: var(--surface-2); }
.contract-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.contract-head h3 { margin: 0 0 4px; }
.contract-head p { margin: 0; max-width: 520px; }
.contract-go { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contract-go > b { font-size: 20px; font-variant-numeric: tabular-nums; }
.contract-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.contract-slot { position: relative; border: 0; padding: 0; background: none; font: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.contract-slot.empty { display: grid; place-items: center; min-height: 150px; border: 2px dashed var(--line); color: var(--muted); font-size: 28px; cursor: default; }
.slot-x { position: absolute; top: 6px; right: 8px; color: #fff; font-size: 18px; font-weight: 900; opacity: .7; }
.contract-slot:hover .slot-x { opacity: 1; }
.contract-float { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.contract-float b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.contract-float .float-bar { flex: 1; min-width: 140px; }
.outcomes .item-tile { padding-bottom: 10px; }
.trade-result { margin-bottom: 16px; text-align: center; }
.reveal { animation: reveal .7s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes reveal { from { transform: scale(.85); opacity: 0; filter: brightness(2.2); } }

/* ---------- upgrader ---------- */
.up-stage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: 18px; background: var(--surface-2); }
.up-side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.up-empty { display: grid; place-items: center; width: 100%; max-width: 200px; min-height: 120px; padding: 10px; border-radius: 12px; border: 2px dashed var(--line); color: var(--muted); font-size: 14px; }
.up-target { width: 100%; max-width: 200px; }
.up-mini { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 260px; }
.up-chip { width: 58px; height: 42px; padding: 3px; border: 0; border-radius: 8px; cursor: pointer; background: #241a14; box-shadow: inset 0 -3px 0 var(--rarity); }
.up-chip svg { width: 100%; height: 100%; }
.up-dial { position: relative; width: 200px; aspect-ratio: 1; }
.up-dial svg { width: 100%; height: 100%; }
.dial-track { fill: none; stroke: var(--line); stroke-width: 12; }
.dial-chance { fill: none; stroke: #3fbf6a; stroke-width: 12; stroke-linecap: butt; }
.up-dial.won .dial-chance { filter: drop-shadow(0 0 6px #3fbf6a); }
.up-dial.lost .dial-track { stroke: #c9473a; }
.dial-needle { position: absolute; inset: 0; pointer-events: none; }
.dial-needle i { position: absolute; left: calc(50% - 2px); top: 2px; width: 4px; height: 26px; border-radius: 2px; background: var(--text-strong); box-shadow: 0 0 0 2px var(--surface-2); }
.dial-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial-text b { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.up-dial.won .dial-text b { color: #3fbf6a; }
.up-dial.lost .dial-text b { color: #c9473a; }
.up-go { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 14px 0 4px; text-align: center; }
.up-go .btn { min-width: 180px; }
.up-go p { margin: 0; max-width: 560px; }
.up-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.up-pickers h4 { margin: 8px 0 10px; }
.up-pickers .inv-filters { margin-bottom: 10px; }
.up-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 520px; overflow-y: auto; padding: 4px; }
.up-grid .inv-item.picked .pick-mark { display: block; }

/* ---------- leaderboard ---------- */
.leaders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leaders li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); }
.leader-rank { width: 22px; text-align: center; font-weight: 900; color: var(--muted); }
.leaders li:first-child .leader-rank { color: #c98a12; }
.leader-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-chips { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-variant-numeric: tabular-nums; }
.leader-tabs { display: flex; gap: 4px; margin: 4px 0 2px; }
.leader-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.leader-tabs button:hover { background: var(--hover); color: var(--text-strong); }
.leader-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text-strong); box-shadow: 0 0 0 2px var(--accent); }
.leader-name b, .leader-name > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.float-leaders li { gap: 8px; }
.leader-skin { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.leader-art { flex: none; width: 64px; height: 40px; display: grid; place-items: center; border-radius: 8px; border-bottom: 3px solid var(--rarity);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rarity) 30%, transparent), transparent 70%); }
.leader-art svg { width: 100%; height: 100%; }
.leader-float { flex: none; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; justify-items: end; line-height: 1.15; }
.leader-float .avatar { grid-row: 1 / 3; }
.leader-float b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-variant-numeric: tabular-nums; }
.leader-float .small { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buyin-amount { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-head); font-size: 28px; color: var(--text-strong); }
#buyin { width: 100%; accent-color: var(--accent); }

/* ---------- the others at the fire, on their slots ---------- */
.slot-neighbors { width: min(100%, 760px); }
.slot-neighbors h4 { margin: 4px 0 8px; text-align: center; }
.mini-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mini-slot { width: 150px; padding: 8px 8px 7px; border-radius: 14px; background: linear-gradient(#5a1d12, #2b0f0a); color: #fbe9d4;
  box-shadow: inset 0 0 0 2px #c98a12, 0 3px 10px rgba(0, 0, 0, .25); transition: box-shadow .3s; }
.mini-slot.won { box-shadow: inset 0 0 0 2px #ffd86b, 0 0 14px rgba(255, 196, 80, .55); }
.mini-slot.big { animation: mini-glow .6s ease-in-out 3; }
@keyframes mini-glow { 50% { box-shadow: inset 0 0 0 2px #fff3c4, 0 0 26px rgba(255, 210, 90, .9); } }
.mini-who { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; margin-bottom: 6px; }
.mini-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-window { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; height: 90px; padding: 3px; border-radius: 8px; background: #fbf4ea; overflow: hidden; }
.mini-reel { display: flex; flex-direction: column; overflow: hidden; border-radius: 4px; background: #fff; }
.mini-reel .ms { flex: none; height: 28px; display: grid; place-items: center; }
.mini-reel .ms svg { width: 22px; height: 22px; }
.mini-reel .ms.hit { background: rgba(255, 196, 80, .45); }
.mini-reel.spinning .ms { animation: mini-spin .18s linear infinite; filter: blur(1.2px); }
@keyframes mini-spin { to { transform: translateY(-28px); } }
.mini-result { margin-top: 5px; text-align: center; color: #f4d9b8; font-variant-numeric: tabular-nums; }
.mini-win { color: #ffd86b; }
@media (prefers-reduced-motion: reduce) { .mini-reel.spinning .ms { animation: none; } }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .casino-view .stage-head { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .casino-view .stage-head h1 { font-size: 20px; }
  .casino-top { padding: 10px 14px 2px; gap: 8px; flex-wrap: nowrap; }
  .casino-top .chip-icon:not(.sm) { width: 24px; height: 24px; }
  #casino-free { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .chip-text b { font-size: 22px; }
  .casino-tabs { padding: 6px 12px; }
  .casino-tabs button { padding: 8px 11px; }
  .contract-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contract-slot.empty { min-height: 110px; }
  .up-stage { grid-template-columns: 1fr 1fr; padding: 12px; gap: 12px; }
  .up-stage .up-dial { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: 170px; }
  .up-pickers { grid-template-columns: 1fr; }
  .up-grid { max-height: 380px; }
  .pull-row { grid-auto-columns: 140px; }
  .leader-art { width: 48px; height: 32px; }
  .leader-float b { font-size: 11px; }
  .casino-body { padding: 4px 12px 8px; }
  .casino-note { padding: 4px 12px 8px; }
  .poker-stage { padding: 30px 30px 52px; }
  .poker-table { aspect-ratio: 1 / 1.3; }
  .poker-felt { inset: 8% 10%; border-width: 10px; border-radius: 46% / 32%; }
  .poker-board { gap: 3px; }
  .poker-board .pcard { --w: clamp(30px, 10cqw, 46px); }
  .p-seat { width: 92px; }
  .p-plate { min-width: 0; padding: 3px 9px 3px 3px; gap: 6px; }
  .p-avatar { width: 24px; height: 24px; font-size: 11px; }
  .p-name { max-width: 56px; font-size: 12px; }
  .p-cards { height: 34px; }
  .p-cards .pcard { --w: 26px; }
  .p-seat.me .p-cards .pcard { --w: 40px; }
  .p-bet { font-size: 11px; }
  .poker-moves .btn { min-width: 90px; padding: 11px 16px; }
  .poker-raise input[type="range"] { width: 100%; }
  .bj-table { min-height: 320px; border-radius: 30px 30px 140px 140px / 30px 30px 90px 90px; padding: 18px 10px 30px; }
  .bj-cards .pcard { --w: 48px; }
  .bj-cards .pcard + .pcard { margin-left: -16px; }
  .bet-chip { width: 40px; height: 40px; }
  .slots { --row: 66px; }
  .slot-cabinet { padding-right: 0; }
  .slot-lever { display: none; }
  .slot-machine { padding: 10px 10px 0; }
  .slot-title { font-size: 23px; }
  .slot-led b { font-size: 16px; }
  .spin-btn { width: 80px; height: 80px; font-size: 16px; }
  .slot-key { min-width: 38px; height: 38px; }
  .case-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .case-art { width: 130px; height: 90px; }
  .case-weapon { top: 50px; width: 118px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .case-strip .item-tile { width: 128px; }
  .drop { flex-direction: column; text-align: center; }
  .drop-art { width: 80%; }
  .drop-info { align-items: center; }
}

/* The collection book */
.book { display: flex; flex-direction: column; gap: 18px; }
.book-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.book-total { display: flex; align-items: center; gap: 10px; color: var(--text-strong); }
.book-total .book-bar { width: 180px; }
.book-bar { display: inline-block; width: 120px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; vertical-align: middle; }
.book-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffd36b); border-radius: inherit; }
.book-case h4 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; color: var(--text-strong); }
.book-done { font-size: 12px; font-weight: 800; color: #1c1612; background: #ffd36b; padding: 2px 8px; border-radius: 999px; }
.item-tile.missing { background: #1c1612; border-bottom-color: color-mix(in srgb, var(--rarity) 35%, #1c1612); }
.item-tile.missing .skin-art { filter: brightness(0) invert(1) opacity(.16); }
.item-tile.missing .rare-mark { color: #4a3d33; text-shadow: none; }
.item-tile.missing .item-name, .item-tile.missing .item-meta { opacity: .55; }
.drop-new { margin: 8px 0 0; font-weight: 800; color: var(--accent-text, var(--accent)); }
@media (max-width: 600px) {
  .book-total .book-bar { width: 110px; }
  .cases-nav { overflow-x: auto; scrollbar-width: none; }
  .cases-nav .seg { white-space: nowrap; flex: none; padding: 7px 12px; font-size: 14px; }
}

/* Opening several cases at once */
.count-pick { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.count-pick button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; padding: 8px 12px; cursor: pointer; }
.count-pick button + button { border-left: 1px solid var(--line); }
.count-pick button[aria-pressed="true"] { background: var(--text-strong); color: var(--bg); }
#case-reels:empty { display: none; }
#case-reels.multi { display: grid; gap: 8px; }
#case-reels.n10, #case-reels.n20 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
#case-reels.multi .case-reel { padding: 6px 0; }
#case-reels.multi .case-strip { gap: 6px; }
#case-reels.multi .case-strip .item-tile { width: 104px; padding: 6px 7px 8px; gap: 2px; border-bottom-width: 3px; }
#case-reels.multi .item-art { height: 46px; }
#case-reels.multi .item-art .skin-art { max-height: 44px; }
#case-reels.multi .rare-mark { font-size: 28px; }
#case-reels.multi .item-name { font-size: 11px; }
#case-reels.multi .item-name b { font-size: 12px; }
#case-reels.multi .case-marker::before, #case-reels.multi .case-marker::after { border-width: 6px; }
#case-reels.multi .case-strip .item-tile.landed { box-shadow: 0 0 0 2px var(--rarity), 0 0 16px var(--rarity); }
.drops { display: flex; flex-direction: column; gap: 12px; }
.drops-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; color: var(--text-strong); font-size: 17px; }
.drop-item { position: relative; }
.drop-item.sold { cursor: default; }
.drop-item.sold .item-tile { opacity: .45; filter: grayscale(.7); }
.new-mark { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: #1c1612; background: #ffd36b; padding: 2px 7px; border-radius: 999px; }
@media (max-width: 600px) {
  .count-pick { order: 3; width: 100%; justify-content: space-between; }
  .count-pick button { flex: 1; }
  #case-reels.n10, #case-reels.n20 { grid-template-columns: 1fr; }
  #case-reels.multi .case-strip .item-tile { width: 88px; }
}

/* Case battles */
.battles { display: flex; flex-direction: column; gap: 14px; }
.battles-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.battles-head h3 { margin: 0; font-family: var(--font-head); font-size: 22px; color: var(--text-strong); }
.battles-head p { margin: 2px 0 0; }
.battle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.battle-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.battle-card.started { opacity: .92; }
.battle-card-top { display: flex; align-items: baseline; gap: 8px; color: var(--text-strong); }
.battle-cost { margin-left: auto; font-weight: 900; color: var(--text-strong); }
.battle-cases, .battle-rounds { display: flex; gap: 6px; flex-wrap: wrap; }
.battle-case { position: relative; width: 54px; }
.battle-case .case-art { width: 100%; height: auto; display: block; }
.battle-case b { position: absolute; right: -2px; bottom: -2px; font-size: 11px; background: var(--text-strong); color: var(--bg); border-radius: 999px; padding: 1px 6px; }
.battle-rounds .battle-case { width: 46px; opacity: .45; transition: opacity .2s, transform .2s; }
.battle-rounds .battle-case.past { opacity: .25; }
.battle-rounds .battle-case.now { opacity: 1; transform: scale(1.15); }
.battle-seats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.b-seat { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 3px 8px 3px 3px; border-radius: 999px; background: var(--bg); color: var(--text-strong); font-weight: 700; }
.b-seat.open { padding: 3px; gap: 4px; border: 1px dashed var(--line); background: none; }
.b-seat.open .muted { padding: 0 8px; font-weight: 600; }
.b-av { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; background-size: cover; background-position: center; }
.bot-face { width: 28px; height: 28px; display: grid; place-items: center; font-size: 17px; border-radius: 50%; background: var(--line); }
.seat-x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.vs { font-weight: 900; font-size: 13px; color: var(--accent); letter-spacing: .06em; padding: 0 4px; }
.battle-card-actions:empty { display: none; }
.btn.small { padding: 6px 12px; font-size: 13px; }

.battle-modal .battle-make { display: flex; flex-direction: column; gap: 12px; }
.seg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.make-cases { display: flex; flex-direction: column; gap: 8px; }
.make-case { display: flex; align-items: center; gap: 12px; }
.make-case .case-art { width: 60px; height: auto; }
.make-case > div:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 18px; text-align: center; color: var(--text-strong); }
.stepper .icon-btn { font-size: 20px; font-weight: 800; }

.battle-view { display: flex; flex-direction: column; gap: 14px; }
.battle-view .case-head > .small { margin-left: auto; }
.b-cols { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.b-side { display: flex; justify-content: center; gap: 10px; flex: 1; min-width: 0; }
.b-cols.ffa .b-side { flex: none; }
.b-cols.ffa { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 340px)); }
.b-cols.ffa.n2 { --cols: 2; } .b-cols.ffa.n3 { --cols: 3; } .b-cols.ffa.n4 { --cols: 4; }
.b-cols.ffa .vs { display: none; }
.b-cols.ffa .b-side { display: contents; }
.b-cols .vs { align-self: center; }
.b-col { flex: 1; min-width: 0; max-width: 340px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: opacity .3s, box-shadow .3s; }
.b-col.won { box-shadow: 0 0 0 3px #ffd36b, 0 0 26px rgba(255, 196, 70, .45); }
.b-col.lost { opacity: .55; }
.b-who { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-strong); }
.b-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-total { font-weight: 900; font-size: 18px; color: var(--text-strong); }
.vreel { position: relative; height: 200px; overflow: hidden; border-radius: 12px; background: #15100d; box-shadow: inset 0 0 24px rgba(0, 0, 0, .7); }
.vreel::before, .vreel::after { content: ""; position: absolute; left: 0; right: 0; height: 26%; z-index: 1; pointer-events: none; }
.vreel::before { top: 0; background: linear-gradient(#15100d, transparent); }
.vreel::after { bottom: 0; background: linear-gradient(0deg, #15100d, transparent); }
.vstrip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px; will-change: transform; }
.vstrip:has(> :only-child) { height: 100%; justify-content: center; }
.vstrip .item-tile { width: min(100%, 200px); height: 118px; flex: none; padding: 6px 8px 8px; }
.vstrip .item-art { height: 60px; }
.vstrip .item-art .skin-art { max-height: 58px; }
.vstrip .rare-mark { font-size: 34px; }
.vstrip .item-name { font-size: 11px; }
.vstrip .item-name b { font-size: 12px; }
.vmarker { position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: #ffd36b; box-shadow: 0 0 12px #ffb04f; z-index: 2; }
.b-result { text-align: center; font-weight: 900; color: var(--text-strong); }
.b-col.won .b-result { color: var(--accent-text, var(--accent)); }
.b-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.b-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 8px; background: #1c1612; border-bottom: 3px solid var(--rarity); color: #fbf4ec; font-size: 11px; font-weight: 800; }
.b-item .skin-art { width: 100%; height: 26px; }
.battle-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); color: var(--text-strong); }
@media (max-width: 600px) {
  .b-cols, .b-side { gap: 6px; }
  .b-cols.\32v2 { flex-direction: column; }
  .b-col { padding: 6px; gap: 6px; }
  .b-who .b-av, .b-who .bot-face { display: none; }
  .b-who b { font-size: 13px; }
  .b-total { font-size: 15px; }
  .vreel { height: 160px; }
  .vstrip { padding: 0 3px; }
  .vstrip .item-tile { height: 96px; padding: 4px 5px 6px; }
  .vstrip .item-art { height: 46px; }
  .vstrip .item-art .skin-art { max-height: 44px; }
  .vstrip .item-name span { display: none; }
  .b-items { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
}

/* Floats, to 14 places like CS */
.item-float { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: rgba(251, 244, 236, .82); font-variant-numeric: tabular-nums; }
.item-float span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item-float b { flex: none; font-family: var(--font-body, inherit); font-weight: 900; color: #fbf4ec; }
.drop-float { font: 600 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: rgba(251, 244, 236, .8); }
.drop-float b { color: #fbf4ec; }
.float-bar { position: relative; display: block; width: min(100%, 260px); height: 6px; margin: 4px 0 2px; border-radius: 3px;
  background: linear-gradient(90deg, #3fb37f 0 7%, #8fcf5a 7% 15%, #e8c94a 15% 38%, #ee8a3c 38% 45%, #e0533e 45%); }
.float-bar i { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: #fbf4ec; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.vstrip .item-float { font-size: 10px; }
