:root {
    /* Fact Bingo — Modern Telegram Native (Stage 1)
       Defaults = dark fallbacks; theme.js + themeParams override live. */
    --bg: #17212B;
    --bg-secondary: #0E1621;
    --bg-elevated: #232E3C;
    --surface: rgba(35, 46, 60, 0.94);
    --surface-border: rgba(42, 171, 238, 0.22);
    --text: #F5F5F5;
    --text-muted: rgba(245, 245, 245, 0.62);
    --hint: rgba(245, 245, 245, 0.45);
    --accent: #00A3FF;
    --accent-strong: #0090E0;
    --accent-dim: rgba(0, 163, 255, 0.18);
    --neon-blue: #00A3FF;
    --neon-blue-dim: rgba(0, 163, 255, 0.22);
    --link: #00A3FF;
    --on-accent: #FFFFFF;
    --emerald: #3d9b6e;
    --emerald-dim: rgba(61, 155, 110, 0.18);
    --gold: #2AABEE;
    --gold-dim: rgba(42, 171, 238, 0.2);
    --danger: #E53935;
    --radius: 14px;
    --radius-sm: 10px;
    --nav-h: 68px;
    --header-h: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --glow-blue: 0 0 18px rgba(42, 171, 238, 0.28);
    --glow-emerald: 0 0 18px rgba(61, 155, 110, 0.28);
    --glow-gold: 0 0 22px rgba(42, 171, 238, 0.32);
    --body-wash-a: rgba(42, 171, 238, 0.12);
    --body-wash-b: rgba(34, 158, 217, 0.08);
    --header-bg: rgba(23, 33, 43, 0.92);
}

html[data-tg-theme="light"] {
    --bg: #F4F4F5;
    --bg-secondary: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-border: rgba(0, 163, 255, 0.28);
    --text: #000000;
    --text-muted: rgba(0, 0, 0, 0.55);
    --hint: rgba(0, 0, 0, 0.4);
    --accent: #00A3FF;
    --accent-strong: #0090E0;
    --accent-dim: rgba(0, 163, 255, 0.14);
    --neon-blue: #00A3FF;
    --neon-blue-dim: rgba(0, 163, 255, 0.16);
    --link: #00A3FF;
    --on-accent: #FFFFFF;
    --gold: #2AABEE;
    --gold-dim: rgba(42, 171, 238, 0.14);
    --danger: #E53935;
    --glow-blue: 0 0 18px rgba(42, 171, 238, 0.2);
    --glow-gold: 0 0 18px rgba(42, 171, 238, 0.22);
    --body-wash-a: rgba(42, 171, 238, 0.08);
    --body-wash-b: rgba(34, 158, 217, 0.05);
    --header-bg: rgba(244, 244, 245, 0.94);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Sora', 'Noto Sans Ethiopic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse 90% 55% at 12% -10%, var(--body-wash-a), transparent 55%),
        radial-gradient(ellipse 70% 45% at 100% 20%, var(--body-wash-b), transparent 50%),
        linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 48%, var(--bg-secondary) 100%);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background 0.2s ease, color 0.2s ease;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: var(--header-h);
    padding: 10px 14px;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--surface-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--neon-blue-dim), var(--emerald-dim));
    border: 2px solid var(--neon-blue);
    box-shadow: var(--glow-blue);
    overflow: hidden;
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-meta {
    min-width: 0;
}

.header-meta strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.header-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.chip-balance {
    background: var(--emerald-dim);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--emerald);
}

.chip-stars {
    background: var(--gold-dim);
    border-color: rgba(251, 191, 36, 0.35);
    color: var(--gold);
}

.chip small {
    font-size: 0.62rem;
    opacity: 0.85;
}

.chip-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--surface-border);
    background: var(--bg-elevated);
    font-size: 1rem;
    cursor: pointer;
}

.chip-btn.muted {
    opacity: 0.45;
}

/* Tabs */
.tab {
    display: none;
    padding: 12px 14px;
    animation: tabIn 0.28s ease;
}

.tab.active {
    display: block;
}

@keyframes tabIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.page-head {
    margin-bottom: 14px;
}

.page-head h2 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--neon-blue), var(--emerald));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-head p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Game hero */
.game-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-logo,
.brand-logo {
    width: 52px;
    height: 52px;
    max-width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: var(--glow-blue);
    display: block;
    flex-shrink: 0;
}

.hero-logo-sm,
.brand-logo-sm {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
}

