:root {
    --bg-color: #060913;
    --card-bg: rgba(13, 20, 36, 0.88);
    --card-border: rgba(0, 243, 255, 0.22);
    --card-border-strong: rgba(0, 243, 255, 0.35);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --primary-cyan: #00f3ff;
    --primary-magenta: #ff0055;
    --neon-green: #00ff88;
    --neon-amber: #ffaa00;
    --gold: #ffd700;
    --shadow: 0 0 40px rgba(0, 243, 255, 0.12);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Se tentarem usar Ctrl+P para "Imprimir para PDF", a tela fica toda preta */
@media print {
    body {
        display: none !important;
    }
    html {
        background-color: #000 !important;
    }
}

input, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 50% 10%, rgba(0, 243, 255, 0.08) 0%, transparent 45%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
    outline: none;
}

button {
    cursor: pointer;
}

/* ==========================================
   UTILITÁRIOS E TEXTOS
   ========================================== */
.text-cyan {
    color: var(--primary-cyan);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.text-green {
    color: var(--neon-green);
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==========================================
   BOTÕES GLOBAIS (Estilo Arcade)
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Cores específicas dos jogos */
.btn-reflex {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.btn-reflex:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.btn-letrinhas {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.btn-letrinhas:hover {
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.btn-ritmo {
    border-color: var(--primary-magenta);
    color: var(--primary-magenta);
}

.btn-ritmo:hover {
    background: rgba(255, 0, 85, 0.1);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.3);
}

/* ==========================================
   HEADER GLOBAL
   ========================================== */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(16px);
    background: rgba(6, 9, 19, 0.92);
    border-bottom: 1px solid rgba(0, 243, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
}

.global-header .brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.global-header .brand-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-cyan);
}

.global-header .brand-tag {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.global-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.global-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 12px;
    text-transform: uppercase;
}

.global-nav a.active,
.global-nav a:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    background: rgba(0, 243, 255, 0.08);
}

.global-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.icon-button:hover {
    border-color: var(--primary-cyan);
    background: rgba(0, 243, 255, 0.08);
}

.profile-badge {
    min-width: 52px;
    min-height: 52px;
    border-radius: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    background: rgba(0, 243, 255, 0.07);
    color: var(--text-main);
}

/* ==========================================
   BADGES (CROWNS)
   ========================================== */
.global-badges {
    position: fixed;
    top: 88px;
    left: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
    pointer-events: none;
}

.crown-badge {
    background: rgba(6, 9, 19, 0.95);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 12px;
    border-radius: 999px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.16);
    text-transform: uppercase;
}

.crown-badge.plat {
    background: linear-gradient(135deg, rgba(255, 223, 0, 0.22), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 215, 0, 0.8);
    color: #ffffff;
}

/* ==========================================
   TOASTS E NOTIFICAÇÕES
   ========================================== */
.global-toast,
.invite-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    max-width: 92vw;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(6, 9, 19, 0.95);
    border: 1px solid rgba(0, 243, 255, 0.22);
    color: #fff;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
}

.global-toast.show,
.invite-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
    pointer-events: auto;
}

.invite-toast {
    bottom: 18px;
    left: auto;
    right: 18px;
    transform: none;
    width: 320px;
}

.invite-toast .invite-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.invite-toast .invite-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 12px;
}

.invite-progress-bar {
    width: 100%;
    height: 100%;
    background: var(--primary-cyan);
    transition: width 0.12s linear;
}

/* ==========================================
   MODAIS
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: min(420px, 100%);
    background: rgba(6, 9, 19, 0.98);
    border: 1px solid rgba(0, 243, 255, 0.18);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

.modal-card h2 {
    margin: 0 0 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    letter-spacing: 1px;
}

.modal-card p {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.modal-card label {
    display: block;
    margin: 16px 0 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-card input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.modal-card input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.modal-card .modal-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-card .modal-actions button {
    flex: 1 1 auto;
    border: 1px solid rgba(0, 243, 255, 0.24);
    background: rgba(0, 243, 255, 0.08);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.modal-card .modal-actions button.primary {
    background: var(--primary-cyan);
    color: #06121f;
    border-color: transparent;
}

.modal-card .hint {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* ==========================================
   LOBBY / HUB PRINCIPAL
   ========================================== */
.lobby-shell {
    padding: 40px 24px 60px;
    min-height: 100vh;
}

.lobby-hero {
    max-width: 840px;
    margin: 0 auto;
    text-align: center;
    padding-top: 10px;
}

.lobby-hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(40px, 7vw, 68px);
    margin: 10px 0;
    line-height: 1.1;
    font-weight: 900;
}

.lobby-desc {
    max-width: 680px;
    margin: 20px auto 0;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.6;
}

.lobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 25px;
    align-items: stretch;
    margin: 60px auto 0;
    max-width: 1100px;
}

.lobby-card {
    background: rgba(13, 20, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-content h3 {
    margin: 0 0 12px;
    font-size: 24px;
    letter-spacing: 1.5px;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.card-content p {
    margin: 0 0 25px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Efeitos Específicos dos Cards Arcade no Hover */
.lobby-card.card-reflex:hover {
    transform: translateY(-5px);
    border-color: var(--primary-cyan);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.15);
}

.lobby-card.card-reflex:hover h3 {
    color: var(--primary-cyan);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.lobby-card.card-letrinhas:hover {
    transform: translateY(-5px);
    border-color: var(--neon-green);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.15);
}

.lobby-card.card-letrinhas:hover h3 {
    color: var(--neon-green);
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.lobby-card.card-ritmo:hover {
    transform: translateY(-5px);
    border-color: var(--primary-magenta);
    box-shadow: 0 10px 30px rgba(255, 0, 85, 0.15);
}

.lobby-card.card-ritmo:hover h3 {
    color: var(--primary-magenta);
    text-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
}

/* ==========================================
   RESPONSIVO (MOBILE)
   ========================================== */
/* ==========================================
   CORREÇÃO HEADER MOBILE (Anti-vazamento)
   ========================================== */
@media (max-width: 760px) {
    .global-header {
        padding: 8px 12px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    /* Reduz a Logo e o Título no Mobile */
    .global-header .brand-title {
        font-size: 14px !important;
        letter-spacing: 1px !important;
        gap: 6px !important;
    }

    .global-header .brand-title svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Ajusta a área da direita (Online + Perfil) */
    .global-actions {
        gap: 8px !important;
    }

    /* Compacta o texto Online */
    #online-counter {
        font-size: 11px !important;
    }

    /* Reduz o círculo do Perfil para não estourar a margem */
    #shared-header .profile-badge {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        font-size: 12px !important;
    }

    /* Menu de jogos deslizável abaixo */
    .global-nav {
        order: 3;
        width: 100% !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0 !important;
        gap: 6px !important;
    }

    .global-nav::-webkit-scrollbar {
        display: none !important;
    }

    .global-nav a {
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 10px !important;
    }

    /* Ajuste de topo para a tela do jogo */
    body {
        padding-top: 110px !important;
    }

    .global-nav a {
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 10px !important;
    }

    /* Ajuste de topo para a tela do jogo */
    body {
        padding-top: 110px !important;
    }
}
