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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #4a4a4a 0%, #2c2c2c 50%, #1a1a1a 100%);
    height: 100%;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* タイトル画面 */
#title-screen h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
}

#title-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.instructions {
    background: rgba(74, 74, 74, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 140, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    max-width: 400px;
}

.instructions h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ff8c00;
}

.instructions ul {
    list-style: none;
    text-align: left;
}

.instructions li {
    padding: 5px 0;
    font-size: 1em;
}

.instructions li:before {
    content: "→ ";
    color: #ff8c00;
}

.high-scores {
    margin-top: 20px;
    background: rgba(74, 74, 74, 0.3);
    padding: 15px 30px;
    border-radius: 10px;
}

.high-scores h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #ff8c00;
}

.score-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 1.1em;
}

/* ボタン */
.btn-primary {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 100%);
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.7);
}

.btn-secondary {
    background: rgba(74, 74, 74, 0.8);
    color: white;
    font-size: 1em;
    font-weight: bold;
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(74, 74, 74, 1);
}

/* ゲーム画面 */
#game-screen {
    padding: 0;
    justify-content: flex-start;
}

#hud {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 1.1em;
    flex-wrap: wrap;
    gap: 15px;
}

.hud-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stamina-bar-container {
    position: relative;
    width: 200px;
    height: 25px;
    background: rgba(100, 100, 100, 0.5);
    border: 2px solid rgba(255, 140, 0, 0.5);
    border-radius: 15px;
    overflow: hidden;
}

.stamina-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 50%, #44ff44 100%);
    transition: width 0.3s;
    border-radius: 13px;
}

#stamina-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9em;
    text-shadow: 1px 1px 2px black;
}

#game-canvas {
    flex: 1;
    background: linear-gradient(180deg, #87ceeb 0%, #f0f0f0 100%);
    min-height: 0;
    cursor: pointer;
}

#controls {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 結果画面 */
#stage-clear-screen h2,
#game-clear-screen h2,
#gameover-screen h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
}

#stage-result,
#final-result,
#gameover-result {
    background: rgba(74, 74, 74, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 140, 0, 0.3);
    padding: 30px;
    border-radius: 15px;
    min-width: 300px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.result-item:last-child {
    border-bottom: none;
}

.score-large {
    font-size: 3.5em;
    font-weight: bold;
    color: #ff8c00;
    text-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
    margin-bottom: 20px;
}

.result-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    #title-screen h1 {
        font-size: 2em;
    }

    .btn-primary {
        font-size: 1.1em;
        padding: 12px 30px;
    }

    #hud {
        font-size: 0.9em;
    }

    .stamina-bar-container {
        width: 150px;
        height: 20px;
    }

    .score-large {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .stamina-bar-container {
        width: 120px;
    }

    #hud {
        font-size: 0.8em;
    }
}
