/* --------- Base --------- */
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    color: #f5e7c4;
    background:
        radial-gradient(ellipse at top, #1c3a26 0%, #0e2014 55%, #060d08 100%),
        #060d08;
    overflow-x: hidden;
}

.vignette {
    position: fixed; inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
    z-index: 1;
}

/* --------- Top bar --------- */
.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    background: linear-gradient(180deg, rgba(0,0,0,0.35), transparent);
}

.brand {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.brand-gold {
    background: linear-gradient(180deg, #fff3b0 0%, #d4af37 45%, #8a6a1e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    display: flex;
    gap: 14px;
}
.stat {
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25));
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 8px;
    padding: 8px 16px;
    min-width: 120px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 12px rgba(0,0,0,0.4);
}
.stat-label {
    display: block;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(245, 231, 196, 0.6);
}
.stat-value {
    display: block;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 20px;
    color: #ffd966;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    margin-top: 2px;
}
.stat-value.flash {
    animation: flash 0.8s ease;
}
@keyframes flash {
    0% { color: #ffd966; text-shadow: 0 0 0 transparent; }
    30% { color: #fff; text-shadow: 0 0 18px #ffe680, 0 0 30px #d4af37; }
    100% { color: #ffd966; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
}

/* --------- Main table --------- */
.table {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(620px, 1.4fr);
    gap: 28px;
    padding: 28px;
    max-width: 1500px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .table {
        grid-template-columns: 1fr;
    }
}

/* --------- Wheel --------- */
.wheel-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.wheel-wrap {
    position: relative;
    width: min(520px, 90vw);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 18px;
    background:
        radial-gradient(circle at 30% 20%, #6b4a1a, #3a2710 60%, #1a1106 100%);
    box-shadow:
        0 25px 60px rgba(0,0,0,0.7),
        inset 0 0 0 4px rgba(255, 220, 130, 0.35),
        inset 0 0 40px rgba(0,0,0,0.5);
}

.wheel-wrap::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, #8a6a1e 0deg 6deg, #d4af37 6deg 12deg);
    opacity: 0.7;
    z-index: 0;
}
.wheel-wrap::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.5));
    z-index: 0;
    pointer-events: none;
}

#wheel {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
    transform-origin: 50% 50%;
}

.ball-orbit {
    position: absolute;
    inset: 18px;
    pointer-events: none;
    z-index: 3;
    transform-origin: 50% 50%;
}
.ball {
    position: absolute;
    left: 50%;
    top: 6%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #d0d0d0 60%, #7a7a7a);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.6),
        inset -2px -2px 3px rgba(0,0,0,0.3);
}

.wheel-hub {
    position: absolute;
    left: 50%; top: 50%;
    width: 22%; height: 22%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}
.hub-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fde9a3 0%, #d4af37 35%, #7a5d18 70%, #3a2910 100%);
    box-shadow: 0 0 24px rgba(0,0,0,0.6), inset 0 0 10px rgba(0,0,0,0.4);
}
.hub-center {
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3b0, #a8801f 60%, #3a2910);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
}

.pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 22px solid #d4af37;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
    z-index: 4;
}

