/* ===== CSS Variables & Reset ===== */
:root {
    /* Soft & Friendly Pastel Palette */
    --primary: #7C9CBF;           /* Soft sky blue */
    --primary-light: #A8C5E2;     /* Lighter sky */
    --primary-dark: #5A7A9E;      /* Deeper blue for contrast */
    --secondary: #9BC4BC;         /* Soft mint */
    --accent: #E8B4BC;            /* Soft rose */
    --success: #9BC4BC;           /* Mint green */
    --warning: #F5D89A;           /* Soft golden */
    --danger: #E8A5A5;            /* Soft coral */
    --white: #FFFFFF;
    --light: #F8FAFC;             /* Very light gray-blue */
    --cream: #FDF8F5;             /* Warm cream */
    --dark: #4A5568;              /* Soft charcoal */
    --gray: #718096;              /* Medium gray */

    /* Pastel accent colors for variety */
    --pastel-lavender: #C5B9E8;
    --pastel-peach: #FCDCCE;
    --pastel-mint: #B8E0D4;
    --pastel-sky: #B8D4E8;
    --pastel-lemon: #F5EDBE;
    --pastel-rose: #F0D0D8;

    /* Soft gradients */
    --gradient-1: linear-gradient(135deg, #7C9CBF 0%, #A8C5E2 100%);
    --gradient-2: linear-gradient(135deg, #E8B4BC 0%, #F0D0D8 100%);
    --gradient-3: linear-gradient(135deg, #9BC4BC 0%, #B8E0D4 100%);
    --gradient-4: linear-gradient(135deg, #C5B9E8 0%, #DDD5F0 100%);
    --gradient-rainbow: linear-gradient(90deg, #E8B4BC, #F5D89A, #9BC4BC, #C5B9E8, #7C9CBF);
    --gradient-bg: linear-gradient(150deg, #F8FAFC 0%, #F0F7FF 25%, #FDF8F5 50%, #F5F0F8 75%, #F0FBF8 100%);

    /* Softer shadows with color tints */
    --shadow-soft: 0 4px 20px rgba(124, 156, 191, 0.1);
    --shadow-medium: 0 8px 30px rgba(124, 156, 191, 0.12);
    --shadow-strong: 0 15px 50px rgba(124, 156, 191, 0.15);
    --shadow-glow: 0 0 30px rgba(124, 156, 191, 0.2);

    /* More rounded for friendly feel */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --radius-full: 9999px;

    /* Mobile-friendly font sizes */
    --font-size-base: 18px;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;

    /* Gentle transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

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

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Modern Floating Decorations ===== */
.floating-decorations {
    display: none; /* Hidden for calm design */
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Glowing Orbs */
.float-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.7;
}

.orb-1 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #ff9a9e, #fad0c4 50%, transparent 70%);
    top: 8%;
    left: 5%;
    animation: floatOrb1 18s ease-in-out infinite;
    box-shadow: 0 0 60px rgba(255, 154, 158, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.3);
}

.orb-2 {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at 30% 30%, #a18cd1, #fbc2eb 50%, transparent 70%);
    top: 15%;
    right: 8%;
    animation: floatOrb2 22s ease-in-out infinite;
    box-shadow: 0 0 50px rgba(161, 140, 209, 0.5), inset 0 0 25px rgba(255, 255, 255, 0.3);
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, #89f7fe, #66a6ff 50%, transparent 70%);
    bottom: 20%;
    left: 3%;
    animation: floatOrb3 25s ease-in-out infinite;
    box-shadow: 0 0 80px rgba(137, 247, 254, 0.4), inset 0 0 40px rgba(255, 255, 255, 0.3);
}

.orb-4 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #ffecd2, #fcb69f 50%, transparent 70%);
    bottom: 35%;
    right: 5%;
    animation: floatOrb4 20s ease-in-out infinite;
    box-shadow: 0 0 45px rgba(252, 182, 159, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.orb-5 {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #d299c2, #fef9d7 50%, transparent 70%);
    top: 50%;
    left: 8%;
    animation: floatOrb5 16s ease-in-out infinite;
    box-shadow: 0 0 35px rgba(210, 153, 194, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.orb-6 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, #96fbc4, #f9f586 50%, transparent 70%);
    bottom: 10%;
    right: 12%;
    animation: floatOrb6 24s ease-in-out infinite;
    box-shadow: 0 0 55px rgba(150, 251, 196, 0.4), inset 0 0 28px rgba(255, 255, 255, 0.3);
}

/* Floating Rings */
.float-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    opacity: 0.4;
}

.ring-1 {
    width: 180px;
    height: 180px;
    border-color: rgba(255, 255, 255, 0.6);
    top: 25%;
    right: 15%;
    animation: floatRing1 30s linear infinite, pulseRing 4s ease-in-out infinite;
}

.ring-2 {
    width: 140px;
    height: 140px;
    border-color: rgba(167, 139, 250, 0.5);
    bottom: 25%;
    left: 10%;
    animation: floatRing2 25s linear infinite, pulseRing 5s ease-in-out infinite;
    border-style: dashed;
}

/* Geometric Shapes */
.geometric {
    position: absolute;
    opacity: 0.3;
}

.geo-1 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    top: 65%;
    right: 3%;
    transform: rotate(45deg);
    border-radius: 20px;
    animation: floatGeo1 20s ease-in-out infinite, rotateGeo 30s linear infinite;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.geo-2 {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.3), rgba(250, 208, 196, 0.3));
    top: 5%;
    left: 15%;
    border-radius: 15px;
    animation: floatGeo2 18s ease-in-out infinite, rotateGeo 25s linear infinite reverse;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Sparkle Clusters */
.sparkle-cluster {
    position: absolute;
}

.sparkle-cluster span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.4);
}

.cluster-1 {
    top: 30%;
    left: 2%;
}

.cluster-1 span:nth-child(1) { animation: twinkle 2s ease-in-out infinite; }
.cluster-1 span:nth-child(2) { top: 25px; left: 15px; animation: twinkle 2.5s ease-in-out infinite 0.3s; width: 6px; height: 6px; }
.cluster-1 span:nth-child(3) { top: 10px; left: 30px; animation: twinkle 1.8s ease-in-out infinite 0.6s; width: 5px; height: 5px; }

.cluster-2 {
    bottom: 15%;
    right: 20%;
}

.cluster-2 span:nth-child(1) { animation: twinkle 2.2s ease-in-out infinite 0.2s; }
.cluster-2 span:nth-child(2) { top: -20px; left: 25px; animation: twinkle 1.9s ease-in-out infinite 0.5s; width: 6px; height: 6px; }
.cluster-2 span:nth-child(3) { top: 15px; left: 20px; animation: twinkle 2.4s ease-in-out infinite 0.8s; width: 4px; height: 4px; }

/* Floating Animations */
@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, 20px) scale(1.05); }
    50% { transform: translate(-20px, 40px) scale(0.95); }
    75% { transform: translate(25px, -15px) scale(1.02); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 30px) scale(1.08); }
    66% { transform: translate(20px, -25px) scale(0.92); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(40px, -20px) scale(1.03); }
    40% { transform: translate(-15px, 35px) scale(0.97); }
    60% { transform: translate(25px, 15px) scale(1.05); }
    80% { transform: translate(-30px, -25px) scale(0.98); }
}

