/* ============= CSS VARIABLES ============= */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #22c55e;
    --success-dark: #16a34a;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #eab308;
    --orange: #f97316;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --bg: #0a0a1a;
    --bg-card: #111127;
    --bg-input: #0d0d20;
    --text: #f1f5f9;
    --text-dim: #64748b;
    --text-muted: #475569;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.15);
}

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

/* ============= AUTH PAGE ============= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom);
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}

.auth-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.auth-box h1 { font-size: 28px; margin-bottom: 8px; text-align: center; }
.subtitle { text-align: center; color: var(--text-dim); margin-bottom: 24px; font-size: 14px; }

.status-indicator {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 24px; font-size: 14px; color: var(--text-dim);
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-dim); animation: pulse 2s infinite;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.tab {
    flex: 1; padding: 12px; background: transparent; border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-dim); cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.tab:hover { background: rgba(255,255,255,0.05); }
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.form-group input {
    width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px; transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.form-group small { display: block; margin-top: 4px; font-size: 12px; color: var(--text-dim); }

.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary { width: 100%; background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.hidden { display: none !important; }
.error-message {
    margin-top: 16px; padding: 12px; background: rgba(239,68,68,0.1);
    border: 1px solid var(--danger); border-radius: 8px; color: var(--danger); font-size: 14px;
}

/* ============= CRASH GAME BODY ============= */
.crash-body {
    margin: 0; padding: 0; overflow: hidden; height: 100vh;
    display: flex; flex-direction: column;
    background: #050510;
    position: relative;
}

/* Blur orbs */
.orb {
    position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: 0;
}
.orb-1 {
    top: -15%; right: 5%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
    animation: orbFloat1 20s ease-in-out infinite;
}
.orb-2 {
    bottom: -15%; left: 5%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.10) 0%, transparent 70%);
    animation: orbFloat2 25s ease-in-out infinite;
}
.orb-3 {
    top: 40%; left: 40%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(34,197,94,0.06) 0%, transparent 70%);
    animation: orbFloat3 30s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,-30px); } }
@keyframes orbFloat2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-30px,40px); } }
@keyframes orbFloat3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(20px,-20px); } }

.crash-body > *:not(.orb):not(.crash-flash):not(.fair-modal-backdrop) { position: relative; z-index: 1; }

/* ============= CRASH FLASH ============= */
.crash-flash {
    position: fixed; inset: 0; z-index: 1000; pointer-events: none;
    background: radial-gradient(circle, rgba(239,68,68,0.4) 0%, transparent 70%);
    opacity: 0; transition: opacity 0.1s;
}
.crash-flash.active {
    opacity: 1;
    animation: flashPulse 0.5s ease-out forwards;
}
@keyframes flashPulse { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ============= HEADER ============= */
.crash-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px max(20px, env(safe-area-inset-left)) 10px max(20px, env(safe-area-inset-right));
    background: rgba(17,17,39,0.9);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    backdrop-filter: blur(10px);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 16px; }

