/* ==========================================================================
   nihongoGO - Modern Design System & Stylesheet (Tokyo Neon / Sakura Theme)
   ========================================================================== */

/* Google Fonts Import & Reset */
:root {
    /* Color Palette */
    --bg-dark: #090b1e;
    --bg-card: rgba(22, 26, 60, 0.45);
    --bg-card-hover: rgba(30, 36, 80, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 117, 143, 0.4);
    
    --primary: #8a2be2;
    --primary-glow: rgba(138, 43, 226, 0.4);
    --accent-sakura: #ff758f;
    --accent-sakura-glow: rgba(255, 117, 143, 0.35);
    --accent-tokyo: #00bbf9;
    
    /* Functional Colors */
    --color-correct: #00f5d4;
    --color-correct-bg: rgba(0, 245, 212, 0.15);
    --color-correct-border: rgba(0, 245, 212, 0.4);
    
    --color-incorrect: #ff006e;
    --color-incorrect-bg: rgba(255, 0, 110, 0.15);
    --color-incorrect-border: rgba(255, 0, 110, 0.4);
    
    --color-warning: #ffd166;
    
    /* Typography Colors */
    --text-white: #ffffff;
    --text-muted: #a2a7cc;
    --text-dark: #121420;
    
    /* Font Families */
    --font-outfit: 'Outfit', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 50px;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-outfit);
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 117, 143, 0.1) 0%, transparent 45%);
    background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-sakura);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: rgba(9, 11, 30, 0.85);
    border-right: 1px solid var(--border-color);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-left: 8px;
}

.sidebar-logo .logo-emoji {
    font-size: 28px;
}

.sidebar-logo .logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-sakura) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo .logo-text span {
    color: var(--accent-sakura);
    -webkit-text-fill-color: initial;
}

/* Level Selector inside Sidebar */
.level-selector-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 28px;
}

.level-selector-wrapper label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.level-selector-wrapper label i {
    color: var(--accent-sakura);
    margin-right: 4px;
}

.level-select {
    width: 100%;
    background: rgba(9, 11, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-outfit);
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
}

.level-select:focus {
    border-color: var(--accent-sakura);
    box-shadow: 0 0 10px var(--accent-sakura-glow);
}

.level-select option {
    background-color: #0d0f26;
    color: var(--text-white);
    padding: 10px;
}

/* Sidebar Menu Navigation */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-bounce);
    border: 1px solid transparent;
}

.menu-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-item:hover {
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.menu-item.active {
    color: var(--text-white);
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(255, 117, 143, 0.2) 100%);
    border: 1px solid var(--border-color-hover);
    box-shadow: 0 8px 24px rgba(255, 117, 143, 0.1);
}

.menu-item.active i {
    color: var(--accent-sakura);
    filter: drop-shadow(0 0 6px var(--accent-sakura-glow));
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.sidebar-footer .sub-text {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px; /* Offset for sidebar */
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   STATUS HEADER & WIDGETS
   ========================================================================== */

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-welcome {
    display: flex;
    flex-direction: column;
}

#time-greeting {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-white);
}

.user-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-status-widgets {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Badges */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.level-badge {
    background: linear-gradient(135deg, rgba(255, 117, 143, 0.15) 0%, rgba(138, 43, 226, 0.15) 100%);
    border-color: rgba(255, 117, 143, 0.25);
    color: var(--accent-sakura);
}

/* XP Tracker */
.xp-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
}

.xp-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-warning);
}

.xp-progress-bg {
    width: 100px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.xp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-warning) 0%, #ffa200 100%);
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Buttons */
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-bounce);
}

.icon-btn:hover {
    background: rgba(255, 117, 143, 0.15);
    border-color: var(--accent-sakura);
    color: var(--accent-sakura);
    transform: scale(1.1);
}

/* General Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-outfit);
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-bounce);
    outline: none;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
    padding: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6f1ab6 100%);
    color: var(--text-white);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(138, 43, 226, 0.6);
}

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

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

.btn-success {
    background: linear-gradient(135deg, #00f5d4 0%, #00bbf9 100%);
    color: var(--text-dark);
    box-shadow: 0 8px 20px rgba(0, 245, 212, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 245, 212, 0.5);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent-sakura-glow);
    border: 1px solid var(--accent-sakura);
    color: var(--accent-sakura);
    margin-bottom: 12px;
}

/* ==========================================================================
   VIEWPORTS & CONTAINER GLASSMORPHISM
   ========================================================================== */

