/* ═══ KLE Player V4 — Robocar Poli Light Mode ═══ */
:root {
    /* Robocar Poli Primary Colors */
    --primary: #4A90D9;
    /* Poli Blue */
    --primary-light: #7AB5F5;
    --primary-dark: #2D6CB5;
    --accent-red: #E84545;
    /* Roy Red */
    --accent-green: #4CAF50;
    /* Helly Green */
    --accent-yellow: #FFB300;
    /* Amber Yellow */
    --accent-blue: #4A90D9;
    --accent-orange: #FF8F00;
    --accent-pink: #F06292;
    --accent-cyan: #26C6DA;
    --accent-purple: #7E57C2;

    /* Light Backgrounds */
    --bg: #F0F4FF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #E8EEFF;
    --bg-glass: rgba(255, 255, 255, 0.9);

    /* Text */
    --text: #2D3748;
    --text-dim: #718096;
    --text-dark: #1A202C;

    /* Layout */
    --radius: 24px;
    --radius-sm: 14px;
    --shadow: 0 4px 20px rgba(74, 144, 217, 0.15);
    --shadow-glow: 0 4px 30px rgba(74, 144, 217, 0.2);

    /* Fonts */
    --font-heading: 'Nunito', 'Baloo 2', sans-serif;
    --font-body: 'Nunito', 'Baloo 2', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 80%, rgba(74, 144, 217, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(240, 98, 146, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(76, 175, 80, 0.04) 0%, transparent 50%);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-user-select: none;
    user-select: none;
}

/* ═══ Screens ═══ */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    animation: screenIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
    display: flex;
}

@keyframes screenIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══ Confetti Canvas ═══ */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    display: none;
}

/* ═══ Splash Screen ═══ */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 20px;
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #E3F2FD 0%, #F0F4FF 30%, #FFF3E0 100%);
}

.splash-icon {
    font-size: 100px;
    animation: bounceFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.5));
}

@keyframes bounceFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-15px) rotate(3deg);
    }
}

.splash-content h1 {
    font-family: var(--font-heading);
    font-size: 56px;
    background: linear-gradient(135deg, #4A90D9, #E84545, #FFB300);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(74, 144, 217, 0.3));
}

.splash-content p {
    font-size: 22px;
    color: var(--text-dim);
    font-weight: 500;
}

.btn-start {
    font-family: var(--font-heading);
    font-size: 24px;
    padding: 18px 48px;
    border: none;
    border-radius: 60px;
    background: linear-gradient(135deg, #4A90D9, #26C6DA);
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(74, 144, 217, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
    letter-spacing: 1px;
}

.btn-start:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 40px rgba(74, 144, 217, 0.5);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 30px rgba(74, 144, 217, 0.4);
    }

    50% {
        box-shadow: 0 8px 50px rgba(74, 144, 217, 0.6), 0 0 20px rgba(240, 98, 146, 0.3);
    }
}

/* ═══ Menu ═══ */
.menu-header {
    padding: 24px 24px 8px;
    text-align: center;
}

.menu-header h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    background: linear-gradient(135deg, #4A90D9, #2D6CB5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 16px;
}

.month-selector select {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(74, 144, 217, 0.3);
    background: white;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.month-selector select:focus {
    border-color: var(--primary-light);
    outline: none;
}

/* ═══ Menu Grid — 3D Card Tiles ═══ */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
}

.menu-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    overflow: hidden;
}

/* Each card has its own gradient accent */
.menu-card:nth-child(1) {
    background: linear-gradient(145deg, rgba(74, 144, 217, 0.25), rgba(255, 255, 255, 0.9));
    border-color: rgba(74, 144, 217, 0.3);
}

.menu-card:nth-child(2) {
    background: linear-gradient(145deg, rgba(240, 98, 146, 0.25), rgba(255, 255, 255, 0.9));
    border-color: rgba(240, 98, 146, 0.3);
}

.menu-card:nth-child(3) {
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.25), rgba(255, 255, 255, 0.9));
    border-color: rgba(251, 191, 36, 0.3);
}

.menu-card:nth-child(4) {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.25), rgba(255, 255, 255, 0.9));
    border-color: rgba(16, 185, 129, 0.3);
}

