/* Math Park Builder - Styles */

:root {
    /* Theme Park Color Palette */
    --park-blue: #00b4d8;
    --park-blue-dark: #0077b6;
    --park-gold: #ffd700;
    --park-gold-dark: #c9a200;
    --park-purple: #9b5de5;
    --park-green: #00f5d4;
    --park-red: #f15bb5;
    --park-orange: #fee440;
    --park-pink: #ff6b9d;

    /* Fun bright colors */
    --candy-pink: #ff69b4;
    --sky-blue: #87ceeb;
    --grass-green: #90ee90;

    /* Background Colors - Fun sunset sky */
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #2d1b4e;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-bg-hover: rgba(255, 255, 255, 0.15);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);

    /* Sizing */
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Screen System */
.screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    gap: var(--spacing-sm);
}

.screen-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
    transform: scale(0.95);
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, var(--park-gold), var(--park-gold-dark));
    color: #1a1a2e;
    font-size: 1.25rem;
    font-weight: 700;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    min-width: 200px;
}

.primary-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.primary-btn:disabled {
    background: var(--card-bg);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: var(--card-bg-hover);
}

.back-btn {
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.park-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--park-gold), var(--park-gold-dark));
    font-size: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Home Link */
.home-link {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: color 0.2s ease;
}

.home-link:hover {
    color: var(--text-primary);
}

/* Start Screen */
#start-screen .screen-content {
    justify-content: center;
    gap: var(--spacing-lg);
    max-width: 400px;
    margin: 0 auto;
}

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

.park-icon {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
}

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

.park-header h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    background: linear-gradient(135deg, var(--park-gold), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: var(--spacing-sm);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: var(--spacing-xs);
}

/* Player Name Input */
.player-select, .year-select {
    width: 100%;
    text-align: center;
}

.player-select label, .year-select label {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

#player-name {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1.25rem;
    text-align: center;
    background: var(--card-bg);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

#player-name:focus {
    border-color: var(--park-gold);
}

#player-name::placeholder {
    color: var(--text-muted);
}

/* Year Selection */
.year-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.year-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    min-width: 100px;
}

.year-btn.selected {
    background: linear-gradient(135deg, var(--park-purple), #6d28d9);
    border-color: var(--park-purple);
}

/* Player Info */
.player-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    justify-content: center;
}

.player-name-display {
    font-weight: 600;
    color: var(--park-gold);
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 215, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

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

.coin-count {
    font-weight: 700;
    color: var(--park-gold);
}

/* Menu Screen */
#menu-screen h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: var(--spacing-xs);
}

.menu-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    width: 100%;
    max-width: 800px;
}

.topic-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.topic-card:hover {
    background: var(--card-bg-hover);
    transform: translateY(-2px);
}

.topic-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.topic-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topic-info {
    flex: 1;
}

.topic-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.topic-progress {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topic-stars {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}

.topic-stars .star {
    font-size: 1rem;
    opacity: 0.3;
}

.topic-stars .star.earned {
    opacity: 1;
}

/* Levels Container */
.levels-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 120px));
    gap: var(--spacing-md);
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.level-card {
    aspect-ratio: 1;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.level-card:hover:not(.locked) {
    background: var(--card-bg-hover);
    transform: scale(1.05);
}

.level-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.level-card.completed {
    border-color: var(--park-green);
    background: rgba(34, 197, 94, 0.1);
}

.level-card.current {
    border-color: var(--park-gold);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
}

.level-number {
    font-size: 2rem;
    font-weight: 700;
}

.level-stars {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}

.level-stars .star {
    font-size: 0.9rem;
    opacity: 0.3;
}

.level-stars .star.earned {
    opacity: 1;
}

.level-lock {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* Game Screen */
.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    gap: var(--spacing-md);
    overflow: hidden;
}

.game-progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    max-width: 200px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--park-green), #4ade80);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 35px;
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(249, 115, 22, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.streak-icon {
    font-size: 1rem;
}

.streak-count {
    font-weight: 700;
    color: var(--park-orange);
}

/* Question Area */
.question-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    min-height: 0;
}