@keyframes floatOrb4 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-35px, -30px); }
}

@keyframes floatOrb5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -35px) scale(1.1); }
    66% { transform: translate(-25px, 20px) scale(0.9); }
}

@keyframes floatOrb6 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-20px, 25px); }
    50% { transform: translate(30px, -20px); }
    75% { transform: translate(-15px, -30px); }
}

@keyframes floatRing1 {
    0% { transform: rotate(0deg) translateX(20px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(20px) rotate(-360deg); }
}

@keyframes floatRing2 {
    0% { transform: rotate(0deg) translateY(15px) rotate(0deg); }
    100% { transform: rotate(-360deg) translateY(15px) rotate(360deg); }
}

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

@keyframes floatGeo1 {
    0%, 100% { transform: rotate(45deg) translate(0, 0); }
    50% { transform: rotate(45deg) translate(-25px, 30px); }
}

@keyframes floatGeo2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -25px); }
}

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

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===== Container & Screens ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* ===== Typography ===== */
.title {
    font-size: var(--font-size-2xl);
    text-align: center;
    color: var(--dark);
    text-shadow: 2px 2px 0 var(--white), 3px 3px 0 var(--primary-light);
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
    word-wrap: break-word;
}

.subtitle {
    font-size: var(--font-size-lg);
    text-align: center;
    color: var(--dark);
    opacity: 0.8;
    margin-bottom: 24px;
    font-weight: 500;
}

/* ===== Home Screen (Clean Modern Design) ===== */
.home-screen {
    min-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

/* Animated Background Circles */
.home-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
}

.bg-circle-1 {
    width: 400px;
    height: 400px;
    background: #FF6B9D;
    top: -150px;
    right: -100px;
    animation: float1 8s ease-in-out infinite;
}

.bg-circle-2 {
    width: 350px;
    height: 350px;
    background: #C44FE2;
    bottom: 20%;
    left: -120px;
    animation: float2 10s ease-in-out infinite;
}

.bg-circle-3 {
    width: 300px;
    height: 300px;
    background: #4FACFE;
    bottom: -100px;
    right: -50px;
    animation: float3 12s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -20px); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -40px); }
}

/* Home Language Toggle */
.home-lang-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.lang-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.lang-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

/* Logo & Brand */
.home-brand {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.logo-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
}

.logo-ring {
    position: absolute;
    inset: 0;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: spin 20s linear infinite;
}

.logo-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #FFD93D;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px #FFD93D;
}

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

.logo-icon {
    position: absolute;
    inset: 8px;
    background: linear-gradient(135deg, #5a7d95 0%, #7a9db5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    box-shadow: 0 10px 30px rgba(90, 125, 149, 0.35);
}

.home-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
    letter-spacing: -1px;
    margin: 0;
}

.home-tagline {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    margin: 6px 0 0 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Main Card - Soft & Friendly */
.home-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(124, 156, 191, 0.15), 0 0 0 1px rgba(124, 156, 191, 0.05);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light);
}

.card-emoji {
    font-size: 2rem;
    animation: wave 2.5s ease-in-out infinite;
}

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

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
}

/* Main Button - Soft & Friendly */
.btn-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    margin-top: 20px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 6px 20px rgba(124, 156, 191, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-main::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 ease;
}

.btn-main:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(124, 156, 191, 0.45);
}

.btn-main:hover::before {
    left: 100%;
}

.btn-main:active {
    transform: translateY(0) scale(0.98);
}

.btn-plus {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 400;
}

.btn-link {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: none;
    border: none;
    color: var(--gray);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
}

.btn-link:hover {
    color: var(--primary);
    background: rgba(124, 156, 191, 0.08);
}

/* Features Row */
.home-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--white);
    backdrop-filter: blur(10px);
    padding: 18px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(124, 156, 191, 0.15);
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-normal);
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.feature-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.feature-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Welcome Screen ===== */
.welcome-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: 0 15px 50px rgba(124, 156, 191, 0.12);
    border: 1px solid rgba(124, 156, 191, 0.1);
}

.character-select {
    margin: 30px 0;
}

.character-select h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.characters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.character-btn {
    background: var(--light);
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.character-btn:hover {
    transform: scale(1.1);
    background: var(--primary-light);
}

.character-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.1);
}

.char-emoji {
    font-size: 3rem;
}

.char-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--dark);
}

/* ===== Name Input ===== */
.name-input {
    margin: 30px 0;
    text-align: center;
}

.name-input label {
    display: block;
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.name-input input {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-full);
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.name-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

/* ===== Buttons ===== */
.big-button {
    display: block;
    width: 100%;
    max-width: 350px;
    margin: 20px auto;
    padding: 18px 32px;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--white);
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.big-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
}

.big-button:active {
    transform: translateY(0);
}

