:root { --text-size: 32px; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; }

/* =============================================
   MENU SCREEN — Dark navy with golden accents
   ============================================= */
.menu-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #fbbf24 75%, #fb923c 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    overflow: hidden;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 25%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 0% 75%; }
    100% { background-position: 0% 50%; }
}

.menu-topbar, .hero-section, .menu-footer-row {
    position: relative;
    z-index: 1;
}

/* --- TOP BAR --- */
.menu-topbar {
    text-align: center;
    padding: 2.5rem 2rem 0.5rem;
    flex-shrink: 0;
}

.menu-title {
    font-size: clamp(2.6rem, 5.5vw, 4.2rem);
    font-weight: 900;
    color: white;
    text-shadow: 3px 3px 20px rgba(0,0,0,0.5), 0 0 40px rgba(251,191,36,0.25);
    letter-spacing: -0.02em;
}

.menu-subtitle {
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    margin-top: 0.15rem;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.4);
}

/* --- HERO SECTION — Split Layout --- */
.hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 1.5rem;
    min-height: 0;
    width: 100%;
}

.hero-card {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    max-height: 80vh;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(30,15,60,0.97), rgba(45,27,78,0.95));
    box-shadow:
        0 20px 60px rgba(0,0,0,0.6),
        0 8px 25px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,215,0,0.2);
}

/* Left side: square image */
.hero-image-wrapper {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Right side: title + buttons */
.hero-info-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 3rem;
    gap: 2.5rem;
}

.hero-song-info { text-align: center; }

.hero-song-title {
    font-size: clamp(2.8rem, 5vw, 5rem);
    font-weight: 900;
    color: white;
    text-shadow: 2px 3px 20px rgba(0,0,0,0.5);
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.hero-artist {
    font-size: clamp(1.3rem, 2.2vw, 2rem);
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    margin-top: 0.3rem;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.4);
}

/* --- BUTTONS — stacked vertically --- */
.level-cards {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    width: 100%;
    max-width: 380px;
}

.level-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 2.2rem 3.2rem;
    border-radius: 18px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.45);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.level-card:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(255,255,255,0.7);
}

.level-card:active {
    transform: translateY(0) scale(0.97);
}

