/* ============================================
   BACKGAMMON SUPREME - Premium Lobby & Layout
   ClubGG-inspired pearl-white footer/header
   ============================================ */

:root {
    --tg-safe-top: 0px;
    --tg-safe-bottom: 0px;
    --tg-safe-left: 0px;
    --tg-safe-right: 0px;
    --tg-content-top: 0px;
    --tg-content-bottom: 0px;
    --tg-total-top: 0px;
    --footer-bg: linear-gradient(180deg, rgba(4,14,6,0.96), rgba(2,8,4,0.98));
    --footer-text: rgba(160,195,165,0.3);
    --footer-active: #c9944a;
    --header-bg: linear-gradient(180deg, rgba(4,14,6,0.98), rgba(2,10,4,0.96));
    /* Casino Felt D Theme */
    --felt-card: rgba(5,20,10,0.82);
    --felt-border: rgba(201,148,74,0.12);
    --felt-text: #c8deca;
    --felt-text-b: #eef5ef;
    --felt-text-d: rgba(160,195,165,0.45);
    --felt-gold: #c9944a;
}

/* === BACKGROUND — Casino Felt Green === */
body {
    background-color: #020804 !important;
    background-image:
        radial-gradient(ellipse 65% 45% at 50% 12%, rgba(30,82,36,0.5) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 85%, rgba(20,50,25,0.15) 0%, transparent 60%),
        radial-gradient(ellipse 90% 90% at 50% 50%, transparent 35%, rgba(2,8,4,0.7) 80%) !important;
}
/* Felt noise texture */
body::after {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    background-size: 256px 256px; opacity: 0.7; mix-blend-mode: overlay;
}
body > * { position: relative; z-index: 1; }
body.in-game { background-color: #0a0704 !important; background-image: none !important; }
body.in-game::after { display: none; }

/* === HEADER — Dark Green Glass === */
.g-header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(42,104,48,0.15);
    box-shadow: 0 3px 20px rgba(0,0,0,0.5);
    min-height: 50px;
}
.g-header::before {
    content: ''; position: absolute; bottom: -1px; left: 5%; right: 5%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,148,74,0.25), transparent);
}