.secondary-button {
    padding: 14px 28px;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    background: var(--white);
    border: 3px solid var(--primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.secondary-button:hover {
    background: var(--primary);
    color: var(--white);
}

.back-btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    background: var(--white);
    border: 2px solid var(--dark);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.back-btn:hover {
    background: var(--dark);
    color: var(--white);
}

/* ===== Grade Selection ===== */
#grade-screen {
    text-align: center;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.player-info {
    background: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    box-shadow: var(--shadow-soft);
}

.grade-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.grade-btn {
    background: var(--white);
    border: 3px solid var(--pastel-sky);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-soft);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.grade-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.grade-btn:nth-child(1) { border-color: var(--pastel-sky); background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%); }
.grade-btn:nth-child(2) { border-color: var(--pastel-mint); background: linear-gradient(135deg, #fff 0%, #f0fff8 100%); }
.grade-btn:nth-child(3) { border-color: var(--pastel-lemon); background: linear-gradient(135deg, #fff 0%, #fffef0 100%); }
.grade-btn:nth-child(4) { border-color: var(--pastel-peach); background: linear-gradient(135deg, #fff 0%, #fff8f5 100%); }

.grade-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(124, 156, 191, 0.2);
}

.grade-btn:hover::after {
    opacity: 0.5;
}

.grade-btn:active {
    transform: scale(0.97);
}

.grade-number {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary);
}

.grade-label {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--dark);
}

.grade-desc {
    font-size: 1rem;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.grade-stars {
    font-size: 1.25rem;
    margin-top: 5px;
}

/* ===== Mode Selection ===== */
.mode-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.mode-btn {
    background: var(--white);
    border: 2px solid rgba(124, 156, 191, 0.2);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-soft);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.mode-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

.mode-btn:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: 0 12px 35px rgba(124, 156, 191, 0.2);
}

.mode-btn:hover::before {
    opacity: 0.05;
}

.mode-btn:active {
    transform: scale(0.97);
}

.mode-icon {
    font-size: 2.5rem;
}

.mode-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--dark);
}

.mode-desc {
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

/* ===== Game Screen ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
    gap: 10px;
}

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

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--dark);
}

.stat-icon {
    font-size: 1.25rem;
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--danger);
}

/* ===== Game Character ===== */
.game-character {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

#game-character-emoji {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

.speech-bubble {
    background: var(--white);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    position: relative;
    box-shadow: var(--shadow-soft);
    max-width: 220px;
    font-weight: 500;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: var(--white);
}

/* ===== Game Area - Soft & Friendly ===== */
.game-area {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    min-height: 260px;
    box-shadow: 0 12px 40px rgba(124, 156, 191, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(124, 156, 191, 0.08);
}

/* Fill the Blank Game */
.math-problem {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

.blank-input {
    width: 85px;
    height: 65px;
    font-size: var(--font-size-xl);
    text-align: center;
    border: 3px dashed var(--primary-light);
    border-radius: var(--radius-lg);
    background: var(--light);
    font-family: inherit;
    color: var(--primary);
    font-weight: 700;
    outline: none;
    transition: all var(--transition-normal);
    -webkit-appearance: none;
    appearance: none;
}

.blank-input:focus {
    border-style: solid;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(124, 156, 191, 0.15), 0 4px 15px rgba(124, 156, 191, 0.2);
}

.blank-input.correct {
    border-color: var(--secondary);
    border-style: solid;
    background: linear-gradient(135deg, #f0fff8 0%, #d4f0e8 100%);
    animation: correctPulse 0.5s ease;
}

.blank-input.incorrect {
    border-color: var(--danger);
    border-style: solid;
    background: linear-gradient(135deg, #fff5f5 0%, #fce4e4 100%);
    animation: shake 0.5s ease;
}

/* Quiz Mode - Soft & Friendly */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 100%;
}

.quiz-option {
    padding: 20px 14px;
    font-size: var(--font-size-xl);
    font-weight: 700;
    background: var(--white);
    border: 2px solid rgba(124, 156, 191, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: var(--shadow-soft);
    color: var(--dark);
}

.quiz-option:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary-light);
    background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
    box-shadow: 0 8px 25px rgba(124, 156, 191, 0.2);
}

.quiz-option:active {
    transform: scale(0.97);
}

.quiz-option.correct {
    background: linear-gradient(135deg, var(--pastel-mint) 0%, #d4f0e8 100%);
    border-color: var(--secondary);
    color: #2d6a4f;
    box-shadow: 0 4px 15px rgba(155, 196, 188, 0.4);
}

.quiz-option.incorrect {
    background: linear-gradient(135deg, var(--pastel-rose) 0%, #fce4e4 100%);
    border-color: var(--danger);
    color: #9b4444;
    box-shadow: 0 4px 15px rgba(232, 165, 165, 0.4);
}

/* Match Game - Horizontal Layout with Lines */
.match-game {
    width: 100%;
    padding: 10px 0;
}

.match-header {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    opacity: 0.8;
}

.match-grid {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.match-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.match-problems {
    align-items: flex-end;
    padding-right: 8px;
}

.match-answers {
    align-items: flex-start;
    padding-left: 8px;
}

.match-lines {
    width: 70px;
    min-width: 50px;
    position: relative;
}

.match-lines svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.match-line {
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    animation: drawLine 0.3s ease-out forwards;
}

@keyframes drawLine {
    from {
        stroke-dasharray: 200;
        stroke-dashoffset: 200;
    }
    to {
        stroke-dasharray: 200;
        stroke-dashoffset: 0;
    }
}

.match-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 1.15rem;
    font-weight: bold;
    background: white;
    border: 3px solid #e0e5ec;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.match-problem {
    flex-direction: row;
    justify-content: flex-end;
}

.match-answer {
    flex-direction: row;
    justify-content: flex-start;
}

.match-text {
    white-space: nowrap;
}

.match-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d0d5dd;
    border: 2px solid #b0b5bd;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.match-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.match-item:hover .match-dot {
    background: var(--primary-light);
    border-color: var(--primary);
}

.match-item.selected {
    background: linear-gradient(135deg, #5a7d95 0%, #7a9db5 100%);
    border-color: transparent;
    color: white;
}

.match-item.selected .match-dot {
    background: white;
    border-color: white;
}

.match-item.matched {
    background: linear-gradient(135deg, #5a8a78 0%, #7ab098 100%);
    border-color: transparent;
    color: white;
    cursor: default;
    pointer-events: none;
}

.match-item.matched .match-dot {
    background: white;
    border-color: white;
}

.match-item.wrong {
    animation: shake 0.4s ease;
    border-color: var(--danger);
}

/* Bubble Pop Game */
.bubble-game-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.bubble-question {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 15px;
    text-align: center;
    padding: 10px;
    background: var(--light);
    border-radius: var(--radius-md);
    position: relative;
    z-index: 10;
}

.bubble-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(168, 237, 234, 0.3) 0%, rgba(254, 214, 227, 0.3) 100%);
}

.bubble {
    position: absolute;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--white);
    cursor: pointer;
    animation: floatUp 8s linear forwards;
    transition: transform 0.2s ease;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.2), inset 5px 5px 15px rgba(255,255,255,0.3);
}

.bubble:hover {
    transform: scale(1.15);
}

.bubble.pop {
    animation: pop 0.3s ease forwards;
}

/* ===== Feedback ===== */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 30px 50px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 100;
    animation: popIn 0.3s ease;
}

.feedback.hidden {
    display: none;
}

.feedback-emoji {
    font-size: 4rem;
}

.feedback-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark);
}

/* ===== Progress Bar ===== */
.progress-container {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-rainbow);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

#progress-text {
    color: var(--dark);
    font-weight: bold;
}

/* ===== Results Screen ===== */
.results-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-strong);
}