.content-viewport {
    flex-grow: 1;
    position: relative;
}

.view-section {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.view-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.card-glass {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

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

.section-title {
    margin: 40px 0 20px 0;
}

.section-title h2 {
    font-size: 22px;
    font-weight: 800;
}

.section-title p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   1. DASHBOARD VIEW STYLING
   ========================================================================== */

.dashboard-hero {
    background: linear-gradient(135deg, rgba(22, 26, 60, 0.8) 0%, rgba(138, 43, 226, 0.25) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 117, 143, 0.35) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.hero-text {
    max-width: 60%;
    z-index: 1;
}

.hero-text h1 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-sakura) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-visual {
    position: relative;
    width: 300px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: float 6s ease-in-out infinite;
}

.floating-card .jp-char {
    font-family: var(--font-jp);
    font-weight: 700;
    color: var(--text-white);
}

.floating-card .romaji {
    font-size: 12px;
    color: var(--accent-sakura);
    font-weight: 700;
    margin-top: 4px;
}

.floating-card.c1 {
    top: 10px;
    left: 20px;
    font-size: 32px;
    animation-delay: 0s;
}

.floating-card.c2 {
    bottom: 20px;
    right: 10px;
    padding: 12px 18px;
    animation-delay: 2s;
}

.floating-card.c2 .jp-char {
    font-size: 18px;
}

.floating-card.c3 {
    top: 80px;
    left: 120px;
    padding: 12px 18px;
    animation-delay: 4s;
    border-color: rgba(0, 245, 212, 0.2);
}

.floating-card.c3 .jp-char {
    font-size: 16px;
}

.floating-card.c3 .romaji {
    color: var(--color-correct);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(3deg);
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    top: -30px;
    right: -30px;
    border-radius: 50%;
}

.feature-card.clickable {
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 30px rgba(255, 117, 143, 0.1);
    background-color: var(--bg-card-hover);
}

.card-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    margin-bottom: 20px;
}

.card-icon.blue { background: rgba(0, 187, 249, 0.15); color: var(--accent-tokyo); }
.card-icon.green { background: rgba(0, 245, 212, 0.15); color: var(--color-correct); }
.card-icon.purple { background: rgba(138, 43, 226, 0.15); color: #b175ff; }
.card-icon.red { background: rgba(255, 0, 110, 0.15); color: var(--color-incorrect); }

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.card-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-sakura);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-link i {
    transition: transform 0.2s ease;
}

.feature-card:hover .card-link i {
    transform: translateX(4px);
}

/* ==========================================================================
   2. LEARN VIEW STYLING
   ========================================================================== */

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}

.view-header h2 {
    font-size: 26px;
    font-weight: 800;
    margin-top: 4px;
}

.view-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.learn-progress-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 200px;
}

#learn-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-sakura) 0%, var(--primary) 100%);
    border-radius: var(--radius-pill);
    width: 33%;
    transition: width 0.4s ease;
}

.lesson-wrapper {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    align-items: start;
}

