﻿        /* =========================================================
         * 全体レイアウト
         * ページ全体の固定表示と共通フォントを管理
         * ========================================================= */
        body {
            margin: 0;
            background: #000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100dvh;
            width: 100vw;
            touch-action: none; /* ゲーム操作エリアでのスクロール禁止 */
            user-select: none;
            -webkit-user-select: none;
            color: white;
            position: fixed;
            overflow: hidden;
            font-family: 'Orbitron', sans-serif;
            font-weight: 200 !important;
        }

        .btn {
            font-family: 'Orbitron', sans-serif;
        }

        canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            display: block;
            -webkit-touch-callout: none;
        }

        /* =========================================================
         * HUD上部表示
         * スコア、ハイスコア、NEXT表示を管理
         * ========================================================= */
        #ui-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            padding: 12px 5px;
            box-sizing: border-box;
            display: none;
            justify-content: space-between;
            align-items: flex-start;
            pointer-events: none;
            z-index: 10;
            background: none;
        }

        .hud-panel-left, .hud-panel-right {
            background: rgba(5, 15, 30, 0.3);
            border: none;
            box-shadow: none;
            background-image: linear-gradient(rgba(0, 247, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 247, 255, 0.1) 1px, transparent 1px);
            background-size: 15px 15px;
            -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 95%);
            mask-image: radial-gradient(ellipse at center, black 40%, transparent 95%);
            padding: 8px 12px;
            position: relative;
            overflow: hidden;
            height: 110px;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
        }

            .hud-panel-left > *, .hud-panel-right > * {
                position: relative;
                z-index: 1;
            }

        .hud-panel-left {
            border-left: 5px solid #00f7ff;
            align-items: flex-start;
            min-width: 200px;
        }

        .hud-panel-right {
            border-right: 5px solid #00f7ff;
            align-items: center;
            min-width: 100px;
        }

        .hud-item {
            width: 100%;
        }

        .hud-label, .next-label {
            font-size: 16px;
            color: #00f7ff;
            letter-spacing: 1px;
            font-weight: bold;
            display: block;
            margin-bottom: 0px;
            text-transform: uppercase;
            text-shadow: 0 0 8px rgba(0, 247, 255, 0.8);
        }

        .score-num {
            font-size: 32px;
            color: #fff;
            text-shadow: 0 0 10px #fff, 0 0 15px #00f7ff;
            font-weight: 400;
            line-height: 1;
            font-variant-numeric: tabular-nums;
            letter-spacing: 1px;
        }

        .hi-score-num {
            font-size: 24px;
            font-weight: 400;
            color: #ffd700;
            text-shadow: 0 0 10px #ffd700, 0 0 20px #ff6600;
            font-variant-numeric: tabular-nums;
        }

        .hi-stage-text {
            margin-left: 8px;
            font-size: 10px;
            letter-spacing: 1px;
            color: #aaa;
            text-shadow: 0 0 10px #fff;
        }

        #hi-stage-val {
            font-size: 20px;
            font-weight: 500;
            color: #fff;
            text-shadow: 0 0 10px #ffd700, 0 0 20px #ff6600;
        }

        /* 次の天体プレビュー */
        #next-ui {
            height: 46px;
            width: 46px;
            margin: 2px auto;
            position: relative;
            background: radial-gradient(circle, rgba(0,247,255,0.1) 0%, transparent 60%);
            border-radius: 50%;
            border: 1px dotted rgba(180, 180, 180, 0.6);
            box-shadow: inset 0 0 10px rgba(150, 150, 150, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
        }

            #next-ui canvas {
                position: static;
                width: 46px;
                height: 46px;
                display: block;
                filter: drop-shadow(0 0 6px rgba(255,255,255,0.7));
            }

        #next-name {
            margin-top: 2px;
            font-size: 11px;
            letter-spacing: 1px;
            font-weight: bold;
            line-height: 1.1;
            text-shadow: 0 0 8px currentColor;
            white-space: nowrap;
        }

        /* ショット制限時間ゲージ */
        #timer-bar-container {
            width: 100%;
            height: 4px;
            background: rgba(0, 20, 40, 0.8);
            border: 1px solid #00f7ff;
            border-radius: 0;
            margin-top: 4px;
            overflow: hidden;
            display: none;
            box-shadow: 0 0 5px #00f7ff;
        }

        #timer-bar-fill {
            height: 100%;
            background: #ff3c3c;
            box-shadow: 0 0 15px #ff0000, inset 0 0 5px #fff;
            transition: width 0.1s linear;
        }

        /* =========================================================
         * 操作ボタン共通
         * BOOST、PAUSE、BGMトグルの共通見た目
         * ========================================================= */
        #boost-left-btn, #boost-right-btn, #hud-pause-btn, #bgm-toggle {
            font-family: 'Orbitron', sans-serif;
            font-weight: 800;
            color: #00f7ff;
            background: linear-gradient( 180deg, rgba(0, 247, 255, 0.15) 0%, rgba(5, 15, 30, 0.9) 60%, rgba(0, 0, 0, 0.95) 100% );
            mask-image: linear-gradient( to bottom, transparent 0%, black 40%, black 70%, transparent 100% );
            -webkit-mask-image: linear-gradient( to bottom, transparent 0%, black 40%, black 70%, transparent 100% );
            border: 4px solid #00f7ff;
            border-radius: 0px;
            cursor: pointer;
            outline: none;
            text-shadow: 0 0 8px rgba(0, 247, 255, 0.8);
            box-shadow: 0 0 15px rgba(0, 247, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
            transition: all 0.15s;
            text-transform: uppercase;
            letter-spacing: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-image: linear-gradient(rgba(0, 247, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 247, 255, 0.1) 1px, transparent 1px);
            background-size: 15px 15px;
        }

            #boost-left-btn:hover, #boost-right-btn:hover, #hud-pause-btn:hover, #bgm-toggle:hover {
                background: linear-gradient( 180deg, rgba(0, 247, 255, 0.3) 0%, rgba(5, 25, 40, 0.9) 100% );
                box-shadow: 0 0 25px rgba(0, 247, 255, 0.6);
                color: #fff;
                text-shadow: 0 0 10px #fff, 0 0 20px #00f7ff;
            }

            #boost-left-btn:active, #boost-right-btn:active, #hud-pause-btn:active, #bgm-toggle:active {
                background: radial-gradient(circle, rgba(220, 255, 255, 0.5) 0%, rgba(0, 247, 255, 0.3) 90%);
                color: #fff;
                text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #00f7ff;
                border-color: rgba(255, 255, 255, 0.8);
                box-shadow: 0 0 40px rgba(0, 247, 255, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.4);
                transform: scale(0.97);
            }

        #boost-controls {
            position: fixed;
            bottom: 60px;
            left: calc(env(safe-area-inset-left, 0px) + 52px);
            z-index: 20;
            display: none;
            gap: 14px;
            pointer-events: none;
        }

        @media screen and (orientation: landscape) {
            #boost-controls {
                left: calc(env(safe-area-inset-left, 0px) + 40px);
            }
        }

        #boost-left-btn,
        #boost-right-btn {
            width: 82px;
            height: 70px;
            padding: 0;
            pointer-events: auto;
            position: relative;
            touch-action: none;
            -webkit-touch-callout: none;
        }

        .boost-arrow-svg {
            display: block;
            width: 40px;
            height: 40px;
            color: #00f7ff;
            filter: drop-shadow(0 0 8px rgba(0, 247, 255, 0.8));
        }

        .boost-text-label {
            display: none;
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 2px;
            color: #00f7ff;
            text-shadow: 0 0 10px rgba(0, 247, 255, 0.9), 0 0 20px rgba(0, 247, 255, 0.5);
            line-height: 1;
        }

        #boost-right-btn.right-only-mode {
            min-width: 110px;
            padding: 0 12px;
        }

        #boost-right-btn.right-only-mode .boost-arrow-svg {
            display: none;
        }

        #boost-right-btn.right-only-mode .boost-text-label {
            display: block;
        }

        .boost-arrow-svg path {
            fill: none;
            stroke: currentColor;
            stroke-width: 4;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

            #boost-left-btn::before,
            #boost-right-btn::before {
                content: "";
                position: absolute;
                inset: -6px;
                border: 1px solid rgba(0, 247, 255, 0.3);
                box-shadow: 0 0 10px rgba(0, 247, 255, 0.1);
                pointer-events: none;
                z-index: -1;
                transition: all 0.3s;
            }

            #boost-left-btn:hover::before,
            #boost-right-btn:hover::before {
                inset: -10px;
                border-color: rgba(0, 247, 255, 0.6);
                opacity: 0.5;
            }

        /* 右下の管理UI */
        #bottom-right-ui {
            position: fixed;
            right: 24px;
            bottom: 60px;
            display: none;
            align-items: flex-end;
            gap: 15px;
            pointer-events: none;
            z-index: 1000;
        }

        @media screen and (orientation: portrait) {
            #bottom-right-ui {
                flex-direction: column;
                align-items: flex-end;
                gap: 10px;
            }

            #management-btn-area {
                justify-content: flex-end;
            }
        }

        #management-btn-area {
            position: relative;
            pointer-events: auto;
            display: flex;
            align-items: center;
            height: 36px;
        }

        #hud-pause-btn {
            width: 70px;
            height: 32px;
            font-size: 10px;
            padding: 0;
            display: none;
        }

        #bgm-control-pos {
            display: block;
            width: 100px;
            height: 32px;
        }

        #bgm-toggle {
            width: 100%;
            height: 100%;
            font-size: 10px;
            padding: 0;
        }

        #stage-ui {
            text-align: right;
            pointer-events: none;
        }

        .stage-label {
            font-size: 12px;
            letter-spacing: 2px;
            color: #aaa;
            text-shadow: 0 0 10px #fff, 0 0 20px #00f7ff;
        }

        .stage-num {
            font-size: 36px;
            font-weight: bold;
            color: #fff;
            text-shadow: 0 0 15px #00f7ff, 0 0 30px #fff;
        }

        .ui-faded {
            opacity: 0.3;
            transition: opacity 0.5s;
        }

        .score-bounce {
            animation: score-bounce 0.5s ease-out;
        }

        @keyframes score-bounce {
            0% {
                transform: scale(1);
                opacity: 1;
            }

            30% {
                transform: scale(1.1);
                opacity: 0.8;
                text-shadow: 0 0 10px #fff;
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* =========================================================
         * タイトル・結果オーバーレイ
         * タイトル画面、ゲームオーバー、クリア表示を管理
         * ========================================================= */
        #overlay {
            position: fixed;
            inset: 0;
            background: transparent;
            display: flex;
            flex-direction: column;
            align-items: center;
            /* 中身が画面より大きくなった場合の対応 */
            justify-content: flex-start;
            overflow-y: auto;
            padding: 40px 0;
            z-index: 1000;
            text-align: center;
            transition: opacity 0.5s;
            touch-action: pan-y; /* スクロール許可 */
            -webkit-overflow-scrolling: touch;
        }

            /* 中身が少ない場合でも縦方向の中央寄せを維持する */
            #overlay::before, #overlay::after {
                content: "";
                margin: auto;
                flex-basis: 0;
            }

            #overlay.hide {
                opacity: 0;
                pointer-events: none;
            }

        /* タイトルロゴ */
        h1 {
            margin: 0;
            font-size: 42px;
            line-height: 1.1;
            letter-spacing: 6px;
            font-weight: 200;
            transition: transform 0.45s ease;
        }

            h1#title-text {
                text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 20px #00f7ff, 0 0 40px #00f7ff, 0 0 80px #fff;
            }

        #title-version {
            margin-top: 18px;
            margin-bottom: 6px;
            font-size: 11px;
            letter-spacing: 3px;
            color: rgba(255, 255, 255, 0.65);
            text-shadow: 0 0 8px rgba(0, 247, 255, 0.35);
            font-variant-numeric: tabular-nums;
        }

        /* タイトル画面の共通ボタン */
        .btn {
            font-family: 'Orbitron', sans-serif;
            background: transparent;
            border: 1px solid rgba(255,255,255,0.8);
            color: white;
            border-radius: 50px;
            cursor: pointer;
            letter-spacing: 4px;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.2), inset 0 0 5px rgba(0, 247, 255, 0.2);
            text-shadow: 0 0 8px rgba(0, 247, 255, 0.8);
            border-color: #00f7ff;
        }

            .btn:hover {
                background: #00f7ff;
                color: #000;
                box-shadow: 0 0 30px #00f7ff;
            }

        /* メイン開始ボタン */
        #start-btn {
            margin-top: 30px;
            padding: 15px 60px;
            font-size: 20px;
            min-width: 220px;
            transition: transform 0.45s ease;
        }

        #clear-message,
        #title-version,
        #clear-hi-btn,
        #name-input-area,
        #show-ranking-btn,
        #soundtrack-btn,
        #controls-hint,
        #control-mode-selector {
            transition: transform 0.45s ease;
        }

        #overlay.stage-clear-layout #title-text {
            transform: translateY(-60px);
        }

        #overlay.stage-clear-layout #start-btn,
        #overlay.stage-clear-layout #clear-message,
        #overlay.stage-clear-layout #title-version,
        #overlay.stage-clear-layout #clear-hi-btn,
        #overlay.stage-clear-layout #name-input-area,
        #overlay.stage-clear-layout #show-ranking-btn,
        #overlay.stage-clear-layout #soundtrack-btn,
        #overlay.stage-clear-layout #controls-hint,
        #overlay.stage-clear-layout #control-mode-selector {
            transform: translateY(56px);
        }

        #control-mode-selector {
            margin-top: 12px;
            display: flex;
            flex-direction: row;
            justify-content: center;
            flex-wrap: nowrap;
            gap: 3px;
            align-items: center;
            padding: 4px;
            border-radius: 999px;
            border: 1px solid rgba(0, 247, 255, 0.35);
            background: rgba(0, 15, 28, 0.7);
            box-shadow: inset 0 0 10px rgba(0, 247, 255, 0.18);
        }

        .mode-btn {
            width: 96px;
            min-height: 28px;
            padding: 0 7px;
            margin-top: 0;
            letter-spacing: 1px;
            font-size: 10px;
            border-radius: 999px;
            border: 1px solid transparent;
            background: transparent;
            box-shadow: none;
            text-shadow: none;
            opacity: 0.65;
        }

        .mode-btn.mode-active {
            opacity: 1;
            background: linear-gradient(180deg, rgba(88, 224, 255, 0.95), rgba(0, 184, 220, 0.95));
            border-color: #00f7ff;
            box-shadow: 0 0 16px rgba(0, 247, 255, 0.45), inset 0 0 10px rgba(255, 255, 255, 0.35);
            color: #ffffff;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 18px rgba(140, 240, 255, 0.75);
        }

        .mode-btn:hover {
            background: rgba(0, 247, 255, 0.14);
            color: #fff;
            box-shadow: 0 0 12px rgba(0, 247, 255, 0.25);
        }

        .mode-btn.mode-active:hover {
            color: #ffffff;
        }

        /* 補助ボタン群 */
        .sub-btn {
            margin-top: 12px;
            padding: 8px 0;
            width: 200px;
            font-size: 11px;
            letter-spacing: 1px;
            opacity: 0.7;
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 20px;
            transition: all 0.3s;
            text-align: center;
        }

            .sub-btn:hover {
                opacity: 1.0;
                background: rgba(0, 247, 255, 0.2);
                border-color: #00f7ff;
                box-shadow: 0 0 15px rgba(0, 247, 255, 0.4);
                color: #fff;
            }

        .btn.menu-selected,
        .pause-menu-btn.menu-selected {
            opacity: 1;
            background: rgba(0, 247, 255, 0.2);
            border-color: #00f7ff !important;
            box-shadow: 0 0 24px rgba(0, 247, 255, 0.55);
            color: #fff;
            transform: translateY(-1px) scale(1.02);
        }

        #pause-quit-btn.menu-selected {
            background: rgba(255, 96, 96, 0.18);
            border-color: rgba(255, 120, 120, 0.8) !important;
            box-shadow: 0 0 24px rgba(255, 96, 96, 0.35);
            color: #fff2f2;
        }

        #controls-hint {
            font-family: 'Orbitron', sans-serif;
            font-weight: 400;
            margin-top: 25px;
            font-size: 10px;
            letter-spacing: 2px;
            color: #888;
            line-height: 1.6;
        }

        /* 名前入力エリア */
        #name-input-area {
            margin-top: 15px;
            display: none;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            background: rgba(5, 15, 30, 0.9);
            padding: 30px 40px;
            border-radius: 10px;
            border: 2px solid #00f7ff;
            box-shadow: 0 0 20px rgba(0, 247, 255, 0.4), inset 0 0 20px rgba(0, 247, 255, 0.1);
        }

            #name-input-area > div:first-child {
                text-shadow: 0 0 10px currentColor;
                letter-spacing: 2px;
            }

        #player-name-input {
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid #00f7ff;
            color: #00f7ff;
            padding: 12px;
            font-family: 'Orbitron', sans-serif;
            font-size: 20px;
            text-align: center;
            width: 240px;
            border-radius: 5px;
            outline: none;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.2);
            transition: box-shadow 0.2s;
        }

            #player-name-input:focus {
                box-shadow: 0 0 20px rgba(0, 247, 255, 0.6);
            }

        #submit-score-btn {
            background: #4facfe;
            color: #000;
            border: none;
            padding: 10px 20px !important;
            font-family: 'Orbitron', sans-serif;
            font-weight: bold;
            cursor: pointer;
            border-radius: 30px;
            letter-spacing: 3px;
            font-size: 10px !important;
            width: 180px !important;
            margin-top: 10px !important;
            box-shadow: 0 0 15px #00f7ff;
            transition: all 0.2s;
        }

            #submit-score-btn:hover:not(:disabled) {
                background: #fff;
                color: #00f7ff;
                box-shadow: 0 0 25px #00f7ff;
            }

            #submit-score-btn:disabled {
                background: #555;
                color: #888;
                box-shadow: none;
                cursor: not-allowed;
            }

        #skip-score-btn {
            font-size: 10px !important;
            padding: 10px 20px !important;
            width: 180px !important;
            margin-top: 10px !important;
            border: none;
            opacity: 1;
        }

        /* =========================================================
         * レスポンシブ調整
         * タイトル改行と低い画面高さ向けの圧縮表示
         * ========================================================= */

        /* タイトルの改行制御 */
        .title-br {
            display: block;
        }

        .title-space {
            display: none;
        }

        @media screen and (orientation: landscape) {
            .title-br {
                display: none;
            }

            .title-space {
                display: inline;
            }

            #title-text {
                font-size: 36px;
                letter-spacing: 6px;
                white-space: nowrap;
            }
        }

        /* 画面高さが低い場合の全体圧縮 */
        @media screen and (max-height: 600px) {
            h1#title-text {
                font-size: 24px !important;
                letter-spacing: 3px !important;
                margin-bottom: 5px !important;
            }

            #title-version {
                margin-top: 8px !important;
                margin-bottom: 4px !important;
                font-size: 9px !important;
                letter-spacing: 2px !important;
            }

            #controls-hint {
                margin-top: 5px !important;
                font-size: 8px !important;
                margin-bottom: 10px !important;
            }

            #start-btn {
                margin-top: 10px !important;
                padding: 8px 30px !important;
                font-size: 14px !important;
            }

            .sub-btn {
                margin-top: 8px !important;
                padding: 6px 0 !important;
                width: 180px !important;
                font-size: 10px !important;
            }

            #name-input-area {
                padding: 15px 20px !important;
                margin-top: 5px !important;
            }

                #name-input-area > div:first-child {
                    font-size: 12px !important;
                }

            #player-name-input {
                padding: 6px !important;
                font-size: 14px !important;
                width: 180px !important;
            }
        }

        /* =========================================================
         * ランキング画面
         * 固定ヘッダー付きテーブルとスクロール領域を管理
         * ========================================================= */
        #ranking-overlay {
            position: fixed;
            inset: 0;
            background: rgba(5, 10, 20, 0.95);
            backdrop-filter: blur(15px);
            display: none;
            flex-direction: column;
            align-items: center;
            /* 内容量が少なくても中央に見せる */
            justify-content: center;
            z-index: 2500;
            font-family: 'Orbitron', sans-serif;
            border: 1px solid #00f7ff;
            box-shadow: inset 0 0 50px rgba(0, 247, 255, 0.2);
            /* 全体のはみ出し対策 */
            overflow-y: auto;
            padding: 20px;
            box-sizing: border-box;
        }

            #ranking-overlay h2 {
                font-size: 24px;
                letter-spacing: 4px;
                color: #fff;
                margin-bottom: 15px;
                text-shadow: 0 0 15px #00f7ff, 0 0 30px #00f7ff;
                border-bottom: 2px solid #00f7ff;
                padding-bottom: 10px;
                flex-shrink: 0;
                margin-top: 0; /* 中央寄せ時の余白ずれを防ぐ */
            }

        /* テーブル本体のスクロールラッパー */
        .ranking-scroll-wrapper {
            width: 100%;
            max-width: 500px;
            /* 高さ固定にせず、最大だけ制限する */
            flex: 0 1 auto;
            max-height: 60vh;
            overflow-y: auto;
            margin: 15px 0;
            -webkit-overflow-scrolling: touch;
            border: 1px solid rgba(0, 247, 255, 0.3);
        }

            .ranking-scroll-wrapper::-webkit-scrollbar {
                width: 6px;
            }

            .ranking-scroll-wrapper::-webkit-scrollbar-track {
                background: rgba(0, 0, 0, 0.3);
            }

            .ranking-scroll-wrapper::-webkit-scrollbar-thumb {
                background-color: rgba(0, 247, 255, 0.5);
                border-radius: 3px;
            }

        .ranking-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            color: #fff;
            margin: 0;
            font-size: 13px;
            letter-spacing: 1px;
            background: rgba(0, 247, 255, 0.05);
            border: 1px solid rgba(0, 247, 255, 0.3);
        }

            .ranking-table th, .ranking-table td {
                padding: 8px 4px;
                border-bottom: 1px solid rgba(0, 247, 255, 0.2);
                text-align: center;
                font-family: 'Orbitron', sans-serif;
            }

            .ranking-table th {
                color: #00f7ff;
                font-size: 12px;
                letter-spacing: 2px;
                text-shadow: 0 0 8px rgba(0, 247, 255, 0.6);
                padding-top: 12px;
                padding-bottom: 12px;
                position: sticky; /* テーブルヘッダーを固定表示 */
                top: 0;
                z-index: 2;
                background-color: #050a14;
                box-shadow: 0 2px 5px rgba(0,0,0,0.5);
            }

            .ranking-table td {
                font-variant-numeric: tabular-nums;
                line-height: 1.1;
                font-weight: 400;
            }

            .ranking-table td.ranking-score-cell {
                font-family: 'Orbitron', sans-serif !important;
                font-variant-numeric: tabular-nums;
                letter-spacing: 0.25px;
                white-space: nowrap;
            }

            .ranking-score-digit {
                display: inline-block;
                min-width: 0.85em;
                text-align: center;
            }

            .ranking-score-comma {
                min-width: 0.35em;
                text-align: center;
                margin-right: 0.08em;
            }

        .rank-1 {
            background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff);
            background-size: 200% auto;
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: rainbow-text 3s linear infinite;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
            font-size: 22px;
            font-weight: bold;
        }

        @keyframes rainbow-text {
            to {
                background-position: 200% center;
            }
        }

        .rank-2 {
            color: #00f7ff;
            text-shadow: 0 0 12px #00f7ff;
            font-size: 18px;
            font-weight: bold;
        }

        .rank-3 {
            color: #ff00ff;
            text-shadow: 0 0 12px #ff00ff;
            font-size: 18px;
            font-weight: bold;
        }
        #close-ranking-btn {
            flex-shrink: 0;
            margin-top: 10px;
        }

        /* =========================================================
         * サウンドトラック画面
         * 曲リストと再生状態表示を管理
         * ========================================================= */
        #soundtrack-overlay {
            position: fixed;
            inset: 0;
            background: rgba(10, 10, 20, 0.95);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1500;
            text-align: center;
            touch-action: pan-y;
            /* 背景を少しぼかして前面UIを見やすくする */
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid #00f7ff; /* 外枠もネオン表現に統一 */
            box-shadow: inset 0 0 50px rgba(0, 247, 255, 0.2);
        }

            /* 見出しはタイトル画面と同系統のネオン表現 */
            #soundtrack-overlay h2 {
                font-size: 24px;
                letter-spacing: 4px;
                color: #fff;
                margin-bottom: 20px;
                text-shadow: 0 0 15px #00f7ff, 0 0 30px #00f7ff;
                border-bottom: 2px solid #00f7ff;
                padding-bottom: 10px;
                flex-shrink: 0;
            }

        .track-list {
            list-style: none;
            padding: 0;
            margin: 15px 0;
            width: 80%;
            max-width: 400px;
            max-height: 60vh;
            overflow-y: auto;
            touch-action: pan-y;
            scrollbar-width: thin;
            scrollbar-color: #00f7ff transparent;
        }

            .track-list::-webkit-scrollbar {
                width: 6px;
            }

            .track-list::-webkit-scrollbar-thumb {
                background-color: rgba(0, 247, 255, 0.5);
                border-radius: 3px;
            }

        .track-item {
            padding: 10px 15px;
            margin-bottom: 6px;
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s;
            font-size: 12px;
            letter-spacing: 2px;
            color: #ccc;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

            .track-item:hover {
                background: rgba(255,255,255,0.1);
                color: white;
                box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); /* ホバー時は白寄りに発光 */
            }

            .track-item.active {
                border-color: #00f7ff; /* 再生中の曲をシアンで強調 */
                background: rgba(0, 247, 255, 0.2);
                color: #fff;
                text-shadow: 0 0 8px rgba(0, 247, 255, 0.8);
            }

            .track-item.menu-selected {
                border-color: rgba(255, 255, 255, 0.8);
                background: rgba(255, 255, 255, 0.12);
                color: #fff;
                box-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
            }

            .track-item.active.menu-selected {
                border-color: #00f7ff;
                background: rgba(0, 247, 255, 0.26);
                box-shadow: 0 0 18px rgba(0, 247, 255, 0.32);
            }

        .track-icon {
            font-size: 12px;
        }

        #soundtrack-progress-panel {
            width: 80%;
            max-width: 400px;
            margin: 8px 0 18px;
            padding: 12px 14px;
            border: 1px solid rgba(0, 247, 255, 0.25);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.04);
            box-shadow: inset 0 0 18px rgba(0, 247, 255, 0.08);
            box-sizing: border-box;
        }

        #soundtrack-progress-times {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            font-size: 11px;
            letter-spacing: 2px;
            color: rgba(255, 255, 255, 0.82);
            font-variant-numeric: tabular-nums;
        }

        #soundtrack-seek-bar {
            width: 100%;
            height: 6px;
            margin: 0;
            appearance: none;
            -webkit-appearance: none;
            background: linear-gradient(90deg, rgba(0, 247, 255, 0.9) 0%, rgba(0, 247, 255, 0.35) 0%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.12) 100%);
            border-radius: 999px;
            outline: none;
            cursor: pointer;
        }

            #soundtrack-seek-bar::-webkit-slider-thumb {
                -webkit-appearance: none;
                width: 16px;
                height: 16px;
                border-radius: 50%;
                border: 1px solid rgba(255, 255, 255, 0.9);
                background: #00f7ff;
                box-shadow: 0 0 12px rgba(0, 247, 255, 0.65);
            }

            #soundtrack-seek-bar::-moz-range-thumb {
                width: 16px;
                height: 16px;
                border-radius: 50%;
                border: 1px solid rgba(255, 255, 255, 0.9);
                background: #00f7ff;
                box-shadow: 0 0 12px rgba(0, 247, 255, 0.65);
            }

            #soundtrack-seek-bar::-moz-range-track {
                height: 6px;
                border-radius: 999px;
                background: transparent;
            }

            #soundtrack-seek-bar:disabled {
                opacity: 0.4;
                cursor: default;
            }

        /* =========================================================
         * ポーズ画面
         * 一時停止中の操作メニューを管理
         * ========================================================= */
        #pause-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }

        .pause-text {
            font-size: 42px;
            letter-spacing: 8px;
            color: white;
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
            margin-bottom: 40px;
        }

        .pause-menu-btn {
            font-family: 'Orbitron', sans-serif;
            font-size: 18px;
            letter-spacing: 4px;
            background: transparent;
            color: white;
            border: 1px solid rgba(255,255,255,0.8);
            padding: 15px 40px;
            border-radius: 50px;
            cursor: pointer;
            margin-bottom: 20px;
            min-width: 200px;
            transition: all 0.2s;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.2), inset 0 0 5px rgba(0, 247, 255, 0.2);
            text-shadow: 0 0 8px rgba(0, 247, 255, 0.8);
            border-color: #00f7ff !important;
        }

            .pause-menu-btn:hover {
                background: #00f7ff !important;
                color: #000 !important;
                box-shadow: 0 0 30px #00f7ff !important;
            }

        #pause-quit-btn {
            font-size: 14px;
            padding: 12px 30px;
            opacity: 0.8;
            border-color: rgba(255, 100, 100, 0.6) !important;
            color: #ffcccc;
            box-shadow: none;
            text-shadow: none;
        }

            #pause-quit-btn:hover {
                background: rgba(255, 50, 50, 0.8) !important;
                color: white !important;
                box-shadow: 0 0 20px rgba(255, 50, 50, 0.6) !important;
            }

        /* =========================================================
         * タッチ操作抑制
         * iOS長押しメニューや選択、ジェスチャーを防ぐ
         * ========================================================= */
        /* ボタン全般、特にBOOSTまわりの誤操作を防ぐ */
        #boost-btn, .btn {
            -webkit-touch-callout: none !important; /* 長押しメニュー禁止 */
            -webkit-user-select: none !important; /* テキスト選択禁止 */
            user-select: none !important;
            touch-action: none !important; /* ブラウザのジェスチャー（拡大等）禁止 */
            -webkit-tap-highlight-color: transparent; /* タップ時の青い枠線を消す */
        }