.menu-card:nth-child(5) {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(255, 255, 255, 0.9));
    border-color: rgba(59, 130, 246, 0.3);
}

.menu-card:nth-child(6) {
    background: linear-gradient(145deg, rgba(249, 115, 22, 0.25), rgba(255, 255, 255, 0.9));
    border-color: rgba(249, 115, 22, 0.3);
}

.menu-card:hover,
.menu-card:focus {
    transform: scale(1.05) translateY(-4px);
    box-shadow: 0 12px 40px rgba(74, 144, 217, 0.3);
}

.menu-card:active {
    transform: scale(0.97);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.menu-card:hover .card-icon {
    transform: scale(1.2) rotate(5deg);
    animation: wobble 0.5s ease;
}

@keyframes wobble {
    0% {
        transform: scale(1.2) rotate(0);
    }

    25% {
        transform: scale(1.2) rotate(8deg);
    }

    75% {
        transform: scale(1.2) rotate(-5deg);
    }

    100% {
        transform: scale(1.2) rotate(5deg);
    }
}

.card-title {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

.card-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-yellow);
}

.menu-hint {
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: var(--text-dim);
}

.menu-hint kbd {
    background: rgba(74, 144, 217, 0.3);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 700;
}

/* ═══ Screen Headers ═══ */
.screen-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(240, 244, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(74, 144, 217, 0.2);
}

.screen-header h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    flex: 1;
}

.btn-back {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    padding: 8px 16px;
    border: 2px solid rgba(74, 144, 217, 0.4);
    border-radius: var(--radius-sm);
    background: #F0F4FF;
    color: var(--primary-light);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ═══ Video / Audio Lists ═══ */
.media-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.video-item,
.audio-item,
.pdf-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid transparent;
}

.video-item:hover,
.audio-item:hover,
.pdf-item:hover {
    transform: translateX(6px) scale(1.01);
    border-color: rgba(74, 144, 217, 0.3);
    background: var(--bg-card-hover);
}

.video-item.watched,
.audio-item.watched {
    opacity: 0.6;
    border-color: rgba(16, 185, 129, 0.3);
}

.item-number {
    font-family: var(--font-heading);
    font-size: 22px;
    min-width: 36px;
    text-align: center;
    color: var(--primary-light);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.item-status {
    font-size: 20px;
    min-width: 28px;
    text-align: center;
}

/* ═══ Video Player ═══ */
#video-player {
    overflow: hidden;
}

#video-player video {
    flex: 1;
    width: 100%;
    min-height: 0;
    max-height: calc(100vh - 70px);
    object-fit: contain;
    background: #000;
    border-radius: 0;
}

.player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 16px;
    background: #F0F4FF;
}

.player-container video {
    width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.now-playing {
    font-family: var(--font-heading);
    font-size: 18px;
    text-align: center;
    color: var(--accent-yellow);
}

.player-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.player-controls button {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.player-controls button:hover {
    background: var(--primary);
    transform: scale(1.05);
}

/* ═══ Audio Bar ═══ */
.audio-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.3), rgba(240, 98, 146, 0.2));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(74, 144, 217, 0.3);
}

.audio-bar .now-playing {
    flex: 1;
    font-size: 14px;
    text-align: left;
    color: var(--text);
}

/* ═══ Flashcard ═══ */
.flashcard-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 24px;
}

.flashcard-container {
    perspective: 1200px;
    width: 320px;
    height: 400px;
}

