/* Typing Fighter - Cyberpunk Arcade CSS */

:root {
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff0055;
    --neon-yellow: #ffe600;
    --neon-purple: #9d00ff;
    --dark-bg: #070913;
    --dark-card: rgba(15, 20, 42, 0.88);
    --dark-border: rgba(0, 240, 255, 0.3);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

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

html {
    font-size: 16px;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--dark-bg);
    color: #ffffff;
    font-family: var(--font-body);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* APP CONTAINER */
.app-container {
    width: 100%;
    max-width: 1240px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100dvh;
    box-sizing: border-box;
}

/* PLAYER HEADER BADGE */
.player-header-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-header-badge:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.icon-glow {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-right: 6px;
}

.level-avatar i {
    font-size: 2.2rem;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px var(--neon-cyan));
}

.avatar i {
    font-size: 1.5rem;
    color: var(--neon-cyan);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
}

.user-meta {
    font-size: 0.7rem;
    color: var(--neon-cyan);
}

/* AUTH MODAL STYLING */
.auth-card {
    max-width: 550px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin: 18px 0;
}

.auth-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

.form-group label {
    font-size: 0.8rem;
    font-family: var(--font-heading);
    color: #a0aec0;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    background: #000;
    border: 1.5px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
}

.auth-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.auth-status-msg {
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 900;
}

.logo .highlight {
    color: var(--neon-magenta);
    text-shadow: 0 0 10px var(--neon-magenta);
}

.badge {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: #000;
    font-weight: 900;
}

.header-controls {
    display: flex;
    gap: 12px;
}

