/* ============================================================
   ADULT SPECIAL EDUCATION TEACHER — AAA Photo-Real UI Styles
   happystoner5420 Games
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Roboto:wght@300;400;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #f5c518;
    --gold-dark: #c49a14;
    --red: #c0392b;
    --red-bright: #e74c3c;
    --green: #27ae60;
    --blue: #2980b9;
    --purple: #8e44ad;
    --dark: #0a0a0f;
    --dark2: #12121a;
    --dark3: #1a1a2a;
    --surface: #1e1e2e;
    --surface2: #252535;
    --border: #333355;
    --text: #f0f0ff;
    --muted: #888aaa;
    --chalk: #e8e8f0;
    --chaos-red: #ff2222;
    --font-title: 'Oswald', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--dark);
    font-family: var(--font-body);
    color: var(--text);
    user-select: none;
}

/* ── SCREENS ─────────────────────────────────────────────── */
.screen {
    position: fixed; inset: 0;
    display: none;
    z-index: 10;
}
.screen.active { display: flex; align-items: center; justify-content: center; }

/* Game screen overrides centering — it fills the whole viewport */
#gameScreen.active {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
}

/* ── MAIN MENU ────────────────────────────────────────────── */
.menu-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(80,20,100,0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(20,60,120,0.4) 0%, transparent 60%),
        linear-gradient(160deg, #0a0a18 0%, #0f0f2a 40%, #1a0a1a 100%);
}

/* Classroom blackboard grid pattern */
.menu-bg::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,255,255,0.03) 60px),
        repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.03) 60px);
    pointer-events: none;
}

.menu-overlay {
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.6;
}

.menu-container {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    align-items: center; gap: 32px;
    padding: 40px 20px;
}

.title-block { text-align: center; }

.title-badge {
    font-family: var(--font-title);
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
    opacity: 0.85;
}

.game-title {
    font-family: var(--font-title);
    font-size: clamp(44px, 8vw, 90px);
    font-weight: 700;
    line-height: 1.0;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow:
        0 0 40px rgba(255,255,255,0.1),
        0 4px 8px rgba(0,0,0,0.8),
        0 2px 2px rgba(0,0,0,1);
}

.title-accent {
    color: var(--gold);
    text-shadow:
        0 0 60px rgba(245,197,24,0.6),
        0 0 20px rgba(245,197,24,0.4),
        0 4px 8px rgba(0,0,0,0.8);
}

.title-sub {
    font-family: var(--font-title);
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-top: 10px;
}

.title-warning {
    margin-top: 14px;
    background: linear-gradient(135deg, rgba(192,57,43,0.3), rgba(192,57,43,0.15));
    border: 1px solid rgba(192,57,43,0.6);
    border-radius: 6px;
    padding: 8px 20px;
    font-family: var(--font-title);
    font-size: 12px;
    letter-spacing: 2px;
    color: #ff8888;
}

/* ── MENU BUTTONS ────────────────────────────────────────── */
.menu-buttons {
    display: flex; flex-direction: column;
    gap: 14px; width: 320px;
}

.menu-btn {
    width: 100%;
    padding: 16px 28px;
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none; border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.12s, filter 0.12s;
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
}

.menu-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
    pointer-events: none;
}

.menu-btn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.15); }
.menu-btn:active { transform: translateY(1px) scale(0.98); filter: brightness(0.9); }

