* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Bubblegum Sans', 'Arial', sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 8px solid #FFD700;
}

h1 {
    color: #FF6B6B;
    margin-bottom: 20px;
    font-size: 2.8rem;
    text-shadow: 2px 2px 0 #FFD700;
    animation: bounce 2s infinite;
}

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

h2 {
    color: #FF6B6B;
    margin-bottom: 15px;
    font-size: 2.2rem;
    text-shadow: 1px 1px 0 #FFD700;
}

p {
    margin-bottom: 20px;
    font-size: 1.2rem;
    line-height: 1.5;
}

button {
    background: linear-gradient(to right, #FF6B6B, #FF8E53);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform-origin: center;
}

button:hover {
    background: linear-gradient(to right, #FF8E53, #FF6B6B);
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

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

button:disabled {
    background: linear-gradient(to right, #95a5a6, #bdc3c7);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#score-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    background-color: #4ECDC4;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
    font-weight: bold;
    animation: slide-in 0.5s ease-out;
}

@keyframes slide-in {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.score-item {
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-item span {
    font-size: 1.4rem;
    color: #FFED00;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

#start-screen, #game-over, #level-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

#start-screen {
    animation: fade-in 1s ease;
}

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

#game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#instruction-text {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: bold;
    padding: 10px 15px;
    background-color: #F7FFF7;
    border-radius: 10px;
    border-left: 5px solid #4ECDC4;
}

#helper-container {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

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

.helper-image {
    width: 100%;
    max-width: 200px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    border: 5px solid white;
    transition: transform 0.3s ease;
}

.helper-image:hover {
    transform: scale(1.05);
}

.helper-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 10px 0;
    color: #FF6B6B;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
    background: linear-gradient(to right, #FF6B6B, #FF8E53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#tools-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    width: 100%;
}

.tool-option {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #4ECDC4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform-origin: center;
}

.tool-option:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #FF8E53;
}

.tool-option.correct {
    border-color: #2ecc71;
    box-shadow: 0 0 15px #2ecc71;
    animation: correct-animation 0.5s;
}

.tool-option.incorrect {
    border-color: #e74c3c;
    box-shadow: 0 0 15px #e74c3c;
    animation: incorrect-animation 0.5s;
}

.tool-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform 0.3s ease;
}

.tool-option:hover .tool-image {
    transform: scale(1.1);
}

.tool-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
    color: white;
    padding: 8px 5px 5px 5px;
    font-size: 0.9rem;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

#fact-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 15px;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
    max-width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px dashed #4ECDC4;
    position: relative;
}

#fact-container:before {
    content: "Fun Fact!";
    position: absolute;
    top: -12px;
    left: 20px;
    background-color: #4ECDC4;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

#fact-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.feedback-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 2rem;
    font-weight: bold;
    z-index: 100;
    animation: fadeInOut 2s forwards;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.feedback-message.correct {
    background: linear-gradient(to right, #2ecc71, #1abc9c);
    color: white;
}

.feedback-message.wrong {
    background: linear-gradient(to right, #e74c3c, #e67e22);
    color: white;
}

.bonus-time {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(to right, #f39c12, #e67e22);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: bonusAnimation 2s forwards;
    z-index: 1000;
    font-size: 1.2rem;
}

.hidden {
    display: none !important;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    25% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

@keyframes bonusAnimation {
    0% { opacity: 0; transform: translateY(-20px); }
    20% { opacity: 1; transform: translateY(0) scale(1.1); }
    25% { transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

@keyframes correct-animation {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(3deg); }
}

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

/* Game mascot styling */
.game-mascot {
    margin: 20px auto;
    animation: float 3s ease-in-out infinite;
}

.game-mascot img {
    width: 320px;
    height: 320px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

/* How to play section */
.how-to-play {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #4ECDC4;
}

.how-to-play h3 {
    color: #FF6B6B;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.how-to-play ul {
    padding-left: 25px;
}

.how-to-play li {
    margin-bottom: 8px;
    position: relative;
}

.how-to-play li::before {
    content: "✓";
    color: #4ECDC4;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Progress bar */
.progress-container {
    margin-top: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    position: relative;
}

.progress-bar {
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, #FFD700, #FF6B6B);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 50px;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Celebration animation */
.celebration-animation {
    font-size: 5rem;
    color: #FFD700;
    margin: 20px 0;
    animation: celebrate-trophy 2s infinite;
}

@keyframes celebrate-trophy {
    0% { transform: scale(1) rotate(-5deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(-5deg); }
}

/* Achievement badges */
.achievement {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    transform: scale(0);
    animation: badge-appear 0.5s forwards 0.5s;
}

.badge i {
    font-size: 1.5rem;
}

@keyframes badge-appear {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Sound toggle button */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4ECDC4, #2AB7CA);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease, background 0.3s ease;
}

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

.sound-toggle i {
    font-size: 1.2rem;
}

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

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

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

/* Mobile responsive adaptations */
@media (max-width: 600px) {
    .container {
        padding: 15px;
        border-width: 5px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #score-container {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .tool-option {
        width: 100px;
        height: 100px;
    }
    
    .helper-image {
        max-width: 160px;
    }
    
    .helper-name {
        font-size: 1.5rem;
    }
    
    .game-mascot img {
        width: 100px;
        height: 100px;
    }
    
    .how-to-play {
        padding: 10px;
    }
    
    .how-to-play h3 {
        font-size: 1.1rem;
    }
    
    .celebration-animation {
        font-size: 3.5rem;
    }
    
    .badge {
        padding: 10px 20px;
    }
    
    .sound-toggle {
        width: 35px;
        height: 35px;
        bottom: 15px;
        right: 15px;
    }
    
    .sound-toggle i {
        font-size: 1rem;
    }
} 