.flashcard-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.flashcard-card.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    gap: 12px;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.flashcard-front {
    background: linear-gradient(145deg, #4A90D9, #2D6CB5);
    box-shadow: 0 20px 60px rgba(74, 144, 217, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.flashcard-back {
    background: linear-gradient(145deg, #E84545, #C62828);
    box-shadow: 0 20px 60px rgba(240, 98, 146, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: rotateY(180deg);
}

.flashcard-emoji {
    font-size: 100px;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
    animation: emojiFloat 3s ease-in-out infinite;
}

@keyframes emojiFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.05);
    }
}

.flashcard-word {
    font-family: var(--font-heading);
    font-size: 36px;
    text-align: center;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.flashcard-word-vi {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
}

.flashcard-counter {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-dim);
}

.flashcard-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.flashcard-actions button {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-flip {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: white;
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.3);
}

.btn-flip:hover {
    transform: scale(1.08);
}

.btn-know {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-know:hover {
    transform: scale(1.08);
}

.btn-speak {
    background: linear-gradient(135deg, var(--accent-orange), #DC2626);
    color: white;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
}

.btn-speak:hover {
    transform: scale(1.08);
}

.btn-nav {
    background: var(--bg-card);
    color: var(--text);
    border: 2px solid rgba(74, 144, 217, 0.3) !important;
}

.btn-nav:hover {
    background: var(--primary);
    border-color: var(--primary) !important;
}

/* ═══ PDF Viewer ═══ */
.pdf-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    background: radial-gradient(circle at center, rgba(74, 144, 217, 0.05) 0%, transparent 70%);
    overflow: auto;
}

.pdf-container canvas {
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    max-width: 100%;
}

.pdf-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: rgba(240, 244, 255, 0.8);
    backdrop-filter: blur(10px);
}

.pdf-nav button {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 700;
    padding: 10px 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.pdf-nav button:hover {
    transform: scale(1.08);
    background: var(--primary-light);
}

.pdf-page-info {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--accent-yellow);
    min-width: 80px;
    text-align: center;
}

/* ═══ Quiz ═══ */
.quiz-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 20px;
}

.quiz-emoji {
    font-size: 100px;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
    animation: emojiFloat 2.5s ease-in-out infinite;
}

.quiz-prompt {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--accent-yellow);
    text-align: center;
}

.quiz-score {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--accent-orange);
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 420px;
}

.quiz-option {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 700;
    padding: 16px 20px;
    border: 3px solid rgba(74, 144, 217, 0.3);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-option:hover {
    transform: scale(1.05);
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
}

.quiz-option.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(16, 185, 129, 0.2));
    border-color: var(--accent-green);
    animation: correctPop 0.5s ease;
}

.quiz-option.wrong {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.3), rgba(244, 63, 94, 0.15));
    border-color: var(--accent-red);
    animation: shake 0.4s ease;
}

@keyframes correctPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.quiz-feedback {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    min-height: 30px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.quiz-feedback.correct {
    color: var(--accent-green);
}

.quiz-feedback.wrong {
    color: var(--accent-red);
}

.quiz-next-btn {
    font-family: var(--font-heading);
    font-size: 18px;
    padding: 12px 36px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.3);
}

.quiz-next-btn:hover {
    transform: scale(1.08);
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 32px;
}

.result-emoji {
    font-size: 80px;
    margin-bottom: 16px;
}

.result-text {
    font-family: var(--font-heading);
    font-size: 36px;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.result-score {
    font-size: 22px;
    color: var(--text-dim);
    font-weight: 700;
}

/* ═══ Progress ═══ */
.progress-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.progress-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(74, 144, 217, 0.15);
}

.progress-section h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--accent-yellow);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-fill.flashcard {
    background: linear-gradient(90deg, var(--primary), var(--accent-pink));
}

.progress-fill.video {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
}

.progress-stat {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 600;
}

.words-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.word-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.word-tag.known {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #F0F4FF;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 217, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 217, 0.5);
}

/* ═══ Responsive ═══ */
@media (max-width: 480px) {
    .splash-icon {
        font-size: 72px;
    }

    .splash-content h1 {
        font-size: 40px;
    }

    .btn-start {
        font-size: 20px;
        padding: 14px 36px;
    }

    .menu-header h1 {
        font-size: 28px;
    }

    .menu-grid {
        gap: 12px;
        padding: 16px;
    }

    .card-icon {
        font-size: 36px;
    }

    .card-title {
        font-size: 16px;
    }

    .flashcard-container {
        width: 280px;
        height: 350px;
    }

    .flashcard-emoji {
        font-size: 72px;
    }

    .flashcard-word {
        font-size: 28px;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .quiz-emoji {
        font-size: 72px;
    }
}

@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 700px;
        margin: 0 auto;
    }

    .flashcard-container {
        width: 380px;
        height: 460px;
    }

    .flashcard-emoji {
        font-size: 120px;
    }

    .flashcard-word {
        font-size: 42px;
    }
}

@media (min-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
    }

    .flashcard-container {
        width: 420px;
        height: 500px;
    }
}

