/* ===========================================================================
   Casinary — dark-luxe theme
   Deep charcoal • emerald felt • gold trim • glassmorphism
   =========================================================================== */

:root {
    --bg:          #080b0a;
    --bg-2:        #0d1311;
    --panel:       rgba(255, 255, 255, 0.045);
    --panel-2:     rgba(255, 255, 255, 0.07);
    --panel-brd:   rgba(255, 255, 255, 0.09);
    --felt:        #0c7a43;
    --felt-deep:   #064529;
    --emerald:     #2ee27a;
    --emerald-dim: #1ba85a;
    --gold:        #d8b14a;
    --gold-soft:   #f3dd96;
    --text:        #f3f7f4;
    --muted:       #94a39a;
    --win:         #4be08a;
    --lose:        #ff6063;
    --accent:      var(--gold);
    --radius:      18px;
    --radius-sm:   12px;
    --shadow:      0 20px 50px -20px rgba(0, 0, 0, 0.8);
    --shadow-gold: 0 10px 40px -10px rgba(216, 177, 74, 0.4);
    --blur:        blur(16px);
    --sidebar-w:   248px;
    --ease:        cubic-bezier(0.22, 1, 0.36, 1);
    --font:        'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display:'Clash Display', 'Playfair Display', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 80% -10%, rgba(12, 122, 67, 0.18), transparent 60%),
        radial-gradient(900px 700px at -10% 110%, rgba(216, 177, 74, 0.1), transparent 55%),
        var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button {
    font-family: inherit; cursor: pointer;
    /* Kill the mobile double-tap-to-zoom gesture on fast tapping (e.g. the Wordie
       keyboard) without disabling pinch-zoom on page content. */
    touch-action: manipulation;
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ---------- App shell ---------- */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* Mobile-only overlay. Hidden + out of flow on desktop so it never becomes a
   grid cell (which would shove the sidebar/content into the wrong tracks). */
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 39; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, rgba(13,19,17,0.95), rgba(8,11,10,0.95));
    border-right: 1px solid var(--panel-brd);
    backdrop-filter: var(--blur);
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    gap: 8px;
    z-index: 40;
}

.sidebar .logo { padding: 6px 10px 22px; }
.sidebar .logo img { height: 34px; width: auto; }
.brand-word {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(120deg, var(--gold-soft), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-word span { color: var(--emerald); -webkit-text-fill-color: var(--emerald); }

.main-nav ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.main-nav a {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.25s var(--ease);
    position: relative;
}
.main-nav a i { width: 20px; text-align: center; font-size: 1rem; }
.main-nav a:hover { color: var(--text); background: var(--panel); }
.main-nav li.active a {
    color: #08110b;
    background: linear-gradient(120deg, var(--gold-soft), var(--gold));
    box-shadow: var(--shadow-gold);
}

.sidebar-spacer { flex: 1; }

.user-info {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: var(--radius-sm);
    background: var(--panel); border: 1px solid var(--panel-brd);
}
.user-info .avatar { position: relative; }
.user-info .avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.user-info .status { position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg-2); }
.user-info .status.online { background: var(--emerald); }
.user-identity { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; border-radius: 10px; }
.user-identity:hover { opacity: 0.9; }
.user-details h4 { font-size: 0.9rem; }
.user-details p { font-size: 0.78rem; color: var(--muted); }
.logout-link { color: var(--muted); margin-left: auto; font-size: 0.95rem; padding: 6px; }
.logout-link:hover { color: var(--lose); }

/* ---------- Main content ---------- */
.main-content { display: flex; flex-direction: column; min-height: 100vh; }

.content-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 18px 32px;
    background: linear-gradient(180deg, rgba(8,11,10,0.85), rgba(8,11,10,0.4));
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--panel-brd);
}
.content-header h1 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.content-header h1 .accent { color: var(--gold); }

.user-balance { display: flex; gap: 12px; align-items: center; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--panel); border: 1px solid var(--panel-brd); color: var(--text);
    display: grid; place-items: center; font-size: 0.95rem;
    transition: all 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn[aria-pressed="false"] { color: var(--muted); }

/* Level badge — number inside a conic-gradient XP-progress ring (--p = 0..100). */
@property --p { syntax: '<number>'; initial-value: 0; inherits: false; }
.level-badge {
    position: relative; width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0;
    background: conic-gradient(var(--gold) calc(var(--p, 0) * 1%), rgba(255,255,255,0.12) 0);
    transition: --p 0.6s var(--ease);
}
.level-badge::before {
    content: ""; position: absolute; inset: 3px; border-radius: 50%;
    background: var(--bg-2); border: 1px solid var(--panel-brd);
}
.lvl-num { position: relative; font-weight: 800; font-size: 0.95rem; line-height: 1; color: var(--gold-soft); }
.lvl-num::before { content: "Lv"; display: block; font-size: 0.5rem; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; }

/* Level-up celebration banner */
.levelup-banner {
    position: fixed; top: 22%; left: 50%; transform: translateX(-50%); z-index: 120;
    display: flex; align-items: center; gap: 16px; padding: 20px 30px; border-radius: 20px;
    background: linear-gradient(120deg, var(--gold-soft), var(--gold));
    color: #08110b; box-shadow: 0 24px 70px -10px rgba(216,177,74,0.6);
    pointer-events: none; text-align: left;
}
.levelup-banner i { font-size: 2.2rem; }
.levelup-banner .lu-title { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.levelup-banner .lu-sub { display: block; font-size: 0.95rem; font-weight: 600; opacity: 0.85; }
.balance-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--panel-brd);
    font-weight: 700; font-size: 0.95rem;
    transition: transform 0.2s var(--ease);
}
.balance-item i { font-size: 0.9rem; }
.balance-item.chips i { color: var(--gold); }
.balance-item.gems i { color: #5bd1ff; }
.balance-item.bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 0%{transform:scale(1)} 40%{transform:scale(1.14)} 100%{transform:scale(1)} }

