* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 25%, #fecfef 50%, #a8edea 75%, #fed6e3 100%);
    background-size: 300% 300%;
    animation: dreamyBg 8s ease infinite;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #6b46c1;
    position: relative;
    overflow: hidden;
}

/* キラキラアニメーション */
@keyframes dreamyBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 浮遊する星エフェクト */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #ff69b4, transparent),
        radial-gradient(1px 1px at 90px 40px, #87ceeb, transparent),
        radial-gradient(1px 1px at 130px 80px, #dda0dd, transparent),
        radial-gradient(2px 2px at 160px 30px, #98fb98, transparent);
    background-size: 200px 100px;
    animation: floatingStars 10s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes floatingStars {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.game-container {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 182, 193, 0.3), rgba(221, 160, 221, 0.3));
    border-radius: 30px;
    padding: 25px;
    box-shadow: 
        0 8px 32px rgba(255, 105, 180, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 182, 193, 0.5);
    animation: containerGlow 3s ease-in-out infinite alternate;
}

@keyframes containerGlow {
    0% { 
        box-shadow: 
            0 8px 32px rgba(255, 105, 180, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    100% { 
        box-shadow: 
            0 12px 40px rgba(255, 105, 180, 0.5),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

.ui-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #6b46c1;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 182, 193, 0.8);
}

.life-display, .score-display {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.6), rgba(221, 160, 221, 0.6));
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid rgba(255, 105, 180, 0.5);
    box-shadow: 
        0 4px 15px rgba(255, 105, 180, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.progress-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    color: #6b46c1;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 182, 193, 0.8);
}

.clear-display {
    background: linear-gradient(135deg, rgba(152, 251, 152, 0.6), rgba(221, 160, 221, 0.6));
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(152, 251, 152, 0.5);
    box-shadow: 
        0 4px 15px rgba(152, 251, 152, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

#gameCanvas {
    background: linear-gradient(to bottom, #ffd1dc 0%, #ffb6c1 30%, #dda0dd 70%, #f0e6ff 100%);
    border: 4px solid rgba(255, 182, 193, 0.8);
    border-radius: 20px;
    box-shadow: 
        0 8px 25px rgba(255, 105, 180, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    display: block;
    animation: canvasGlow 4s ease-in-out infinite alternate;
}

@keyframes canvasGlow {
    0% { 
        box-shadow: 
            0 8px 25px rgba(255, 105, 180, 0.4),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    100% { 
        box-shadow: 
            0 12px 35px rgba(255, 105, 180, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(255, 240, 245, 0.95), rgba(230, 230, 250, 0.95));
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 
        0 15px 35px rgba(255, 105, 180, 0.4),
        inset 0 0 25px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 182, 193, 0.6);
    animation: screenFloat 3s ease-in-out infinite alternate;
}

@keyframes screenFloat {
    0% { transform: translate(-50%, -50%) translateY(0px); }
    100% { transform: translate(-50%, -50%) translateY(-5px); }
}

.screen.hidden {
    display: none;
}

.screen h1 {
    color: #8b5cf6;
    margin-bottom: 25px;
    font-size: 32px;
    text-shadow: 0 0 15px rgba(255, 182, 193, 0.8);
    animation: titleSparkle 2s ease-in-out infinite alternate;
}

.screen h2 {
    color: #ec4899;
    margin-bottom: 25px;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

.screen p {
    color: #7c3aed;
    margin-bottom: 20px;
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(255, 182, 193, 0.5);
}

@keyframes titleSparkle {
    0% { text-shadow: 0 0 15px rgba(255, 182, 193, 0.8); }
    100% { text-shadow: 0 0 25px rgba(255, 182, 193, 1), 0 0 35px rgba(221, 160, 221, 0.8); }
}

button {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44bd4 50%, #9c88ff 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(255, 107, 157, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: buttonGlow 2s ease-in-out infinite alternate;
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(255, 107, 157, 0.6),
        inset 0 2px 15px rgba(255, 255, 255, 0.4);
    animation: buttonSparkle 0.5s ease-in-out infinite;
}

button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 4px 15px rgba(255, 107, 157, 0.5),
        inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

@keyframes buttonGlow {
    0% { box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4), inset 0 2px 10px rgba(255, 255, 255, 0.3); }
    100% { box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6), inset 0 2px 15px rgba(255, 255, 255, 0.4); }
}

@keyframes buttonSparkle {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 182, 193, 0.6); }
}

.controls {
    margin-top: 25px;
    text-align: center;
    color: #8b5cf6;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(221, 160, 221, 0.3));
    padding: 15px 25px;
    border-radius: 25px;
    border: 2px solid rgba(255, 105, 180, 0.3);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.2);
    backdrop-filter: blur(5px);
    text-shadow: 0 0 8px rgba(255, 182, 193, 0.6);
}

/* 点滅アニメーション（ダメージ時用） */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.blinking {
    animation: blink 0.1s infinite;
}