/* BUTTONS */
.btn {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-neon {
    background: linear-gradient(135deg, #00f0ff, #0088ff);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.7);
}

.btn-magenta {
    background: linear-gradient(135deg, #ff0055, #ff00aa);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.btn-magenta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 0, 85, 0.7);
}

.btn-yellow {
    background: linear-gradient(135deg, #ffe600, #ff9900);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.4);
    font-weight: 800;
}

.btn-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 230, 0, 0.8);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--neon-cyan);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
}

/* ARENA WRAPPER */
.arena-wrapper {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* HUD BAR */
.hud {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    align-items: center;
    gap: 15px;
}

.player-hud {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: rgba(0, 240, 255, 0.1);
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.p2-hud .avatar {
    border-color: var(--neon-magenta);
    box-shadow: 0 0 10px var(--neon-magenta);
    background: rgba(255, 0, 85, 0.1);
}

.details h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.stats-mini {
    font-size: 0.8rem;
    color: #a0aec0;
}

.align-right {
    text-align: right;
}

/* HEALTH BARS */
.hp-bar-outer {
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.hp-bar-inner {
    height: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.p1-hp {
    background: linear-gradient(90deg, #00f0ff, #0066ff);
    box-shadow: 0 0 15px #00f0ff;
}

.p2-hp {
    background: linear-gradient(90deg, #ff00aa, #ff0055);
    box-shadow: 0 0 15px #ff0055;
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 900;
    font-family: var(--font-heading);
    color: #ffffff !important;
    text-shadow: 0 0 4px #000, 1px 1px 3px #000, -1px -1px 3px #000;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    letter-spacing: 0.5px;
}

/* SUPER METERS */
.super-bar-outer {
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.super-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #ffe600, #ff9900);
    box-shadow: 0 0 10px #ffe600;
    transition: width 0.2s ease;
}

.super-text {
    position: absolute;
    right: 8px;
    top: -12px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--neon-yellow);
}

/* VS CENTER */
.vs-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.vs-circle {
    width: 48px;
    height: 48px;
    background: var(--dark-bg);
    border: 2px solid var(--neon-yellow);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--neon-yellow);
    box-shadow: 0 0 15px var(--neon-yellow);
}

/* MOBILE KEYBOARD BUTTON (Hidden by default on Desktop) */
.mobile-keyboard-btn {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 800;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(0, 240, 255, 0.3); }
    to { box-shadow: 0 0 20px rgba(0, 240, 255, 0.8); }
}

/* ========================================================================== */
/* UNIFIED NEXT-LEVEL RESPONSIVE DESIGN SYSTEM (LAPTOPS, TABLETS & PHONES)    */
/* ========================================================================== */

/* -- 1. LAPTOPS & TABLETS (<= 1024px) ------------------------------------- */
@media (max-width: 1024px) {
    .app-container {
        padding: 8px 12px;
        gap: 10px;
    }

    .header {
        padding: 8px 14px;
    }

    .modes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .utility-grid {
        grid-template-columns: 1fr;
    }

    .arena-selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .campaign-grid {
        grid-template-columns: repeat(3, 1fr);
        max-height: 50dvh;
    }

    .canvas-container {
        max-height: min(420px, calc(100dvh - 220px));
    }
}

/* -- 2. SMARTPHONES & SMALL TABLETS (<= 768px) --------------------------- */
@media (max-width: 768px) {
    html, body {
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        touch-action: manipulation;
        -webkit-text-size-adjust: 100%;
    }

    .app-container {
        min-height: 100dvh;
        height: auto;
        padding-top: max(6px, env(safe-area-inset-top));
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        gap: 8px;
        overflow-x: hidden;
    }

    /* Prevent mobile browser auto-zoom glitch on text inputs */
    input, textarea, select {
        font-size: 16px !important;
    }

    /* -- HEADER ON MOBILE: CLEAN 1-ROW FLOW ------------------ */
    .header {
        padding: 6px 10px;
        border-radius: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .logo-area {
        gap: 6px;
        min-width: 0;
        flex-shrink: 1;
    }

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

    .logo-text {
        font-size: 1rem;
        letter-spacing: 1px;
        white-space: nowrap;
    }

    .logo-area .badge {
        display: none;
    }

    .player-header-badge {
        padding: 4px 8px;
        border-radius: 8px;
        gap: 4px;
        max-width: 95px;
        min-width: 0;
    }

    .player-header-badge .avatar-icon {
        font-size: 0.95rem;
    }

    .player-header-badge .user-meta {
        display: none;
    }

    .player-header-badge .user-name {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-controls {
        width: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        flex-shrink: 0;
    }

    .header-controls .btn,
    .header-controls .icon-btn {
        padding: 5px 8px;
        font-size: 0.72rem;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .chat-header-text {
        display: none;
    }

    /* -- DASHBOARD ON MOBILE --------------------------------- */
    .hero-banner {
        padding: 18px 12px 14px;
        border-radius: 14px;
    }

    .hero-title {
        font-size: 1.5rem;
        letter-spacing: 1.5px;
    }

    .hero-subtitle {
        font-size: 0.8rem;
        margin-bottom: 14px;
        line-height: 1.35;
    }

    .dual-hero-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn-hero-play,
    .btn-hero-chat {
        width: 100%;
        max-width: 100%;
        padding: 12px 14px;
    }

    .play-main-text {
        font-size: 1rem;
    }

    .modes-grid,
    .utility-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dash-card {
        padding: 16px 14px;
        border-radius: 12px;
    }

    .dash-card-icon {
        font-size: 2rem;
    }

    .dash-card h3 {
        font-size: 1rem;
    }

    .dash-card p {
        font-size: 0.78rem;
    }

    .arena-selector-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    /* -- BATTLE ARENA & HUD ON MOBILE ------------------------ */
    .arena-wrapper {
        gap: 6px;
        padding: 0 0 10px 0;
        min-height: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .hud {
        display: grid;
        grid-template-columns: 1fr 65px 1fr;
        gap: 5px;
        padding: 6px 8px;
        border-radius: 10px;
    }

    .player-info {
        gap: 5px;
        min-width: 0;
    }

    .avatar {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .details {
        min-width: 0;
        overflow: hidden;
    }

    .details h3 {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stats-mini {
        font-size: 0.62rem;
        white-space: nowrap;
    }

    .vs-box {
        gap: 2px;
    }

    .vs-circle {
        width: 26px;
        height: 26px;
        font-size: 0.68rem;
    }

    .stage-badge {
        font-size: 0.62rem;
        padding: 2px 4px;
        white-space: nowrap;
    }

    .match-time {
        font-size: 0.72rem;
    }

    .combo-badge {
        font-size: 0.62rem;
        padding: 2px 6px;
    }

    .hp-bar-outer {
        height: 20px !important;
        border-radius: 6px;
        position: relative;
    }

    .hp-text {
        font-size: 0.65rem !important;
        font-weight: 900 !important;
        color: #ffffff !important;
        letter-spacing: 0.3px;
    }

    .super-bar-outer {
        height: 7px;
        border-radius: 4px;
    }

    .super-text {
        display: none;
    }

    /* -- CANVAS ARENA ON MOBILE ----------------------------- */
    .canvas-container {
        width: 100%;
        aspect-ratio: 16 / 8;
        max-height: clamp(160px, 32vh, 240px);
        min-height: 150px;
        border-radius: 12px;
        overflow: hidden;
        border: 1.5px solid rgba(0, 240, 255, 0.35);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(0, 240, 255, 0.1);
        position: relative;
    }

    .canvas-container canvas {
        width: 100%;
        height: 100%;
        display: block;
    }

    .typing-box-container {
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 96%;
        max-width: 96%;
        gap: 3px;
        padding: 0;
        z-index: 20;
    }

    .typing-word-card {
        padding: 6px 10px !important;
        border-radius: 10px !important;
        backdrop-filter: blur(8px) !important;
        background: rgba(5, 7, 20, 0.82) !important;
        border: 1.5px solid rgba(0, 240, 255, 0.45) !important;
    }

    .prompt-label {
        font-size: 0.62rem;
        margin-bottom: 2px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .next-word-preview {
        font-size: 0.58rem !important;
        padding: 1px 5px !important;
        max-width: 110px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .word-display {
        font-size: clamp(1.15rem, 5vw, 1.45rem);
        min-height: 30px;
        letter-spacing: 1px;
    }

    .char-space {
        padding: 1px 4px;
        font-size: 0.7rem;
        margin: 0 2px;
    }

    .super-ready-banner {
        font-size: 0.65rem;
        padding: 3px 8px;
        letter-spacing: 0.5px;
    }

    .battle-skills-dock {
        display: flex;
        gap: 4px;
        margin: 2px auto 3px;
        width: 100%;
        max-width: 100%;
    }

    .skill-btn {
        flex: 1;
        padding: 5px 4px;
        gap: 2px;
        border-radius: 6px;
        min-height: 36px;
        touch-action: manipulation;
    }

    .skill-icon {
        font-size: 0.95rem;
    }

    .skill-name {
        font-size: 0.58rem;
        font-weight: 800;
    }

    .skill-key {
        display: none;
    }

    /* Mobile soft keyboard toggle button (Visible on phones when keyboard is closed) */
    .mobile-keyboard-btn {
        display: flex !important;
        width: 100%;
        margin-top: 4px;
        padding: 10px 14px;
        font-size: 0.82rem;
        border-radius: 8px;
        touch-action: manipulation;
    }

    /* -- VIRTUAL KEYBOARD OPEN STATE ------------------------- */
    body.keyboard-open .canvas-container {
        max-height: clamp(100px, 20vh, 140px) !important;
        min-height: 100px !important;
    }

    body.keyboard-open .hud {
        grid-template-columns: 1fr 36px 1fr !important;
        gap: 4px !important;
        padding: 3px 6px !important;
    }

    body.keyboard-open .player-info {
        display: none !important;
    }

    body.keyboard-open .super-bar-outer {
        display: none !important;
    }

    body.keyboard-open .stage-badge,
    body.keyboard-open .match-time,
    body.keyboard-open .combo-badge {
        display: none !important;
    }

    body.keyboard-open .vs-circle {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.55rem !important;
    }

    body.keyboard-open .hp-bar-outer {
        height: 18px !important;
        margin: 0 !important;
    }

    body.keyboard-open .hp-text {
        font-size: 0.62rem !important;
    }

    body.keyboard-open .battle-skills-dock {
        display: none !important;
    }

    body.keyboard-open .mobile-keyboard-btn {
        display: none !important;
    }

    body.keyboard-open .super-ready-banner {
        display: none !important;
    }

    /* Fixed Combat Lock: Zero jumping, absolute bottom anchor on mobile keyboard */
    body.keyboard-open .arena-wrapper {
        overflow: hidden !important;
        justify-content: flex-start !important;
    }

    body.keyboard-open .typing-box-container {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 3px !important;
    }

    body.keyboard-open .typing-word-card {
        padding: 4px 8px !important;
    }

    body.keyboard-open .word-display {
        font-size: 1.2rem !important;
        min-height: 26px !important;
    }

    /* -- UNIVERSAL MODALS ON MOBILE (NEVER CUT OFF) --------- */
    .modal-overlay {
        padding: 8px;
    }

    .modal-card {
        padding: 16px 12px 14px;
        max-width: 100%;
        width: 100%;
        max-height: calc(100dvh - 16px);
        border-radius: 14px;
    }

    .modal-card h1,
    .modal-card h2 {
        font-size: 1.15rem;
        padding-right: 32px;
    }

    .btn-close-modal {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .mode-grid,
    .choice-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .campaign-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: 58dvh;
        margin: 14px 0;
    }

    .level-card {
        padding: 10px 8px;
        border-radius: 12px;
    }

    .level-num {
        font-size: 0.68rem;
    }

    .level-card h4 {
        font-size: 0.78rem;
    }

    .level-wpm {
        font-size: 0.68rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-box {
        padding: 8px;
    }

    .stat-val {
        font-size: 1.15rem;
    }

    .upi-qr-wrapper {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }

    .upi-qr-img {
        width: 140px;
        height: 140px;
    }

    .modal-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .modal-actions .btn {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 0.9rem !important;
        justify-content: center !important;
    }
}

/* -- 3. ULTRA COMPACT PHONES (<= 400px e.g. iPhone SE) --------------------- */
@media (max-width: 400px) {
    .app-container {
        padding: 4px 6px;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .player-header-badge {
        display: none;
    }

    .hud {
        grid-template-columns: 1fr 50px 1fr;
    }

    .vs-circle {
        width: 22px;
        height: 22px;
        font-size: 0.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .campaign-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}

.match-time {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: #a0aec0;
}

.combo-badge {
    background: var(--neon-magenta);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 0 12px var(--neon-magenta);
    animation: pulse 0.5s infinite alternate;
}

/* v28: Fire combo badge (10+ combo) */
.combo-badge.combo-on-fire {
    background: linear-gradient(90deg, #ff4400, #ff8800, #ffe600);
    box-shadow: 0 0 20px #ff6600, 0 0 40px #ff4400;
    animation: firePulse 0.3s infinite alternate;
    color: #fff;
}

@keyframes firePulse {
    0%   { transform: scale(1.0); box-shadow: 0 0 16px #ff4400; }
    100% { transform: scale(1.12); box-shadow: 0 0 32px #ff8800, 0 0 64px #ff4400; }
}

/* v28: Rage mode — pulsing red glow on typing card when HP < 30% */
.typing-word-card.rage-mode-active {
    border-color: #ff2222 !important;
    box-shadow: 0 0 20px rgba(255, 30, 30, 0.6), 0 0 40px rgba(255, 30, 30, 0.3);
    animation: ragePulse 0.6s infinite alternate;
}

@keyframes ragePulse {
    0%   { box-shadow: 0 0 12px rgba(255, 30, 30, 0.5); }
    100% { box-shadow: 0 0 28px rgba(255, 30, 30, 0.9), 0 0 56px rgba(255, 30, 30, 0.4); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* CANVAS CONTAINER */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    aspect-ratio: 16 / 8;
    max-height: min(480px, calc(100dvh - 240px));
    min-height: 240px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 240, 255, 0.08);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* TYPING PROMPT BOX & COMBAT DECK */
.typing-box-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 8px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.super-ready-banner {
    background: linear-gradient(90deg, #ff0055, #ffe600, #ff0055);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 0 20px var(--neon-yellow);
    animation: pulse 0.4s infinite alternate;
}

.typing-word-card {
    background: rgba(10, 15, 35, 0.92);
    border: 2px solid var(--neon-cyan);
    border-radius: 14px;
    padding: 12px 24px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
    backdrop-filter: blur(12px);
}

.prompt-label {
    font-size: 0.7rem;
    font-family: var(--font-heading);
    color: #a0aec0;
    letter-spacing: 1px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.focus-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 8px #00ff88;
    animation: focusDotBlink 1.2s infinite alternate;
}

/* Micro-guidance typo hint */
.typo-guidance-hint {
    background: rgba(255, 0, 85, 0.25);
    border: 1px solid #ff0055;
    color: #ff4d88;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    animation: shake 0.25s ease;
}

/* Super attack mode card glow */
.typing-word-card.super-mode-active {
    border-color: #ffe600 !important;
    background: rgba(20, 16, 5, 0.95) !important;
    box-shadow: 0 0 35px rgba(255, 230, 0, 0.7), inset 0 0 20px rgba(255, 230, 0, 0.2) !important;
    animation: superCardPulse 0.4s infinite alternate !important;
}

@keyframes superCardPulse {
    0% { transform: scale(1.0); box-shadow: 0 0 25px rgba(255, 230, 0, 0.5); }
    100% { transform: scale(1.02); box-shadow: 0 0 45px rgba(255, 230, 0, 0.9), 0 0 70px rgba(255, 0, 85, 0.4); }
}

.typing-word-card.not-focused .focus-dot {
    background: #ffaa00;
    box-shadow: 0 0 8px #ffaa00;
}

.typing-word-card.not-focused {
    border-color: rgba(255, 170, 0, 0.6) !important;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.25) !important;
}

@keyframes focusDotBlink {
    0% { opacity: 0.4; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.15); }
}

.word-display {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-height: 40px;
}

.placeholder-text {
    font-size: 1.1rem;
    color: #718096;
}

/* TYPING CHAR FEEDBACK */
.char-correct {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.char-current {
    background: rgba(255, 230, 0, 0.3);
    color: var(--neon-yellow);
    border-bottom: 3px solid var(--neon-yellow);
    animation: charBlink 0.6s infinite alternate;
}

.char-untyped {
    color: rgba(255, 255, 255, 0.35);
}

.char-error {
    color: #ff0055;
    text-shadow: 0 0 10px #ff0055;
    animation: shake 0.2s ease;
}

/* VISUAL SPACE INDICATOR */
.char-space {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px dashed rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
}

.char-space::after {
    content: "␣ SPACE";
    font-size: 0.75rem;
    font-family: var(--font-heading);
}

.char-space.char-correct {
    background: rgba(0, 240, 255, 0.2);
    border: 1.5px solid var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.char-space.char-current {
    background: rgba(255, 230, 0, 0.35);
    border: 2px solid var(--neon-yellow);
    color: var(--neon-yellow);
    box-shadow: 0 0 15px var(--neon-yellow);
    animation: charBlink 0.4s infinite alternate;
}

@keyframes charBlink {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    pointer-events: auto;
    border: none;
    outline: none;
    background: transparent;
    z-index: 1;
}

.install-pwa-btn {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 240, 255, 0.2)) !important;
    border: 1px solid #00ff88 !important;
    color: #00ff88 !important;
    font-weight: 800 !important;
    animation: pulse 2s infinite alternate;
}

/* MODALS & OVERLAYS */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 16, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-card {
    position: relative;
    background: var(--dark-card);
    border: 1.5px solid var(--neon-cyan);
    border-radius: 18px;
    padding: 24px 20px 20px 20px;
    max-width: 720px;
    width: 100%;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.25);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin: auto;
}

.modal-card h1, .modal-card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 6px;
    padding-right: 36px; /* Reserve space so title never collides with close button! */
    word-break: break-word;
}

.btn-close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: rgba(255, 0, 85, 0.15);
    border: 1.5px solid #ff0055;
    color: #ff0055;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-close-modal:hover {
    background: #ff0055;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
    transform: scale(1.1);
}

.game-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.glow-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
}

.subtitle {
    color: #cbd5e1;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mode-card:hover {
    border-color: var(--neon-cyan);
    transform: translateY(-4px);
    background: rgba(0, 240, 255, 0.06);
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.2);
}

.mode-stickman-card {
    border-color: rgba(255, 230, 0, 0.3);
    background: rgba(255, 230, 0, 0.04);
}

.mode-stickman-card:hover {
    border-color: #ffe600;
    background: rgba(255, 230, 0, 0.1);
    box-shadow: 0 10px 25px rgba(255, 230, 0, 0.3);
}

.mode-icon {
    font-size: 2.5rem;
}

.mode-card h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.mode-card p {
    font-size: 0.8rem;
    color: #718096;
}

/* P2P MODAL SPECIFICS */
.p2p-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-heading);
}

.tab-btn.active {
    background: var(--neon-cyan);
    color: #000;
    font-weight: 800;
}

.room-code-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: #000;
    padding: 16px;
    border-radius: 12px;
    border: 2px dashed var(--neon-cyan);
    margin: 15px 0;

}

.room-code-display span {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--neon-yellow);
    letter-spacing: 4px;
}

.code-input {
    width: 100%;
    padding: 14px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 4px;
    background: #000;
    border: 2px solid var(--neon-magenta);
    border-radius: 10px;
    color: #fff;
    text-transform: uppercase;
}

.p2p-status {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #a0aec0;
}

/* CONTENT CHOICE & CUSTOM SCRIPT MODALS */
.choice-card {
    max-width: 750px;
    text-align: center;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.choice-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.choice-box:hover {
    border-color: var(--neon-cyan);
    transform: translateY(-4px);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.2);
}

.choice-icon {
    font-size: 2.8rem;
}

.choice-box h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
}

.choice-box p {
    font-size: 0.8rem;
    color: #a0aec0;
}

.script-card {
    max-width: 750px;
    text-align: center;
}

.script-textarea {
    width: 100%;
    height: 180px;
    background: #000;
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    line-height: 1.5;
    resize: vertical;
    margin: 20px 0;
    outline: none;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.script-textarea:focus {
    border-color: var(--neon-yellow);
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.4);
}

.script-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* CAMPAIGN LEVEL SELECT MODAL */
.campaign-card {
    max-width: 850px;
    text-align: center;
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 20px 0;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
}

.campaign-grid::-webkit-scrollbar {
    width: 6px;
}

.campaign-grid::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
}

.level-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.25 ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.level-card:hover:not(.locked) {
    border-color: var(--neon-cyan);
    transform: translateY(-4px);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.2);
}



/* CYBERPUNK LOADING SPLASH SCREEN */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #070913;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
}

.loading-bar-outer {
    width: 320px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    overflow: hidden;
}

.loading-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    box-shadow: 0 0 15px var(--neon-cyan);
    transition: width 0.3s ease;
}

.loading-text {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: #a0aec0;
    letter-spacing: 2px;
}

/* TOAST NOTIFICATIONS SYSTEM */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(15, 20, 42, 0.95);
    border: 1.5px solid var(--neon-cyan);
    border-radius: 10px;
    padding: 12px 20px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease forwards;
    pointer-events: auto;
}

.toast.toast-success {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.toast.toast-error {
    border-color: #ff0055;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.toast.toast-info {
    border-color: var(--neon-yellow);
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.4);
}

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

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

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

.level-num {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: #718096;
}

.level-avatar {
    font-size: 2.4rem;
    margin: 4px 0;
}

.level-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.level-wpm {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    font-weight: 700;
}

.level-status-badge {
    font-size: 0.65rem;
    font-family: var(--font-heading);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 900;
    margin-top: 4px;
}

.status-cleared { background: #00ff88; color: #000; }
.status-unlocked { background: var(--neon-cyan); color: #000; }
.status-locked { background: rgba(255, 255, 255, 0.1); color: #a0aec0; }

/* v28: Personal best WPM badge on cleared campaign levels */
.level-best-wpm {
    display: block;
    font-size: 0.6rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: #ffe600;
    margin-top: 3px;
    letter-spacing: 0.5px;
}

.bot-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-card:hover {
    border-color: var(--neon-cyan);
    transform: scale(1.03);
}

.bot-avatar { font-size: 2rem; margin-bottom: 6px; }
.tag { font-size: 0.65rem; font-family: var(--font-heading); padding: 2px 6px; border-radius: 4px; font-weight: 800; display: inline-block; margin: 4px 0; }
.tag.easy { background: #00ff88; color: #000; }
.tag.medium { background: #ffaa00; color: #000; }
.tag.hard { background: #ff0055; color: #fff; }

/* STATS MODAL */
.gameOver-card { text-align: center; }
.winner-title { font-family: var(--font-heading); font-size: 2rem; color: var(--neon-yellow); margin-bottom: 4px; }
.winner-subtitle { color: #a0aec0; margin-bottom: 14px; }

.winner-coins-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 230, 0, 0.15);
    border: 1.5px solid var(--neon-yellow);
    border-radius: 20px;
    padding: 6px 18px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(255, 230, 0, 0.3);
    animation: pulse 1s infinite alternate;
}
.winner-coins-icon { font-size: 1.3rem; }
.winner-coins-val {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 900;
    color: #ffe600;
    letter-spacing: 1px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 8px;
}

.stat-label { font-size: 0.65rem; font-family: var(--font-heading); color: #718096; }
.stat-val { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 900; color: var(--neon-cyan); margin-top: 4px; }
.unit { font-size: 0.75rem; color: #a0aec0; }
.rank-badge { font-size: 0.95rem; color: var(--neon-yellow); }

.modal-actions { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

#btnNextLevel {
    background: linear-gradient(135deg, var(--neon-cyan), #00ff88) !important;
    color: #000 !important;
    font-weight: 900 !important;
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.6) !important;
    transform: scale(1.05);
    animation: pulse 1s infinite alternate;
}

.btn-close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #718096;
    font-size: 1rem;
    cursor: pointer;
}

.hidden { display: none !important; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.full-width { width: 100%; }

/* SPINNER */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--neon-cyan);
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* ================================================================
   P2P REMATCH LOBBY — Free Fire Style Ready-Up System
   ================================================================ */

.p2p-lobby-card {
    max-width: 420px;
    width: 94vw;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 20px 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) transparent;
}

/* Result Banner */
.p2p-lobby-banner {
    text-align: center;
    padding: 14px 10px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,240,255,0.07), rgba(255,230,0,0.05));
    border: 1px solid rgba(0,240,255,0.2);
    margin-bottom: 14px;
}

.p2p-result-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 4px;
    animation: bounceIn 0.5s ease;
}

.p2p-lobby-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 2px;
    margin: 2px 0;
}

.p2p-lobby-subtitle {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0;
}

/* Stats Pills */
.p2p-stats-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.p2p-stat-pill {
    background: rgba(0,240,255,0.08);
    border: 1px solid rgba(0,240,255,0.2);
    border-radius: 50px;
    padding: 6px 16px;
    text-align: center;
    min-width: 80px;
}

.p2p-stat-label {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 1px;
    opacity: 0.6;
    text-transform: uppercase;
}

.p2p-stat-val {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--neon-cyan);
    font-weight: 700;
}

/* Lobby divider */
.lobby-divider {
    border: none;
    border-top: 1px solid rgba(0,240,255,0.12);
    margin: 12px 0;
}

/* Section */
.lobby-section {
    margin-bottom: 8px;
}

.lobby-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Custom text textarea */
.p2p-lobby-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 130px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(0,240,255,0.25);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 10px 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 8px;
    user-select: text;
    -webkit-user-select: text;
}

.p2p-lobby-textarea:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0,240,255,0.15);
}