.btn-primary {
    background: linear-gradient(135deg, #c49a14, #f5c518, #c49a14);
    color: #1a1000;
    box-shadow: 0 4px 20px rgba(245,197,24,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #1e2a4a, #2a3a6a, #1e2a4a);
    color: #c0d0ff;
    border: 1px solid rgba(100,140,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #6a1010, #c0392b, #6a1010);
    color: #ffcccc;
    box-shadow: 0 4px 15px rgba(192,57,43,0.4);
}

.btn-icon { font-size: 20px; }

/* ── MODAL / SCREEN OVERLAYS ─────────────────────────────── */
.modal-bg {
    position: absolute; inset: 0;
    background: rgba(5,5,15,0.92);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative; z-index: 2;
    background: linear-gradient(160deg, #16162a, #1e1e35);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    width: 90%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
}
.modal-box.large-modal { max-width: 720px; }

.modal-title {
    font-family: var(--font-title);
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(245,197,24,0.4);
}

/* ── HOW TO PLAY ─────────────────────────────────────────── */
.htp-content { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.htp-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    padding: 16px 18px;
}

.htp-section h3 {
    font-family: var(--font-title);
    font-size: 15px;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 10px;
}

.htp-section p, .htp-section li {
    font-size: 14px;
    line-height: 1.7;
    color: #b0b8d0;
}

.htp-section ul { padding-left: 18px; }
.htp-section li { margin-bottom: 4px; }
.htp-section strong { color: var(--text); }

.warning-section { border-left-color: var(--red-bright); }
.warning-section h3 { color: var(--red-bright); }

/* ── CREDITS ─────────────────────────────────────────────── */
.credits-content { text-align: center; margin-bottom: 24px; }

.credits-studio {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--gold);
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(245,197,24,0.5);
}

.credits-tagline {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
    margin: 8px 0 24px;
}

.credits-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.credit-item {
    display: flex; justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
}

.credit-role { font-size: 13px; color: var(--muted); }
.credit-name { font-size: 13px; color: var(--text); font-weight: 700; }

.credits-version {
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
    letter-spacing: 1px;
}

/* ── GAME SCREEN ─────────────────────────────────────────── */
#gameScreen {
    display: none;
    flex-direction: column;
    background:
        linear-gradient(180deg, #0a1a0a 0%, #0f2010 60%, #0a1a0a 100%);
}

#gameScreen.active { display: flex; }

#gameCanvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

#gameUI {
    position: relative; z-index: 5;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
}

/* ── HUD ─────────────────────────────────────────────────── */
#hud {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 100%);
    border-bottom: 1px solid rgba(245,197,24,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.hud-block {
    display: flex; flex-direction: column;
    align-items: center;
    padding: 6px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    min-width: 90px;
}

.hud-label {
    font-family: var(--font-title);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 2px;
}

.hud-value {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(245,197,24,0.5);
}

.chaos-bar-wrap {
    width: 100px; height: 14px;
    background: rgba(255,255,255,0.1);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
    margin-top: 4px;
}

.chaos-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22cc44, #ffcc00, #ff4400);
    border-radius: 7px;
    transition: width 0.4s ease;
}

.hud-menu-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: rgba(192,57,43,0.3);
    border: 1px solid rgba(192,57,43,0.6);
    border-radius: 6px;
    color: #ff9999;
    font-family: var(--font-title);
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
}
.hud-menu-btn:hover { background: rgba(192,57,43,0.6); color: #fff; }

/* ── CLASSROOM AREA ──────────────────────────────────────── */
#classroomArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 16px;
    overflow: hidden;
}

/* Blackboard effect background */
#classroomArea::before {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg,
            rgba(10,40,10,0.95) 0%,
            rgba(15,50,15,0.9) 30%,
            rgba(20,60,20,0.85) 70%,
            rgba(30,50,20,0.9) 100%);
    pointer-events: none;
}

/* Chalkboard at top */
#classroomArea::after {
    content: '';
    position: absolute;
    top: 0; left: 40px; right: 40px;
    height: 120px;
    background: linear-gradient(180deg, #1a3a1a, #0d2a0d);
    border: 4px solid #8a6a40;
    border-radius: 4px;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.6),
        0 4px 20px rgba(0,0,0,0.5),
        inset 2px 2px 8px rgba(255,255,255,0.04);
}

#teacherDesk {
    position: relative; z-index: 10;
    align-self: center;
    margin-top: 130px;
    background: linear-gradient(180deg, #5a3a1a, #3a2210);
    border: 2px solid #8a6a40;
    border-radius: 8px;
    padding: 12px 24px;
    min-width: 380px;
    box-shadow:
        0 6px 20px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.desk-label {
    font-family: var(--font-title);
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(255,220,150,0.7);
    text-align: center;
    margin-bottom: 10px;
}

#teacherActions {
    display: flex; gap: 10px; justify-content: center;
}

