/* ===========================================
   CSS Variables for Consistent Typography
   =========================================== */
:root {
    /* Font Families */
    --font-display: 'Fredoka', 'Poppins', sans-serif;  /* For headings, numbers, titles */
    --font-body: 'Poppins', sans-serif;                 /* For body text, inputs, descriptions */

    /* Font Weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
}

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

body {
    font-family: var(--font-body);
    font-weight: var(--weight-normal);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Headings use display font */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
}

/* Inputs use body font */
input, button, textarea, select {
    font-family: var(--font-body);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
}

/* Make all screens fit viewport */
.screen {
    min-height: calc(100vh - 70px);
}

/* Navigation Bar */
.main-nav {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: scale(1.05);
}

.nav-logo {
    font-size: 2em;
}

.nav-title {
    font-size: 1.5em;
    font-weight: var(--weight-bold);
    font-family: var(--font-display);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tagline {
    font-size: 0.75em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-body);
    letter-spacing: 0.3px;
    padding-left: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
    margin-left: 4px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 8px 14px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #333;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: var(--weight-semibold);
    font-family: var(--font-body);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(240, 147, 251, 0.4);
}

/* Math Decorations - Floating Background */
.math-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.math-symbol, .math-number {
    position: absolute;
    font-size: 3em;
    font-weight: bold;
    opacity: 0.15;
    color: white;
    animation: float 6s ease-in-out infinite;
}

.math-number {
    font-size: 4em;
    opacity: 0.12;
}

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

/* Screen Management */
.screen {
    display: none;
    min-height: calc(100vh - 70px);
    position: relative;
    z-index: 1;
    padding-top: 70px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Home Screen - Compact Layout */
#profile-screen {
    padding-top: 0;
}

/* Dashboard Screen - Compact Layout */
#dashboard-screen {
    padding-top: 10px;
}

#dashboard-screen .container {
    max-width: 700px;
    padding: 10px 15px;
}