.p2p-lobby-textarea::placeholder {
    opacity: 0.35;
    font-size: 0.78rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.78rem;
}

.p2p-share-status {
    font-size: 0.75rem;
    margin-top: 6px;
    min-height: 18px;
    color: var(--neon-cyan);
}

/* Ready Players Row */
.ready-players-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ready-player-card {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.ready-player-card.not-ready {
    border-color: rgba(255,0,85,0.35);
    background: rgba(255,0,85,0.04);
}

.ready-player-card.is-ready {
    border-color: var(--neon-cyan);
    background: rgba(0,240,255,0.08);
    box-shadow: 0 0 18px rgba(0,240,255,0.2);
    animation: readyPulse 1.5s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(0,240,255,0.2); }
    50%       { box-shadow: 0 0 28px rgba(0,240,255,0.5); }
}

.ready-player-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 4px;
}

.ready-player-name {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 6px;
}

.ready-player-status {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ff0055;
    transition: color 0.3s;
}

.ready-player-card.is-ready .ready-player-status {
    color: var(--neon-cyan);
}

.ready-vs-badge {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 900;
    color: var(--neon-yellow);
    flex-shrink: 0;
    text-shadow: 0 0 12px rgba(255,230,0,0.6);
}

/* Countdown */
.p2p-countdown {
    text-align: center;
    margin: 8px 0;
}