.results-character {
    font-size: 6rem;
    margin: 20px 0;
    animation: bounce 1s infinite;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.result-icon {
    font-size: 2rem;
}

.result-label {
    font-size: 1rem;
    color: #666;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stars-earned {
    font-size: 3rem;
    margin: 20px 0;
}

.stars-earned span {
    opacity: 0.3;
    transition: all 0.5s ease;
}

.stars-earned span.active {
    opacity: 1;
    animation: starPop 0.5s ease;
}

.achievements {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.achievement {
    background: var(--gradient-4);
    color: var(--dark);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: bold;
    animation: slideIn 0.5s ease;
}

.results-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* ===== Sound Toggle ===== */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.sound-toggle.muted {
    opacity: 0.5;
}

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

/* ===== Animations ===== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.bounce {
    animation: bounce 2s infinite;
}

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

.pulse {
    animation: pulse 2s infinite;
}

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

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

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    70% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes floatUp {
    0% { bottom: -80px; opacity: 1; }
    100% { bottom: calc(100% - 80px); opacity: 0.9; }
}

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

@keyframes starPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

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

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Responsive Design ===== */

/* Tablets */
@media (max-width: 768px) {
    :root {
        --font-size-base: 17px;
    }

    .title {
        font-size: 1.75rem;
    }

    .welcome-content {
        padding: 20px;
    }

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

    .match-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .results-stats {
        gap: 20px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    :root {
        --font-size-base: 16px;
        --font-size-lg: 1.125rem;
        --font-size-xl: 1.25rem;
        --font-size-2xl: 1.5rem;
    }

    .container {
        padding: 12px;
    }

    /* Home screen mobile */
    .home-screen {
        padding: 15px 0;
    }

    .bg-circle-1 { width: 250px; height: 250px; }
    .bg-circle-2 { width: 200px; height: 200px; }
    .bg-circle-3 { width: 180px; height: 180px; }

    .logo-container {
        width: 80px;
        height: 80px;
    }

    .logo-icon {
        font-size: 2.2rem;
    }

    .home-title {
        font-size: 2.2rem;
    }

    .home-tagline {
        font-size: 1rem;
    }

    .home-card {
        border-radius: 26px;
        padding: 22px 18px;
    }

    .card-title {
        font-size: 1.15rem;
    }

    .btn-main {
        padding: 16px;
        font-size: 1.05rem;
    }

    .home-features {
        gap: 12px;
        margin-top: 24px;
    }

    .feature {
        padding: 12px 18px;
        border-radius: 16px;
    }

    .feature-num {
        font-size: 1.3rem;
    }

    .feature-label {
        font-size: 0.7rem;
    }

    .title {
        font-size: 1.5rem;
        text-shadow: 1px 1px 0 var(--white), 2px 2px 0 var(--primary-light);
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .welcome-content {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .screen-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .player-info {
        font-size: 0.95rem;
        padding: 8px 14px;
    }

    .back-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Game header mobile */
    .game-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .game-stats {
        gap: 12px;
        width: 100%;
        justify-content: center;
    }

    .stat {
        font-size: 1rem;
    }

    .stat-icon {
        font-size: 1.1rem;
    }

    .timer-container {
        font-size: 1rem;
    }

    /* Game character mobile */
    .game-character {
        gap: 8px;
        margin-bottom: 12px;
    }

    #game-character-emoji {
        font-size: 2.5rem;
    }

    .speech-bubble {
        padding: 10px 14px;
        font-size: 0.9rem;
        max-width: 180px;
    }

    /* Game area mobile */
    .game-area {
        padding: 20px 14px;
        min-height: 220px;
    }

    .math-problem {
        font-size: 1.5rem;
        gap: 8px;
        margin-bottom: 20px;
    }

    .blank-input {
        width: 70px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Quiz options mobile */
    .quiz-options {
        gap: 10px;
    }

    .quiz-option {
        padding: 16px 10px;
        font-size: 1.25rem;
    }

    /* Match game mobile */
    .match-item {
        padding: 12px 16px;
        font-size: 1.1rem;
        min-width: 100px;
    }

    /* Bubble game mobile */
    .bubble-container {
        height: 220px;
    }

    .bubble {
        width: 60px;
        height: 60px;
        font-size: 1.15rem;
    }

    .bubble-question {
        font-size: 1.2rem;
        padding: 8px;
        margin-bottom: 10px;
    }

    /* Buttons mobile */
    .big-button {
        padding: 16px 24px;
        font-size: 1.125rem;
        max-width: 100%;
    }

    .secondary-button {
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Grade buttons mobile */
    .grade-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .grade-btn {
        padding: 16px 12px;
    }

    .grade-number {
        font-size: 1.5rem;
    }

    .grade-label {
        font-size: 1rem;
    }

    .grade-desc {
        font-size: 0.85rem;
    }

    /* Mode buttons mobile */
    .mode-buttons {
        gap: 10px;
    }

    .mode-btn {
        padding: 16px 12px;
    }

    .mode-icon {
        font-size: 2rem;
    }

    .mode-name {
        font-size: 1rem;
    }

    .mode-desc {
        font-size: 0.85rem;
    }

    /* Progress bar mobile */
    .progress-container {
        margin-top: 16px;
    }

    .progress-bar {
        height: 16px;
    }

    #progress-text {
        font-size: 0.9rem;
    }

    /* Results mobile */
    .results-content {
        padding: 20px 16px;
    }

    .results-character {
        font-size: 4rem;
        margin: 16px 0;
    }

    .results-stats {
        gap: 16px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .result-item {
        min-width: 80px;
    }

    .result-icon {
        font-size: 1.5rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .result-label {
        font-size: 0.85rem;
    }

    .stars-earned {
        font-size: 2rem;
    }

    .achievement {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    .results-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .results-buttons .big-button,
    .results-buttons .secondary-button {
        width: 100%;
        max-width: 100%;
    }

    /* Feedback mobile */
    .feedback {
        padding: 20px 30px;
        width: 85%;
        max-width: 280px;
    }

    .feedback-emoji {
        font-size: 3rem;
    }

    .feedback-text {
        font-size: 1.1rem;
    }

    /* Sound toggle mobile */
    .sound-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        bottom: 16px;
        right: 16px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    :root {
        --font-size-base: 15px;
    }

    .container {
        padding: 10px;
    }

    .title {
        font-size: 1.35rem;
    }

    .math-problem {
        font-size: 1.35rem;
    }

    .blank-input {
        width: 60px;
        height: 45px;
        font-size: 1.1rem;
    }

    .quiz-option {
        padding: 14px 8px;
        font-size: 1.1rem;
    }

    .grade-buttons,
    .mode-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===== User Profile System ===== */

/* User Profiles Grid */
.user-profiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 14px;
    margin: 0;
}

.user-profile-card {
    background: #f8f9ff;
    border-radius: 20px;
    padding: 18px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    border: 2px solid transparent;
}

.user-profile-card:hover {
    transform: translateY(-4px);
    background: white;
    border-color: #5a7d95;
    box-shadow: 0 12px 35px rgba(90, 125, 149, 0.2);
}

.user-profile-card .user-avatar {
    font-size: 2.5rem;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.user-profile-card:hover .user-avatar {
    transform: scale(1.15);
}

.user-profile-card .user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}

.user-profile-card .user-grades {
    font-size: 0.7rem;
    color: #5a7d95;
    background: rgba(90, 125, 149, 0.12);
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.no-users-message {
    text-align: center;
    padding: 30px 20px;
    color: #888;
}

.no-users-message .big-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.no-users-message p {
    font-size: 0.95rem;
    color: #666;
}

/* Login Actions */
.login-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed var(--primary-light);
}

.add-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.add-user-btn::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 ease;
}

.add-user-btn:hover::before {
    left: 100%;
}

.add-user-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.add-user-btn:active {
    transform: translateY(-1px);
}

.add-user-btn .add-icon {
    font-size: 1.3rem;
}

.secondary-button.small {
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* Registration Form */
.registration-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 10px;
    text-align: center;
}

.form-hint {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-full);
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

/* Language Selector */
.form-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-full);
    background: var(--white);
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c5ce7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
    margin: 0 auto;
    display: block;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

.form-select:hover {
    border-color: var(--primary);
}

/* Avatar Grid */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 10px;
    max-width: 450px;
    margin: 0 auto;
}

.avatar-option {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
    background: var(--light);
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option:hover {
    transform: scale(1.1);
    background: var(--primary-light);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.15);
    box-shadow: var(--shadow-soft);
}

/* Grade Selection Checkboxes */
.grade-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.grade-checkbox {
    cursor: pointer;
}

.grade-checkbox input {
    display: none;
}

.grade-check-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: var(--light);
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.grade-checkbox input:checked + .grade-check-box {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.05);
}

.grade-check-box .grade-num {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.grade-check-box .grade-text {
    font-size: 0.9rem;
    color: var(--dark);
}

.select-all-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 1rem;
    color: var(--dark);
    cursor: pointer;
}

.select-all-label input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* User Welcome Section */
.user-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.welcome-avatar {
    font-size: 5rem;
    animation: bounce 2s infinite;
}

.welcome-text {
    text-align: left;
}

.welcome-text h2 {
    font-size: 1.2rem;
    color: #666;
    font-weight: normal;
}

.welcome-name {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0;
}

.icon-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: var(--light);
    border: 2px solid var(--primary-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

/* User Stats Card */
.user-stats-card {
    background: var(--gradient-3);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 30px;
}

.user-stats-card h3 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.mini-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    min-width: 100px;
}

.mini-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.mini-stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Collected Prizes Section on Welcome Screen */
.welcome-prizes-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed rgba(255, 255, 255, 0.5);
}

.welcome-prizes-section h4 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.welcome-prizes-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

.welcome-prize-item {
    font-size: 1.8rem;
    cursor: default;
    transition: transform 0.2s ease;
}

.welcome-prize-item:hover {
    transform: scale(1.2);
}

/* Manage Users Screen */
.manage-user-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.manage-user-card {
    display: flex;
    align-items: center;
    background: var(--light);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    gap: 15px;
}

.manage-user-card .user-avatar {
    font-size: 2.5rem;
}

.manage-user-info {
    flex: 1;
}

.manage-user-info .user-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark);
}

.manage-user-info .user-details {
    font-size: 0.9rem;
    color: #666;
}

.manage-user-actions {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    background: var(--primary-light);
    color: var(--dark);
}

.edit-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.delete-btn {
    background: #ffcccc;
    color: var(--danger);
}

.delete-btn:hover {
    background: var(--danger);
    color: var(--white);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    padding: 30px 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.3s ease;
}

.modal-content h2 {
    color: var(--dark);
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
}

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

.danger-button {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--white);
    background: var(--danger);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.danger-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Responsive adjustments for user profile elements */
@media (max-width: 768px) {
    .user-profiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

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

    .avatar-option {
        width: 55px;
        height: 55px;
        font-size: 1.75rem;
    }

    .grade-select-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .user-welcome {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

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

    .manage-user-card {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 12px;
    }

    .manage-user-info {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .user-profiles {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .user-profile-card {
        padding: 14px 10px;
    }

    .user-profile-card .user-avatar {
        font-size: 2.25rem;
    }

    .user-profile-card .user-name {
        font-size: 1rem;
    }

    .user-profile-card .user-grades {
        font-size: 0.75rem;
    }

    .no-users-message {
        padding: 24px;
    }

    .no-users-message .big-emoji {
        font-size: 3rem;
    }

    .add-user-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

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

    .avatar-option {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .form-label {
        font-size: 1.05rem;
    }

    .form-input {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .grade-check-box {
        padding: 12px 8px;
    }

    .grade-check-box .grade-num {
        font-size: 1.5rem;
    }

    .grade-check-box .grade-text {
        font-size: 0.85rem;
    }

    .welcome-avatar {
        font-size: 3.5rem;
    }

    .welcome-text h2 {
        font-size: 1rem;
    }

    .welcome-name {
        font-size: 1.75rem;
    }

    .icon-btn {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .user-stats-card {
        padding: 16px;
    }

    .user-stats-card h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .mini-stats {
        gap: 10px;
    }

    .mini-stat {
        padding: 10px 14px;
        min-width: 80px;
    }

    .mini-stat-value {
        font-size: 1.5rem;
    }

    .mini-stat-label {
        font-size: 0.8rem;
    }

    .manage-user-card .user-avatar {
        font-size: 2rem;
    }

    .manage-user-info .user-name {
        font-size: 1rem;
    }

    .manage-user-info .user-details {
        font-size: 0.8rem;
    }

    .edit-btn, .delete-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    .modal-content p {
        font-size: 0.95rem;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .danger-button,
    .modal-buttons .secondary-button {
        width: 100%;
    }
}

/* ===== Prize Popup System ===== */

.prize-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.prize-popup.hidden {
    display: none;
}

.prize-popup.show {
    opacity: 1;
    visibility: visible;
}

.prize-popup-content {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 50%, #ffe6a0 100%);
    border: 4px solid #ffc107;
    border-radius: var(--radius-lg);
    padding: 30px 40px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: prizePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(255, 193, 7, 0.4), 0 0 60px rgba(255, 193, 7, 0.2);
    position: relative;
    overflow: hidden;
}

.prize-popup-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: prizeShimmer 2s infinite;
}

.prize-sparkles {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.prize-sparkles .sparkle {
    font-size: 1.5rem;
    animation: sparkleFloat 1s ease-in-out infinite;
}

.prize-sparkles .sparkle:nth-child(1) { animation-delay: 0s; }
.prize-sparkles .sparkle:nth-child(2) { animation-delay: 0.3s; }
.prize-sparkles .sparkle:nth-child(3) { animation-delay: 0.6s; }

.prize-title {
    font-size: 1.25rem;
    color: #b8860b;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0 #fff;
    position: relative;
}

.prize-emoji {
    font-size: 5rem;
    line-height: 1;
    margin: 15px 0;
    animation: prizeBounce 0.6s ease-in-out infinite alternate;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    position: relative;
}

.prize-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 8px;
    position: relative;
}

.prize-points {
    font-size: 1.1rem;
    color: #228b22;
    font-weight: bold;
    background: rgba(34, 139, 34, 0.1);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 10px;
    position: relative;
}

.prize-streak-msg {
    font-size: 1rem;
    color: #e67e22;
    font-weight: bold;
    position: relative;
}

/* Prize Burst Effect */
.prize-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.burst-star {
    position: absolute;
    font-size: 1.5rem;
    animation: burstOut 1s ease-out forwards;
    opacity: 0;
}

.burst-star:nth-child(1) { animation-delay: 0s; }
.burst-star:nth-child(2) { animation-delay: 0.05s; }
.burst-star:nth-child(3) { animation-delay: 0.1s; }
.burst-star:nth-child(4) { animation-delay: 0.15s; }
.burst-star:nth-child(5) { animation-delay: 0.2s; }
.burst-star:nth-child(6) { animation-delay: 0.25s; }
.burst-star:nth-child(7) { animation-delay: 0.3s; }
.burst-star:nth-child(8) { animation-delay: 0.35s; }

@keyframes burstOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--burst-x, 100px), var(--burst-y, -100px)) scale(1);
    }
}

.burst-star:nth-child(1) { --burst-x: -80px; --burst-y: -80px; }
.burst-star:nth-child(2) { --burst-x: 80px; --burst-y: -80px; }
.burst-star:nth-child(3) { --burst-x: -100px; --burst-y: 0px; }
.burst-star:nth-child(4) { --burst-x: 100px; --burst-y: 0px; }
.burst-star:nth-child(5) { --burst-x: -80px; --burst-y: 80px; }
.burst-star:nth-child(6) { --burst-x: 80px; --burst-y: 80px; }
.burst-star:nth-child(7) { --burst-x: 0px; --burst-y: -100px; }
.burst-star:nth-child(8) { --burst-x: 0px; --burst-y: 100px; }

/* Prize Collection During Game */
.prize-collection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border: 2px solid #ffc107;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    margin: 10px auto;
    max-width: fit-content;
    animation: slideIn 0.3s ease;
}

.prize-collection.hidden {
    display: none;
}

.prize-collection-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #b8860b;
}

.collected-prizes {
    display: flex;
    gap: 6px;
}

.collected-prize-item {
    font-size: 1.5rem;
    animation: prizeCollect 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes prizeCollect {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Prize Animations */
@keyframes prizePopIn {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes prizeShimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes sparkleFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.2); }
}

@keyframes prizeBounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

/* Prizes Won Section in Results */
.prizes-won {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border: 3px solid #ffc107;
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
}

.prizes-won.hidden {
    display: none;
}

.prizes-title {
    font-size: 1.2rem;
    color: #b8860b;
    margin-bottom: 15px;
    text-align: center;
}

.prizes-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.prize-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
    min-width: 80px;
    animation: slideIn 0.3s ease;
}

