/* =====================================================================
   ESAForum — Mini-Games / Points Casino Styles
   Created by ESAGAMES HOSTING SHIELD SRL
   Uses theme.css custom properties (--primary, --surface, etc.)
   ===================================================================== */

/* ── Utility colours ── */
.text-green { color: var(--green); }
.text-red   { color: var(--red); }

/* ── Points badge (lobby + game pages) ── */
.points-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.18), rgba(47,107,255,.12));
    border: 1px solid rgba(var(--primary-rgb),.35);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    backdrop-filter: blur(6px);
}
.points-badge b { color: var(--amber); font-size: 17px; }

/* ── Casino badge in H1 ── */
.casino-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(245,179,1,.18), rgba(255,92,138,.12));
    border: 1px solid rgba(245,179,1,.35);
    font-size: 13px;
    font-weight: 700;
    color: var(--amber);
    vertical-align: middle;
    margin-left: 10px;
    letter-spacing: .04em;
}

/* ── Guest alert ── */
.game-guest-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(var(--primary-rgb),.08);
    border: 1px solid rgba(var(--primary-rgb),.25);
    border-radius: var(--radius);
    padding: 14px 18px;
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ======================================================================
   LOBBY — Game Cards Grid
   ====================================================================== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 860px) {
    .games-grid { grid-template-columns: 1fr; }
}

.game-card {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    --card-accent: var(--primary); /* default accent so Play Now button is always visible */
    --card-glow: rgba(var(--primary-rgb),.22);
}
.game-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(var(--primary-rgb),.3);
}
.game-card--disabled {
    opacity: .55;
    pointer-events: none;
    filter: grayscale(.6);
}

/* Per-game accent colours */
.game-card--coinflip { --card-accent: #f5b301; --card-glow: rgba(245,179,1,.22); }
.game-card--slots    { --card-accent: var(--primary); --card-glow: rgba(var(--primary-rgb),.22); }
.game-card--dice     { --card-accent: #2ee6a6; --card-glow: rgba(46,230,166,.22); }

.game-card-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, var(--card-glow) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.game-card-body {
    position: relative;
    z-index: 1;
    padding: 32px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 0 14px var(--card-glow));
}

.game-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -.02em;
}

.game-desc {
    color: var(--text-dim);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.game-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    color: var(--text-dim);
}

.game-play-btn {
    margin-top: 10px;
    align-self: flex-start;
    background: linear-gradient(135deg, var(--card-accent), color-mix(in srgb, var(--card-accent), #fff 15%));
    color: #000;
    font-weight: 700;
    border: none;
    padding: 9px 22px;
    border-radius: 30px;
    font-size: 14px;
    transition: opacity .18s, transform .15s;
}
.game-card:hover .game-play-btn {
    opacity: .9;
    transform: scale(1.04);
}

/* ======================================================================
   BIGGEST WINS TABLE
   ====================================================================== */

.wins-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.wins-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
}
.wins-row:last-child { border-bottom: none; }
.wins-rank  { font-size: 18px; width: 30px; flex-shrink: 0; text-align: center; }
.wins-user  { flex: 1; font-weight: 600; color: var(--text); }
.wins-user a{ color: var(--primary-2); }
.wins-game  {
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.game-label--coinflip { background: rgba(245,179,1,.15); color: var(--amber); }
.game-label--slots    { background: rgba(var(--primary-rgb),.15); color: var(--primary-2); }
.game-label--dice     { background: rgba(46,230,166,.15); color: var(--green); }

.wins-bet  { color: var(--text-mute); font-size: 13px; }
.wins-net  { font-weight: 800; color: var(--green); font-size: 14px; flex-shrink: 0; }

/* ======================================================================
   CASINO INFO WIDGET
   ====================================================================== */

.casino-info h4 {
    font-size: 14px;
    margin: 0 0 10px;
    color: var(--text-dim);
}
.casino-info ul {
    margin: 0;
    padding: 0 0 0 16px;
    color: var(--text-mute);
    font-size: 13px;
    line-height: 1.8;
}
.casino-info ul b { color: var(--text); }

/* ======================================================================
   GAME PAGE LAYOUT
   ====================================================================== */

.game-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
    margin-top: 8px;
}
@media (max-width: 780px) {
    .game-container { grid-template-columns: 1fr; }
}

.game-controls {
    position: sticky;
    top: calc(var(--header-h) + 16px);
}
.game-controls-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 18px;
    color: #fff;
}