#p2pCountdownNum {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: var(--neon-yellow);
    text-shadow: 0 0 30px rgba(255,230,0,0.8);
    animation: countPulse 1s ease-in-out infinite;
}

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

/* Big Ready Button */
.p2p-ready-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,240,255,0.15), rgba(0,240,255,0.05));
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0,240,255,0.5);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-heading);
    animation: readyBtnPulse 2s ease-in-out infinite;
}

@keyframes readyBtnPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0,240,255,0.3); }
    50%       { box-shadow: 0 0 25px rgba(0,240,255,0.6), 0 0 50px rgba(0,240,255,0.2); }
}

.p2p-ready-btn:hover {
    background: linear-gradient(135deg, rgba(0,240,255,0.3), rgba(0,240,255,0.1));
    transform: translateY(-2px);
}

.p2p-ready-btn.is-ready-state {
    background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,240,255,0.08));
    border-color: #00ff88;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0,255,136,0.5);
    animation: none;
    box-shadow: 0 0 20px rgba(0,255,136,0.3);
}

@keyframes bounceIn {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile optimization for lobby */
@media (max-width: 480px) {
    .p2p-lobby-card { padding: 14px 12px; }
    .p2p-lobby-title { font-size: 1.1rem; }
    .ready-player-card { padding: 10px 6px; }
    .p2p-ready-btn { padding: 14px 12px; font-size: 0.85rem; }
    .p2p-stats-row { gap: 5px; }
    .p2p-stat-pill { min-width: 64px; padding: 5px 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v29 — COIN SYSTEM & CHARACTER SHOP
   ═══════════════════════════════════════════════════════════════════════════ */

.coin-btn {
    background: linear-gradient(135deg, rgba(255, 230, 0, 0.15), rgba(255, 180, 0, 0.08));
    border: 1px solid rgba(255, 230, 0, 0.5) !important;
    color: #ffe600 !important;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.coin-btn:hover {
    background: linear-gradient(135deg, rgba(255, 230, 0, 0.3), rgba(255, 180, 0, 0.2)) !important;
    box-shadow: 0 0 20px rgba(255, 230, 0, 0.5);
    transform: scale(1.05);
}

.coin-shop-tag {
    font-size: 0.6rem;
    font-weight: 900;
    color: #000;
    background: #ffe600;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ── Gold button style ─────────────────────────────────────────────────── */
.btn-gold {
    background: linear-gradient(135deg, #ffe600, #ffb300);
    color: #000;
    font-weight: 900;
    border: none;
    box-shadow: 0 0 16px rgba(255, 230, 0, 0.4);
    transition: all 0.2s ease;
}
.btn-gold:hover {
    background: linear-gradient(135deg, #ffef33, #ffc933);
    box-shadow: 0 0 28px rgba(255, 230, 0, 0.7);
}

/* ── Shop modal card ───────────────────────────────────────────────────── */
.shop-card {
    max-width: 760px !important;
    width: 96vw !important;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 24px !important;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.shop-header h2 { margin: 0; }

.shop-coin-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 230, 0, 0.12);
    border: 1px solid rgba(255, 230, 0, 0.4);
    border-radius: 12px;
    padding: 8px 16px;
}
.shop-coin-icon { font-size: 1.4rem; }
.shop-coin-num  { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 900; color: #ffe600; }
.shop-coin-label{ font-size: 0.75rem; color: #a0aec0; font-weight: 600; }

/* ── Shop tabs ─────────────────────────────────────────────────────────── */
.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
}
.shop-tab {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: #a0aec0;
    padding: 8px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.shop-tab.active, .shop-tab:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ── Upgrade grid ──────────────────────────────────────────────────────── */
.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 12px;
}

.upgrade-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.upgrade-card.can-afford {
    border-color: rgba(255, 230, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 230, 0, 0.1);
}
.upgrade-card.maxed {
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.05);
}

.upg-icon { font-size: 2rem; flex-shrink: 0; }

.upg-info { flex: 1; min-width: 0; }
.upg-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}
.upg-name { font-family: var(--font-heading); font-weight: 800; font-size: 0.95rem; }
.upg-level-badge {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 2px 6px;
    border-radius: 6px;
}
.upg-level-badge.max {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.15);
    border-color: #00ff88;
}
.upg-desc { font-size: 0.72rem; color: #a0aec0; margin-bottom: 6px; line-height: 1.4; }

.upg-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.upg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    box-shadow: 0 0 8px var(--neon-cyan);
    transition: width 0.3s ease;
}
.upg-progress-fill.max {
    background: linear-gradient(90deg, #00ff88, #ffe600);
    box-shadow: 0 0 8px #00ff88;
}

.upg-dots { display: flex; gap: 5px; margin-bottom: 4px; }
.upg-dot  {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    transition: background 0.2s;
}
.upg-dot.filled { background: var(--neon-cyan); border-color: var(--neon-cyan); box-shadow: 0 0 6px var(--neon-cyan); }

.upg-level { font-size: 0.68rem; color: #718096; font-family: var(--font-heading); font-weight: 700; }

.upg-action { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.upg-cost   { font-family: var(--font-heading); font-size: 0.8rem; font-weight: 800; color: #ffe600; }
.upg-btn    { white-space: nowrap; min-width: 90px; }
.upg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.upg-max-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 900;
    color: #00ff88;
    background: rgba(0,255,136,0.15);
    border: 1px solid #00ff88;
    border-radius: 8px;
    padding: 4px 10px;
}

/* ── Coin packages grid ────────────────────────────────────────────────── */
.coin-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.coin-pkg-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.coin-pkg-card:hover {
    border-color: rgba(255, 0, 85, 0.5);
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.15);
}
.pkg-icon   { font-size: 2.2rem; }
.pkg-label  { font-family: var(--font-heading); font-weight: 800; font-size: 0.85rem; }
.pkg-coins  { font-family: var(--font-heading); font-size: 1rem; color: #ffe600; font-weight: 900; }
.pkg-bonus  { font-size: 0.65rem; font-weight: 800; color: #00ff88; font-family: var(--font-heading); }
.pkg-price  { font-size: 1.1rem; font-weight: 900; color: var(--neon-cyan); font-family: var(--font-heading); }

/* ── Shop info text ────────────────────────────────────────────────────── */
.shop-info-text    { font-size: 0.82rem; color: #a0aec0; margin-bottom: 14px; line-height: 1.5; }
.shop-payment-note { font-size: 0.72rem; color: #4a5568; margin-top: 10px; text-align: center; }

/* ── Shop button in main menu mode grid ───────────────────────────────── */
.mode-shop-card { border-color: rgba(255, 230, 0, 0.3) !important; }
.mode-shop-card:hover { border-color: rgba(255, 230, 0, 0.7) !important; box-shadow: 0 0 24px rgba(255,230,0,0.15) !important; }

/* ── Mobile shop responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .upgrade-grid        { grid-template-columns: 1fr; }
    .coin-packages-grid  { grid-template-columns: repeat(2, 1fr); }
    .shop-card           { padding: 14px !important; }
    .shop-header         { gap: 8px; }
    .shop-coin-num       { font-size: 1.1rem; }
    .upgrade-card        { padding: 10px; gap: 10px; }
    .upg-icon            { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v30 — HOME DASHBOARD SCREEN & HERO PLAY SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

/* ── NAV DASHBOARD BUTTON ───────────────────────────────────────────────── */
.nav-dashboard-btn {
    background: rgba(0, 240, 255, 0.12) !important;
    border: 1px solid var(--neon-cyan) !important;
    color: var(--neon-cyan) !important;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.nav-dashboard-btn:hover {
    background: rgba(0, 240, 255, 0.25) !important;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
    transform: scale(1.05);
}

/* ── DASHBOARD HERO BANNER ──────────────────────────────────────────────── */
.dashboard-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(7, 9, 19, 0.98));
    border: 1.5px solid rgba(0, 240, 255, 0.35);
    border-radius: 18px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.12);
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
    animation: pulse 4s infinite alternate;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.5);
    border-radius: 20px;
    padding: 5px 14px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: pulse 1s infinite alternate;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}
.hero-subtitle {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    color: #a0aec0;
    max-width: 720px;
    margin: 0 auto 24px;
    line-height: 1.5;
}

/* ── HERO PLAY BUTTON ───────────────────────────────────────────────────── */
.hero-action-box {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}
.btn-hero-play {
    position: relative;
    background: linear-gradient(135deg, #00f0ff 0%, #00a8ff 50%, #9d00ff 100%);
    border: none;
    border-radius: 16px;
    padding: 16px 36px;
    color: #000;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6), 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: heroPlayPulse 2s infinite;
}
.btn-hero-play:hover {
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 0 45px rgba(0, 240, 255, 0.9), 0 12px 35px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #33f3ff 0%, #00c3ff 50%, #b833ff 100%);
}
.btn-hero-play:active {
    transform: scale(0.98);
}

@keyframes heroPlayPulse {
    0%   { box-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(157, 0, 255, 0.2); }
    50%  { box-shadow: 0 0 35px rgba(0, 240, 255, 0.85), 0 0 60px rgba(157, 0, 255, 0.4); }
    100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(157, 0, 255, 0.2); }
}

.play-btn-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}
.play-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.play-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
.play-main-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #000;
    line-height: 1.1;
}
.play-sub-text {
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.75);
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
}
.play-arrow {
    font-size: 1.4rem;
    font-weight: 900;
    color: #000;
    margin-left: 8px;
    transition: transform 0.2s;
}
.btn-hero-play:hover .play-arrow {
    transform: translateX(4px);
}

/* ── PROMINENT PWA INSTALL BANNER (< 0.5 MB & OFFLINE PLAY) ─────────────── */
.dash-install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 255, 136, 0.08));
    border: 1.5px solid rgba(0, 240, 255, 0.4);
    border-radius: 16px;
    padding: 14px 22px;
    margin-top: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
}

