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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive, sans-serif;
    background: linear-gradient(180deg, #A8E6FF 0%, #FFE5F1 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.4) 0%, transparent 40%);
    pointer-events: none;
}

.game-container {
    max-width: 520px;
    width: 100%;
    background: #FFFEF7;
    border-radius: 30px;
    padding: 20px;
    border: 5px solid #FFB6D9;
    box-shadow: 0 8px 0 #FF8DC7;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.score-panel {
    display: flex;
    gap: 15px;
}

.score-item {
    background: #FFE66D;
    padding: 12px 20px;
    border-radius: 20px;
    color: #5A3E2B;
    min-width: 85px;
    border: 4px solid #FFC93C;
    box-shadow: 0 4px 0 #FFAA00;
}

.score-label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
}

.next-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFD4E5;
    padding: 10px 16px;
    border-radius: 20px;
    border: 4px solid #FFB6D9;
    box-shadow: 0 4px 0 #FF8DC7;
}

.next-label {
    font-size: 14px;
    color: #8B4789;
    font-weight: bold;
}

.next-bubble {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.game-area {
    position: relative;
    background: #E3F5FF;
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 5px solid #7EC8E3;
    box-shadow: 0 6px 0 #5DADE2;
}

#gameCanvas {
    display: block;
    width: 100%;
    cursor: pointer;
}

.drop-line {
    position: absolute;
    top: 110px;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #FF6B9D 0px,
        #FF6B9D 12px,
        transparent 12px,
        transparent 24px
    );
    pointer-events: none;
    opacity: 0.8;
}

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.game-over-overlay.active {
    display: flex;
}

.game-over-panel {
    background: #FFF9E6;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    animation: popIn 0.3s ease-out;
    border: 5px solid #FFD93D;
    box-shadow: 0 8px 0 #FFB800;
}

@keyframes popIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-over-panel h2 {
    font-size: 36px;
    color: #FF6B9D;
    margin-bottom: 20px;
}

.final-score {
    font-size: 28px;
    color: #6BCB77;
    margin-bottom: 30px;
    font-weight: bold;
}

.restart-btn {
    background: #6BCB77;
    color: white;
    border: 5px solid #4D96A9;
    padding: 16px 45px;
    border-radius: 25px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 6px 0 #3A7D8A;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #3A7D8A;
}

.restart-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #3A7D8A;
}

.evolution-circle {
    background: #FFF4E0;
    border-radius: 20px;
    padding: 16px;
    border: 4px solid #FFD89C;
    box-shadow: 0 4px 0 #FFB84D;
}

.evolution-title {
    font-size: 16px;
    font-weight: bold;
    color: #8B6914;
    margin-bottom: 12px;
    text-align: center;
}

.evolution-items {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.evolution-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    transition: opacity 0.3s, transform 0.3s;
    border: 3px solid #DDD;
    filter: grayscale(100%);
}

.evolution-item.unlocked {
    opacity: 1;
    animation: unlock 0.5s ease-out;
    filter: grayscale(0%);
    border-color: #FFD700;
}

@keyframes unlock {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .game-container {
        padding: 15px;
    }

    .score-item {
        padding: 10px 15px;
        min-width: 70px;
    }

    .score-value {
        font-size: 20px;
    }

    .game-over-panel {
        padding: 30px 20px;
    }

    .game-over-panel h2 {
        font-size: 28px;
    }
}
