@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800&display=swap');
/* assets/css/style.css — Thai Lotto Theme (แดง–ทอง) Level 2 */
:root {
    --primary: #b45309;
    --primary-dark: #92400e;
    --primary-light: #f59e0b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #fbbf24;
    --bg: #3b0a0a;
    --bg-deep: #2a0606;
    --card-bg: #5c1212;
    --card-soft: #7f1d1d;
    --text: #fffbeb;
    --muted: #fca5a5;
    --border: #991b1b;
    --gold: #fbbf24;
    --gold-soft: #fde68a;
    --cream: #fffbeb;
    --free: #b45309;
    --marked: #fbbf24;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    --radius: 16px;
    --radius-sm: 12px;
}

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

body {
    font-family: 'Kanit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    background:
        radial-gradient(ellipse at top, #7f1d1d 0%, transparent 55%),
        linear-gradient(180deg, #4a0e0e 0%, var(--bg) 40%, var(--bg-deep) 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* ===== Auth ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25rem;
}
.auth-box {
    background: linear-gradient(180deg, #6b1515 0%, var(--card-bg) 100%);
    padding: 1.75rem 1.4rem;
    border-radius: 22px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(251, 191, 36, 0.25);
}
.auth-box h1 {
    text-align: center;
    margin-bottom: 0.35rem;
    font-size: 1.75rem;
    color: var(--gold);
    letter-spacing: 0.5px;
}
.auth-box .auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    background: rgba(0,0,0,0.2);
    padding: 0.35rem;
    border-radius: 12px;
}
.tab {
    flex: 1;
    min-width: 80px;
    padding: 0.65rem;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}
.tab.active {
    color: #3b0a0a;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.auth-form input,
.auth-form input[type="file"] {
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-size: 1rem;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}
.auth-form button,
.btn-buy {
    width: 100%;
    padding: 0.95rem;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.35);
}
.auth-form button:hover,
.btn-buy:hover {
    filter: brightness(1.08);
}
.btn-buy:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.msg { margin-top: 0.7rem; text-align: center; font-size: 0.9rem; }
.msg.error { color: #fecaca; }
.msg.success { color: #86efac; }

/* ===== Topbar ===== */
.topbar {
    background: linear-gradient(90deg, #7f1d1d, #5c1212);
    padding: 0.7rem 0.9rem 0.75rem;
    border-bottom: 2px solid rgba(251, 191, 36, 0.35);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
}
.logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.2;
    white-space: nowrap;
}
.topbar-credit {
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}
.topbar-credit strong {
    color: var(--gold);
    font-size: 1.1rem;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    flex-wrap: wrap;
    width: 100%;
}
.user-info .user-name {
    font-weight: 700;
    color: var(--cream);
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
}
.credit strong { color: var(--gold); font-size: 1.05rem; }
.btn-logout, .btn-admin, .btn-back, .btn-wallet {
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
.btn-logout { background: #991b1b; }
.btn-admin { background: #b45309; }
.btn-back, .btn-wallet {
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(251,191,36,0.35);
    color: var(--gold-soft);
}
@media (min-width: 700px) {
    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1.1rem;
    }
    .topbar-row { width: auto; }
    .user-info { width: auto; }
}

/* ===== Container / Rooms ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.rooms-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.room-card {
    background: linear-gradient(135deg, #6b1515, #5c1212);
    border-radius: 18px;
    padding: 1.15rem 1.2rem;
    border: 1px solid rgba(251, 191, 36, 0.22);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.room-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 12px 28px rgba(180, 83, 9, 0.25);
}
.room-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.15rem;
    color: var(--gold);
}
.room-card .price {
    font-size: 1.45rem;
    color: var(--gold);
    font-weight: 800;
    margin: 0.35rem 0;
}
.room-card .btn-enter {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    font-size: 1rem;
}
.room-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.room-card-top h3 { margin-bottom: 0; }
.room-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}
.status-idle { background: rgba(148,163,184,0.2); color: #d6d3d1; }
.status-waiting { background: rgba(251,191,36,0.22); color: #fbbf24; }
.status-playing { background: rgba(34,197,94,0.22); color: #4ade80; }
.player-count {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

/* Lobby quick actions */
.lobby-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.lobby-actions a {
    display: block;
    text-align: center;
    padding: 0.95rem;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(251,191,36,0.25);
}
.lobby-actions .act-wallet {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: var(--gold);
}
.lobby-actions .act-history {
    background: linear-gradient(135deg, #b45309, #92400e);
    color: var(--cream);
}

/* ===== Play ===== */
.play-container { max-width: 900px; margin: 0 auto; padding: 0.85rem; }
.game-status {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(251,191,36,0.2);
}
.status-text { font-size: 1.1rem; font-weight: 700; color: var(--gold-soft); }
.countdown { font-size: 1.8rem; color: var(--gold); margin-top: 0.35rem; font-weight: 800; }
.current-number-box { text-align: center; margin-bottom: 1rem; }
.current-number-box .label { color: var(--muted); font-size: 0.85rem; }
.current-number-box .number {
    font-size: 3.8rem;
    font-weight: 900;
    color: var(--gold);
    line-height: 1.05;
    text-shadow: 0 0 24px rgba(251,191,36,0.35);
}

.bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 360px;
    margin: 0 auto 1.2rem;
}
.bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6b1515;
    border: 2px solid #991b1b;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cream);
    transition: all 0.2s;
}
.bingo-cell.free {
    background: linear-gradient(135deg, #b45309, #92400e);
    color: white;
    font-size: 0.75rem;
    border-color: #f59e0b;
}
.bingo-cell.marked {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #3b0a0a;
    border-color: #fde68a;
    box-shadow: 0 0 0 2px rgba(251,191,36,0.35);
}

.buy-section { text-align: center; margin: 1.2rem 0; }
.called-numbers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.6rem; }
.called-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-soft);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}
.called-num.latest {
    background: var(--gold);
    color: #3b0a0a;
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(251,191,36,0.45);
}

.winners-section {
    margin-top: 1.2rem;
    padding: 0.95rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(251,191,36,0.2);
}
.win-info {
    text-align: center;
    padding: 0.95rem;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.4);
    border-radius: 12px;
    margin-top: 0.9rem;
    color: #86efac;
    font-weight: 700;
}

.history-section { margin-top: 1.5rem; }
.history-item {
    background: var(--card-bg);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.3rem;
    border: 1px solid rgba(251,191,36,0.12);
}
.history-item .win { color: #86efac; }
.history-item .lose { color: var(--muted); }

/* Players */
.players-section {
    margin: 1.1rem 0;
    padding: 0.95rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(251,191,36,0.18);
}
.players-section h3 { font-size: 1rem; margin-bottom: 0.7rem; color: var(--gold); }
.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
}
.player-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    font-size: 0.9rem;
}
.player-item.is-me {
    border: 1px solid var(--gold);
    background: rgba(251,191,36,0.1);
}
.player-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.player-name { flex: 1; font-weight: 600; }
.player-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}
.player-badge.me { background: rgba(251,191,36,0.25); color: #fbbf24; }
.player-badge.host { background: rgba(245,158,11,0.3); color: #fde68a; }
.player-badge.win { background: rgba(34,197,94,0.25); color: #4ade80; }

/* Bingo Modal */
.bingo-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.bingo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 0, 0, 0.82);
}
.bingo-modal-box {
    position: relative;
    background: linear-gradient(180deg, #7f1d1d, #5c1212);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 1.35rem;
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    animation: modalPop 0.3s ease;
}
@keyframes modalPop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.bingo-modal-title {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 1rem;
}
.bingo-winner-block {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(251,191,36,0.2);
}
.bingo-winner-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.bingo-winner-name { font-size: 1.2rem; font-weight: 800; color: #86efac; }
.bingo-winner-pattern { font-size: 0.9rem; color: var(--muted); margin: 0.3rem 0; }
.bingo-winner-prize { font-size: 1.05rem; color: var(--gold); font-weight: 700; margin-bottom: 0.7rem; }
.modal-bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    max-width: 240px;
    margin: 0 auto;
}
.modal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4a0e0e;
    border: 1px solid #991b1b;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.modal-cell.free { background: var(--free); color: white; font-size: 0.6rem; }
.modal-cell.marked { background: var(--marked); color: #3b0a0a; }
.modal-cell.win-line {
    background: #dc2626 !important;
    color: white !important;
    border-color: #b91c1c !important;
    box-shadow: 0 0 0 2px #fca5a5;
}
.bingo-modal-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.bingo-modal-actions button {
    flex: 1;
    min-width: 120px;
    padding: 0.8rem 0.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-modal-close {
    background: rgba(0,0,0,0.3);
    color: var(--text);
    border: 1px solid var(--border) !important;
}
.btn-modal-continue {
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
}

/* Spectator */
.spectator-wrap { display: block !important; width: 100%; max-width: 100%; }
.spectator-box {
    text-align: center;
    padding: 1.4rem 1.1rem;
    background: var(--card-bg);
    border: 1px dashed rgba(251,191,36,0.35);
    border-radius: 16px;
    margin: 0.5rem 0 1rem;
    width: 100%;
}
.spectator-icon { font-size: 2.2rem; margin-bottom: 0.35rem; }
.spectator-title { font-size: 1.15rem; font-weight: 800; color: var(--gold); margin-bottom: 0.35rem; }
.spectator-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 0.9rem; }
.spectator-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}
.spectator-meta span {
    display: inline-block;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
}
.spectator-hint { font-size: 0.85rem; color: var(--muted); }

/* ===== Wallet ===== */
.wallet-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.15rem;
    background: var(--card-bg);
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid rgba(251,191,36,0.2);
}
.wallet-tab-btn {
    flex: 1;
    padding: 0.75rem 0.45rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}
.wallet-tab-btn.active {
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
}
.wallet-card {
    background: linear-gradient(180deg, #6b1515, var(--card-bg));
    border: 1px solid rgba(251,191,36,0.22);
    border-radius: 20px;
    padding: 1.3rem;
    max-width: 460px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}
.wallet-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}
.wallet-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    font-weight: 800;
    flex-shrink: 0;
}
.deposit-icon { background: rgba(34,197,94,0.18); color: #86efac; }
.withdraw-icon { background: rgba(251,191,36,0.18); color: #fbbf24; }
.wallet-card-header h3 { font-size: 1.15rem; margin-bottom: 0.15rem; color: var(--gold); }
.wallet-card-header p { font-size: 0.85rem; color: var(--muted); margin: 0; }

.wallet-form .form-group { margin-bottom: 1rem; }
.wallet-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
    font-weight: 700;
}
.input-with-prefix {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.input-with-prefix .prefix {
    padding: 0 0.9rem;
    color: var(--gold);
    font-weight: 800;
    font-size: 1.15rem;
}
.input-with-prefix input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 0.9rem 0.9rem 0.9rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    outline: none;
    width: 100%;
}
.input-with-prefix:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(251,191,36,0.2);
}

