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

body {
    font-family: 'Arial', 'メイリオ', sans-serif;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f3460 50%, #000 100%);
    height: 100%;
    overflow: hidden;
    color: white;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* スタート画面 */
.title-container {
    text-align: center;
    margin-bottom: 40px;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

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

.subtitle {
    font-size: 24px;
    color: #ffd93d;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.instructions h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #ffd93d;
}

.instructions h3 {
    font-size: 20px;
    margin: 20px 0 10px 0;
    color: #ffd93d;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    font-size: 18px;
    margin: 10px 0;
    line-height: 1.6;
}

.obstacles-info {
    margin-top: 20px;
}

.obstacle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.obstacle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.obstacle-item .emoji {
    font-size: 32px;
}

.start-btn {
    padding: 20px 60px;
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.start-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.7);
}

.start-btn:active {
    transform: translateY(-2px);
}

/* ゲーム画面 */
#gameScreen {
    padding: 0;
    position: relative;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 100%;
    padding: 15px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 10;
    border-radius: 10px 10px 0 0;
}

.ui-top {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat .label {
    font-size: 14px;
    color: #ffd93d;
    font-weight: bold;
}

.stat .value {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.fuel-bar-container {
    max-width: 400px;
    margin: 0 auto;
}

.fuel-label {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffd93d;
}

.fuel-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.fuel-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #51cf66 0%, #ffd93d 50%, #ff6b6b 100%);
    transition: width 0.2s;
}

#gameCanvas {
    display: block;
    max-width: 500px;
    max-height: 600px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    touch-action: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.game-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #ffd93d;
}

/* リザルト画面 */
.result-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.result-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.result-title.clear {
    color: #ffd93d;
}

.clear-message {
    font-size: 20px;
    margin-bottom: 30px;
    color: #51cf66;
}

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.result-stat {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.result-label {
    font-size: 20px;
    color: #ffd93d;
    font-weight: bold;
}

.result-value {
    font-size: 28px;
    font-weight: bold;
    color: white;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .game-title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 18px;
    }

    .instructions {
        padding: 20px;
        font-size: 14px;
    }

    .instructions li {
        font-size: 14px;
    }

    .obstacle-item {
        font-size: 14px;
    }

    .obstacle-item .emoji {
        font-size: 24px;
    }

    .start-btn {
        padding: 15px 40px;
        font-size: 20px;
    }

    .stat .value {
        font-size: 18px;
    }

    .result-title {
        font-size: 36px;
    }

    .result-label {
        font-size: 16px;
    }

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

@media (max-height: 700px) {
    .instructions {
        max-height: 400px;
        overflow-y: auto;
    }
}