.action-btn {
    padding: 10px 18px;
    font-family: var(--font-title);
    font-size: 14px;
    letter-spacing: 1px;
    border: none; border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.12s;
    position: relative;
    overflow: hidden;
}
.action-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
}
.action-btn:hover { transform: translateY(-2px); filter: brightness(1.2); }
.action-btn:active { transform: translateY(1px); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-discipline {
    background: linear-gradient(135deg, #8a0000, #c0392b);
    color: #fff;
    box-shadow: 0 3px 12px rgba(192,57,43,0.4);
}
.btn-star {
    background: linear-gradient(135deg, #9a7800, #f5c518);
    color: #1a1000;
    box-shadow: 0 3px 12px rgba(245,197,24,0.4);
}
.btn-lesson {
    background: linear-gradient(135deg, #0a4a8a, #2980b9);
    color: #fff;
    box-shadow: 0 3px 12px rgba(41,128,185,0.4);
}

/* ── STUDENT GRID ────────────────────────────────────────── */
.student-grid {
    position: relative; z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-content: flex-start;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.student-card {
    position: relative;
    width: 110px;
    background: linear-gradient(180deg, rgba(30,30,50,0.95), rgba(20,20,35,0.98));
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 8px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-align: center;
    overflow: visible;
}

.student-card:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: var(--gold);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 16px rgba(245,197,24,0.3);
    z-index: 20;
}

.student-card.bad {
    border-color: rgba(255,50,50,0.6);
    animation: badShake 0.3s ease;
}

.student-card.good {
    border-color: rgba(50,255,100,0.6);
    box-shadow: 0 0 16px rgba(50,255,100,0.3);
}

.student-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(245,197,24,0.5);
}

@keyframes badShake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-6px) rotate(-2deg); }
    40% { transform: translateX(6px) rotate(2deg); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.student-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    margin: 0 auto 8px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.15);
    background: linear-gradient(135deg, #2a2a3a, #1a1a2a);
    position: relative;
}

.student-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.student-avatar .avatar-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, #2a1a3a, #1a2a3a);
}

.student-name {
    font-family: var(--font-title);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
    text-transform: uppercase;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-mood {
    font-size: 16px;
    margin-bottom: 4px;
}

.student-status-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.student-status-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s, background 0.4s;
}

.student-chaos-badge {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--red-bright);
    color: white;
    font-size: 9px;
    font-family: var(--font-title);
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    letter-spacing: 0.5px;
}

/* ── SPEECH BUBBLES ──────────────────────────────────────── */
#speechLayer {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 30;
}

.speech-bubble {
    position: absolute;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #1a1a1a;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    max-width: 200px;
    line-height: 1.4;
    z-index: 31;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: bubbleIn 0.25s ease, bubbleOut 0.4s ease 2.2s forwards;
    word-wrap: break-word;
    pointer-events: none;
}

.speech-bubble.angry {
    background: linear-gradient(135deg, #ff4444, #ff8888);
    color: white;
    border-color: #cc0000;
}

.speech-bubble.funny {
    background: linear-gradient(135deg, #ffee44, #ffdd00);
    color: #333;
    border-color: #cc8800;
}

.speech-bubble.rude {
    background: linear-gradient(135deg, #cc00cc, #ff44ff);
    color: white;
    border-color: #880088;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: inherit;
    border-top-color: #ffffff;
}

.speech-bubble.angry::after { border-top-color: #ff4444; }
.speech-bubble.funny::after { border-top-color: #ffee44; }
.speech-bubble.rude::after { border-top-color: #cc00cc; }

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

@keyframes bubbleOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.7) translateY(-10px); }
}

/* ── PROJECTILES ─────────────────────────────────────────── */
#projectileLayer {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 25;
    overflow: hidden;
}

.projectile {
    position: absolute;
    font-size: 20px;
    animation: fly linear forwards;
    pointer-events: none;
}

@keyframes fly {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ── QUESTION PANEL ──────────────────────────────────────── */
#questionPanel {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 90%; max-width: 640px;
    background: linear-gradient(160deg, #12122a, #1a1a35);
    border: 1px solid rgba(245,197,24,0.4);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    z-index: 40;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.7);
    transition: transform 0.3s ease;
}

#questionPanel.hidden {
    transform: translateX(-50%) translateY(100%);
}

.panel-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}

.subject-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--font-title);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--gold);
    color: #1a1000;
}

.subject-badge.science { background: #27ae60; color: white; }
.subject-badge.history { background: #8e44ad; color: white; }
.subject-badge.english { background: #2980b9; color: white; }

#questionStudentName {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--muted);
    flex: 1;
}

.panel-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--muted);
    font-size: 16px;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.panel-close:hover { background: rgba(192,57,43,0.4); color: white; }

.question-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--chalk);
    margin-bottom: 18px;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.answer-btn {
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e2a4a, #2a3a6a);
    border: 2px solid rgba(100,140,255,0.25);
    border-radius: 10px;
    color: #c0d0ff;
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
}