.lesson-theory {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lesson-theory h3 {
    font-size: 22px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    color: var(--accent-sakura);
}

.lesson-intro {
    line-height: 1.7;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.lesson-intro h4 {
    margin: 16px 0 8px 0;
    font-size: 16px;
    color: var(--text-white);
    font-weight: 700;
}

.lesson-intro ul {
    margin-left: 20px;
    margin-top: 8px;
}

.lesson-intro li {
    margin-bottom: 6px;
}

.info-alert {
    background-color: rgba(0, 187, 249, 0.1);
    border-left: 4px solid var(--accent-tokyo);
    padding: 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

.info-alert i {
    color: var(--accent-tokyo);
    font-size: 18px;
    margin-top: 2px;
}

.info-alert strong {
    color: var(--text-white);
}

.interactive-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Flashcard Styling */
.flashcard {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.flashcard:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 117, 143, 0.2);
    transform: scale(1.02);
}

.card-jp-side {
    display: flex;
    flex-direction: column;
}

/* Furigana support */
ruby {
    font-family: var(--font-jp);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
}

rt {
    font-size: 11px;
    color: var(--accent-sakura);
    font-weight: 500;
    padding-bottom: 2px;
    font-family: var(--font-outfit);
}

.card-meaning {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

.card-audio-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(138, 43, 226, 0.15);
    color: #b175ff;
    border: 1px solid rgba(138, 43, 226, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-bounce);
}

.card-audio-btn:hover {
    background-color: var(--primary);
    color: var(--text-white);
    transform: scale(1.1);
    box-shadow: 0 0 12px var(--primary-glow);
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* ==========================================================================
   3. QUIZ VIEW STYLING
   ========================================================================== */

.quiz-screen {
    display: none;
}

.quiz-screen.active {
    display: block;
}

/* Intro Screen */
.quiz-illustration {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce-anim 2s infinite ease-in-out;
}

@keyframes bounce-anim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#quiz-intro-screen h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

#quiz-intro-screen p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto 28px auto;
}

.quiz-rules {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    margin-bottom: 32px;
}

.quiz-rules div {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}

.quiz-rules div i {
    color: var(--color-correct);
}

/* Play Screen */
.quiz-progress-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.btn-quit-quiz {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-quit-quiz:hover {
    color: var(--color-incorrect);
    transform: scale(1.1);
}

.quiz-progress-bar-bg {
    flex-grow: 1;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.quiz-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-sakura) 0%, #00f5d4 100%);
    border-radius: var(--radius-pill);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 60px;
    text-align: right;
}

/* Question prompt */
.question-container {
    margin-bottom: 32px;
}

.question-prompt {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 24px;
}

.question-prompt ruby {
    font-size: 26px;
}

.audio-question-helper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 20px 0 32px 0;
}

.audio-play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary);
    border: none;
    color: var(--text-white);
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-bounce);
}

.audio-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(138, 43, 226, 0.6);
}

.audio-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Multiple choice options */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.option-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--text-white);
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 16px;
}

.option-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.option-btn.selected {
    background-color: rgba(138, 43, 226, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.option-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.option-btn.selected .option-index {
    background-color: var(--primary);
    color: var(--text-white);
    border-color: transparent;
}

/* Sentence Builder Style */
.sentence-builder-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sentence-workspace {
    min-height: 80px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    transition: var(--transition-smooth);
}

.sentence-workspace.active {
    border-color: var(--accent-sakura);
}

.workspace-placeholder {
    color: var(--text-muted);
    font-size: 14px;
    width: 100%;
    text-align: center;
    font-style: italic;
}

.sentence-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

/* Word Bubbles */
.word-bubble {
    background-color: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    color: var(--text-white);
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.word-bubble:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-sakura);
    transform: translateY(-2px);
}

.word-bubble.disabled {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
    transform: none;
}

/* Feedback Bar */
.quiz-feedback-bar {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

/* Color codes when grading active */
.quiz-feedback-bar.correct {
    background-color: var(--color-correct-bg);
    border: 1px solid var(--color-correct-border);
    margin: 32px -32px -32px -32px;
    padding: 24px 32px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.quiz-feedback-bar.incorrect {
    background-color: var(--color-incorrect-bg);
    border: 1px solid var(--color-incorrect-border);
    margin: 32px -32px -32px -32px;
    padding: 24px 32px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feedback-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.quiz-feedback-bar.correct .feedback-icon {
    display: flex;
    background-color: var(--color-correct);
    color: var(--text-dark);
}

.quiz-feedback-bar.incorrect .feedback-icon {
    display: flex;
    background-color: var(--color-incorrect);
    color: var(--text-white);
}

.feedback-text h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}

.quiz-feedback-bar.correct .feedback-text h4 { color: var(--color-correct); }
.quiz-feedback-bar.incorrect .feedback-text h4 { color: var(--color-incorrect); }

.feedback-text p {
    font-size: 14px;
    color: var(--text-muted);
}

.quiz-feedback-bar.correct .feedback-text p,
.quiz-feedback-bar.incorrect .feedback-text p {
    color: var(--text-white);
    opacity: 0.9;
}

/* ==========================================================================
   4. GAME VIEW (KANA MATCH) STYLING
   ========================================================================== */

.game-screen {
    display: none;
}

.game-screen.active {
    display: block;
}

/* Game Lobby */
.game-illustration {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate-anim 4s infinite linear;
}

@keyframes rotate-anim {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

#game-lobby h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

#game-lobby p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 28px;
}

.game-mode-selector {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.game-mode-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 14px 24px;
    font-family: var(--font-outfit);
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-bounce);
}

.game-mode-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 117, 143, 0.2);
}

