:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f97316;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}



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

html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(to right, #171b2f 0%, #171b2f 100%);
    min-height: 100vh;
    height: 100%;
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

.curtain {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #8b0000 0%, #dc143c 30%, #ff0000 50%, #dc143c 70%, #8b0000 100%);
    box-shadow: 
        inset 0 0 100px rgba(0, 0, 0, 0.7),
        0 0 50px rgba(220, 20, 60, 0.5),
        inset 20px 0 60px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.curtain::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 50px,
        rgba(255, 255, 255, 0.03) 50px,
        rgba(255, 255, 255, 0.03) 52px
    );
}

.curtain-left {
    left: 0;
    transform-origin: left center;
    border-right: 3px solid rgba(255, 255, 255, 0.1);
}

.curtain-right {
    right: 0;
    transform-origin: right center;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.curtain-tieback {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d4af37 0%, #f0c000 50%, #d4af37 100%);
    border-radius: 50%;
    box-shadow: 
        0 4px 15px rgba(212, 175, 55, 0.5),
        inset 0 -3px 10px rgba(0, 0, 0, 0.3);
    z-index: 15;
}

.curtain-left .curtain-tieback {
    right: -30px;
}

.curtain-right .curtain-tieback {
    left: -30px;
}

.curtain-tieback::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.loading-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.logo-container {
    margin-bottom: 30px;
}

.loading-icon {
    font-size: 6rem;
    background: linear-gradient(135deg, #ffd700, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1.5s ease-in-out infinite;
    display: block;
    margin-bottom: 20px;
}

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

.loading-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 10px;
}

.loading-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loading-bar-container {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 30px auto;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* App Container */
#app {
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
    width: 100%;
}

/* Header */
.header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.logo-text:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.2);
}

.points-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.points-display i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.points-display span {
    font-weight: 700;
    font-size: 1.1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.google-signin-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic i {
    font-size: 1rem;
    color: white;
}

/* Profile Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(5px);
}

.profile-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.profile-modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 1px solid var(--border-color);
    animation: scaleIn 0.2s ease;
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.profile-modal-header h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.profile-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.profile-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.profile-modal-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.profile-picture-section {
    text-align: center;
}

.profile-pic-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 3px solid var(--border-color);
    transition: all 0.3s;
}

.profile-pic-large:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.profile-pic-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic-large i {
    font-size: 3rem;
    color: white;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.camera-btn, .upload-btn, .remove-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.camera-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.upload-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.upload-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

.remove-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.profile-info-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-info-section label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-info-section input {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.profile-info-section input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.profile-info-section input::placeholder {
    color: var(--text-secondary);
}

.profile-modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.cancel-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.save-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #171b2f 0%, #1a1a2e 50%, #171b2f 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    animation: fadeIn 0.3s ease;
}

.login-modal.active {
    display: flex;
}

.login-modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 45px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 0 60px rgba(99, 102, 241, 0.3),
        0 0 100px rgba(139, 92, 246, 0.2);
}

.login-modal-header {
    margin-bottom: 30px;
}

.login-logo {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 5px;
}

.login-modal-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: bounce 2s ease-in-out infinite;
}

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

.login-icon i {
    font-size: 2.5rem;
    color: white;
}

.login-modal-body h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.login-modal-body p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 30px;
}

.google-signin-login {
    margin-bottom: 20px;
}

.guest-login-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.guest-login-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.guest-login-btn i {
    font-size: 1.2rem;
}

/* Power-Up Modal */
.powerup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(10px);
}

.powerup-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.powerup-modal-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    border-radius: 24px;
    padding: 35px;
    max-width: 500px;
    width: 90%;
    border: 2px solid rgba(99, 102, 241, 0.5);
    animation: powerUpScaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 0 60px rgba(99, 102, 241, 0.3),
        0 0 100px rgba(139, 92, 246, 0.2);
}

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

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

.powerup-modal-header h3 {
    font-size: 1.8rem;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.powerup-modal-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.powerup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.powerup-item {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.powerup-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.powerup-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-8px) scale(1.05);
    background: rgba(251, 191, 36, 0.1);
    box-shadow: 0 15px 35px rgba(251, 191, 36, 0.2);
}

.powerup-item:hover::before {
    transform: scaleX(1);
}

.powerup-icon {
    font-size: 2.5rem;
    animation: powerUpPulse 1.5s ease-in-out infinite;
}

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

.powerup-item:hover .powerup-icon {
    animation: none;
    transform: scale(1.2);
}