/* Bet input row */
.bet-input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bet-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bet-quick-btns .btn {
    flex: 1;
    min-width: 40px;
    font-size: 12px;
    padding: 5px 8px;
}

/* Side / choice picker */
.side-picker {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}
.side-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--surface-2);
    color: var(--text-mute);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
}
.side-btn:hover {
    border-color: rgba(var(--primary-rgb),.45);
    color: var(--text);
}
.side-btn.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb),.14);
    color: #fff;
    box-shadow: 0 0 16px rgba(var(--primary-rgb),.25);
}
.side-icon { font-size: 22px; }

/* Result area */
.game-result-area {
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius);
    text-align: center;
    transition: all .25s;
}
.game-result-area.result-win {
    background: rgba(46,230,166,.1);
    border: 1px solid rgba(46,230,166,.35);
}
.game-result-area.result-lose {
    background: rgba(255,77,109,.08);
    border: 1px solid rgba(255,77,109,.3);
}
.game-result-area.result-error {
    background: rgba(245,179,1,.08);
    border: 1px solid rgba(245,179,1,.3);
}
.result-icon  { font-size: 36px; margin-bottom: 8px; }
.result-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.result-detail {
    font-size: 13px;
    color: var(--text-dim);
}

/* ======================================================================
   COINFLIP ANIMATION
   ====================================================================== */

.coin-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
    background: radial-gradient(ellipse at center, rgba(245,179,1,.07) 0%, transparent 70%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.coin {
    width: 140px;
    height: 140px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 800px;
    cursor: pointer;
}

.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    font-weight: 900;
    backface-visibility: hidden;
    border: 5px solid;
    box-shadow: 0 0 30px rgba(245,179,1,.4), inset 0 0 20px rgba(0,0,0,.3);
}
.coin-heads {
    background: radial-gradient(circle at 35% 35%, #ffd700, #b8860b);
    border-color: #ffd700;
    color: #5a3e00;
}
.coin-tails {
    background: radial-gradient(circle at 35% 35%, #c0c0c0, #696969);
    border-color: #c0c0c0;
    color: #2a2a2a;
    transform: rotateY(180deg);
}

@keyframes coinSpin {
    0%   { transform: rotateY(0deg); }
    100% { transform: rotateY(1440deg); }
}
.coin.spin-heads {
    animation: coinSpin 1.2s cubic-bezier(.4,0,.6,1) forwards;
}
.coin.spin-tails {
    animation: coinSpin 1.2s cubic-bezier(.4,0,.6,1) forwards;
}
.coin.landed-heads { transform: rotateY(0deg); }
.coin.landed-tails { transform: rotateY(180deg); }

.coin-result-label {
    margin-top: 20px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .1em;
    min-height: 30px;
    transition: color .3s;
}

/* ======================================================================
   SLOTS MACHINE
   ====================================================================== */

.slots-machine {
    background: linear-gradient(160deg, #1a1040, var(--surface));
    border: 2px solid rgba(var(--primary-rgb),.4);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 0 40px rgba(var(--primary-rgb),.15), inset 0 0 30px rgba(0,0,0,.4);
    overflow: hidden;
}

.slots-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 22px;
}
.slots-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .25em;
    color: var(--amber);
    text-shadow: 0 0 12px rgba(245,179,1,.6);
}
.slots-light {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 12px var(--amber), 0 0 24px rgba(245,179,1,.4);
    animation: slotBlink 1.2s ease-in-out infinite alternate;
}
@keyframes slotBlink {
    from { opacity: 1; }
    to   { opacity: .3; }
}

.slots-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #060810;
    border: 2px solid rgba(var(--primary-rgb),.3);
    border-radius: 12px;
    padding: 18px 24px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,.6);
}

.slots-reel-wrap {
    width: 90px;
    height: 90px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    display: flex;
    align-items: center;
    justify-content: center;
}
.slots-reel {
    display: flex;
    align-items: center;
    justify-content: center;
}
.slots-symbol {
    font-size: 50px;
    line-height: 1;
    text-align: center;
    user-select: none;
    transition: transform .15s;
}
.slots-symbol.reel-pop {
    animation: reelPop .3s cubic-bezier(.36,.07,.19,.97);
}
@keyframes reelPop {
    0%   { transform: scale(1.4); }
    60%  { transform: scale(.9); }
    100% { transform: scale(1); }
}

.slots-sep {
    color: rgba(255,255,255,.1);
    font-size: 28px;
    font-weight: 100;
}