img.hero-logo,
img.brand-logo,
img.hero-logo-sm,
img.brand-logo-sm,
.admin-header img,
.admin-brand-row img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-box {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
}

.stat-countdown {
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.06);
}

.stat-label {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-big {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: var(--glow-gold);
    animation: countdownPulse 1.2s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neon-blue);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 0;
}

.boards-label {
    font-weight: 600;
    font-size: 0.85rem;
}

.boards-badge {
    background: var(--neon-blue-dim);
    color: var(--neon-blue);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Board picker grid */
.board-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    padding: 12px;
    max-height: 48vh;
    overflow-y: auto;
}

.board-cell {
    aspect-ratio: 1;
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.board-cell:hover:not(.taken) {
    transform: translateY(-2px);
    box-shadow: var(--glow-blue);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

.board-cell.taken {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: var(--danger);
    cursor: not-allowed;
}

.board-cell.mine,
.board-cell.selected {
    background: #00A3FF !important;
    border-color: #00A3FF !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 14px rgba(0, 163, 255, 0.55);
    font-weight: 800;
}

.board-cell:active:not(.taken) {
    transform: scale(0.92);
}

/* Game info bar */
.game-info-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(16, 185, 129, 0.12));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    margin-bottom: 10px;
    font-size: 0.58rem;
    text-align: center;
}

.game-info-bar small {
    display: block;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.game-info-bar strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
}

.prize-highlight strong {
    color: var(--gold);
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.play-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 8px;
    margin-bottom: 10px;
}

.master-board {
    padding: 8px;
    font-size: 0.52rem;
}

.master-col {
    display: inline-block;
    vertical-align: top;
    width: 19%;
    text-align: center;
}

.master-col .col-head {
    font-weight: 800;
    padding: 3px 0;
    border-radius: 6px;
    margin-bottom: 3px;
    color: white;
    font-size: 0.55rem;
}

.master-col .col-head.b { background: #fbbf24; }
.master-col .col-head.i { background: #10b981; }
.master-col .col-head.n { background: #38bdf8; }
.master-col .col-head.g { background: #f87171; }
.master-col .col-head.o { background: #a78bfa; }

.master-num {
    padding: 2px 0;
    border-radius: 4px;
    margin: 1px 0;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.master-num.called {
    background: #E91E63;
    color: #FFFFFF;
    font-weight: 700;
}

.master-num.last,
.master-num.current {
    background: #00A3FF !important;
    color: #FFFFFF !important;
    font-weight: 800;
    animation: lastCallFlash 0.6s ease;
    box-shadow: 0 0 10px rgba(0, 163, 255, 0.55);
}

@keyframes lastCallFlash {
    0% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.play-side {
    padding: 12px 10px;
    text-align: center;
}

.call-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.current-call {
    margin-bottom: 10px;
}

.call-letter {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-blue);
    margin-bottom: 6px;
}

.call-circle {
    display: inline-flex;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #7dd3fc, var(--accent));
    color: var(--on-accent);
    font-size: 1.5rem;
    font-weight: 800;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-gold);
    border: 3px solid rgba(255, 255, 255, 0.35);
}

.call-circle.ball-pop {
    animation: ballPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ballPop {
    0% { transform: scale(0.5); opacity: 0.5; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.recent-calls {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.recent-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    animation: recentBallIn 0.35s ease;
}

@keyframes recentBallIn {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.wait-msg {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Bingo cards */
.card-wrap {
    margin-bottom: 12px;
}

.card-wrap.win-flash .bingo-card {
    animation: winCardFlash 1.2s ease infinite;
}

@keyframes winCardFlash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 30px 6px rgba(251, 191, 36, 0.35); }
}

.card-label {
    font-size: 0.75rem;
    color: var(--neon-blue);
    font-weight: 700;
    margin-bottom: 6px;
}

.bingo-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-header-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
    font-weight: 800;
    color: white;
    font-size: 0.78rem;
}

.card-header-row span:nth-child(1) { background: #fbbf24; }
.card-header-row span:nth-child(2) { background: #10b981; }
.card-header-row span:nth-child(3) { background: #38bdf8; }
.card-header-row span:nth-child(4) { background: #f87171; }
.card-header-row span:nth-child(5) { background: #a78bfa; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 6px;
}

.card-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
}

html[data-tg-theme="light"] .card-cell {
    background: #FFFFFF;
}

.card-cell:active:not(.free) {
    transform: scale(0.94);
}

.card-cell.called {
    background: var(--accent-dim);
    border-color: rgba(42, 171, 238, 0.45);
    color: var(--accent);
}

.card-cell.marked {
    background: linear-gradient(135deg, var(--emerald-dim), rgba(16, 185, 129, 0.35));
    border-color: var(--emerald);
    color: #ecfdf5;
    animation: markPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--glow-emerald);
}

@keyframes markPop {
    0% { transform: scale(0.7); }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.card-cell.marked.win-line {
    animation: winLinePulse 0.8s ease infinite;
}

@keyframes winLinePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 18px rgba(251, 191, 36, 0.75); background: var(--gold-dim); }
}

.card-cell.free {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--on-accent);
    font-size: 1rem;
    cursor: default;
    box-shadow: var(--glow-blue);
}

/* Actions */
.action-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 8px;
    margin-top: 8px;
}

.btn-refresh,
.btn-reload,
.btn-admin {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(42, 171, 238, 0.4);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-refresh:hover,
.btn-reload:hover,
.btn-admin:hover {
    background: rgba(34, 158, 217, 0.18);
    border-color: var(--accent-strong);
}

.btn-refresh:active,
.btn-reload:active {
    transform: scale(0.97);
}

.btn-bingo,
.btn-claim {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.06em;
    box-shadow: var(--glow-blue);
    transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}

.btn-bingo:hover:not(:disabled),
.btn-claim:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-strong), #1c8fc4);
}

.btn-bingo:not(:disabled),
.btn-claim:not(:disabled) {
    animation: claimPulse 1.5s ease-in-out infinite;
}

@keyframes claimPulse {
    0%, 100% { box-shadow: var(--glow-blue); }
    50% { box-shadow: 0 0 32px rgba(42, 171, 238, 0.55); transform: translateY(-1px); }
}

.btn-bingo:disabled,
.btn-claim:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    animation: none;
    filter: grayscale(0.4);
}

.btn-bingo.full,
.btn-claim.full {
    width: 100%;
}

.btn-reload.full {
    width: 100%;
    margin: 8px 0 16px;
}

/* Chat */
.live-chat {
    overflow: hidden;
}

.live-chat-header {
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--surface-border);
    color: var(--neon-blue);
}

.chat-feed {
    max-height: 140px;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 0.78rem;
}

.chat-msg {
    margin-bottom: 6px;
    line-height: 1.4;
}

.chat-msg.system {
    color: var(--gold);
    font-style: italic;
}

.chat-name {
    color: var(--emerald);
    font-weight: 600;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--surface-border);
}

.chat-input-row input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
}

.chat-input-row input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px var(--neon-blue-dim);
}