.file-drop { display: block; cursor: pointer; }
.file-drop-inner {
    border: 2px dashed rgba(251,191,36,0.35);
    border-radius: 14px;
    padding: 1.4rem 1rem;
    text-align: center;
    background: rgba(0,0,0,0.2);
}
.file-drop:hover .file-drop-inner {
    border-color: var(--gold);
    background: rgba(251,191,36,0.08);
}
.file-drop-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.file-drop-text { font-weight: 700; font-size: 0.95rem; }
.file-drop-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.file-preview { margin-top: 0.75rem; text-align: center; }
.file-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.btn-remove-file {
    margin-top: 0.5rem;
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: #991b1b;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-wallet-submit {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 0 8px 22px rgba(180,83,9,0.35);
}
.btn-wallet-submit:hover { filter: brightness(1.08); }
.btn-wallet-submit:disabled { opacity: 0.6; cursor: not-allowed; filter: none; }
.btn-wallet-submit.btn-withdraw {
    background: linear-gradient(135deg, #92400e, #d97706);
}

.bank-info-card,
.deposit-bank-card {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.bank-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.bank-name, .db-name { font-weight: 800; font-size: 1rem; color: var(--gold-soft); }
.bank-number, .db-number {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.5px;
    margin: 0.25rem 0;
}
.db-acc { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.65rem; }
.btn-copy {
    width: 100%;
    padding: 0.65rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
    font-weight: 800;
    cursor: pointer;
}
.bank-empty {
    padding: 0.9rem;
    border-radius: 12px;
    background: rgba(248,113,113,0.12);
    color: #fecaca;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}
.deposit-banks { margin-bottom: 1.1rem; }
.bank-list-title {
    font-weight: 800;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    color: var(--gold);
}

.history-list .history-item,
#depositHistory .history-item,
#withdrawHistory .history-item {
    background: var(--card-bg);
}

/* Prize / info chips */
.prize-chip,
.info-chip {
    display: inline-block;
    background: rgba(251,191,36,0.15);
    border: 1px solid rgba(251,191,36,0.35);
    color: var(--gold);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Section titles */
.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold);
    margin: 0.5rem 0 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .logo { font-size: 1.05rem; }
    .user-info { font-size: 0.82rem; }
    .topbar-credit strong { font-size: 1.05rem; }
    .bingo-card { max-width: 100%; }
    .bingo-cell { font-size: 1.05rem; }
    .current-number-box .number { font-size: 3rem; }
    .rooms-grid { grid-template-columns: 1fr; }
    .auth-box { padding: 1.35rem 1.15rem; }
    .room-card .btn-enter { padding: 0.9rem; font-size: 1.05rem; }
}
@media (min-width: 601px) and (max-width: 900px) {
    .rooms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) {
    .rooms-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Sound toggle etc */
.topbar-actions .btn-sound {
    padding: 0.42rem 0.65rem;
    border-radius: 999px;
    min-width: 2.2rem;
}
.btn-sound,
.btn-secondary {
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(251,191,36,0.3);
    background: rgba(0,0,0,0.25);
    color: var(--gold-soft);
    font-weight: 600;
    cursor: pointer;
}
.btn-start-game {
    padding: 0.9rem 1.4rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(180,83,9,0.35);
}


/* History pager */
.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}
.pager-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(251,191,36,0.3);
    background: rgba(0,0,0,0.25);
    color: var(--gold-soft);
    font-weight: 700;
    cursor: pointer;
}
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-info { color: var(--muted); font-size: 0.9rem; }


