:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --bg-color: #f7fff7;
    --text-color: #2f3e46;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

#game-container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    border: 5px solid var(--secondary-color);
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.screen {
    display: none;
}

.screen.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

button {
    font-family: inherit;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

button:hover {
    transform: scale(1.05);
    background-color: #3dbfb6;
}

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

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-btn {
    background-color: var(--accent-color);
    color: var(--text-color);
    font-size: 2rem;
    padding: 1.5rem;
}

.option-btn:hover {
    background-color: #f7d745;
}

#timer-container {
    width: 100%;
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#timer-bar {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 1s linear;
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
}

.setting-group {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input[type="range"] {
    width: 100%;
}

.problem {
    font-size: 4rem;
    margin: 2rem 0;
    font-weight: bold;
}

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

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

.bounce {
    animation: bounce 0.5s ease;
}

.shake {
    animation: shake 0.5s ease;
}

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

.high-score-info {
    font-size: 1.1rem;
    color: var(--text-color);
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    margin: 0.5rem 0;
    font-weight: bold;
}

#start-high-score, #game-over-high-score {
    color: var(--primary-color);
}

.new-record {
    color: #ff9f43;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    animation: bounce 0.5s ease infinite;
}