/* --------- Result display --------- */
.result-display {
    background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.25));
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 12px;
    padding: 12px 22px;
    text-align: center;
    min-width: 260px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 18px rgba(0,0,0,0.4);
}
.result-number {
    font-family: 'Cinzel', serif;
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    color: #ffd966;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.result-number.red    { color: #ff6b5c; text-shadow: 0 0 16px rgba(255,70,60,0.6); }
.result-number.black  { color: #e8e8e8; text-shadow: 0 0 16px rgba(255,255,255,0.25); }
.result-number.green  { color: #6ef28a; text-shadow: 0 0 16px rgba(110,242,138,0.5); }
.result-sub {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(245, 231, 196, 0.65);
    margin-top: 4px;
}

.history-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}
.history-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(245, 231, 196, 0.5);
    text-transform: uppercase;
}
.history {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.history-item {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.history-item.red { background: linear-gradient(180deg, #e94a3a, #a31e12); }
.history-item.black { background: linear-gradient(180deg, #2a2a2a, #000); }
.history-item.green { background: linear-gradient(180deg, #2ecc71, #186a3b); }

/* --------- Board --------- */
.board-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.board {
    display: grid;
    grid-template-columns: auto repeat(12, 1fr) auto;
    gap: 2px;
    background: linear-gradient(180deg, #0a2410 0%, #061a0a 100%);
    padding: 8px;
    border-radius: 10px;
    border: 2px solid #d4af37;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.6),
        0 10px 30px rgba(0,0,0,0.5);
    user-select: none;
}

.cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.12);
    transition: transform 0.08s, filter 0.12s, box-shadow 0.12s;
    min-height: 38px;
}
.cell:hover { filter: brightness(1.3); z-index: 2; box-shadow: inset 0 0 0 2px #ffd966; }
.cell:active { transform: scale(0.97); }

.cell.red   { background: linear-gradient(180deg, #d63a2b, #8b1a10); }
.cell.black { background: linear-gradient(180deg, #1c1c1c, #000); }
.cell.zero  { background: linear-gradient(180deg, #2ecc71, #186a3b); }

.cell.outside {
    background: linear-gradient(180deg, #123a1d, #0a2410);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cell.zero  { grid-row: span 3; font-size: 22px; font-family: 'Cinzel', serif; }

/* row span for numbers column */
.number { }

.cell-dozen { grid-column: span 4; }
.cell-col { }
.cell-bottom { grid-column: span 2; }

/* chip stack on cell */
.stack {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    color: var(--chip-ink, #111);
    background: radial-gradient(circle at 30% 30%, var(--chip, #fff), var(--chip-dark, #888));
    border: 2px dashed rgba(255,255,255,0.85);
    box-shadow: 0 2px 4px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 3;
}
.stack.placed {
    animation: chipDrop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes chipDrop {
    0% { transform: translateY(-30px) scale(1.3); opacity: 0; }
    60% { transform: translateY(4px) scale(0.95); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.cell.winning {
    animation: winPulse 1.2s ease infinite;
}
@keyframes winPulse {
    0%, 100% { box-shadow: inset 0 0 0 2px #ffd966, 0 0 0 0 rgba(255,217,102,0.6); }
    50%      { box-shadow: inset 0 0 0 2px #fff3b0, 0 0 20px 4px rgba(255,217,102,0.8); }
}

/* --------- Controls --------- */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.chips {
    display: flex;
    gap: 10px;
}
.chip {
    width: 58px; height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: 900;
    font-size: 14px;
    color: var(--chip-ink, #111);
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent 50%),
        radial-gradient(circle, var(--chip), var(--chip-dark));
    box-shadow:
        0 0 0 4px var(--chip-dark) inset,
        0 0 0 8px var(--chip) inset,
        0 6px 10px rgba(0,0,0,0.6);
    transition: transform 0.1s, box-shadow 0.12s;
    position: relative;
    outline: none;
}
.chip::before {
    /* dashed ring pattern like a casino chip */
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.85);
    opacity: 0.6;
    pointer-events: none;
}
.chip:hover { transform: translateY(-3px); }
.chip:active { transform: translateY(0) scale(0.95); }
.chip.active {
    transform: translateY(-6px);
    box-shadow:
        0 0 0 4px var(--chip-dark) inset,
        0 0 0 8px var(--chip) inset,
        0 0 0 3px #ffd966,
        0 10px 18px rgba(0,0,0,0.7);
}

.actions {
    display: flex;
    gap: 10px;
}
.btn {
    padding: 12px 22px;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,0.5);
    background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
    color: #f5e7c4;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.08s, filter 0.12s, box-shadow 0.12s;
}
.btn:hover { filter: brightness(1.3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-spin {
    background: linear-gradient(180deg, #e74c3c 0%, #8b1a10 100%);
    border: 1px solid #ffd966;
    color: #fff;
    box-shadow: 0 0 14px rgba(231,76,60,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    font-size: 15px;
    padding: 12px 28px;
}
.btn-spin:hover { box-shadow: 0 0 22px rgba(255,100,80,0.7), inset 0 1px 0 rgba(255,255,255,0.3); }

/* --------- Toast --------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(40px);
    background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    border: 1px solid #d4af37;
    color: #ffd966;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7), 0 0 30px rgba(212,175,55,0.3);
    transition: opacity 0.3s, transform 0.3s;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.win   { color: #6ef28a; border-color: #6ef28a; box-shadow: 0 10px 40px rgba(0,0,0,0.7), 0 0 30px rgba(110,242,138,0.5); }
.toast.lose  { color: #ff6b5c; border-color: #ff6b5c; }

/* --------- Racetrack --------- */
.btn-toggle[aria-pressed="true"] {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    color: #1a1106;
    border-color: #ffd966;
    box-shadow: 0 0 14px rgba(212,175,55,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
}

.racetrack-panel {
    background: linear-gradient(180deg, #0a2410 0%, #061a0a 100%);
    border: 2px solid #d4af37;
    border-radius: 14px;
    padding: 14px 18px 16px;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.6),
        0 10px 30px rgba(0,0,0,0.5);
    animation: rtSlide 0.35s ease;
}
.racetrack-panel[hidden] { display: none; }
@keyframes rtSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.racetrack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.rt-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    color: #ffd966;
    text-transform: uppercase;
}
.rt-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(245,231,196,0.55);
    text-transform: none;
}

.neighbours {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nb-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(245,231,196,0.7);
    text-transform: uppercase;
    font-weight: 700;
}
.nb-buttons {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.5);
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(212,175,55,0.4);
}
.nb-btn {
    width: 30px; height: 28px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #f5e7c4;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.08s;
}
.nb-btn:hover { background: rgba(212,175,55,0.2); }
.nb-btn.active {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    color: #1a1106;
    box-shadow: 0 0 10px rgba(212,175,55,0.4);
}

.racetrack {
    position: relative;
    width: 100%;
    aspect-ratio: 2.6 / 1;
    min-height: 180px;
    margin: 4px auto 0;
}
.racetrack-oval {
    position: absolute;
    inset: 6% 2%;
    border-radius: 50% / 50%;
    background:
        radial-gradient(ellipse at center, rgba(30,132,73,0.55) 0%, rgba(16,60,30,0.95) 80%);
    border: 2px solid #d4af37;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.7);
}

.track-num {
    position: absolute;
    width: 34px; height: 34px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid rgba(212,175,55,0.6);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.1s, box-shadow 0.12s, filter 0.12s;
    z-index: 2;
}
.track-num:hover {
    transform: translate(-50%, -50%) scale(1.18);
    filter: brightness(1.35);
    box-shadow: 0 0 14px rgba(255,217,102,0.7), 0 2px 6px rgba(0,0,0,0.7);
    z-index: 4;
}
.track-num:active {
    transform: translate(-50%, -50%) scale(1.02);
}
.track-num.red   { background: linear-gradient(180deg, #d63a2b, #8b1a10); }
.track-num.black { background: linear-gradient(180deg, #2a2a2a, #000); }
.track-num.green { background: linear-gradient(180deg, #2ecc71, #186a3b); }
.track-num.highlight {
    outline: 2px solid #ffd966;
    outline-offset: 2px;
    animation: nbGlow 1s ease;
}
@keyframes nbGlow {
    0%   { box-shadow: 0 0 0 0 rgba(255,217,102,0.9); }
    70%  { box-shadow: 0 0 0 12px rgba(255,217,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,217,102,0); }
}

.racetrack-inside {
    position: absolute;
    inset: 22% 12%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    z-index: 1;
}
.announce-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,0.5);
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.3));
    color: #f5e7c4;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    transition: transform 0.08s, filter 0.15s, box-shadow 0.15s;
    text-align: center;
}
.announce-btn:hover {
    filter: brightness(1.3);
    box-shadow: 0 0 10px rgba(212,175,55,0.4);
}
.announce-btn:active { transform: scale(0.97); }
.an-title {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    color: #ffd966;
}
.an-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 1px;
    color: rgba(245,231,196,0.6);
    text-transform: uppercase;
}

.racetrack-hint {
    margin-top: 8px;
    text-align: center;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: rgba(245,231,196,0.45);
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .racetrack { aspect-ratio: 2 / 1; }
    .track-num { width: 28px; height: 28px; font-size: 10px; }
    .an-title { font-size: 11px; }
    .an-sub { font-size: 9px; }
}

/* ================================================================
   App Shell / Sidebar / Chat
   ================================================================ */
body {
    display: grid;
    grid-template-columns: 80px 1fr 300px;
    grid-template-areas: "sidebar app chat";
    min-height: 100vh;
}
body.chat-collapsed {
    grid-template-columns: 80px 1fr 0px;
}
.app { grid-area: app; min-width: 0; }
.sidebar { grid-area: sidebar; }
.chat    { grid-area: chat; }

.topbar { padding-left: 24px; padding-right: 24px; }

@media (max-width: 1100px) {
    body { grid-template-columns: 64px 1fr 0; grid-template-areas: "sidebar app chat"; }
    .chat { position: fixed; right: 0; top: 0; bottom: 0; width: 300px; z-index: 12; transform: translateX(100%); transition: transform 0.3s ease; }
    body.chat-open .chat { transform: translateX(0); }
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: relative;
    z-index: 5;
    background: linear-gradient(180deg, #0a1f12 0%, #050d08 100%);
    border-right: 1px solid rgba(212,175,55,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    gap: 18px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}
.sidebar-logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(255,243,176,0.2), transparent 60%);
    border: 1px solid rgba(212,175,55,0.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 10px rgba(0,0,0,0.5);
}
.sidebar-games {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}
.game-btn {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(245,231,196,0.6);
    padding: 12px 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
}
.game-btn:hover:not(:disabled) {
    background: rgba(212,175,55,0.08);
    color: #f5e7c4;
    border-color: rgba(212,175,55,0.25);
}
.game-btn.active {
    background: linear-gradient(180deg, rgba(212,175,55,0.25), rgba(212,175,55,0.08));
    color: #ffd966;
    border-color: rgba(212,175,55,0.55);
    box-shadow: inset 0 0 12px rgba(212,175,55,0.15);
}
.game-btn:disabled, .game-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
}
.game-btn-label { line-height: 1; }
.sidebar-bottom {
    margin-top: auto;
    background: transparent;
    color: rgba(245,231,196,0.65);
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.sidebar-bottom:hover { color: #ffd966; background: rgba(212,175,55,0.08); }

/* ---------- Music Control ---------- */
.music-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 14px;
    padding: 6px 12px;
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 10px;
    background: rgba(0,0,0,0.35);
}
.music-btn {
    background: none;
    border: none;
    color: rgba(245,231,196,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.15s;
}
.music-btn .ic-on  { display: none; }
.music-btn .ic-off { display: block; }
.music-btn[aria-pressed="true"] { color: #ffd966; }
.music-btn[aria-pressed="true"] .ic-on  { display: block; }
.music-btn[aria-pressed="true"] .ic-off { display: none; }
.music-vol {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #d4af37, rgba(212,175,55,0.2));
    outline: none;
    cursor: pointer;
}
.music-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #ffd966;
    border: 1px solid #8a6a1e;
    box-shadow: 0 0 6px rgba(212,175,55,0.6);
    cursor: pointer;
}
.music-vol::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #ffd966;
    border: 1px solid #8a6a1e;
    cursor: pointer;
}

/* ---------- Game switcher ---------- */
.games {
    padding: 0;
}
.game-view[hidden] { display: none !important; }

/* ---------- Chat ---------- */
.chat {
    background: linear-gradient(180deg, #0a1f12 0%, #050d08 100%);
    border-left: 1px solid rgba(212,175,55,0.25);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    z-index: 4;
}
.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(212,175,55,0.18);
}
.chat-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #ffd966;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    flex: 1;
}
.chat-online {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(245,231,196,0.6);
}
.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6ef28a;
    box-shadow: 0 0 6px #6ef28a;
    animation: liveBlink 1.6s ease-in-out infinite;
}
@keyframes liveBlink {
    0%,100% { opacity: 1; }
    50%     { opacity: 0.45; }
}
.chat-collapse {
    background: none;
    border: none;
    color: rgba(245,231,196,0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.chat-collapse:hover { color: #ffd966; background: rgba(212,175,55,0.08); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.3);
    border-radius: 4px;
}
.chat-msg {
    line-height: 1.35;
    word-wrap: break-word;
    animation: chatIn 0.25s ease;
}
@keyframes chatIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg .chat-name {
    font-weight: 700;
    margin-right: 4px;
}
.chat-msg.system {
    text-align: center;
    color: rgba(245,231,196,0.4);
    font-size: 11px;
    font-style: italic;
    padding: 4px 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.chat-msg.you .chat-name { color: #ffd966 !important; }
.chat-msg .chat-text { color: #f5e7c4; }

.chat-input {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid rgba(212,175,55,0.18);
}
.chat-input input {
    flex: 1;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 8px;
    color: #f5e7c4;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input input:focus {
    border-color: #ffd966;
    box-shadow: 0 0 0 2px rgba(212,175,55,0.2);
}
.chat-send {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    border: none;
    color: #1a1106;
    width: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s, transform 0.08s;
}
.chat-send:hover { filter: brightness(1.15); }
.chat-send:active { transform: scale(0.95); }
.chat-foot {
    text-align: center;
    font-size: 9px;
    color: rgba(245,231,196,0.35);
    padding: 4px 8px 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ================================================================
   Fruit Machine
   ================================================================ */
.slot-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 28px;
    padding: 28px;
    max-width: 1280px;
    margin: 0 auto;
}
@media (max-width: 1000px) {
    .slot-stage { grid-template-columns: 1fr; }
}

.slot-cabinet {
    background:
        linear-gradient(180deg, #6b1e10 0%, #4a1108 60%, #2a0805 100%);
    border: 4px solid #d4af37;
    border-radius: 18px;
    padding: 18px 22px 22px;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.7),
        0 25px 50px rgba(0,0,0,0.7),
        0 0 0 6px rgba(0,0,0,0.4),
        0 0 0 8px rgba(212,175,55,0.4);
    position: relative;
}

.slot-marquee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}
.slot-title {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 6px;
    margin: 0;
    background: linear-gradient(180deg, #fff3b0 0%, #d4af37 50%, #7a5d18 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255,217,102,0.4);
}
.slot-lights {
    flex: 1;
    height: 16px;
    background: repeating-linear-gradient(90deg,
        #ffe680 0px, #ffe680 6px,
        transparent 6px, transparent 14px);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(255,230,128,0.5);
    animation: marquee 1.4s linear infinite;
}
@keyframes marquee {
    from { background-position: 0 0; }
    to   { background-position: 14px 0; }
}

.slot-window {
    position: relative;
    background: linear-gradient(180deg, #0a0a0a, #1a1a1a);
    border: 3px solid #d4af37;
    border-radius: 12px;
    padding: 8px;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.85),
        inset 0 4px 8px rgba(0,0,0,0.5);
}
.slot-reels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.slot-reel {
    height: 270px;
    overflow: hidden;
    background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 0 22px rgba(0,0,0,0.85);
}
.slot-reel::before, .slot-reel::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 30px;
    z-index: 2;
    pointer-events: none;
}
.slot-reel::before {
    top: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.95), transparent);
}
.slot-reel::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.95), transparent);
}
.slot-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}
.slot-symbol {
    height: 90px;
    flex: 0 0 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
    user-select: none;
}
.slot-symbol.star {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 56px;
    color: #ff3b3b;
    text-shadow: 0 0 12px rgba(255,80,80,0.7), 0 2px 4px rgba(0,0,0,0.6);
}
.slot-payline {
    position: absolute;
    left: 8px; right: 8px;
    top: 50%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff3b3b 20%, #ff3b3b 80%, transparent);
    box-shadow: 0 0 10px rgba(255,59,59,0.7);
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
}

.slot-result {
    text-align: center;
    margin: 14px 0 12px;
    min-height: 28px;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    letter-spacing: 2px;
    color: #ffd966;
    text-transform: uppercase;
}
.slot-result.win { color: #6ef28a; text-shadow: 0 0 12px rgba(110,242,138,0.6); }
.slot-result.big { animation: bigWinPulse 0.8s ease infinite; }
@keyframes bigWinPulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.06); }
}

.slot-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.slot-bet-info {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 8px;
    padding: 6px 16px;
    text-align: center;
}
.bet-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(245,231,196,0.6);
    text-transform: uppercase;
}
.bet-amount {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #ffd966;
    font-size: 18px;
}
.slot-buttons { display: flex; gap: 10px; }
.slot-pull {
    font-size: 18px;
    padding: 14px 32px;
    letter-spacing: 4px;
}

.slot-paytable {
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.3));
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 12px;
    padding: 16px;
    align-self: start;
    height: fit-content;
}
.paytable-title {
    font-family: 'Cinzel', serif;
    color: #ffd966;
    margin: 0 0 10px;
    font-size: 16px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
}
.paytable-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.paytable-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0,0,0,0.4);
    border-radius: 6px;
    font-size: 14px;
}
.paytable-list .pt-syms {
    letter-spacing: 4px;
    font-size: 18px;
}
.paytable-list .pt-syms .slot-symbol-small.star {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    color: #ff3b3b;
    font-size: 18px;
}
.paytable-list .pt-pay {
    color: #ffd966;
    font-weight: 700;
    font-size: 13px;
}
.paytable-foot {
    margin-top: 10px;
    font-size: 10px;
    color: rgba(245,231,196,0.45);
    text-align: center;
    line-height: 1.4;
    letter-spacing: 1px;
}

.slot-reel.winning {
    animation: reelWinFlash 0.6s ease 3;
}
@keyframes reelWinFlash {
    0%,100% { box-shadow: inset 0 0 22px rgba(0,0,0,0.85); }
    50%     { box-shadow: inset 0 0 22px rgba(0,0,0,0.85), 0 0 18px 2px rgba(110,242,138,0.7); }
}

/* ================================================================
   Auth Modal / User Pill
   ================================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    position: relative;
    width: min(420px, 92vw);
    background: linear-gradient(180deg, #102a18 0%, #051208 100%);
    border: 2px solid #d4af37;
    border-radius: 14px;
    padding: 28px 30px 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 30px rgba(0,0,0,0.6);
    animation: cardIn 0.3s ease;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    text-align: center;
    margin: 0 0 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffd966;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 18px;
}
.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(245,231,196,0.7);
    padding: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.auth-tab.active {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    color: #1a1106;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.field > span {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(245,231,196,0.6);
    font-weight: 700;
}
.field input {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 8px;
    padding: 10px 12px;
    color: #f5e7c4;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
    border-color: #ffd966;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.color-swatch {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s;
    padding: 0;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
    border-color: #ffd966;
    box-shadow: 0 0 8px rgba(212,175,55,0.6);
    transform: scale(1.1);
}
.auth-error {
    background: rgba(239, 83, 80, 0.18);
    border: 1px solid #ef5350;
    color: #ffb7b3;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}
.auth-hint {
    margin: 6px 0 0;
    text-align: center;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(245,231,196,0.4);
}

/* Topbar user pill */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 999px;
    padding: 4px 6px 4px 10px;
    margin-left: 18px;
}
.user-pill-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--user-color, #ffd966);
    box-shadow: 0 0 6px var(--user-color, rgba(212,175,55,0.6));
}
.user-pill-name {
    font-weight: 700;
    color: #f5e7c4;
    font-size: 13px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-pill-badge {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    color: #1a1106;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 2px 6px;
    border-radius: 4px;
}
.user-pill-logout {
    background: transparent;
    border: none;
    color: rgba(245,231,196,0.6);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: color 0.15s, background 0.15s;
}
.user-pill-logout:hover {
    color: #ff6b5c;
    background: rgba(255,107,92,0.15);
}

/* ================================================================
   Admin Panel
   ================================================================ */
.admin-stage {
    padding: 28px;
    max-width: 1200px;
    margin: 0 auto;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.admin-title {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    margin: 0;
    color: #ffd966;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.admin-table-wrap {
    background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 12px;
    padding: 12px;
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #f5e7c4;
    font-size: 13px;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(212,175,55,0.15);
}
.admin-table th {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(245,231,196,0.6);
    font-weight: 700;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(212,175,55,0.06); }
.admin-cell-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-cell-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.admin-cell-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.admin-btn {
    background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
    border: 1px solid rgba(212,175,55,0.35);
    color: #f5e7c4;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.08s;
}
.admin-btn:hover { filter: brightness(1.3); }
.admin-btn:active { transform: scale(0.96); }
.admin-btn.danger { border-color: rgba(239,83,80,0.5); color: #ff8a80; }
.admin-btn.danger:hover { background: rgba(239,83,80,0.12); }
.admin-btn.gold {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    color: #1a1106;
    border: none;
}
.admin-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.admin-badge.admin   { background: linear-gradient(180deg, #d4af37, #8a6a1e); color: #1a1106; }
.admin-badge.user    { background: rgba(255,255,255,0.08); color: rgba(245,231,196,0.7); }
.admin-badge.banned  { background: rgba(239,83,80,0.2); color: #ff8a80; border: 1px solid rgba(239,83,80,0.5); }
.admin-badge.active  { background: rgba(110,242,138,0.15); color: #6ef28a; border: 1px solid rgba(110,242,138,0.4); }
.admin-badge.online  { background: rgba(110,242,138,0.15); color: #6ef28a; }
.admin-badge.offline { background: rgba(255,255,255,0.05); color: rgba(245,231,196,0.4); }

/* gated game-view: blur the casino while not logged in */
body.locked .games,
body.locked .chat-messages,
body.locked .chat-input { filter: blur(4px); pointer-events: none; user-select: none; }

/* Force-hide elements with the hidden attribute */
[hidden] { display: none !important; }

/* ================================================================
   8-Ball Pool
   ================================================================ */
.pool-stage {
    padding: 24px;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pool-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
}
.pool-seat {
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.3));
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pool-seat.right { flex-direction: row-reverse; }
.seat-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(245,231,196,0.55);
    font-weight: 700;
}
.seat-name {
    font-family: 'Cinzel', serif;
    color: #ffd966;
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seat-group {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}
.seat-group.solid  { background: rgba(255, 220, 80, 0.18); color: #ffe680; border: 1px solid rgba(255,220,80,0.4); }
.seat-group.stripe { background: rgba(80, 160, 255, 0.18); color: #80a8ff; border: 1px solid rgba(80,160,255,0.4); }
.pool-seat.active {
    border-color: #ffd966;
    box-shadow: 0 0 16px rgba(212,175,55,0.4);
}
.pool-sit {
    padding: 6px 14px;
    font-size: 11px;
}

.pool-status-wrap { text-align: center; }
.pool-status {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #ffd966;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.1;
}
.pool-turn {
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(245,231,196,0.55);
    margin-top: 2px;
    text-transform: uppercase;
}

.pool-table-wrap {
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, #2a1208 0%, #1a0805 100%);
    border: 6px solid #6b4a1a;
    border-radius: 22px;
    padding: 14px;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.7),
        0 22px 50px rgba(0,0,0,0.7),
        0 0 0 2px rgba(212,175,55,0.4);
}
#poolCanvas {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 2 / 1;
    cursor: crosshair;
    display: block;
}
#poolCanvas.placing { cursor: grab; }
#poolCanvas.aiming  { cursor: crosshair; }
#poolCanvas.spectator { cursor: default; }

.pool-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.pool-hint {
    flex: 1;
    min-width: 240px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(212,175,55,0.25);
    color: rgba(245,231,196,0.7);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.pool-hint .hint-icon {
    color: #ffd966;
    margin-right: 6px;
    font-size: 8px;
    vertical-align: middle;
}
.pool-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================================================================
   Slot bet buttons (independent of roulette chips)
   ================================================================ */
.slot-bets {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 12px 0 4px;
}
.slot-bet {
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25));
    border: 1px solid rgba(212,175,55,0.4);
    color: #f5e7c4;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.08s, box-shadow 0.15s;
}
.slot-bet:hover { filter: brightness(1.3); }
.slot-bet:active { transform: scale(0.96); }
.slot-bet.active {
    background: linear-gradient(180deg, #d4af37, #8a6a1e);
    color: #1a1106;
    border-color: #ffd966;
    box-shadow: 0 0 12px rgba(212,175,55,0.5);
}

/* Countdown / status on the spin button */
.btn-spin.countdown {
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35));
    border: 1px solid rgba(212,175,55,0.5);
    color: #ffd966;
    text-shadow: 0 0 6px rgba(212,175,55,0.3);
    box-shadow: none;
    cursor: default;
    opacity: 1;
}
.btn-spin.countdown.spinning  { color: #ff8a65; border-color: #ff8a65; box-shadow: 0 0 14px rgba(255,138,101,0.4); }
.btn-spin.countdown.result    { color: #6ef28a; border-color: #6ef28a; box-shadow: 0 0 14px rgba(110,242,138,0.4); }

/* ================================================================
   MOBILE — phones / narrow tablets
   ================================================================ */
@media (max-width: 760px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas: "app";
    }
    .sidebar {
        position: fixed;
        inset: auto 0 0 0;
        height: 60px;
        flex-direction: row;
        padding: 6px 8px;
        gap: 4px;
        border-right: none;
        border-top: 1px solid rgba(212,175,55,0.25);
        z-index: 8;
        box-shadow: 0 -6px 24px rgba(0,0,0,0.5);
    }
    .sidebar-logo { display: none; }
    .sidebar-games {
        flex-direction: row;
        flex: 1;
        gap: 4px;
        margin-top: 0;
        justify-content: center;
    }
    .game-btn { flex: 1; max-width: 84px; padding: 6px 4px; font-size: 9px; }
    .sidebar-bottom { width: 44px; height: 44px; padding: 8px; margin-top: 0; }

    .app { padding-bottom: 70px; }

    .topbar {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
        justify-content: center;
    }
    .brand { font-size: 18px; letter-spacing: 1px; flex-basis: 100%; text-align: center; margin-bottom: 4px; }
    .stats { gap: 4px; flex-wrap: wrap; justify-content: center; flex: 1; }
    .stat { min-width: 80px; padding: 4px 8px; }
    .stat-label { font-size: 9px; }
    .stat-value { font-size: 13px; }
    .user-pill { margin-left: 0; padding: 3px 4px 3px 8px; }
    .user-pill-name { font-size: 11px; max-width: 80px; }
    .music-ctrl { padding: 4px 8px; gap: 6px; }
    .music-vol { width: 60px; }

    .table {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 14px;
    }
    .wheel-wrap { width: min(360px, 86vw); }
    .result-display { min-width: 200px; padding: 8px 14px; }
    .result-number  { font-size: 30px; }

    .board { gap: 1px; padding: 4px; }
    .cell { padding: 6px 1px; min-height: 28px; font-size: 10px; }
    .cell.zero { font-size: 14px; }
    .cell.outside { font-size: 9px; letter-spacing: 0.5px; }
    .stack { width: 18px; height: 18px; font-size: 8px; right: -2px; bottom: -2px; }

    .controls { gap: 8px; }
    .chips { gap: 6px; }
    .chip { width: 44px; height: 44px; font-size: 11px; }
    .actions { flex-wrap: wrap; gap: 6px; justify-content: center; }
    .btn { padding: 8px 12px; font-size: 10px; letter-spacing: 1px; }
    .btn-spin { padding: 8px 14px; font-size: 11px; letter-spacing: 1.5px; }

    .racetrack-panel { padding: 10px; }
    .racetrack { aspect-ratio: 1.6 / 1; }
    .track-num { width: 22px; height: 22px; font-size: 9px; border-width: 1px; }
    .racetrack-inside { inset: 26% 8%; gap: 4px; }
    .an-title { font-size: 9px; letter-spacing: 0.5px; }
    .an-sub { font-size: 7px; }

    .slot-stage { padding: 12px; gap: 12px; grid-template-columns: 1fr; }
    .slot-cabinet { padding: 12px; }
    .slot-paytable { order: 2; padding: 10px; }
    .paytable-list li { padding: 4px 6px; font-size: 12px; }
    .slot-window { padding: 4px; }
    .slot-reels { gap: 4px; }
    .slot-reel { height: 210px; }
    .slot-symbol { height: 70px; flex: 0 0 70px; font-size: 42px; }
    .slot-payline { left: 4px; right: 4px; }
    .slot-bet { padding: 6px 12px; font-size: 12px; }
    .slot-controls { gap: 8px; }
    .slot-pull { padding: 10px 18px; font-size: 14px; letter-spacing: 2px; }
    .slot-title { font-size: 26px; letter-spacing: 3px; }

    .pool-stage { padding: 10px; }
    .pool-bar {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .pool-seat, .pool-seat.right { flex-direction: row; padding: 6px 10px; }
    .seat-name { font-size: 13px; }
    .pool-status { font-size: 14px; }
    .pool-table-wrap { padding: 6px; border-width: 4px; border-radius: 14px; }
    .power-meter { padding: 6px 10px; min-width: 0; }
    .pool-buttons { flex-wrap: wrap; }

    .admin-stage { padding: 12px; }
    .admin-table th, .admin-table td { padding: 6px 8px; font-size: 11px; }
    .admin-cell-actions { gap: 2px; }
    .admin-btn { padding: 3px 6px; font-size: 9px; }

    .modal-card { width: 92vw; padding: 22px 18px; }
    .modal-title { font-size: 18px; }

    .chat {
        width: min(320px, 92vw);
    }

    .toast { font-size: 14px; padding: 10px 18px; bottom: 80px; }

    [data-game="roulette"] .table {
        grid-template-rows: auto auto;
    }
}

/* Hide game-button labels on very narrow screens to save space */
@media (max-width: 420px) {
    .game-btn-label { display: none; }
    .stats { flex-basis: 100%; }
    .user-pill-badge { display: none; }
    .stat { flex: 1; min-width: 0; }
}