/* Avatar */
.g-avatar-wrap { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.g-avatar-ring {
    position: absolute; inset: -3px; border-radius: 50%;
    background: conic-gradient(#c9944a 0%, #dbb86a 50%, #c9944a 100%);
}
.g-avatar {
    position: relative; z-index: 1;
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid #0a1a0e;
    background: radial-gradient(circle at 35% 35%, #1e3a22, #0a1a0e);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; overflow: hidden;
}
.g-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.g-user-info { margin-right: 6px; max-width: 90px; }
.g-user-name { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--felt-text-b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-user-level { font-size: 9px; color: var(--felt-gold); opacity: 0.6; }

/* Header center logo */
.g-header-btn {
    position: absolute; left: 50%; top: calc(50% + 2px); transform: translate(-50%, -50%);
    padding: 4px 14px;
    background: linear-gradient(170deg, #dbb86a, #c9944a 40%, #8a6a2e);
    border: none; border-radius: 12px;
    box-shadow: 0 2px 12px rgba(160,100,40,0.3), inset 0 1px 0 rgba(255,255,200,0.2), inset 0 -1px 0 rgba(0,0,0,0.15);
    cursor: pointer; overflow: hidden;
    max-width: 120px;
}
.g-header-btn span {
    font-family: 'Cinzel', serif;
    font-size: 10px; font-weight: 900; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 1.5px;
}
.g-header-btn::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: hShine 3s ease infinite;
}
@keyframes hShine { 0%{left:-100%} 50%{left:150%} 100%{left:150%} }

/* Balance pill */
.g-balance {
    display: flex; align-items: center; gap: 4px;
    background: rgba(6,20,10,0.7);
    border: 1px solid rgba(201,148,74,0.15);
    border-radius: 18px; padding: 4px 12px 4px 8px;
    box-shadow: none;
}
.g-balance-coin {
    width: 20px; height: 20px; border-radius: 50%;
    background: conic-gradient(from 30deg, #ffd700, #cc9900, #ffd700, #aa7700, #ffd700);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 900; color: #4a2800;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.4);
    border: 1px solid rgba(180,140,60,0.4);
}
.g-balance-amount {
    font-family: 'Cinzel', serif;
    font-size: 14px; font-weight: 900; color: #dbb86a;
}

/* ================================================
   PREMIUM FOOTER — Dark Gold
   ================================================ */
.g-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
}
.g-footer-glow {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 5%, rgba(0,0,0,0.04) 20%, 
        rgba(0,0,0,0.08) 50%, 
        rgba(0,0,0,0.04) 80%, transparent 95%);
}
.g-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 4px 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
    background: linear-gradient(180deg, rgba(4,14,6,0.96), rgba(2,8,4,0.98));
    border-top: 1px solid rgba(201,148,74,0.08);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
.g-nav-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 4px 6px 2px;
    border: none; background: none; cursor: pointer;
    position: relative; min-width: 48px;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s;
}
.g-nav-btn:active { transform: scale(0.88); }
.g-nav-ico {
    width: 22px; height: 22px;
    color: rgba(160,195,165,0.25);
    transition: color 0.2s;
    flex-shrink: 0;
}
.g-nav-btn.active .g-nav-ico {
    color: #c9944a;
}
.g-nav-txt {
    font-size: 9px; font-weight: 600;
    color: rgba(160,195,165,0.25);
    font-family: 'Rubik', 'Noto Sans Hebrew', sans-serif;
    transition: color 0.2s; letter-spacing: -0.2px;
}
.g-nav-btn.active .g-nav-txt { color: #c9944a; font-weight: 700; }
.g-nav-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: transparent;
    transition: background 0.2s;
    margin-top: 1px;
}
.g-nav-btn.active .g-nav-dot {
    background: #c9944a;
}
/* Old class compat */
.g-nav-item { display: none; }
.g-nav-spacer { display: none; }
.g-footer-spin { display: none !important; }
.g-footer-spin-text { display: none; }
.g-footer-wrap { display: contents; }
.g-footer-bump { display: none; }
.g-footer-center { display: none; }
/* Hide in game */
body.in-game .g-footer { display: none !important; }

/* Collect (gold button above footer) */
.g-footer-collect-text {
    font-family: 'Cinzel', serif;
    font-size: 12px; font-weight: 900; color: #fff; letter-spacing: 1px;
}
.g-footer-collect {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(50%);
    z-index: 10; padding: 7px 20px;
    background: linear-gradient(180deg, #c9944a, #a87530);
    border: none; border-radius: 18px;
    box-shadow: 0 4px 15px rgba(180,120,48,0.35);
    cursor: pointer; display: flex; align-items: center; gap: 5px;
    direction: ltr;
}

/* === LOBBY CONTENT — Light Clean === */
.lobby-container { max-width: 500px; margin: 0 auto; padding: 10px 12px 100px; }

/* PLAY HERO — Felt green with premium gold frame */
.g-play-hero {
    position: relative; margin: 10px 0 14px;
    border-radius: 16px; overflow: hidden; cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(201,148,74,0.08),
        0 10px 40px rgba(0,0,0,0.5),
        inset 0 0 50px rgba(0,0,0,0.35),
        inset 0 0 80px rgba(30,82,36,0.08);
    border: 2px solid rgba(201,148,74,0.22);
    background:
        radial-gradient(ellipse 90% 80% at 50% 30%, rgba(42,104,48,0.3) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 50% 50%, #1a4a22 0%, #0e2814 45%, #060e08 85%);
    min-height: 110px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.g-play-hero:active { transform: scale(0.985); }
/* Inner gold frame */
.g-play-hero::before {
    content: ''; position: absolute; inset: 6px; border-radius: 12px;
    border: 1px solid rgba(201,148,74,0.1); pointer-events: none; z-index: 2;
}
/* Gold shimmer line */
.g-play-hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
    overflow: hidden; z-index: 3;
    background: linear-gradient(90deg, transparent, rgba(240,208,120,0.3), transparent);
    animation: heroShimmer 5s ease-in-out infinite;
}
@keyframes heroShimmer {
    0% { opacity: 0.3; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
    100% { opacity: 0.3; transform: translateX(-100%); }
}
.g-play-content { text-align: center; z-index: 1; padding: 14px; }
.g-play-dice {
    font-size: 38px; margin-bottom: 2px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
    animation: diceFloat 3s ease infinite;
}
@keyframes diceFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.g-play-text {
    font-family: 'Cinzel', serif;
    font-size: clamp(26px, 7vw, 38px); font-weight: 900;
    background: linear-gradient(
        180deg,
        #fffef0 0%,
        #f5e6a0 8%,
        #e8c560 18%,
        #f0d878 28%,
        #c9944a 42%,
        #a07028 52%,
        #c9944a 60%,
        #f0d878 72%,
        #e8c560 82%,
        #a07028 92%,
        #6a4a18 100%
    );
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(201,148,74,0.4)) drop-shadow(0 0 18px rgba(240,208,120,0.15));
    letter-spacing: 5px;
    position: relative;
}
.g-play-sub { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.g-play-left, .g-play-right {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center;
    opacity: 1;
}
.g-play-left { right: 14px; }
.g-play-right { left: 14px; }

/* ACTION CARDS — dark green cards */
.g-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.g-action {
    position: relative;
    background: var(--felt-card);
    border: 1px solid var(--felt-border); border-radius: 12px;
    padding: 14px 6px 12px; text-align: center; cursor: pointer;
    overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: transform 0.12s;
}
.g-action:active { transform: scale(0.94); border-color: rgba(201,148,74,0.25); }
.g-action::before { display: none; }
.g-action-icon { font-size: 26px; margin-bottom: 3px; }
.g-action-label { font-size: 11px; font-weight: 700; color: var(--felt-text); text-shadow: none; }

/* BET ROW */
.g-bet-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 10px; padding: 8px 10px;
    background: var(--felt-card); border: 1px solid var(--felt-border); border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.g-bet-label { font-size: 12px; color: var(--felt-text-d); font-weight: 700; flex-shrink: 0; }
.g-bet-chips { display: flex; gap: 5px; flex: 1; justify-content: center; flex-wrap: wrap; }
.g-chip {
    padding: 4px 12px; border-radius: 14px;
    border: 1.5px solid rgba(42,104,48,0.25); background: rgba(8,28,12,0.5);
    color: var(--felt-text); font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
}
.g-chip.active {
    background: linear-gradient(135deg, #c9944a, #d4a847);
    border-color: #c9944a; color: #fff;
    box-shadow: 0 2px 8px rgba(201,148,74,0.3);
}

/* STATS */
.g-stats { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.g-stat {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 12px;
    background: var(--felt-card); border: 1px solid var(--felt-border); font-size: 11px;
}
.g-stat b { color: var(--felt-text-b); }
.g-stat span:last-child { color: var(--felt-text-d); }

/* Section titles */
.g-section-title { color: var(--felt-gold) !important; }

/* LEADERBOARD */
.g-lb-title { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; color: var(--felt-gold); }
.g-lb-more { font-size: 11px; color: var(--felt-text-d); cursor: pointer; }
.g-lb-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--felt-card); border-radius: 10px;
    padding: 8px; margin-bottom: 5px;
    border: 1px solid var(--felt-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.g-lb-rank { min-width: 24px; text-align: center; font-weight: 900; color: #c9944a; font-family: 'Cinzel', serif; }
.g-lb-avatar { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #1a3a20, #0a1a0e); border: 1.5px solid rgba(201,148,74,0.12); display: flex; align-items: center; justify-content: center; font-size: 14px; overflow: hidden; }
.g-lb-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.g-lb-name { flex: 1; font-size: 12px; font-weight: 700; color: var(--felt-text-b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-lb-elo { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; color: #c9944a; }

/* ROOM LIST */
.g-rooms { margin-bottom: 16px; }
.g-room {
    display: flex; align-items: center; gap: 10px;
    background: var(--felt-card); border-radius: 10px; border: 1px solid var(--felt-border);
    padding: 10px; margin-bottom: 6px; cursor: pointer; transition: transform 0.1s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.g-room:active { transform: scale(0.98); }
.g-room-bet { min-width: 48px; text-align: center; font-family: 'Cinzel', serif; font-size: 16px; font-weight: 900; color: #c9944a; }
.g-room-info { flex: 1; }
.g-room-host { font-size: 13px; font-weight: 700; color: var(--felt-text-b); }
.g-room-sub { font-size: 10px; color: var(--felt-text-d); }
.g-room-status {
    padding: 3px 10px; border-radius: 10px; font-size: 10px; font-weight: 700;
    background: rgba(53,138,64,0.12); color: #6abf6e; border: 1px solid rgba(53,138,64,0.12);
}
.g-room-status.playing { background: rgba(201,148,74,0.08); color: #dbb86a; border-color: rgba(201,148,74,0.12); }

/* GAME PAGE */
#page-game.active { display: flex; flex-direction: column; min-height: 100dvh; background: none; }
#page-game.active .game-board-area { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4px; }
.game-footer {
    display: flex; justify-content: center; gap: 8px;
    padding: 8px 12px 12px; background: rgba(4,14,6,0.9);
}
.game-footer .btn { min-width: 80px; font-size: 12px; padding: 8px 14px; border-radius: 8px; }

/* Page padding */
#page-leaderboard .lobby-container,
#page-profile .lobby-container { padding-top: 12px; }

/* Online indicator */
.g-online-row {
    display: flex; gap: 14px; justify-content: center; margin-bottom: 10px;
    font-size: 12px; color: var(--felt-text-d);
}
.g-online-pulse {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #4caf50; margin-right: 4px; vertical-align: middle;
    box-shadow: 0 0 6px #4caf50;
    animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* === TG MODE === */
body.tg-mode .g-header {
    position: fixed; top: 0; left: 0; right: 0;
    padding-top: calc(var(--tg-content-top, 0px) + 32px);
    min-height: calc(50px + var(--tg-content-top, 0px) + 32px);
}
body.tg-mode.tg-ios .g-header {
    padding-top: calc(var(--tg-content-top, 0px) + 36px);
    min-height: calc(50px + var(--tg-content-top, 0px) + 36px);
}
body.tg-mode #appContent {
    padding-top: calc(58px + var(--tg-content-top, 0px) + 32px);
}
body.tg-mode.tg-ios #appContent {
    padding-top: calc(58px + var(--tg-content-top, 0px) + 36px);
}
body.tg-mode .g-footer-bar {
    padding-bottom: calc(var(--tg-safe-bottom, 0px) + 6px);
}
body.tg-mode.tg-ios .g-footer-bar {
    padding-bottom: calc(var(--tg-safe-bottom, 0px) + 10px);
}
body.tg-mode .g-nav-btn {
    min-width: 42px;
    padding: 3px 4px 1px;
}
body.tg-mode .g-nav-txt {
    font-size: 8px;
}
body.admin-mode .g-footer-collect {
    display: none !important;
}

/* Turn banner - hidden */
.turn-banner { display: none !important; }

/* === CHAT === */
.game-chat {
    position: fixed !important;
    bottom: 52px; left: 0; right: 0;
    max-height: 40vh;
    background: rgba(30,25,20,0.95) !important;
    border-top: 1px solid rgba(0,0,0,0.1);
    z-index: 80;
    display: flex; flex-direction: column;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 8px; max-height: 30vh; }
.chat-input-row {
    display: flex; gap: 4px; padding: 6px 8px;
    border-top: 1px solid rgba(100,60,30,0.2);
}

/* Hide header in game */
#page-game.active ~ #gHeader { display: none !important; }

/* === ADMIN PANEL — Light Clean === */
.admin-container { max-width: 600px; margin: 0 auto; padding: 10px 12px 120px; }

.admin-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px;
}
@media (max-width: 420px) { .admin-stats-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; } }
.admin-stat {
    background: var(--felt-card);
    border: 1px solid var(--felt-border); border-radius: 8px;
    padding: 8px 4px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    overflow: hidden;
}
.admin-stat.warn { border-color: rgba(255,152,0,0.3); }
.admin-stat.green .admin-stat-num { color: #6abf6e; }
.admin-stat.blue .admin-stat-num { color: #6ab2e8; }
.admin-stat-num {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--felt-text-b); line-height: 1.3;
    font-family: 'Rubik', sans-serif;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-stat.warn .admin-stat-num { color: #ff9800; }
.admin-stat-label { display: block; font-size: 9px; color: var(--felt-text-d); margin-top: 2px; }

.admin-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    margin-bottom: 12px; padding: 6px;
    background: rgba(6,20,10,0.5); border: 1px solid var(--felt-border); border-radius: 12px;
}
.admin-tab {
    padding: 10px 4px; font-size: 12px; font-weight: 700; color: var(--felt-text-d);
    background: var(--felt-card); border: 1px solid var(--felt-border);
    border-radius: 8px; cursor: pointer; text-align: center;
    transition: all 0.2s; white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.admin-tab:active { transform: scale(0.96); }
.admin-tab.active {
    background: linear-gradient(145deg, #c9944a, #8a6a2e); color: #fff;
    border-color: transparent; box-shadow: 0 2px 10px rgba(201,148,74,0.25);
}
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

.admin-card {
    background: var(--felt-card);
    border: 1px solid var(--felt-border); border-radius: 10px;
    padding: 14px; margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.admin-card-title { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.admin-card-title.blue { color: #2196f3; }
.admin-card-title.green { color: #4caf50; }
.admin-card-title.orange { color: #ff9800; }

.admin-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.admin-btn-grid .btn { font-size: 11px; }

.admin-label { display: block; font-size: 11px; color: var(--felt-text-d); margin-bottom: 3px; font-weight: 600; }
.admin-input {
    width: 100%; padding: 8px;
    background: rgba(4,16,8,0.6); border: 1px solid var(--felt-border);
    border-radius: 6px; color: var(--felt-text-b); font-size: 13px;
}

.admin-search-bar { display: flex; gap: 6px; margin-bottom: 10px; align-items: center; }
.admin-search-bar input {
    flex: 1; padding: 10px 12px;
    background: var(--felt-card); border: 1px solid var(--felt-border);
    border-radius: 8px; color: var(--felt-text-b); font-size: 13px;
}

.admin-user-card {
    background: var(--felt-card);
    border: 1px solid var(--felt-border); border-radius: 10px;
    padding: 12px; margin-bottom: 8px; transition: border-color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.admin-user-card:hover, .admin-user-card:active { border-color: rgba(201,148,74,0.3); }
.admin-user-card.pending { border-color: rgba(255,152,0,0.3); }
.admin-user-card.closed { opacity: 0.4; }
.admin-user-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.admin-user-name { font-weight: 800; color: #c9944a; font-size: 14px; }
.admin-user-meta { font-weight: 400; color: var(--felt-text-d); font-size: 11px; margin-right: 4px; }
.admin-badge { font-size: 10px; color: var(--felt-text-d); background: rgba(201,148,74,0.06); padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.admin-user-stats {
    display: flex; flex-wrap: wrap; gap: 6px 10px;
    font-size: 11px; color: var(--felt-text-d); margin-bottom: 8px; padding: 6px 0;
    border-top: 1px solid rgba(201,148,74,0.06);
    border-bottom: 1px solid rgba(201,148,74,0.06);
}
.admin-user-balance { color: #6abf6e; font-weight: 700; }
.admin-user-detail { font-size: 11px; color: var(--felt-text-d); margin-bottom: 4px; }
.admin-ticket-msg {
    color: var(--felt-text); font-size: 13px; padding: 6px 8px; margin: 6px 0;
    background: rgba(201,148,74,0.04); border-radius: 6px;
    border-right: 3px solid rgba(201,148,74,0.2);
}
.admin-user-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.admin-user-actions .btn { font-size: 11px; padding: 5px 10px; }

/* TG mode pages padding */
body.tg-mode .page { padding-bottom: 110px; }
body.tg-mode.tg-ios .page { padding-bottom: 120px; }

/* ================================================
   CASINO FELT THEME OVERRIDES — All Pages
   ================================================ */

/* Modal — dark felt */
.modal { background: rgba(2,6,3,0.75) !important; backdrop-filter: blur(4px); }
.modal-content {
    background: linear-gradient(160deg, rgba(10,36,16,0.97), rgba(4,16,8,0.99)) !important;
    border: 1.5px solid rgba(201,148,74,0.14) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55) !important;
    border-radius: 16px !important;
}
.modal-header { color: var(--felt-gold) !important; font-family: 'Cinzel', serif; }
.modal-body { color: var(--felt-text-d); }
.modal-body input {
    background: rgba(4,16,8,0.6) !important;
    border: 1px solid rgba(201,148,74,0.1) !important;
    color: var(--felt-text-b) !important;
    border-radius: 8px !important;
}
.modal-body input:focus { border-color: #c9944a !important; }
.modal-footer .btn { border-radius: 8px !important; }

/* Buttons — dark felt */
.btn-primary {
    background: linear-gradient(145deg, #f0d078, #c9944a 45%, #8a6a2e) !important;
    color: #1a0a00 !important; border-color: rgba(201,148,74,0.3) !important;
    box-shadow: 0 2px 12px rgba(201,148,74,0.25) !important;
}
.btn-secondary {
    border-color: rgba(201,148,74,0.12) !important;
    color: var(--felt-text-d) !important; background: rgba(8,28,12,0.5) !important;
}
.btn-danger {
    border-color: rgba(239,83,80,0.2) !important;
    color: #ef5350 !important; background: rgba(239,83,80,0.08) !important;
}
.btn { color: var(--felt-text); }
.btn:not(.btn-primary):not(.btn-danger):not(.btn-secondary) {
    background: var(--felt-card); border-color: var(--felt-border); color: var(--felt-text);
}

/* Section titles — all pages */
.section-title {
    color: var(--felt-gold) !important;
    text-shadow: none !important;
}
.section-title-fancy { color: var(--felt-gold) !important; text-shadow: none !important; }

/* General page text */
.page { color: var(--felt-text); }
.g-empty { color: var(--felt-text-d) !important; }
.rooms-grid .g-empty { color: var(--felt-text-d); }

/* === PROFILE PAGE — felt === */
#page-profile { color: var(--felt-text); }
.profile-container { color: var(--felt-text); }
.profile-card {
    background: var(--felt-card) !important;
    border: 1px solid var(--felt-border) !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.3) !important;
    border-radius: 16px !important;
}
.profile-avatar-large {
    background: radial-gradient(circle at 35% 35%, #1e3a22, #0a1a0e) !important;
    border: 3px solid rgba(201,148,74,0.2) !important;
    color: var(--felt-gold) !important;
}
.pstat-val { color: #c9944a !important; }
.pstat-lbl { color: var(--felt-text-d) !important; }

/* === LEADERBOARD PAGE — felt === */
#page-leaderboard { color: var(--felt-text); }

/* === HISTORY PAGE — felt === */
#page-history { color: var(--felt-text); }
#historyList { color: var(--felt-text); }

/* === CASHBACK PAGE — felt === */
#page-cashback { color: var(--felt-text); }

/* === AGENT PAGE — felt === */
#page-agent { color: var(--felt-text); }
#page-agent .admin-container { color: var(--felt-text); }

/* === ADMIN PANEL — felt === */
.admin-container { color: var(--felt-text); }
.admin-stats-grid .stat-card { background: var(--felt-card) !important; }
.stat-card {
    background: var(--felt-card) !important;
    border: 1px solid var(--felt-border) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.stat-num { color: #c9944a !important; }
.stat-label { color: var(--felt-text-d) !important; }
.admin-stats-bar {
    background: var(--felt-card) !important;
    border: 1px solid var(--felt-border) !important;
    border-radius: 10px !important;
    color: var(--felt-text) !important;
}

/* === TOAST — dark green === */
.toast-container .toast {
    background: rgba(8,28,12,0.92) !important;
    color: var(--felt-text-b) !important;
    border: 1px solid rgba(201,148,74,0.15) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* === SETTINGS BUTTONS in pages === */
#page-profile .btn, #page-cashback .btn, #page-history .btn {
    background: var(--felt-card); border: 1px solid var(--felt-border);
    color: var(--felt-text); box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#page-profile .btn-primary, #page-cashback .btn-primary, #page-history .btn-primary {
    background: linear-gradient(145deg, #f0d078, #c9944a, #8a6a2e) !important;
    color: #1a0a00 !important;
}

/* === SUPPORT / SETTINGS modal overrides === */
.modal-content .admin-input {
    background: rgba(4,16,8,0.6) !important; border: 1px solid rgba(201,148,74,0.1) !important;
    color: var(--felt-text-b) !important;
}

/* === CLUBS PAGE — light (handled by clubs.css) === */

/* === LOGIN PAGE — felt === */
.login-card {
    background: linear-gradient(160deg, rgba(10,36,16,0.95), rgba(4,16,8,0.98)) !important;
    border: 1px solid rgba(201,148,74,0.14) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.login-card input {
    background: rgba(4,16,8,0.6) !important;
    border: 1px solid rgba(201,148,74,0.1) !important;
    color: var(--felt-text-b) !important;
    font-family: 'Rubik', sans-serif;
}
.login-card input::placeholder { color: var(--felt-text-d) !important; }
.login-card input:focus { border-color: #c9944a !important; }
.login-card p { color: var(--felt-text-d) !important; }
.lobby-title { color: var(--felt-gold) !important; text-shadow: none !important; }
.lobby-title .gold { color: #c9944a !important; -webkit-text-fill-color: #c9944a !important; }
.lobby-sub { color: var(--felt-text-d) !important; }

/* === SPIN PAGE — keep dark cosmic theme === */
#page-spin { background: transparent; }

/* === ADMIN PANEL — Ensure felt theme for all tabs === */
#page-admin {
    background: transparent;
    color: var(--felt-text);
}
#page-admin .admin-tab-content {
    background: transparent;
    color: var(--felt-text);
}
#adminTabClubs {
    background: transparent !important;
}
#adminTabClubs #clubsContainer {
    color: var(--felt-text);
}
/* Admin history tab */
#adminTabAllHistory {
    background: transparent !important;
    color: var(--felt-text);
}

/* === Floating Undo Button === */
.btn-undo-float {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(0,0,0,0.5); border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8); display: inline-flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 0.15s;
    backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.btn-undo-float:active { transform: scale(0.9); background: rgba(0,0,0,0.7); }

/* === Hide Scrollbar Globally === */
::-webkit-scrollbar { width: 0 !important; height: 0 !important; }
* { scrollbar-width: none !important; }

/* === ROOM CARDS — Casino Felt Design === */
.room-card {
    background: var(--felt-card); border-radius: 12px;
    border: 1px solid var(--felt-border);
    margin-bottom: 8px; transition: transform 0.1s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.room-card:active { transform: scale(0.98); }
.room-empty {
    text-align: center; padding: 20px; color: var(--felt-text-d);
    font-size: 13px; font-style: italic;
}
.room-status {
    padding: 3px 10px; border-radius: 10px; font-size: 10px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
}
.room-status.playing { background: rgba(201,148,74,0.08); color: #dbb86a; }

/* === PAGE SCROLL FIX === */
/* Main scroll fix is in game-v2.css. This is backup. */
body.in-game #appContent {
    height: auto !important;
    overflow: visible !important;
}
