/* The casino (js/casino.js): a casino room's tables, machine and cases. Felt and cards keep their
   colours in both themes; everything around them follows Glød. */

/* ---------- the room: the casino and its chat ---------- */
.casino { display: none; }
.chat.casino-room .casino { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat.casino-room[data-casino="floor"] .messages-wrap,
.chat.casino-room[data-casino="floor"] .composer-wrap { display: none; }
.chat.casino-room[data-casino="chat"] .casino { display: none; }

.casino-switch { display: flex; flex: none; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.casino-switch button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.casino-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow); }

/* Wide enough: the casino with the room's chat beside it. */
@media (min-width: 1280px) {
  .chat.casino-room { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 28%); grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
  .chat.casino-room > .chat-header { grid-column: 1 / -1; grid-row: 1; }
  .chat.casino-room > .voice-pill { grid-column: 1 / -1; grid-row: 2; }
  .chat.casino-room > .call-bar { grid-column: 1 / -1; grid-row: 3; }
  .chat.casino-room .casino { display: flex !important; grid-column: 1; grid-row: 4 / 6; border-right: 1px solid var(--line); }
  .chat.casino-room .messages-wrap { display: flex !important; grid-column: 2; grid-row: 4; }
  .chat.casino-room .composer-wrap { display: block !important; grid-column: 2; grid-row: 5; padding: 0 14px 14px; }
  .chat.casino-room .messages { padding-left: 4px; padding-right: 4px; }
  .casino-switch { display: none !important; }
}

.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-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-amount { font-family: var(--font-head); font-size: 22px; color: var(--text-strong); min-width: 80px; text-align: center; }

/* ---------- slots ---------- */
.slots { --row: 84px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.slot-machine { width: min(100%, 460px); border-radius: 30px; padding: 16px 18px 18px; background: linear-gradient(160deg, #e2501d, #a8331c 55%, #6a1f12);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -6px 0 rgba(0, 0, 0, .25), 0 20px 40px rgba(60, 20, 8, .35); display: flex; flex-direction: column; gap: 12px; }
.slot-marquee { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border-radius: 16px; background: #1f1813; color: #ffd36b;
  font-family: var(--font-head); font-size: 26px; text-shadow: 0 0 12px rgba(255, 196, 107, .7); }
.slot-marquee .logo-mark { width: 30px; height: 30px; }
.slot-lights { position: absolute; inset: 4px; border-radius: 13px; pointer-events: none; border: 3px dotted rgba(255, 211, 107, .55); animation: lights 1.2s steps(2) infinite; }
@keyframes lights { 50% { border-color: rgba(255, 140, 70, .7); } }
.slot-window { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 18px; background: #1f1813; box-shadow: inset 0 4px 12px rgba(0, 0, 0, .6); }
.slot-reel { height: calc(var(--row) * 3); overflow: hidden; border-radius: 10px; background: linear-gradient(#e9dfcf, #fffaf1 20%, #fffaf1 80%, #e9dfcf); position: relative; }
.slot-reel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .28), transparent 22%, transparent 78%, rgba(0, 0, 0, .28)); }
.slot-strip { display: flex; flex-direction: column; will-change: transform; }
.slot-sym { height: var(--row); flex: none; display: grid; place-items: center; font-size: calc(var(--row) * .54); line-height: 1; }
.slot-sym.hit { animation: sym-hit .7s ease-in-out 3; background: radial-gradient(circle, rgba(255, 211, 107, .75), transparent 70%); }
@keyframes sym-hit { 50% { transform: scale(1.14); } }
.sym-seven { font-family: var(--font-head); font-weight: 600; color: #c0262d; font-size: calc(var(--row) * .72); text-shadow: 2px 2px 0 #ffd36b, 3px 3px 0 #6a1f12; }
.sym-flame { width: calc(var(--row) * .62); height: calc(var(--row) * .62); border-radius: 14px; box-shadow: 0 0 14px rgba(255, 140, 70, .7); }
.slot-lines { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); pointer-events: none; overflow: visible; }
.slot-lines polyline { fill: none; stroke: #ffd36b; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .85; filter: drop-shadow(0 0 4px rgba(255, 140, 70, .9)); vector-effect: non-scaling-stroke; }
.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; }
.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: 14px; justify-content: space-between; }
.slot-bet { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 4px; color: #fff; }
.slot-bet > span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 70px; }
.slot-bet .muted { color: rgba(255, 255, 255, .65); }
.slot-bet .icon-btn { color: #fff; width: 36px; height: 36px; font-size: 22px; font-weight: 800; background: rgba(255, 255, 255, .12); border-radius: 50%; }
.spin-btn { flex: 1; max-width: 200px; padding: 14px 20px; font-size: 18px; letter-spacing: .04em; background: linear-gradient(#ffd36b, #e0962f); color: #3a1a08; box-shadow: 0 4px 0 #9a5a14, 0 8px 16px rgba(0, 0, 0, .3); }
.spin-btn:hover { background: linear-gradient(#ffe29a, #f0a63f); }
.spin-btn:disabled { opacity: .7; transform: translateY(3px); box-shadow: 0 1px 0 #9a5a14; }
.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; font-size: 22px; }
.pays td:last-child { text-align: right; font-weight: 800; font-size: 16px; }
.pays .sym-seven { font-size: 26px; text-shadow: 1px 1px 0 #ffd36b; }
.pays .sym-flame, .paytable p .sym-flame { width: 22px; height: 22px; border-radius: 6px; vertical-align: -0.25em; box-shadow: none; }

/* ---------- 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: 70px; display: grid; place-items: center; }
.item-art .skin-art { max-height: 66px; 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; }

/* ---------- 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; }
.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); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .chat.casino-room .chat-title { display: none; }
  .chat.casino-room .casino-switch { margin-right: auto; }
  .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-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-marquee { font-size: 21px; }
  .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; }
}