.question-visual {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    min-height: 120px;
    width: 100%;
    max-width: 400px;
}

.question-text {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    text-align: center;
}

/* Visual Math Elements */
.visual-dot {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--park-blue), var(--park-blue-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop-in 0.3s ease backwards;
}

.visual-dot.empty {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

@keyframes pop-in {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ten Frame */
.ten-frames-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.ten-frame {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    background: var(--bg-gradient-start);
    border-radius: 8px;
    border: 3px solid var(--text-muted);
}

.ten-frame-cell {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ten-frame-cell.filled {
    background: linear-gradient(135deg, var(--park-blue), var(--park-blue-dark));
}

/* Part-Whole Model */
.part-whole-model {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.whole-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--park-purple), #6d28d9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.parts-row {
    display: flex;
    gap: 40px;
}

.part-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--park-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.part-circle.mystery {
    background: linear-gradient(135deg, var(--park-gold), var(--park-gold-dark));
    border-color: var(--park-gold);
    color: #1a1a2e;
}

.part-whole-lines {
    width: 80px;
    height: 30px;
    position: relative;
}

.part-whole-lines::before,
.part-whole-lines::after {
    content: '';
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--park-purple);
}

.part-whole-lines::before {
    left: 10px;
    transform: rotate(-30deg);
    transform-origin: top center;
}

.part-whole-lines::after {
    right: 10px;
    transform: rotate(30deg);
    transform-origin: top center;
}

/* Number Line */
.number-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 350px;
}

.number-line-bar {
    width: 100%;
    height: 4px;
    background: var(--text-secondary);
    position: relative;
}

