/* Tin Patti in the MIT look: midnight glass, violet -> pink, mint, gold only for money and the winner.
   Everything except the mascots and the room behind is drawn here, so it stays sharp on any screen. */

:root {
  --midnight: #0b0b1a;
  --deep: #14123a;
  --card: #1d1850;
  --violet: #8e6bff;
  --pink: #ff4fa3;
  --gold: #ffc83d;
  --mint: #27e3a1;
  --danger: #ff4d5e;
  --text: #ffffff;
  --soft: #b9aeff;
  --grad: linear-gradient(135deg, #8e6bff, #ff4fa3);
  --a: #ff4fa3;
  --b: #27e3a1;
  --c: #9d7bff;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--midnight); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { fill: currentColor; }

.game-viewport { position: relative; width: 100%; max-width: 480px; height: 100%; height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 11, 26, .18) 0%, rgba(11, 11, 26, .35) 45%, rgba(11, 11, 26, .88) 100%),
    var(--midnight); }

/* slow coloured light drifting behind everything */
.aurora { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; width: 70%; height: 36%; border-radius: 50%; filter: blur(48px); opacity: .34; animation: drift 11s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: var(--violet); left: -22%; top: 8%; }
.aurora i:nth-child(2) { background: var(--pink); right: -26%; top: 30%; animation-duration: 14s; }
.aurora i:nth-child(3) { background: var(--mint); left: 10%; bottom: 6%; opacity: .18; animation-duration: 17s; }
@keyframes drift { to { transform: translate3d(12%, 8%, 0) scale(1.15); } }

.glass { background: linear-gradient(160deg, rgba(62, 48, 128, .62), rgba(20, 18, 58, .72)); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 18px rgba(0, 0, 0, .35); }

