/* ===== ROOT & VARIABLES ===== */
:root {
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --primary-dark: #5A52E0;
    --secondary: #FF6B9D;
    --accent-yellow: #FFD93D;
    --accent-green: #6BCB77;
    --accent-blue: #4D96FF;
    --accent-orange: #FF8C32;
    --accent-purple: #B983FF;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: #F0F0FF;
    --bg-card: #FFFFFF;
    --text-dark: #2D3436;
    --text-medium: #636E72;
    --text-light: #B2BEC3;
    --shadow: 0 8px 32px rgba(0,0,0,0.1);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.15);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --font: 'Nunito', 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCREEN MANAGEMENT ===== */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.4s ease;
}
.screen.active { display: flex; }

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

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

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-15px) rotate(5deg); }
    66% { transform: translateY(-8px) rotate(-3deg); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108,99,255,0.4);
    padding: 12px 28px;
    font-size: 1rem;
}
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 6px 20px rgba(108,99,255,0.5); }

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 24px;
    font-size: 0.95rem;
}
.btn-secondary:hover { background: var(--primary); color: white; }

.btn-lg { padding: 16px 40px; font-size: 1.2rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }

.btn-back {
    background: none;
    border: none;
    color: var(--primary);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
}
.btn-back:hover { color: var(--primary-dark); transform: translateX(-3px); }

.pulse-btn { animation: pulse 2s ease-in-out infinite; }

.hidden { display: none !important; }

/* ===== WELCOME SCREEN ===== */
#screen-welcome {
    background: var(--bg-gradient);
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.welcome-container {
    text-align: center;
    z-index: 1;
    padding: 20px;
    width: 100%;
    max-width: 600px;
}

.floating-emojis {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.float-emoji {
    position: absolute;
    font-size: 2.5rem;
    left: var(--x);
    animation: float 4s ease-in-out infinite;
    animation-delay: var(--delay);
    top: 20%;
    opacity: 0.6;
}

.welcome-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.6s ease;
}

.welcome-mascot { font-size: 5rem; margin-bottom: 16px; }
.welcome-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.welcome-subtitle {
    font-size: 1.3rem;
    color: var(--accent-orange);
    font-weight: 700;
    margin-bottom: 12px;
}
.welcome-desc {
    color: var(--text-medium);
    font-size: 1rem;
    margin-bottom: 32px;
    line-height: 1.6;
}
.welcome-card .btn { display: block; width: 100%; margin-bottom: 12px; }

/* ===== REGISTRATION SCREEN ===== */
#screen-register {
    background: var(--bg-light);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.register-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.register-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    text-align: center;
    animation: slideUp 0.4s ease;
}
.register-icon { font-size: 3.5rem; margin-bottom: 8px; }
.register-card h2 { font-size: 1.8rem; margin-bottom: 24px; color: var(--primary); }

.form-group {
    text-align: left;
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text-dark);
}
.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 1rem;
    transition: var(--transition);
    background: #FAFAFA;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(108,99,255,0.1);
}
.register-card .btn { width: 100%; margin-top: 8px; }

.age-info {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideUp 0.3s ease;
}
.age-info.valid { background: #E8F5E9; color: #2E7D32; }
.age-info.warning { background: #FFF3E0; color: #E65100; }
.age-info.error { background: #FFEBEE; color: #C62828; }

/* ===== LEVEL SELECT SCREEN ===== */
#screen-level-select {
    background: var(--bg-light);
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    max-height: 100vh;
}

.level-container { width: 100%; max-width: 900px; }

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 16px 0 20px;
}

.recommendation {
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 24px;
    animation: slideUp 0.3s ease;
}

.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.level-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}
.level-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.level-card.recommended {
    border-color: var(--accent-green);
    box-shadow: 0 4px 20px rgba(107,203,119,0.3);
}
.level-card.recommended::after {
    content: "Direkomendasikan!";
    position: absolute;
    top: 12px;
    right: -30px;
    background: var(--accent-green);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 36px;
    transform: rotate(35deg);
}

.level-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.level-1 .level-badge { background: var(--accent-green); }
.level-2 .level-badge { background: var(--accent-blue); }
.level-3 .level-badge { background: var(--accent-purple); }