.chat-input-row button {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--on-accent);
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

/* Wallet */
.wallet-title {
    display: none;
}

.wallet-total {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: var(--glow-gold);
}

.wallet-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.wallet-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.wtab {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.wtab.active {
    color: var(--neon-blue);
    border-color: rgba(56, 189, 248, 0.35);
    background: var(--neon-blue-dim);
}

.balance-hero {
    text-align: center;
    padding: 20px 18px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-strong) 55%, #1a8fc4 100%);
    border: 1px solid transparent;
    color: var(--on-accent);
    box-shadow: var(--glow-blue);
}

.balance-hero small {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.08em;
}

.balance-hero strong {
    font-size: 1.7rem;
    color: #fff;
}

.balance-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.bal-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
}

.bal-card small {
    display: block;
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.bal-card strong {
    font-size: 0.82rem;
    color: var(--emerald);
}

.withdraw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: var(--emerald-dim);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.withdraw-row strong {
    color: var(--emerald);
}

.deposit-card {
    padding: 14px;
}

.section-label {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--neon-blue);
}

.deposit-phone {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 8px;
}

.deposit-hint,
.deposit-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.phone-register {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.phone-register input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text);
    font-family: inherit;
}

.phone-register button {
    background: var(--neon-blue);
    color: #0a0e17;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-weight: 700;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
}

/* Leaderboard */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 0;
}

.podium-slot {
    width: 28%;
    text-align: center;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 1.5rem;
    padding: 12px 8px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
}

.podium-slot.first {
    height: 88px;
    background: linear-gradient(180deg, var(--gold-dim), var(--surface));
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: var(--glow-gold);
}

.podium-slot.second {
    height: 68px;
}

.podium-slot.third {
    height: 56px;
}

.lb-you {
    padding: 14px;
}