.answer-btn:hover {
    background: linear-gradient(135deg, #2a3a6a, #3a50aa);
    border-color: rgba(100,140,255,0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(41,128,185,0.3);
}

.answer-btn.correct {
    background: linear-gradient(135deg, #0a4a1a, #27ae60);
    border-color: #27ae60;
    color: white;
    animation: correctFlash 0.5s ease;
}

.answer-btn.wrong {
    background: linear-gradient(135deg, #4a0a0a, #c0392b);
    border-color: #c0392b;
    color: white;
    animation: wrongShake 0.4s ease;
}

@keyframes correctFlash {
    0% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

@keyframes wrongShake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.feedback {
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-title);
    font-size: 14px;
    letter-spacing: 1px;
    text-align: center;
}

.feedback.correct { background: rgba(39,174,96,0.2); border: 1px solid #27ae60; color: #55ee88; }
.feedback.wrong { background: rgba(192,57,43,0.2); border: 1px solid #c0392b; color: #ff8888; }
.feedback.hidden { display: none; }

/* ── CHAOS BANNER ────────────────────────────────────────── */
.chaos-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(150,0,0,0.95), rgba(50,0,0,0.98));
    border: 3px solid #ff2222;
    border-radius: 16px;
    padding: 20px 40px;
    font-family: var(--font-title);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ff6666;
    text-align: center;
    z-index: 50;
    box-shadow: 0 0 60px rgba(255,0,0,0.4), inset 0 0 30px rgba(0,0,0,0.3);
    animation: chaosAppear 0.3s ease;
    pointer-events: none;
}

.chaos-banner.hidden { display: none; }

@keyframes chaosAppear {
    from { opacity: 0; transform: translate(-50%,-50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* ── OVERLAY MODALS (in-game) ────────────────────────────── */
.overlay-modal {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 60;
    backdrop-filter: blur(4px);
}

.overlay-modal.hidden { display: none; }

.overlay-content {
    background: linear-gradient(160deg, #16162a, #1e1e35);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    display: flex; flex-direction: column;
    gap: 16px;
}

.overlay-title {
    font-family: var(--font-title);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(245,197,24,0.4);
}

.overlay-title.red-title {
    color: var(--red-bright);
    text-shadow: 0 0 20px rgba(231,76,60,0.4);
}

.overlay-title.gold-title {
    color: var(--gold);
    text-shadow: 0 0 30px rgba(245,197,24,0.6);
}

.overlay-body {
    font-size: 15px;
    color: #b0b8d0;
    line-height: 1.7;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

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

.shake {
    animation: badShake 0.3s ease;
}

/* ── FLOATING SCORE TEXT ─────────────────────────────────── */
.float-score {
    position: absolute;
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 700;
    pointer-events: none;
    z-index: 55;
    animation: floatUp 1.4s ease forwards;
}

.float-score.positive { color: #44ff88; text-shadow: 0 0 10px rgba(68,255,136,0.6); }
.float-score.negative { color: #ff4444; text-shadow: 0 0 10px rgba(255,68,68,0.6); }

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    60% { opacity: 1; transform: translateY(-50px) scale(1.1); }
    100% { opacity: 0; transform: translateY(-90px) scale(0.8); }
}

/* ── CHALKBOARD TEXT (top of classroom) ──────────────────── */
#chalkboardText {
    position: absolute;
    top: 10px;
    left: 60px; right: 60px;
    height: 110px;
    z-index: 15;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    color: rgba(220,240,220,0.85);
    text-align: center;
    padding: 8px 20px;
    text-shadow: 0 0 4px rgba(200,240,200,0.3);
    pointer-events: none;
    letter-spacing: 1px;
}

/* ── PERIOD INDICATOR DOTS ───────────────────────────────── */
.period-dots {
    display: flex; gap: 6px; align-items: center;
}
.period-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}
.period-dot.done { background: var(--gold); border-color: var(--gold-dark); }
.period-dot.current { background: #44ff88; border-color: #22cc66; box-shadow: 0 0 8px rgba(68,255,136,0.5); }