.level-emoji { font-size: 3.5rem; margin-bottom: 8px; }
.level-card h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.level-card p { color: var(--text-medium); font-size: 0.9rem; margin-bottom: 8px; }
.level-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 8px 0;
    border-top: 1px solid #F0F0F0;
}

.level-sessions {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.session-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E0E0E0;
}
.session-dot.completed { background: var(--accent-green); }

/* ===== SESSION SELECT SCREEN ===== */
#screen-session-select {
    background: var(--bg-light);
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.session-container { width: 100%; max-width: 700px; }
.session-info {
    text-align: center;
    color: var(--text-medium);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.session-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.session-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 3px solid transparent;
}
.session-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.session-card.completed-session {
    background: #F0FFF0;
    border-color: var(--accent-green);
}
.session-card.completed-session .session-status { color: var(--accent-green); }

.session-card .session-icon { font-size: 2.5rem; margin-bottom: 8px; }
.session-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.session-card .session-desc { font-size: 0.85rem; color: var(--text-medium); margin-bottom: 8px; }
.session-card .session-status {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
}

/* ===== GAME SCREEN ===== */
#screen-game {
    background: linear-gradient(180deg, #F0F0FF 0%, #E8E8FF 100%);
    flex-direction: column;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 16px;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.game-info {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
}
.game-info span:first-child { font-weight: 800; color: var(--primary); }
.game-info span:last-child { color: var(--text-light); font-size: 0.75rem; }

.game-progress { flex: 1; max-width: 200px; text-align: center; }
.progress-bar {
    height: 8px;
    background: #E8E8E8;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 4px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 10%;
}
#progress-text { font-size: 0.75rem; color: var(--text-medium); font-weight: 700; }

/* Voice Controls */
.voice-controls { display: flex; align-items: center; }
.voice-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #E8E8FF;
    background: #F8F8FF;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-toggle-btn:hover { background: #E8E8FF; transform: scale(1.1); }
.voice-toggle-btn.speaking {
    border-color: var(--accent-green);
    background: #E8F5E9;
    animation: pulse 1s ease infinite;
}

.category-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.voice-replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F0F0FF;
    border: 2px solid #E0E0FF;
    border-radius: 50px;
    padding: 4px 14px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}
