/* ===== RESET & BASE ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: rgba(25, 25, 60, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #e8e8ff;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --accent-1: #6c5ce7;
    --accent-2: #a855f7;
    --accent-3: #00cec9;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --success: #00e676;
    --danger: #ff5252;
    --warning: #ffc107;
    --gradient-1: linear-gradient(135deg, #6c5ce7, #a855f7);
    --gradient-2: linear-gradient(135deg, #00cec9, #6c5ce7);
    --gradient-bg: linear-gradient(135deg, #0a0a1a 0%, #111128 50%, #0d0d2b 100%);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.2);
    --radius: 16px;
    --radius-sm: 10px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATED BG ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    animation: float 20s infinite ease-in-out;
}

.bg-orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: var(--accent-1);
    top: -80px;
    left: -80px;
}

.bg-orb:nth-child(2) {
    width: 200px;
    height: 200px;
    background: var(--accent-3);
    bottom: -50px;
    right: -50px;
    animation-delay: -7s;
}

.bg-orb:nth-child(3) {
    width: 180px;
    height: 180px;
    background: var(--accent-2);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -20px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }

    75% {
        transform: translate(20px, 20px) scale(1.02);
    }
}

/* ===== MAIN CONTAINER ===== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 100%;
    padding: 12px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 16px 0 12px;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 400;
}

/* ===== CONNECTION STATUS ===== */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    transition: background 0.3s;
    flex-shrink: 0;
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
    }

    50% {
        box-shadow: 0 0 18px rgba(0, 230, 118, 0.8);
    }
}

.status-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

/* ===== SETUP / USERNAME SCREEN ===== */
.setup-screen {
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
}

.setup-screen h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.setup-screen .subtitle {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 24px;
}

.username-hero {
    margin-bottom: 24px;
}

.username-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    animation: bounce-in 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce-in {
    from {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gradient-1);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

.waiting-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
}

.waiting-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.waiting-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== INPUT GROUP ===== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.number-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 10px;
    outline: none;
    transition: all 0.3s;
    -webkit-appearance: none;
}

.number-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 16px rgba(108, 92, 231, 0.2);
}

.number-input::placeholder {
    letter-spacing: 6px;
    font-size: 1rem;
    color: var(--text-muted);
}

#usernameInput {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
}

#usernameInput::placeholder {
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.08);
}

.btn-full {
    width: 100%;
}

/* ===== GAME AREA ===== */
.game-area {
    display: none;
    flex: 1;
    flex-direction: column;
}

.game-area.active {
    display: flex;
}

.game-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* ===== INFO BAR ===== */
.info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.info-chip .icon {
    font-size: 0.85rem;
}

.turn-indicator {
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.turn-indicator.my-turn {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(0, 206, 201, 0.15));
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--success);
    animation: glow-pulse 2s infinite;
}

.turn-indicator.opponent-turn {
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(255, 82, 82, 0.2);
    color: var(--danger);
    animation: none;
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(0, 230, 118, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 230, 118, 0.25);
    }
}

/* ===== GUESS SECTION ===== */
.guess-section {
    margin-bottom: 12px;
}

.guess-form {
    display: flex;
    gap: 8px;
}

.guess-input {
    flex: 1;
    padding: 12px 12px;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 6px;
    outline: none;
    transition: all 0.3s;
    -webkit-appearance: none;
    min-width: 0;
}

.guess-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 16px rgba(108, 92, 231, 0.2);
}

.guess-input::placeholder {
    letter-spacing: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.guess-input:disabled {
    opacity: 0.4;
}

/* ===== GUESS HISTORY ===== */
.guess-history {
    flex: 1;
    overflow-y: auto;
    max-height: 45vh;
}

.guess-history h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guess-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.guess-table thead th {
    padding: 8px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.guess-table tbody tr {
    background: var(--bg-glass);
    transition: all 0.3s;
}

.guess-table tbody tr.my-guess {
    border-left: 3px solid var(--accent-1);
}

.guess-table tbody tr.opponent-guess {
    border-left: 3px solid var(--accent-3);
}

.guess-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
}

.guess-table td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.guess-table td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guess-number {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 3px;
}

.guess-result {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    letter-spacing: 1px;
}

.result-char {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 5px;
    margin-right: 2px;
    font-weight: 700;
    font-size: 0.78rem;
}

.result-char.correct {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.2), rgba(0, 206, 201, 0.2));
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.result-char.wrong {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

.player-label {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.player-label.p1 {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-1);
}

.player-label.p2 {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-3);
}

/* ===== FLOATING CHAT BUTTON ===== */
.chat-fab {
    position: fixed;
    bottom: calc(20px + var(--safe-bottom));
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chat-fab.visible {
    display: flex;
}

.chat-fab:active {
    transform: scale(0.9);
}

.chat-fab .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-fab .chat-badge.active {
    display: flex;
}

@keyframes badge-pop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* ===== CHAT NOTIFICATION TOAST ===== */
.chat-notification {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    right: 16px;
    max-width: 260px;
    padding: 10px 14px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 12px 12px 4px 12px;
    z-index: 49;
    animation: chat-notif-in 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.chat-notification .notif-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.chat-notification .notif-text {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes chat-notif-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== CHAT PANEL (Fullscreen Overlay on Mobile) ===== */
.chat-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 60;
    flex-direction: column;
    border-radius: 0;
    border: none;
    padding: 0;
    background: var(--bg-primary);
}

.chat-panel.open {
    display: flex;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-card);
}

.chat-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-close-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
    width: 3px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 3px;
}