.powerup-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.powerup-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.audio-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.audio-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.audio-btn.active {
    animation: pulseAudio 1s ease-in-out infinite;
}

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

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Home Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.cta-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.play-button {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    box-shadow: 
        0 0 30px rgba(245, 158, 11, 0.5),
        0 0 60px rgba(139, 92, 246, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    translate: none;
    rotate: none;
    scale: none;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.play-button:hover::before {
    left: 100%;
}

.play-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 0 40px rgba(245, 158, 11, 0.7),
        0 0 80px rgba(139, 92, 246, 0.5),
        0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

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

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.feature-card i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.feature-card:hover i {
    animation: featureIcon3D 0.5s ease-in-out;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6));
}

@keyframes featureIcon3D {
    0% {
        transform: rotateZ(0deg) scale(1);
    }
    25% {
        transform: rotateZ(10deg) scale(1.05);
    }
    50% {
        transform: rotateZ(-10deg) scale(1.1);
    }
    75% {
        transform: rotateZ(5deg) scale(1.05);
    }
    100% {
        transform: rotateZ(0deg) scale(1.1);
    }
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Subjects Section */
#subjects h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 30px;
}

.level-btn {
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.level-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.level-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

#subjects h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

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

.subject-card {
    background: var(--bg-card);
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.subject-card:hover::before {
    transform: scaleX(1);
}

.subject-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.2);
}

.subject-card i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.subject-card:hover i {
    animation: icon3D 0.6s ease-in-out;
    text-shadow: 
        0 0 20px var(--primary-color),
        0 0 40px rgba(99, 102, 241, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes icon3D {
    0% {
        transform: rotateY(0deg) rotateX(0deg) scale(1);
    }
    25% {
        transform: rotateY(15deg) rotateX(-10deg) scale(1.05);
    }
    50% {
        transform: rotateY(-15deg) rotateX(10deg) scale(1.1);
    }
    75% {
        transform: rotateY(10deg) rotateX(-5deg) scale(1.05);
    }
    100% {
        transform: rotateY(0deg) rotateX(0deg) scale(1.1);
    }
}

.subject-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.subject-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Game Section */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.subject-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: clamp(12px, 2.5vw, 14px);
}

.question-count {
    color: var(--text-secondary);
    font-size: clamp(14px, 3vw, 16px);
}

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

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 600;
}

.stat-item i {
    color: var(--accent-color);
}

.stat-item:last-child i {
    color: var(--primary-color);
}

.timer-warning {
    color: var(--danger-color);
    animation: shake 0.5s ease-in-out infinite;
}

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

.timer-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 32px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--accent-color));
    border-radius: 3px;
    transition: width 1s linear;
}

.timer-bar.warning {
    background: linear-gradient(90deg, var(--warning-color), var(--danger-color));
    animation: pulseBar 0.5s ease-in-out infinite;
}

@keyframes pulseBar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#game.red-flash {
    position: relative;
}

#game.red-flash::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(239, 68, 68, 0);
    pointer-events: none;
    z-index: 100;
    animation: redGameFlash 0.3s ease-in-out infinite;
    border-radius: 20px;
}

@keyframes redGameFlash {
    0%, 100% { 
        opacity: 0;
    }
    50% { 
        opacity: 0.4;
        background-color: rgba(239, 68, 68, 0.5);
    }
}

/* Flashcard */
.flashcard-container {
    perspective: 1000px;
    margin-bottom: 32px;
}

.flashcard {
    width: min(550px, 90vw);
    max-width: 100%;
    height: min(400px, 55vh);
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    cursor: pointer;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 1px solid var(--border-color);
}

.flashcard-back {
    transform: rotateY(180deg);
}

.flashcard-icon {
    margin-bottom: 20px;
    perspective: 1000px;
}

.flashcard-icon i {
    font-size: 3.5rem;
    color: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
}

.flashcard-back .flashcard-icon i {
    color: var(--accent-color);
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) rotateY(0deg);
    }
    50% {
        transform: translateY(-10px) rotateY(5deg);
    }
}

.flashcard-front h3,
.flashcard-back h3 {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    text-align: center;
    line-height: 1.4;
    color: var(--text-primary);
}

.flashcard-back h3 {
    color: var(--accent-color);
}

.flashcard .explanation,
.flashcard .example {
    margin-top: 20px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: center;
    max-width: 100%;
    border: 1px solid rgba(99, 102, 241, 0.3);
    line-height: 1.6;
}

.flashcard .explanation {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    font-weight: 500;
}

.flashcard .example {
    margin-top: 15px;
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Options */
.options-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 700px;
    width: 100%;
    padding: 0 20px;
}