.dash-install-banner:hover {
    transform: translateY(-2px);
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 255, 136, 0.15));
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.3);
}

.install-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.install-badge-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px #00f0ff);
}

.install-badge-texts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.install-badge-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    color: #00f0ff;
    letter-spacing: 1px;
}

.install-badge-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 600px) {
    .dash-install-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 12px 14px;
    }
    .install-banner-left {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* ── DASHBOARD GRID ─────────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.dash-card {
    background: rgba(15, 20, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.22s ease;
}
.dash-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.15);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dash-card-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: #718096;
    letter-spacing: 1px;
}
.dash-link-btn {
    background: none;
    border: none;
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.dash-link-btn:hover {
    text-decoration: underline;
}

.dash-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 900;
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 2px 8px;
    border-radius: 6px;
}
.dash-card-icon {
    font-size: 2.2rem;
}
.dash-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
}
.dash-card p {
    font-size: 0.8rem;
    color: #a0aec0;
    line-height: 1.4;
    flex: 1;
}
.dash-card-action {
    margin-top: 6px;
}

/* Specific Card Accents */
.dash-campaign-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.25);
}
.dash-shop-card {
    border-color: rgba(255, 230, 0, 0.3);
}
.dash-shop-card:hover {
    border-color: var(--neon-yellow);
    box-shadow: 0 8px 25px rgba(255, 230, 0, 0.25);
}
.dash-shop-card .dash-card-badge {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    background: rgba(255, 230, 0, 0.12);
}
.dash-stickman-card {
    border-color: rgba(255, 230, 0, 0.25);
}
.dash-stickman-card:hover {
    border-color: var(--neon-yellow);
    box-shadow: 0 8px 25px rgba(255, 230, 0, 0.25);
}
.dash-stickman-card .dash-card-badge {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    background: rgba(255, 230, 0, 0.12);
}
.dash-p2p-card {
    border-color: rgba(255, 0, 85, 0.25);
}
.dash-p2p-card:hover {
    border-color: var(--neon-magenta);
    box-shadow: 0 8px 25px rgba(255, 0, 85, 0.25);
}
.dash-p2p-card .dash-card-badge {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
    background: rgba(255, 0, 85, 0.12);
}
.dash-arena-card {
    border-color: rgba(0, 240, 255, 0.25);
    cursor: default;
}
.dash-arena-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.25);
}
.dash-arena-card .dash-card-badge {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
}

/* ── FIGHTER PROFILE CARD BODY ──────────────────────────────────────────── */
.dash-player-card {
    cursor: default;
}
.dash-player-body {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dash-avatar-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.dash-avatar {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: rgba(0, 240, 255, 0.1);
    border: 1.5px solid var(--neon-cyan);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}
.dash-skin-tag {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--neon-cyan);
}
.dash-player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dash-player-info h3 {
    font-size: 1.1rem;
    color: #fff;
}
.dash-meta-line {
    font-size: 0.75rem;
    color: var(--neon-cyan);
    font-weight: 700;
    font-family: var(--font-heading);
}
.dash-stats-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.dash-stat-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.pill-label {
    font-size: 0.6rem;
    color: #718096;
    font-family: var(--font-heading);
    font-weight: 800;
}
.pill-val {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 900;
    color: #ffe600;
}

/* Interactive 2-Way Skin Switcher Pills */
.dash-skin-switcher-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.dash-skin-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #a0aec0;
    transition: all 0.2s ease;
}
.dash-skin-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}
.dash-skin-pill.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}
#btnSkinSelectStickman.active {
    background: rgba(255, 230, 0, 0.15);
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    box-shadow: 0 0 12px rgba(255, 230, 0, 0.3);
}

/* ── DASHBOARD FOOTER FEATURE BAR ───────────────────────────────────────── */
.dashboard-footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    background: rgba(15, 20, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
}
.dash-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #a0aec0;
}
.feat-icon {
    font-size: 0.95rem;
}

