body {
            margin: 0;
            overflow: hidden;
            background-color: #222;
            font-family: 'Courier New', sans-serif;
            color: white;
            user-select: none;
            touch-action: none;
        }
        canvas {
            display: block;
        }
        #ui {
            position: absolute;
            top: 10px;
            left: 10px;
            pointer-events: none;
            z-index: 10;
            background: rgba(0, 0, 0, 0.4);
            padding: 8px;
            border-radius: 5px;
            backdrop-filter: blur(2px);
        }
        .stats-row {
            display: flex;
            gap: 12px;
            align-items: baseline;
            margin-bottom: 4px;
        }
        #score-display {
            font-size: 24px;
            font-weight: bold;
            color: #ff0055;
        }
        #level-display {
            font-size: 12px;
            color: #00ccff;
        }
        #round-display {
            font-size: 16px;
            color: #ffff00;
            text-shadow: 0 0 5px #ffff00;
        }
        /* HP表示の追加スタイル */
        #hp-container {
            width: 150px;
            max-width: 90vw;
            height: 16px;
            background-color: #444;
            border: 1px solid #fff;
            position: relative;
            margin: 4px 0;
        }
        #hp-bar {
            width: 100%;
            height: 100%;
            background-color: #00ff00;
            transition: width 0.2s, background-color 0.2s;
        }
        #hp-text {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 16px;
            font-size: 10px;
            font-weight: bold;
            color: white;
            text-shadow: 1px 1px 1px black;
        }

        /* レベルアップ選択画面 */
        #upgrade-menu {
            display: none;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.9);
            border: 2px solid #00ff88;
            padding: 20px;
            text-align: center;
            border-radius: 10px;
            z-index: 100;
            box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
        }
        #upgrade-menu h2 {
            margin-top: 0;
            color: #fff;
        }
        .btn {
            display: block;
            width: 220px;
            max-width: 90vw;
            margin: 10px auto;
            padding: 15px;
            background: #333;
            color: #00ff88;
            border: 1px solid #00ff88;
            cursor: pointer;
            font-family: inherit;
            font-size: 16px;
            transition: 0.2s;
        }
        .btn:hover {
            background: #00ff88;
            color: #000;
        }
        .btn-secondary {
            color: #00ccff;
            border-color: #00ccff;
        }
        .btn-secondary:hover {
            background: #00ccff;
            color: #000;
        }

        /* スタート画面 & ゲームオーバー画面 */
        .overlay-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 200;
            text-align: center;
            overflow-y: auto;
            padding: 20px 0;
            box-sizing: border-box;
        }
        .overlay-screen h1 {
            font-size: clamp(2rem, 10vw, 4rem);
            margin-bottom: 20px;
            letter-spacing: 10px;
        }
        .overlay-screen h2 {
            font-size: clamp(1.5rem, 6vw, 2.5rem);
            color: #ff0055;
            text-shadow: 0 0 10px #ff0055;
        }
        .instructions {
            background: rgba(255, 255, 255, 0.1);
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 30px;
            max-width: 80%;
        }
        .instructions p {
            margin: 10px 0;
            font-size: 16px;
        }

        @media (max-height: 500px) {
            .overlay-screen {
                justify-content: flex-start;
            }
            .overlay-screen h1 {
                font-size: clamp(1.2rem, 8vh, 2rem);
                margin-bottom: 5px;
                letter-spacing: 5px;
            }
            .overlay-screen h2 {
                font-size: 1.2rem;
            }
            .instructions {
                padding: 10px;
                margin-bottom: 10px;
                font-size: 13px;
            }
            .instructions p {
                margin: 3px 0;
            }
            .btn {
                padding: 10px;
                font-size: 14px;
            }
        }
        #final-score {
            font-size: 48px;
            color: #ff0055;
            margin: 20px 0;
        }
        #game-over-screen {
            display: none;
        }
        #graphics-toggle {
            position: fixed;
            top: 10px;
            right: 10px;
            padding: 8px 12px;
            background: rgba(0, 0, 0, 0.6);
            color: #00ff88;
            border: 1px solid #00ff88;
            cursor: pointer;
            font-family: inherit;
            font-size: 12px;
            z-index: 1000;
            transition: 0.2s;
        }
        #graphics-toggle:hover {
            background: #00ff88;
            color: #000;
        }

        /* スペシャルゲージUI */
        #special-container {
            width: 150px;
            max-width: 90vw;
            height: 12px;
            background-color: #333;
            border: 1px solid #aaa;
            position: relative;
            margin: 8px 0 4px 0;
            overflow: hidden;
            box-shadow: 0 0 5px rgba(0,0,0,0.5);
        }
        #special-bar {
            width: 0%;
            height: 100%;
            background-color: #ffff00;
            transition: width 0.3s;
        }
        #special-text {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 12px;
            font-size: 9px;
            font-weight: bold;
            color: white;
            text-shadow: 1px 1px 1px black;
        }
        .special-ready {
            border-color: #fff !important;
            box-shadow: 0 0 10px #ffff00 !important;
            animation: pulse-special 1s infinite;
        }
        @keyframes pulse-special {
            0% { opacity: 0.8; }
            50% { opacity: 1; }
            100% { opacity: 0.8; }
        }
