/* RESET E BASES DE LAYOUT */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ajuste principal para Notebooks: a main-content deve ser flexível */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 100%;
    transition: all 0.3s ease;
    overflow-x: hidden;
    padding: 2rem;
}

/* SEÇÃO INICIAL E BOTÃO X1 */
.start-section {
    text-align: center;
    padding: 3rem 2rem;
}

.start-x1-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;

    font-size: 0.95rem;
    font-weight: 600;

    padding: 0.9rem 1.4rem;

    width: auto;
    min-height: auto;
    max-width: none;

    border-radius: 12px;
    border: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(16,185,129,.20);

    transition: .2s;
}

.start-x1-btn:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(16, 185, 129, 0.6);
}

.start-x1-btn:active {
    transform: translateY(-4px) scale(1);
}

.start-x1-btn i {
    font-size: 1rem;
    animation: none;
}

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

/* OVERLAY DE LOADING */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(10, 26, 58, 0.98), rgba(37, 99, 235, 0.95));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
    width: 100%;
}

.loading-title{
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    color: white;
}

/* ANIMAÇÃO DE BUSCA */
.search-spinner {
    width: 120px;
    height: 120px;
    border: 6px solid rgba(255,255,255,0.2);
    border-top: 6px solid var(--secondary-light);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 2rem auto;
    position: relative;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#search-status {
   color: white;
}

/* CARD DE ADVERSÁRIO ENCONTRADO */
.found-opponent {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.3);
    display: none;
    align-items: center;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

#opponent-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--success), #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    font-weight: 800;
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}

/* HEADER DO DESAFIO */
.x1-header {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #4f46e5, #7c3aed);
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

/* ESTADO DO JOGO (MATCH CARD) */
.match-card {
    display: none;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.players-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

.player-box {
    width: 100%;
    text-align: center;
}

.player-avatar-large {
    width: clamp(80px, 10vw, 140px);
    height: clamp(80px, 10vw, 140px);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: clamp(2rem, 3vw, 3.5rem);
    color: white;
    font-weight: 700;
    border: 4px solid white;
    box-shadow: var(--shadow-xl);
    position: relative;
}

/* VS BADGE */
.vs-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4);
    animation: pulse-vs 2s infinite;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    white-space: nowrap;
}

@keyframes pulse-vs {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* TIMER */
.question-timer {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-family: monospace;
    letter-spacing: 5px;
    border: 2px dashed var(--secondary);
}


@media (max-width: 768px) {
    .players-display {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .vs-badge {
        order: -1;
        margin: 0.5rem 0;
    }

    .main-content {
        padding: 4.5rem 1rem 1.5rem; /* top reserva espaço para o hamburger */
    }

    .x1-header {
        padding: 2rem 1rem;
    }

.btn-solicitar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important; 
    }

  
    .btn-solicitar .btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 0.8rem !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .btn-solicitar .btn + .btn {
        margin-top: 10px !important; 
    }
    
    
    .ranking-item {
        flex-direction: column !important;
        padding: 1rem !important;
        align-items: center !important;
        text-align: center;
    }

   
    .btn-solicitar .btn {
        flex: 1;
        text-align: center;
        padding: 0.6rem !important; 
    }
}


@media (min-width: 769px) and (max-width: 1280px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .players-display {
        gap: 1rem;
    }
    
    .player-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .vs-badge {
        padding: 0.8rem 1.8rem;
        font-size: 1.8rem;
    }
}



.hidden-sidebar {
    display: none;
}

/* ---------- Tag de disciplina ---------- */
.question-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---------- Indicador "ao vivo" ---------- */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--danger);
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ---------- Modal de adversário ---------- */
.opponent-modal-inner {
    max-width: 520px;
    width: 90%;
    background: rgba(15, 23, 42, 0.92);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    padding: 1.75rem;
}

.modal-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.3); }

.modal-search-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.modal-search-input::placeholder { color: rgba(255,255,255,0.45); }
.modal-search-input:focus { border-color: var(--secondary-light); }

/* ---------- Linha de adversário ---------- */
.opponent-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.4rem;
    background: rgba(255,255,255,0.07);
    cursor: pointer;
    transition: background 0.2s;
}
.opponent-row:hover { background: rgba(255,255,255,0.15); }

.opponent-row-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---------- Avatar mini na lista ---------- */
.x1-mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ---------- Scrollbar no modal ---------- */
#opponent-list::-webkit-scrollbar       { width: 5px; }
#opponent-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 10px; }
#opponent-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 10px; }

/* ---------- Strike (Riscar alternativa) ---------- */
.option-row { display: flex; align-items: center; gap: 0.4rem; }
.option-row .option-item { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 0.75rem; }
.option-prefix { flex-shrink: 0; margin-top: 2px; }
.option-text { flex: 1; line-height: 1.65; text-align: justify; text-justify: inter-word; }
#question-text { text-align: justify; text-justify: inter-word; line-height: 1.75; }

.strike-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    color: #cbd5e1;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}
.strike-btn:hover { color: #64748b; background: rgba(0,0,0,0.06); }

.option-row.struck .option-item   { opacity: 0.5; }
.option-row.struck .option-text   { text-decoration: line-through; color: #94a3b8; }
.option-row.struck .option-prefix { background: #e2e8f0; color: #94a3b8; border-color: #e2e8f0; }
.option-row.struck .strike-btn    { color: #ef4444; background: rgba(239,68,68,0.1); }

.x1-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.x1-header p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
}

.x1-header{
    background: linear-gradient(135deg,#0f172a,#2563eb);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    color:white;
}

.x1-header-content{
    display:flex;
    align-items:center;
    gap:1.5rem;
}

.x1-icon{
    width:70px;
    height:70px;
    border-radius:16px;
    background:rgba(255,255,255,.12);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:2rem;
    backdrop-filter: blur(10px);
}

.x1-header h1{
    margin:0;
    font-size:2rem;
    font-weight:800;
}

.x1-header p{
    margin-top:.4rem;
    opacity:.85;
    font-size:.95rem;
}
/* ══════════════════════════════════════════════
   DARK MODE — x1.css
   ══════════════════════════════════════════════ */
[data-theme="dark"] .question-timer { color: #60a5fa; }
[data-theme="dark"] .question-tag {
    background: #0c2a3d;
    color: #7dd3fc;
    border-color: #1e3550;
}

/* Paginação do ranking rápido */
.ranking-pag-btn {
    min-width: 32px; height: 32px; padding: 0 0.55rem; border-radius: 8px;
    border: 1.5px solid var(--gray-200); background: white; color: var(--gray-700);
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.ranking-pag-btn:hover:not(:disabled) { border-color: var(--secondary); color: var(--secondary); }
.ranking-pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ranking-pag-btn.active { background: var(--secondary); border-color: var(--secondary); color: white; }
[data-theme="dark"] .ranking-pag-btn { background: #0f172a; border-color: #334155; color: #cbd5e1; }

/* Linha "você" no ranking rápido — não pode usar --gray-50 puro, vira
   quase branco em cima de fundo quase branco (--gray-800 fica claro no dark) */
.ranking-item-highlight { background: var(--gray-50); border-radius: var(--radius-md); }
[data-theme="dark"] .ranking-item-highlight { background: rgba(59,130,246,0.15); }
