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

body {
    font-family: Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 10px;
}

/* Animated stars background */
.stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(2px 2px at 15% 85%, white, transparent),
        radial-gradient(1px 1px at 70% 20%, white, transparent);
    background-size: 200% 200%;
    animation: twinkle 4s ease-in-out infinite;
    z-index: 0;
}

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

/* Mascot Selection Screen */
.mascot-selection-screen, .unit-selection-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    overflow-y: auto;
}

.selection-title {
    font-size: clamp(1.5em, 5vw, 3.5em);
    color: #ffd93d;
    text-shadow: 4px 4px 0px #ff6b6b, 8px 8px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    animation: rainbowPulse 3s ease-in-out infinite;
    text-align: center;
}

@keyframes rainbowPulse {
    0%, 100% { transform: scale(1); color: #ffd93d; }
    33% { transform: scale(1.05); color: #ff6b6b; }
    66% { transform: scale(1.02); color: #6bcf7f; }
}

.mascot-choices {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
}

.mascot-choice {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    cursor: pointer;
    min-width: clamp(200px, 30vw, 280px);
}

.mascot-choice:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.mascot-character {
    font-size: clamp(4em, 10vw, 8em);
    margin-bottom: 20px;
    animation: mascotBounce 2s ease-in-out infinite;
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.mascot-name {
    font-size: clamp(1.3em, 3vw, 2em);
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 20px;
}

.select-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: clamp(1.1em, 2.5vw, 1.5em);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    font-family: 'Comic Sans MS', cursive;
    transition: all 0.3s;
}

.select-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.select-button:active {
    transform: scale(0.95);
}

/* Unit Selection Screen */
.units-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
}

.unit-button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-family: 'Comic Sans MS', cursive;
}

.unit-button:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.unit-number {
    font-size: 1.3em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.unit-name {
    font-size: 1.5em;
    color: #ff6b6b;
    font-weight: bold;
    margin: 10px 0;
}

.unit-words {
    font-size: 1.1em;
    color: #764ba2;
    margin-top: 10px;
}

.surprise-button {
    background: linear-gradient(135deg, #ffd93d 0%, #ffaa00 100%);
}

.surprise-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

/* Game Container */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: clamp(15px, 3vw, 30px);
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

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

.header h1 {
    color: #ff6b6b;
    font-size: clamp(1.5em, 4vw, 2.5em);
    text-shadow: 3px 3px 0px #ffd93d;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

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

.unit-title {
    font-size: clamp(1em, 2.5vw, 1.3em);
    color: #764ba2;
    font-weight: bold;
    margin-bottom: 15px;
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: clamp(0.9em, 2vw, 1.2em);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-label {
    margin-right: 5px;
}

.mascot-container {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.mascot {
    font-size: clamp(3em, 8vw, 5em);
    display: inline-block;
    animation: wiggle 1s ease-in-out infinite;
    transition: all 0.5s;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.speech-bubble {
    display: inline-block;
    background: #ffd93d;
    color: #333;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: clamp(1em, 2.5vw, 1.3em);
    font-weight: bold;
    margin-top: 10px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
    max-width: 90%;
}

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

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 12px solid transparent;
    border-bottom-color: #ffd93d;
}

.question-container {
    margin: 20px 0;
}

.word-display {
    text-align: center;
    margin-bottom: 20px;
}

.word-display h2 {
    color: #764ba2;
    font-size: clamp(1.1em, 2.5vw, 1.5em);
    margin-bottom: 15px;
}

.word {
    font-size: clamp(2em, 5vw, 3em);
    font-weight: bold;
    color: #ff6b6b;
    background: linear-gradient(135deg, #ffd93d 0%, #ffaa00 100%);
    padding: 15px 30px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
    margin-bottom: 15px;
}

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

.speaker-button {
    background: linear-gradient(135deg, #6bcf7f 0%, #4d96ff 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: clamp(1em, 2vw, 1.2em);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Comic Sans MS', cursive;
    transition: all 0.3s;
    margin: 10px 0;
}

.speaker-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.speaker-button:active {
    transform: scale(0.95);
}

.example-sentence {
    font-size: clamp(1em, 2.2vw, 1.3em);
    color: #764ba2;
    font-style: italic;
    margin-top: 15px;
    padding: 12px;
    background: rgba(253, 217, 61, 0.2);
    border-radius: 15px;
    border-left: 5px solid #ffd93d;
}

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

.answer-button {
    background: linear-gradient(135deg, #6bcf7f 0%, #4d96ff 100%);
    color: white;
    border: none;
    padding: 20px 15px;
    font-size: clamp(1em, 2.2vw, 1.3em);
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-family: 'Comic Sans MS', cursive;
    text-align: left;
}

.answer-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.answer-button:active {
    transform: translateY(-2px);
}

.answer-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress-container {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcf7f, #4d96ff);
    background-size: 200% 100%;
    border-radius: 15px;
    transition: width 0.5s ease-in-out;
    animation: progressShine 2s linear infinite;
}

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

.progress-text {
    margin-top: 10px;
    font-size: clamp(1em, 2vw, 1.2em);
    color: #764ba2;
    font-weight: bold;
}

/* Full Screen Overlays */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-in;
    padding: 20px;
    overflow-y: auto;
}

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

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

/* Celebration Overlay */
.celebration-content {
    text-align: center;
    position: relative;
}

.big-mascot {
    font-size: clamp(8em, 20vw, 15em);
    animation: celebrateBig 1s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
}

@keyframes celebrateBig {
    0%, 100% { transform: scale(1) rotate(-10deg); }
    25% { transform: scale(1.15) rotate(10deg); }
    50% { transform: scale(1.08) rotate(-10deg); }
    75% { transform: scale(1.15) rotate(10deg); }
}

.celebration-message {
    font-size: clamp(2.5em, 8vw, 5em);
    color: #ffd93d;
    font-weight: bold;
    text-shadow: 4px 4px 0px #ff6b6b, 8px 8px 20px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
    animation: messagePopIn 0.6s ease-out;
}

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

/* Wrong Answer Overlay */
.wrong-content {
    text-align: center;
    max-width: 900px;
    padding: 20px;
    width: 100%;
}

.sad-mascot {
    font-size: clamp(6em, 15vw, 12em);
    animation: sadShake 0.8s ease-in-out;
    filter: drop-shadow(0 0 30px rgba(255, 107, 107, 0.8));
}

@keyframes sadShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-15px); }
    20%, 40%, 60%, 80% { transform: translateX(15px); }
}

.wrong-message {
    font-size: clamp(1.8em, 5vw, 3em);
    color: #ff6b6b;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

.correct-answer-reveal {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: clamp(20px, 4vw, 40px);
    margin-top: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.reveal-label {
    font-size: clamp(1.3em, 3vw, 2em);
    color: #764ba2;
    margin-bottom: 15px;
    font-weight: bold;
}

.reveal-answer {
    font-size: clamp(1.5em, 3.5vw, 2.5em);
    color: #ff6b6b;
    background: linear-gradient(135deg, #ffd93d 0%, #ffaa00 100%);
    padding: 20px 30px;
    border-radius: 20px;
    margin: 20px 0;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: revealPulse 1.5s ease-in-out infinite;
}

@keyframes revealPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.03); box-shadow: 0 15px 40px rgba(255, 215, 0, 0.5); }
}

.reveal-word-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
    font-size: clamp(1.2em, 2.5vw, 1.8em);
}

.reveal-word {
    color: #ff6b6b;
    font-weight: bold;
    background: #ffd93d;
    padding: 8px 15px;
    border-radius: 15px;
}

.reveal-means {
    color: #764ba2;
    font-style: italic;
}

.reveal-definition {
    color: #4d96ff;
    font-weight: bold;
}

.continue-button {
    background: linear-gradient(135deg, #52c234 0%, #34a853 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: clamp(1.3em, 3vw, 2em);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Comic Sans MS', cursive;
    transition: all 0.3s;
    margin-top: 20px;
    animation: buttonBounce 2s ease-in-out infinite;
}

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

.continue-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.continue-button:active {
    transform: scale(0.95);
}

/* Unit Complete Overlay */
.unit-complete-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 20px;
}

.huge-mascot {
    font-size: clamp(10em, 22vw, 18em);
    animation: levelMascotDance 2s ease-in-out infinite;
    filter: drop-shadow(0 0 50px rgba(255, 215, 0, 1));
}

@keyframes levelMascotDance {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.12) rotate(-12deg); }
    50% { transform: scale(1.08) rotate(0deg); }
    75% { transform: scale(1.12) rotate(12deg); }
}

.unit-complete-title {
    font-size: clamp(2.5em, 7vw, 4em);
    color: #ffd93d;
    font-weight: bold;
    text-shadow: 5px 5px 0px #ff6b6b, 10px 10px 30px rgba(0, 0, 0, 0.5);
    margin: 25px 0;
    animation: titleShine 2s ease-in-out infinite;
}

@keyframes titleShine {
    0%, 100% { text-shadow: 5px 5px 0px #ff6b6b, 10px 10px 30px rgba(0, 0, 0, 0.5); }
    50% { text-shadow: 5px 5px 0px #6bcf7f, 10px 10px 50px rgba(107, 207, 127, 0.8); }
}

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

.unit-complete-stat {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: clamp(20px, 4vw, 30px) clamp(30px, 6vw, 50px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.unit-complete-stat-label {
    font-size: clamp(1.1em, 2.5vw, 1.5em);
    color: #764ba2;
    margin-bottom: 12px;
}

.unit-complete-stat-value {
    font-size: clamp(2.5em, 6vw, 4em);
    color: #ff6b6b;
    font-weight: bold;
    text-shadow: 3px 3px 0px #ffd93d;
}

.unit-complete-message {
    font-size: clamp(1.5em, 3.5vw, 2.5em);
    color: #6bcf7f;
    font-weight: bold;
    margin: 25px 0;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

/* Celebration Particles */
.celebration-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2500;
}

.confetti-piece {
    position: absolute;
    width: 15px;
    height: 15px;
    animation: confettiFall 3s linear forwards;
}

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

.star-burst {
    position: absolute;
    font-size: clamp(2em, 4vw, 3em);
    animation: starBurst 2s ease-out forwards;
}

@keyframes starBurst {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
    100% { transform: scale(2) rotate(360deg); opacity: 0; }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .game-container {
        padding: 15px;
        border-radius: 20px;
    }

    .mascot-choices {
        gap: 15px;
    }

    .mascot-choice {
        padding: 20px;
        min-width: 150px;
    }

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

    .answer-button {
        padding: 18px 12px;
    }

    .stats {
        gap: 8px;
    }

    .stat-item {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .units-container {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .speech-bubble {
        font-size: 1em;
        padding: 10px 15px;
    }

    .speech-bubble::before {
        border-width: 10px;
    }

    .wrong-content,
    .unit-complete-content {
        padding: 15px;
    }

    .correct-answer-reveal {
        padding: 20px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .selection-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .mascot-character {
        font-size: 4em;
    }

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

    .select-button {
        padding: 12px 25px;
        font-size: 1.1em;
    }

    .word {
        font-size: 1.8em;
        padding: 12px 20px;
    }

    .answer-button {
        font-size: 1em;
        padding: 15px 10px;
    }

    .big-mascot {
        font-size: 8em;
    }

    .celebration-message {
        font-size: 2.5em;
    }

    .sad-mascot {
        font-size: 6em;
    }

    .huge-mascot {
        font-size: 10em;
    }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .mascot-selection-screen,
    .unit-selection-screen,
    .fullscreen-overlay {
        justify-content: flex-start;
        padding-top: 10px;
    }

    .selection-title {
        margin-bottom: 15px;
        font-size: 2em;
    }

    .mascot-character {
        font-size: 5em;
    }

    .big-mascot,
    .sad-mascot,
    .huge-mascot {
        font-size: 8em;
    }
}

/* ===== ACCESSIBILITY STYLES ===== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced focus indicators for keyboard navigation */
*:focus {
    outline: 3px solid #ffd93d;
    outline-offset: 3px;
}

button:focus,
.select-button:focus,
.unit-button:focus,
.grade-button:focus,
.answer-button:focus {
    outline: 4px solid #ffd93d;
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(255, 217, 61, 0.3);
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ffd93d;
    color: #333;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* ===== GRADE SELECTION STYLES ===== */

.grade-selection {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 30px;
}

.grades-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.grade-button {
    background: linear-gradient(135deg, #6bcf7f 0%, #4d96ff 100%);
    border: none;
    border-radius: 20px;
    padding: 25px 15px;
    font-size: clamp(1.2em, 3vw, 1.8em);
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.grade-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.grade-button:active {
    transform: translateY(-2px) scale(1.02);
}

.grade-number {
    font-size: 1.2em;
    font-weight: bold;
}

.grade-label {
    font-size: 0.6em;
    opacity: 0.9;
}

/* Units section (shown after grade selection) */
.units-section {
    width: 100%;
    max-width: 1200px;
}

.selection-subtitle {
    font-size: clamp(1.2em, 4vw, 2.5em);
    color: #ffd93d;
    text-shadow: 3px 3px 0px #ff6b6b, 6px 6px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    text-align: center;
}

.back-button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: clamp(1em, 2.5vw, 1.2em);
    font-weight: bold;
    color: #764ba2;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
    transform: translateX(-5px);
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-button:active {
    transform: translateX(-2px);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button, .select-button, .unit-button, .grade-button {
        border: 3px solid currentColor;
    }
    
    *:focus {
        outline-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .mascot-choice:hover,
    .unit-button:hover,
    .grade-button:hover {
        transform: none;
    }
}

/* Mobile accessibility improvements */
@media (max-width: 768px) {
    .grades-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
        padding: 15px;
    }
    
    .grade-button {
        padding: 20px 10px;
        min-height: 80px;
        font-size: clamp(1em, 4vw, 1.5em);
    }
    
    /* Larger touch targets for mobile */
    button, .select-button, .answer-button {
        min-height: 48px;
        min-width: 48px;
    }
}