.prize-item-emoji {
    font-size: 2rem;
    margin-bottom: 5px;
}

.prize-item-name {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* ===== PIN Input System ===== */

.pin-input-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
}

.pin-digit {
    width: 55px;
    height: 65px;
    font-size: 1.75rem;
    font-weight: bold;
    text-align: center;
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--primary);
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pin-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
    transform: scale(1.05);
}

.pin-digit.filled {
    background: var(--primary-light);
    border-color: var(--primary);
}

.pin-digit.error {
    border-color: var(--danger);
    background: #ffe0e0;
    animation: shake 0.4s ease;
}

.pin-digit.success {
    border-color: var(--success);
    background: #d4edda;
}

/* PIN Modal Styles */
.pin-modal-content {
    padding: 30px 40px;
}

.pin-modal-avatar {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.pin-modal-content h2 {
    color: var(--primary);
    margin-bottom: 5px;
}

.pin-modal-content p {
    color: #666;
    margin-bottom: 15px;
}

.pin-error {
    color: var(--danger);
    font-weight: bold;
    font-size: 0.95rem;
    margin-top: 10px;
    animation: shake 0.4s ease;
}

.pin-error.hidden {
    display: none;
}

/* Lock icon on profile cards */
.profile-lock {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.9rem;
    opacity: 0.6;
}

.user-profile-card {
    position: relative;
}

/* PIN input responsive */
@media (max-width: 480px) {
    .pin-input-container {
        gap: 8px;
    }

    .pin-digit {
        width: 48px;
        height: 58px;
        font-size: 1.5rem;
    }

    .pin-modal-content {
        padding: 24px 20px;
    }

    .pin-modal-avatar {
        font-size: 3rem;
    }
}

@media (max-width: 360px) {
    .pin-digit {
        width: 42px;
        height: 52px;
        font-size: 1.3rem;
    }
}

/* Prize popup responsive */
@media (max-width: 480px) {
    .prize-popup-content {
        padding: 24px 20px;
        max-width: 280px;
    }

    .prize-title {
        font-size: 1.1rem;
    }

    .prize-emoji {
        font-size: 4rem;
    }

    .prize-name {
        font-size: 1.25rem;
    }

    .prize-points {
        font-size: 1rem;
    }

    .prize-streak-msg {
        font-size: 0.9rem;
    }

    .prizes-won {
        padding: 15px;
    }

    .prize-item {
        padding: 10px 12px;
        min-width: 70px;
    }

    .prize-item-emoji {
        font-size: 1.75rem;
    }

    .prize-collection {
        padding: 6px 12px;
        gap: 8px;
    }

    .prize-collection-label {
        font-size: 0.8rem;
    }

    .collected-prize-item {
        font-size: 1.25rem;
    }

    .burst-star {
        font-size: 1.2rem;
    }
}

/* ===== Speed Challenge Game ===== */
.speed-challenge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.speed-score-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: var(--radius-full);
    font-size: 1.2rem;
    box-shadow: var(--shadow-medium);
}