/* ── RESPONSIVE MOBILE DASHBOARD ────────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-hero {
        padding: 22px 14px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }
    .btn-hero-play {
        padding: 12px 20px;
        width: 100%;
    }
    .play-main-text {
        font-size: 1.2rem;
    }
    .play-sub-text {
        font-size: 0.65rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-footer-bar {
        gap: 8px;
        padding: 8px 10px;
    }
    .dash-feature {
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v31 — PAYMENT GATEWAY & DIGITAL RECEIPT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── PAYMENT CARD MODAL ─────────────────────────────────────────────────── */
.payment-card {
    max-width: 620px !important;
    width: 95vw !important;
    padding: 24px !important;
    max-height: 90dvh;
    overflow-y: auto;
    border: 1.5px solid rgba(0, 240, 255, 0.4) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.2) !important;
}

.payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.payment-modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}
.pay-secure-tag {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid rgba(0, 255, 136, 0.4);
    padding: 3px 8px;
    border-radius: 6px;
}

/* ── PACKAGE SUMMARY BOX ────────────────────────────────────────────────── */
.payment-summary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    gap: 12px;
}
.summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.summary-icon {
    font-size: 2.2rem;
}
.summary-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    color: #fff;
}
.summary-coins {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffe600;
}
.summary-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.summary-price-label {
    font-size: 0.65rem;
    font-family: var(--font-heading);
    color: #718096;
    font-weight: 800;
}
.summary-price-val {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* ── PAYMENT TABS ───────────────────────────────────────────────────────── */
.payment-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    overflow-x: auto;
}
.pay-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #a0aec0;
    padding: 8px 14px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.pay-tab-btn.active, .pay-tab-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ── TAB 1: UPI & QR CODE CONTENT ───────────────────────────────────────── */
.pay-guide-text {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-bottom: 12px;
    line-height: 1.4;
}
.upi-qr-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
}
.upi-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
.upi-qr-img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    border-radius: 4px;
}
.qr-scan-hint {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    font-weight: 900;
    color: #000;
    margin-top: 6px;
    text-align: center;
}
.upi-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.upi-id-copy-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
}
.upi-id-label {
    font-size: 0.7rem;
    color: #718096;
    font-weight: 700;
}
.upi-id-val {
    font-family: monospace;
    font-size: 0.82rem;
    color: #ffe600;
    font-weight: 700;
}
.utr-confirmation-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.utr-confirmation-box label {
    font-size: 0.72rem;
    color: #a0aec0;
    font-family: var(--font-heading);
}
.utr-input-group {
    display: flex;
    gap: 6px;
}
.utr-input {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
}

/* ── TAB 2: RAZORPAY SECTION ────────────────────────────────────────────── */
.rzp-info-box {
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rzp-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}
.rzp-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: #cbd5e0;
    margin-top: 4px;
}

/* ── TAB 3: SANDBOX SECTION ─────────────────────────────────────────────── */
.sandbox-info-box {
    background: rgba(255, 230, 0, 0.08);
    border: 1px solid rgba(255, 230, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sandbox-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 900;
    color: #ffe600;
    letter-spacing: 1px;
}

/* ── DIGITAL RECEIPT MODAL ──────────────────────────────────────────────── */
.receipt-card {
    max-width: 480px !important;
    text-align: center;
    border: 1.5px solid rgba(0, 255, 136, 0.5) !important;
    box-shadow: 0 0 35px rgba(0, 255, 136, 0.25) !important;
    padding: 28px !important;
}
.receipt-success-icon {
    font-size: 3.5rem;
    animation: pulse 1s infinite alternate;
}
.receipt-success-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 900;
    color: #00ff88;
    margin-bottom: 6px;
}
.receipt-coins-badge {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    color: #ffe600;
    background: rgba(255, 230, 0, 0.12);
    border: 1px solid rgba(255, 230, 0, 0.4);
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 18px;
}
.receipt-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 20px;
    text-align: left;
}
.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}
.receipt-label {
    color: #718096;
    font-weight: 700;
}
.receipt-val {
    color: #fff;
    font-weight: 800;
}
.code-font {
    font-family: monospace;
    color: var(--neon-cyan);
}
.gold-text {
    color: #ffe600;
    font-size: 1rem;
    font-family: var(--font-heading);
}
.receipt-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── RESPONSIVE MOBILE PAYMENT MODAL ────────────────────────────────────── */
@media (max-width: 600px) {
    .upi-qr-wrapper {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .upi-qr-box {
        width: 100%;
        max-width: 220px;
    }
    .payment-summary-box {
        flex-direction: column;
        align-items: flex-start;
    }
    .summary-right {
        align-items: flex-start;
        width: 100%;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 8px;
    }
    .payment-tabs {
        flex-wrap: nowrap;
    }
    .pay-tab-btn {
        padding: 6px 10px;
        font-size: 0.72rem;
    }
}

/* ── iOS PWA INSTALL GUIDE MODAL ────────────────────────────────────────── */
.ios-install-card {
    max-width: 480px !important;
    padding: 28px 22px !important;
    text-align: center;
    border: 1.5px solid rgba(0, 240, 255, 0.5) !important;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.25) !important;
}

.ios-modal-header {
    margin-bottom: 18px;
}

.ios-app-icon {
    font-size: 2.8rem;
    display: inline-block;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 12px #00f0ff);
}

.ios-modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #00f0ff;
    margin-bottom: 6px;
}

.ios-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 22px;
}

.ios-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
}

.ios-step-num {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #00f0ff, #0088ff);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-step-desc {
    font-size: 0.85rem;
    color: #e0e6ed;
    line-height: 1.4;
}

.ios-icon-tag {
    display: inline-block;
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid #00f0ff;
    color: #00f0ff;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIVE IN-GAME CHAT & EMOJI REACTION SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── QUICK EMOJI REACTION DOCK ─────────────────────────────────────────── */
.emoji-reaction-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(10, 14, 28, 0.85);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(0, 240, 255, 0.35);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 240, 255, 0.2);
    margin: 8px auto 0 auto;
    width: fit-content;
    max-width: 95%;
    z-index: 20;
    transition: all 0.2s ease;
}

.emoji-reaction-dock:hover {
    border-color: #00f0ff;
    box-shadow: 0 4px 25px rgba(0, 240, 255, 0.35);
}

.emoji-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    touch-action: manipulation;
}

.emoji-btn:hover {
    transform: scale(1.3) translateY(-3px);
    background: rgba(0, 240, 255, 0.25);
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
}

.emoji-btn:active {
    transform: scale(0.92);
}

.btn-chat-toggle {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(157, 0, 255, 0.25));
    border-color: #00f0ff;
    color: #00f0ff;
    font-weight: bold;
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
}

.btn-chat-toggle:hover {
    background: linear-gradient(135deg, #00f0ff, #9d00ff);
    color: #000;
}

/* ── EXPANDABLE IN-GAME CHAT DRAWER ────────────────────────────────────── */
.in-game-chat-drawer {
    position: absolute;
    bottom: 70px;
    right: 15px;
    width: 320px;
    max-width: calc(100vw - 30px);
    background: rgba(7, 9, 19, 0.95);
    backdrop-filter: blur(14px);
    border: 1.5px solid #00f0ff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.3);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: chatSlideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.in-game-chat-drawer.hidden {
    display: none !important;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 8px;
}

.chat-drawer-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    color: #00f0ff;
    letter-spacing: 1px;
}

.btn-close-chat {
    background: transparent;
    border: none;
    color: #ff0055;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-close-chat:hover {
    background: rgba(255, 0, 85, 0.2);
}

/* ── QUICK PHRASES BAR ─────────────────────────────────────────────────── */
.quick-phrases-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.quick-phrase-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 8px;
    color: #e0e6ed;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-phrase-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    border-color: #00f0ff;
    color: #00f0ff;
    transform: translateY(-1px);
}

/* ── CHAT MESSAGE FEED ─────────────────────────────────────────────────── */
.chat-message-feed {
    max-height: 140px;
    min-height: 70px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
}

.chat-system-msg {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    font-style: italic;
    text-align: center;
}

.chat-feed-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: fadeIn 0.15s ease;
}