.game-mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 117, 143, 0.15) 0%, rgba(138, 43, 226, 0.15) 100%);
    border-color: var(--accent-sakura);
    color: var(--accent-sakura);
    box-shadow: 0 0 15px var(--accent-sakura-glow);
}

/* Game Play Arena */
.game-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-value {
    color: var(--text-white);
    font-weight: 800;
    font-size: 16px;
    margin-left: 6px;
}

/* Card Grid Styles */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
    perspective: 800px; /* Crucial for 3D flip */
}

.game-card {
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.game-card.flipped {
    transform: rotateY(180deg);
}

.game-card.matched {
    transform: rotateY(180deg) scale(0.95);
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    border: 2px solid var(--border-color);
}

/* Back Face (Hidden initially, shown on click) */
.card-face.card-back {
    background-color: var(--bg-dark);
    color: var(--accent-sakura);
    font-size: 24px;
}

.game-card:hover .card-face.card-back {
    border-color: var(--accent-sakura);
    background-color: rgba(255, 117, 143, 0.05);
}

/* Front Face (Contains letter/Romaji) */
.card-face.card-front {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    font-family: var(--font-jp);
    font-size: 22px;
    transform: rotateY(180deg);
}

.game-card.romaji-card .card-face.card-front {
    font-family: var(--font-outfit);
    color: var(--accent-tokyo);
}

/* Card matched colors */
.game-card.matched .card-face.card-front {
    border-color: var(--color-correct);
    background-color: rgba(0, 245, 212, 0.08);
}

/* ==========================================================================
   5. VIDEO VIEW STYLING
   ========================================================================== */

.video-content-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: start;
}

.video-player-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-details h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.video-details p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.video-quiz-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-info-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.video-quiz-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-quiz-body h4 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.video-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-option {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.video-option.selected {
    background-color: rgba(138, 43, 226, 0.08);
    border-color: var(--primary);
}

.video-option-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.video-option.selected .video-option-radio {
    border-color: var(--primary);
    background-color: var(--primary);
}

.video-option.selected .video-option-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--text-white);
    border-radius: 50%;
}

.video-quiz-result {
    margin-top: 12px;
}

.result-alert {
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    gap: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.result-alert.success {
    background-color: var(--color-correct-bg);
    border: 1px solid var(--color-correct-border);
    color: var(--color-correct);
}

.result-alert.success i {
    font-size: 20px;
    margin-top: 2px;
}

.result-alert strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-white);
}

.result-alert p {
    color: var(--text-muted);
}

/* ==========================================================================
   6. RESULT / SUMMARY VIEW STYLING
   ========================================================================== */

.result-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.result-badge-anim {
    font-size: 90px;
    margin-bottom: 20px;
    display: inline-block;
    animation: scale-up 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scale-up {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.result-container h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.jp-congrats {
    font-family: var(--font-jp);
    font-size: 24px;
    color: var(--accent-sakura);
    font-weight: 700;
    margin-bottom: 12px;
}

#result-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.result-stat-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.result-stat-card .stat-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-stat-card .stat-number {
    font-size: 20px;
    font-weight: 800;
}

.result-stat-card .stat-number.score-xp {
    color: var(--color-warning);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Integrated Lesson Video Styles */
.lesson-video-container {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lesson-video-quiz {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.lesson-video-quiz h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--accent-sakura);
}

.lesson-video-quiz .quiz-info-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.video-q-text {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.4;
}

/* ==========================================================================
   INTERACTIVE LEARN VIEW ARENA
   ========================================================================== */
.learn-mode-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.mode-instruction {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 1. Canvas Writing Styles */
.canvas-card {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: var(--radius-md);
    background-color: rgba(9, 11, 30, 0.6);
    border: 2px dashed rgba(255, 117, 143, 0.2);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

#writing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    touch-action: none; /* disables standard page gestures while drawing */
}

.canvas-controls {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

/* 2. Spelling Mode Styles */
.spell-audio-helper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.spell-workspace {
    width: 100%;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.spell-bubbles-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* 3. Image/Emoji matching card grid */
.match-word-prompt {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    margin-bottom: 24px;
}

#match-word-jp {
    font-family: var(--font-jp);
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-sakura);
}

.match-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 500px;
}

.match-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition-bounce);
}

