@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&display=swap');

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #ffebee;
    font-family: 'Gaegu', cursive;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 450px;
    height: 700px;
    background: linear-gradient(135deg, #fff9f9 0%, #ffe4e8 100%);
    border: 8px solid #ff4081;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(255, 64, 129, 0.2);
    overflow: hidden;
}

#ui-layer {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

#score-board {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    color: #ff4081;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#next-preview {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#next-kirby {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

#game-canvas {
    width: 100%;
    height: 100%;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.hidden {
    display: none;
}

.message-box {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 5px solid #ff4081;
}

.message-box.win {
    border-color: #ffd700;
}

.message-box h1 {
    font-size: 48px;
    margin: 0;
    color: #ff4081;
}

.message-box.win h1 {
    color: #fbc02d;
}

.message-box p {
    font-size: 24px;
    color: #666;
    margin: 10px 0 20px;
}

.final-score {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
}

button {
    background: #ff4081;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    font-family: 'Gaegu', cursive;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 5px 15px rgba(255, 64, 129, 0.3);
}

button:hover {
    transform: scale(1.1);
    background: #f50057;
}

#back-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

#back-btn a {
    text-decoration: none;
    color: #ff80ab;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}