.main-area { padding: 28px 32px 80px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Section transitions ---------- */
.section-enter { animation: sectionIn 0.45s var(--ease) both; }
@keyframes sectionIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.section-title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 4px; }
.section-sub { color: var(--muted); margin-bottom: 24px; font-size: 0.95rem; }
.section-empty, .section-auth { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Glass panel ---------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-brd);
    border-radius: var(--radius);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 12px 22px; border-radius: 999px; border: none;
    font-weight: 700; font-size: 0.95rem; color: #08110b;
    background: linear-gradient(120deg, var(--gold-soft), var(--gold));
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
    box-shadow: var(--shadow-gold);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 44px -10px rgba(216,177,74,0.55); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
    background: var(--panel); color: var(--text); border: 1px solid var(--panel-brd); box-shadow: none;
}
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); transform: translateY(-2px); }
.btn-emerald {
    background: linear-gradient(120deg, var(--emerald), var(--emerald-dim)); color: #04140a;
    box-shadow: 0 10px 40px -10px rgba(46,226,122,0.45);
}
.btn-danger { background: linear-gradient(120deg, #ff7a7c, var(--lose)); color: #1a0606; box-shadow: none; }
.btn.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(216,177,74,0.5)} 50%{box-shadow:0 0 0 12px rgba(216,177,74,0)} }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card {
    padding: 20px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--panel-brd);
    display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden;
    transition: transform 0.3s var(--ease);
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card .ic {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.1rem; margin-bottom: 6px;
    background: rgba(216,177,74,0.14); color: var(--gold);
}
.stat-card.green .ic { background: rgba(46,226,122,0.14); color: var(--emerald); }
.stat-card.blue .ic  { background: rgba(91,209,255,0.14); color: #5bd1ff; }
.stat-card.purple .ic{ background: rgba(177,140,255,0.16); color: #b18cff; }
.stat-card h3 { font-size: 1.7rem; font-weight: 800; }
.stat-card p { color: var(--muted); font-size: 0.82rem; }
.xp-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.08); margin-top: 8px; overflow: hidden; }
.xp-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--emerald)); transition: width 0.8s var(--ease); }

/* ---------- Cards / grids ---------- */
.cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 26px; }
.block-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.block-title:first-child { margin-top: 0; }
.block-title h2 { font-size: 1.15rem; font-family: var(--font-display); }
.block-title a { color: var(--gold); font-size: 0.85rem; font-weight: 600; }

