/* ══════════════════════════════════════════════════════════════
   PSIKOTES MASUK SMA — DESIGN SYSTEM
   Modern, vibrant, glassmorphism-based UI for ages 14-15
   ══════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(20, 20, 50, 0.65);
    --bg-card-hover: rgba(30, 30, 65, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.04);

    --text-primary: #f0f0ff;
    --text-secondary: #9d9dbe;
    --text-muted: #5c5c80;

    --accent-1: #7c5cfc;
    --accent-2: #00d4aa;
    --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #00d4aa 100%);
    --accent-glow: 0 0 30px rgba(124, 92, 252, 0.4), 0 0 60px rgba(0, 212, 170, 0.15);

    --correct: #00d68f;
    --correct-bg: rgba(0, 214, 143, 0.1);
    --correct-border: rgba(0, 214, 143, 0.3);
    --wrong: #ff6b6b;
    --wrong-bg: rgba(255, 107, 107, 0.1);
    --wrong-border: rgba(255, 107, 107, 0.3);

    --verbal-color: #a78bfa;
    --numerik-color: #38bdf8;
    --logika-color: #fb923c;
    --spasial-color: #34d399;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-btn: 0 4px 20px rgba(124, 92, 252, 0.35);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET & BASE ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── PARTICLE CANVAS ─── */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
/* ─── APP TOP NAV ─── */
.app-top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 10, 26, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    transition: var(--transition-fast);
}

.nav-back-link:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.nav-brand-center {
    display: flex;
    align-items: center;
}

.nav-tag-mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.nav-home-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.nav-home-link:hover {
    color: #ffffff;
    opacity: 0.9;
}

.nav-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #ffffff;
    color: #000000;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .nav-tag-mono { display: none; }
    .nav-home-text { display: none; }
    .nav-back-link { padding: 8px 12px; font-size: 0.8rem; }
}


/* ─── SCREEN MANAGEMENT ─── */
.screen {
    position: fixed;
    inset: 0;
    padding-top: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    pointer-events: all;
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ═══════════════════════════════════════════════════
   WELCOME SCREEN
   ═══════════════════════════════════════════════════ */
.welcome-container {
    text-align: center;
    max-width: 560px;
    width: 90%;
    padding: 2rem;
}

.logo-badge {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--accent-glow);
    animation: floatBadge 3s ease-in-out infinite;
}

.logo-icon {
    font-size: 2.8rem;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Info cards row */
.info-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    backdrop-filter: blur(12px);
    flex: 1;
    max-width: 140px;
    transition: var(--transition-smooth);
}

.info-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(124, 92, 252, 0.3);
    transform: translateY(-3px);
}

.info-icon {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Category tags */
.category-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid;
}

.tag-verbal  { color: var(--verbal-color); border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.08); }
.tag-numerik { color: var(--numerik-color); border-color: rgba(56,189,248,0.3); background: rgba(56,189,248,0.08); }
.tag-logika  { color: var(--logika-color); border-color: rgba(251,146,60,0.3); background: rgba(251,146,60,0.08); }
.tag-spasial { color: var(--spasial-color); border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.08); }

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.15);
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

.btn:active { transform: scale(0.97); }

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(124, 92, 252, 0.5);
}

.btn-glow {
    animation: glowPulse 2.5s ease-in-out infinite;
}

.btn-glow:disabled {
    animation: none;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(124, 92, 252, 0.35); }
    50% { box-shadow: 0 4px 30px rgba(124, 92, 252, 0.55), 0 0 50px rgba(0, 212, 170, 0.15); }
}

.btn-submit {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-btn);
    width: 100%;
    margin-top: 1.2rem;
    font-size: 1.05rem;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(124, 92, 252, 0.5);
}

.btn-next {
    background: linear-gradient(135deg, #00d4aa 0%, #38bdf8 100%);
    color: white;
    width: 100%;
    margin-top: 1rem;
    font-size: 1.05rem;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 170, 0.45);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-2px);
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    width: 100%;
}

.quiz-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition-fast);
}

.quiz-exit-btn:hover {
    color: var(--wrong);
    border-color: rgba(255, 107, 107, 0.4);
    background: var(--wrong-bg);
}

/* ═══════════════════════════════════════════════════
   QUIZ SCREEN
   ═══════════════════════════════════════════════════ */
#quizScreen {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

/* Header */
.quiz-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-badge {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
}

.category-pill {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-pill[data-category="verbal"]  { color: var(--verbal-color); background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.25); }
.category-pill[data-category="numerik"] { color: var(--numerik-color); background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.25); }
.category-pill[data-category="logika"]  { color: var(--logika-color); background: rgba(251,146,60,0.12); border: 1px solid rgba(251,146,60,0.25); }
.category-pill[data-category="spasial"] { color: var(--spasial-color); background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.25); }

.header-center {
    flex: 1;
    max-width: 320px;
    margin: 0 16px;
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 1rem;
    font-family: var(--font-mono);
    color: #fbbf24;
}

.score-icon { font-size: 1rem; }

/* Quiz Body */
.quiz-body {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 20px 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: auto;
    flex-shrink: 0;
}

