/* ==========================================
   KI & DU - DESIGN SYSTEM & STYLES (VANILLA CSS)
   ========================================== */

/* Local Fonts (GDPR/DSGVO compliant) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-latin-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-latin-700-normal.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-latin-800-normal.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* 1. CSS VARIABLES (Design Tokens) */
:root {
    --bg-dark: #090714;
    --bg-card: rgba(20, 16, 38, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-active: rgba(139, 92, 246, 0.4);
    
    --text-main: #f3f4f6;
    --text-muted: #a1a1aa;
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --primary-grad: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
    
    --secondary: #06b6d4;
    --secondary-grad: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --success-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --danger-grad: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
}

/* 2. BASE RESET & LAYOUT */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.6;
}

/* Ambient Glowing Background Circles */
.glow-bg-1 {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
    z-index: -1;
    pointer-events: none;
    animation: float-slow 15s infinite ease-in-out;
}

.glow-bg-2 {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6,182,212,0.12) 0%, rgba(0,0,0,0) 70%);
    bottom: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
    animation: float-slow-reverse 18s infinite ease-in-out;
}


@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.1); }
}

@keyframes float-slow-reverse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, -50px) scale(0.9); }
}

.container {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin: 20px 0;
}

/* 3. PROGRESS NAV TRACKER */
.progress-nav {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 12px var(--primary-glow);
}

.steps-indicator {
    display: flex;
    justify-content: space-between;
    padding: 0 6px;
}