.speed-score-display strong {
    font-size: 1.5rem;
    margin-left: 5px;
}

.speed-problem {
    font-size: 2.5rem !important;
    animation: pulseScale 0.3s ease-out;
}

.speed-input {
    font-size: 2rem;
    width: 150px;
    text-align: center;
}

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

/* ===== Memory Match Game ===== */
.memory-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 10px;
}

.memory-header {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 400px;
    width: 100%;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
}

.memory-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
}

.memory-card-back {
    background: white;
    color: var(--dark);
    transform: rotateY(180deg);
    border: 3px solid var(--primary-light);
    font-size: 1.1rem;
    padding: 5px;
    word-break: break-word;
}

.memory-card.matched .memory-card-back {
    background: linear-gradient(135deg, #5a8a78 0%, #7ab098 100%);
    color: white;
    border-color: var(--success);
}

/* ===== Number Order Game ===== */
.number-order-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 20px;
}

.order-instruction {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    padding: 15px 25px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
}

.order-slots {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.order-slot {
    width: 60px;
    height: 60px;
    border: 3px dashed var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.order-slot.filled {
    border-style: solid;
    border-color: var(--success);
    background: linear-gradient(135deg, #5a8a78 0%, #7ab098 100%);
    color: white;
    animation: slotFill 0.3s ease;
}

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

.order-numbers {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 350px;
}

.order-number {
    width: 65px;
    height: 65px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.order-number:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: var(--shadow-medium);
}

.order-number:active:not(:disabled) {
    transform: scale(0.95);
}

.order-number.correct {
    background: linear-gradient(135deg, #5a8a78 0%, #7ab098 100%);
    transform: scale(0.9);
    opacity: 0.7;
}

.order-number.wrong {
    background: linear-gradient(135deg, #b87070 0%, #a05858 100%);
    animation: shake 0.3s ease;
}

.order-number:disabled {
    cursor: not-allowed;
}

/* ===== True or False Game ===== */
.true-false-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

.tf-equation {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    padding: 30px 50px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    animation: fadeInUp 0.4s ease;
}

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

.tf-buttons {
    display: flex;
    gap: 20px;
}

.tf-btn {
    padding: 20px 40px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
    min-width: 140px;
}

.tf-true {
    background: linear-gradient(135deg, #5a8a78 0%, #7ab098 100%);
    color: white;
}

.tf-false {
    background: linear-gradient(135deg, #b87070 0%, #a05858 100%);
    color: white;
}

.tf-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.tf-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.tf-btn.correct {
    animation: correctPulse 0.5s ease;
    box-shadow: 0 0 30px rgba(67, 233, 123, 0.6);
}

.tf-btn.wrong {
    animation: shake 0.3s ease;
    opacity: 0.7;
}

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

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

/* ===== Responsive Styles for New Games ===== */
@media (max-width: 480px) {
    .speed-score-display {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .speed-problem {
        font-size: 2rem !important;
    }

    .speed-input {
        font-size: 1.5rem;
        width: 120px;
    }

    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .memory-card-front {
        font-size: 1.5rem;
    }

    .memory-card-back {
        font-size: 0.9rem;
    }

    .order-instruction {
        font-size: 1.1rem;
        padding: 12px 20px;
    }

    .order-slot {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .order-number {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    .tf-equation {
        font-size: 1.8rem;
        padding: 20px 30px;
    }

    .tf-btn {
        padding: 15px 25px;
        font-size: 1.2rem;
        min-width: 110px;
    }
}

@media (max-width: 360px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .memory-card-back {
        font-size: 0.8rem;
    }

    .order-slot {
        width: 45px;
        height: 45px;
    }

    .order-number {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .tf-equation {
        font-size: 1.5rem;
        padding: 15px 20px;
    }

    .tf-buttons {
        gap: 12px;
    }

    .tf-btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-width: 90px;
    }
}

/* ===== Power of Numbers Learning Tab ===== */

/* Power Learn Button on Welcome Screen */
.power-learn-btn {
    margin-top: 12px;
    width: 100%;
    max-width: 350px;
}

/* Power Tabs */
.power-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.power-tab {
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.power-tab:hover {
    background: var(--primary-light);
}

.power-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Power Sections */
.power-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.power-section.active {
    display: block;
}

/* Learn Cards */
.learn-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    border: 3px solid var(--primary-light);
}

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

.learn-card p {
    color: var(--dark);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

/* Power Examples */
.power-examples {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.power-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.power-notation {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.power-notation sup {
    font-size: 1rem;
    color: var(--accent);
}

.power-equals {
    font-size: 1.4rem;
    color: #666;
}

.power-expansion {
    font-size: 1.2rem;
    color: var(--dark);
    font-weight: 500;
}

.power-result {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--success);
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 6px 16px;
    border-radius: var(--radius-full);
}

/* Power Anatomy */
.power-anatomy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.anatomy-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    padding: 10px 30px;
}

.anatomy-base {
    color: var(--primary);
}

.anatomy-exponent {
    color: var(--accent);
    font-size: 2.5rem;
}

.anatomy-labels {
    display: flex;
    justify-content: center;
    gap: 60px;
    width: 100%;
}

.anatomy-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    font-weight: 700;
}

.base-label {
    color: var(--primary);
}

.exp-label {
    color: var(--accent);
}

.label-arrow {
    font-size: 1.5rem;
    animation: bounceArrow 1s ease-in-out infinite;
}

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

.label-desc {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
}

.anatomy-example {
    font-size: 1.2rem !important;
    font-weight: 600;
    color: var(--success);
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    margin-top: 10px;
}

/* Squares Grid */
.squares-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.square-item {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 12px 8px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.2s ease;
}

.square-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-soft);
}

/* Cubes Grid */
.cubes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.cube-item {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    padding: 12px 8px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.2s ease;
}

.cube-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-soft);
}

/* Game Setup */
.power-game-setup {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-medium);
    border: 3px solid var(--primary-light);
}

.power-game-setup h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--white);
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.difficulty-btn:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.diff-icon {
    font-size: 2.5rem;
}

.diff-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}

.diff-desc {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Power Game Area */
.power-problem {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    text-align: center;
}

.power-question {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 16px;
}

.power-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.power-display sup {
    font-size: 1.8rem;
    color: var(--accent);
}

.power-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.power-option {
    padding: 16px 24px;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--light);
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--dark);
}

.power-option:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.02);
}