/* ═══ Profile / Gamification ═══ */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.3), rgba(240, 98, 146, 0.2));
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.profile-avatar {
    font-size: 72px;
    cursor: pointer;
    transition: transform 0.3s;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.profile-avatar:hover {
    transform: scale(1.15) rotate(5deg);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--accent-yellow);
}

.profile-level {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 600;
}

.profile-xp-section {
    margin-bottom: 20px;
}

.profile-xp-bar {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-pink));
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-xp-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-yellow);
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px 8px;
    text-align: center;
    border: 1px solid rgba(74, 144, 217, 0.15);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--accent-yellow);
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    margin-top: 4px;
}

/* Badges */
.badges-section {
    margin-bottom: 20px;
}

.badges-section h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--accent-yellow);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.badge-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.badge-item.earned {
    border-color: rgba(251, 191, 36, 0.4);
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.15), var(--bg-card));
}

.badge-item.locked {
    opacity: 0.5;
}

.badge-emoji {
    font-size: 32px;
    margin-bottom: 4px;
}

.badge-name {
    font-family: var(--font-heading);
    font-size: 12px;
    margin-bottom: 2px;
}

.badge-desc {
    font-size: 10px;
    color: var(--text-dim);
}

/* ═══ Modals ═══ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    animation: screenIn 0.4s ease;
}

.reward-modal {
    background: linear-gradient(145deg, #FFFFFF, #0f0a1a);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.reward-chest {
    font-size: 80px;
    animation: bounceFloat 1.5s ease-in-out infinite;
    margin-bottom: 16px;
}

.reward-title {
    font-family: var(--font-heading);
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.reward-xp {
    font-family: var(--font-heading);
    font-size: 36px;
    color: var(--accent-yellow);
    margin-bottom: 8px;
}

.reward-streak {
    font-size: 18px;
    color: var(--accent-orange);
    font-weight: 700;
    margin-bottom: 20px;
}

/* ═══ PDF Viewer Fix ═══ */
.pdf-slideshow {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 60vh;
    background: #FAFAFA;
    overflow: auto;
}

.pdf-canvas {
    max-width: 95%;
    max-height: 80vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.pdf-nav-overlay {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.pdf-nav-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}

.pdf-nav-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* ═══ Video/Audio Grid ═══ */
.video-grid,
.audio-grid,
.pdf-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* ═══ Flashcard Nav ═══ */
.flashcard-nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 16px;
}

.flashcard-nav button {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    padding: 12px 24px;
    border: 2px solid rgba(74, 144, 217, 0.3);
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flashcard-nav .btn-know {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    border-color: transparent;
}

.flashcard-nav button:hover {
    transform: scale(1.08);
}

/* ═══ Quiz Nav ═══ */
.quiz-nav {
    display: flex;
    justify-content: center;
    padding: 16px;
}

/* ═══ Audio Player Bar ═══ */
.audio-player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.3), rgba(240, 98, 146, 0.2));
    border-top: 1px solid rgba(74, 144, 217, 0.2);
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.audio-icon {
    font-size: 24px;
}

#audioNowPlaying {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#audioPlayer {
    max-width: 200px;
}

/* Flashcard front/back text */
.flashcard-word-en {
    font-family: var(--font-heading);
    font-size: 36px;
    text-align: center;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.btn-audio {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--accent-orange), #DC2626);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-audio:hover {
    transform: scale(1.08);
}

/* ═══ Mobile profile ═══ */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-avatar {
        font-size: 56px;
    }

    .profile-name {
        font-size: 20px;
    }

    .stat-value {
        font-size: 22px;
    }
}

