/* --- CSS --- */
:root {
    --sunao-blue: #75cce8;
    --sunao-pink: #f0a0b8;
    --sunao-brown: #8c6d62;
    --sugar-white: #fafafa;
    --dark-text: #333;
    --danger-red: #e74c3c;
    --gold: #ffd700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f8ff;
    color: var(--dark-text);
    touch-action: none;
}

#game-container {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 9 / 16;
    max-height: 100vh;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid var(--sunao-blue);
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.5s;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* --- タイトル画面 --- */
#title-screen {
    background: linear-gradient(180deg, var(--sunao-blue) 0%, #a3dff3 100%);
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

#title-screen h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

#title-screen p {
    font-size: 1.1rem;
    margin: 0 20px 30px;
}

#difficulty-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--sunao-blue);
    background-color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.btn.hard {
    background-color: var(--sunao-pink);
    color: white;
}

/* --- ゲーム画面 --- */
#game-screen {
    background-color: transparent;
}

#game-canvas {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #a7e0f5 0%, #e0f2f9 100%);
}

#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.3);
}

#score-display, #life-display, #timer-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-text);
}

#life-display {
    letter-spacing: 4px;
}

#bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sunao-power-gauge-container {
    flex-grow: 1;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid white;
}

#sunao-power-gauge-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--sunao-pink) 0%, #ffc0cb 100%);
    transition: width 0.2s ease-out;
}

#sunao-power-button {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background-color: var(--sunao-pink);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0.5;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
}

#sunao-power-button.ready {
    opacity: 1;
    transform: scale(1);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- リザルト画面 --- */
#result-screen {
     background-color: rgba(255, 255, 255, 0.9);
}

#result-screen h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--sunao-blue);
}

#result-stats {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.8;
    background: rgba(255,255,255,0.7);
    padding: 20px;
    border-radius: 10px;
    width: 80%;
}

#result-stats strong {
    font-size: 1.5rem;
    color: var(--sunao-pink);
}

#result-buttons {
    display: flex;
    gap: 20px;
}