.lb-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.lb-rank {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lb-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lb-stat {
    text-align: center;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
}

.lb-stat span {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.lb-stat strong {
    font-size: 0.95rem;
    color: var(--neon-blue);
}

.lb-stat.gold strong {
    color: var(--gold);
}

.profile-card {
    padding: 14px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
    font-size: 0.85rem;
}

.stat-line:last-child {
    border-bottom: none;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}

.setting-row:last-child {
    border-bottom: none;
}

.toggle {
    min-width: 52px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--surface-border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.toggle[data-on='1'] {
    background: var(--emerald-dim);
    border-color: var(--emerald);
    color: var(--emerald);
}

/* History */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--surface-border);
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 800;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.history-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.history-id {
    font-weight: 700;
    color: var(--neon-blue);
}

.history-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--neon-blue-dim);
    color: var(--neon-blue);
}

.history-status.completed {
    background: var(--emerald-dim);
    color: var(--emerald);
}

.history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 0.72rem;
    margin: 8px 0;
    color: var(--text-muted);
}

.footer-note {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Admin */
.admin-card {
    padding: 14px;
}

.admin-brand-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.admin-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.admin-period {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-stat-card {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
}

.admin-stat-card small {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
}

.admin-stat-card.highlight {
    border-color: rgba(56, 189, 248, 0.35);
}

.admin-stat-card.gold {
    border-color: rgba(251, 191, 36, 0.35);
}

.admin-stat-card.gold strong {
    color: var(--gold);
}

.admin-split-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}

.admin-split-row.net {
    color: var(--emerald);
    font-weight: 700;
}

.admin-owners {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: stretch;
    margin: 10px 0 0;
}

.admin-owner-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    min-width: 0;
}

.admin-owner-name {
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.25;
    color: var(--accent);
}

.admin-owner-card strong {
    font-size: 1rem;
}

.admin-owner-card small {
    color: var(--text-muted);
    font-weight: 600;
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: var(--nav-h);
    padding: 8px 8px calc(8px + var(--safe-bottom));
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--surface-border);
    z-index: 100;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: 12px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-btn.active {
    color: #ffffff;
    background: #00A3FF;
    box-shadow: 0 0 14px rgba(0, 163, 255, 0.45);
}

.nav-btn.active .nav-icon {
    color: #ffffff;
    filter: drop-shadow(0 0 6px rgba(0, 163, 255, 0.65));
}

/* Toast & modals */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 12px 18px;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid var(--emerald);
    color: var(--emerald);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 200;
    box-shadow: var(--glow-emerald);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 320px;
    background: var(--bg-elevated);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--glow-gold);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.bingo-header {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 12px;
    text-shadow: var(--glow-gold);
    animation: bingoTitle 0.6s ease infinite alternate;
}

@keyframes bingoTitle {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

#bingo-msg {
    margin-bottom: 16px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Golden ball overlay */
.ball-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 250;
    pointer-events: none;
}

.golden-ball {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fff9c4, var(--gold) 45%, #b45309);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.6), inset -8px -12px 20px rgba(0, 0, 0, 0.25);
    border: 4px solid rgba(255, 255, 255, 0.45);
}