/* ═══ Mascot Bubble ═══ */
.mascot-bubble {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: linear-gradient(135deg, #FFFFFF, #E8EEFF);
    border: 2px solid rgba(251, 191, 36, 0.4);
    border-radius: 20px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 90%;
    z-index: 8000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.mascot-bubble.visible {
    transform: translateX(-50%) translateY(0);
}

.mascot-icon {
    font-size: 36px;
    flex-shrink: 0;
    animation: bounceFloat 1.5s ease-in-out infinite;
}

.mascot-text {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

@media (max-width: 480px) {
    .mascot-bubble {
        bottom: 16px;
        padding: 10px 16px;
    }

    .mascot-text {
        font-size: 14px;
    }

    .mascot-icon {
        font-size: 28px;
    }
}

/* ═══ PDF Subtitle / Narration ═══ */
.pdf-subtitle {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    max-height: 80px;
    overflow-y: auto;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 12px;
    text-align: center;
    z-index: 15;
    backdrop-filter: blur(4px);
    font-family: var(--font-body);
}

/* ═══ PDF Coloring ═══ */
.color-canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    touch-action: none;
    cursor: crosshair;
    max-width: 100%;
    max-height: 100%;
}

.color-toolbar {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 2px solid var(--border);
    overflow-x: auto;
    flex-wrap: nowrap;
}

.color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    font-size: 16px;
    line-height: 36px;
    text-align: center;
    padding: 0;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border: 3px solid #333;
    box-shadow: 0 0 0 3px var(--primary), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

.color-btn.eraser,
.color-btn.clear {
    background: white !important;
    font-size: 18px;
}

/* ═══ YouTube Vietnamese ═══ */
.youtube-container {
    flex: 1;
    display: flex;
    background: #000;
    min-height: 0;
}

.youtube-container iframe {
    flex: 1;
    border: none;
    min-height: 300px;
}

/* Video Wrapper + Unmute Overlay */
.video-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 0;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.unmute-overlay {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 32px;
    font-size: 22px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.8);
    color: #FFD700;
    border: 3px solid #FFD700;
    border-radius: 40px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse-unmute 2s ease-in-out infinite;
    backdrop-filter: blur(4px);
}

.unmute-overlay:hover,
.unmute-overlay:focus {
    background: rgba(0, 0, 0, 0.95);
    transform: translateX(-50%) scale(1.1);
    outline: 3px solid #fff;
}

@keyframes pulse-unmute {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

.vn-card {
    border: 2px solid #DA251D !important;
    background: linear-gradient(135deg, #DA251D08, #FFD70008) !important;
}

.vn-card:hover {
    border-color: #DA251D !important;
    box-shadow: 0 4px 20px rgba(218, 37, 29, 0.2) !important;
}

/* VN Tabs */
.vn-tabs {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.vn-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vn-tab.active {
    background: #DA251D;
    border-color: #DA251D;
    color: white;
}

/* VN Big Cards */
#vnGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

@media (min-width: 600px) {
    #vnGrid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) {
    #vnGrid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.vn-big-card {
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.vn-big-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.vn-letter {
    font-size: 42px;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 6px;
}

.vn-type {
    font-size: 11px;
    color: #2c3e50;
    font-weight: 600;
}

/* VN Scroll buttons for TV remote */
.vn-scroll-nav {
    grid-column: 1 / -1;
    text-align: center;
    padding: 8px 0;
}

.vn-scroll-btn {
    padding: 12px 40px;
    font-size: 18px;
    font-weight: 700;
    border: 3px solid #DA251D;
    background: linear-gradient(135deg, #DA251D, #c0392b);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(218, 37, 29, 0.3);
}

.vn-scroll-btn:hover,
.vn-scroll-btn:focus {
    background: linear-gradient(135deg, #e74c3c, #DA251D);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(218, 37, 29, 0.4);
    outline: 3px solid #FFD700;
}

.vn-item.playing {
    border: 3px solid #DA251D;
    animation: pulse-vn 1.5s ease-in-out infinite;
    transform: scale(1.05);
}

@keyframes pulse-vn {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(218, 37, 29, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 8px rgba(218, 37, 29, 0.3);
    }
}

/* ═══ Piano ═══ */
.piano-card {
    border-left: 4px solid #9B59B6 !important;
}

.piano-card:hover {
    border-color: #9B59B6 !important;
    box-shadow: 0 4px 20px rgba(155, 89, 182, 0.2) !important;
}

.piano-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 16px 12px 16px 12px;
    min-height: 0;
    background: linear-gradient(to bottom, #2c1a0e, #3d2410);
    border-radius: 8px;
    margin: 0 8px 8px;
}

.piano-white-keys {
    display: flex;
    gap: 4px;
    width: 100%;
    height: 100%;
}

.piano-key {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.1s, box-shadow 0.1s;
}

.piano-white {
    flex: 1;
    /* Ivory gradient — not flat white */
    background: linear-gradient(to bottom, #f5f0e8 0%, #fff 60%, #f0ece0 100%);
    border-radius: 0 0 10px 10px;
    border: 2px solid #999;
    border-top: 3px solid #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 14px;
    box-shadow: 3px 6px 10px rgba(0, 0, 0, 0.35), inset 0 -2px 4px rgba(0, 0, 0, 0.08);
    min-height: 200px;
    gap: 2px;
}

.piano-white:active,
.piano-white.pressed {
    transform: scaleY(0.97);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: brightness(0.85);
}

.piano-black-keys {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 45%;
    pointer-events: none;
}

.piano-black {
    position: absolute;
    width: 8%;
    height: 100%;
    background: #1a1a1a;
    border-radius: 0 0 8px 8px;
    box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    pointer-events: all;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 6px;
}

.piano-black:active,
.piano-black.pressed {
    background: #1a252f;
    transform: scaleY(0.97);
}

.piano-label {
    font-size: 28px;
    font-weight: 900;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 3px rgba(0, 0, 0, 0.15);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.5);
    padding: 4px 10px;
    border-radius: 12px;
}

.piano-label-small {
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.piano-label-black {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.piano-label-black-small {
    font-size: 9px;
    font-weight: 600;
    color: #ccc;
    line-height: 1;
    margin-top: 1px;
}

.piano-animal {
    font-size: 36px;
    display: block;
    margin-bottom: 4px;
}

/* Highlight for follow mode */
.piano-key.highlight {
    animation: piano-glow 0.6s ease-in-out infinite alternate;
    z-index: 3;
}

@keyframes piano-glow {
    from {
        box-shadow: 0 0 10px 5px rgba(255, 215, 0, 0.5);
        filter: brightness(1.2);
    }

    to {
        box-shadow: 0 0 25px 10px rgba(255, 215, 0, 0.8);
        filter: brightness(1.4);
    }
}

.piano-key.shake {
    animation: piano-shake 0.3s ease-in-out;
}

@keyframes piano-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Status + Songs */
.piano-status {
    text-align: center;
    padding: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    min-height: 32px;
}

.piano-songs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    /* No max-height for TV compatibility */
}

.piano-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 4px 0;
}

.piano-month-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #3498db;
    background: rgba(52, 152, 219, 0.15);
    color: #2c3e50;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.piano-month-btn:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.35);
    transform: scale(1.1);
}

.piano-month-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.piano-month-label {
    font-size: 18px;
    font-weight: 800;
    color: #2c3e50;
    min-width: 100px;
    text-align: center;
}

.piano-song-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.piano-song-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.piano-song-name {
    flex: 1;
    font-size: 16px;
    font-weight: 800;
    color: #2c3e50;
}

.piano-song-actions {
    display: flex;
    gap: 6px;
}

.piano-song-btn {
    padding: 8px 14px;
    border: 2px solid rgba(255, 200, 100, 0.4);
    background: rgba(255, 200, 100, 0.15);
    color: #FFD700;
    font-weight: 700;
    font-size: 13px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.piano-song-btn:hover {
    background: rgba(255, 200, 100, 0.35);
    transform: scale(1.05);
}

.piano-song-row {
    display: flex;
    gap: 4px;
    align-items: stretch;
}

.piano-song-row .piano-song-btn {
    flex: 1;
}

.piano-autoplay-btn {
    padding: 6px 12px;
    border: 2px solid rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.15);
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.piano-autoplay-btn:hover {
    background: rgba(76, 175, 80, 0.4);
    transform: scale(1.1);
}


/* Animal popup */
.piano-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 100;
    transition: transform 0.2s ease-out, opacity 0.3s;
    opacity: 0;
}

.piano-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.piano-popup-emoji {
    font-size: 100px;
    display: block;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

/* Karaoke Lyrics */
.piano-lyrics {
    text-align: center;
    padding: 8px 16px;
    min-height: 40px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.6;
}

.lyric-word {
    display: inline;
    transition: all 0.2s;
    padding: 2px 1px;
}

.lyric-done {
    color: rgba(255, 255, 255, 0.4);
}

.lyric-active {
    color: #FECA57;
    font-size: 28px;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(254, 202, 87, 0.6);
    animation: lyric-pulse 0.5s ease-in-out;
}

.lyric-next {
    color: rgba(255, 255, 255, 0.85);
}

@keyframes lyric-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* === Numberblocks === */
.nb-card {
    border-left: 4px solid #E74C3C !important;
}

.nb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
}

.nb-card {
    background: linear-gradient(135deg, var(--nb-color, #E74C3C) 0%, rgba(0, 0, 0, 0.3) 100%);
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.nb-card:hover,
.nb-card:focus {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nb-emoji {
    font-size: 40px;
    margin-bottom: 8px;
}

.nb-title {
    font-size: 15px;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
}

.nb-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.nb-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
}

.nb-player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.nb-video {
    width: 100%;
    flex: 1;
    border-radius: 12px;
    background: #000;
    object-fit: contain;
}

.piano-stop-btn {
    width: 100%%;
    padding: 14px;
    border: 2px solid #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    font-size: 18px;
    font-weight: 800;
    border-radius: 14px;
    cursor: pointer;
    animation: pulse-stop 1s ease-in-out infinite alternate;
}

@keyframes pulse-stop {
    from {
        background: rgba(231, 76, 60, 0.15);
    }

    to {
        background: rgba(231, 76, 60, 0.35);
    }
}

.piano-stop-btn:hover {
    background: rgba(231, 76, 60, 0.5);
}

/* ═══ TreeHouse (Owl Diaries) ═══ */
.th-card {
    border: 2px solid #7B2D8E !important;
    background: linear-gradient(135deg, #7B2D8E08, #E8752A08) !important;
}

.th-card:hover {
    border-color: #7B2D8E !important;
    box-shadow: 0 4px 20px rgba(123, 45, 142, 0.2) !important;
}

.th-tabs {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.th-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.th-tab.active {
    background: #7B2D8E;
    border-color: #7B2D8E;
    color: white;
}

.th-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

@media (min-width: 600px) {
    .th-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .th-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.th-big-card {
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.th-big-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.th-num {
    font-size: 32px;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 6px;
}

.th-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    line-height: 1.3;
}

/* TreeHouse Audio Player */
.th-audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #2c1445, #1a0a2e);
}

.th-audio-owl {
    font-size: 120px;
    animation: owl-bounce 2s ease-in-out infinite;
}

@keyframes owl-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.th-audio-title {
    font-size: 22px;
    font-weight: 700;
    color: #E8752A;
    text-align: center;
}

.th-audio-info audio {
    width: 90%;
    max-width: 500px;
}

/* ═══ Potty Training ═══ */
.potty-card {
    background: linear-gradient(135deg, #FF9F43, #F7931E) !important;
    border: 2px solid rgba(255, 159, 67, 0.4) !important;
}

.potty-card:hover {
    border-color: rgba(255, 159, 67, 0.7) !important;
    box-shadow: 0 8px 30px rgba(255, 159, 67, 0.4) !important;
}

.potty-card .card-icon {
    animation: potty-wiggle 2s ease-in-out infinite;
}

@keyframes potty-wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(8deg);
    }
}

.potty-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
}

.potty-big-card {
    border-radius: 20px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.potty-big-card:hover {
    transform: scale(1.06) translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.potty-big-card:active {
    transform: scale(0.97);
}

.potty-icon {
    font-size: 54px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.potty-title {
    font-family: var(--font-heading);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    width: 100%;
    text-align: center;
    margin: 0 auto;
}
/* === Dong Dao === */
.dongdao-card { background: linear-gradient(135deg, #a855f7, #ec4899) !important; border: 2px solid rgba(168, 85, 247, 0.4) !important; }
.dongdao-card:hover { border-color: rgba(168, 85, 247, 0.7) !important; box-shadow: 0 8px 30px rgba(168, 85, 247, 0.4) !important; }
.dongdao-card .card-icon { animation: potty-wiggle 2s ease-in-out infinite; }
.dongdao-player { margin: 16px; border-radius: 16px; overflow: hidden; background: #1a1a2e; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.dongdao-player-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: linear-gradient(135deg, #a855f7, #ec4899); color: white; font-weight: 700; font-size: 16px; }
.dongdao-player-header button { background: rgba(255,255,255,0.2); border: none; color: white; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.dongdao-iframe-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.dongdao-iframe-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