.chat-sender {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.chat-sender.p1 { color: #00f0ff; }
.chat-sender.p2 { color: #ff0055; }
.chat-sender.ai { color: #ffe600; }

.chat-bubble-text {
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 8px;
    border-radius: 6px;
    color: #ffffff;
    word-break: break-word;
    line-height: 1.3;
}

/* ── CHAT INPUT FORM ───────────────────────────────────────────────────── */
.chat-input-form {
    display: flex;
    gap: 6px;
}

.chat-text-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-text-input:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.btn-send-chat {
    padding: 0 14px;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
}

/* ── LOBBY QUICK EMOJI BAR ─────────────────────────────────────────────── */
.lobby-emoji-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    margin: 10px 0;
}

.lobby-emoji-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.lobby-emoji-buttons {
    display: flex;
    gap: 6px;
}

/* ── MOBILE RESPONSIVENESS FOR CHAT & EMOJIS ───────────────────────────── */
@media (max-width: 600px) {
    .emoji-reaction-dock {
        padding: 4px 8px;
        gap: 4px;
    }
    .emoji-btn {
        width: 32px;
        height: 32px;
        font-size: 1.05rem;
    }
    .btn-chat-toggle {
        padding: 0 8px;
        font-size: 0.9rem;
    }
    .in-game-chat-drawer {
        right: 8px;
        bottom: 60px;
        width: calc(100vw - 16px);
    }
}

/* ── BATTLE ARENA SELECTOR (DASHBOARD & PAUSE) ─────────────────────────── */
.arena-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.arena-theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    text-align: left;
}

.arena-theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.arena-theme-btn.active {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.arena-theme-btn[data-theme="shaolin_temple"].active {
    background: rgba(255, 153, 0, 0.15);
    border-color: #ff9900;
    box-shadow: 0 0 12px rgba(255, 153, 0, 0.35);
}

.arena-theme-btn[data-theme="lava_inferno"].active {
    background: rgba(255, 51, 0, 0.15);
    border-color: #ff3300;
    box-shadow: 0 0 12px rgba(255, 51, 0, 0.35);
}

.arena-theme-btn[data-theme="synthwave_retro"].active {
    background: rgba(255, 0, 170, 0.15);
    border-color: #ff00aa;
    box-shadow: 0 0 12px rgba(255, 0, 170, 0.35);
}

.arena-theme-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.arena-theme-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── PAUSE MENU ARENA THEME SELECTOR ───────────────────────────────────── */
.pause-arena-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 8px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.pause-arena-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

.pause-arena-buttons {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.pause-arena-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 6px 10px;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pause-arena-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.pause-arena-btn.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.pause-arena-btn[data-pause-theme="shaolin_temple"].active {
    border-color: #ff9900;
    background: rgba(255, 153, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 153, 0, 0.4);
}

.pause-arena-btn[data-pause-theme="lava_inferno"].active {
    border-color: #ff3300;
    background: rgba(255, 51, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 51, 0, 0.4);
}

.pause-arena-btn[data-pause-theme="synthwave_retro"].active {
    border-color: #ff00aa;
    background: rgba(255, 0, 170, 0.15);
    box-shadow: 0 0 10px rgba(255, 0, 170, 0.4);
}

/* ── BATTLE POWER-UPS & SUPER SKILLS ACTION DOCK ───────────────────────── */
.battle-skills-dock {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 6px auto 8px;
    width: 100%;
    max-width: 480px;
    padding: 0 4px;
    box-sizing: border-box;
    z-index: 25;
}

.skill-btn {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(10, 15, 29, 0.85);
    border: 1.5px solid rgba(0, 240, 255, 0.35);
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.skill-btn:active {
    transform: scale(0.96);
}

.skill-btn.ready {
    border-color: rgba(0, 240, 255, 0.6);
}

.skill-btn.ready:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.12);
}

#skillFreeze.ready {
    border-color: rgba(0, 240, 255, 0.7);
}
#skillFreeze.ready:hover {
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

#skillShield.ready {
    border-color: rgba(0, 170, 255, 0.7);
}
#skillShield.ready:hover {
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.5);
}

#skillDoubleDmg.ready {
    border-color: rgba(255, 51, 0, 0.7);
}
#skillDoubleDmg.ready:hover {
    box-shadow: 0 0 12px rgba(255, 51, 0, 0.5);
    border-color: #ff3300;
}

#skillMedkit.ready {
    border-color: rgba(0, 255, 136, 0.7);
}
#skillMedkit.ready:hover {
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
    border-color: #00ff88;
}

.skill-btn.on-cooldown {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
}

.skill-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    line-height: 1;
}

.skill-text-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    min-width: 0;
}

.skill-name {
    font-size: 0.68rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-name .short-name {
    display: none;
}

.skill-name .full-name {
    display: inline;
}

.skill-key {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--neon-cyan);
    opacity: 0.85;
}

.skill-cd-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0, 0, 0, 0.75);
    color: #ffd700;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: height 0.15s linear;
}

/* Mobile responsiveness for skills dock */
@media (max-width: 600px) {
    .battle-skills-dock {
        gap: 4px;
        margin: 2px auto 4px;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    .skill-btn {
        flex: 1;
        min-width: 0;
        padding: 5px 3px;
        gap: 2px;
        border-radius: 6px;
    }
    .skill-icon {
        font-size: 0.95rem;
    }
    .skill-text-box {
        align-items: center;
    }
    .skill-name {
        font-size: 0.58rem;
        letter-spacing: 0;
    }
    .skill-name .full-name {
        display: none;
    }
    .skill-name .short-name {
        display: inline;
    }
    .skill-key {
        display: none; /* Hide [key] indicator on phone touch screens */
    }
}

/* ========================================================================== */
/* v42: SIMPLIFIED UI, HERO ACTIONS & COMMUNITY CHAT SYSTEM                  */
/* ========================================================================== */

/* Header Chat Button */
.chat-header-btn {
    position: relative;
    background: rgba(255, 0, 85, 0.12) !important;
    border: 1px solid var(--neon-magenta) !important;
    color: #fff !important;
}

.chat-header-btn:hover {
    background: rgba(255, 0, 85, 0.25) !important;
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.5) !important;
}

.chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--neon-magenta);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 0 8px var(--neon-magenta);
    animation: pulseBadge 1.8s infinite;
}

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

/* Dual Hero Action Buttons */
.dual-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 20px 0 15px;
    width: 100%;
}

.btn-hero-play,
.btn-hero-chat {
    position: relative;
    padding: 16px 28px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 260px;
    flex: 1;
    max-width: 380px;
    text-align: left;
}

.btn-hero-play {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 150, 255, 0.1));
    border: 1.5px solid var(--neon-cyan);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3);
}

.btn-hero-chat {
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.25), rgba(157, 0, 255, 0.15));
    border: 1.5px solid var(--neon-magenta);
    box-shadow: 0 0 25px rgba(255, 0, 85, 0.3);
}

.btn-hero-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.55);
}

.btn-hero-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(255, 0, 85, 0.55);
}

.chat-btn-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 0, 85, 0.2), transparent 70%);
    pointer-events: none;
}

/* Modes Section Headers */
.modes-section-header {
    text-align: center;
    margin: 25px 0 12px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 3px;
}

.modes-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 16px;
    margin-bottom: 25px;
}

.utility-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 16px;
    margin-bottom: 20px;
}

/* ────────────────────────────────────────────────────────────────────────── */
/* COMMUNITY CHAT MODAL / DRAWER                                              */
/* ────────────────────────────────────────────────────────────────────────── */

.chat-modal-card {
    max-width: 640px !important;
    width: 95% !important;
    height: 85vh;
    max-height: 720px;
    display: flex;
    flex-direction: column;
    padding: 16px 20px !important;
    background: rgba(10, 14, 30, 0.96) !important;
    border: 1.5px solid var(--neon-magenta) !important;
    box-shadow: 0 0 40px rgba(255, 0, 85, 0.3) !important;
    border-radius: 16px;
}

.chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.chat-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-title-icon {
    font-size: 1.6rem;
}

.chat-main-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.chat-meta-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.chat-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.status-online {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.4);
}

.status-connecting {
    background: rgba(255, 230, 0, 0.15);
    color: #ffe600;
    border: 1px solid rgba(255, 230, 0, 0.4);
}

.status-offline {
    background: rgba(255, 0, 85, 0.15);
    color: #ff0055;
    border: 1px solid rgba(255, 0, 85, 0.4);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.chat-online-count {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* 1-Click Challenge Banner in Chat */
.chat-challenge-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(90deg, rgba(255, 0, 85, 0.15), rgba(157, 0, 255, 0.15));
    border: 1px solid var(--neon-magenta);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 12px 0 10px;
    flex-shrink: 0;
}

.challenge-banner-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.challenge-banner-icon {
    font-size: 1.4rem;
}

.challenge-banner-info strong {
    font-size: 0.82rem;
    color: #fff;
    display: block;
    font-family: var(--font-heading);
}

.challenge-banner-info p {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 2px 0 0;
}

.btn-post-challenge {
    padding: 8px 14px;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.4);
}

/* Chat Messages Stream */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 4px;
    scroll-behavior: smooth;
}

.chat-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 90%;
    animation: fadeInMsg 0.2s ease;
}

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

.msg-self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-other {
    align-self: flex-start;
}

.chat-avatar {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-bubble {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
    word-break: break-word;
}

.msg-self .chat-bubble {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.4);
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.chat-user-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--neon-cyan);
    font-family: var(--font-heading);
}