.option-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 16px;
    color: var(--text-primary);
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-btn:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-3px);
}

.option-btn.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border-color: var(--success-color);
    color: var(--success-color);
}

.option-btn.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.option-btn.disabled {
    cursor: not-allowed;
}

.option-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Power-up Notification */
.powerup-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-50px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.powerup-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.powerup-title {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.powerup-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.powerup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.powerup-btn:nth-child(1) {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.powerup-btn:nth-child(2) {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.powerup-btn:nth-child(3) {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.powerup-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.powerup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.powerup-btn span {
    font-size: 1.2rem;
}

/* Results Section */
#results {
    text-align: center;
}

#results h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--accent-color), var(--warning-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 500px;
    margin: 0 auto 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#redemption-info {
    color: var(--warning-color);
    margin-bottom: 20px;
    font-size: 1rem;
}

.results-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.results-buttons button {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.results-buttons button:first-child {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.results-buttons button:last-child {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.results-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Leaderboard Section */
#leaderboard h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-container {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 2fr;
    gap: 20px;
    padding: 20px 24px;
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 2fr;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

.rank {
    font-weight: 700;
    font-size: 1.2rem;
}

.rank:nth-child(-n+3) {
    background: linear-gradient(135deg, var(--accent-color), var(--warning-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-name {
    font-weight: 600;
}

.player-points {
    font-weight: 700;
    color: var(--accent-color);
}

.player-subject {
    color: var(--text-secondary);
}

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

.confetti {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: confettiFall 5s ease-in forwards;
}

.confetti.square {
    border-radius: 2px;
}

.confetti.triangle {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.firework-particle {
    position: absolute;
    pointer-events: none;
    animation: fireworkExplode var(--velocity, 2s) ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes fireworkExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance, 100px)),
            calc(sin(var(--angle)) * var(--distance, 100px) + 50px)
        ) scale(0);
        opacity: 0;
    }
}

.firework-burst {
    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: fireworkBurst 0.5s ease-out forwards;
}

@keyframes fireworkBurst {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Error Overlay */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.error-content {
    background: var(--bg-card);
    border: 2px solid var(--danger-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: errorFadeIn 0.3s ease-out;
}

@keyframes errorFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon i {
    font-size: 3rem;
    color: var(--danger-color);
}

.error-content h3 {
    font-size: 1.5rem;
    color: var(--danger-color);
    margin-bottom: 10px;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.error-close-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.error-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.cookie-consent.hidden {
    display: none;
}

.cookie-consent-content {
    background: rgba(23, 27, 47, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

.cookie-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.cookie-icon i {
    font-size: 2.5rem;
    color: white;
}

.cookie-text h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cookie-text p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.cookie-settings {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.cookie-settings:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.cookie-reject {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.cookie-reject:hover {
    background: rgba(239, 68, 68, 0.3);
}

.cookie-accept {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.cookie-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.cookie-save {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 100%;
    padding: 14px;
}

.cookie-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.cookie-settings-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.cookie-settings-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 1px solid var(--border-color);
    animation: scaleIn 0.2s ease;
}

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

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.cookie-settings-header h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.cookie-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.cookie-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.cookie-settings-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-option {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
}

.cookie-option label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.cookie-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.cookie-option span {
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-option p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-settings-footer {
    margin-top: 25px;
}

/* Responsive Design */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .header-content {
        padding: 12px 20px;
    }
    
    .user-section {
        gap: 15px;
    }
    
    .hero h1 {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }
    
    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .subject-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    
    .flashcard {
        width: min(500px, 85vw);
        height: min(300px, 40vh);
    }
    
    .options-container {
        max-width: 600px;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
    }
}

/* Mobile (up to 768px) */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-link {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
    
    .user-section {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        width: 100%;
    }
    
    .points-display {
        font-size: 0.95rem;
        padding: 8px 12px;
    }
    
    .user-info {
        font-size: 0.9rem;
    }
    
    .google-signin-container {
        width: 100%;
        max-width: 200px;
    }
    
    .hero h1 {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        padding: 0 15px;
        line-height: 1.3;
    }
    
    .hero p {
        padding: 0 15px;
        font-size: 1rem;
    }
    
    .cta-btn {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .feature-card {
        padding: 18px;
    }
    
    .feature-card i {
        font-size: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
    }
    
    .feature-card p {
        font-size: 0.85rem;
    }
    
    .subject-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px;
    }
    
    .subject-card {
        padding: 14px 10px;
    }
    
    .subject-card i {
        font-size: 2.2rem;
    }
    
    .subject-card h3 {
        font-size: 0.85rem;
    }
    
    .subject-card p {
        font-size: 0.75rem;
        display: none;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .game-info {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .subject-tag {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .question-count {
        font-size: 0.85rem;
    }
    
    .game-stats {
        margin-top: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-item {
        font-size: 0.85rem;
        gap: 5px;
    }
    
    .flashcard-container {
        padding: 12px;
    }
    
    .flashcard {
        width: 100%;
        max-width: 400px;
        height: min(260px, 38vh);
        padding: 15px;
        margin: 0 auto;
    }
    
    .flashcard-front h3,
    .flashcard-back h3 {
        font-size: clamp(0.9rem, 4vw, 1.3rem);
        line-height: 1.4;
    }
    
    .flashcard .explanation,
    .flashcard .example {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .options-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 12px;
    }
    
    .options {
        max-width: 100%;
    }
    
    .option-btn {
        padding: 12px 8px;
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .option-letter {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
    
    .results-container {
        padding: 15px;
        margin: 12px;
    }
    
    .results-header h2 {
        font-size: 1.4rem;
    }
    
    .results-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .result-item {
        padding: 12px;
    }
    
    .result-label {
        font-size: 0.8rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .results-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .leaderboard-container {
        margin: 0 12px;
        overflow-x: auto;
    }
    
    .leaderboard-header,
    .leaderboard-row {
        grid-template-columns: 1fr 2fr 1fr;
        min-width: 280px;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .leaderboard-header .player-subject,
    .leaderboard-row .player-subject {
        display: none;
    }
    
    .leaderboard-header {
        font-size: 0.8rem;
    }
    
    .leaderboard-row {
        font-size: 0.85rem;
    }
    
    .footer p {
        font-size: 0.75rem;
        padding: 0 10px;
        text-align: center;
    }
    
    /* Cookie Consent Mobile */
    .cookie-consent-content {
        padding: 25px 20px;
        margin: 15px;
    }
    
    .cookie-icon {
        width: 55px;
        height: 55px;
    }
    
    .cookie-icon i {
        font-size: 2rem;
    }
    
    .cookie-text h3 {
        font-size: 1.2rem;
    }
    
    .cookie-text p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .cookie-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .cookie-btn {
        width: 100%;
        padding: 14px;
        font-size: 0.9rem;
    }
    
    .cookie-settings-content {
        padding: 20px;
        margin: 15px;
    }
    
    .cookie-option label {
        gap: 6px;
    }
    
    .cookie-option span {
        font-size: 0.9rem;
    }
    
    .cookie-option p {
        font-size: 0.75rem;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .level-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .level-btn {
        width: 100%;
        max-width: 180px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .powerup-notification {
        top: 15%;
        left: 10px;
        right: 10px;
        transform: none;
    }
    
    .powerup-content {
        padding: 20px;
    }
    
    .powerup-title {
        font-size: 1.1rem;
    }
    
    .powerup-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .powerup-btn {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .flashcard {
        height: min(220px, 35vh);
        padding: 12px;
    }
    
    .flashcard-front h3,
    .flashcard-back h3 {
        font-size: clamp(0.85rem, 3.5vw, 1.1rem);
    }
    
    .audio-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 12px;
        right: 12px;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .option-btn {
        padding: 12px 10px;
        font-size: 0.8rem;
    }
    
    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .game-header {
        padding: 8px;
    }
    
    .subject-tag {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    .question-count {
        font-size: 0.8rem;
    }
    
    .timer-warning {
        font-size: 1.1rem;
    }
    
    .results-header h2 {
        font-size: 1.2rem;
    }
    
    .results-icon i {
        font-size: 2.5rem;
    }
    
    .result-value {
        font-size: 1.3rem;
    }
    
    .cookie-settings-content {
        padding: 15px;
        margin: 10px;
    }
    
    .cookie-settings-header h3 {
        font-size: 1.2rem;
    }
    
    .profile-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .profile-pic-large {
        width: 100px;
        height: 100px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .camera-btn, .upload-btn, .remove-btn {
        width: 100%;
        justify-content: center;
    }
    
    .powerup-modal-content {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .powerup-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .powerup-item {
        padding: 20px;
    }
    
    .powerup-modal-header h3 {
        font-size: 1.4rem;
    }
    
    .profile-btn {
        padding: 6px 8px;
        gap: 8px;
    }
    
    .profile-pic {
        width: 32px;
        height: 32px;
    }
    
    .user-name {
        font-size: 0.85rem;
    }
}