/* Question Card */
.question-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    animation: cardEnter 0.5s ease-out;
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.question-number {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.question-image-wrapper {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.question-image {
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* Options */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.98rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition-fast);
}

.option-btn:hover:not(.locked) {
    border-color: rgba(124, 92, 252, 0.4);
    background: rgba(124, 92, 252, 0.06);
    transform: translateX(4px);
}

.option-btn.selected {
    border-color: var(--accent-1);
    background: rgba(124, 92, 252, 0.1);
}

.option-btn.selected .option-letter {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.option-btn.locked {
    cursor: default;
    pointer-events: none;
}

.option-btn.correct-answer {
    border-color: var(--correct) !important;
    background: var(--correct-bg) !important;
}

.option-btn.correct-answer .option-letter {
    background: var(--correct) !important;
    color: white !important;
    border-color: transparent !important;
}

.option-btn.wrong-answer {
    border-color: var(--wrong) !important;
    background: var(--wrong-bg) !important;
}

.option-btn.wrong-answer .option-letter {
    background: var(--wrong) !important;
    color: white !important;
    border-color: transparent !important;
}

.option-letter {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    position: relative;
    z-index: 1;
}

.option-label {
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

/* Feedback */
.feedback-box {
    margin-top: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: feedbackSlide 0.4s ease-out;
}

@keyframes feedbackSlide {
    from { opacity: 0; transform: translateY(16px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 500px; }
}

.feedback-box.correct {
    background: var(--correct-bg);
    border: 1px solid var(--correct-border);
}

.feedback-box.wrong {
    background: var(--wrong-bg);
    border: 1px solid var(--wrong-border);
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-weight: 800;
    font-size: 1.05rem;
}

.feedback-box.correct .feedback-header { color: var(--correct); }
.feedback-box.wrong .feedback-header { color: var(--wrong); }

.feedback-icon { font-size: 1.3rem; }

.feedback-body {
    padding: 0 18px 16px;
}

.feedback-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.feedback-explanation {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-primary);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   RESULT SCREEN
   ═══════════════════════════════════════════════════ */
#resultScreen {
    align-items: flex-start;
    padding-top: 2rem;
}

.result-container {
    text-align: center;
    max-width: 520px;
    width: 90%;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    flex-shrink: 0;
}

.result-trophy {
    font-size: 4rem;
    animation: trophyBounce 1s ease-out;
    margin-bottom: 0.5rem;
}

@keyframes trophyBounce {
    0% { transform: scale(0) rotateZ(-20deg); opacity: 0; }
    50% { transform: scale(1.3) rotateZ(5deg); }
    70% { transform: scale(0.9) rotateZ(-2deg); }
    100% { transform: scale(1) rotateZ(0); opacity: 1; }
}

.result-title {
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.result-name {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Score Ring */
.result-score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 2rem;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 10;
}

.ring-fill {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-value {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: var(--font-mono);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ring-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Stats */
.result-stats {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1;
    max-width: 130px;
    padding: 1rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
}

.stat-correct { background: var(--correct-bg); border: 1px solid var(--correct-border); }
.stat-wrong   { background: var(--wrong-bg); border: 1px solid var(--wrong-border); }
.stat-pct     { background: rgba(124,92,252,0.1); border: 1px solid rgba(124,92,252,0.3); }

.stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-mono);
}

.stat-correct .stat-num { color: var(--correct); }
.stat-wrong .stat-num   { color: var(--wrong); }
.stat-pct .stat-num     { color: var(--accent-1); }

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Category Breakdown */
.category-breakdown {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.cat-label {
    font-size: 0.82rem;
    font-weight: 700;
    width: 80px;
    text-align: left;
}

.cat-bar-wrapper {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
    width: 0%;
}

.cat-score {
    font-size: 0.78rem;
    font-weight: 800;
    font-family: var(--font-mono);
    width: 40px;
    text-align: right;
    color: var(--text-secondary);
}

/* Result Message */
.result-message {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   CONFETTI CANVAS
   ═══════════════════════════════════════════════════ */
#confettiCanvas {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .welcome-title { font-size: 1.9rem; }
    .welcome-subtitle { font-size: 0.92rem; }
    .info-cards { gap: 8px; }
    .info-card { padding: 0.75rem 0.8rem; }
    .info-value { font-size: 1.1rem; }
    .info-label { font-size: 0.65rem; }
    .category-tags { gap: 6px; }
    .tag { font-size: 0.72rem; padding: 5px 10px; }
    .question-card { padding: 1.3rem; border-radius: var(--radius-md); }
    .question-text { font-size: 1.02rem; }
    .option-btn { padding: 12px 14px; font-size: 0.9rem; }
    .option-letter { width: 30px; height: 30px; font-size: 0.78rem; }
    .quiz-header { padding: 10px 14px; }
    .header-center { max-width: 160px; }
    .score-display { padding: 5px 10px; font-size: 0.88rem; }
    .result-title { font-size: 1.7rem; }
    .result-stats { gap: 8px; }
    .stat-card { padding: 0.75rem; }
    .stat-num { font-size: 1.3rem; }
}

@media (max-width: 380px) {
    .welcome-title { font-size: 1.6rem; }
    .info-cards { flex-direction: column; align-items: center; }
    .info-card { max-width: 100%; }
    .quiz-body { padding-top: 70px; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 92, 252, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 92, 252, 0.5);
}

/* ─── SELECTION ─── */
::selection {
    background: rgba(124, 92, 252, 0.4);
    color: #fff;
}