.voice-replay-btn:hover { background: #E0E0FF; transform: scale(1.05); }

.game-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FFF3E0;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 800;
    color: var(--accent-orange);
    font-size: 1.1rem;
}
.game-timer.warning { background: #FFEBEE; color: #E53935; animation: pulse 0.5s ease infinite; }
.timer-icon { font-size: 0.9rem; }

.game-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    overflow-y: auto;
    padding: 10px 0;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.question-area {
    background: white;
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.3s ease;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.5;
}

.visual-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.visual-item {
    font-size: 2.5rem;
    padding: 8px 12px;
    background: #F8F8FF;
    border-radius: var(--radius-xs);
    min-width: 50px;
    text-align: center;
    transition: var(--transition);
}
.visual-item.mystery {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: white;
    font-size: 2rem;
    font-weight: 900;
    animation: pulse 1.5s ease infinite;
}

.visual-grid {
    display: grid;
    gap: 8px;
    justify-items: center;
    align-items: center;
    margin: 16px auto;
}
.visual-grid.grid-3x3 { grid-template-columns: repeat(3, 1fr); }
.visual-grid.grid-2x2 { grid-template-columns: repeat(2, 1fr); }

.visual-grid .grid-cell {
    font-size: 2rem;
    padding: 10px;
    background: #F8F8FF;
    border-radius: var(--radius-xs);
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.visual-grid .grid-cell.mystery {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: white;
    font-weight: 900;
    animation: pulse 1.5s ease infinite;
}

.visual-arrow {
    font-size: 1.5rem;
    color: var(--text-light);
}

.number-sequence {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.number-sequence .num-item {
    font-size: 1.8rem;
    font-weight: 800;
    padding: 8px 16px;
    background: var(--accent-blue);
    color: white;
    border-radius: var(--radius-xs);
    min-width: 50px;
    text-align: center;
}
.number-sequence .num-item.mystery {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    animation: pulse 1.5s ease infinite;
}
.number-sequence .num-sep {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 700;
}

.options-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}
.options-area.single-col { grid-template-columns: 1fr; }

.option-btn {
    background: white;
    border: 3px solid #E8E8FF;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 60px;
    text-align: center;
}
.option-btn:hover {
    border-color: var(--primary);
    background: #F8F8FF;
    transform: translateY(-2px);
}
.option-btn:active { transform: translateY(0); }
.option-btn.selected {
    border-color: var(--primary);
    background: #F0F0FF;
}
.option-btn.correct {
    border-color: var(--accent-green);
    background: #E8F5E9;
    color: #2E7D32;
    animation: bounceIn 0.3s ease;
}
.option-btn.wrong {
    border-color: #E53935;
    background: #FFEBEE;
    color: #C62828;
}
.option-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.option-label {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 800;
}

.game-footer {
    text-align: center;
    padding: 10px 0;
}
.score-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}
.feedback-content {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.3s ease;
}
.feedback-icon { font-size: 4rem; margin-bottom: 12px; }
.feedback-text { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.feedback-explanation {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Memory Overlay */
.memory-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(108,99,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}
.memory-content {
    text-align: center;
    color: white;
}
.memory-content h3 { font-size: 1.5rem; margin-bottom: 24px; }
.memory-items {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.memory-item {
    font-size: 3rem;
    background: rgba(255,255,255,0.2);
    padding: 16px;
    border-radius: var(--radius-sm);
    animation: bounceIn 0.3s ease;
    min-width: 70px;
}
.memory-timer-display {
    font-size: 3rem;
    font-weight: 900;
}

/* ===== RESULTS SCREEN ===== */
#screen-results {
    background: var(--bg-gradient);
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 100vh;
}

.results-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    z-index: 1;
}

.results-celebration {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-in forwards;
}

.results-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.5s ease;
}
.results-mascot { font-size: 4rem; margin-bottom: 8px; }
.results-card h2 { font-size: 1.8rem; color: var(--primary); margin-bottom: 4px; }
.result-subtitle { color: var(--text-medium); margin-bottom: 24px; }

.iq-display { margin-bottom: 24px; }
.iq-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--bg-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 8px 30px rgba(108,99,255,0.4);
    animation: countUp 0.5s ease 0.3s both;
}
.iq-number {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    line-height: 1;
}
.iq-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    font-weight: 700;
}
.iq-category {
    font-size: 1.2rem;
    font-weight: 800;
    padding: 6px 20px;
    border-radius: 50px;
    display: inline-block;
}