.logo { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.logo-accent { color: var(--primary); }

.round-badge {
    font-size: 12px; color: var(--text-dim); background: rgba(255,255,255,0.05);
    padding: 4px 10px; border-radius: 12px; font-weight: 500;
}

.balance-display { display: flex; flex-direction: column; align-items: flex-end; }
.balance-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.balance-value { font-size: 18px; font-weight: 700; color: var(--success); }

.username-display { font-size: 13px; color: var(--text-dim); }

.btn-icon {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px; color: var(--text-dim); cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ============= CRASH HISTORY STRIP ============= */
.crash-history-strip {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 20px; background: rgba(17,17,39,0.7);
    border-bottom: 1px solid var(--border);
    overflow-x: auto; flex-shrink: 0;
    scrollbar-width: none;
}
.crash-history-strip::-webkit-scrollbar { display: none; }

.history-label {
    font-size: 11px; font-weight: 700; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
    margin-right: 4px;
}

.crash-bubble {
    padding: 4px 10px; border-radius: 14px; font-size: 12px;
    font-weight: 700; white-space: nowrap; flex-shrink: 0;
    transition: transform 0.2s;
}
.crash-bubble:hover { transform: scale(1.1); }
.bubble-red { background: rgba(239,68,68,0.15); color: #ef4444; }
.bubble-orange { background: rgba(249,115,22,0.15); color: #f97316; }
.bubble-green { background: rgba(34,197,94,0.15); color: #22c55e; }
.bubble-blue { background: rgba(59,130,246,0.15); color: #3b82f6; }

/* ============= MAIN CONTENT ============= */
.crash-main {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* ============= CHART SECTION ============= */
.chart-section { flex: 1; position: relative; min-height: 0; }

.chart-area {
    width: 100%; height: 100%; position: relative; overflow: hidden;
}

#gameCanvas { width: 100%; height: 100%; display: block; }

/* Multiplier overlay */
.multiplier-overlay {
    position: absolute; top: 15%; left: 50%; transform: translate(-50%, 0);
    text-align: center; pointer-events: none; z-index: 10;
}

.multiplier-display {
    font-size: 64px; font-weight: 900; color: #ffffff;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    line-height: 1; transition: color 0.3s, text-shadow 0.3s, transform 0.1s;
    font-variant-numeric: tabular-nums;
}

.phase-label {
    font-size: 14px; color: rgba(255,255,255,0.4); margin-top: 8px;
    font-weight: 600; letter-spacing: 1px;
}

/* Crash overlay */
.crash-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(10,10,26,0.85); z-index: 20;
    animation: crashFadeIn 0.3s ease-out;
}
@keyframes crashFadeIn { from { opacity: 0; } to { opacity: 1; } }

.crash-text {
    font-size: 48px; font-weight: 900; color: var(--danger);
    text-shadow: 0 0 40px rgba(239,68,68,0.8);
    animation: crashShake 0.5s ease-out;
    letter-spacing: 4px;
}
@keyframes crashShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px) rotate(-1deg); }
    30% { transform: translateX(8px) rotate(1deg); }
    50% { transform: translateX(-6px) rotate(-0.5deg); }
    70% { transform: translateX(4px) rotate(0.5deg); }
    90% { transform: translateX(-2px); }
}

.crash-multiplier {
    font-size: 36px; font-weight: 700; color: rgba(239,68,68,0.8); margin-top: 8px;
}

.crash-countdown {
    font-size: 16px; color: var(--text-dim); margin-top: 16px; font-weight: 500;
}

/* ============= BOTTOM PANEL ============= */
.bottom-panel {
    display: flex; flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: rgba(17,17,39,0.9);
    backdrop-filter: blur(10px);
    max-height: 240px;
}

/* ============= BET PANEL ============= */
.bet-panel {
    width: 320px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px;
    border-right: 1px solid var(--border); overflow: hidden;
    flex-shrink: 0;
}

.bet-section { display: flex; flex-direction: column; gap: 6px; }
.bet-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.bet-input-row { display: flex; align-items: center; gap: 0; }
.bet-currency, .bet-suffix {
    padding: 8px 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--text-dim); font-size: 14px; font-weight: 600;
}
.bet-currency { border-radius: 8px 0 0 8px; border-right: none; }
.bet-suffix { border-radius: 0 8px 8px 0; border-left: none; }

.bet-input {
    flex: 1; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text); font-size: 16px; font-weight: 600;
    font-variant-numeric: tabular-nums; transition: border-color 0.2s;
    -moz-appearance: textfield;
}
.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bet-input:focus { outline: none; border-color: var(--primary); }
.bet-input-row .bet-input:first-child { border-radius: 0; }
.bet-input-row .bet-input:only-child { border-radius: 8px; }

.bet-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-preset {
    padding: 5px 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text-dim); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.btn-preset:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: var(--border-hover); }
.btn-preset-special { color: var(--primary); }

.bet-actions { display: flex; flex-direction: column; gap: 6px; }

.btn-place-bet {
    width: 100%; padding: 14px; background: linear-gradient(135deg, var(--success), var(--success-dark));
    border: none; border-radius: 10px; color: white; font-size: 16px; font-weight: 800;
    cursor: pointer; transition: all 0.2s; letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}
.btn-place-bet:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34,197,94,0.4); }
.btn-place-bet:active:not(:disabled) { transform: translateY(0); }

.btn-cashout {
    width: 100%; padding: 14px; background: linear-gradient(135deg, var(--orange), #ea580c);
    border: none; border-radius: 10px; color: white; font-size: 16px; font-weight: 800;
    cursor: pointer; transition: all 0.2s; letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(249,115,22,0.3);
    animation: cashoutPulse 1s ease-in-out infinite;
}
@keyframes cashoutPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(249,115,22,0.3); }
    50% { box-shadow: 0 4px 25px rgba(249,115,22,0.5); }
}
.btn-cashout:hover { transform: translateY(-1px); }