/* ---------- Daily bonus ---------- */
.bonus-card { padding: 22px; }
.bonus-progress { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 16px 0; }
.day {
    aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; gap: 2px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--panel-brd);
    font-size: 0.7rem; color: var(--muted); position: relative;
}
.day i { font-size: 1rem; }
.day .d { font-size: 0.62rem; }
.day.claimed { color: var(--emerald); border-color: rgba(46,226,122,0.4); }
.day.active { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 2px rgba(216,177,74,0.25) inset; }
.day.special { color: #5bd1ff; }

/* ---------- Game cards ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.game-card {
    border-radius: var(--radius); overflow: hidden;
    background: var(--panel); border: 1px solid var(--panel-brd);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
    position: relative;
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(216,177,74,0.4); }
.game-image { position: relative; aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, var(--felt-deep), #04130b); }
.game-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.game-card:hover .game-image img { transform: scale(1.08); }
.game-overlay {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: linear-gradient(0deg, rgba(4,12,8,0.85), rgba(4,12,8,0.1));
    opacity: 0; transition: opacity 0.3s var(--ease);
}
.game-card:hover .game-overlay { opacity: 1; }
.game-info { padding: 16px; }
.game-info h4 { font-size: 1.05rem; margin-bottom: 8px; }
.game-stats { display: flex; gap: 14px; color: var(--muted); font-size: 0.8rem; }
.game-stats i { color: var(--gold); margin-right: 4px; }
.badge {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    padding: 4px 10px; border-radius: 999px; font-size: 0.68rem; font-weight: 700;
    background: linear-gradient(120deg, var(--gold-soft), var(--gold)); color: #08110b;
}

/* ---------- Game board (table) ---------- */
.game-shell { display: flex; flex-direction: column; gap: 20px; }
.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.game-topbar h2 { font-family: var(--font-display); font-size: 1.5rem; }
.table-felt {
    background:
        radial-gradient(120% 90% at 50% -10%, var(--felt), var(--felt-deep) 70%);
    border: 1px solid rgba(216,177,74,0.25);
    border-radius: 28px;
    padding: 28px;
    box-shadow: inset 0 0 80px rgba(0,0,0,0.45), var(--shadow);
    position: relative;
    overflow: hidden;
}
.table-felt::after {
    content: ""; position: absolute; inset: 14px; border-radius: 22px;
    border: 1px dashed rgba(255,255,255,0.12); pointer-events: none;
}
.hand-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.hand-label { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.9rem; }
.hand-total { background: rgba(0,0,0,0.35); padding: 3px 11px; border-radius: 999px; font-size: 0.82rem; }
.cards { display: flex; gap: 10px; min-height: 132px; flex-wrap: wrap; perspective: 900px; }

/* Blackjack split hands */
.bj-hands { display: flex; gap: 16px; flex-wrap: wrap; }
.bj-hand { border-radius: 14px; padding: 8px; transition: background 0.2s, box-shadow 0.2s; }
.bj-hands .bj-hand + .bj-hand,
.bj-hand.active { background: rgba(0,0,0,0.18); }
.bj-hand.active { box-shadow: inset 0 0 0 2px var(--gold); }
.bj-hand.settled.win-text { box-shadow: inset 0 0 0 2px var(--emerald, #2fbf71); }
.bj-hand.settled.lose-text { opacity: 0.72; }
.bj-hand-head { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.8); font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }
.bj-hand-tag { background: rgba(0,0,0,0.4); padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; }
.bj-hand.win-text .bj-hand-tag { color: var(--gold); }
/* When not split there's a single hand box — strip its padding/background. */
.bj-hands:not(:has(.bj-hand + .bj-hand)) .bj-hand { padding: 0; background: none; box-shadow: none; }

.card {
    width: 92px; height: 130px; border-radius: 10px;
    transform-style: preserve-3d; will-change: transform;
    flex-shrink: 0;
}
.card img { width: 100%; height: 100%; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
/* The house's face-down cards use the same back image, rotated 180° so it "faces"
   the dealer/banker. Only applies while face-down; a flipped face is upright. */
#dealer-cards .card[data-code="__back__"] img,
#bacc-banker-cards .card[data-code="__back__"] img,
#gin-cpu .card[data-code="__back__"] img { transform: rotate(180deg); }
.card.placeholder { background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.2); border-radius: 10px; }

.game-message {
    text-align: center; font-size: 1.05rem; font-weight: 700; min-height: 26px;
    color: rgba(255,255,255,0.92); letter-spacing: 0.3px;
}
.win-text { color: var(--win) !important; }
.lose-text { color: var(--lose) !important; }
.push-text { color: var(--gold) !important; }

.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.bet-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bet-input-wrap { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 999px; padding: 6px 8px 6px 16px; }
.bet-input-wrap label { color: var(--muted); font-size: 0.85rem; }
.bet-input-wrap input {
    width: 110px; background: transparent; border: none; color: var(--text);
    font-size: 1rem; font-weight: 700; outline: none;
}
.chip-quick { display: flex; gap: 6px; }
.chip-quick button {
    padding: 7px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
    background: var(--panel-2); color: var(--text); border: 1px solid var(--panel-brd);
}
.chip-quick button:hover { border-color: var(--gold); }
.limits { color: rgba(255,255,255,0.6); font-size: 0.8rem; text-align: center; }
.hidden { display: none !important; }

/* ---------- Shared game-control hierarchy ---------- */
/* Larger primary buttons (Deal/Hit/Stand/Spin/Roll…) to anchor the eye. */
.btn-lg { padding: 14px 30px; font-size: 1.02rem; }
/* Secondary tier — optional moves read as lighter, not co-equal with the primary pair. */
.btn-sub {
    padding: 9px 16px; font-size: 0.82rem; font-weight: 700;
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--panel-brd); box-shadow: none;
}
.btn-sub:hover:not(:disabled) { border-color: var(--gold); background: var(--panel); transform: translateY(-2px); }
/* Group of in-play actions: a primary pair + an optional secondary tier after a divider. */
.action-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.action-sep { width: 1px; height: 28px; background: var(--panel-brd); margin: 0 4px; }

/* ---------- Shared end-of-round overlay ---------- */
/* Sits over the gameboard (its parent must be position:relative). Translucent so
   the final cards/dice/reels stay visible behind it, with the outcome + a single
   prominent replay CTA — keeps round results out of the controls row. */
.game-result {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    background: radial-gradient(120% 90% at 50% 50%, rgba(0,0,0,0.4), rgba(0,0,0,0.72));
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    border-radius: 28px;
}
.game-result[hidden] { display: none; }
.wordie-board { position: relative; }
.game-result-text {
    font-family: var(--font-display); font-size: 1.9rem; font-weight: 800;
    text-align: center; padding: 0 24px; text-shadow: 0 2px 18px rgba(0,0,0,0.6);
}

/* ---------- Pay tables (shared) ---------- */
.paytable { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.paytable td { padding: 7px 10px; border-bottom: 1px solid var(--panel-brd); }
.paytable td:last-child { text-align: right; color: var(--gold); font-weight: 700; }
.paytable tr.hit { background: rgba(216,177,74,0.16); }

/* ---------- Three Card Poker ---------- */
.tcp-layout { grid-template-columns: 1.6fr 1fr; align-items: start; }
.tcp-pays .block-title { margin: 18px 0 8px; }
.tcp-pays .block-title:first-child { margin-top: 0; }
.tcp-pays .block-title h2 { font-size: 1rem; }
.tcp-note { margin-top: 14px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.tcp-note strong { color: var(--text); }
.bet-input-wrap .opt { color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.tcp-play-amt { opacity: 0.85; font-weight: 600; margin-left: 4px; }
@media (max-width: 880px) { .tcp-layout { grid-template-columns: 1fr; } }

/* ---------- Baccarat ---------- */
.bacc-sides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bacc-side {
    padding: 16px; border-radius: var(--radius-sm); text-align: center; cursor: pointer;
    background: var(--panel); border: 2px solid var(--panel-brd); transition: all 0.2s var(--ease);
}
.bacc-side:hover { border-color: var(--gold); }
.bacc-side.selected { border-color: var(--gold); background: rgba(216,177,74,0.14); }
.bacc-side h4 { font-size: 1rem; margin-bottom: 4px; }
.bacc-side .odds { color: var(--muted); font-size: 0.8rem; }
.bacc-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- Wordie ---------- */
.wordie-grid { display: grid; grid-template-rows: repeat(6, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; }
.wordie-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wordie-tile {
    aspect-ratio: 1; display: grid; place-items: center;
    font-size: 1.6rem; font-weight: 800; text-transform: uppercase;
    border-radius: 10px; border: 2px solid var(--panel-brd); background: rgba(255,255,255,0.03);
    transition: transform 0.3s var(--ease);
}
.wordie-tile.filled { border-color: rgba(255,255,255,0.35); animation: pop 0.15s var(--ease); }
.wordie-tile.correct { background: var(--emerald-dim); border-color: var(--emerald-dim); color: #04140a; }
.wordie-tile.present { background: var(--gold); border-color: var(--gold); color: #1a1304; }
.wordie-tile.absent  { background: #1c2522; border-color: #1c2522; color: var(--muted); }
.wordie-tile.flip { animation: flip 0.5s var(--ease); }
@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes flip { 0%{transform:rotateX(0)} 50%{transform:rotateX(90deg)} 100%{transform:rotateX(0)} }
.kbd { display: grid; gap: 6px; max-width: 480px; margin: 18px auto 0; touch-action: manipulation; }
.wordie-grid { touch-action: manipulation; }
.kbd-row { display: flex; gap: 5px; justify-content: center; }
.kbd-key {
    min-width: 30px; height: 48px; padding: 0 8px; border-radius: 8px;
    background: var(--panel-2); border: 1px solid var(--panel-brd); color: var(--text);
    font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
}
.kbd-key.wide { min-width: 56px; font-size: 0.7rem; }
.kbd-key.correct { background: var(--emerald-dim); }
.kbd-key.present { background: var(--gold); color: #1a1304; }
.kbd-key.absent  { background: #161d1b; color: #5a6b63; }

/* ---------- Gin Rummy ---------- */
.gin-table { display: flex; flex-direction: column; gap: 16px; }
.gin-seat .gin-label { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.gin-deadwood { color: var(--gold); font-size: 0.8rem; font-weight: 700; }
.gin-cards { display: flex; gap: 6px; flex-wrap: wrap; min-height: 84px; }
.gin-cards .card { width: 58px; height: 82px; }
.gin-hand .card { transition: transform 0.15s var(--ease); }
.gin-piles { display: flex; gap: 28px; justify-content: center; align-items: flex-start; padding: 4px 0; }
.gin-pile { text-align: center; }
.gin-pile .cards { justify-content: center; min-height: 82px; flex-wrap: nowrap; }
.gin-pile.drawable { cursor: pointer; }
.gin-pile.drawable .card img { box-shadow: 0 0 0 2px var(--gold), 0 8px 18px rgba(0,0,0,0.5); }
.gin-pile .pile-tag { display: block; margin-top: 5px; font-size: 0.68rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; }
.gin-pile .pile-tag em { color: var(--gold); font-style: normal; font-weight: 700; }
.card.melded img { box-shadow: 0 0 0 2px var(--emerald), 0 8px 18px rgba(0,0,0,0.5); }
.gin-hand .card.selectable { cursor: pointer; }
.gin-hand .card.selectable:hover { transform: translateY(-8px); }
.gin-hand .card.selected { transform: translateY(-14px); }
.gin-hand .card.selected img { box-shadow: 0 0 0 3px var(--gold), 0 10px 22px rgba(0,0,0,0.55); }

/* ---------- Switch ---------- */
.sw-mid { display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px 0; }
.sw-suit { color: var(--gold); font-style: normal; font-weight: 800; font-size: 1.05rem; }
.sw-suit.red { color: #ff6b6b; }
.sw-pending { background: rgba(255,96,99,0.18); border: 1px solid rgba(255,96,99,0.5); color: #ffb3b4; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; }
.sw-suitpick { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 0.9rem; }
.sw-suitpick button { width: 44px; height: 44px; border-radius: 11px; font-size: 1.3rem; background: var(--panel-2); border: 1px solid var(--panel-brd); color: var(--text); }
.sw-suitpick button:hover { border-color: var(--gold); }
.sw-suitpick button[data-suit="H"], .sw-suitpick button[data-suit="D"] { color: #ff6b6b; }
.gin-hand .card.dim { opacity: 0.4; filter: saturate(0.6); }
.gin-hand .card.playable { cursor: pointer; }
.gin-hand .card.playable:hover { transform: translateY(-8px); }
.gin-hand .card.playable img { box-shadow: 0 0 0 2px var(--gold), 0 8px 18px rgba(0,0,0,0.5); }

/* ---------- Friends ---------- */
.friend-search { display: flex; gap: 10px; margin-bottom: 14px; }
.friend-search input { flex: 1; padding: 11px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-brd); color: var(--text); outline: none; font-size: 0.95rem; }
.friend-search input:focus { border-color: var(--gold); }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--panel-brd); margin-bottom: 8px; }
.friend-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid var(--panel-brd); flex-shrink: 0; }
.friend-id { flex: 1; min-width: 0; }
.friend-name { font-weight: 700; }
.friend-sub { color: var(--muted); font-size: 0.78rem; }
.friend-actions { display: flex; gap: 8px; }
.friend-btn { padding: 8px 14px; font-size: 0.85rem; }
.friend-tag { font-size: 0.74rem; font-weight: 700; color: var(--muted); padding: 6px 12px; border: 1px solid var(--panel-brd); border-radius: 999px; }

.friend-card { padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-brd); margin-bottom: 14px; }
.fc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fc-head .friend-id { flex: 1; }
.fc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.fc-stat { text-align: center; padding: 10px; border-radius: var(--radius-sm); background: var(--panel-2); }
.fc-label { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.fc-val { display: block; font-size: 1.15rem; font-weight: 800; margin: 2px 0; }
.fc-diff { font-size: 0.72rem; font-weight: 700; }
.fc-diff.behind { color: var(--lose); }   /* friend is ahead of you */
.fc-diff.ahead { color: var(--win); }      /* you're ahead */
.fc-lines { display: flex; flex-direction: column; gap: 6px; }
.fc-line { font-size: 0.85rem; color: var(--text); background: rgba(216,177,74,0.1); border-left: 3px solid var(--gold); padding: 7px 12px; border-radius: 8px; }

.dash-friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.dash-friend { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-brd); transition: transform 0.25s var(--ease), border-color 0.25s var(--ease); }
.dash-friend:hover { transform: translateY(-3px); border-color: rgba(216,177,74,0.45); }
.dash-friend .friend-av { width: 46px; height: 46px; border: 2px solid var(--gold); }
.df-info { flex: 1; min-width: 0; }
.df-info .friend-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.df-lvl { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.df-chips { font-size: 0.82rem; font-weight: 800; color: var(--gold); white-space: nowrap; }
.df-chips i { font-size: 0.7rem; }

/* ---------- Achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 26px; }
.ach-card { display: flex; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-brd); }
.ach-card.locked { opacity: 0.85; }
.ach-card.locked .ach-ic { filter: grayscale(0.7); opacity: 0.65; }
.ach-ic { width: 50px; height: 50px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; color: #08110b; background: linear-gradient(120deg, #cfd8d4, #9aa7a0); }
.ach-card.rarity-rare .ach-ic { background: linear-gradient(120deg, #9fe3ff, #3aa6d8); color: #04121a; }
.ach-card.rarity-epic .ach-ic { background: linear-gradient(120deg, #cdb4ff, #7c4dff); color: #fff; }
.ach-card.rarity-legendary .ach-ic { background: linear-gradient(120deg, #ffe89a, #d8b14a); }
.ach-card.rarity-rare { border-color: rgba(91,209,255,0.35); }
.ach-card.rarity-epic { border-color: rgba(177,140,255,0.35); }
.ach-card.rarity-legendary { border-color: rgba(216,177,74,0.4); }
.ach-info { flex: 1; min-width: 0; }
.ach-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ach-head h4 { font-size: 0.98rem; }
.ach-info p { color: var(--muted); font-size: 0.8rem; margin: 3px 0 8px; }
.ach-rar { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.ach-card.rarity-rare .ach-rar { color: #5bd1ff; }
.ach-card.rarity-epic .ach-rar { color: #b18cff; }
.ach-card.rarity-legendary .ach-rar { color: var(--gold-soft); }
.ach-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.76rem; }
.ach-reward { color: var(--gold); } .ach-reward .fa-star { color: #b18cff; }
.ach-done { color: var(--emerald); font-weight: 700; }
.ach-prog-text { color: var(--muted); font-weight: 700; }
.ach-prog { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.08); margin-top: 8px; overflow: hidden; }
.ach-prog span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--emerald)); }

/* Achievement unlock overlay (Xbox-style) */
.ach-pop { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; align-items: center; background: rgba(13,19,17,0.97); border: 1px solid var(--panel-brd); border-radius: 999px; box-shadow: var(--shadow); overflow: hidden; pointer-events: none; max-width: 92vw; }
.ach-pop-icon { width: 58px; height: 58px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font-size: 1.3rem; color: #08110b; background: linear-gradient(120deg, #cfd8d4, #9aa7a0); }
.ach-pop-body { overflow: hidden; white-space: nowrap; padding: 0 22px 0 14px; }
.ach-pop-top { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.ach-pop-name { font-weight: 800; font-size: 1rem; }
.ach-pop-reward { font-size: 0.78rem; color: var(--gold); } .ach-pop-reward .fa-star { color: #b18cff; }
.ach-pop.rarity-rare { border-color: #5bd1ff; box-shadow: 0 0 32px -6px rgba(91,209,255,0.55); }
.ach-pop.rarity-rare .ach-pop-icon { background: linear-gradient(120deg, #9fe3ff, #3aa6d8); color: #04121a; }
.ach-pop.rarity-epic { border-color: #b18cff; box-shadow: 0 0 38px -6px rgba(177,140,255,0.6); }
.ach-pop.rarity-epic .ach-pop-icon { background: linear-gradient(120deg, #cdb4ff, #7c4dff); color: #fff; }
.ach-pop.rarity-legendary { border-color: var(--gold); box-shadow: 0 0 46px -4px rgba(216,177,74,0.7); }
.ach-pop.rarity-legendary .ach-pop-icon { background: linear-gradient(120deg, #ffe89a, #d8b14a); }

/* ---------- How-to-play modal ---------- */
.rules-modal { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; background: rgba(4,8,6,0.62); backdrop-filter: blur(4px); padding: 20px; }
.rules-card { background: linear-gradient(135deg, rgba(15,22,19,0.98), rgba(8,11,10,0.98)); border: 1px solid var(--panel-brd); border-radius: 20px; max-width: 520px; width: 100%; max-height: 85vh; overflow: auto; padding: 26px 28px; position: relative; box-shadow: var(--shadow); }
.rules-card h3 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 6px; color: var(--gold-soft); }
.rules-card h4 { font-size: 0.95rem; margin: 18px 0 8px; }
.rules-card ol, .rules-card ul { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.rules-card li { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.rules-card ul li::marker { color: var(--gold); }
.rules-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--muted); font-size: 1.7rem; line-height: 1; }
.rules-close:hover { color: var(--text); }
.rules-btn i { margin-right: 4px; }

/* ---------- 100 Grapes ---------- */
.grapes-table { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.grapes-stage { position: relative; display: grid; place-items: center; }
.grapes-img { width: 220px; max-width: 60vw; filter: drop-shadow(0 16px 30px rgba(0,0,0,0.5)); will-change: transform; }
.grapes-stage.poison-flash { animation: poisonFlash 0.7s var(--ease); border-radius: 50%; }
@keyframes poisonFlash { 0%,100% { box-shadow: 0 0 0 0 rgba(255,96,99,0); } 30% { box-shadow: 0 0 80px 20px rgba(255,96,99,0.55); } }
.grapes-pop { position: absolute; inset: 0; pointer-events: none; }
.grape-fly { position: absolute; bottom: 30%; font-size: 1.6rem; will-change: transform, opacity; }

.grapes-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.gstat { min-width: 110px; padding: 12px 18px; border-radius: var(--radius-sm); background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.12); text-align: center; }
.gstat .glabel { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.gstat .gval { font-size: 1.5rem; font-weight: 800; }
.gstat .gsub { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.6); margin-left: 3px; }
.gstat.pot .gval { color: var(--gold); }

/* "Which grape was rotten" reveal after cashing out */
.grapes-reveal { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; background: rgba(4,8,6,0.62); backdrop-filter: blur(4px); cursor: pointer; padding: 20px; }
.gr-card { text-align: center; padding: 30px 40px; border-radius: 22px; max-width: 92vw;
    background: linear-gradient(135deg, rgba(15,22,19,0.97), rgba(8,11,10,0.97));
    border: 1px solid var(--panel-brd); box-shadow: var(--shadow); }
.gr-emoji { font-size: 2.4rem; margin-bottom: 4px; }
.gr-title { color: var(--muted); font-size: 0.95rem; letter-spacing: 0.4px; }
.gr-num { font-family: var(--font-display); font-size: clamp(3rem, 12vw, 4.5rem); font-weight: 800; color: var(--lose); line-height: 1.1; margin: 6px 0 10px; }
.gr-num.locked { animation: grLock 0.45s var(--ease); }
@keyframes grLock { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
.gr-sub { color: var(--text); font-size: 1rem; font-weight: 600; max-width: 360px; margin: 0 auto; }
.gr-dismiss { color: var(--muted); font-size: 0.72rem; margin-top: 16px; text-transform: uppercase; letter-spacing: 0.6px; }

/* ---------- Shop ---------- */
.shop-section { margin-bottom: 48px; }
.shop-section:last-child { margin-bottom: 0; }
.shop-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.shop-section-head i { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(216,177,74,0.14); color: var(--gold); font-size: 1.1rem; flex-shrink: 0; }
.shop-section-head h3 { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.1; }
.shop-section-head span { color: var(--muted); font-size: 0.82rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; align-items: stretch; }
.shop-item {
    padding: 16px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--panel-brd);
    display: flex; flex-direction: column; gap: 14px;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.shop-item:hover { transform: translateY(-4px); border-color: rgba(216,177,74,0.4); }
.shop-item.equipped { border-color: rgba(46,226,122,0.45); }

/* Every preview fills the SAME fixed box, content centred, so items line up. */
.shop-preview {
    aspect-ratio: 16 / 10; width: 100%;
    border-radius: var(--radius-sm); overflow: hidden;
    display: grid; place-items: center;
    background: radial-gradient(130% 100% at 50% 0%, var(--felt), var(--felt-deep));
}
.shop-preview .preview-card { width: 64px; height: 90px; object-fit: cover; border-radius: 8px; box-shadow: 0 8px 18px rgba(0,0,0,0.55); }
.shop-preview .preview-felt { width: 100%; height: 100%; }
.shop-preview .preview-pack { display: grid; place-items: center; gap: 2px; color: var(--gold); }
.shop-preview .preview-pack i { font-size: 2rem; }
.shop-preview .preview-pack b { font-size: 1rem; font-weight: 800; }
.shop-preview .preview-fallback { font-size: 2rem; color: var(--gold); }

.shop-body { display: flex; flex-direction: column; gap: 6px; }
.shop-tag {
    align-self: flex-start; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--muted);
    background: var(--panel-2); border: 1px solid var(--panel-brd);
    padding: 3px 8px; border-radius: 999px; margin-bottom: 2px;
}
.shop-item h4 { font-size: 1rem; line-height: 1.2; }
.shop-desc { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

.shop-foot {
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--panel-brd);
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.shop-price { margin-right: auto; color: var(--gold); font-weight: 800; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.shop-price.gems { color: #5bd1ff; }
.shop-actions { display: flex; align-items: center; gap: 8px; }
.shop-foot .btn { padding: 9px 16px; font-size: 0.85rem; }
.shop-foot .shop-toggle { padding: 9px 13px; }   /* icon-only equipped toggle */

/* ---------- Leaderboard ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-brd); color: var(--muted); font-weight: 600; font-size: 0.86rem; }
.tab.active { background: linear-gradient(120deg, var(--gold-soft), var(--gold)); color: #08110b; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--panel-brd); }
.lb-row.me { border-color: var(--gold); background: rgba(216,177,74,0.1); }
.lb-rank { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--panel-2); }
.lb-rank.r1 { background: linear-gradient(120deg,#ffe89a,#d8b14a); color:#1a1304; }
.lb-rank.r2 { background: linear-gradient(120deg,#e8eef0,#aab4bb); color:#10171a; }
.lb-rank.r3 { background: linear-gradient(120deg,#f0c193,#c0793f); color:#1a0d04; }
.lb-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--panel-brd); flex-shrink: 0; }
.lb-row.me .lb-avatar { border-color: var(--gold); }
.lb-name { font-weight: 700; }
.lb-meta { color: var(--muted); font-size: 0.78rem; }
.lb-value { margin-left: auto; font-weight: 800; color: var(--gold); }

/* ---------- Challenges ---------- */
.ch-list { display: grid; gap: 12px; }
.ch-card { padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-brd); display: flex; align-items: center; gap: 16px; }
.ch-card.done { border-color: rgba(46,226,122,0.4); }
.ch-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(216,177,74,0.14); color: var(--gold); font-size: 1.2rem; flex-shrink: 0; }
.ch-body { flex: 1; }
.ch-body h4 { font-size: 1rem; }
.ch-body p { color: var(--muted); font-size: 0.84rem; margin-bottom: 8px; }
.ch-progress { height: 7px; border-radius: 7px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ch-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--emerald)); transition: width 0.6s var(--ease); }
.ch-reward { text-align: right; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.ch-reward .chips { color: var(--gold); font-weight: 700; }

/* ---------- Transactions ---------- */
.tx-filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tx-filters select { padding: 9px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-brd); color: var(--text); font-weight: 600; outline: none; }
.transaction-list { display: flex; flex-direction: column; gap: 8px; }
.transaction-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--panel-brd); }
.transaction-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.transaction-details h4 { font-size: 0.92rem; }
.transaction-details p { color: var(--muted); font-size: 0.76rem; }
.transaction-amount { margin-left: auto; font-weight: 800; }
.transaction-amount.positive { color: var(--win); }
.transaction-amount.negative { color: var(--lose); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-brd); color: var(--text); font-weight: 700; }
.pagination-btn.active { background: var(--gold); color: #08110b; }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 14px 18px; border-radius: 14px; min-width: 240px; max-width: 340px;
    background: rgba(13,19,17,0.95); border: 1px solid var(--panel-brd); backdrop-filter: var(--blur);
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px;
    animation: toastIn 0.35s var(--ease) both; font-size: 0.9rem; font-weight: 600;
}
.toast.out { animation: toastOut 0.3s var(--ease) both; }
.toast i { font-size: 1.1rem; }
.toast.win { border-color: rgba(46,226,122,0.5); } .toast.win i { color: var(--win); }
.toast.error { border-color: rgba(255,96,99,0.5); } .toast.error i { color: var(--lose); }
.toast.info i { color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; width: 9px; height: 14px; top: -20px; opacity: 0.95; will-change: transform; }

/* ---------- Loader ---------- */
.loading { display: grid; place-items: center; padding: 50px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Slots / Fruit machine ---------- */
.slots-felt { display: flex; flex-direction: column; align-items: center; }
.slot-cabinet { display: flex; gap: 10px; position: relative; padding: 18px; border-radius: 18px; background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.15)); border: 2px solid rgba(216,177,74,0.5); box-shadow: inset 0 0 24px rgba(0,0,0,0.5); }
.slot-window { width: 84px; height: 192px; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--panel-brd); }
.slot-reel { display: flex; flex-direction: column; height: 100%; }
.slot-sym { flex: 1; display: grid; place-items: center; font-size: 2.4rem; opacity: 0.38; }
.slot-sym.center { opacity: 1; background: rgba(216,177,74,0.1); }
.slot-payline { position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; transform: translateY(-50%); background: linear-gradient(90deg, transparent, var(--gold), transparent); pointer-events: none; }
.slot-combo { font-size: 1.05rem; letter-spacing: 2px; }
.slot-any { color: var(--muted); }

/* ---------- Roulette ---------- */
.roulette-top { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 18px; }
.wheel-wrap { position: relative; width: 340px; max-width: 86vw; aspect-ratio: 1; }
.wheel { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at center, #1c241f 36%, #0c100e 37%, #0c100e 100%); border: 8px solid #5a4a22; box-shadow: inset 0 0 40px rgba(0,0,0,0.7), 0 10px 36px rgba(0,0,0,0.5); }
.wheel-seg { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; display: grid; place-items: center; font-size: 0.66rem; font-weight: 800; color: #fff; border-radius: 5px; }
.wheel-seg.red { background: #c1272d; } .wheel-seg.black { background: #1a1a1a; } .wheel-seg.green { background: #1d8a4c; }
.wheel-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; color: #fff; background: #141a16; border: 3px solid var(--gold); z-index: 3; }
.wheel-hub.red { background: #c1272d; } .wheel-hub.black { background: #1a1a1a; } .wheel-hub.green { background: #1d8a4c; }
.wheel-pointer { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 20px solid var(--gold); z-index: 4; }
.wheel-ball { position: absolute; left: 50%; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c9c9c9); box-shadow: 0 1px 3px rgba(0,0,0,0.6); z-index: 4; }

.roulette-felt { padding: 14px; max-width: 460px; margin: 0 auto; }
.rou-board { display: grid; grid-template-columns: 30px 1fr; gap: 5px; }
.rou-zero { grid-row: 1 / span 2; display: grid; place-items: center; background: #1d8a4c; color: #fff; font-weight: 800; border-radius: 8px; cursor: pointer; position: relative; }
.rou-numbers { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.rou-cols { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 5px; }
.rou-num { min-height: 34px; display: grid; place-items: center; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 0.9rem; color: #fff; position: relative; transition: transform 0.1s; }
.rou-num.red { background: #c1272d; } .rou-num.black { background: #222; } .rou-num.green { background: #1d8a4c; }
.rou-cell { padding: 12px 6px; text-align: center; background: var(--panel-2); border: 1px solid var(--panel-brd); border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 0.85rem; position: relative; }
.rou-cell.red { background: rgba(193,39,45,0.4); } .rou-cell.black { background: rgba(0,0,0,0.4); }
.rou-dozens, .rou-outside { display: grid; gap: 6px; margin-top: 8px; }
.rou-dozens { grid-template-columns: repeat(3, 1fr); }
.rou-outside { grid-template-columns: repeat(6, 1fr); }
.rou-num:hover, .rou-cell:hover, .rou-zero:hover { outline: 2px solid var(--gold); }
.win { box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--gold); z-index: 2; }
.rou-badge { position: absolute; right: -4px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #08110b; font-size: 0.7rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.rou-controls { flex-wrap: wrap; }
.chip-tray { display: flex; gap: 8px; }
.rou-chip { width: 46px; height: 46px; border-radius: 50%; border: 2px dashed rgba(255,255,255,0.5); background: var(--panel-2); color: var(--text); font-weight: 800; cursor: pointer; }
.rou-chip.selected { border-style: solid; border-color: var(--gold); background: rgba(216,177,74,0.18); transform: scale(1.06); }
.rou-total { color: var(--muted); }
.rou-total strong { color: var(--gold); }

/* ---------- Craps ---------- */
.craps-felt { display: flex; flex-direction: column; align-items: center; }
.craps-point { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cp-puck { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; border: 3px solid; }
.cp-puck.off { background: #1a1a1a; color: #aaa; border-color: #555; }
.cp-puck.on { background: #fff; color: #14201a; border-color: var(--emerald); box-shadow: 0 0 16px rgba(46,226,122,0.6); }
.cp-label { color: var(--muted); font-weight: 600; }
.dice-area { display: flex; gap: 18px; margin: 8px 0 18px; }
.die { width: 76px; height: 76px; display: grid; place-items: center; }
.die::after { font-size: 4.6rem; line-height: 1; color: #f3f7f4; text-shadow: 0 3px 6px rgba(0,0,0,0.5); }
.die[data-face="1"]::after { content: "\2680"; }
.die[data-face="2"]::after { content: "\2681"; }
.die[data-face="3"]::after { content: "\2682"; }
.die[data-face="4"]::after { content: "\2683"; }
.die[data-face="5"]::after { content: "\2684"; }
.die[data-face="6"]::after { content: "\2685"; }
.craps-bets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 460px; }
.craps-bet { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 12px; padding: 10px 12px; }
.craps-bet label { font-size: 0.82rem; font-weight: 700; }
.craps-bet .opt { color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.craps-bet input { background: var(--panel-2); border: 1px solid var(--panel-brd); border-radius: 8px; color: var(--text); padding: 8px 10px; font: inherit; }

/* ---------- Poker ---------- */
.poker-disclaimer { padding: 26px; max-width: 720px; }
.poker-disclaimer h1 { font-size: 1.4rem; margin-bottom: 14px; }
.poker-disclaimer ul { margin: 0 0 18px; padding-left: 20px; }
.poker-disclaimer li { margin-bottom: 10px; line-height: 1.55; color: rgba(255,255,255,0.85); }
.poker-agree { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; cursor: pointer; }
.poker-agree input { margin-top: 3px; }
.pk-ext { color: var(--gold); }

.poker-home { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.poker-home-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.poker-home-card .bet-input-wrap { width: 100%; }
.poker-home-card select, .poker-home-card input[type=number] { background: transparent; border: none; color: var(--text); font: inherit; text-align: right; flex: 1; }
.poker-check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.88rem; }
.poker-or { text-align: center; color: var(--muted); font-size: 0.82rem; }

.poker-lobby { max-width: 720px; }
.poker-code-box { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; }
.poker-code-box span { color: var(--muted); font-size: 0.82rem; }
.poker-code-box strong { font-size: 1.6rem; letter-spacing: 5px; color: var(--gold); font-family: 'Playfair Display', serif; }
.poker-code-box .btn { margin-left: auto; }
.pk-lobby-players { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pk-lobby-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 12px; }
.pk-host-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* table */
.poker-table-wrap { display: flex; flex-direction: column; gap: 14px; }
.poker-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pk-meta { display: flex; gap: 18px; color: var(--muted); font-size: 0.85rem; }
.pk-meta b { color: var(--text); }
.pk-top-actions { display: flex; gap: 8px; }
#pk-disband.voted { border-color: var(--gold); color: var(--gold); }

.poker-felt {
    position: relative; width: 100%; max-width: 820px; margin: 0 auto 64px; aspect-ratio: 2 / 1.24;
    background: radial-gradient(ellipse at center, #1f8a5a 0%, #136b43 55%, #0c4d30 100%);
    border: 10px solid #5a3d22; border-radius: 50% / 42%;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.45), 0 14px 40px rgba(0,0,0,0.5);
}
.poker-pot { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); color: var(--gold); font-weight: 800; font-size: 1.1rem; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.poker-board { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); justify-content: center; min-height: 0; gap: 6px; }
.poker-board .card { width: 64px; height: 90px; }
.poker-seats { position: absolute; inset: 0; }

.pk-seat { position: absolute; width: 132px; transform: translate(-50%, -50%); text-align: center; transition: opacity 0.25s; }
.pk-pos-bottom { left: 50%; top: 84%; }
.pk-pos-btm-right { left: 90%; top: 70%; }
.pk-pos-top-right { left: 88%; top: 20%; }
.pk-pos-top { left: 50%; top: 4%; }
.pk-pos-top-left { left: 12%; top: 20%; }
.pk-pos-btm-left { left: 10%; top: 70%; }
.pk-seat.folded { opacity: 0.4; }
.pk-seat.out { opacity: 0.3; filter: grayscale(1); }
/* Poker card entrance — pure CSS with fill-mode both, so a card is never left invisible. */
.card.pk-deal { animation: pkDeal 0.34s ease both; }
@keyframes pkDeal { from { opacity: 0; transform: translateY(-16px) scale(0.9); } to { opacity: 1; transform: none; } }
.pk-cards { display: flex; gap: 4px; justify-content: center; min-height: 0; margin-bottom: -10px; }
.pk-cards .card { width: 46px; height: 64px; }
/* Your own seat (bottom) gets larger, clearer cards. */
.pk-pos-bottom .pk-cards { margin-bottom: -6px; }
.pk-pos-bottom .pk-cards .card { width: 62px; height: 86px; }
.pk-seatcard { position: relative; display: inline-flex; align-items: center; gap: 8px; background: rgba(8,12,10,0.82); border: 1px solid var(--panel-brd); border-radius: 999px; padding: 5px 12px 5px 5px; }
.pk-seat.acting .pk-seatcard { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(216,177,74,0.6); }
.pk-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--panel-brd); }
.pk-seatinfo { text-align: left; }
.pk-name { font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.pk-stack { font-size: 0.78rem; color: var(--gold); }
.pk-bet { min-height: 18px; font-size: 0.78rem; color: #ffe7a8; font-weight: 700; margin-top: 4px; }
.pk-dealer { width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #14201a; font-size: 0.62rem; font-weight: 800; display: inline-grid; place-items: center; }
.pk-badge { font-size: 0.6rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; text-transform: uppercase; }
.pk-badge.allin { background: var(--gold); color: #14201a; }
.pk-badge.off { background: #7a2b2b; color: #fff; }
.pk-kick { position: absolute; right: -6px; top: -10px; background: #7a2b2b; color: #fff; border: none; border-radius: 999px; font-size: 0.62rem; padding: 2px 7px; cursor: pointer; }
.pk-timer { height: 3px; margin-top: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; overflow: hidden; display: none; }
.pk-timer span { display: block; height: 100%; background: var(--gold); transition: width 1s linear; }

.poker-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; opacity: 0; }
.poker-banner.show { opacity: 1; pointer-events: auto; background: rgba(8,12,10,0.86); border: 1px solid var(--gold); border-radius: 16px; padding: 18px 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.poker-banner.small { background: rgba(8,12,10,0.7); border-color: var(--panel-brd); padding: 8px 16px; font-size: 0.9rem; }
.poker-banner.win { box-shadow: 0 0 40px rgba(216,177,74,0.5); }
.poker-banner i { color: var(--gold); }

.pk-hint { text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.pk-hint b { color: var(--gold); }
.pk-draw { color: var(--emerald); font-weight: 700; }
.poker-controls { min-height: 52px; display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 6px; }
.pk-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pk-allin-btn { background: linear-gradient(135deg, #b9892f, #d8b14a); color: #14201a; font-weight: 800; }
.pk-raise { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pk-raise input[type=range] { width: 200px; accent-color: var(--gold); }
.pk-raise input[type=number] { width: 100px; background: var(--panel-2); border: 1px solid var(--panel-brd); border-radius: 8px; color: var(--text); padding: 6px 10px; font: inherit; }
.pk-raise-quick { display: flex; gap: 6px; }
.pk-raise-quick button { background: var(--panel-2); border: 1px solid var(--panel-brd); color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 0.8rem; }
.pk-waiting { color: var(--muted); font-style: italic; }

.pk-chat { display: flex; flex-direction: column; gap: 8px; max-width: 760px; margin: 0 auto; width: 100%; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 14px; padding: 12px; }
.pk-chat-log { height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: 0.86rem; }
.pk-msg { line-height: 1.4; }
.pk-msg b { color: var(--gold); margin-right: 4px; }
.pk-msg.sys { color: var(--muted); font-style: italic; font-size: 0.8rem; }
.pk-big-emoji { font-size: 1.3rem; }
.pk-emoji { display: flex; gap: 4px; flex-wrap: wrap; }
.pk-emoji-btn { background: var(--panel-2); border: 1px solid var(--panel-brd); border-radius: 8px; font-size: 1.1rem; padding: 2px 7px; cursor: pointer; }
.pk-chat-input { display: flex; gap: 8px; }
.pk-chat-input input { flex: 1; background: var(--panel-2); border: 1px solid var(--panel-brd); border-radius: 999px; color: var(--text); padding: 9px 16px; font: inherit; }

@media (max-width: 760px) {
    .poker-home { grid-template-columns: 1fr; }
    .poker-board .card { width: 48px; height: 67px; }
    .pk-seat { width: 100px; }
    .pk-cards .card { width: 34px; height: 48px; }
    .pk-pos-bottom .pk-cards .card { width: 48px; height: 67px; }
    .pk-av { width: 30px; height: 30px; }
    .pk-name, .pk-stack { font-size: 0.7rem; }
    .poker-felt { margin-bottom: 52px; }
}

/* ---------- Friends presence dock ---------- */
.presence-dock { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.presence-dot { display: block; width: 46px; height: 46px; border-radius: 50%; pointer-events: auto; transition: transform 0.15s; animation: presIn 0.3s ease both; }
.presence-dot img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--panel-brd); background: #0c100e; display: block; }
.presence-dot:hover { transform: scale(1.1); }
.presence-dot.online img { border-color: var(--emerald); box-shadow: 0 0 0 2px var(--emerald), 0 0 14px rgba(46,226,122,0.75); }
.presence-dot.recent img { border-color: #e0962f; box-shadow: 0 0 0 2px #e0962f; }
.presence-dot.idle img { opacity: 0.5; }
.presence-dot.idle:hover img { opacity: 1; }
@keyframes presIn { from { opacity: 0; transform: translateX(14px) scale(0.8); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .presence-dock { right: 10px; bottom: 76px; } .presence-dot { width: 40px; height: 40px; } }

/* ---------- Clickable rows ---------- */
.clickable { cursor: pointer; }
.lb-row.clickable { transition: transform 0.12s, border-color 0.12s; }
.lb-row.clickable:hover { transform: translateY(-1px); border-color: var(--gold); }
a.friend-name { color: var(--text); text-decoration: none; }
a.friend-name:hover { color: var(--gold); }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 22px; }
.profile-av { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); flex-shrink: 0; }
.profile-id { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-name-row h1 { font-size: 1.5rem; margin: 0; }
.profile-lvl { background: rgba(216,177,74,0.16); color: var(--gold); padding: 3px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.profile-bio { margin: 8px 0 4px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.profile-bio.muted { color: var(--muted); }
.profile-since { color: var(--muted); font-size: 0.8rem; }
.profile-action { flex-shrink: 0; }
.profile-locked { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-locked i { font-size: 2rem; color: var(--gold); }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.pstat { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--panel-brd); }
.pstat-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: rgba(216,177,74,0.14); color: var(--gold); flex-shrink: 0; }
.pstat-val { font-size: 1.15rem; font-weight: 800; }
.pstat-label { font-size: 0.78rem; color: var(--muted); }

.profile-feed { display: flex; flex-direction: column; gap: 8px; }
.feed-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--panel-brd); text-decoration: none; color: var(--text); transition: border-color 0.12s; }
.feed-row:hover { border-color: var(--gold); }
.feed-ic { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.feed-name { flex: 1; font-weight: 600; }
.feed-when { color: var(--muted); font-size: 0.8rem; }
.feed-out { font-weight: 800; font-size: 0.9rem; min-width: 64px; text-align: right; }

/* ---------- Settings ---------- */
.set-label { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 8px; }
.set-bio { width: 100%; resize: vertical; background: var(--panel-2); border: 1px solid var(--panel-brd); border-radius: 12px; color: var(--text); padding: 12px 14px; font: inherit; line-height: 1.5; }
.set-bio:focus { outline: none; border-color: var(--gold); }
.set-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.set-count { color: var(--muted); font-size: 0.8rem; }
.set-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.set-toggle-title { font-weight: 700; }
.set-toggle-sub { color: var(--muted); font-size: 0.84rem; margin-top: 3px; max-width: 46ch; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--panel-brd); flex-shrink: 0; transition: background 0.18s; cursor: pointer; }
.switch .switch-dot { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #cfd8d2; transition: transform 0.18s, background 0.18s; }
.switch[aria-checked="true"] { background: var(--emerald-dim); border-color: var(--emerald); }
.switch[aria-checked="true"] .switch-dot { transform: translateX(22px); background: #fff; }

/* ---------- Mobile ---------- */
.mobile-nav { display: none; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
    .app-container { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 78%; max-width: 300px;
        transform: translateX(-105%); transition: transform 0.35s var(--ease);
    }
    .sidebar.open { transform: none; }
    .sidebar-backdrop { display: block; background: rgba(0,0,0,0.6); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
    .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
    .menu-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-brd); color: var(--text); font-size: 1.1rem; }
    .content-header { padding: 14px 18px; }
    .content-header h1 { font-size: 1.05rem; }
    .main-area { padding: 20px 16px 90px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .cards-row { grid-template-columns: 1fr; }
    .bacc-hands { grid-template-columns: 1fr; }
    .balance-item { padding: 8px 12px; font-size: 0.85rem; }
    .user-balance { gap: 8px; }
    .card { width: 74px; height: 104px; }
    .profile-head { flex-direction: column; text-align: center; }
    .profile-name-row { justify-content: center; }
    .profile-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { width: 62px; height: 88px; }
    .bacc-sides { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