.golden-ball.pulse {
    animation: goldenBallDraw 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes goldenBallDraw {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.ball-letter {
    font-size: 1rem;
    font-weight: 800;
    color: #0b4f75;
}

.ball-number {
    font-size: 2rem;
    font-weight: 800;
    color: #0E1621;
    line-height: 1;
}

@media (max-width: 360px) {
    .play-layout {
        grid-template-columns: 1fr;
    }

    .header-chips .chip small {
        display: none;
    }

    .chip {
        padding: 6px 8px;
    }
}

/* Deposit methods + proof upload */
.pay-method-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 12px;
}
.pay-method {
    border: 1px solid var(--surface-border);
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: 12px;
    padding: 10px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.pay-method.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent-strong);
    box-shadow: var(--glow-blue);
}
.pay-box { margin-bottom: 12px; }
.btn-copy {
    margin-top: 6px;
    border: 1px solid var(--surface-border);
    background: transparent;
    color: var(--accent-strong);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.deposit-bank-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.proof-box {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.proof-box input[type='number'],
.proof-box input[type='text'],
.proof-box input[type='tel'],
#wpanel-withdraw input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}
.file-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border: 1px dashed var(--surface-border);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    background: var(--accent-dim);
}
.dep-preview {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
}
.proof-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.proof-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
}
.proof-item.status-credited { border-color: rgba(61, 155, 110, 0.45); }
.proof-item.status-rejected { border-color: rgba(212, 93, 93, 0.45); }
.proof-item.status-pending { border-color: rgba(42, 171, 238, 0.4); }
.proof-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.proof-actions button {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.btn-approve { background: var(--emerald); color: #04140c; }
.btn-reject { background: rgba(212, 93, 93, 0.25); color: #ffc9c4; }
.wpanel { margin-top: 4px; }

/* —— Fact Bingo 4-tab restructure —— */
.panel-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}

.game-lobby {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 22px 18px 18px;
    background: linear-gradient(145deg, var(--accent-strong) 0%, #1a8fc4 45%, #156a96 100%);
    color: var(--on-accent);
    box-shadow: var(--glow-blue);
}

.welcome-banner__glow {
    position: absolute;
    inset: -40% -20% auto auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.welcome-banner__eyebrow {
    position: relative;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 6px;
}

.welcome-banner__title {
    position: relative;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.welcome-banner__sub {
    position: relative;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 14px;
}

.balance-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(15, 28, 40, 0.35);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.balance-badge small {
    font-size: 0.7rem;
    opacity: 0.85;
}

.balance-badge__value {
    font-variant-numeric: tabular-nums;
    min-width: 2.5ch;
}

.balance-badge__eye {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stake-section {
    padding: 14px;
}

.stake-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.stake-section__head h2 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
}

.stake-section__hint {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.stake-room-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stake-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 108px;
    padding: 14px 12px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.stake-pill:active:not(:disabled) {
    transform: scale(0.98);
}

.stake-pill:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.stake-pill--live {
    background: linear-gradient(105deg, #2db87a 0%, #1e8f5c 55%, #167048 100%);
}

.stake-pill--soon {
    background: linear-gradient(105deg, #f0a04b 0%, #e07a28 55%, #c45f14 100%);
}

.stake-pill__play {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stake-pill__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    width: 100%;
}

.stake-pill__meta strong {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
}

.stake-pill__stake {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.95;
}

.stake-pill__status {
    font-size: 0.68rem;
    opacity: 0.92;
    font-weight: 600;
}

.account-phone {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.wallet-account-card {
    margin-bottom: 12px;
}

.session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-back {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--accent);
    border-radius: 999px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.session-stats {
    display: flex;
    gap: 8px;
}

.session-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
}

.session-stats small {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.session-stats strong {
    font-size: 0.85rem;
    color: var(--accent);
}

.wallet-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0 8px;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.btn-cta:active {
    transform: scale(0.98);
}

.btn-cta--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--on-accent);
    box-shadow: var(--glow-blue);
}

.btn-cta--secondary {
    background: var(--bg-elevated);
    color: var(--accent);
    border: 1px solid var(--surface-border);
}

.btn-cta.full {
    width: 100%;
}

.withdraw-inline {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.withdraw-inline strong {
    color: var(--emerald);
}

.account-card .section-label,
.stats-card .section-label,
.invite-card .section-label {
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.account-meta strong {
    color: var(--accent);
    font-size: 1rem;
    word-break: break-all;
}

.account-phone {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.lb-rank {
    font-size: 0.72rem;
    color: var(--hint);
}

.invite-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.history-status.win {
    background: var(--emerald-dim);
    color: var(--emerald);
}

.history-status.loss {
    background: rgba(229, 57, 53, 0.14);
    color: var(--danger);
}

.history-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-grid .hg-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hint);
}

.history-grid .hg-val {
    color: var(--text);
    font-weight: 600;
}

html[data-tg-theme="light"] .welcome-banner {
    background: linear-gradient(145deg, #2AABEE 0%, #229ED9 50%, #1a8fc4 100%);
}

html[data-tg-theme="light"] .balance-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

html[data-tg-theme="light"] .nav-btn.active {
    background: #00A3FF;
    color: #ffffff;
}

.dep-onshift-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 4px;
}

.dep-onshift-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 163, 255, 0.35);
    background: rgba(0, 163, 255, 0.1);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.dep-onshift-chip strong {
    color: #00A3FF;
    font-size: 0.95rem;
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.admin-header img,
.admin-header .brand-logo,
.admin-header .brand-logo-sm {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
}

.admin-header h1 {
    font-size: 1.15rem;
    font-weight: 800;
}

.admin-back {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--accent);
    border-radius: 999px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-login {
    padding: 16px 14px;
}

.admin-error {
    color: var(--danger);
    margin: 10px 0;
    font-size: 0.9rem;
}

.admin-panel-tabs {
    margin-bottom: 12px;
}

#admin-app img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.admin-body .panel-card input,
.admin-body .panel-card select {
    width: 100%;
    margin: 6px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: inherit;
}