.slots-payline {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--amber), var(--primary), transparent);
    margin-top: 16px;
    border-radius: 2px;
    animation: paylineGlow 2s ease-in-out infinite;
}
@keyframes paylineGlow {
    0%,100% { opacity: .4; }
    50%      { opacity: 1; }
}

/* Paytable */
.paytable {
    background: var(--surface);
    border: 1px solid var(--border);
}
.paytable-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
}
.paytable-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    color: var(--text-dim);
}
.paytable-row:last-child { border-bottom: none; }
.payout-multi {
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.payout-multi.jackpot { background: rgba(245,179,1,.18); color: var(--amber); }
.payout-multi.win     { background: rgba(46,230,166,.15); color: var(--green); }
.payout-multi.pair    { background: rgba(47,107,255,.15); color: var(--accent-2); }
.payout-multi.lose    { background: rgba(255,77,109,.12); color: var(--red); }

/* ======================================================================
   DICE GAME
   ====================================================================== */

.dice-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px 36px;
    min-height: 320px;
    background: radial-gradient(ellipse at center, rgba(46,230,166,.06) 0%, transparent 65%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.dice-wrap {
    perspective: 600px;
    margin-bottom: 24px;
}

.dice {
    width: 120px;
    height: 120px;
    border-radius: 22px;
    background: linear-gradient(145deg, #1e2a4a, #0e1428);
    border: 3px solid rgba(46,230,166,.5);
    box-shadow:
        0 0 30px rgba(46,230,166,.2),
        inset 0 0 20px rgba(0,0,0,.5),
        6px 6px 0 rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .3s, box-shadow .3s;
}
.dice.dice-win {
    border-color: var(--green);
    box-shadow: 0 0 40px rgba(46,230,166,.5), inset 0 0 20px rgba(0,0,0,.5);
}
.dice.dice-lose {
    border-color: var(--red);
    box-shadow: 0 0 40px rgba(255,77,109,.45), inset 0 0 20px rgba(0,0,0,.5);
}

.dice-number {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -.05em;
}

@keyframes diceRoll {
    0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
    25%  { transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg); }
    50%  { transform: rotateX(360deg) rotateY(180deg) rotateZ(90deg); }
    75%  { transform: rotateX(270deg) rotateY(270deg) rotateZ(135deg); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(0deg); }
}
.dice.rolling {
    animation: diceRoll .8s cubic-bezier(.4,0,.2,1) infinite;
}

/* Range bar */
.dice-range-bar {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 380px;
    height: 36px;
    border-radius: 30px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.dice-range-lower {
    flex: 1;
    background: rgba(255,77,109,.12);
    color: var(--red);
    text-align: center;
    line-height: 36px;
}
.dice-range-divider {
    padding: 0 10px;
    line-height: 36px;
    background: var(--surface-3);
    color: var(--text-mute);
    font-size: 10px;
}
.dice-range-higher {
    flex: 1;
    background: rgba(46,230,166,.12);
    color: var(--green);
    text-align: center;
    line-height: 36px;
}

.dice-indicator {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .12em;
    min-height: 22px;
    transition: color .3s;
}

.dice-payout-info {
    padding: 10px 14px;
    background: rgba(46,230,166,.07);
    border: 1px solid rgba(46,230,166,.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 14px;
}
.dice-payout-info b { color: var(--green); }
#payout-preview { color: var(--green); font-weight: 800; }

/* ======================================================================
   SLOTS SPIN BUTTON pulse
   ====================================================================== */
.slots-spin-btn {
    position: relative;
    overflow: hidden;
}
.slots-spin-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.15) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
    to { transform: translateX(100%); }
}

/* ======================================================================
   RESPONSIVE TWEAKS
   ====================================================================== */
@media (max-width: 600px) {
    .coin { width: 100px; height: 100px; }
    .coin-face { font-size: 38px; }
    .slots-symbol { font-size: 38px; }
    .slots-reel-wrap { width: 70px; height: 70px; }
    .dice { width: 90px; height: 90px; }
    .dice-number { font-size: 36px; }
    .game-card-body { padding: 22px 18px 18px; }
    .games-grid { gap: 14px; }
}

/* =====================================================================
   v2 — remove background glows + CS-themed animated FX + polish
   ===================================================================== */
/* Kill the colored radial glow behind cards (user requested) */
.game-card-glow{ display:none !important; }
.games-grid .game-card{ background: linear-gradient(165deg, var(--surface-2), var(--surface)) !important; }

/* CS FX layer — bullets, tracers, crosshairs (subtle, gaming, NOT a glow) */
.cs-fx{ position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden; opacity:.55; }
.cs-fx .cs-tracer{ position:absolute; height:2px; width:140px; border-radius:2px;
    background:linear-gradient(90deg, transparent, #ffd36e, #fff3); filter:drop-shadow(0 0 4px #ffae3455);
    transform:rotate(-12deg); animation:tracer linear infinite; }
.cs-fx .t1{ top:18%; animation-duration:2.6s; animation-delay:.2s; }
.cs-fx .t2{ top:42%; animation-duration:3.4s; animation-delay:1.1s; width:180px; }
.cs-fx .t3{ top:63%; animation-duration:2.2s; animation-delay:.6s; }
.cs-fx .t4{ top:77%; animation-duration:4s;  animation-delay:2s; width:120px; }
.cs-fx .t5{ top:30%; animation-duration:3s;  animation-delay:1.6s; }
@keyframes tracer{ from{ left:-200px; opacity:0; } 10%{opacity:.9;} 90%{opacity:.9;} to{ left:108%; opacity:0; } }

.cs-fx .cs-cross{ position:absolute; color:rgba(var(--primary-rgb),.35); font-size:26px; animation:crossDrift linear infinite; }
.cs-fx .c1{ left:12%; animation-duration:22s; }
.cs-fx .c2{ left:58%; font-size:38px; color:rgba(46,230,166,.22); animation-duration:30s; animation-delay:4s; }
.cs-fx .c3{ left:83%; font-size:22px; color:rgba(245,179,1,.25); animation-duration:26s; animation-delay:8s; }
@keyframes crossDrift{ from{ top:110%; transform:rotate(0); } to{ top:-10%; transform:rotate(180deg); } }

.cs-fx .cs-bullet{ position:absolute; width:10px; height:4px; border-radius:3px;
    background:linear-gradient(90deg,#c9a04e,#ffe9b0); box-shadow:0 0 6px #ffae3466; transform:rotate(-12deg);
    animation:bulletFly linear infinite; }
.cs-fx .b1{ top:25%; animation-duration:1.8s; animation-delay:.3s; }
.cs-fx .b2{ top:52%; animation-duration:2.3s; animation-delay:1.4s; }
.cs-fx .b3{ top:70%; animation-duration:1.6s; animation-delay:.9s; }
.cs-fx .b4{ top:38%; animation-duration:2.1s; animation-delay:2.2s; }
@keyframes bulletFly{ from{ left:-30px; opacity:0; } 8%{opacity:1;} 92%{opacity:1;} to{ left:106%; opacity:0; } }

/* keep page content above the FX */
.page-head, .games-grid, .casino-stats, .game-stage, .game-shell { position:relative; z-index:1; }

@media (prefers-reduced-motion: reduce){ .cs-fx{ display:none; } }

/* ======================================================================
   MOBILE RESPONSIVE — v3
   Appended below; do NOT edit above (keep base styles clean).
   ====================================================================== */

/* ── 768 px and below (tablets + large phones) ── */
@media (max-width: 768px) {

    /* --- Lobby page-head: title + points badge + free-coins button --- */
    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-head > div:last-child {
        align-self: stretch;
    }
    /* Wrap the badge+button row so it fills width but wraps if needed */
    .page-head .flex {
        flex-wrap: wrap;
        gap: 8px;
    }
    .points-badge {
        font-size: 14px;
        padding: 8px 16px;
    }

    /* --- Games grid: already 1-col at 860px via base rule.
         Ensure card body padding is comfortable on tablets ---- */
    .games-grid {
        gap: 14px;
    }
    .game-card-body {
        padding: 22px 18px 20px;
    }
    .game-play-btn {
        align-self: stretch;   /* full-width Play Now on tablet */
        text-align: center;
    }

    /* --- Game container: stack to 1 column (controls below game) --- */
    .game-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    /* Un-stick the controls sidebar so it scrolls naturally below the game */
    .game-controls {
        position: static;
    }

    /* --- Coin: scale down, max 100% width --- */
    .coin-stage {
        padding: 40px 16px;
        min-height: 240px;
    }
    .coin {
        width: 110px;
        height: 110px;
    }
    .coin-face {
        font-size: 40px;
    }

    /* --- Slots: keep machine from overflowing --- */
    .slots-machine {
        padding: 20px 16px;
    }
    .slots-display {
        padding: 14px 12px;
        gap: 6px;
    }
    .slots-reel-wrap {
        width: 80px;
        height: 80px;
    }
    .slots-symbol {
        font-size: 44px;
    }

    /* --- Dice stage --- */
    .dice-stage {
        padding: 36px 16px 28px;
        min-height: 260px;
    }
    .dice {
        width: 100px;
        height: 100px;
    }
    .dice-number {
        font-size: 40px;
    }
    /* Range bar: allow text to wrap inside segments */
    .dice-range-bar {
        font-size: 11px;
        max-width: 100%;
    }
    .dice-range-lower,
    .dice-range-higher {
        line-height: 1.2;
        padding: 6px 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    .dice-range-divider {
        padding: 0 6px;
        line-height: 1;
        display: flex;
        align-items: center;
    }

    /* --- Biggest-wins table: allow row to wrap on narrow viewports --- */
    .wins-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .wins-user {
        flex-basis: 60%;
    }
    .wins-bet {
        font-size: 12px;
    }

    /* --- Ensure nothing causes horizontal scroll --- */
    .slots-machine,
    .coin-stage,
    .dice-stage,
    .game-controls,
    .paytable {
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
}

/* ── 480 px and below (small phones) ── */
@media (max-width: 480px) {

    /* --- Page head: tighten further, h1 can wrap with badge below it --- */
    .page-head h1 {
        font-size: 20px;
        flex-wrap: wrap;
    }
    .casino-badge {
        font-size: 11px;
        padding: 2px 9px;
        margin-left: 6px;
    }
    .points-badge {
        font-size: 13px;
        padding: 7px 13px;
    }
    .points-badge b {
        font-size: 15px;
    }

    /* --- Cards: compact on 320px+ phones --- */
    .game-card-body {
        padding: 16px 14px 16px;
        gap: 8px;
    }
    .game-icon {
        font-size: 36px;
    }
    .game-title {
        font-size: 18px;
    }
    .game-desc {
        font-size: 13px;
    }
    .game-play-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    .games-grid {
        gap: 10px;
    }

    /* --- Coin: smallest size --- */
    .coin-stage {
        padding: 30px 12px;
        min-height: 200px;
    }
    .coin {
        width: 88px;
        height: 88px;
    }
    .coin-face {
        font-size: 32px;
        border-width: 3px;
    }
    .coin-result-label {
        font-size: 18px;
        margin-top: 14px;
    }

    /* --- Slots: compact reels --- */
    .slots-machine {
        padding: 14px 10px;
    }
    .slots-reel-wrap {
        width: 64px;
        height: 64px;
    }
    .slots-symbol {
        font-size: 34px;
    }
    .slots-sep {
        font-size: 20px;
    }
    .slots-display {
        padding: 10px 8px;
        gap: 4px;
    }
    .slots-title {
        font-size: 11px;
        letter-spacing: .15em;
    }

    /* --- Dice: compact --- */
    .dice-stage {
        padding: 24px 10px 20px;
        min-height: 220px;
    }
    .dice {
        width: 84px;
        height: 84px;
        border-radius: 16px;
    }
    .dice-number {
        font-size: 34px;
    }
    .dice-range-bar {
        height: auto;
        min-height: 36px;
        font-size: 10px;
    }
    .dice-range-lower,
    .dice-range-higher {
        line-height: 36px;
        line-height: 1.3;
        padding: 8px 4px;
    }

    /* --- Side-picker (coinflip/dice): ensure buttons don't squeeze --- */
    .side-picker {
        gap: 8px;
    }
    .side-btn {
        padding: 12px 6px;
        font-size: 13px;
    }
    .side-icon {
        font-size: 18px;
    }

    /* --- Quick bet buttons: smaller text --- */
    .bet-quick-btns .btn {
        font-size: 11px;
        padding: 4px 6px;
    }

    /* --- Result area --- */
    .game-result-area {
        padding: 14px 12px;
    }
    .result-icon {
        font-size: 28px;
    }
    .result-title {
        font-size: 13px;
    }
    .result-detail {
        font-size: 12px;
    }

    /* --- Wins table on small phones --- */
    .wins-row {
        gap: 4px;
        padding: 8px 0;
    }
    .wins-rank {
        font-size: 15px;
        width: 24px;
    }
    .wins-user {
        flex-basis: 50%;
        font-size: 13px;
    }
    .wins-game {
        font-size: 10px;
    }
    .wins-bet {
        font-size: 11px;
    }
    .wins-net {
        font-size: 13px;
    }

    /* --- No horizontal overflow anywhere --- */
    .game-container,
    .slots-machine,
    .dice-stage,
    .coin-stage,
    .paytable,
    .game-controls {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
}