.number-line-marks {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.number-line-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.number-line-mark::before {
    content: '';
    width: 2px;
    height: 10px;
    background: var(--text-secondary);
}

.number-line-mark span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.number-line-mark.highlight span {
    color: var(--park-gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.number-line-jump {
    position: absolute;
    top: -30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jump-arrow {
    font-size: 1.5rem;
    color: var(--park-green);
}

/* Bar Model */
.bar-model {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
}

.bar-total {
    height: 40px;
    background: linear-gradient(135deg, var(--park-purple), #6d28d9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.bar-parts {
    display: flex;
    gap: 4px;
}

.bar-part {
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.bar-part.known {
    background: var(--park-blue);
}

.bar-part.mystery {
    background: linear-gradient(135deg, var(--park-gold), var(--park-gold-dark));
    color: #1a1a2e;
}

/* Answer Area */
.answer-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.answer-btn {
    padding: var(--spacing-md);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    border: 3px solid transparent;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.answer-btn:hover {
    background: var(--card-bg-hover);
}

.answer-btn.correct {
    background: rgba(34, 197, 94, 0.3);
    border-color: var(--park-green);
    animation: correct-pulse 0.5s ease;
}

.answer-btn.incorrect {
    background: rgba(239, 68, 68, 0.3);
    border-color: var(--park-red);
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Number Input Answer */
.number-input-container {
    grid-column: 1 / -1;
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.number-input {
    width: 100px;
    padding: var(--spacing-md);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: var(--card-bg);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    outline: none;
}

.number-input:focus {
    border-color: var(--park-gold);
}

.submit-answer-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--park-green), #16a34a);
    color: white;
    border-radius: var(--border-radius);
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.feedback-overlay.show {
    display: flex;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.feedback-content {
    text-align: center;
    animation: pop-in 0.3s ease;
}

.feedback-icon {
    font-size: 5rem;
    margin-bottom: var(--spacing-sm);
}

.feedback-text {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Level Complete Screen */
.celebration {
    justify-content: center;
    gap: var(--spacing-lg);
    text-align: center;
}

.stars-display {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.stars-display .star {
    font-size: 4rem;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.stars-display .star.earned {
    opacity: 1;
    animation: star-pop 0.5s ease backwards;
}

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

.stars-display .star:nth-child(1) { animation-delay: 0.1s; }
.stars-display .star:nth-child(2) { animation-delay: 0.3s; }
.stars-display .star:nth-child(3) { animation-delay: 0.5s; }

#complete-title {
    font-size: 2rem;
}

#complete-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.rewards-section {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--card-bg);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
}

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

.reward-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--park-gold);
}

.reward-text {
    font-weight: 600;
}

.complete-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

/* Park Screen */
.kingdom-view {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
    background: linear-gradient(to bottom,
        #ff9a9e 0%,
        #fecfef 30%,
        #87ceeb 60%,
        #90ee90 80%,
        #228b22 100%);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    border: 4px solid var(--park-purple);
}

/* Ground - grassy park area */
.kingdom-view::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(to bottom, #90ee90, #228b22);
}

/* Path through park */
.kingdom-view::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 35%;
    background: linear-gradient(to bottom, #d4a574, #c4956a);
    border-radius: 30px 30px 0 0;
}

/* Park entrance */
.park-entrance {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Building blocks in kingdom */
.kingdom-block {
    position: absolute;
    transition: all 0.5s ease;
    animation: build-in 0.5s ease backwards;
}

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

/* Kingdom Stats */
.kingdom-stats {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

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

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--park-gold);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Blocks Collection */
.blocks-collection {
    width: 100%;
    max-width: 500px;
}

.blocks-collection h3 {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: var(--spacing-sm);
}

.block-item {
    aspect-ratio: 1;
    background: var(--card-bg);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.2s ease;
}

.block-item:hover {
    transform: scale(1.1);
}

.block-item.locked {
    opacity: 0.3;
}

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, var(--park-gold), var(--park-gold-dark));
    color: #1a1a2e;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    z-index: 200;
    opacity: 0;
    transition: all 0.5s ease;
    text-align: center;
}

.achievement-popup.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

.achievement-title {
    font-size: 0.8rem;
    opacity: 0.8;
}

.achievement-name {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Particles */
#particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 150;
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: particle-fall 2s ease-out forwards;
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .screen-content {
        padding: var(--spacing-sm);
    }

    .topics-grid {
        grid-template-columns: 1fr;
    }

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

    .question-visual {
        min-height: 100px;
        padding: var(--spacing-sm);
    }

    .visual-dot {
        width: 32px;
        height: 32px;
    }

    .answer-btn {
        padding: var(--spacing-sm);
        font-size: 1.25rem;
    }

    .year-buttons {
        flex-direction: column;
    }

    .complete-buttons {
        flex-direction: column;
    }
}

@media (min-width: 768px) {
    .game-content {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Counting Objects */
.counting-objects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 300px;
}

.counting-object {
    font-size: 2.5rem;
    animation: pop-in 0.3s ease backwards;
}

.counting-object:nth-child(1) { animation-delay: 0.05s; }
.counting-object:nth-child(2) { animation-delay: 0.1s; }
.counting-object:nth-child(3) { animation-delay: 0.15s; }
.counting-object:nth-child(4) { animation-delay: 0.2s; }
.counting-object:nth-child(5) { animation-delay: 0.25s; }
.counting-object:nth-child(6) { animation-delay: 0.3s; }
.counting-object:nth-child(7) { animation-delay: 0.35s; }
.counting-object:nth-child(8) { animation-delay: 0.4s; }
.counting-object:nth-child(9) { animation-delay: 0.45s; }
.counting-object:nth-child(10) { animation-delay: 0.5s; }

/* Comparison Visual */
.comparison-visual {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

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

.comparison-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    max-width: 100px;
}

.comparison-items .item {
    font-size: 1.5rem;
}

.comparison-vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--park-gold);
}

/* Addition/Subtraction Visual Groups */
.operation-visual {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
}

.visual-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    max-width: 150px;
    justify-content: center;
}

.operation-symbol {
    font-size: 2rem;
    font-weight: 700;
    color: var(--park-gold);
}

/* Cross out animation for subtraction */
.visual-dot.crossed {
    position: relative;
    opacity: 0.4;
}

.visual-dot.crossed::after {
    content: '✕';
    position: absolute;
    font-size: 1.5rem;
    color: var(--park-red);
}