.chat-msg {
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    animation: msg-in 0.3s ease;
}

@keyframes msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.chat-msg.other {
    align-self: flex-start;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
}

.chat-msg .msg-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-2);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chat-msg.mine .msg-name {
    color: var(--accent-1);
    text-align: right;
}

.chat-msg .msg-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.chat-msg .msg-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.chat-msg.mine .msg-time {
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: calc(10px + var(--safe-bottom));
    border-top: 1px solid var(--border-glass);
    background: var(--bg-card);
}

.chat-input {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.3s;
    -webkit-appearance: none;
}

.chat-input:focus {
    border-color: var(--accent-1);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    padding: 12px 16px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* ===== SYSTEM MESSAGES ===== */
.system-msg {
    text-align: center;
    padding: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== OVERLAYS ===== */
.winner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.winner-overlay.active {
    display: flex;
}

.winner-card {
    text-align: center;
    padding: 40px 24px;
    max-width: 400px;
    width: 100%;
    animation: winner-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes winner-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.winner-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.winner-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.winner-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 24px;
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.4s ease;
    pointer-events: auto;
}

.toast.error {
    border-color: rgba(255, 82, 82, 0.3);
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.1), var(--bg-card));
}

.toast.success {
    border-color: rgba(0, 230, 118, 0.3);
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.1), var(--bg-card));
}

.toast.info {
    border-color: rgba(108, 92, 231, 0.3);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), var(--bg-card));
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MY NUMBER DISPLAY ===== */
.my-number-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.my-number-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-2);
}

/* ===== NEW GAME BTN ===== */
.new-game-section {
    text-align: center;
    margin-top: 16px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.82rem;
}

/* ===== SCOREBOARD BUTTON ===== */
.scoreboard-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-left: 8px;
    -webkit-tap-highlight-color: transparent;
}

.scoreboard-btn:active {
    transform: scale(0.9);
}

/* ===== SCOREBOARD CARD ===== */
.scoreboard-card {
    max-width: 400px;
    width: 100%;
    padding: 30px 20px;
}

.scoreboard-content {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.scoreboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
    margin-top: 12px;
}

.scoreboard-table thead th {
    padding: 8px 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.scoreboard-table tbody tr {
    background: var(--bg-glass);
}

.scoreboard-table tbody tr.scoreboard-me {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.25);
}

.scoreboard-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
}

.scoreboard-table td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 1rem;
    text-align: center;
    width: 36px;
}

.scoreboard-table td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.scoreboard-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-wins {
    color: var(--success);
    font-weight: 600;
}

.score-losses {
    color: var(--danger);
    font-weight: 600;
}

/* ===== STATS CHIP ===== */
.stats-chip {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(168, 85, 247, 0.1));
    border-color: rgba(108, 92, 231, 0.2);
}

#statsDisplay {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

/* ===== MODE TOGGLE SWITCH ===== */
.mode-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    transition: all 0.3s;
}

.mode-switch-container.locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.mode-switch-container.locked::after {
    content: '🔒';
    position: absolute;
    right: 12px;
    font-size: 0.8rem;
}

.mode-switch-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s;
    white-space: nowrap;
}

.mode-switch-label.active {
    color: var(--text-primary);
    text-shadow: 0 0 12px rgba(108, 92, 231, 0.4);
}

/* Toggle Switch */
.mode-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.3), rgba(0, 206, 201, 0.15));
    border: 1px solid rgba(0, 206, 201, 0.3);
    border-radius: 26px;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.mode-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mode-switch input:checked+.mode-slider {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.15));
    border-color: rgba(168, 85, 247, 0.3);
}

.mode-switch input:checked+.mode-slider::before {
    transform: translateX(22px);
}

.mode-switch-container.locked .mode-slider {
    cursor: not-allowed;
    pointer-events: none;
}


/* ===== MODE BADGE ===== */
.mode-badge {
    margin-bottom: 12px;
}

.mode-badge-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
}

.mode-badge-inner.number {
    background: rgba(0, 206, 201, 0.12);
    color: var(--accent-3);
    border: 1px solid rgba(0, 206, 201, 0.25);
}

.mode-badge-inner.word {
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-2);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

/* ===== WORDLE LETTER STATES ===== */
.result-char.w-correct {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.25), rgba(0, 200, 100, 0.25));
    color: #4ade80;
    border: 1px solid rgba(0, 230, 118, 0.4);
}

.result-char.w-present {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 160, 0, 0.25));
    color: #fbbf24;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.result-char.w-absent {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

/* ===== WORD MODE GUESS STYLES ===== */
.guess-number {
    text-transform: uppercase;
}

/* ===== RESET LONG PRESS ===== */
.reset-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 0 0 8px 8px;
    display: none;
    transition: none;
}

.reset-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== HIDE/SHOW HELPERS ===== */
.hidden {
    display: none !important;
}