.home-container {
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.home-hero {
    text-align: center;
    margin-bottom: 15px;
}

.home-hero-icon {
    font-size: 3em;
    margin-bottom: 5px;
    animation: bounce 2s ease-in-out infinite;
}

.home-title {
    font-size: 1.6em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    margin-bottom: 5px;
    background: linear-gradient(135deg, #667eea 0%, #f5576c 50%, #feca57 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.home-subtitle {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.home-profiles {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 15px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.home-section-title {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 12px;
    font-weight: 700;
}

.home-profiles .btn {
    padding: 10px 20px;
    font-size: 0.95em;
}

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

/* Legacy Hero Section (kept for other pages) */
.hero-section {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 30px 25px;
    margin: 15px auto 25px;
    max-width: 900px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
    min-width: 280px;
}

.hero-title {
    font-size: 2.2em;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #f5576c 50%, #feca57 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-emoji {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.1em;
    color: #666;
    line-height: 1.5;
}

.hero-illustration {
    flex: 1;
    min-width: 200px;
    display: flex;
    justify-content: center;
}

.math-illustration {
    width: 100%;
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.1));
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 2em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.section-subtitle, .subtitle {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Title Styles */
.title {
    text-align: center;
    font-size: 3em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    margin: 30px 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    color: white;
}

/* Button Styles */
.btn {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: var(--weight-semibold);
    transition: all 0.15s ease;
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    transform: translateY(0);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2), 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-large {
    padding: 14px 25px;
    font-size: 1.1em;
}

.btn-icon {
    font-size: 1.2em;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    align-items: center;
}

.button-group .btn {
    width: 100%;
    max-width: 400px;
}

/* Profile Screen */
.profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.profile-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, #667eea25 0%, #764ba225 100%);
    border-color: #667eea;
}

.profile-name {
    font-size: 1em;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.profile-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.8em;
}

.profile-stats > div {
    display: flex;
    align-items: center;
    gap: 3px;
}

.streak {
    font-size: 1em;
    font-weight: bold;
    color: #ff6348;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    margin-bottom: 25px;
    color: #667eea;
    font-size: 2em;
}

.modal-content input {
    width: 100%;
    padding: 18px;
    font-size: 1.3em;
    border: 3px solid #ddd;
    border-radius: 15px;
    margin-bottom: 25px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

.profile-error-message {
    color: #dc2626;
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fee2e2;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    display: none;
}

.modal-buttons {
    display: flex;
    gap: 15px;
}

.modal-buttons .btn {
    flex: 1;
}

/* Dashboard Screen */
.dashboard-hero {
    text-align: center;
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-avatar {
    font-size: 2.5em;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.dashboard-name {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 2px;
    text-align: left;
}

.dashboard-greeting {
    font-size: 0.9em;
    color: #666;
    text-align: left;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe5cc 100%);
    border: 2px solid #feca57;
}

.stat-card-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.stat-card-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 3px;
}

.stat-card-label {
    font-size: 0.7em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Operation Settings */
.operation-settings {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.operation-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.operation-card {
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.operation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.operation-card.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f5576c;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.operation-card.active .operation-name,
.operation-card.active .operation-example {
    color: white;
}

.operation-icon {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.operation-name {
    font-size: 0.95em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 3px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.operation-card.active .operation-name {
    color: white;
}

.operation-example {
    font-size: 0.8em;
    color: #666;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Difficulty Settings */
.difficulty-settings {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.settings-title {
    text-align: center;
    font-size: 1.1em;
    color: #1a1a1a;
    margin-bottom: 5px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.settings-subtitle {
    text-align: center;
    font-size: 0.85em;
    color: #999;
    margin-bottom: 12px;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.difficulty-card {
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.difficulty-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.difficulty-card.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.difficulty-card.active .difficulty-name,
.difficulty-card.active .difficulty-range,
.difficulty-card.active .difficulty-timer {
    color: white;
}

.difficulty-icon {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.difficulty-name {
    font-size: 0.95em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 3px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.difficulty-card.active .difficulty-name {
    color: white;
}

.difficulty-range {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 3px;
}

.difficulty-timer {
    font-size: 0.7em;
    color: #999;
    font-weight: bold;
}

.difficulty-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6em;
    font-weight: bold;
}

.difficulty-card.active .difficulty-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.dashboard-actions .btn {
    width: 100%;
    padding: 12px 15px;
    font-size: 0.9em;
}

.streak-reminder {
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    text-align: center;
    font-size: 0.95em;
    color: #f5576c;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: pulse 2s ease infinite;
}

.streak-reminder:empty {
    display: none;
}

/* ================================
   MODE SELECTION SCREEN
   ================================ */
#mode-selection-screen {
    padding-top: 0;
}

/* ================================
   DASHBOARD LAYOUT (3-PANEL)
   ================================ */
.dashboard-layout {
    min-height: calc(100vh - 60px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-left {
    width: 220px;
    flex-shrink: 0;
}

.panel-center {
    flex: 1;
    max-width: 550px;
}

.panel-right {
    width: 420px;
    flex-shrink: 0;
}

/* ================================
   HOW IT WORKS CARD
   ================================ */
.how-it-works-card {
    background: linear-gradient(135deg, #f8f4ff 0%, #fff5f8 50%, #ffffff 100%);
    border: 2px solid rgba(167, 139, 250, 0.2);
    border-radius: 24px;
    padding: 20px 30px;
    margin-bottom: 20px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(167, 139, 250, 0.1);
}

.how-it-works-title {
    font-family: var(--font-display);
    font-size: 1.2em;
    font-weight: 700;
    color: #7c3aed;
    margin: 0 0 4px 0;
}

.how-it-works-subtitle {
    font-size: 0.85em;
    color: #9ca3af;
    margin: 0 0 16px 0;
    font-style: italic;
}

.how-it-works-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.how-it-works-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.step-icon.learn-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.step-icon.practice-icon {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.step-icon.play-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.step-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.step-action {
    font-weight: 700;
    font-size: 0.95em;
    color: #1f2937;
}

.step-desc {
    font-size: 0.8em;
    color: #6b7280;
}

.step-arrow {
    color: #d1d5db;
    font-size: 1.2em;
    font-weight: 300;
}

/* Responsive */
@media (max-width: 768px) {
    .how-it-works-card {
        padding: 16px 20px;
    }

    .how-it-works-steps {
        gap: 8px;
    }

    .how-it-works-step {
        padding: 6px 10px;
        gap: 6px;
    }

    .step-icon {
        width: 28px;
        height: 28px;
        font-size: 1em;
    }

    .step-action {
        font-size: 0.85em;
    }

    .step-desc {
        font-size: 0.7em;
    }

    .step-arrow {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .how-it-works-steps {
        flex-direction: column;
        gap: 10px;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .how-it-works-step {
        width: 100%;
        justify-content: center;
    }
}

/* ================================
   ADVENTURE CARD LANDING PAGE
   ================================ */
.adventure-card {
    background: white;
    border-radius: 32px;
    padding: 35px 40px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

.adventure-title {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 2em;
    color: #333;
    margin-bottom: 8px;
}

.adventure-welcome {
    font-family: var(--font-body);
    font-size: 1.1em;
    color: #666;
}

.adventure-welcome span {
    color: #f093fb;
    font-weight: var(--weight-semibold);
}

/* Adventure Mode Grid - 2x2 with flexible expansion */
.adventure-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

/* Individual Mode Cards */
.adventure-mode-card {
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.adventure-mode-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.adventure-mode-card:active {
    transform: scale(0.98);
}

/* Shimmer effect on hover */
.adventure-mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.adventure-mode-card:hover::before {
    left: 100%;
}

/* Learn Mode - Green Gradient */
.adventure-mode-card.learn-mode {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.35);
}

/* Practice Mode - Blue Gradient */
.adventure-mode-card.practice-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

/* Play Mode - Orange Gradient */
.adventure-mode-card.play-mode {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.35);
}

/* Challenge Mode - Pink/Purple Gradient */
.adventure-mode-card.challenge-mode {
    background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
    box-shadow: 0 6px 20px rgba(252, 74, 26, 0.35);
}

/* Card Content */
.adventure-icon {
    font-size: 2.8em;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.adventure-mode-title {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 1.3em;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.adventure-mode-desc {
    font-family: var(--font-body);
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* NEW Badge */
.adventure-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: white;
    color: #f5576c;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 0.7em;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Bottom Actions */
.adventure-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.adventure-btn {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 2px solid #d1d5db;
    color: #4b5563;
    padding: 10px 24px;
    border-radius: 25px;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.adventure-btn:hover {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #374151;
}

/* ================================
   LEFT PANEL: FRIEND + STREAK CARDS
   ================================ */

/* Streak Card */
.streak-card {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%);
    border-radius: 24px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.35);
    position: relative;
    overflow: hidden;
}

.streak-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmerRotate 8s linear infinite;
}

@keyframes shimmerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.streak-flame-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
    animation: flameFlicker 1.5s ease-in-out infinite;
}

@keyframes flameFlicker {
    0%, 100% { transform: scale(1) rotate(-3deg); }
    50% { transform: scale(1.1) rotate(3deg); }
}

.streak-number {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 3.5em;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    line-height: 1;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.streak-label {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 1.1em;
    color: #fef3c7;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.streak-message {
    font-family: var(--font-body);
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.streak-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.streak-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.streak-dot.active {
    background: #fbbf24;
    border-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

/* Friend Card */
.friend-card {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #4f46e5 100%);
    border-radius: 24px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.45);
}

.friend-avatar {
    font-size: 5em;
    margin-bottom: 12px;
    filter: drop-shadow(0 6px 15px rgba(0,0,0,0.25));
    animation: friendBounce 3s ease-in-out infinite;
}

@keyframes friendBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.friend-label {
    font-family: var(--font-body);
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.friend-name {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 1.4em;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 12px;
}

.friend-change-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-change-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* ================================
   FRIEND SELECTION MODAL
   ================================ */
.friend-modal-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.friend-modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.friend-categories {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.friend-category-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.friend-category-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.friend-category-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.friend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.friend-option {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border: 3px solid transparent;
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #8b5cf6;
}

.friend-option.selected {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.friend-option-emoji {
    display: block;
    font-size: 2.5em;
    margin-bottom: 8px;
}

.friend-option-name {
    font-family: var(--font-display);
    font-weight: var(--weight-semibold);
    font-size: 0.9em;
    color: #374151;
}

/* Responsive Design for Dashboard Layout */

/* Tablet: Stack panels vertically, hide right panel */
@media (max-width: 900px) {
    .dashboard-layout {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 20px 15px;
    }

    .panel-left {
        width: 100%;
        max-width: 500px;
        flex-direction: row;
        gap: 16px;
    }

    .panel-left .friend-card,
    .panel-left .streak-card {
        flex: 1;
    }

    .panel-center {
        max-width: 500px;
        width: 100%;
    }

    .panel-right {
        display: none;
    }

    .friend-avatar {
        font-size: 4em;
    }
}

/* Mobile: Stack everything vertically */
@media (max-width: 600px) {
    .panel-left {
        flex-direction: column;
        gap: 12px;
    }

    .adventure-card {
        padding: 25px 20px;
        border-radius: 24px;
    }

    .adventure-title {
        font-size: 1.6em;
    }

    .adventure-grid {
        gap: 12px;
    }

    .adventure-mode-card {
        padding: 20px 15px;
    }

    .adventure-icon {
        font-size: 2.2em;
    }

    .adventure-mode-title {
        font-size: 1.1em;
    }

    .adventure-mode-desc {
        font-size: 0.8em;
    }

    .streak-card, .friend-card {
        padding: 20px 16px;
    }

    .streak-number {
        font-size: 2.8em;
    }

    .streak-flame-icon {
        font-size: 2em;
    }

    .friend-avatar {
        font-size: 3.5em;
    }

    .friend-name {
        font-size: 1.2em;
    }

    /* Friend Modal Responsive */
    .friend-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .friend-option-emoji {
        font-size: 2em;
    }
}

@media (max-width: 400px) {
    .adventure-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   LEARN & PLAY DASHBOARDS V2
   ================================ */
.dashboard-container-v2 {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 15px;
}

.dashboard-header-v2 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.back-btn-v2 {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.25);
    border: none;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.3em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-btn-v2:hover {
    background: rgba(255,255,255,0.35);
    transform: translateX(-2px);
}

.dashboard-title-v2 {
    color: white;
    font-size: 1.6em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.15);
}

/* Selection Card */
.selection-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.selection-title {
    font-size: 1.25em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #1f2937;
    margin-bottom: 16px;
    padding-left: 5px;
}

/* Operation Grid */
.operation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.op-card {
    background: #f3f4f6;
    border-radius: 16px;
    padding: 20px 15px 28px 15px; /* Extra bottom padding for level badge and progress bar */
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.op-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.op-card.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.op-card .op-icon {
    font-size: 2.5rem;
    font-weight: 300;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1;
}

.op-card.active .op-icon {
    color: white;
}

.op-card .op-name {
    font-size: 1em;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    color: #374151;
}

.op-card.active .op-name {
    color: white;
}

/* Level Grid */
.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.level-card {
    background: #f3f4f6;
    border-radius: 16px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.level-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.level-card.active {
    background: linear-gradient(135deg, #c471ed 0%, #f64f59 100%);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(196, 113, 237, 0.4);
}

.level-card .level-emoji {
    font-size: 2rem;
    margin-bottom: 8px;
}

.level-card .level-name {
    font-size: 1em;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    color: #374151;
    margin-bottom: 4px;
}

.level-card.active .level-name {
    color: white;
}

.level-card .level-range {
    font-size: 0.8em;
    font-family: var(--font-body);
    color: #6b7280;
    font-weight: var(--weight-medium);
}

.level-card.active .level-range {
    color: rgba(255, 255, 255, 0.9);
}

/* Start Button V2 */
.start-btn-v2 {
    width: 100%;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 16px;
    font-size: 1.15em;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.35);
    margin-top: 5px;
}

.start-btn-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.45);
}

.start-btn-v2:active {
    transform: translateY(0);
}

/* Practice Start Button - Orange gradient */
.start-btn-v2.practice-start {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.35);
}

.start-btn-v2.practice-start:hover {
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.45);
}

/* Play Start Button - Blue gradient */
.start-btn-v2.play-start {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.start-btn-v2.play-start:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45);
}

/* Stats Card V2 */
.stats-card {
    margin-top: 16px;
}

.stats-card-highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.stats-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stat-item-v2 {
    text-align: center;
    padding: 10px 5px;
}

.stat-icon-v2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.stat-value-v2 {
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #374151;
    line-height: 1.2;
}

.stat-label-v2 {
    font-size: 0.75rem;
    font-family: var(--font-body);
    color: #6b7280;
    font-weight: var(--weight-medium);
    margin-top: 2px;
}

/* Leaderboard Link */
.leaderboard-link {
    text-align: center;
    margin-top: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ================================
   LEARN & PLAY DASHBOARDS (Legacy)
   ================================ */
.dashboard-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

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

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.dashboard-title {
    color: white;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.section-label {
    color: white;
    font-size: 1em;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Topic Cards for Learn Dashboard */
.topic-section {
    margin-bottom: 15px;
}

.topic-cards {
    display: flex;
    gap: 10px;
}

.topic-card {
    flex: 1;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.topic-card:hover {
    transform: translateY(-3px);
}

.topic-card.active {
    border-color: #11998e;
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.3);
}

.topic-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.topic-name {
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.topic-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.topic-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #11998e, #38ef7d);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.topic-progress-text {
    font-size: 0.75em;
    color: #666;
    font-weight: bold;
}

/* Difficulty Buttons */
.difficulty-section {
    margin-bottom: 15px;
}

.difficulty-buttons, .operation-buttons {
    display: flex;
    gap: 8px;
}

.diff-btn, .op-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-weight: bold;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.diff-btn:hover, .op-btn:hover {
    transform: translateY(-2px);
}

.diff-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.op-btn.active {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.full-width {
    width: 100%;
    margin-bottom: 15px;
}

/* Learn Stats */
.learn-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
}

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

.learn-stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: white;
}

.learn-stat-label {
    font-size: 0.8em;
    color: rgba(255,255,255,0.8);
}

/* Play Stats Grid */
.play-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.play-stat-card {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}

.play-stat-card.highlight {
    background: linear-gradient(135deg, #fff5e6, #ffe5cc);
    border: 2px solid #feca57;
}

.play-stat-icon {
    font-size: 1.3em;
    margin-bottom: 3px;
}

.play-stat-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #667eea;
}

.play-stat-label {
    font-size: 0.65em;
    color: #999;
    text-transform: uppercase;
}

/* Operation Section */
.operation-section {
    margin-bottom: 15px;
}

/* Recent Scores */
.recent-scores {
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
}

.recent-label {
    color: white;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.recent-scores-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.9);
    font-weight: bold;
}

.no-scores {
    color: rgba(255,255,255,0.6);
    font-style: italic;
    font-weight: normal;
}

.recent-score-item {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 15px;
}

#view-leaderboard-btn {
    padding: 8px 20px;
    font-size: 0.85em;
}

/* ================================
   RESPONSIVE - Mode & Dashboards
   ================================ */
@media (max-width: 480px) {
    .topic-cards {
        flex-direction: column;
    }

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

    .difficulty-buttons, .operation-buttons {
        flex-wrap: wrap;
    }

    .diff-btn, .op-btn {
        flex: 1 1 45%;
    }
}

/* Game Screen */
.game-controls {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 20px;
}

.control-btn {
    padding: 12px 25px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.quit-btn {
    background: rgba(255, 99, 71, 0.1);
    color: #ff6348;
    border: 2px solid #ff6348;
}

.quit-btn:hover {
    background: #ff6348;
    color: white;
}

.pause-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

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

.pause-content {
    background: white;
    padding: 60px;
    border-radius: 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pause-content h2 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 20px;
}

.pause-content p {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 40px;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    flex-wrap: wrap;
    gap: 20px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-avatar {
    font-size: 3em;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.player-name-display {
    font-size: 1.5em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #333;
}

.game-stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 2em;
}

.stat-label {
    font-size: 0.9em;
    font-family: var(--font-body);
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #667eea;
}

/* Timer */
.timer-container {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.timer-label {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.timer-bar-wrapper {
    background: #e0e0e0;
    height: 25px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
    transition: width 0.1s linear;
    width: 100%;
    border-radius: 15px;
}

.timer-bar.warning {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 0.5s ease infinite;
}

.timer-text {
    display: block;
    text-align: center;
    font-size: 2.5em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #667eea;
    margin-top: 15px;
}

/* ===========================================
   Star Timer - Playful Visual Timer
   =========================================== */

.star-timer-container {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-radius: 20px;
    padding: 16px 24px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.2);
    border: 2px solid #fcd34d;
}

.star-timer-label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: var(--weight-semibold);
    color: #92400e;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.star-timer-stars {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.timer-star {
    font-size: 2.5rem;
    transition: all 0.5s ease;
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.4));
    animation: starFloat 2s ease-in-out infinite;
}

.timer-star:nth-child(1) { animation-delay: 0s; }
.timer-star:nth-child(2) { animation-delay: 0.2s; }
.timer-star:nth-child(3) { animation-delay: 0.4s; }
.timer-star:nth-child(4) { animation-delay: 0.6s; }
.timer-star:nth-child(5) { animation-delay: 0.8s; }

@keyframes starFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Active star - bright and golden */
.timer-star.active {
    opacity: 1;
    transform: scale(1);
}

/* Fading star - currently dimming */
.timer-star.fading {
    animation: starFade 1s ease-out forwards;
}

@keyframes starFade {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.4));
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
        filter: drop-shadow(0 4px 8px rgba(251, 191, 36, 0.6));
    }
    100% {
        opacity: 0.2;
        transform: scale(0.8);
        filter: grayscale(100%) drop-shadow(none);
    }
}

/* Dimmed star - time used */
.timer-star.dimmed {
    opacity: 0.2;
    transform: scale(0.8);
    filter: grayscale(100%);
    animation: none;
}

/* Star flying to score animation */
.timer-star.collecting {
    animation: starCollect 0.8s ease-out forwards;
}

@keyframes starCollect {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.5) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-100px) translateX(var(--fly-x, 0px));
    }
}

/* Star burst when all stars collected */
.timer-star.burst {
    animation: starBurst 0.6s ease-out forwards;
}

@keyframes starBurst {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(2);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.star-timer-hint {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #b45309;
    font-style: italic;
}

/* Bonus indicator when stars are collected */
.star-bonus-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: var(--weight-bold);
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.5);
    z-index: 1000;
    animation: bonusPopup 1.5s ease-out forwards;
}

@keyframes bonusPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(-30px);
    }
}

/* Responsive star timer */
@media (max-width: 768px) {
    .star-timer-container {
        padding: 12px 18px;
    }

    .timer-star {
        font-size: 2rem;
    }

    .star-timer-stars {
        gap: 8px;
    }

    .star-timer-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .star-timer-container {
        padding: 10px 14px;
        border-radius: 16px;
    }

    .timer-star {
        font-size: 1.6rem;
    }

    .star-timer-stars {
        gap: 6px;
    }

    .star-timer-hint {
        font-size: 0.75rem;
    }
}

/* Question Container - Base */
.question-container {
    background: transparent;
    padding: 20px;
    border-radius: 25px;
    text-align: center;
}

/* Quiz Card - Modern Design */
.quiz-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 20px;
}

/* Question Card - Colored Numbers */
.quiz-question-card {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 30px 50px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    animation: scaleIn 0.4s ease;
}

.quiz-num1 {
    font-size: 5rem;
    font-weight: var(--weight-bold);
    color: #3b82f6;
    font-family: var(--font-display);
}

.quiz-operator {
    font-size: 4rem;
    font-weight: var(--weight-semibold);
    color: #8b5cf6;
    font-family: var(--font-display);
}

.quiz-num2 {
    font-size: 5rem;
    font-weight: var(--weight-bold);
    color: #ec4899;
    font-family: var(--font-display);
}

/* Quiz Input Wrapper */
.quiz-input-wrapper {
    width: 100%;
    max-width: 400px;
}

.quiz-input-wrapper input,
#answer-input,
#practice-answer-input {
    width: 100%;
    padding: 22px 30px;
    font-size: 1.8rem;
    font-weight: var(--weight-medium);
    font-family: var(--font-body);
    border: 3px solid #e9d5ff;
    border-radius: 20px;
    text-align: center;
    background: #fefefe;
    color: #6b7280;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.quiz-input-wrapper input::placeholder,
#answer-input::placeholder,
#practice-answer-input::placeholder {
    color: #c4b5fd;
    font-weight: 400;
}

.quiz-input-wrapper input:focus,
#answer-input:focus,
#practice-answer-input:focus {
    outline: none;
    border-color: #c084fc;
    box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.2);
    transform: scale(1.02);
}

/* Quiz Buttons Container */
.quiz-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

/* Quiz Button - Modern Gradient Style */
.quiz-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 1.1rem;
    color: white;
    transition: all 0.3s ease;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}

.quiz-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
}

.quiz-btn-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.quiz-btn-text {
    line-height: 1.2;
    text-align: center;
}

/* Solution Button - Blue/Cyan Gradient */
.quiz-btn.solution-btn {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #0284c7 100%);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.quiz-btn.solution-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
}

.quiz-btn.solution-btn:active {
    transform: translateY(-1px);
}

.quiz-btn.solution-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Skip Button - Orange/Yellow Gradient (same as hint) */
.quiz-btn.skip-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.quiz-btn.skip-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.5);
}

/* Submit Button - Pink/Purple Gradient */
.quiz-btn.submit-btn {
    background: linear-gradient(135deg, #e879f9 0%, #d946ef 50%, #a855f7 100%);
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
}

.quiz-btn.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(217, 70, 239, 0.5);
}

.quiz-btn.submit-btn:active {
    transform: translateY(-1px);
}

/* Hidden question element for compatibility */
.question {
    display: none;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Feedback */
.feedback {
    text-align: center;
    font-size: 1.8em;
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    margin-top: 25px;
    min-height: 50px;
}

.feedback.correct {
    color: #38ef7d;
    animation: bounceIn 0.5s ease;
}

.feedback.incorrect {
    color: #f5576c;
    animation: shake 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

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

/* Results Screen */
.results-hero {
    text-align: center;
    margin-bottom: 30px;
}

.celebration-title {
    animation: celebration 1s ease;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.results-subtitle {
    font-size: 1.4em;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.results-card {
    background: white;
    border-radius: 25px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #f9f9f9;
    transform: translateX(5px);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.highlight {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
}

.result-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.result-item > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 20px;
}

.result-label {
    font-size: 1.3em;
    color: #666;
    font-weight: normal;
}

.result-value {
    font-size: 2em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #667eea;
}

.streak-update {
    text-align: center;
    font-size: 1.5em;
    padding: 25px;
    background: white;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    line-height: 1.6;
}

.badge-earned {
    text-align: center;
    font-size: 2em;
    padding: 35px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 25px;
    margin: 20px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    animation: badgePulse 1.5s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Leaderboard */
.leaderboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.leaderboard-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.tab-btn {
    flex: 1;
    max-width: 250px;
    padding: 18px 25px;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.5);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.tab-icon {
    font-size: 1.2em;
}

.leaderboard-list {
    background: white;
    border-radius: 25px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    max-height: 600px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: #f9f9f9;
    transform: translateX(5px);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.leaderboard-info {
    flex: 1;
    margin-left: 20px;
}

.leaderboard-info > div:first-child {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
}

.leaderboard-score {
    font-size: 1.5em;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #f5576c;
}

/* ================================
   LEARNING MODE V2 - Card Design
   ================================ */

.learn-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Two-column layout */
.learn-layout {
    display: flex;
    gap: 20px;
    padding: 16px;
}

/* Left Panel - Content */
.learn-content-panel {
    flex: 1;
    min-width: 0;
}

/* Right Panel - Actions */
.learn-action-panel {
    width: 220px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.action-panel-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #374151;
    margin: 0;
    text-align: center;
}

.learning-phase {
    display: none;
    animation: fadeIn 0.3s ease;
}

.learning-phase.active {
    display: block;
}

/* ========== NEW STEP-BASED LEARNING DESIGN ========== */

.learn-container-v2 {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(180deg, #f8f9ff 0%, #f0f4ff 100%);
    display: flex;
    flex-direction: column;
}

/* Header V2 */
.learn-header-v2 {
    background: linear-gradient(135deg, #667eea 0%, #9b59b6 50%, #e91e8c 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0 0 24px 24px;
}

.learn-header-content {
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.learn-header-icon {
    font-size: 1.3em;
}

.learn-header-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1em;
    cursor: pointer;
}

/* Controls Bar */
.learn-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.learn-control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.learn-control-btn.back {
    background: #f3f4f6;
    color: #374151;
}

.learn-control-btn.back:hover {
    background: #e5e7eb;
}

.voice-controls {
    display: flex;
    gap: 8px;
}

.learn-control-btn.voice,
.learn-control-btn.skip {
    background: #f3f4f6;
    color: #374151;
    padding: 8px 12px;
}

.learn-control-btn.voice:hover,
.learn-control-btn.skip:hover {
    background: #e5e7eb;
}

.learn-control-btn.voice.active {
    background: #dbeafe;
    color: #2563eb;
}

/* Progress Dots */
.learn-progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.progress-dot {
    width: 40px;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: linear-gradient(135deg, #667eea 0%, #9b59b6 100%);
    width: 50px;
}

.progress-dot.completed {
    background: #10b981;
}

/* Step Container */
.learn-step-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.learn-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.learn-step.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Content */
.step-icon {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 8px;
}

.step-title {
    font-size: 1.6rem;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: #1f2937;
    text-align: center;
    margin-bottom: 12px;
}

.step-subtitle {
    font-size: 1rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 12px;
}

.step-description {
    font-size: 1.2rem;
    color: #374151;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Keywords */
.keyword {
    font-weight: 700;
}
.keyword.blue { color: #3b82f6; }
.keyword.pink { color: #ec4899; }
.keyword.purple { color: #9b87f5; }
.keyword.green { color: #10b981; }
.keyword.orange { color: #f97316; }

/* Info Box */
.step-info-box {
    background: linear-gradient(135deg, #fdf4ff 0%, #fce7f3 100%);
    border-radius: 16px;
    padding: 14px 18px;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

.step-info-box p {
    font-size: 1rem;
    color: #6b21a8;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* Visual Text */
.step-visual-text {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin: 15px 0 10px;
}

.step-visual-text.blue { color: #3b82f6; }
.step-visual-text.pink { color: #ec4899; }

/* Emoji Row */
.step-emoji-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 2.5rem;
    margin: 10px 0;
    flex-wrap: wrap;
    max-width: 100%;
}

/* Emoji size variants for larger counts */
.step-emoji-row.emoji-medium {
    font-size: 1.8rem;
    gap: 6px;
}

.step-emoji-row.emoji-small {
    font-size: 1.3rem;
    gap: 4px;
}

.step-emoji-row.emoji-tiny {
    font-size: 1rem;
    gap: 3px;
}

/* Result Box */
.step-result-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 3px solid #10b981;
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.step-result-box .result-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #047857;
    margin-bottom: 10px;
}

/* Equation Box */
.step-equation-box {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 18px;
    padding: 18px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px auto;
    max-width: 350px;
}

.eq-num1, .eq-num2, .eq-op, .eq-equals, .eq-result {
    font-size: 2.5rem;
    font-weight: 800;
}

.eq-num1 { color: #3b82f6; }
.eq-op { color: #9b87f5; }
.eq-num2 { color: #ec4899; }
.eq-equals { color: #6b7280; }
.eq-result { color: #10b981; }

/* Number Cards */
.step-number-cards {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.number-card {
    border-radius: 14px;
    padding: 12px 20px;
    text-align: center;
    min-width: 85px;
}

.number-card.blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 3px solid #3b82f6;
}

.number-card.pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border: 3px solid #ec4899;
}

.number-card.green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 3px solid #10b981;
}

.number-card-value {
    font-size: 2.2rem;
    font-weight: 800;
}

.number-card.blue .number-card-value { color: #2563eb; }
.number-card.pink .number-card-value { color: #db2777; }
.number-card.green .number-card-value { color: #059669; }

.number-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.2;
}

.number-card.blue .number-card-label { color: #3b82f6; }
.number-card.pink .number-card-label { color: #ec4899; }
.number-card.green .number-card-label { color: #10b981; }

/* Step 4 Actions */
.step4-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px dashed #e5e7eb;
    width: 100%;
}

.step4-actions-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
}

/* Tips Cards */
.step-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.tip-card-v2 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 3px solid;
}

.tip-card-v2.cyan {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border-color: #00bcd4;
}

.tip-card-v2.pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: #e91e8c;
}

.tip-card-v2.lime {
    background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 100%);
    border-color: #84cc16;
}

.tip-card-v2.yellow {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border-color: #eab308;
}

.tip-card-v2 .tip-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.tip-card-v2 .tip-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #374151;
}

/* Navigation Footer */
.learn-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.learn-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.learn-nav-btn.prev {
    background: #f3f4f6;
    border: none;
    color: #6b7280;
}

.learn-nav-btn.prev:hover:not(:disabled) {
    background: #e5e7eb;
}

.learn-nav-btn.prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.learn-nav-btn.next {
    background: linear-gradient(135deg, #667eea 0%, #e91e8c 100%);
    border: none;
    color: white;
}

.learn-nav-btn.next:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.learn-nav-btn.next.finish {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.learn-step-indicator {
    font-size: 0.95rem;
    color: #6b7280;
    font-weight: 500;
}

/* Action Panel V2 */
.learn-action-panel-v2 {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.action-buttons-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-buttons-row.two-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.action-btn-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-v2.visual {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
    border: 2px solid #3b82f6;
}

.action-btn-v2.practice {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #db2777;
    border: 2px solid #ec4899;
}

.action-btn-v2.quiz {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    border: 2px solid #10b981;
}

.action-btn-v2.challenge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    border: 2px solid #f59e0b;
}

.action-btn-v2.video {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    border: 2px solid #6366f1;
}

.action-btn-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========== END NEW STEP-BASED DESIGN ========== */

/* Header Bar (legacy) */
.learn-header-bar {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.learn-header-bar.visual-header {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.learn-back-arrow {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.learn-back-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
}

.learn-header-title {
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    margin: 0;
}

.header-icon {
    font-size: 1.1em;
}

.header-badge {
    color: white;
    font-size: 1em;
    opacity: 0.8;
}

/* Voiceover Bar */
.voiceover-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.voice-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-btn:hover {
    background: #e5e7eb;
}

.voice-btn.skip-btn {
    color: #6b7280;
}

/* Content Cards Container */
.learn-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Base Card Style */
.learn-card {
    background: white;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.learn-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

/* Explanation Card - Purple border */
.explanation-card {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.explanation-card::before {
    background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
}

.explanation-card .card-text {
    font-size: 1.05em;
    line-height: 1.7;
    color: #374151;
}

.explanation-card .card-text .highlight {
    color: #7c3aed;
    font-weight: 700;
}

/* Real World Card - Pink/Green */
.realworld-card {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.realworld-card::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

/* Math Card - Yellow */
.math-card {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}

.math-card::before {
    background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
}

/* Tips Card - Green */
.tips-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.tips-card::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

/* Card Title */
.card-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title span {
    font-size: 1.2em;
}

/* Card Text */
.card-text {
    font-size: 1em;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* Math Equation Display */
.math-equation {
    font-size: 3em;
    font-weight: var(--weight-bold);
    text-align: center;
    padding: 15px 0;
    font-family: var(--font-display);
}

.math-equation .num1 {
    color: #3b82f6;
}

.math-equation .operator {
    color: #6b7280;
    margin: 0 8px;
}

.math-equation .num2 {
    color: #22c55e;
}

.math-equation .equals {
    color: #6b7280;
    margin: 0 8px;
}

.math-equation .result {
    color: #f59e0b;
}

.math-explanation {
    text-align: center;
    margin-top: 5px;
}

.math-explanation .num-highlight {
    font-weight: 700;
}

.math-explanation .num-highlight.blue { color: #3b82f6; }
.math-explanation .num-highlight.green { color: #22c55e; }
.math-explanation .num-highlight.orange { color: #f59e0b; }

/* Tips List V2 */
.tips-list-v2 {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list-v2 li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.95em;
    color: #374151;
    line-height: 1.5;
}

.tips-list-v2 li .tip-check {
    color: #22c55e;
    font-size: 1.1em;
    flex-shrink: 0;
}

.tips-list-v2 li .tip-emoji {
    font-size: 1.1em;
    flex-shrink: 0;
}

.tips-list-v2 li .tip-text {
    flex: 1;
}

/* Encouragement Message */
.learn-encouragement {
    text-align: center;
    padding: 10px 12px;
    font-size: 0.95em;
    font-weight: 600;
    color: #f59e0b;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-radius: 10px;
    border: 2px solid #fde047;
}

/* Action Buttons Container */
.learn-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Action Button Base Style */
.learn-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
}

.learn-action-btn span {
    font-size: 1.1em;
}

/* Visual Examples Button - Purple */
.visual-btn-action {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.visual-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* Let's Practice Button - Pink/Coral */
.practice-btn-action {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.practice-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}

/* Go to Quiz Button - Green */
.quiz-btn-action {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.quiz-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Create Video Button - Blue/Cyan */
.video-btn-action {
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.video-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.video-btn-action:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Video Progress Container */
.video-progress-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 16px;
    margin-top: 15px;
}

.video-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.video-progress-icon {
    font-size: 1.5em;
    animation: pulse 1.5s ease-in-out infinite;
}

.video-progress-title {
    font-weight: 700;
    color: #1e40af;
    font-size: 1em;
}

.video-progress-bar {
    height: 10px;
    background: #dbeafe;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.video-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #0ea5e9 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.video-progress-text {
    font-size: 0.85em;
    color: #3b82f6;
    font-weight: 600;
    text-align: center;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.video-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.video-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    color: white;
}

.video-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.video-actions .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.video-actions .btn-secondary:hover {
    background: #e5e7eb;
}

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

/* ============================================
   Level-Specific Learning Content Styles
   ============================================ */

/* Strategy Section (Step 2) */
.strategy-section {
    padding: 10px;
}

.strategy-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 15px;
    text-align: center;
}

.strategy-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.strategy-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    animation: slideInLeft 0.3s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.strategy-step .step-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.strategy-step .step-text {
    font-size: 1em;
    color: #1e40af;
    line-height: 1.4;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Example Section (Step 3) */
.example-section {
    padding: 10px;
}

.example-problem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    border-radius: 16px;
    border: 2px solid #e879f9;
}

.problem-label {
    font-size: 0.9em;
    color: #a855f7;
    font-weight: 600;
}

.problem-text {
    font-size: 1.8em;
    font-weight: 700;
    color: #7c3aed;
    font-family: 'Baloo 2', cursive;
}

.example-walkthrough {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.walkthrough-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 10px;
    border-left: 3px solid #22c55e;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.walkthrough-num {
    font-size: 1em;
    font-weight: 700;
    color: #16a34a;
    flex-shrink: 0;
}

.walkthrough-text {
    font-size: 0.95em;
    color: #166534;
    line-height: 1.4;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.example-visual {
    margin-top: 15px;
    padding: 15px;
    background: #1e293b;
    border-radius: 10px;
    overflow-x: auto;
}

.example-visual pre {
    margin: 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 1.1em;
    color: #f1f5f9;
    white-space: pre;
    text-align: center;
}

/* Practice Preview Section */
.practice-preview {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 12px;
    border: 2px solid #f59e0b;
}

.practice-preview h4 {
    font-size: 1em;
    font-weight: 700;
    color: #b45309;
    margin-bottom: 12px;
    text-align: center;
}

.practice-problems {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.practice-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #fcd34d;
}

.practice-q {
    font-size: 1.1em;
    font-weight: 700;
    color: #92400e;
}

.practice-hint {
    font-size: 0.85em;
    color: #b45309;
    font-style: italic;
}

/* Level Subtitle */
#learn-level-subtitle {
    font-size: 1em;
    color: #6366f1;
    font-weight: 600;
    text-align: center;
    margin-top: -5px;
    margin-bottom: 10px;
}

/* Enhanced tip card for level content */
.tip-card-v2 {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.tip-card-v2 .tip-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.tip-card-v2 .tip-text {
    font-size: 0.95em;
    line-height: 1.4;
}

/* Back Button in Action Panel */
.learn-action-panel .learn-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.learn-action-panel .learn-back-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.learn-action-panel .learn-back-btn span {
    font-size: 1em;
}

/* Progressive Reveal & Voiceover Styles */
.content-hidden {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.content-reveal {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.4s ease;
}

.speaking-highlight {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Visual Phase V2 */
.visual-card-v2 {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.visual-buttons {
    display: flex;
    gap: 12px;
    padding: 0 16px 16px;
}

.visual-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.visual-btn.another-btn {
    background: #f3f4f6;
    color: #374151;
}

.visual-btn.another-btn:hover {
    background: #e5e7eb;
}

.visual-btn.ready-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.visual-btn.ready-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.examples-counter {
    text-align: center;
    font-size: 0.9em;
    color: #6b7280;
    padding: 8px 0;
}

/* Visual Phase */
.visual-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.visual-card {
    width: 100%;
    text-align: center;
}

.visual-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.visual-container {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 250px;
}

.visual-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.examples-counter {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.visual-explanation {
    font-size: 0.95em;
    color: #555;
    margin: 5px 0;
}

/* Dot Visualization */
.dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-block;
    animation: pop-in 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.dot.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.dot.pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dot.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.dots-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: rgba(240, 147, 251, 0.1);
    border-radius: 15px;
    border: 3px dashed rgba(240, 147, 251, 0.3);
}

.visual-operator {
    font-size: 3em;
    font-weight: 900;
    color: #667eea;
    margin: 0 20px;
}

/* Number Line */
.number-line-container {
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
}

.number-line {
    width: 100%;
    height: auto;
}

/* Grid Visualization */
.grid-container {
    display: inline-grid;
    gap: 8px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    border: 3px solid rgba(102, 126, 234, 0.3);
}

.grid-cell {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    animation: pop-in 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Repeated Addition Groups */
.addition-groups {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.addition-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background: rgba(254, 202, 87, 0.2);
    border-radius: 12px;
    border: 2px dashed rgba(254, 202, 87, 0.5);
}

.group-label {
    font-size: 1.2em;
    font-weight: bold;
    color: #666;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Animations */
@keyframes pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    /* Navigation */
    .nav-content {
        padding: 8px 12px;
    }

    .nav-brand {
        gap: 8px;
    }

    .nav-logo {
        font-size: 1.5em;
    }

    .nav-title {
        font-size: 1.2em;
    }

    .nav-tagline {
        display: none;
    }

    .nav-links {
        gap: 5px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    /* Learning Mode */
    .learning-progress-bar {
        gap: 15px;
        padding: 6px 12px;
    }

    .learning-step {
        font-size: 0.8em;
        gap: 4px;
    }

    .step-number {
        width: 22px;
        height: 22px;
        font-size: 0.75em;
    }

    .step-label {
        font-size: 0.75em;
    }

    #learning-operation-title {
        font-size: 1.3em;
    }

    .concept-card {
        padding: 12px;
    }

    .concept-heading {
        font-size: 1.4em;
        margin-bottom: 10px;
    }

    .section-heading {
        font-size: 1em;
        margin-top: 10px;
        margin-bottom: 6px;
    }

    .concept-text {
        font-size: 0.95em;
        margin-bottom: 8px;
    }

    .math-display {
        font-size: 1.5em;
    }

    .real-world-box,
    .math-example-box,
    .tips-list {
        padding: 10px 12px;
        margin: 8px 0;
    }

    .tips-list li {
        font-size: 0.9em;
        padding: 4px 0;
        padding-left: 20px;
    }

    .visual-display {
        padding: 10px;
    }

    .visual-container {
        min-height: 200px;
    }

    .visual-controls {
        gap: 8px;
        padding: 8px 0;
    }

    .visual-controls .btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* General buttons */
    .btn {
        padding: 10px 18px;
        font-size: 0.95em;
    }

    .btn-large {
        padding: 12px 25px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 3px;
    }

    .nav-btn {
        padding: 5px 8px;
        font-size: 0.75em;
    }

    .nav-title {
        display: none;
    }

    .learning-progress-bar {
        gap: 10px;
        padding: 5px 10px;
    }

    .step-label {
        display: none;
    }

    #learning-operation-title {
        font-size: 1.2em;
    }

    .concept-heading {
        font-size: 1.2em;
    }

    .section-heading {
        font-size: 0.95em;
    }

    .concept-text {
        font-size: 0.9em;
    }

    .math-display {
        font-size: 1.4em;
    }

    .visual-container {
        min-height: 180px;
    }

    .visual-controls {
        flex-wrap: wrap;
    }

    .visual-controls .btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}

/* Learning Page V2 Responsive */
@media (max-width: 768px) {
    .learn-container {
        max-width: 100%;
    }

    .learn-layout {
        flex-direction: column;
        padding: 12px;
        gap: 16px;
    }

    .learn-action-panel {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        gap: 12px;
    }

    .learn-encouragement {
        width: 100%;
    }

    .action-panel-title {
        width: 100%;
    }

    .learn-action-buttons {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .learn-action-btn {
        flex: 1;
        min-width: 140px;
        padding: 12px 16px;
        font-size: 0.9em;
    }

    .learn-action-panel .learn-back-btn {
        width: 100%;
    }

    .learn-header-bar {
        padding: 14px 16px;
    }

    .learn-header-title {
        font-size: 1.1em;
    }

    .learn-cards {
        gap: 12px;
    }

    .learn-card {
        padding: 16px;
        border-radius: 14px;
    }

    .math-equation {
        font-size: 2.5em;
    }

    .visual-btn {
        padding: 12px 16px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .learn-layout {
        padding: 10px;
        gap: 12px;
    }

    .learn-action-panel {
        padding: 14px;
        gap: 10px;
    }

    .learn-action-buttons {
        flex-direction: column;
    }

    .learn-action-btn {
        min-width: 100%;
        padding: 10px 14px;
        font-size: 0.85em;
        border-radius: 10px;
    }

    .learn-action-btn span {
        font-size: 1em;
    }

    .action-panel-title {
        font-size: 1em;
    }

    .learn-header-bar {
        padding: 12px 14px;
    }

    .learn-back-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.1em;
    }

    .learn-header-title {
        font-size: 1em;
        gap: 6px;
    }

    .voiceover-bar {
        padding: 10px 12px;
        gap: 8px;
    }

    .voice-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .learn-cards {
        gap: 10px;
    }

    .learn-card {
        padding: 14px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 1em;
    }

    .card-text {
        font-size: 0.95em;
    }

    .math-equation {
        font-size: 2em;
        padding: 10px 0;
    }

    .tips-list-v2 li {
        font-size: 0.9em;
        padding: 6px 0;
    }

    .learn-encouragement {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .learn-action-panel .learn-back-btn {
        padding: 10px 14px;
        font-size: 0.85em;
    }

    .visual-card-v2 {
        margin: 10px;
        padding: 16px;
    }

    .visual-buttons {
        padding: 0 10px 10px;
        gap: 8px;
    }

    .visual-btn {
        padding: 10px 14px;
        font-size: 0.9em;
    }
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* General Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 25px;
        flex-direction: column;
    }

    .hero-title {
        font-size: 2em;
    }

    .hero-subtitle {
        font-size: 1.1em;
    }

    .section-title {
        font-size: 2em;
    }

    .title {
        font-size: 2em;
    }

    /* .question is now hidden, using quiz-question-card instead */

    /* answer-input styles now in quiz card responsive section */

    .btn {
        font-size: 1em;
        padding: 12px 24px;
    }

    .btn-large {
        font-size: 1.2em;
        padding: 15px 30px;
    }

    .profile-list {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
    }

    .game-stats {
        width: 100%;
        justify-content: space-around;
    }

    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .result-item > div {
        flex-direction: column;
        gap: 5px;
    }

    .math-symbol, .math-number {
        font-size: 2em;
    }

    /* Dashboard responsive */
    .dashboard-avatar {
        width: 50px;
        height: 50px;
        font-size: 2em;
    }

    .dashboard-name {
        font-size: 1.3em;
    }

    .dashboard-greeting {
        font-size: 0.85em;
    }

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

    .stat-card-value {
        font-size: 1.3em;
    }

    /* Difficulty settings responsive */
    .difficulty-settings {
        padding: 12px;
    }

    .settings-title {
        font-size: 1em;
    }

    .settings-subtitle {
        font-size: 0.8em;
    }

    .difficulty-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .difficulty-card {
        padding: 10px 5px;
    }

    .difficulty-icon {
        font-size: 1.5em;
    }

    .operation-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .operation-card {
        padding: 10px 5px;
    }

    .operation-icon {
        font-size: 1.5em;
    }

    .dashboard-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .dashboard-actions .btn {
        padding: 10px 8px;
        font-size: 0.8em;
    }

    /* Game controls responsive */
    .game-controls {
        justify-content: space-between;
    }

    .control-btn {
        padding: 10px 18px;
        font-size: 1em;
    }

    .pause-content {
        padding: 40px 30px;
    }

    .pause-content h2 {
        font-size: 2em;
    }

    .pause-content p {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6em;
    }

    /* .question is now hidden */

    /* Dashboard small screens */
    .dashboard-hero {
        padding: 10px 12px;
        gap: 10px;
    }

    .dashboard-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.8em;
    }

    .dashboard-name {
        font-size: 1.2em;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 8px 5px;
    }

    .stat-card-icon {
        font-size: 1.2em;
        margin-bottom: 3px;
    }

    .stat-card-value {
        font-size: 1.2em;
    }

    .stat-card-label {
        font-size: 0.6em;
    }

    .dashboard-actions {
        grid-template-columns: 1fr 1fr;
    }

    /* Game controls small screens */
    .control-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .control-btn span {
        display: none;
    }

    .pause-content {
        padding: 30px 20px;
    }

    .pause-content h2 {
        font-size: 1.8em;
    }
}

/* ================================
   PRACTICE MODE STYLES
   ================================ */

.btn-practice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.practice-intro {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.practice-intro-text {
    color: white;
    font-size: 1em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.practice-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
    margin-top: 15px;
}

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

.practice-stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: white;
}

.practice-stat-label {
    font-size: 0.85em;
    color: rgba(255,255,255,0.8);
}

/* Practice Session Screen */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.practice-progress {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.practice-question-container {
    background: transparent;
    border-radius: 25px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.practice-question-label {
    display: none;
}

.practice-question {
    display: none;
}

/* Practice uses same quiz-card styles */
/* Practice input disabled state */
#practice-answer-input:disabled {
    background: #f5f5f5;
    opacity: 0.7;
}

/* Practice uses quiz-buttons now */
.practice-buttons {
    display: none;
}

/* Legacy btn-hint - now using quiz-btn.hint-btn */
.btn-hint {
    display: none;
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.95em;
}

/* Hint Box */
.practice-hint-box {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe5cc 100%);
    border-left: 4px solid #feca57;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeIn 0.3s ease;
}

.hint-level {
    font-size: 1.1em;
    font-weight: bold;
    color: #ff9f43;
    margin-bottom: 10px;
}

.hint-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.hint-tip {
    color: #888;
    font-size: 0.95em;
}

/* Practice Feedback */
.practice-feedback {
    text-align: center;
    min-height: 60px;
}

.practice-correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 15px;
    padding: 20px;
    animation: bounceIn 0.5s ease;
}

.practice-correct .feedback-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

.practice-correct .feedback-text {
    font-size: 1.2em;
    color: #155724;
    font-weight: bold;
    display: block;
}

.practice-correct .feedback-score {
    display: block;
    margin-top: 10px;
    font-size: 1.1em;
    color: #28a745;
    font-weight: bold;
}

.practice-incorrect {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-radius: 15px;
    padding: 20px;
    animation: shake 0.5s ease;
}

.practice-incorrect .feedback-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

.practice-incorrect .feedback-text {
    font-size: 1.1em;
    color: #856404;
    font-weight: bold;
}

/* Solution Shown Feedback */
.practice-solution-shown {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 15px;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.practice-solution-shown .feedback-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

.practice-solution-shown .feedback-text {
    font-size: 1.2em;
    color: #0369a1;
    display: block;
}

.practice-solution-shown .feedback-text strong {
    font-size: 1.3em;
    color: #0284c7;
}

/* Step Breakdown */
.step-breakdown {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.step-breakdown h4 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.step-num {
    font-weight: bold;
    color: #667eea;
    min-width: 25px;
}

.step-desc {
    color: #666;
}

.step-calc {
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
}

.step-note {
    background: #feca57;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: bold;
}

.practice-step-display {
    margin-top: 15px;
}

/* ================================
   PRACTICE COMPLETE SCREEN
   ================================ */

.practice-complete-card {
    background: white;
    border-radius: 25px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    margin: 40px auto;
}

.practice-complete-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.practice-complete-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 25px;
}

.practice-complete-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 25px;
}

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

.practice-stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    font-family: var(--font-display);
}

.practice-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.practice-complete-message {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f4fc 100%);
    border-radius: 15px;
}

.practice-complete-question {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.practice-complete-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ================================
   DIVISION VISUAL STYLES
   ================================ */

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

.division-problem {
    font-size: 2.5em;
    font-weight: 900;
    color: #667eea;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.dividend, .divisor, .quotient {
    padding: 10px 20px;
    border-radius: 15px;
}

.dividend {
    background: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
    color: white;
}

.divisor {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quotient {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    min-width: 60px;
}

.division-symbol, .equals {
    color: #333;
}

.division-narration {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 25px;
    min-height: 30px;
}

.division-groups {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.group-container {
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    padding: 15px;
    min-width: 100px;
    text-align: center;
}

.group-label {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 50px;
    padding: 10px;
}

.group-item {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.group-item.visible {
    opacity: 1;
    transform: scale(1);
    animation: pop-in 0.3s ease;
}

.group-count {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

.division-tip {
    font-size: 1.1em;
    color: #38ef7d;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Weight Canvas */
#weight-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
}

/* ================================
   NEW COLOR SCHEME VARIABLES
   ================================ */
:root {
    --primary: #667eea;
    --secondary: #f093fb;
    --addition: #38ef7d;
    --subtraction: #f5576c;
    --multiplication: #4facfe;
    --division: #feca57;
    --success: #38ef7d;
    --warning: #feca57;
    --danger: #f5576c;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.15);
    --radius-small: 12px;
    --radius-medium: 20px;
    --radius-large: 25px;
}

/* ================================
   ENHANCED GLASSMORPHISM CARDS
   ================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-soft);
}

/* ================================
   ENHANCED BUTTON STYLES
   ================================ */
.btn {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.btn-glow {
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2),
                0 8px 20px rgba(0, 0, 0, 0.15),
                0 0 20px rgba(102, 126, 234, 0.3);
}

.btn-glow:hover {
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2),
                0 10px 25px rgba(0, 0, 0, 0.2),
                0 0 30px rgba(102, 126, 234, 0.5);
}

/* ================================
   SCREEN TRANSITIONS
   ================================ */
.screen {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.active {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* (Old mode card styles removed - replaced by adventure cards) */

/* ================================
   ENHANCED QUIZ QUESTION CARD
   ================================ */
/* Quiz question card animation */
.quiz-question-card {
    animation: questionPulse 3s ease-in-out infinite;
}

@keyframes questionPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

/* ================================
   ENHANCED TIMER BAR
   ================================ */
.timer-bar {
    position: relative;
    overflow: hidden;
}

.timer-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: timerShine 2s ease-in-out infinite;
}

@keyframes timerShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ================================
   ENHANCED STAT CARDS
   ================================ */
.stat-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Input field enhancements are now in the quiz-card section above */

/* ================================
   RIPPLE EFFECT FOR BUTTONS
   ================================ */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ================================
   LOADING STATES
   ================================ */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================
   ENHANCED PROFILE CARDS
   ================================ */
.profile-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-card:hover {
    transform: translateX(8px) scale(1.01);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.profile-card:active {
    transform: translateX(4px) scale(0.99);
}

/* ================================
   ENHANCED LEADERBOARD
   ================================ */
.leaderboard-item {
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-item:first-child {
    background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
}

.leaderboard-item:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-item:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32 0%, #daa06d 100%);
}

.leaderboard-item:first-child .leaderboard-rank,
.leaderboard-item:nth-child(2) .leaderboard-rank,
.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #333;
}

/* ================================
   NUMBER COUNTING ANIMATION
   ================================ */
.count-up {
    animation: countUp 0.5s ease-out;
}

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

/* ================================
   BOUNCE ANIMATION FOR CORRECT
   ================================ */
.bounce-correct {
    animation: bounceCorrect 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceCorrect {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ================================
   SHAKE ANIMATION FOR INCORRECT
   ================================ */
.shake-incorrect {
    animation: shakeIncorrect 0.5s ease-in-out;
}

@keyframes shakeIncorrect {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Operation-specific styling */
.topic-card[data-operation="addition"] .topic-icon,
.op-btn[data-operation="addition"].active {
    color: var(--addition);
}

.topic-card[data-operation="subtraction"] .topic-icon,
.op-btn[data-operation="subtraction"].active {
    color: var(--subtraction);
}

.topic-card[data-operation="multiplication"] .topic-icon,
.op-btn[data-operation="multiplication"].active {
    color: var(--multiplication);
}

.topic-card[data-operation="division"] .topic-icon,
.op-btn[data-operation="division"].active {
    color: var(--division);
}

/* Operation buttons 4-column layout */
.operation-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Practice Dashboard topic cards 4-column */
#practice-dashboard-screen .topic-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Learn Dashboard topic cards 4-column */
#learn-dashboard-screen .topic-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Responsive adjustments for 4-column */
@media (max-width: 600px) {
    .operation-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    #practice-dashboard-screen .topic-cards,
    #learn-dashboard-screen .topic-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================
   KID-FRIENDLY ADDITION VISUALS
   ================================ */

/* Easy Mode - Individual Counting Objects */
.visual-container {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Ensure visual container is scrollable on smaller screens */
@media (max-width: 768px) {
    .visual-container {
        min-height: 220px;
        overflow-x: auto;
    }

    .addition-visual-easy .object-row,
    .addition-visual-medium .number-display-row {
        flex-direction: column;
        gap: 15px;
    }

    .addition-visual-easy .plus-sign,
    .addition-visual-medium .medium-plus {
        font-size: 2em;
    }

    .addition-visual-easy .counting-object {
        font-size: 1.6rem;
    }

    .addition-visual-medium .bundle {
        font-size: 1.8rem;
    }

    .addition-visual-medium .loose-item {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .visual-container {
        min-height: 200px;
        padding: 10px;
    }

    .addition-visual-easy .object-group {
        padding: 10px;
        gap: 5px;
    }

    .addition-visual-easy .counting-object {
        font-size: 1.4rem;
    }

    .addition-visual-medium .number-box {
        padding: 10px;
        min-width: 120px;
    }

    .addition-visual-medium .bundle {
        font-size: 1.5rem;
    }
}

/* Practice Mode Visual Container */
.practice-visual-container {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.practice-visual-container .visual-container {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .practice-visual-container {
        padding: 10px;
    }

    .practice-visual-container .visual-container {
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    .practice-visual-container .visual-container {
        min-height: 100px;
        overflow-x: auto;
    }
}

/* ===========================================
   Quiz Card Responsive Styles
   =========================================== */

@media (max-width: 768px) {
    .quiz-card {
        padding: 20px 15px;
        gap: 16px;
    }

    .quiz-question-card {
        padding: 25px 35px;
        gap: 12px;
    }

    .quiz-num1,
    .quiz-num2 {
        font-size: 4rem;
    }

    .quiz-operator {
        font-size: 3.2rem;
    }

    .quiz-input-wrapper {
        max-width: 350px;
    }

    .quiz-input-wrapper input,
    #answer-input,
    #practice-answer-input {
        padding: 18px 24px;
        font-size: 1.5rem;
    }

    .quiz-buttons {
        max-width: 350px;
        gap: 12px;
    }

    .quiz-btn {
        padding: 16px 20px;
        min-height: 80px;
        font-size: 1rem;
    }

    .quiz-btn-icon {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .quiz-card {
        padding: 15px 10px;
        gap: 14px;
    }

    .quiz-question-card {
        padding: 20px 25px;
        gap: 10px;
        border-radius: 18px;
    }

    .quiz-num1,
    .quiz-num2 {
        font-size: 3rem;
    }

    .quiz-operator {
        font-size: 2.5rem;
    }

    .quiz-input-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .quiz-input-wrapper input,
    #answer-input,
    #practice-answer-input {
        padding: 16px 20px;
        font-size: 1.3rem;
        border-radius: 16px;
    }

    .quiz-buttons {
        max-width: 100%;
        width: 100%;
        gap: 10px;
    }

    .quiz-btn {
        padding: 14px 16px;
        min-height: 70px;
        font-size: 0.9rem;
        border-radius: 16px;
    }

    .quiz-btn-icon {
        font-size: 1.1rem;
    }

    .quiz-btn-text {
        font-size: 0.85rem;
    }

    .hint-count {
        font-size: 0.7rem;
    }
}

/* ===========================================
   Visual Hint Boxes - Practice Mode
   =========================================== */

.visual-hint-container {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-radius: 24px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
    border: 2px solid #fcd34d;
    animation: hintSlideIn 0.4s ease-out;
}

@keyframes hintSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visual-hint-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.visual-hint-header .hint-icon {
    font-size: 1.8rem;
}

.visual-hint-header .hint-title {
    font-size: 1.3rem;
    font-weight: var(--weight-semibold);
    color: #92400e;
    font-family: var(--font-display);
}

.visual-hint-boxes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* Individual number box */
.hint-number-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hint-box-label {
    font-size: 1rem;
    font-weight: var(--weight-semibold);
    color: #6b7280;
    font-family: var(--font-body);
}

/* The beautiful rounded box containing items */
.hint-items-box {
    background: white;
    border-radius: 20px;
    padding: 16px 20px;
    min-width: 80px;
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hint-items-box:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.12),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

/* Box color variants */
.hint-items-box.blue {
    border: 3px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.hint-items-box.pink {
    border: 3px solid #ec4899;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.hint-items-box.green {
    border: 3px solid #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.hint-items-box.purple {
    border: 3px solid #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

/* Items inside the box */
.hint-item {
    font-size: 1.5rem;
    line-height: 1;
    animation: itemPop 0.3s ease-out backwards;
}

.hint-item:nth-child(1) { animation-delay: 0.05s; }
.hint-item:nth-child(2) { animation-delay: 0.1s; }
.hint-item:nth-child(3) { animation-delay: 0.15s; }
.hint-item:nth-child(4) { animation-delay: 0.2s; }
.hint-item:nth-child(5) { animation-delay: 0.25s; }
.hint-item:nth-child(6) { animation-delay: 0.3s; }
.hint-item:nth-child(7) { animation-delay: 0.35s; }
.hint-item:nth-child(8) { animation-delay: 0.4s; }
.hint-item:nth-child(9) { animation-delay: 0.45s; }
.hint-item:nth-child(10) { animation-delay: 0.5s; }

@keyframes itemPop {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Operator between boxes */
.hint-operator {
    font-size: 2.5rem;
    font-weight: var(--weight-bold);
    color: #8b5cf6;
    font-family: var(--font-display);
}

/* Equals and result */
.hint-equals {
    font-size: 2.5rem;
    font-weight: var(--weight-bold);
    color: #6b7280;
    font-family: var(--font-display);
}

.hint-result-box {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 16px;
    padding: 12px 24px;
    font-size: 2rem;
    font-weight: var(--weight-bold);
    font-family: var(--font-display);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.hint-result-box.hidden {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Tip at the bottom */
.visual-hint-tip {
    text-align: center;
    font-size: 1rem;
    color: #92400e;
    font-style: italic;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #fcd34d;
}

/* Tens box (for medium difficulty) */
.hint-tens-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hint-tens-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    background: white;
    border-radius: 16px;
    padding: 12px;
    border: 3px solid;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    position: relative;
}

.hint-tens-grid.blue {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.hint-tens-grid.pink {
    border-color: #ec4899;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.hint-tens-grid .grid-item {
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint-tens-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* Loose items display */
.hint-loose-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    max-width: 120px;
}

.hint-loose-items .loose-item {
    font-size: 1.3rem;
}

/* Tens display container */
.hint-tens-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Crossed out items (for subtraction) */
.hint-item.crossed {
    opacity: 0.3;
    text-decoration: line-through;
    filter: grayscale(100%);
}

/* Responsive */
@media (max-width: 768px) {
    .visual-hint-container {
        padding: 18px;
        margin-top: 16px;
    }

    .visual-hint-boxes {
        gap: 14px;
    }

    .hint-items-box {
        padding: 12px 16px;
        min-width: 60px;
        gap: 4px;
    }

    .hint-item {
        font-size: 1.3rem;
    }

    .hint-operator,
    .hint-equals {
        font-size: 2rem;
    }

    .hint-result-box {
        font-size: 1.6rem;
        padding: 10px 20px;
    }

    .hint-tens-grid {
        padding: 8px;
        gap: 3px;
    }

    .hint-tens-grid .grid-item {
        font-size: 1rem;
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .visual-hint-container {
        padding: 14px;
        border-radius: 18px;
    }

    .visual-hint-header .hint-title {
        font-size: 1.1rem;
    }

    .visual-hint-boxes {
        gap: 10px;
    }

    .hint-items-box {
        padding: 10px 12px;
        min-width: 50px;
        border-radius: 14px;
    }

    .hint-item {
        font-size: 1.1rem;
    }

    .hint-operator,
    .hint-equals {
        font-size: 1.6rem;
    }

    .hint-result-box {
        font-size: 1.4rem;
        padding: 8px 16px;
    }
}

/* ===========================================
   Progressive Level System Styles
   =========================================== */

/* Level Badge - Hidden (level info shown in separate display on selection) */
.level-badge {
    display: none;
}

/* Level Progress Bar on Operation Cards */
.level-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(0, 0, 0, 0.15);
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.5s ease;
    width: 0%;
}

/* Level Display Card on Dashboards */
.level-display-card {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 2px solid #818cf8;
}

.current-level-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
}

.current-level-info .level-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #4f46e5;
    font-family: var(--font-display);
}

.current-level-info .level-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #6366f1;
}

.current-level-info .level-desc {
    font-size: 0.9em;
    color: #6b7280;
    text-align: center;
}

/* Game Screen Level Indicator */
.game-level-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.level-badge-game {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.85em;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
}

.level-name-game {
    font-size: 0.95em;
    font-weight: 600;
    color: #4b5563;
}

/* Play Mode Streak Counter */
.play-streak-container {
    position: fixed;
    top: 80px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 50;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.play-streak-container.visible {
    opacity: 1;
    transform: translateX(0);
}

.play-streak-container .streak-fire {
    font-size: 1.3em;
    animation: fireFlicker 0.5s ease infinite alternate;
}

@keyframes fireFlicker {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.1) rotate(5deg); }
}

.play-streak-container .streak-counter {
    font-size: 1.4em;
    font-weight: 700;
    font-family: var(--font-display);
    color: #f97316;
}

.play-streak-container .streak-label {
    font-size: 0.85em;
    color: #6b7280;
    font-weight: 500;
}

/* Highlight when close to speed promotion */
.play-streak-container.speed-streak {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
    animation: speedPulse 0.8s ease infinite;
}

.play-streak-container.fast-track-streak {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

@keyframes speedPulse {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(0) scale(1.05); }
}

/* Speed Rating Popup */
.speed-rating {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 20px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.speed-rating.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.speed-rating .speed-stars {
    font-size: 2em;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.speed-rating .speed-label {
    font-size: 1.1em;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

/* Speed rating color variations */
.speed-rating.speed-5-star {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.6);
}

.speed-rating.speed-5-star .speed-label {
    color: #fffbeb;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.speed-rating.speed-4-star {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.speed-rating.speed-4-star .speed-label {
    color: #dbeafe;
}

.speed-rating.speed-3-star {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

.speed-rating.speed-3-star .speed-label {
    color: #d1fae5;
}

.speed-rating.speed-2-star {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.speed-rating.speed-2-star .speed-label {
    color: #e0e7ff;
}

.speed-rating.speed-1-star {
    background: rgba(0, 0, 0, 0.85);
}

.speed-rating.speed-1-star .speed-label {
    color: #9ca3af;
}

/* Level Up Modal Action Buttons */
.level-up-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

.level-up-action-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1em;
    border-radius: 16px;
    font-weight: 600;
}

.level-up-action-btn:first-child {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.level-up-action-btn:last-child {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.level-up-skip-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.level-up-skip-btn:hover {
    color: white;
}

/* Level Up Modal */
.level-up-modal .modal-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    max-width: 360px;
    animation: modalPop 0.4s ease;
}

@keyframes modalPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.level-up-stars {
    font-size: 2em;
    margin-bottom: 8px;
    animation: starBounce 0.6s ease infinite alternate;
}

@keyframes starBounce {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* Learning Friend in Level Up Modal */
.level-up-friend-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.level-up-friend {
    font-size: 4em;
    animation: friendBounce 0.8s ease infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes friendBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.level-up-speech-bubble {
    background: white;
    border-radius: 16px;
    padding: 12px 16px;
    position: relative;
    max-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: speechPop 0.5s ease 0.3s both;
}

.level-up-speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border: 10px solid transparent;
    border-right-color: white;
}

@keyframes speechPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.level-up-speech-bubble p {
    margin: 0;
    color: #1e1b4b;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.3;
}

.level-up-title {
    font-size: 2em;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 16px;
    font-family: var(--font-display);
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.level-up-badge {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
    animation: badgePulse 1.5s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 35px rgba(251, 191, 36, 0.6); }
}

.new-level-number {
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    font-family: var(--font-display);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.level-up-name {
    font-size: 1.4em;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 8px;
}

.level-up-message {
    font-size: 0.95em;
    color: #c7d2fe;
    margin-bottom: 20px;
}

.level-up-progress {
    margin-bottom: 20px;
}

.level-up-progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.level-up-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.level-up-progress-text {
    font-size: 0.85em;
    color: #a5b4fc;
}

#level-up-continue-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 700;
    color: #1e1b4b;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

#level-up-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
}

/* Responsive Level Styles */
@media (max-width: 480px) {
    .level-badge {
        font-size: 0.65em;
        padding: 3px 8px;
    }

    .game-level-indicator {
        padding: 6px 12px;
        gap: 8px;
    }

    .level-badge-game {
        font-size: 0.75em;
        padding: 3px 10px;
    }

    .level-name-game {
        font-size: 0.85em;
    }

    .level-up-modal .modal-content {
        padding: 24px 20px;
        margin: 0 16px;
    }

    .level-up-badge {
        width: 80px;
        height: 80px;
    }

    .new-level-number {
        font-size: 2em;
    }

    .level-up-title {
        font-size: 1.6em;
    }
}

/* ===========================================
   LEARNING JOURNEY CARD STYLES (Right Panel)
   =========================================== */

/* Journey Card Container */
.journey-card {
    background: linear-gradient(160deg, #4facfe 0%, #00f2fe 50%, #a8edea 100%);
    border-radius: 28px;
    padding: 20px 18px;
    box-shadow:
        0 12px 40px rgba(79, 172, 254, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    min-height: 580px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Subtle texture overlay */
.journey-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.25) 0%, transparent 50%);
    pointer-events: none;
}

.journey-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.journey-card-icon {
    font-size: 1.4em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.journey-card-title {
    font-family: var(--font-display);
    font-size: 1.4em;
    font-weight: var(--weight-bold);
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(100, 80, 150, 0.25);
    letter-spacing: -0.3px;
}

/* Operation Tabs in Journey Card */
.journey-op-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.journey-op-tab {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25em;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.journey-op-tab:hover {
    background: rgba(255, 255, 255, 0.38);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.journey-op-tab.active {
    background: white;
    color: #0891b2;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Journey Path in Card */
.journey-card-path {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 6px;
    position: relative;
    z-index: 1;
}

/* Journey Milestone Item */
.journey-milestone {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding: 1px 0;
}

/* Connector Line Between Milestones */
.journey-milestone:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 52px;
    width: 4px;
    height: calc(100% + 2px);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    z-index: 0;
}

.journey-milestone.completed:not(:last-child)::before {
    background: linear-gradient(180deg, #ffb833 0%, #ffcc44 100%);
    box-shadow: 0 0 8px rgba(255, 184, 51, 0.3);
}

.journey-milestone.current:not(:last-child)::before {
    background: linear-gradient(180deg, #ffb833 40%, rgba(255, 255, 255, 0.5) 100%);
}

/* Milestone Marker Circle */
.journey-milestone-marker {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5em;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.journey-milestone.completed .journey-milestone-marker {
    background: linear-gradient(145deg, #ffcc33 0%, #ff9f1c 100%);
    box-shadow:
        0 4px 14px rgba(255, 159, 28, 0.5),
        inset 0 1px 3px rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
}

.journey-milestone.current .journey-milestone-marker {
    background: linear-gradient(145deg, #ffcc33 0%, #ff9f1c 100%);
    box-shadow:
        0 4px 18px rgba(255, 159, 28, 0.6),
        inset 0 1px 3px rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    animation: journey-pulse 2s infinite;
}

.journey-milestone.locked .journey-milestone-marker {
    background: rgba(148, 163, 184, 0.7);
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.25);
}

@keyframes journey-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Milestone Content Card */
.journey-milestone-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 11px 14px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.journey-milestone.current .journey-milestone-content {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
    padding: 12px 14px;
}

/* Locked content card - keep it visible, just slightly less prominent */
.journey-milestone.locked .journey-milestone-content {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.25);
}

.journey-milestone-name {
    font-family: var(--font-display);
    font-size: 1.1em;
    font-weight: var(--weight-bold);
    color: #1e3a5f;
    margin: 0 0 2px 0;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Keep text visible for locked - only marker is gray */
.journey-milestone.locked .journey-milestone-name {
    color: #2d4a6f;
}

.journey-milestone-level {
    font-size: 0.85em;
    color: #3d5a80;
    font-weight: 500;
}

/* Keep level text visible for locked */
.journey-milestone.locked .journey-milestone-level {
    color: #5a7a9a;
}

/* Star Badge for Completed */
.journey-star-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.25em;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
}

/* "YOU ARE HERE" Badge */
.journey-here-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 0.6em;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow:
        0 2px 8px rgba(238, 90, 90, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: here-pulse 2s infinite;
    white-space: nowrap;
}

@keyframes here-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(238, 90, 90, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 4px 14px rgba(238, 90, 90, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
}

/* Progress info in current milestone */
.journey-milestone-progress {
    margin-top: 6px;
    font-size: 0.8em;
    color: #2d4a6f;
    font-weight: 500;
}

.journey-milestone-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.journey-milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* Clickable Journey Milestones */
.journey-milestone.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.journey-milestone.clickable:hover {
    transform: translateX(4px);
}

.journey-milestone.clickable:hover .journey-milestone-content {
    background: linear-gradient(135deg, #e0f2fe 0%, #cffafe 100%);
    border-color: #0ea5e9;
}

.journey-milestone.clickable:hover .journey-milestone-marker {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.journey-play-hint {
    font-size: 0.7em;
    color: #0ea5e9;
    font-weight: 600;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.journey-milestone.clickable:hover .journey-play-hint {
    opacity: 1;
}

/* Responsive Journey Card */
@media (max-width: 1200px) {
    .panel-right {
        width: 360px;
    }

    .journey-card {
        min-height: 520px;
        padding: 16px 14px;
    }

    .journey-card-title {
        font-size: 1.1em;
    }

    .journey-milestone-marker {
        width: 42px;
        height: 42px;
        font-size: 1.2em;
    }

    .journey-milestone:not(:last-child)::before {
        left: 19px;
        top: 44px;
    }

    .journey-milestone-content {
        padding: 8px 12px;
    }

    .journey-milestone-name {
        font-size: 0.9em;
    }

    .journey-op-tab {
        width: 38px;
        height: 38px;
        font-size: 1.15em;
    }
}

/* ===========================================
   PLAY SCREEN - Consistent with Site Theme
   Based on docs/branding.md guidelines
   =========================================== */

/* Game Container - uses site background (inherited) */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    max-width: 550px;
    margin: 0 auto;
}

/* Level Header Banner - White card with brand accent badge */
.game-level-banner {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.level-badge-v2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: var(--font-display);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.level-badge-v2 .badge-icon {
    font-size: 1em;
}

.level-name-v2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
}

.level-sparkle {
    font-size: 1.3rem;
    animation: gentleSparkle 2s ease-in-out infinite;
}

@keyframes gentleSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.1) rotate(8deg); opacity: 0.85; }
}

/* Profile Info Card - White card consistent with site */
.game-profile-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
}

.profile-streak {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f97316;
}

.profile-stats {
    display: flex;
    gap: 8px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: 12px;
    min-width: 72px;
}

.stat-box.score {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border: 2px solid #fbbf24;
}

.stat-box.questions {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #60a5fa;
}

.stat-box .stat-icon {
    font-size: 1.1rem;
    margin-bottom: 1px;
}

.stat-box .stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.stat-box .stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

/* Bonus Stars Card - Gold accent for rewards */
.game-stars-card {
    width: 100%;
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border: 2px solid #fbbf24;
    border-radius: 20px;
    padding: 14px 20px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.25);
}

.stars-header {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #b45309;
    margin-bottom: 8px;
}

.stars-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}

.stars-row .timer-star {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.4));
    transition: all 0.5s ease;
    animation: starFloat 2s ease-in-out infinite;
}

.stars-row .timer-star:nth-child(1) { animation-delay: 0s; }
.stars-row .timer-star:nth-child(2) { animation-delay: 0.1s; }
.stars-row .timer-star:nth-child(3) { animation-delay: 0.2s; }
.stars-row .timer-star:nth-child(4) { animation-delay: 0.3s; }
.stars-row .timer-star:nth-child(5) { animation-delay: 0.4s; }

.stars-row .timer-star.dimmed {
    opacity: 0.2;
    filter: grayscale(100%);
    animation: none;
    transform: scale(0.8);
}

.stars-row .timer-star.fading {
    animation: starFade 0.8s ease-out forwards;
}

.stars-hint {
    font-size: 0.8rem;
    color: #92400e;
    font-weight: 500;
}

/* Question Card - White card consistent with site */
.game-question-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 24px 30px;
    text-align: center;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.question-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.question-prefix,
.question-suffix {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #374151;
}

.question-num {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
}

.question-num.num1 {
    color: #3b82f6;
}

.question-num.num2 {
    color: #ec4899;
}

.question-op {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    color: #8b5cf6;
}

/* Answer Section */
.game-answer-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-answer-input {
    width: 100%;
    padding: 16px 22px;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-display);
    border: 3px solid #c4b5fd;
    border-radius: 15px;
    text-align: center;
    background: white;
    color: #4b5563;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.game-answer-input::placeholder {
    color: #a5b4fc;
    font-weight: 400;
}

.game-answer-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.game-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.game-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
}

.game-btn.skip {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.35);
}

.game-btn.skip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(100, 116, 139, 0.45);
}

.game-btn.submit {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.game-btn.submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45);
}

.game-btn .btn-icon {
    font-size: 1.1rem;
}

/* Responsive Game Screen */
@media (max-width: 768px) {
    .game-container {
        gap: 12px;
        padding: 10px;
    }

    .game-level-banner {
        padding: 12px 18px;
    }

    .level-badge-v2 {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .level-name-v2 {
        font-size: 1.1rem;
    }

    .game-profile-card {
        padding: 14px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .profile-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .profile-name {
        font-size: 1.05rem;
    }

    .stat-box {
        padding: 6px 12px;
        min-width: 65px;
    }

    .stat-box .stat-value {
        font-size: 1.1rem;
    }

    .game-stars-card {
        padding: 12px 14px;
    }

    .stars-row .timer-star {
        font-size: 1.8rem;
    }

    .stars-row {
        gap: 8px;
    }

    .game-question-card {
        padding: 20px 16px;
    }

    .question-prefix,
    .question-suffix {
        font-size: 1.2rem;
    }

    .question-num {
        font-size: 2.5rem;
    }

    .question-op {
        font-size: 2.1rem;
    }

    .game-answer-input {
        padding: 14px 16px;
        font-size: 1.3rem;
    }

    .game-btn {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-level-banner {
        padding: 10px 14px;
        gap: 10px;
    }

    .level-badge-v2 {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .level-name-v2 {
        font-size: 0.9rem;
    }

    .level-sparkle {
        font-size: 1.1rem;
    }

    .profile-stats {
        width: 100%;
        justify-content: center;
    }

    .question-num {
        font-size: 2.2rem;
    }

    .question-op {
        font-size: 1.8rem;
    }

    .question-prefix,
    .question-suffix {
        font-size: 1rem;
    }

    .stars-row .timer-star {
        font-size: 1.5rem;
    }

    .game-answer-input {
        padding: 12px 14px;
        font-size: 1.1rem;
    }

    .game-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .game-btn .btn-icon {
        font-size: 1rem;
    }
}

/* ===========================================
   Quit Confirmation Modal
   =========================================== */

#quit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

#quit-modal.active {
    display: flex;
}

#quit-modal .modal-content {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s ease;
}

.quit-modal-content {
    text-align: center;
    padding: 30px;
    max-width: 360px;
}

.quit-modal-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.quit-modal-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.quit-modal-message {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.5;
}

.quit-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.quit-modal-buttons .btn {
    min-width: 120px;
    padding: 12px 20px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
}