/* Beginner — Golden NEON glow */
.beginner-card {
    background: linear-gradient(160deg, rgba(217,119,6,0.88), rgba(245,158,11,0.9), rgba(252,211,77,0.88));
    box-shadow:
        0 12px 40px rgba(245,158,11,0.8),
        0 0 70px rgba(252,211,77,0.5),
        0 0 120px rgba(252,211,77,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
}
.beginner-card:hover {
    box-shadow:
        0 16px 55px rgba(245,158,11,0.95),
        0 0 90px rgba(252,211,77,0.65),
        0 0 150px rgba(252,211,77,0.25),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Advanced — Deep Indigo with NEON glow */
.advanced-card {
    background: linear-gradient(160deg, rgba(79,40,180,0.88), rgba(109,40,217,0.9), rgba(139,92,246,0.88));
    box-shadow:
        0 12px 40px rgba(109,40,217,0.7),
        0 0 70px rgba(139,92,246,0.4),
        0 0 120px rgba(139,92,246,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
}
.advanced-card:hover {
    box-shadow:
        0 16px 55px rgba(109,40,217,0.9),
        0 0 90px rgba(139,92,246,0.55),
        0 0 150px rgba(139,92,246,0.2),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

.card-emoji { font-size: 2.8rem; flex-shrink: 0; }

.card-label {
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 800;
    color: white;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.5);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* --- FOOTER --- */
.menu-footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 2rem 0.7rem;
    flex-shrink: 0;
}

.pdf-link-inline {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(255,255,255,0.2);
    margin-top: 0.5rem;
}
.pdf-link-inline:hover {
    color: white;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
}

.footer-copy {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- MOBILE MENU --- */
@media (max-width: 768px) {
    .menu-topbar { padding: 0.3rem 0.5rem 0; }
    .menu-title { font-size: clamp(1.4rem, 5.5vw, 2.2rem); white-space: nowrap; }
    .menu-subtitle { font-size: clamp(0.7rem, 2.8vw, 0.9rem); white-space: nowrap; }
    .menu-screen { height: 100vh; min-height: 100vh; overflow-y: auto; justify-content: space-evenly; }
    .hero-section { padding: 0 0.5rem; flex: none; }
    .hero-card { flex-direction: column; max-height: none; height: auto; aspect-ratio: auto; }
    .hero-image-wrapper { flex: 0 0 auto; height: auto; aspect-ratio: 16 / 9; width: 100%; }
    .hero-info-side { padding: 1rem 1.2rem; align-items: center; gap: 1.2rem; }
    .hero-song-info { text-align: center; }
    .hero-song-title { font-size: clamp(2rem, 7vw, 3rem); }
    .hero-artist { font-size: clamp(1rem, 4vw, 1.5rem); }
    .level-cards { max-width: 100%; gap: 1.2rem; align-items: center; }
    .level-card { padding: 1.2rem 1.6rem; border-radius: 14px; width: 100%; max-width: 340px; }
    .card-emoji { font-size: 1.8rem; }
    .card-label { font-size: clamp(1.1rem, 4.5vw, 1.4rem); }
    .menu-footer-row { padding: 0.2rem 1rem 0.4rem; }
    .pdf-link-inline { font-size: 0.85rem; padding: 0.4rem 1rem; }
}


/* =============================================
   ACTIVITY SCREEN
   ============================================= */
.activity-screen { display: none; height: 100vh; flex-direction: column; overflow: hidden; transition: background 0.5s ease; background: #1a0a2e; }

/* Beginner = Golden Amber */
.activity-screen.beginner-mode { 
    background: linear-gradient(135deg, #F59E0B, #D97706); 
}
/* Advanced = Deep Indigo */
.activity-screen.advanced-mode { 
    background: linear-gradient(135deg, #4C1D95, #312E81); 
}


/* =============================================
   HEADER
   ============================================= */
.main-header { background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 0.9rem 1.8rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); gap: 1.2rem; flex-shrink: 0; z-index: 10; }
.header-group { display: flex; align-items: center; gap: 1rem; }
.back-btn { background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.5); color: white; padding: 0.7rem 1.5rem; border-radius: 30px; cursor: pointer; font-size: 1.15rem; font-weight: 700; transition: all 0.3s ease; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.back-btn:hover { background: rgba(255,255,255,0.35); transform: translateY(-2px); box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
.song-info { font-size: 1.35rem; font-weight: 700; color: white; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.difficulty-toggle { 
    display: flex; 
    background: rgba(0, 0, 0, 0.35); 
    border-radius: 35px; 
    overflow: hidden; 
    border: 2px solid rgba(255, 255, 255, 0.5); 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 255, 255, 0.1); 
    animation: subtleGlow 3s ease-in-out infinite; 
    position: relative;
}
@keyframes subtleGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(255, 255, 255, 0.2); }
}
.diff-btn { 
    padding: 0.7rem 1.5rem; border: none; background: transparent; 
    color: rgba(255,255,255,0.7); cursor: pointer; font-weight: 700; 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); font-size: 1.1rem; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); position: relative; z-index: 2;
    -webkit-tap-highlight-color: transparent;
}
.diff-btn:hover:not(.active) { background: rgba(255,255,255,0.12); color: white; }
.diff-btn:active { transform: scale(0.95); }
.diff-btn.active { color: white; transform: scale(1); }

/* Beginner active = Gold */
.diff-btn.active.beginner-active { 
    background: linear-gradient(135deg, #D97706, #F59E0B); 
    box-shadow: 0 3px 15px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation: modeSwitch 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Advanced active = Indigo */
.diff-btn.active.advanced-active { 
    background: linear-gradient(145deg, #6D28D9, #4C1D95); 
    box-shadow: 0 3px 15px rgba(109, 40, 217, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation: modeSwitch 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modeSwitch {
    0% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.control-label { font-size: 1.1rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.text-size-label { font-size: 1.2rem; font-weight: 700; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.3); margin-right: 0.3rem; }
.text-size-slider { width: 80px; cursor: pointer; height: 8px; }
.instructions-btn { background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.5); color: white; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; font-weight: bold; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.instructions-btn:hover { background: rgba(255,255,255,0.35); transform: scale(1.1) rotate(15deg); }
.score-board { background: linear-gradient(145deg, #facc15, #f59e0b); color: #422006; padding: 0.6rem 1.5rem; border-radius: 30px; font-size: 1.1rem; font-weight: 700; box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4); }


/* =============================================
   CONTENT AREA
   ============================================= */
.content-area { flex: 1; display: flex; padding: 1.5rem; gap: 1.5rem; overflow: hidden; }
.video-section { flex: 3; display: flex; align-items: center; justify-content: center; min-width: 0; }
.video-container { width: 100%; background: #000; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); aspect-ratio: 16 / 9; position: relative; border: 3px solid rgba(255,255,255,0.1); overflow: hidden; }
.video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }

/* --- LYRICS SECTION --- */
.lyrics-section { flex: 2; background: rgba(255,255,255,0.9); border-radius: 20px; padding: 2rem; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }

.beginner-mode .lyrics-section { 
    background: rgba(255, 251, 235, 0.97); /* Warm amber tint */
}
.advanced-mode .lyrics-section { 
    background: rgba(245, 243, 255, 0.97); /* Pale indigo tint */
}


/* =============================================
   LYRICS LINES
   ============================================= */
.lyrics-line { 
    padding: 1.2rem; 
    margin-bottom: 1.2rem;
    margin-left: 50px;
    max-width: calc(100% - 50px);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border-radius: 15px; 
    border-left: 5px solid; 
    display: flex; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 0.8rem; 
    transition: all 0.4s; 
    font-size: var(--text-size); 
    line-height: 1.7; 
    font-weight: 600;
    overflow: visible;
    position: relative;
}

/* Advanced mode - add right margin for lifeline */
.advanced-mode .lyrics-line {
    margin-right: 50px;
    max-width: calc(100% - 100px);
}

/* Border colors */
.beginner-mode .lyrics-line { border-left-color: #F59E0B; }
.advanced-mode .lyrics-line { border-left-color: #7C3AED; }

/* Active line */
.lyrics-line.active { 
    transform: scale(1.02); 
    border-left-width: 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95) !important;
}
.beginner-mode .lyrics-line.active { 
    box-shadow: 0 10px 35px rgba(245, 158, 11, 0.3);
    border-left: 12px solid #D97706;
}
.advanced-mode .lyrics-line.active {
    box-shadow: 0 10px 35px rgba(124, 58, 237, 0.3);
    border-left: 12px solid #7C3AED;
}


/* =============================================
   WORD-BY-WORD HIGHLIGHTING
   ============================================= */
.lyric-word, .interactive-word { display: inline-block; transition: all 0.2s ease-in-out; border-radius: 6px; }

/* BEGINNER — Golden highlight */
.beginner-mode .lyric-word.highlighted { 
    background-color: #D97706; 
    color: white;
    padding: 0.2em 0.5em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.6);
    transform: scale(1.1);
    font-weight: 700;
}
.beginner-mode .highlighted-interactive { 
    background-color: rgba(245, 158, 11, 0.15); 
    box-shadow: 0 3px 0px 0px #D97706; 
    padding: 0.1em 0.3em;
    border-radius: 6px;
    transform: scale(1.05);
}

/* ADVANCED — Indigo highlight */
.advanced-mode .lyric-word.highlighted {
    background-color: #7C3AED; 
    color: white;
    padding: 0.2em 0.5em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.6);
    transform: scale(1.1);
    font-weight: 700;
}
.advanced-mode .highlighted-interactive {
    background-color: rgba(124, 58, 237, 0.15);
    box-shadow: 0 3px 0px 0px #7C3AED;
    padding: 0.1em 0.3em;
    border-radius: 6px;
    transform: scale(1.05);
}


/* =============================================
   INTERACTIVE ELEMENTS - CHOICE BUTTONS
   ============================================= */
.choice-wrapper { display: inline-flex; gap: 0.8rem; }

.choice-btn { 
    background: linear-gradient(145deg, #FFFBEB, #FEF3C7);
    color: #78350F;
    border: 3px solid #D97706;
    padding: 0.5em 1.2em; 
    border-radius: 30px; 
    cursor: pointer; 
    font-size: inherit; 
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.choice-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4);
    background: linear-gradient(145deg, #FEF3C7, #FDE68A);
    border-color: #B45309;
}
.choice-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
.choice-btn.correct { 
    background: linear-gradient(145deg, #10B981, #059669); 
    color: white; 
    border-color: #059669; 
    animation: correctPulse 0.6s ease; 
}
.choice-btn.incorrect { 
    background: linear-gradient(145deg, #EF4444, #DC2626); 
    color: white; 
    border-color: #DC2626; 
    animation: shake 0.5s ease; 
}

.choice-wrapper:hover,
.word-blank-wrapper:hover {
    transition: transform 0.2s ease;
    transform: translateY(-1px);
}


/* =============================================
   ADVANCED WORD BLANK
   ============================================= */
.word-blank { 
    background: linear-gradient(145deg, #7C3AED, #5B21B6);
    color: white; 
    padding: 0.5em 1.4em; 
    border-radius: 30px; 
    cursor: pointer; 
    font-size: inherit; 
    font-weight: 700; 
    min-width: 100px; 
    text-align: center; 
    border: 2px solid #6D28D9;
    transition: all 0.3s ease;
}
.word-blank:not(.revealed):hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.4);
}
.word-blank.revealed { 
    background: linear-gradient(145deg, #e5e7eb, #d1d5db); 
    color: #1f2937; 
    border-color: #9ca3af; 
    animation: revealPop 0.5s ease; 
    cursor: default; 
}
.word-blank.scored-correct { 
    background: linear-gradient(145deg, #10B981, #059669); 
    color: white; 
    border-color: #059669;
}
.word-blank.scored-incorrect { 
    background: linear-gradient(145deg, #EF4444, #DC2626); 
    color: white; 
    border-color: #DC2626;
}
.word-blank.scored-correct:hover { box-shadow: 0 10px 22px rgba(16, 185, 129, 0.35); }
.word-blank.scored-incorrect:hover { box-shadow: 0 10px 22px rgba(239, 68, 68, 0.35); }

.word-blank-wrapper { display: inline-flex; align-items: center; gap: 0.5rem; }
.score-controls { display: none; gap: 0.3rem; }
.score-controls.visible { display: inline-flex; }
.score-btn { width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.2rem; font-weight: bold; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.score-btn:hover { transform: scale(1.15); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.score-btn.plus { background: #10B981; color: white; }
.score-btn.minus { background: #EF4444; color: white; }


/* =============================================
   REPLAY BUTTON (↺) - LEFT SIDE
   ============================================= */
.replay-btn {
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.6;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 5;
}
.replay-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}
.lyrics-line.active .replay-btn {
    opacity: 1;
}

/* Beginner replay = Gold */
.beginner-mode .replay-btn {
    background: linear-gradient(135deg, #D97706, #F59E0B);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}
.beginner-mode .replay-btn:hover {
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.5);
}

/* Advanced replay = Indigo */
.advanced-mode .replay-btn {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}
.advanced-mode .replay-btn:hover {
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5);
}


/* =============================================
   LIFELINE BUTTON (🛟) - RIGHT SIDE
   ============================================= */
.lifeline-btn {
    position: absolute;
    right: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    z-index: 5;
}
.lifeline-btn:hover {
    transform: translateY(-50%) scale(1.25);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8));
}
.lifeline-btn:active {
    transform: translateY(-50%) scale(1.15);
}

.lyrics-line.active .lifeline-btn {
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

/* Used state */
.lifeline-btn.used {
    opacity: 0.7;
    cursor: default;
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.lifeline-btn.used:hover {
    transform: translateY(-50%) scale(1);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Lifeline tooltip */
.lifeline-btn::after {
    content: 'Lifeline: Show choices (-5 pts)';
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(4px);
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
}
.lifeline-btn::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    right: 10px;
    border: 4px solid transparent;
    border-bottom-color: rgba(30, 41, 59, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}
.lifeline-btn:not(.used):hover::after,
.lifeline-btn:not(.used):hover::before {
    opacity: 1;
    visibility: visible;
}


/* =============================================
   MODAL
   ============================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 1000; animation: modal-fade-in 0.3s ease; }

.modal-content { 
    background: white;
    color: #1e293b; 
    padding: 3.5rem; 
    border-radius: 30px; 
    width: 90%; 
    max-width: 670px; 
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: modal-slide-up 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
}

.instructions-modal h2 { 
    font-size: 2.5rem; 
    margin-bottom: 2rem;
    text-align: center;
    color: #1e293b;
}

.modal-emoji {
    display: inline-block;
    animation: emojiWave 1s ease-in-out infinite;
}

@keyframes emojiWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.instruction-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}
.instruction-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1.4rem;
}

.instruction-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}
.instruction-icon { font-size: 2rem; }
.instruction-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #D97706;
}

.instruction-section p {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}
.instruction-section strong { color: #1e293b; }

.tips-list { list-style: none; padding: 0; margin: 0; }
.tips-list li {
    font-size: 1.4rem;
    color: #475569;
    padding: 0.5rem 0;
    padding-left: 1.8rem;
    position: relative;
}
.tips-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #D97706;
    font-weight: bold;
}

.modal-close-btn { 
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #D97706, #F59E0B); 
    color: white; 
    border: none; 
    padding: 1.3rem 2.5rem; 
    border-radius: 50px; 
    font-size: 1.5rem; 
    font-weight: 700; 
    cursor: pointer; 
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.4);
}
.modal-close-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.5);
}


/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes correctPulse { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.15) rotate(5deg); } 50% { transform: scale(1.1) rotate(-5deg); } 75% { transform: scale(1.12) rotate(3deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 10% { transform: translateX(-8px) rotate(-2deg); } 20% { transform: translateX(8px) rotate(2deg); } 30% { transform: translateX(-6px) rotate(-1deg); } 40% { transform: translateX(6px) rotate(1deg); } 50% { transform: translateX(-4px); } }
@keyframes revealPop { 0% { transform: scale(0.7) rotate(-180deg); opacity: 0; } 50% { transform: scale(1.2) rotate(10deg); } 100% { transform: scale(1) rotate(0deg); opacity: 1; } }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* =============================================
   RESPONSIVE STYLES
   ============================================= */

/* --- TABLET --- */
@media (max-width: 1024px) { 
    .menu-content { grid-template-columns: 1fr; gap: 2rem; padding: 2rem; } 
    .cover-art-wrapper { max-width: 300px; } 
    .content-area { padding: 1rem; gap: 1rem; } 
    .lyrics-section { padding: 1.5rem 1rem; } 
    .main-header { flex-wrap: wrap; row-gap: 0.5rem; } 
    .header-group { gap: 0.5rem; } 
    .header-group.left { order: 1; flex-grow: 1; } 
    .header-group.right { order: 2; } 
    .header-group.center { order: 3; width: 100%; justify-content: center; } 
    .control-label { display: none; }
}

/* --- PORTRAIT TABLETS / STACKED LAYOUT --- */
@media (max-width: 1200px) and (max-aspect-ratio: 1/1) {
    .content-area {
        flex-direction: column;
        height: auto;
        padding-top: 0.3rem;
        gap: 0.3rem;
    }
    .video-section {
        flex: none;
        width: 100%;
        height: 35%; 
        margin-bottom: 0;
    }
    .lyrics-section {
        flex: 1;
        min-height: 0;
    }
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    .content-area { padding: 0.5rem; gap: 0.2rem; overflow-x: hidden; }
    .lyrics-section { padding: 1rem 0.5rem; }
    .menu-screen { padding: 0; }
    .menu-container { height: auto; }
    .main-title { font-size: clamp(2rem, 8vw, 3.5rem); }
    .subtitle { font-size: 1.1rem; }
    .menu-content { padding: 1.5rem; gap: 1.5rem; }
    .level-cards { grid-template-columns: 1fr; }
    .level-card { padding: 1.5rem; }
    .song-title-main { font-size: 2.5rem; }
    .artist-name-main { font-size: 1.5rem; }

    /* ONE-ROW HEADER - FIXED TO TOP */
    .main-header { 
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        flex-wrap: nowrap; 
        justify-content: space-between;
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }
    
    .activity-screen {
        padding-top: 50px;
    }
    .header-group { gap: 0.5rem; }
    .header-group.left { flex-shrink: 0; }
    .header-group.center { 
        flex-grow: 1; 
        justify-content: center;
    }
    .header-group.right { flex-shrink: 0; }
    .song-info { display: none; }
    .back-btn { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
    
    /* ABBREVIATED: MC / Fill */
    .diff-btn { 
        padding: 0.4rem 0.8rem; 
        font-size: 0;
    }
    .diff-btn::after {
        font-size: 0.8rem;
        font-weight: 600;
    }
    .diff-btn[data-difficulty="beginner"]::after {
        content: 'MC';
    }
    .diff-btn[data-difficulty="advanced"]::after {
        content: 'Fill';
    }
    .difficulty-toggle {
        margin: 0 auto;
    }
    
    /* QUESTIONS BUTTON → "Q" */
    .questions-btn {
        padding: 0.3rem 0.7rem;
        margin-left: 0.5rem;
    }
    .questions-text { display: none; }
    .questions-icon { display: none; }
    .questions-btn::after {
        content: 'Q';
        font-size: 0.9rem;
        font-weight: 700;
    }
    
    /* SCORE — Star + Pill style */
    .score-board {
        padding: 0.3rem 0.8rem;
        border-radius: 20px;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.3rem;
        width: auto;
        height: auto;
        background: linear-gradient(145deg, #8b5cf6, #6d28d9);
        color: white;
    }
    .score-board .score-text { 
        display: none; 
    }
    .score-board::before {
        content: '⭐';
        font-size: 0.9rem;
    }
    .score-value { font-size: 0.95rem; color: white; }
    
    /* Hide ? button on mobile */
    .instructions-btn { display: none; }
    .text-size-slider, .text-size-label { display: none; }
    .control-label { display: none; }
    
    /* ===== BUTTONS STACKED ON LEFT ===== */
    .lyrics-line { 
        font-size: var(--text-size, 24px); line-height: 1.6; 
        padding: 0.8rem 0.6rem;
        margin-left: 36px;
        margin-right: 0;
        max-width: calc(100% - 36px);
        gap: 0.4rem;
        position: relative;
    }
    
    /* Replay button */
    .replay-btn {
        position: absolute;
        left: -38px;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    .replay-btn:hover {
        transform: translateY(-50%) scale(1.1);
    }
    .replay-btn::after,
    .replay-btn::before {
        display: none;
    }
    
    /* Lifeline button - below replay in advanced mode */
    .lifeline-btn {
        position: absolute;
        left: -38px;
        right: auto;
        top: calc(50% + 18px);
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
    .lifeline-btn:hover {
        transform: translateY(-50%) scale(1.15);
    }
    .lifeline-btn::after,
    .lifeline-btn::before {
        display: none;
    }
    
    /* Advanced mode - move replay UP to make room */
    .advanced-mode .replay-btn {
        top: calc(50% - 18px);
    }
    .advanced-mode .lyrics-line {
        margin-right: 0;
        max-width: calc(100% - 36px);
    }
    
    .choice-btn { 
        padding: 0.3em 0.7em; 
        font-size: 0.85em;
        max-width: 100%;
        box-sizing: border-box;
    }
}
/* --- END: RESPONSIVE STYLES --- */


/* =============================================
   QUESTIONS FEATURE
   ============================================= */
.questions-btn {
    background: linear-gradient(145deg, #8b5cf6, #6d28d9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}
.questions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}
.questions-btn:active {
    transform: translateY(0);
}
.questions-btn.active {
    background: linear-gradient(145deg, #6d28d9, #5b21b6);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}
.questions-icon {
    font-size: 1.2rem;
}

.questions-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.questions-panel.open {
    transform: translateX(0);
}

.questions-header {
    background: linear-gradient(145deg, #8b5cf6, #6d28d9);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.questions-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.close-panel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.questions-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.question-item {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #8b5cf6;
    transition: all 0.3s ease;
}
.question-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}

.question-number {
    display: inline-block;
    background: linear-gradient(145deg, #8b5cf6, #6d28d9);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 0.8rem;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.reveal-answer-btn {
    background: linear-gradient(145deg, #10b981, #059669);
    border: none;
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.reveal-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}
.reveal-answer-btn.revealed {
    background: linear-gradient(145deg, #6b7280, #4b5563);
}

.reveal-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}
.reveal-answer-btn.revealed .reveal-icon {
    transform: rotate(180deg);
}

.answer-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin-top 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}
.answer-container.visible {
    max-height: 800px;
    margin-top: 1rem;
    opacity: 1;
}

.model-answer {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-left: 4px solid #10b981;
    padding: 1.5rem;
    border-radius: 10px;
    font-size: 1.4rem;
    line-height: 2;
    color: #1f2937;
}


/* =============================================
   QUESTIONS NOTIFICATION
   ============================================= */
.questions-notification {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #8b5cf6, #6d28d9);
    color: white;
    border-radius: 50px;
    padding: 1rem 2rem;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.5);
    z-index: 90;
    transition: bottom 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.questions-notification.show {
    bottom: 2rem;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.notification-icon {
    font-size: 1.8rem;
    animation: bounce-notification 1s ease-in-out infinite;
}
@keyframes bounce-notification {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.notification-text {
    font-size: 1.1rem;
    font-weight: 600;
}
.notification-btn {
    background: white;
    color: #8b5cf6;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
}
.notification-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}
.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}


/* =============================================
   MOBILE QUESTIONS PANEL OVERRIDE
   ============================================= */
@media (max-width: 768px) {
    .questions-panel {
        width: 100%;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        height: auto;
        max-height: 90vh;
        border-radius: 0 0 20px 20px;
        z-index: 200;
        transform: translateY(-100%);
        visibility: hidden;
    }
    .questions-panel.open {
        transform: translateY(0);
        visibility: visible;
    }
    .questions-header { padding: 0.8rem 1rem; }
    .questions-header h2 { font-size: 1.1rem; }
    .close-panel-btn { width: 36px; height: 36px; font-size: 1.2rem; flex-shrink: 0; }
    .questions-content { padding: 1rem; max-height: 70vh; overflow-y: auto; }
    .question-item { padding: 1rem; margin-bottom: 1rem; }
    .question-text { font-size: 0.95rem; line-height: 1.4; margin-bottom: 0.8rem; }
    .model-answer { font-size: 0.9rem; line-height: 1.5; padding: 1rem; }
    .reveal-answer-btn { font-size: 0.9rem; padding: 0.7rem 1.2rem; }
    .question-number { width: 28px; height: 28px; line-height: 28px; font-size: 0.9rem; margin-right: 0.6rem; }
}