.power-option.correct {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.power-option.incorrect {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

/* Power Game Responsive */
@media (max-width: 768px) {
    .squares-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .cubes-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .square-item,
    .cube-item {
        padding: 10px 6px;
        font-size: 0.95rem;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .power-display {
        font-size: 2.5rem;
    }

    .anatomy-display {
        font-size: 3rem;
    }

    .anatomy-exponent {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .power-tabs {
        gap: 8px;
    }

    .power-tab {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .learn-card {
        padding: 18px;
    }

    .learn-card h3 {
        font-size: 1.2rem;
    }

    .power-example {
        padding: 10px 12px;
        gap: 8px;
    }

    .power-notation {
        font-size: 1.4rem;
    }

    .power-expansion {
        font-size: 1rem;
    }

    .power-result {
        font-size: 1.2rem;
        padding: 4px 12px;
    }

    .squares-grid,
    .cubes-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .square-item,
    .cube-item {
        padding: 8px 4px;
        font-size: 0.85rem;
    }

    .anatomy-labels {
        gap: 30px;
    }

    .anatomy-label {
        font-size: 0.9rem;
    }

    .power-problem {
        padding: 20px;
    }

    .power-display {
        font-size: 2rem;
    }

    .power-display sup {
        font-size: 1.2rem;
    }

    .power-options {
        gap: 12px;
    }

    .power-option {
        padding: 14px 20px;
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .squares-grid,
    .cubes-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .square-item,
    .cube-item {
        padding: 6px 2px;
        font-size: 0.75rem;
    }

    .power-option {
        padding: 12px 16px;
        font-size: 1rem;
    }
}

/* ==========================================
   GRADE GROUP STYLES (Grades 5-13)
   ========================================== */

.grade-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.grade-group {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.grade-group-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light);
}

.grade-group .grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

/* Extended grade button colors for grades 5-13 - Soft Pastels */
.grade-btn:nth-child(5) {
    border-color: var(--pastel-lavender);
    background: linear-gradient(135deg, #fff 0%, #f8f5ff 100%);
}

.grade-btn:nth-child(6) {
    border-color: var(--pastel-rose);
    background: linear-gradient(135deg, #fff 0%, #fff5f8 100%);
}

.grade-btn:nth-child(7) {
    border-color: #B8D4E8;
    background: linear-gradient(135deg, #fff 0%, #f5faff 100%);
}

.grade-btn:nth-child(8) {
    border-color: #D4E8B8;
    background: linear-gradient(135deg, #fff 0%, #f8fff5 100%);
}

.grade-btn:nth-child(9) {
    border-color: #E8D4B8;
    background: linear-gradient(135deg, #fff 0%, #fffaf5 100%);
}

.grade-btn:nth-child(10) {
    border-color: #D4B8E8;
    background: linear-gradient(135deg, #fff 0%, #faf5ff 100%);
}

.grade-btn:nth-child(11) {
    border-color: #B8E8D4;
    background: linear-gradient(135deg, #fff 0%, #f5fff8 100%);
}

.grade-btn:nth-child(12) {
    border-color: #E8C8B8;
    background: linear-gradient(135deg, #fff 0%, #fff8f5 100%);
}

.grade-btn:nth-child(13) {
    border-color: #B8C8E8;
    background: linear-gradient(135deg, #fff 0%, #f5f8ff 100%);
}

/* ==========================================
   TIMED CHALLENGE STYLES - Soft & Friendly
   ========================================== */

.timed-challenge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px;
    max-width: 500px;
    margin: 0 auto;
}

.timed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 18px 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(124, 156, 191, 0.1);
}

.timed-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Nunito', sans-serif;
}

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

.timed-timer.danger {
    color: var(--danger);
    animation: pulse 0.3s ease-in-out infinite;
}

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

.timed-score-display {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
}

.timed-score-display span {
    color: var(--primary);
    font-size: 2rem;
}

.timed-problem {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 35px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 35px rgba(124, 156, 191, 0.12);
    border: 1px solid rgba(124, 156, 191, 0.08);
}

.timed-problem .problem-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 24px;
}

.timed-input {
    width: 150px;
    padding: 16px;
    font-size: 2rem;
    text-align: center;
    border: 3px solid rgba(124, 156, 191, 0.2);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.timed-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 156, 191, 0.15);
}

.timed-input.correct {
    border-color: var(--secondary);
    background: linear-gradient(135deg, #f0fff8 0%, #e8f8f0 100%);
}

.timed-input.incorrect {
    border-color: var(--danger);
    background: linear-gradient(135deg, #fff5f5 0%, #fce4e4 100%);
    animation: shake 0.3s ease;
}

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

.timed-results {
    text-align: center;
    padding: 30px;
}

.timed-results h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.timed-final-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.timed-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

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

.timed-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.timed-stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

/* ==========================================
   WORD PROBLEMS STYLES
   ========================================== */

.word-problem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.word-problem-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.word-problem-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
}

.word-problem-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--dark);
    text-align: center;
    margin-bottom: 25px;
}

.word-problem-text .highlight {
    font-weight: 700;
    color: var(--primary);
}

.word-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.word-input-label {
    font-size: 1.1rem;
    color: var(--gray);
}

.word-input {
    width: 200px;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid var(--light);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.word-input:focus {
    border-color: var(--primary);
}

.word-submit-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 16px 44px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 6px 20px rgba(124, 156, 191, 0.3);
    font-family: inherit;
}

.word-submit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(124, 156, 191, 0.4);
}

.word-submit-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   EQUATION SOLVER STYLES
   ========================================== */

.equation-solver {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.equation-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.equation-instruction {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 15px;
}

.equation-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    padding: 20px;
    background: var(--light);
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.equation-display .variable {
    color: var(--primary);
}

.equation-input-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.equation-variable-label {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.equation-input {
    width: 120px;
    padding: 15px;
    font-size: 1.8rem;
    text-align: center;
    border: 3px solid var(--light);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.equation-input:focus {
    border-color: var(--primary);
}

.equation-submit-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 6px 20px rgba(124, 156, 191, 0.3);
    font-family: inherit;
}

.equation-submit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(124, 156, 191, 0.4);
}

.equation-submit-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   GEOMETRY GAME STYLES
   ========================================== */

.geometry-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 20px;
    max-width: 550px;
    margin: 0 auto;
}

.geometry-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.geometry-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    min-height: 200px;
}

.geometry-visual svg {
    max-width: 100%;
    height: auto;
}

.geometry-shape {
    fill: rgba(90, 125, 149, 0.2);
    stroke: var(--primary);
    stroke-width: 3;
}

.geometry-label {
    font-size: 14px;
    fill: var(--dark);
    font-weight: 600;
}

.geometry-question {
    font-size: 1.3rem;
    color: var(--dark);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
}

.geometry-question .formula {
    display: inline-block;
    background: var(--light);
    padding: 5px 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin: 5px 0;
}

.geometry-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.geometry-input {
    width: 150px;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid var(--light);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.geometry-input:focus {
    border-color: var(--primary);
}

.geometry-unit {
    font-size: 1rem;
    color: var(--gray);
}

.geometry-submit-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 6px 20px rgba(124, 156, 191, 0.3);
    font-family: inherit;
}

.geometry-submit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(124, 156, 191, 0.4);
}

.geometry-submit-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   RESPONSIVE STYLES FOR NEW GAME MODES
   ========================================== */

@media (max-width: 768px) {
    .grade-group .grade-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .timed-problem .problem-text {
        font-size: 2rem;
    }

    .timed-input {
        width: 120px;
        font-size: 1.5rem;
    }

    .word-problem-text {
        font-size: 1.1rem;
    }

    .equation-display {
        font-size: 2rem;
    }

    .geometry-visual {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .grade-group {
        padding: 12px;
    }

    .grade-group-label {
        font-size: 0.75rem;
    }

    .timed-header {
        flex-direction: column;
        gap: 10px;
    }

    .timed-timer {
        font-size: 1.5rem;
    }

    .timed-problem .problem-text {
        font-size: 1.8rem;
    }

    .word-problem-card {
        padding: 20px;
    }

    .word-problem-icon {
        font-size: 2.5rem;
    }

    .word-problem-text {
        font-size: 1rem;
    }

    .equation-display {
        font-size: 1.5rem;
        padding: 15px;
    }

    .equation-input {
        width: 100px;
        font-size: 1.5rem;
    }

    .geometry-card {
        padding: 20px;
    }

    .geometry-question {
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .timed-problem .problem-text {
        font-size: 1.5rem;
    }

    .timed-input {
        width: 100px;
        font-size: 1.3rem;
        padding: 12px;
    }

    .word-input {
        width: 150px;
        font-size: 1.2rem;
    }

    .equation-display {
        font-size: 1.3rem;
    }

    .geometry-input {
        width: 120px;
        font-size: 1.2rem;
    }
}