/* ---------------------------------------------------------------- header */
.game-header { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 4px; }
.user-capsule { display: flex; align-items: center; gap: 7px; padding: 3px 4px 3px 3px; border-radius: 999px; min-width: 0; }
.avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--violet); background: var(--card); }
.user-details { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.user-name { font-size: 11.5px; font-weight: 800; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-id { font-size: 9px; color: var(--soft); white-space: nowrap; }
.btn-topup { font-size: 10px; font-weight: 800; padding: 6px 9px; border-radius: 999px; background: linear-gradient(135deg, #ffd666, #ff9d2e); color: #3a1c00; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 6px; }
.pill { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pill svg { width: 14px; height: 14px; color: var(--mint); }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; }
#btnRanking svg { color: var(--gold); }

/* ---------------------------------------------------------------- brand + timer */
.game-content { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.brand { text-align: center; line-height: 1; padding-top: 2px; }
.brand-logo { height: clamp(34px, 7.2vh, 66px); width: auto; display: block; margin: 0 auto -2px; filter: drop-shadow(0 4px 14px rgba(142, 107, 255, .55)); }
.brand-title { font-size: clamp(20px, 3.9vh, 32px); font-weight: 900; letter-spacing: 3px; font-style: italic;
  background: linear-gradient(180deg, #fff 20%, #ffd9ef 45%, #ff6bb5 70%, #a98bff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 20, 110, .9)) drop-shadow(0 0 16px rgba(255, 79, 163, .55)); }
.brand-sub { font-size: 10.5px; color: var(--soft); margin-top: 3px; }
.brand-sub b { color: var(--gold); }

.counter-area { display: flex; align-items: center; justify-content: center; height: clamp(46px, 8vh, 64px); }
.timer-circle { --p: 1; position: relative; width: clamp(42px, 7vh, 56px); aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: clamp(16px, 2.6vh, 21px); font-weight: 900; font-variant-numeric: tabular-nums; z-index: 0; isolation: isolate; }
.timer-circle::before { content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -2;
  background: conic-gradient(var(--mint) 0turn, var(--violet) calc(var(--p) * .5turn), var(--pink) calc(var(--p) * 1turn), rgba(255, 255, 255, .14) 0);
  box-shadow: 0 0 22px rgba(142, 107, 255, .7); }
.timer-circle::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; z-index: -1; background: radial-gradient(circle at 50% 30%, #35277e, #120f33 75%); }
.timer-circle.is-low { color: #ffb3c0; animation: tick 1s ease-in-out infinite; }
@keyframes tick { 50% { transform: scale(1.09); } }
.phase-label { font-size: 15px; font-weight: 900; letter-spacing: .5px; padding: 8px 20px; border-radius: 999px; background: var(--grad); box-shadow: 0 0 24px rgba(255, 79, 163, .6); }

/* ---------------------------------------------------------------- table and the three seats */
.stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: flex-end; padding: 0 6px 4px; }
/* the table's far edge runs under the paws, so the three sit at it */
.table-felt { position: absolute; z-index: 1; left: -22%; right: -22%; top: calc(var(--mascot-h) - 20px); height: 62vh; border-radius: 50% 50% 0 0 / 74px 74px 0 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 28%, #4a2f9e 0%, #2a1a68 45%, #150f3c 78%);
  border: 3px solid rgba(255, 255, 255, .14);
  box-shadow: 0 -4px 0 2px #1b1247, 0 -7px 0 2px var(--pink), 0 -10px 30px 6px rgba(255, 79, 163, .6), inset 0 12px 40px rgba(39, 227, 161, .2); }
.seats { --mascot-h: clamp(96px, 22vh, 184px); position: relative; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; align-items: end; }

.seat { --seat: var(--a); position: relative; isolation: auto; display: flex; flex-direction: column; align-items: center; cursor: pointer; min-width: 0;
}
.seat > div { transition: filter .3s ease, translate .25s cubic-bezier(.2, 1.4, .4, 1), scale .18s ease; }
.seat-b { --seat: var(--b); }
.seat-c { --seat: var(--c); }
.seat:active .pot-box { scale: .96; }

.mascot-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
.halo { position: absolute; width: 86%; aspect-ratio: 1; top: 4%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--seat) 55%, transparent) 0%, transparent 68%); }
.mascot { position: relative; width: auto; max-width: 112%; height: var(--mascot-h); object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .55)); animation: breathe 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.seat-b .mascot { animation-delay: -1.2s; }
.seat-c .mascot { animation-delay: -2.4s; }
@keyframes breathe { 50% { transform: translateY(-3px) scale(1.015); } }
.seat-badge { position: relative; z-index: 3; flex: none; margin-top: -17px; width: 23px; height: 23px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #14092c; background: var(--seat); border: 2px solid #fff;
  box-shadow: 0 0 12px var(--seat); }

/* the three dealt cards */
.card-item { position: relative; z-index: 2; width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.card-flipper { width: 100%; display: flex; justify-content: center; }
.hand { --w: clamp(30px, 9.6vw, 42px); display: flex; justify-content: center; height: calc(var(--w) * 1.5); perspective: 600px; }
.pcard { --r: 0deg; position: relative; width: var(--w); height: calc(var(--w) * 1.42); border-radius: calc(var(--w) * .16); flex: none;
  transform: rotate(var(--r)); transform-origin: 50% 120%; box-shadow: 0 3px 8px rgba(0, 0, 0, .55);
  background: linear-gradient(160deg, #ffffff, #efe9ff); }
.pcard + .pcard { margin-left: calc(var(--w) * -.34); }
.pcard:nth-child(1) { --r: -10deg; }
.pcard:nth-child(3) { --r: 10deg; }
.pcard.is-red { color: #e0245e; }
.pcard.is-black { color: #1c1446; }
.pcard-corner { position: absolute; left: 7%; top: 4%; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pcard-corner b { font-size: calc(var(--w) * .36); font-weight: 900; letter-spacing: -.5px; }
.pip-small { width: calc(var(--w) * .22); height: calc(var(--w) * .22); }
.pip-big { position: absolute; right: 9%; bottom: 8%; width: 56%; height: auto; }
.pip-crown { position: absolute; right: 14%; top: 24%; width: 44%; height: auto; color: var(--gold); }
.pcard.is-back { background: linear-gradient(145deg, #5b39c4, #b23aa0 55%, #ff4fa3); border: 2px solid #ffffff; }
.pcard-mark { position: absolute; inset: 3px; border-radius: calc(var(--w) * .11); border: 1px solid rgba(255, 255, 255, .55);
  background: url("../assets/brand/logo.webp") center / 94% no-repeat, radial-gradient(circle, #1d1850 0 62%, #120d38 100%); }
.card-flipper.flipped .pcard { animation: turn .5s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.card-flipper.flipped .pcard:nth-child(2) { animation-delay: .08s; }
.card-flipper.flipped .pcard:nth-child(3) { animation-delay: .16s; }
@keyframes turn { from { transform: rotate(var(--r)) rotateY(92deg) translateY(-10px); } to { transform: rotate(var(--r)); } }
.hand-name { height: 15px; margin-top: -7px; z-index: 2; font-size: 9px; font-weight: 900; letter-spacing: .3px; padding: 0 7px; line-height: 15px; border-radius: 999px;
  background: rgba(11, 11, 26, .88); border: 1px solid var(--seat); white-space: nowrap; }
.hand-name:empty { visibility: hidden; }

.pot-box { position: relative; z-index: 2; width: 100%; margin-top: 6px; padding: 6px 4px 5px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: linear-gradient(180deg, rgba(46, 34, 104, .92), rgba(16, 12, 44, .95)); border: 1.5px solid color-mix(in srgb, var(--seat) 75%, transparent);
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--seat) 28%, transparent), 0 5px 12px rgba(0, 0, 0, .4); }
.pot-label { font-size: 8.5px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: 1.2px; }
.pot-value { font-size: clamp(15px, 2.4vh, 19px); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.you-badge { margin-top: 2px; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); transition: opacity .15s ease; }
.you-badge b { color: var(--gold); font-variant-numeric: tabular-nums; }
.you-badge.is-pending { opacity: .55; background: rgba(255, 255, 255, .18); }
.you-badge.is-pending b { color: #ffe38a; }
.seat.is-pending .pot-box::after { content: ""; position: absolute; top: -6px; right: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255, 255, 255, .65); border: 1.5px solid rgba(255, 255, 255, .95); opacity: .55; pointer-events: none; }
.balance-text.is-arriving { font-size: 11px; color: #ffe38a; }

/* overlays are kept for the game's code; the look is on the seat itself */
.card-dim-overlay, .block-dim-overlay { display: none; }
.seat.is-dim > div { filter: saturate(.35) brightness(.58); }
.seat.is-winner > .card-item, .seat.is-winner > .pot-box { translate: 0 -5px; }
.seat.is-winner::before { content: ""; position: absolute; left: -2px; right: -2px; top: -6px; bottom: -3px; border-radius: 20px; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 200, 61, .05), rgba(255, 200, 61, .34)); border: 2px solid var(--gold); box-shadow: 0 0 28px rgba(255, 200, 61, .75);
  animation: glow 1s ease-in-out infinite alternate; }
.seat.is-winner .mascot { animation: cheer .6s ease-in-out infinite alternate; }
.seat.is-winner .pot-box { border-color: var(--gold); }
@keyframes glow { to { box-shadow: 0 0 44px rgba(255, 200, 61, 1); } }
@keyframes cheer { to { transform: translateY(-8px) rotate(2deg) scale(1.04); } }

/* ---------------------------------------------------------------- coins, chips */
.coin-area { position: relative; z-index: 2; padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: linear-gradient(180deg, rgba(29, 24, 80, .2), rgba(11, 11, 26, .97) 42%); }
.balance-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.coin-balance { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 5px; border-radius: 999px; }
.balance-text { font-size: 13px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.chip-hint { font-size: 9.5px; color: var(--soft); text-align: center; flex: 1; }
.history-btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.history-btn svg { width: 16px; height: 16px; color: var(--soft); }
.coin-ic { display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle;
  background: radial-gradient(circle at 35% 30%, #fff3b0 0 14%, #ffd54a 15% 48%, #f2a30f 49% 60%, #ffcf45 61% 74%, #b86f00 75%);
  box-shadow: 0 0 8px rgba(255, 200, 61, .6); }

.chips { display: flex; justify-content: space-between; align-items: center; }
.chip-item { --chip: #8e6bff; position: relative; width: clamp(46px, 14vw, 62px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: repeating-conic-gradient(from -12deg, #fff 0 24deg, var(--chip) 24deg 60deg);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .45), 0 8px 14px rgba(0, 0, 0, .45); transition: transform .18s cubic-bezier(.2, 1.6, .4, 1), box-shadow .18s ease; }
.chip-item::before { content: ""; position: absolute; inset: 13%; border-radius: 50%; background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--chip) 72%, #fff), var(--chip) 55%, color-mix(in srgb, var(--chip) 62%, #000));
  border: 2px dashed rgba(255, 255, 255, .75); }
.chip-item span { position: relative; font-size: clamp(11px, 3.3vw, 14px); font-weight: 900; text-shadow: 0 1px 3px rgba(0, 0, 0, .65); }
.chip-1 { --chip: #3d8bff; }
.chip-2 { --chip: #12b886; }
.chip-3 { --chip: #8e6bff; }
.chip-4 { --chip: #ff4fa3; }
.chip-5 { --chip: #e59a00; }
.chip-item.active { transform: translateY(-8px) scale(1.1); box-shadow: 0 0 0 3px #fff, 0 0 22px 6px var(--chip), 0 12px 16px rgba(0, 0, 0, .45); }

/* a chip flying to a seat, and the coins of a win */
.fly-chip { position: fixed; z-index: 30; width: 22px; height: 22px; border-radius: 50%; pointer-events: none; transition: transform .42s cubic-bezier(.3, .7, .3, 1), opacity .42s ease;
  background: repeating-conic-gradient(#fff 0 24deg, var(--chip, #8e6bff) 24deg 60deg); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.confetti { position: absolute; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -24px; width: var(--s); height: var(--s); border-radius: var(--round); background: var(--k); animation: rain var(--d) linear forwards; }
@keyframes rain { to { transform: translate3d(var(--x), 105vh, 0) rotate(var(--rot)); } }

/* ---------------------------------------------------------------- result of the round */
.win-modal-overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(7, 6, 20, .7); }
.result-card { position: relative; width: min(82%, 320px); flex-direction: column; align-items: center; gap: 8px; padding: 22px 18px 18px; border-radius: 26px; overflow: hidden; text-align: center;
  background: linear-gradient(170deg, #3b2590, #1b1450 55%, #0f0c30); border: 1.5px solid rgba(255, 255, 255, .22); animation: pop .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.result-win { box-shadow: 0 0 0 2px var(--gold), 0 0 60px rgba(255, 200, 61, .55); }
.result-lose { box-shadow: 0 0 40px rgba(142, 107, 255, .45); }
.result-viewer { box-shadow: 0 0 50px rgba(255, 79, 163, .5); }
.rays { position: absolute; width: 200%; aspect-ratio: 1; top: -58%; left: -50%; opacity: .16; pointer-events: none; animation: spin 14s linear infinite;
  background: repeating-conic-gradient(var(--gold) 0 9deg, transparent 9deg 22deg); -webkit-mask: radial-gradient(circle, #000 0 30%, transparent 62%); mask: radial-gradient(circle, #000 0 30%, transparent 62%); }
@keyframes spin { to { transform: rotate(360deg); } }
.result-card > :not(.rays) { position: relative; }
.result-emblem { width: 62px; height: 62px; border-radius: 50%; }
.emblem-win, .emblem-lose { --face: url("../assets/lucky77/cat.webp"); background: var(--face) center 6% / 128% no-repeat, radial-gradient(circle, #4a36a6, #17123f); }
.emblem-win { width: 104px; height: 104px; border: 3px solid var(--gold); box-shadow: 0 0 34px var(--gold); }
.emblem-lose { width: 84px; height: 84px; border: 2px solid var(--violet); }
[data-seat="B"] .result-emblem { --face: url("../assets/lucky77/cat.webp"); }
[data-seat="C"] .result-emblem { --face: url("../assets/lucky77/cat.webp"); }
.result-kicker { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--soft); }
.result-title { font-size: 28px; font-weight: 900; line-height: 1.05; }
.result-win .result-title { background: linear-gradient(180deg, #fff3b0, #ffc83d 60%, #ff9d2e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(255, 200, 61, .6)); }
.result-stats { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.stat { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 11.5px; color: var(--soft); }
.stat b { display: flex; align-items: center; gap: 5px; color: #fff; font-size: 13px; }
.stat-big b { font-size: 19px; color: var(--gold); }
.result-lose .stat-big b { color: #ff9aa5; }
.result-ok { margin-top: 6px; min-width: 130px; padding: 10px 24px; border-radius: 999px; font-weight: 900; background: var(--grad); box-shadow: 0 6px 18px rgba(255, 79, 163, .5); }
.viewer-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); box-shadow: 0 0 28px rgba(255, 200, 61, .7); background: var(--card); }
.viewer-name { font-size: 18px; font-weight: 900; }
.viewer-coins { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 900; color: var(--gold); }

/* ---------------------------------------------------------------- history, ranking, players */
.sheet-overlay { position: absolute; inset: 0; z-index: 10; background: rgba(7, 6, 20, .68); }
.board-wrap { position: absolute; inset: 0; z-index: 11; display: flex; align-items: flex-end; }
.board { position: relative; width: 100%; max-height: 82%; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  border-radius: 26px 26px 0 0; border-top: 1px solid rgba(255, 255, 255, .22);
  background: radial-gradient(120% 60% at 15% 0%, rgba(255, 79, 163, .3), transparent 60%), radial-gradient(100% 60% at 95% 10%, rgba(39, 227, 161, .2), transparent 60%), linear-gradient(180deg, #341658, #16183f 45%, #0a0c1e);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .55); animation: up .26s cubic-bezier(.2, 1, .3, 1); }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.board-head { display: flex; align-items: center; justify-content: center; position: relative; min-height: 28px; }
.board-head h2 { font-size: 14px; font-weight: 900; }
.board-close { position: absolute; right: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 12px; }
.board-foot { font-size: 9.5px; text-align: center; color: var(--soft); }

.history-head, .history-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.history-head span { font-weight: 900; font-size: 12px; padding: 5px 0; border-radius: 10px; color: #14092c; background: var(--a); }
.history-head .col-b { background: var(--b); }
.history-head .col-c { background: var(--c); }
.history-rows { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; min-height: 0; }
.hist-badge { padding: 5px 0; border-radius: 10px; font-size: 10px; font-weight: 800; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .35); }
.hist-badge.win { background: linear-gradient(135deg, #ffe38a, #ffb11f); color: #3a1c00; box-shadow: 0 0 10px rgba(255, 200, 61, .5); }

.podium { display: grid; grid-template-columns: 1fr 1.18fr 1fr; gap: 8px; align-items: end; }
.podium-slot { --m: #c9d4ff; display: flex !important; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 16px; min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)); border: 1px solid color-mix(in srgb, var(--m) 55%, transparent); }
.rank-1 { --m: #ffc83d; padding-top: 14px; padding-bottom: 14px; box-shadow: 0 0 24px rgba(255, 200, 61, .3); }
.rank-3 { --m: #ff9a62; }
.podium-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--m); background: var(--card); }
.rank-1 .podium-avatar img { width: 54px; height: 54px; }
.medal { width: 18px; height: 18px; border-radius: 50%; margin-top: -11px; z-index: 1; display: grid; place-items: center; font-size: 10px; font-weight: 900; color: #1a1040; background: var(--m); }
.podium-name { height: 14px; max-width: 100%; font-size: 10.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-coins, .rank-coins { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; color: var(--gold); }
.podium-coins .coin-ic, .rank-coins .coin-ic { width: 12px; height: 12px; }
.rank-rows { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; min-height: 0; }
.rank-row { display: flex; align-items: center; gap: 9px; flex: none; padding: 5px 10px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.rank-row img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--card); }
.rank-no { width: 14px; font-size: 11px; font-weight: 900; color: var(--soft); }
.rank-name { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name small { display: block; font-size: 9px; color: var(--soft); }
.rank-mine { background: linear-gradient(135deg, rgba(142, 107, 255, .5), rgba(255, 79, 163, .4)); border: 1px solid rgba(255, 255, 255, .22); }

.participants-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 80px; }
.participant-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.p-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.p-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--card); }
.p-name { font-size: 11.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-role-badge { font-size: 9.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--soft); }
.p-role-badge.role-participant { background: rgba(39, 227, 161, .2); color: var(--mint); }

.game-toast { position: absolute; left: 50%; bottom: 132px; transform: translateX(-50%); z-index: 40; max-width: 86%; padding: 9px 14px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; text-align: center; background: rgba(20, 18, 58, .96); border: 1px solid var(--pink); }

/* the game opened as a half-height sheet inside a room */
@media (max-height: 660px) {
  .brand-sub, .chip-hint { display: none; }
  .brand { display: flex; align-items: center; justify-content: center; gap: 8px; }
  .brand-logo { height: 30px; margin: 0; }
  .counter-area { height: 44px; }
  .seats { --mascot-h: clamp(70px, 18vh, 116px); }
  .card-item { margin-top: 5px; }
  .hand { --w: 29px; }
  .pot-box { margin-top: 3px; padding: 3px 4px; }
  .pot-label { display: none; }
  .chip-item { width: 44px; }
  .balance-row { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora i, .mascot, .seat.is-winner::before, .seat.is-winner .mascot, .rays, .timer-circle.is-low { animation: none; }
}

/* ---------------------------------------------------------------- MIT's glossy buttons (the same set as the app) */
.orb-btn { position: relative; width: 38px; height: 38px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center;
  transition: transform .12s ease; -webkit-tap-highlight-color: transparent; }
.orb-btn img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 6px rgba(10, 0, 40, .45)); }
.orb-btn:active { transform: scale(.88); }
.orb-btn > b { position: absolute; right: -4px; bottom: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: 10px; line-height: 17px; font-weight: 900;
  text-align: center; color: #fff; background: linear-gradient(135deg, #ff6fb5, #c02a86); border: 1.5px solid rgba(255, 255, 255, .85); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
/* a light passes over the trophy now and then */
.orb-shine { overflow: visible; }
.orb-shine::after { content: ""; position: absolute; inset: 1px 1px 3px; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .75) 50%, transparent 62%) no-repeat; background-size: 260% 100%; background-position: 180% 0;
  animation: orb-shine 4.2s ease-in-out infinite; mix-blend-mode: soft-light; }
@keyframes orb-shine { 0%, 68% { background-position: 180% 0; } 92%, 100% { background-position: -80% 0; } }
.header-right { gap: 8px; }
.user-capsule { padding: 3px 6px 3px 3px; gap: 8px; box-shadow: 0 4px 16px rgba(10, 0, 40, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.avatar-img { width: 36px; height: 36px; border: 0; padding: 2px; background: conic-gradient(from 200deg, #8e6bff, #ff4fa3, #ffc83d, #8e6bff); }
.btn-topup.orb-btn { width: 30px; height: 30px; background: none; padding: 0; }
.coin-ic { background: url("../assets/ui/coin.webp") center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 0 6px rgba(255, 200, 61, .55)); }
.coin-balance { height: 34px; padding: 0 13px 0 4px; box-shadow: 0 4px 14px rgba(10, 0, 40, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.coin-balance .coin-ic { width: 26px; height: 26px; }
.balance-text { font-size: 14px; }
.history-btn.orb-btn { width: 40px; height: 40px; background: none; border: 0; }
.board-close { width: 32px; height: 32px; padding: 0; background: url("../assets/ui/close.webp") center / contain no-repeat; color: transparent; font-size: 0; border: 0;
  filter: drop-shadow(0 3px 6px rgba(10, 0, 40, .45)); }
.board-close:active { transform: scale(.88); }
@media (max-width: 340px) { .orb-btn { width: 34px; height: 34px; } .header-right { gap: 5px; } .user-name { max-width: 70px; } }
@media (prefers-reduced-motion: reduce) { .orb-shine::after { animation: none; } }