.category-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 24px 0;
}
.cat-score-item {
    background: #F8F8FF;
    border-radius: var(--radius-xs);
    padding: 12px;
    text-align: center;
}
.cat-score-icon { font-size: 1.5rem; }
.cat-score-label { font-size: 0.75rem; color: var(--text-medium); font-weight: 600; }
.cat-score-value { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.cat-score-bar {
    height: 4px;
    background: #E0E0E0;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}
.cat-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== REPORT SCREEN ===== */
#screen-report {
    background: white;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
}

.report-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.report-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.report-content {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.report-header {
    background: var(--bg-gradient);
    color: white;
    padding: 32px;
    text-align: center;
}
.report-header h1 { font-size: 1.6rem; margin-bottom: 4px; }
.report-header p { opacity: 0.9; font-size: 0.9rem; }
.report-logo { font-size: 2.5rem; margin-bottom: 8px; }

.report-section {
    padding: 24px 32px;
    border-bottom: 1px solid #F0F0F0;
}
.report-section:last-child { border-bottom: none; }
.report-section h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.report-info-item {
    padding: 12px;
    background: #F8F8FF;
    border-radius: var(--radius-xs);
}
.report-info-label { font-size: 0.8rem; color: var(--text-medium); }
.report-info-value { font-size: 1rem; font-weight: 700; }

.report-iq-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.report-iq-badge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.report-iq-badge .iq-num { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.report-iq-badge .iq-lbl { font-size: 0.65rem; opacity: 0.8; }
.report-iq-details { flex: 1; }
.report-iq-details h4 { font-size: 1.1rem; margin-bottom: 4px; }
.report-iq-details p { font-size: 0.9rem; color: var(--text-medium); line-height: 1.5; }

.report-category-bars { margin-top: 8px; }
.report-cat-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.report-cat-bar .bar-label {
    width: 150px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.report-cat-bar .bar-track {
    flex: 1;
    height: 16px;
    background: #F0F0F0;
    border-radius: 10px;
    overflow: hidden;
}
.report-cat-bar .bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
    min-width: 5%;
}
.report-cat-bar .bar-value {
    width: 50px;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.report-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.report-details-table th {
    text-align: left;
    padding: 10px 12px;
    background: #F8F8FF;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 2px solid #E0E0E0;
}
.report-details-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #F0F0F0;
    vertical-align: middle;
}
.report-details-table tr:hover td { background: #FAFAFE; }
.td-correct { color: var(--accent-green); font-weight: 700; }
.td-wrong { color: #E53935; font-weight: 700; }
.td-time { color: var(--text-medium); }

.report-recommendation {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 8px;
}
.report-recommendation h4 {
    color: #2E7D32;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.report-recommendation ul {
    list-style: none;
    padding: 0;
}
.report-recommendation li {
    padding: 4px 0;
    font-size: 0.9rem;
    color: #2E7D32;
}
.report-recommendation li::before { content: "✅ "; }

.report-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ===== HISTORY SCREEN ===== */
#screen-history {
    background: var(--bg-light);
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    max-height: 100vh;
}

.history-container { width: 100%; max-width: 700px; }

.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}
.history-item:hover { transform: translateX(4px); box-shadow: var(--shadow); }

.history-iq {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.history-info { flex: 1; }
.history-info h4 { font-size: 1rem; margin-bottom: 2px; }
.history-info p { font-size: 0.8rem; color: var(--text-medium); }
.history-meta {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
}
.history-meta .history-date { font-weight: 600; }

.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
}
.empty-icon { font-size: 4rem; margin-bottom: 12px; }

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.3s ease;
    padding: 24px;
}
.modal-close {
    position: sticky;
    top: 0;
    text-align: right;
}
.modal-close button {
    background: #F0F0F0;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 700;
    transition: var(--transition);
}
.modal-close button:hover { background: #E0E0E0; }

/* ===== LOCKED / FREEMIUM STYLES ===== */
.locked-session {
    opacity: 0.55;
    position: relative;
    cursor: pointer;
}
.locked-session::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.4);
    border-radius: var(--radius);
    pointer-events: none;
}

.level-card.locked-level {
    opacity: 0.5;
    position: relative;
}
.level-card.locked-level::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 2;
}

.report-locked-section {
    position: relative;
}
.report-locked-section .report-locked-blur {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}
.report-locked-section .locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-sm);
    z-index: 5;
    padding: 24px;
    text-align: center;
}
.locked-overlay .lock-icon { font-size: 2.5rem; margin-bottom: 8px; }
.locked-overlay h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 6px; }
.locked-overlay p { font-size: 0.85rem; color: var(--text-medium); margin-bottom: 14px; }

.upgrade-modal { text-align: center; max-width: 420px; }

/* ===== PRINT STYLES ===== */
@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .screen { display: block !important; min-height: auto; }
    .report-content {
        box-shadow: none;
        border: 1px solid #E0E0E0;
    }
    .report-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .bar-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .welcome-card { padding: 32px 24px; }
    .welcome-title { font-size: 2rem; }
    .welcome-mascot { font-size: 4rem; }

    .level-cards { grid-template-columns: 1fr; }
    .session-cards { grid-template-columns: 1fr; }

    .game-header { padding: 8px 12px; }
    .question-area { padding: 20px 16px; }
    .visual-item { font-size: 2rem; padding: 6px 8px; }
    .options-area { grid-template-columns: 1fr; }
    .option-btn { padding: 14px; }

    .report-section { padding: 20px 16px; }
    .report-info-grid { grid-template-columns: 1fr; }
    .report-iq-summary { flex-direction: column; text-align: center; }
    .report-cat-bar { flex-direction: column; align-items: flex-start; }
    .report-cat-bar .bar-label { width: auto; }
    .report-cat-bar .bar-track { width: 100%; }
    .category-scores { grid-template-columns: repeat(2, 1fr); }
}
