        /* 画面全体をゲーム領域にする */
        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background-color: #1a1a1a;
            font-family: 'Helvetica Neue', Arial, sans-serif;
        }

        /* ゲームコンテナを全画面に拡張 */
        #game-container {
            position: relative;
            width: 100vw;
            height: 100vh;
            background-color: #2c3e50;
        }

        /* キャンバスを画面サイズにフィットさせる */
        canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* UIレイヤー */
        #ui-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            pointer-events: none;
            box-sizing: border-box;
            padding: 20px;
        }

        /* 経験値バー（横長画面に合わせて少し太く、見やすく変更） */
        .xp-bar-container {
            width: 100%;
            height: 16px;
            background-color: rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 8px;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
        }

        #xp-bar {
            width: 0%;
            height: 100%;
            background-color: #00ffcc;
            transition: width 0.1s ease;
            box-shadow: 0 0 10px #00ffcc;
        }

        .stats-text {
            display: flex;
            justify-content: space-between;
            font-size: 20px;
            font-weight: bold;
            color: #ffffff;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
        }

        /* ゲームオーバー画面 */
        #game-over-screen {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 10;
        }

        #game-over-screen h1 {
            color: #ff3333;
            font-size: 60px;
            margin-bottom: 10px;
            text-shadow: 0 0 20px rgba(255,0,0,0.6);
        }

        #game-over-screen p {
            font-size: 24px;
            margin-bottom: 30px;
            color: #eee;
        }

        #restart-btn {
            padding: 15px 40px;
            font-size: 22px;
            font-weight: bold;
            background-color: #00ffcc;
            color: #000;
            border: none;
            border-radius: 30px;
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(0,255,204,0.4);
            transition: transform 0.1s, background-color 0.2s;
            pointer-events: auto;
        }

        #restart-btn:hover {
            background-color: #00ccaa;
            transform: scale(1.05);
        }

        /* レベルアップ選択画面のオーバーレイ */
#levelup-screen {
    display: none; /* 通常は非表示 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

#levelup-screen h2 {
    color: #00ffcc;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0,255,204,0.5);
}

/* 3つのカードを並べるコンテナ */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 80%;
    max-width: 350px;
}

/* 選択肢カードのスタイル */
.choice-card {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border: 2px solid #7f8c8d;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    pointer-events: auto; /* クリック可能にする */
}

.choice-card:hover {
    transform: scale(1.05);
    border-color: #00ffcc;
    background: linear-gradient(135deg, #3d566e, #2c3e50);
}

.choice-title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.choice-desc {
    font-size: 14px;
    color: #bdc3c7;
}

/* ============================================================================
   🕹️ バーチャルパッド（スマホ・PC共通：JSで表示/非表示を切り替えるため共通でOK）
   ============================================================================ */
#joystick-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 110px;
    height: 110px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: none; /* JSでタッチした時だけ表示 */
    justify-content: center;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

#joystick-knob {
    width: 46px;
    height: 46px;
    background: radial-gradient(circle, rgba(0, 255, 204, 0.9) 0%, rgba(0, 204, 170, 0.7) 100%);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.6);
    will-change: transform;
}

/* ============================================================================
   🃏 レベルアップ画面＆カード（PC・スマホハイブリッド仕様）
   ============================================================================ */
#levelup-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    padding: 20px;
    box-sizing: border-box;
}

#levelup-screen h2 {
    color: #00ffcc;
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0,255,204,0.5);
    text-align: center;
}

/* 横幅を 90% にしつつ、最大でも 360px に制限することでPCでもスマホでも黄金比になる */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 360px; 
}

/* タップ・クリック両対応のカード設定 */
.choice-card {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border: 2px solid #7f8c8d;
    border-radius: 12px;
    padding: 16px;
    text-align: left; /* 左寄せが一番文字を読みやすい */
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.1s, border-color 0.2s;
    -webkit-user-select: none;
}

/* マウスホバー（PC）と、指で押した瞬間（スマホ：active）を同時に適用 */
.choice-card:hover, .choice-card:active {
    border-color: #00ffcc;
    background: linear-gradient(135deg, #3d566e, #2c3e50);
    transform: scale(1.02);
}

.choice-title {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.choice-desc {
    font-size: 13px;
    color: #bdc3c7;
    line-height: 1.4;
}