/* --- 基本設定 --- */
        html, body {
            margin: 0;
            padding: 0;
            height: auto;
        }
        body {
            font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
            text-align: center;
            background-color: #330000;
            color: #FFDDDD;
            padding: 10px;
            box-sizing: border-box;
            min-height: 100vh;
            overflow-y: auto;
            touch-action: auto;
        }
        
        h1 {
            color: #FF5555;
            text-shadow: 2px 2px 4px #000;
            margin: 10px 0;
            font-size: 24px;
        }
        
        @media (min-width: 768px) {
            h1 {
                font-size: 32px;
            }
        }

        /* 操作説明 */
        .instructions {
            background-color: rgba(50, 0, 0, 0.8);
            padding: 15px;
            border-radius: 10px;
            margin: 10px auto;
            max-width: 600px;
            font-size: 14px;
            line-height: 1.5;
        }
        
        .instructions h2 {
            color: #FF5555;
            font-size: 18px;
            margin: 0 0 10px 0;
        }
        
        .instructions ul {
            text-align: left;
            margin: 0;
            padding-left: 20px;
        }
        
        .instructions li {
            margin-bottom: 5px;
        }

        /* --- ゲームコンテナとキャンバス --- */
        #game-container {
            position: relative;
            width: 100%;
            max-width: 800px;
            height: auto;
            aspect-ratio: 4/3;
            margin: 10px auto;
        }
        canvas {
            width: 100%;
            height: 100%;
            max-height: 80vh;
            object-fit: contain;
            background-color: #660000;
            border: 3px solid #FF5555;
            display: block;
            margin: 0 auto;
            max-width: 100%;
            box-sizing: border-box;
            touch-action: none;
        }

        /* --- UI要素 --- */
        #overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 36px;
            font-weight: bold;
            color: #FFDDDD;
            display: none;
            background-color: rgba(50, 0, 0, 0.8);
            padding: 20px;
            border-radius: 10px;
            width: 80%;
            box-sizing: border-box;
        }

        /* 難易度選択画面 */
        #difficulty-select {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: rgba(50, 0, 0, 0.95);
            padding: 30px;
            border-radius: 15px;
            width: 90%;
            max-width: 500px;
            box-sizing: border-box;
            display: none;
        }

        #difficulty-select h2 {
            color: #FF5555;
            font-size: 28px;
            margin: 0 0 20px 0;
        }

        .difficulty-button {
            font-size: 20px;
            padding: 15px 30px;
            cursor: pointer;
            color: white;
            border: none;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
            transition: all 0.3s;
            margin: 10px;
            display: block;
            width: 80%;
            margin-left: auto;
            margin-right: auto;
        }

        .difficulty-easy {
            background-color: #00AA00;
        }

        .difficulty-easy:hover {
            background-color: #008800;
        }

        .difficulty-normal {
            background-color: #FF8800;
        }

        .difficulty-normal:hover {
            background-color: #CC6600;
        }

        .difficulty-hard {
            background-color: #CC0000;
        }

        .difficulty-hard:hover {
            background-color: #AA0000;
        }

        .difficulty-extreme {
            background-color: #990066;
        }

        .difficulty-extreme:hover {
            background-color: #660044;
        }

        #start-button, #bgm-toggle, #back-button {
            font-size: 20px;
            padding: 10px 20px;
            cursor: pointer;
            background-color: #CC0000;
            color: white;
            border: none;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
            transition: background-color 0.3s;
            margin: 5px;
            display: inline-block;
        }
        #start-button:hover, #back-button:hover {
            background-color: #AA0000;
        }
        #score {
            font-size: 24px;
            margin-top: 5px;
            color: #FFDDDD;
        }
        #bgm-toggle {
            background-color: #007700;
        }
        #bgm-toggle:hover {
            background-color: #005500;
        }

        /* 発射ボタン */
        #shoot-button {
            display: none;
            width: 120px;
            height: 120px;
            border-radius: 60px;
            background-color: #FF3333;
            color: white;
            border: none;
            font-size: 20px;
            margin: 20px auto;
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
            -webkit-tap-highlight-color: transparent;
        }

        #shoot-button:active {
            background-color: #CC0000;
            transform: scale(0.95);
        }

        /* スマホ表示時のみ発射ボタンを表示 */
        @media (max-width: 768px) {
            #shoot-button {
                display: block;
            }
            
            .instructions {
                font-size: 12px;
                padding: 10px;
            }
            
            .instructions h2 {
                font-size: 16px;
            }

            .difficulty-button {
                font-size: 18px;
                padding: 12px 24px;
            }

            #difficulty-select h2 {
                font-size: 24px;
            }
        }