/* ===== Hero Slider (Lobby) ===== */
.hero-slider {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 1.15rem;
    border: 1px solid rgba(251,191,36,0.28);
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}
.hero-track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}
.hero-slide {
    min-width: 100%;
    padding: 1.35rem 1.2rem 1.55rem;
    box-sizing: border-box;
    background:
        radial-gradient(ellipse at 90% 20%, rgba(251,191,36,0.18), transparent 45%),
        linear-gradient(135deg, #7f1d1d 0%, #4a0e0e 55%, #3b0a0a 100%);
    min-height: 150px;
    display: flex;
    align-items: center;
}
.hero-slide.s2 {
    background:
        radial-gradient(ellipse at 10% 80%, rgba(245,158,11,0.2), transparent 40%),
        linear-gradient(135deg, #991b1b 0%, #5c1212 100%);
}
.hero-slide.s3 {
    background:
        radial-gradient(ellipse at 85% 70%, rgba(34,197,94,0.12), transparent 40%),
        linear-gradient(135deg, #6b1515 0%, #3b0a0a 100%);
}
.hero-slide.s4 {
    background:
        radial-gradient(ellipse at 80% 30%, rgba(251,191,36,0.28), transparent 50%),
        linear-gradient(135deg, #b45309 0%, #7f1d1d 50%, #450a0a 100%);
}
.hero-content { width: 100%; }
.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #3b0a0a;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.45rem;
}
.hero-content h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fbbf24;
    margin: 0 0 0.3rem;
    line-height: 1.25;
    text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.hero-content p {
    font-size: 0.9rem;
    color: #fecaca;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}
.hero-cta {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fffbeb;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(251,191,36,0.4);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
}
.hero-cta-link {
    text-decoration: none;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    border-color: transparent;
    color: #fffbeb;
}
.hero-dots {
    position: absolute;
    left: 0; right: 0; bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}
.hero-dots span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.hero-dots span.active {
    background: #fbbf24;
    transform: scale(1.25);
}
@media (min-width: 700px) {
    .hero-slide { min-height: 180px; padding: 1.6rem 1.8rem; }
    .hero-content h2 { font-size: 1.75rem; }
    .hero-content p { font-size: 1rem; }
}


/* Chat */
.chat-section {
    margin: 1.2rem 0 2rem;
    padding: 0.9rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(251,191,36,0.2);
}
.chat-section h3 { color: var(--gold); margin-bottom: 0.6rem; font-size: 1rem; }
.chat-messages {
    height: 180px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.88rem;
}
.chat-line { margin-bottom: 0.35rem; line-height: 1.35; }
.chat-line .cn { color: var(--gold); font-weight: 700; margin-right: 0.35rem; }
.chat-line .cm { color: var(--cream); word-break: break-word; }
.chat-line.me .cn { color: #86efac; }
.chat-form { display: flex; gap: 0.45rem; }
.chat-form input {
    flex: 1;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-family: inherit;
}
.chat-form button {
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fffbeb;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* Announcement marquee */
.announce-bar {
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.35);
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
    margin-bottom: 0.9rem;
    color: #fde68a;
    font-size: 0.9rem;
    overflow: hidden;
    white-space: nowrap;
}
.announce-bar .marquee {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 18s linear infinite;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
.rules-btn {
    display: block;
    text-align: center;
    margin-bottom: 0.9rem;
    padding: 0.7rem;
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(251,191,36,0.3);
    color: var(--gold-soft);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}
.rules-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(0,0,0,0.75);
}
.rules-box {
    background: linear-gradient(180deg, #7f1d1d, #5c1212);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 1.2rem;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    color: var(--cream);
}
.rules-box h3 { color: var(--gold); margin-bottom: 0.7rem; }
.rules-box ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.rules-box li { margin-bottom: 0.35rem; font-size: 0.92rem; }
.vip-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(251,191,36,0.25);
    color: #fbbf24;
    font-weight: 700;
    margin-left: 0.3rem;
}
.notif-toast {
    position: fixed;
    top: 70px;
    right: 12px;
    z-index: 10000;
    background: #7f1d1d;
    border: 1px solid #fbbf24;
    color: #fffbeb;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 0.9rem;
}


.invite-stats { margin-bottom: 0.45rem; font-size: 0.9rem; color: var(--muted); }
.invite-link-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    margin-bottom: 0.25rem; font-size: 0.9rem; color: var(--muted);
}
.btn-copy-invite {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: #3b0a0a;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.invite-hint { font-size: 0.78rem; color: rgba(253,230,138,0.75); }


.bingo-cards-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.bingo-card-block { width: 100%; }
.card-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.35rem;
}
.bingo-card-block.card-won .card-label { color: #86efac; }
@media (min-width: 700px) {
    .bingo-cards-wrap {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }
}


.bingo-cards-wrap .bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 360px;
    margin: 0 auto 0.4rem;
}
.bingo-cards-wrap .bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6b1515;
    border: 2px solid #b45309;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cream);
}
.bingo-cards-wrap .bingo-cell.free {
    background: linear-gradient(135deg, #b45309, #92400e);
    border-color: #f59e0b;
    color: #fff;
}
.bingo-cards-wrap .bingo-cell.marked {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #3b0a0a;
    border-color: #fde68a;
}

.player-badge.cards {
    background: rgba(251,191,36,0.2);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.35);
}


.player-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    width: 100%;
}
.player-item .player-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.player-item .player-badge {
    flex: 0 0 auto;
}
.player-card-count {
    margin-left: auto;
    flex: 0 0 auto;
    font-weight: 800;
    font-size: 0.88rem;
    color: #fbbf24;
    background: rgba(251,191,36,0.15);
    border: 1px solid rgba(251,191,36,0.4);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    white-space: nowrap;
}
.player-num { display: none !important; }
