/* ═══════════════════════════════════════════════════════════════
   Trivia Musical — Styles
═══════════════════════════════════════════════════════════════ */

.game-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────── */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.back-btn {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 700;
    transition: transform 0.2s;
}
.back-btn:hover { transform: translateX(-4px); }

.header-center {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.level-badge, .progress-badge {
    background: var(--color-primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.progress-badge {
    background: var(--color-secondary);
}

.score-display {
    background: white;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    color: var(--color-primary);
}

.hidden { display: none !important; }

/* ── Screens ─────────────────────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: screenIn 0.3s ease-out;
    flex: 1;
}
.screen.active { display: flex; }

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

h1 { font-size: 2.5rem; color: var(--color-text); margin-bottom: 0.5rem; }
.subtitle { color: var(--color-text-light); font-size: 1.1rem; margin-bottom: 2rem; }
.setup-label { font-weight: 700; color: var(--color-text-light); text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; margin-bottom: 1rem; }

/* ── Start Screen ───────────────────────────────────────────── */
.start-icon { font-size: 4rem; margin-bottom: 0.5rem; animation: float 3s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.level-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
}

.level-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.level-btn:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}
.level-btn.selected {
    border-color: var(--color-primary);
    background: #f3e8ff;
    transform: translateX(10px);
}

.lvl-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}
.lvl-1 .lvl-num { background: #22c55e; }
.lvl-2 .lvl-num { background: #3b82f6; }
.lvl-3 .lvl-num { background: #f59e0b; }
.lvl-4 .lvl-num { background: #ef4444; }
.lvl-5 .lvl-num { background: #8b5cf6; }

.level-btn > div { display: flex; flex-direction: column; }
.lvl-title { font-weight: 800; font-size: 1.1rem; color: var(--color-text); }
.level-btn small { color: var(--color-text-light); font-size: 0.85rem; }

/* Buttons */
.btn {
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-primary { background: var(--color-primary); color: white; box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6); }
.btn-primary:disabled { background: #cbd5e1; color: #94a3b8; cursor: not-allowed; box-shadow: none; }

/* ── Game Screen ────────────────────────────────────────────── */
.timer-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: #f1f5f9; stroke-width: 8; }
.timer-progress { 
    fill: none; 
    stroke: var(--color-primary); 
    stroke-width: 8; 
    stroke-linecap: round;
    stroke-dasharray: 283; /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-progress.warning { stroke: #ef4444; }
.timer-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-text);
}

.question-text {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 2rem;
    max-width: 90%;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.option-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}
.option-btn:hover:not(:disabled) {
    background: white;
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.option-btn.correct {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}
.option-btn.wrong {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}
.option-btn:disabled {
    cursor: default;
}

/* ── Result Screen ──────────────────────────────────────────── */
.result-icon { font-size: 5rem; margin-bottom: 0.5rem; }

.stats-card {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.1rem;
}
.stat-row:last-child { border-bottom: none; }
.text-primary { color: var(--color-primary); font-size: 1.3rem; }

/* Responsive */
@media (max-width: 600px) {
    .options-grid { grid-template-columns: 1fr; }
    .screen { padding: 1.5rem 1rem; }
    h1 { font-size: 2rem; }
    .question-text { font-size: 1.3rem; max-width: 100%; }
}