.cashout-profit { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.cashout-profit.positive { color: rgba(255,255,255,0.9); }
.cashout-profit.negative { color: rgba(255,255,255,0.6); }

.positive { color: var(--success); }
.negative { color: var(--danger); }

/* ============= LIVE FEED ============= */
.live-feed {
    display: flex; flex-direction: column; overflow: hidden;
    min-width: 0;
    background: rgba(17,17,39,0.9);
    border-top: 1px solid var(--border);
}

/* Desktop: live feed on the right side */
@media (min-width: 769px) {
    .live-feed {
        position: fixed;
        right: 0;
        top: 90px;
        bottom: 0;
        width: 320px;
        border-left: 1px solid var(--border);
        border-top: none;
    }
    .crash-main {
        margin-right: 320px;
    }
    .bottom-panel {
        margin-right: 320px;
    }
}

.feed-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.feed-title { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.feed-count { font-size: 11px; color: var(--text-muted); }
.feed-header-right { display: flex; align-items: center; gap: 8px; }
.feed-toggle {
    display: none; background: none; border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-dim); cursor: pointer; padding: 4px 8px; font-size: 10px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    transition: all 0.2s; line-height: 1;
}
.feed-toggle:hover { color: var(--text); border-color: var(--border-hover); }
.feed-toggle svg { display: block; transition: transform 0.3s; }
.live-feed.collapsed .feed-toggle svg { transform: rotate(180deg); }

.feed-list {
    flex: 1; overflow-y: auto; padding: 8px 16px;
    display: flex; flex-direction: column; gap: 4px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.feed-list::-webkit-scrollbar { width: 4px; }
.feed-list::-webkit-scrollbar-track { background: transparent; }
.feed-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.feed-item {
    font-size: 12px; color: var(--text-dim); padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    line-height: 1.4;
}
.feed-item-new { animation: feedSlideIn 0.3s ease-out; }
@keyframes feedSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.feed-user { color: var(--text); font-weight: 600; }
.feed-amount { color: var(--warning); font-weight: 600; }
.feed-mult { color: var(--primary); font-weight: 600; }
.feed-profit { font-weight: 700; }
.feed-profit.positive { color: var(--success); }
.feed-lost { color: var(--danger); font-weight: 600; }

/* ============= CHAT ============= */
.chat-input-row {
    display: flex; align-items: center; gap: 0;
    padding: 8px 12px; border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input {
    flex: 1; padding: 8px 12px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: 8px 0 0 8px;
    color: var(--text); font-size: 12px; transition: border-color 0.2s;
}
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn {
    padding: 8px 12px; background: var(--primary); border: 1px solid var(--primary);
    border-radius: 0 8px 8px 0; color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.chat-send-btn:hover { background: var(--primary-dark); }

.feed-chat { border-left: 2px solid var(--primary); padding-left: 8px; }
.feed-chat-text { color: var(--text); font-weight: 400; }

/* ============= PROVABLY FAIR BADGE ============= */
.fair-badge {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 12px; padding: 4px 10px;
    font-size: 11px; color: var(--text-dim); font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px;
    cursor: pointer; transition: all 0.2s;
}
.fair-badge:hover { color: var(--success); border-color: rgba(34,197,94,0.3); }
.fair-badge svg { color: var(--success); }

/* Provably Fair Modal */
.fair-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    z-index: 500; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
    padding: 20px;
    padding-bottom: 160px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fair-modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 28px; width: 90%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.fair-modal-title {
    font-size: 18px; font-weight: 700; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.fair-modal-title svg { color: var(--success); }

.fair-modal-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.fair-modal-label { color: var(--text-dim); font-weight: 500; }
.fair-modal-value {
    color: var(--text); font-family: monospace; font-size: 12px;
    cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; transition: color 0.2s;
}
.fair-modal-value:hover { color: var(--primary); }

.fair-modal-explain {
    margin-top: 16px; font-size: 12px; color: var(--text-dim);
    line-height: 1.6; background: rgba(255,255,255,0.03);
    border-radius: 8px; padding: 12px;
}

.fair-modal-close {
    margin-top: 16px; width: 100%; padding: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-dim); font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.fair-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ============= TOAST MESSAGES ============= */
#messages {
    position: fixed; bottom: 50px; right: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 6px; max-width: 350px;
}

.toast {
    padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
    animation: toastIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}
.toast-success {
    background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: var(--success);
}
.toast-error {
    background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--danger);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }

/* ============= RESPONSIVE ============= */

/* --- Mobile (max 768px) --- */
@media (max-width: 768px) {
    .crash-body {
        height: 100vh;
        height: 100dvh;
    }

    .crash-main {
        flex: 1;
        padding-bottom: 270px; /* space for live-feed (140px) + bet-panel (120px) + margin */
        overflow: auto;
        margin-right: 0 !important;
    }

    .chart-section {
        flex: 1;
        min-height: 150px;
    }

    /* Live feed: FIXED just above bet panel */
    .live-feed {
        position: fixed !important;
        bottom: 120px; /* height of bet-panel */
        left: 0;
        right: 0;
        width: 100% !important;
        height: 140px !important;
        z-index: 99;
        border-left: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        background: rgba(17,17,39,0.98) !important;
        display: flex !important;
        flex-direction: column;
    }
    .live-feed .chat-input-row { display: none; }
    .live-feed .feed-header { flex-shrink: 0; }
    .live-feed .feed-list {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        display: block !important;
    }
    .feed-toggle { display: flex !important; align-items: center; }
    .live-feed.collapsed { height: 40px !important; overflow: hidden; }
    .live-feed.collapsed .feed-list { display: none !important; }

    /* Bottom panel FIXED at bottom */
    .bottom-panel {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        margin-right: 0 !important;
        background: rgba(17,17,39,0.98);
        border-top: 1px solid var(--border);
    }

    .bet-panel {
        width: 100%;
        padding: 8px 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .multiplier-display { font-size: 32px; }
    .crash-text { font-size: 24px; }
    .orb { display: none; }
}

/* --- Phone (max 480px) --- */
@media (max-width: 480px) {
    .crash-header { padding: 6px 10px; gap: 6px; }
    .header-left { gap: 6px; }
    .header-right { gap: 6px; }
    .logo { font-size: 15px; }
    .username-display { display: none; }
    .round-badge { font-size: 9px; padding: 2px 6px; }
    .balance-value { font-size: 14px; }
    .balance-label { font-size: 8px; }

    .crash-history-strip { padding: 4px 10px; gap: 4px; }
    .crash-bubble { padding: 2px 6px; font-size: 10px; }

    .multiplier-display { font-size: 28px; }
    .crash-text { font-size: 22px; }
    .crash-multiplier { font-size: 20px; }

    /* Live feed compact but visible */
    .live-feed { height: 120px !important; }
    .live-feed.collapsed { height: 40px !important; }
    .feed-header { padding: 8px 12px; }

    /* Compact bet panel */
    .bet-panel { padding: 8px 10px; gap: 6px; }
    .bet-section { gap: 4px; }
    .bet-label { font-size: 10px; }
    .bet-presets { gap: 3px; }
    .btn-preset { padding: 6px 8px; font-size: 11px; min-height: 30px; }
    .bet-input { padding: 8px 10px; font-size: 16px; min-height: 40px; }
    .bet-currency { padding: 8px; min-height: 40px; font-size: 14px; }
    .btn-place-bet { padding: 12px; min-height: 46px; font-size: 15px; }
    .btn-cashout { padding: 12px; min-height: 46px; font-size: 15px; }

    .fair-modal { padding: 16px 12px; }
    .fair-modal-title { font-size: 15px; }
    .fair-modal-value { max-width: 140px; font-size: 10px; }

    #messages { top: 50px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); }
    .toast { font-size: 11px; padding: 6px 10px; }

    /* Auth page */
    .auth-box { padding: 20px 14px; }
    .auth-box h1 { font-size: 20px; }
    .form-group input { min-height: 42px; font-size: 16px; }
    .btn { min-height: 42px; }
    .tab { min-height: 40px; font-size: 13px; }
}

/* --- Small phone (max 360px) --- */
@media (max-width: 360px) {
    .logo { font-size: 13px; }
    .fair-badge-text { display: none; }
    .fair-badge { padding: 3px 6px; }
    .multiplier-display { font-size: 24px; }
    .btn-preset { padding: 5px 6px; font-size: 10px; }
    .bet-panel { padding: 6px 8px; }
    .btn-place-bet, .btn-cashout { padding: 10px; min-height: 42px; font-size: 14px; }
}