.match-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 117, 143, 0.3);
    transform: translateY(-4px);
}

.match-card.selected {
    background: rgba(138, 43, 226, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.match-card.correct-flash {
    background: var(--color-correct-bg);
    border-color: var(--color-correct);
}

.match-card.incorrect-flash {
    background: var(--color-incorrect-bg);
    border-color: var(--color-incorrect);
}

.match-emoji {
    font-size: 40px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.match-translation {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.match-card.selected .match-translation {
    color: var(--text-white);
}

/* ==========================================================================
   AUTHENTICATION OVERLAY
   ========================================================================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(9, 11, 30, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.auth-overlay.active {
    display: flex;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 117, 143, 0.2);
}

.auth-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-logo .logo-emoji {
    font-size: 32px;
}

.auth-logo .logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-sakura) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-logo .logo-text span {
    color: var(--accent-sakura);
}

#auth-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

#auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group label i {
    color: var(--accent-sakura);
    margin-right: 4px;
}

.input-group input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-outfit);
    font-size: 15px;
    outline: none;
    transition: var(--transition-smooth);
}

.input-group input:focus {
    border-color: var(--accent-sakura);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px var(--accent-sakura-glow);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.auth-error-msg {
    color: var(--color-incorrect);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
    margin-top: 8px;
}

/* ==========================================================================
   QUIZ TIMER & BADGE
   ========================================================================== */
.quiz-timer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 117, 143, 0.15);
    border: 1px solid rgba(255, 117, 143, 0.3);
    color: var(--accent-sakura);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    min-width: 85px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 117, 143, 0.1);
}

.quiz-timer-badge i {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* ==========================================================================
   PROFILE VIEW
   ========================================================================== */
.profile-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-sakura) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(138, 43, 226, 0.3);
}

.profile-meta h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-role-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 245, 212, 0.1);
    color: var(--color-correct);
    border: 1px solid rgba(0, 245, 212, 0.3);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-stats-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.prof-level-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.prof-level-card.unlocked {
    border-color: rgba(0, 245, 212, 0.3);
    background: rgba(0, 245, 212, 0.02);
}

.prof-level-card .prof-lvl-icon {
    font-size: 20px;
    color: var(--text-muted);
}

.prof-level-card.unlocked .prof-lvl-icon {
    color: var(--color-correct);
}

.prof-level-card h5 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.prof-level-card p {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-actions-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 1024px) {
    .lesson-wrapper {
        grid-template-columns: 1fr;
    }
    
    .video-content-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-hero {
        padding: 32px;
    }
    
    .hero-text h1 {
        font-size: 30px;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-text {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 80px; /* Space for mobile navigation bar */
    }
    
    .app-container {
        flex-direction: column;
    }
    
    /* Transforming Sidebar into a bottom navigation bar */
    .sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        top: auto;
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        background-color: rgba(9, 11, 30, 0.95);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar-logo, 
    .level-selector-wrapper, 
    .sidebar-footer {
        display: none; /* Hide header, level-select, footer on mobile bar */
    }
    
    .sidebar-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
        align-items: center;
    }
    
    .menu-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        font-size: 10px;
        font-weight: 500;
        border-radius: var(--radius-sm);
        border: none;
        background: none !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    .menu-item i {
        font-size: 18px;
    }
    
    .menu-item span {
        display: block;
    }
    
    .menu-item.active {
        color: var(--accent-sakura);
    }
    
    /* Main Content adjustments */
    .main-content {
        margin-left: 0;
        padding: 20px 24px;
    }
    
    .status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-status-widgets {
        width: 100%;
        justify-content: space-between;
    }
    
    .xp-container {
        flex-grow: 1;
        justify-content: center;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .result-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 12px;
    }
}