.msg-self .chat-user-name {
    color: #ffe600;
}

.chat-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.45);
}

.chat-text {
    font-size: 0.88rem;
    color: #f0f0f0;
    line-height: 1.35;
    margin: 0;
}

/* 1v1 CHALLENGE CARD IN CHAT FEED */
.msg-challenge {
    max-width: 100% !important;
    width: 100% !important;
    align-self: center !important;
}

.chat-challenge-card {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.22), rgba(20, 24, 50, 0.9));
    border: 1.5px solid var(--neon-magenta);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.3);
}

.challenge-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 0, 85, 0.3);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.challenge-icon {
    font-size: 1.1rem;
}

.challenge-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--neon-magenta);
    flex: 1;
    letter-spacing: 0.5px;
}

.challenge-time {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
}

.challenge-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.challenger-info {
    font-size: 0.85rem;
    color: #fff;
}

.challenge-room-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.room-code-tag {
    background: rgba(0, 240, 255, 0.2);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: 1px;
}

.challenge-card-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-accept-challenge {
    padding: 8px 18px !important;
    font-size: 0.82rem !important;
    animation: glowAccept 1.6s infinite;
}

@keyframes glowAccept {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); }
    50% { box-shadow: 0 0 22px rgba(0, 240, 255, 0.85); }
}

.challenge-waiting-tag {
    font-size: 0.75rem;
    color: #00ff88;
    font-weight: 700;
}

/* Quick Emojis Bar */
.chat-quick-emojis {
    display: flex;
    gap: 6px;
    padding: 6px 0;
    overflow-x: auto;
    flex-shrink: 0;
}

.chat-emoji-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.chat-emoji-btn:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.2);
}

/* Input Row */
.chat-input-row {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.chat-input-field {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-field:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.btn-send-chat {
    padding: 10px 18px;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Floating Bottom-Right Chat Pill */
.floating-chat-pill {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.9), rgba(157, 0, 255, 0.9));
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 0, 85, 0.5);
    z-index: 999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-chat-pill:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 25px rgba(255, 0, 85, 0.7);
}

.floating-chat-pill.chat-open {
    display: none;
}

.float-chat-icon {
    font-size: 1.1rem;
}

.float-chat-badge {
    background: #ffe600;
    color: #000;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 900;
}

/* Responsive adjust for mobile */
@media (max-width: 600px) {
    .chat-modal-card {
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        padding: 12px 14px !important;
    }

    .btn-hero-play,
    .btn-hero-chat {
        min-width: 100%;
        max-width: 100%;
        padding: 14px 18px;
    }

    .floating-chat-pill {
        bottom: max(15px, calc(env(safe-area-inset-bottom) + 10px));
        right: 15px;
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .chat-input-row {
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }

    .chat-challenge-banner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 8px 10px !important;
    }

    .btn-post-challenge {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   ARCADE 3-2-1 ROUND START COUNTDOWN FANFARE OVERLAY
   ══════════════════════════════════════════════════════════════════════════════ */
.countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
    background: radial-gradient(circle, rgba(5, 7, 16, 0.65) 0%, rgba(5, 7, 16, 0.88) 100%);
    backdrop-filter: blur(4px);
    transition: opacity 0.25s ease;
}

.countdown-overlay.hidden {
    display: none !important;
}

.countdown-text {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 12vw, 6.5rem);
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffe600;
    text-shadow: 0 0 25px rgba(255, 230, 0, 0.85), 0 0 50px rgba(255, 0, 85, 0.7);
    animation: countPulse 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

.countdown-text.fight-anim {
    color: #ff0055;
    font-size: clamp(3.2rem, 14vw, 7.5rem);
    text-shadow: 0 0 35px #ff0055, 0 0 70px #ffe600;
    animation: fightSlam 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes countPulse {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fightSlam {
    0% {
        transform: scale(2.2);
        opacity: 0;
    }
    60% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   UPCOMING NEXT WORD PREVIEW BADGE
   ══════════════════════════════════════════════════════════════════════════════ */
.next-word-preview {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px dashed rgba(0, 240, 255, 0.4);
    color: #94a3b8;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: auto;
    transition: all 0.2s ease;
}

.next-word-preview strong {
    color: #00f0ff;
    font-weight: 700;
}

.next-word-preview.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MASTER MOBILE PHONE OVERRIDE SYSTEM (<= 768px)
   Guarantees 100% Responsive, Uncluttered Arena & Perfect Native-Like Controls
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* 1. Header & Badges */
    .logo .badge {
        display: none !important;
    }
    .player-header-badge .user-meta {
        display: none !important;
    }
    .header-controls .chat-header-text {
        display: none !important;
    }
    .coin-btn {
        padding: 4px 7px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        min-width: 0 !important;
    }
    .header {
        padding: 6px 8px !important;
        gap: 6px !important;
    }
    .logo-text {
        font-size: 0.92rem !important;
        letter-spacing: 0.5px !important;
    }

    /* 2. HUD (Health, Names & VS Badge) */
    .hud {
        display: grid !important;
        grid-template-columns: 1fr 52px 1fr !important;
        gap: 4px !important;
        padding: 4px 6px !important;
    }
    .player-info {
        gap: 4px !important;
        min-width: 0 !important;
    }
    .avatar {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
    }
    .details h3 {
        font-size: 0.68rem !important;
        max-width: 95px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .stats-mini {
        font-size: 0.58rem !important;
    }
    .vs-center {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1px !important;
    }
    .vs-circle {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.56rem !important;
    }
    .stage-badge {
        font-size: 0.52rem !important;
        padding: 1px 4px !important;
        white-space: nowrap !important;
        letter-spacing: 0 !important;
    }
    .match-time {
        font-size: 0.62rem !important;
    }
    .hp-bar-outer {
        height: 18px !important;
    }
    .hp-text {
        font-size: 0.62rem !important;
    }
    .super-bar-outer {
        height: 6px !important;
    }
    .super-text {
        display: none !important;
    }

    /* 3. Pure Cinema Canvas Arena (Fighters 100% Unobstructed) */
    .canvas-container {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 16 / 8 !important;
        max-height: clamp(160px, 32vh, 230px) !important;
        min-height: 150px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        margin: 0 auto !important;
        border: 1.5px solid rgba(0, 240, 255, 0.35) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(0, 240, 255, 0.1) !important;
        flex-shrink: 0 !important;
    }
    .canvas-container canvas {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }

    /* 4. Target Combat Deck (Flows cleanly below canvas, never overlaps fighters) */
    .typing-box-container {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 6px auto 0 !important;
        gap: 4px !important;
        padding: 0 !important;
        z-index: 20 !important;
    }
    .typing-word-card {
        width: 100% !important;
        padding: 6px 10px !important;
        border-radius: 10px !important;
        background: rgba(8, 12, 28, 0.88) !important;
        border: 1.5px solid rgba(0, 240, 255, 0.5) !important;
        backdrop-filter: blur(8px) !important;
    }
    .prompt-label {
        font-size: 0.6rem !important;
        margin-bottom: 2px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .next-word-preview {
        font-size: 0.58rem !important;
        padding: 1px 5px !important;
        max-width: 110px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    .word-display {
        font-size: clamp(1.15rem, 5vw, 1.45rem) !important;
        min-height: 28px !important;
        letter-spacing: 1px !important;
    }
    .mobile-keyboard-btn {
        display: flex !important;
        width: 100% !important;
        margin-top: 4px !important;
        padding: 10px 14px !important;
        font-size: 0.82rem !important;
        border-radius: 8px !important;
    }

    /* 5. Virtual Soft Keyboard Open State */
    body.keyboard-open .canvas-container {
        max-height: clamp(100px, 20vh, 135px) !important;
        min-height: 100px !important;
    }
    body.keyboard-open .mobile-keyboard-btn {
        display: none !important;
    }
    body.keyboard-open .battle-skills-dock {
        display: none !important;
    }
    body.keyboard-open .super-ready-banner {
        display: none !important;
    }
    body.keyboard-open .typing-box-container {
        margin-top: 3px !important;
        gap: 2px !important;
    }
    body.keyboard-open .typing-word-card {
        padding: 4px 8px !important;
    }
    body.keyboard-open .word-display {
        font-size: 1.18rem !important;
        min-height: 24px !important;
    }
}

/* Extra small mobile phones (<= 380px) */
@media (max-width: 380px) {
    .details h3 {
        max-width: 75px !important;
        font-size: 0.62rem !important;
    }
    .skill-name {
        font-size: 0.52rem !important;
    }
    .logo-text {
        font-size: 0.85rem !important;
    }
}

