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

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    overflow: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

h1 {
    color: #5a67d8;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    width: 0%;
    transition: width 0.5s ease;
}

.score-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.score, .high-score {
    font-size: 1.5rem;
    color: #5a67d8;
    font-weight: bold;
}

.reset-high-score {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-high-score:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

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

.answer-btn {
    aspect-ratio: 1;
    font-size: 3rem;
    font-weight: bold;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #fbb6ce 0%, #f687b3 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.answer-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.answer-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.answer-btn:active::after {
    width: 200px;
    height: 200px;
}

.answer-btn.correct {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    animation: bounce 0.5s ease;
}

.answer-btn.incorrect {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    animation: shake 0.5s ease;
}

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

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

.question-area {
    text-align: center;
    position: relative;
}

.timer-container {
    position: absolute;
    top: -100px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 80px;
}

.timer-svg {
    transform: rotate(-90deg);
}

.timer-track {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 8;
}

.timer-circle {
    fill: none;
    stroke: #5a67d8;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: #5a67d8;
}

.question {
    font-size: 5rem;
    font-weight: bold;
    color: #5a67d8;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.question span {
    display: inline-block;
}

.operator {
    font-size: 4rem;
    color: #e53e3e;
}

.equals {
    color: #38a169;
}

.answer-placeholder {
    color: #cbd5e0;
    border: 3px dashed #cbd5e0;
    padding: 10px 30px;
    border-radius: 15px;
    min-width: 120px;
}

.feedback {
    font-size: 2rem;
    font-weight: bold;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback.correct {
    color: #38a169;
    animation: fadeInScale 0.5s ease;
}

.feedback.incorrect {
    color: #e53e3e;
    animation: fadeInScale 0.5s ease;
}

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

.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.celebration.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.celebration h2 {
    color: white;
    font-size: 4rem;
    text-align: center;
}

.stars {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 20px;
}

.star {
    font-size: 5rem;
    animation: starRotate 2s ease infinite;
}

.star:nth-child(2) {
    animation-delay: 0.2s;
}

.star:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes starRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

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

@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .question {
        font-size: 3rem;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .answer-btn {
        font-size: 2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    .timer-container {
        top: -80px;
    }
    
    .answers-grid {
        gap: 10px;
    }
}

.honey-image {
    display: block;
    width: 120px;
    height: auto;
    margin: 20px auto 0;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .honey-image {
        width: 80px;
    }
}

.timeout-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.timeout-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.timeout-content h2 {
    color: #e53e3e;
    font-size: 3rem;
    margin-bottom: 20px;
}

.timeout-content p {
    font-size: 1.5rem;
    color: #5a67d8;
    margin-bottom: 30px;
}

.play-again-btn {
    padding: 20px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.play-again-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

.glowing {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(72, 187, 120, 0.6), 0 0 40px rgba(72, 187, 120, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(72, 187, 120, 0.8), 0 0 60px rgba(72, 187, 120, 0.6);
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f0f;
    animation: confetti-fall 3s linear forwards;
}

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

@media (max-width: 768px) {
    h1 {
        display: none;
    }
    
    .progress-bar {
        display: none;
    }
    
    .score-section {
        flex-direction: row;
        justify-content: space-between;
        gap: 15px;
    }
    
    .timer-container {
        display: none;
    }
    
    .container {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        padding: 15px;
    }
    
    .game-area {
        height: calc(100vh - 120px);
    }
    
    .honey-image {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }
}