.step-dot {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.step-dot.active {
    color: var(--secondary);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.step-dot.completed {
    color: var(--primary);
}

/* 4. SECTION ROUTING */
.active-section {
    display: block;
    animation: slide-in 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.hidden-section {
    display: none;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 5. CARD & GLASSMORPHISM DESIGN */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(120deg, #ffffff 30%, #d8b4fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 6. HERO SECTION / START */
.hero-card {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr;
    gap: 40px;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    aspect-ratio: 1;
    background: #120f26;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.hero-card:hover .hero-image {
    transform: scale(1.03);
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 70%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 24px;
}

/* Teacher speech bubble element */
.teacher-speech {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.teacher-avatar {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.speech-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    border-radius: 0 20px 20px 20px;
    font-size: 0.95rem;
    position: relative;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(255, 255, 255, 0.06);
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-grad);
    color: white;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.7);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: var(--border-radius-lg);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 7. QUIZ MODULE (DER KI-DETEKTIV) */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-progress {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.quiz-question-text {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 24px;
    color: white;
}

.quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.quiz-option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 16px;
}

.quiz-option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(6px);
}

.quiz-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.quiz-option-btn:hover:not(:disabled) .quiz-option-letter {
    background: var(--primary);
    color: white;
}

/* Answer status */
.quiz-option-btn.correct {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--success);
    box-shadow: 0 0 15px var(--success-glow);
}

.quiz-option-btn.correct .quiz-option-letter {
    background: var(--success);
    color: white;
}

.quiz-option-btn.incorrect {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger);
    box-shadow: 0 0 15px var(--danger-glow);
}

.quiz-option-btn.incorrect .quiz-option-letter {
    background: var(--danger);
    color: white;
}

/* Shake animation for wrong answers */
.shake {
    animation: shake-anim 0.4s ease-in-out;
}

@keyframes shake-anim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Quiz Feedback Box */
.quiz-feedback-box {
    display: flex;
    gap: 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 24px;
    animation: fade-in 0.4s ease-out;
}

.quiz-feedback-box.correct-feedback {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.feedback-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.feedback-text-wrapper h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.feedback-text-wrapper p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.quiz-controls {
    display: flex;
    justify-content: flex-end;
}

/* 8. SORTING GAME (WAAGE DER ZUKUNFT) */
.game-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-deck-wrapper {
    height: 220px;
    position: relative;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-card {
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease, border-color 0.3s;
    user-select: none;
    position: absolute;
    cursor: grab;
}

.game-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.game-card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.game-card-text {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.5;
    color: white;
}

/* Sorting directions buttons style */
.game-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn-game {
    font-size: 1.05rem;
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background: var(--danger-grad);
    color: white;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
    background: var(--success-grad);
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.btn-emoji {
    font-size: 1.25rem;
}

/* Swipe animations */
.swipe-left {
    transform: translate(-150%, -10px) rotate(-15deg) !important;
    opacity: 0;
}

.swipe-right {
    transform: translate(150%, -10px) rotate(15deg) !important;
    opacity: 0;
}

/* Feedback Overlay */
.game-feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 7, 20, 0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    z-index: 10;
    animation: fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#game-feedback-emoji {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

#game-feedback-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

#game-feedback-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.feedback-hint {
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    opacity: 0.8;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}


/* 9. FLIP CARDS (WAHRHEIT ODER MYTHOS) */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    perspective: 1200px; /* Crucial for 3D flip effect */
}

.flip-card {
    height: 320px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Active flipped class toggled via JS */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: var(--border-radius-md);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
}

.flip-card-front {
    background: rgba(255, 255, 255, 0.03);
    justify-content: center;
    gap: 20px;
}

.flip-card-front h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    color: white;
}

.flip-icon {
    font-size: 3.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.flip-hint {
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flip-card-back {
    transform: rotateY(180deg);
    justify-content: space-between;
}

.flip-card-back.is-myth {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.12) 0%, rgba(9, 7, 20, 0.8) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.flip-card-back.is-fact {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, rgba(9, 7, 20, 0.8) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.flip-card-back.is-disputed {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(9, 7, 20, 0.8) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.flip-card-back h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
}

.flip-card-back.is-myth h3 {
    color: #fca5a5;
}

.flip-card-back.is-fact h3 {
    color: #a7f3d0;
}

.flip-card-back.is-disputed h3 {
    color: #fcd34d;
}


.flip-card-back p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
    overflow-y: auto;
    padding: 0 4px;
}

.flip-hint-back {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.facts-controls {
    display: flex;
    justify-content: center;
}

.facts-controls-wrapper {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.facts-hint {
    font-size: 0.88rem;
    color: var(--secondary);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
    animation: pulse 2s infinite ease-in-out;
    align-self: center;
    text-align: center;
}

@media (min-width: 500px) {
    .facts-hint {
        align-self: flex-end;
        text-align: right;
    }
}

/* 10. POLL / STIMMUNGSBAROMETER */
.poll-container {
    max-width: 650px;
    margin: 0 auto;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.poll-option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    width: 100%;
}

.poll-option-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-glass-active);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.poll-emoji {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.poll-option-details h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.poll-option-details p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Chart results */
.results-heading {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: white;
}

.poll-chart {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 35px;
}

.chart-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-bar-wrapper {
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-excited {
    background: var(--success-grad);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.bar-neutral {
    background: var(--secondary-grad);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.bar-skeptical {
    background: var(--danger-grad);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.chart-percent {
    position: absolute;
    right: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Wrap up content */
.teacher-wrap-up {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 30px;
    animation: fade-in 0.8s ease;
}

.speech-bubble-green {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 16px 20px;
    border-radius: 0 20px 20px 20px;
    font-size: 0.95rem;
    position: relative;
}

.speech-bubble-green::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(16, 185, 129, 0.08);
}

.poll-controls {
    display: flex;
    justify-content: center;
}

/* 11. FOOTER */
footer {
    text-align: center;
    padding: 24px 0 20px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
    font-weight: 500;
    opacity: 0.8;
}

.footer-links a:hover {
    color: var(--secondary);
    opacity: 1;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
}

/* 11.5 INTRO EXPLAIN & TIMELINE STYLES */
.definition-banner {
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.definition-icon {
    font-size: 2.2rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.1);
}

.definition-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-main);
}

.definition-text strong {
    color: var(--secondary);
}

.explain-intro-grid {

    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.learning-comparison {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comparison-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 20px;
    transition: var(--transition-smooth);
}

.comparison-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.comparison-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

.comparison-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.simulator-box {
    background: rgba(20, 16, 38, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simulator-box h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: white;
}

.simulator-instruction {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.simulator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 10px 0;
}

.sim-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
}

.sim-card:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.sim-card.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.sim-card:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.sim-emoji {
    font-size: 2.2rem;
}

.sim-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.simulator-actions {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.sim-feedback-box {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-glass);
}

.sim-loading-bar-wrapper {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.sim-loading-bar {
    height: 100%;
    width: 0%;
    background: var(--secondary-grad);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

#sim-loading-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.sim-result-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin-top: 10px;
    animation: fade-in 0.4s ease;
}

.sim-result-emoji {
    font-size: 2.5rem;
}

.sim-result-card h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: white;
    margin-bottom: 4px;
}

.sim-result-card p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.explain-controls {
    display: flex;
    justify-content: flex-end;
}

/* 10.2 TIMELINE STATION */
.timeline-container {
    max-width: 650px;
    margin: 20px auto 40px auto;
}

.timeline-nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
    padding: 0 20px;
    margin-bottom: 40px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 1;
    transform: translateY(-50%);
    border-radius: 2px;
}

.timeline-node {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    outline: none;
}

.node-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid var(--bg-dark);
    transition: var(--transition-smooth);
}

.node-year {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    transition: var(--transition-smooth);
}

.timeline-node:hover .node-dot {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: scale(1.1);
}

.timeline-node:hover .node-year {
    color: white;
}

.timeline-node.active .node-dot {
    background: var(--secondary);
    box-shadow: 0 0 15px var(--secondary);
    transform: scale(1.3);
}

.timeline-node.active .node-year {
    color: var(--secondary);
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.timeline-detail-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    min-height: 180px;
}

.timeline-detail-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.timeline-detail-icon {
    font-size: 2.2rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.15);
}

.timeline-detail-header h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.timeline-subtitle {
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 500;
}

.timeline-detail-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}

.timeline-controls {
    display: flex;
    justify-content: flex-end;
}

.timeline-controls-wrapper {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.timeline-hint {
    font-size: 0.88rem;
    color: var(--secondary);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
    animation: pulse 2s infinite ease-in-out;
    align-self: center;
    text-align: center;
}

@media (min-width: 500px) {
    .timeline-hint {
        align-self: flex-end;
        text-align: right;
    }
}

.m-text {
    display: none;
}


/* 12. RESPONSIVE DESIGN */
@media (max-width: 600px) {
    .hero-card {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px;
    }
    
    .hero-image-wrapper {
        max-width: 320px;
        margin: 0 auto;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .glass-card {
        padding: 24px;
    }
    
    .facts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .flip-card {
        height: 250px;
    }

    .explain-intro-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Mobile Progress Bar Optimization */
    .step-dot .d-text {
        display: none;
    }
    .step-dot .m-text {
        display: inline;
    }
    .step-dot.active .d-text {
        display: inline;
    }
    .step-dot.active .m-text {
        display: none;
    }
    .steps-indicator {
        gap: 6px;
        justify-content: space-around;
        padding: 0 4px;
    }
    .step-dot {
        font-size: 0.72rem;
    }
}

/* Tablet / iPad Layout optimization */
@media (min-width: 601px) and (max-width: 1024px) {
    .hero-card {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        padding: 30px;
    }
    
    .explain-intro-grid {
        grid-template-columns: 1fr 1.1fr;
        gap: 24px;
    }
    
    .facts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .flip-card {
        height: 280px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .step-dot {
        font-size: 0.7rem;
    }
    
    .game-actions {
        grid-template-columns: 1fr;
    }
    
    .quiz-option-btn {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .simulator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-nav {
        height: 80px;
    }

    .node-year {
        font-size: 0.95rem;
    }
}


/* Utility Animations */
@keyframes fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* 13. MODAL & LIVE MONITOR STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 7, 20, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass-active);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 
                0 0 40px rgba(139, 92, 246, 0.15);
    text-align: center;
    position: relative;
    animation: slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: white;
}

.modal-card h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
}

.modal-instruction {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.qr-code-wrapper {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius-md);
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#qr-canvas {
    display: block;
    width: 200px;
    height: 200px;
}

.qr-url-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    font-family: monospace;
    font-size: 1rem;
    color: var(--secondary);
    word-break: break-all;
    user-select: all;
}

/* Live Poll Indicator & Styles */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.live-dot-glow {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    position: relative;
}

.live-dot-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--success);
    animation: ping 1.5s infinite ease-in-out;
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.intro-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.teacher-dashboard-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

@media (max-width: 480px) {
    .teacher-dashboard-buttons {
        flex-direction: column;
        width: 100%;
    }
}

/* 14. ADMIN LOGIN FORM STYLES */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: white;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    border-color: var(--border-glass-active);
    outline: none;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.login-error {
    color: #fca5a5;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    margin-top: 5px;
}

.w-full {
    width: 100%;
}

/* 15. LEHRER COCKPIT STYLES */
.dashboard-grid {
    display: flex;
    gap: 30px;
    margin: 20px 0 30px 0;
    align-items: stretch;
}

.dashboard-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    padding: 36px 30px; /* Spacious padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px; /* Spacious vertical spacing */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.dashboard-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.panel-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: left;
    line-height: 1.6;
    width: 100%;
    margin-bottom: 10px;
}

.panel-desc.font-accent {
    color: var(--secondary);
}

.qr-code-wrapper-dashboard {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius-md);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin: 10px 0;
}

#qr-canvas-dashboard, #qr-img-dashboard {
    display: block;
    width: 180px;
    height: 180px;
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Spacing between the live-results and reset buttons */
    width: 100%;
}

.dashboard-actions .btn {
    padding: 14px 24px; /* Uniform spacious height */
    font-size: 0.98rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.dashboard-footer-actions {
    width: 100%;
    margin-top: auto; /* Push logout to the bottom of the stretched card */
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-footer-actions .btn {
    padding: 14px 24px;
    font-size: 0.98rem;
}

.dashboard-bottom-controls {
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 24px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        flex-direction: column;
        gap: 20px;
    }
}

