        /* --- 共通設定 --- */
        body, html {
            margin: 0; padding: 0; width: 100%; height: 100%;
            overflow: hidden;
            font-family: 'Zen Maru Gothic', sans-serif;
            background-color: #f9f9f9; color: #444;
            cursor: none;
            touch-action: none;
        }
        #container { position: relative; width: 100%; height: 100%; }
        #main-canvas { display: block; position: absolute; top: 0; left: 0; z-index: 1; touch-action: none; }

        /* --- UIレイヤー（全シーン共通コンテナ） --- */
        #ui-layer {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            pointer-events: none;
        }

        /* --- Scene 1: Title --- */
        #title-group {
            display: flex; flex-direction: column; align-items: center; gap: 42px;
            transition: opacity 1s;
        }
        #title-logo-wrap {
            position: relative; pointer-events: auto;
            min-width: min(720px, 88vw);
            padding: 30px 42px 34px;
            border-radius: 24px;
            background:
                radial-gradient(circle at 16% 18%, rgba(255, 236, 210, 0.85), rgba(255, 236, 210, 0)),
                radial-gradient(circle at 84% 82%, rgba(255, 244, 220, 0.7), rgba(255, 244, 220, 0)),
                linear-gradient(145deg, rgba(255,255,255,0.88), rgba(255,255,255,0.5));
            box-shadow: 0 18px 44px rgba(98, 82, 68, 0.18);
            backdrop-filter: blur(3px);
            overflow: hidden;
        }
        .logo-kicker {
            margin: 0 0 8px;
            font-size: 0.82rem; font-weight: 700; letter-spacing: 0.28em;
            color: rgba(108, 90, 72, 0.66);
        }
        #logo-title {
            margin: 0;
            font-size: clamp(2.8rem, 9vw, 6rem);
            line-height: 0.95;
            letter-spacing: 0.02em;
            font-weight: 700;
            color: #5a4a3e;
            text-shadow: 0 3px 0 rgba(255,255,255,0.75), 0 12px 24px rgba(110, 88, 62, 0.18);
        }
        #logo-subtitle {
            margin: 14px 0 0;
            font-size: clamp(0.85rem, 2.5vw, 1.05rem);
            letter-spacing: 0.12em;
            color: rgba(100, 86, 72, 0.72);
            text-transform: uppercase;
        }
        #logo-ornaments {
            position: absolute; inset: 0; pointer-events: none;
        }
        .ornament {
            position: absolute; display: block;
        }
        .orb-a {
            width: 118px; height: 118px; border-radius: 50%;
            right: -26px; top: -26px;
            background: radial-gradient(circle at 40% 40%, rgba(255, 224, 195, 0.92), rgba(255,255,255,0));
            animation: logoFloatA 5s ease-in-out infinite;
        }
        .orb-b {
            width: 146px; height: 146px; border-radius: 50%;
            left: -36px; bottom: -50px;
            background: radial-gradient(circle at 55% 45%, rgba(255, 240, 210, 0.65), rgba(242,255,255,0));
            animation: logoFloatB 7s ease-in-out infinite;
        }
        .line-a, .line-b { display: none; }
        @keyframes logoFloatA {
            0% { transform: translate(0, 0); opacity: 0.7; }
            50% { transform: translate(-10px, 7px); opacity: 1; }
            100% { transform: translate(0, 0); opacity: 0.7; }
        }
        @keyframes logoFloatB {
            0% { transform: translate(0, 0); opacity: 0.5; }
            50% { transform: translate(10px, -7px); opacity: 0.85; }
            100% { transform: translate(0, 0); opacity: 0.5; }
        }
        #start-btn-container {
            margin-top: 0; position: relative; width: 100px; height: 100px;
            display: flex; justify-content: center; align-items: center; pointer-events: auto;
        }
        #start-btn {
            width: 80px; height: 80px; border-radius: 50%; border: none;
            background: linear-gradient(160deg, #e58eaa, #c680db);
            color: #fff; font-size: 1.2rem; font-weight: 700;
            cursor: none; pointer-events: auto;
            transition: transform 0.2s, box-shadow 0.2s;
            z-index: 20;
            box-shadow: 0 0 0 12px rgba(255,255,255,0.45), 0 14px 24px rgba(152, 109, 146, 0.28);
        }
        #start-btn.orb-hover { transform: scale(1.1); box-shadow: 0 0 0 16px rgba(255,255,255,0.55), 0 18px 30px rgba(152, 109, 146, 0.36); }

        /* 波紋エフェクト */
        .ripple {
            position: absolute; width: 80px; height: 80px; border-radius: 50%;
            background: rgba(255,255,255,0.8); z-index: 15; transform: scale(0); pointer-events: none;
        }
        .ripple-anim { animation: expandRipple 2s ease-out forwards; }
        @keyframes expandRipple {
            0% { transform: scale(0); opacity: 0.6; }
            100% { transform: scale(25); opacity: 0; }
        }
        @media (max-width: 700px) {
            #title-group { gap: 28px; }
            #title-logo-wrap {
                min-width: 86vw;
                padding: 20px 22px 24px;
                border-radius: 18px;
            }
            .logo-kicker { letter-spacing: 0.18em; }
            #logo-subtitle { letter-spacing: 0.08em; }
        }

        /* --- Scene 2: Choice (Awakening) --- */
        #choice-group {
            display: none; /* 最初は非表示 */
            flex-direction: column; align-items: center; width: 100%; height: 100%;
            justify-content: center; opacity: 0; transition: opacity 2s;
        }
        #message-container { text-align: center; margin-bottom: 100px; color: #555; opacity: 0.9; }
        .msg-en { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: 0.05em; }
        .msg-jp { font-size: 1rem; font-weight: 400; opacity: 0.8; }

        #choices-btn-container {
            display: flex; gap: 84px; pointer-events: auto;
        }
        .choice-btn {
            width: 100px; height: 100px; border-radius: 50%; border: 4px solid #fff;
            color: #fff; font-size: 1.2rem; font-weight: 700;
            display: flex; justify-content: center; align-items: center;
            cursor: none; pointer-events: auto; transition: all 0.3s ease;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .choice-btn.hovered, .choice-btn.orb-hover { transform: scale(1.15); box-shadow: 0 15px 35px rgba(0,0,0,0.15); }
        .choice-col {
            display: flex; flex-direction: column; align-items: center; gap: 14px;
        }
        .choice-hint {
            font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em;
            color: rgba(80, 72, 62, 0.82); text-transform: uppercase;
            text-shadow: 0 0 6px rgba(255,255,255,0.9), 0 1px 2px rgba(255,255,255,0.7);
            pointer-events: none;
        }
        #btn-left   { animation: breathe 4.2s ease-in-out infinite; }
        #btn-middle  { animation: breathe 3.0s ease-in-out infinite; }
        #btn-right   { animation: breathe 2.0s ease-in-out infinite; }
        #btn-fast    { animation: breathe 1.6s ease-in-out infinite; }
        @media (max-width: 980px) {
            #choices-btn-container { gap: 44px; }
        }
        @media (max-width: 700px) {
            #choices-btn-container {
                gap: 18px;
                flex-wrap: wrap;
                justify-content: center;
                max-width: 340px;
            }
            .choice-btn {
                width: 86px; height: 86px;
                border-width: 3px;
            }
            #message-container { margin-bottom: 64px; }
        }
        @keyframes breathe {
            0%, 100% { transform: scale(1); }
            50%      { transform: scale(1.08); }
        }
        .beat-ripple {
            position: fixed;
            width: 96px; height: 96px;
            border-radius: 50%;
            transform: translate(-50%, -50%) scale(0.2);
            pointer-events: none;
            z-index: 26;
            backdrop-filter: blur(1px);
            animation: beatRipple 900ms ease-out forwards;
        }
        @keyframes beatRipple {
            0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.55; }
            100% { transform: translate(-50%, -50%) scale(4.2); opacity: 0; }
        }

        /* --- Scene Fade --- */
        #scene-fade {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: #fff; opacity: 0; pointer-events: none; z-index: 40;
            transition: opacity 1200ms ease;
        }

        /* --- Draggable Tone Orb --- */
        #custom-cursor {
            position: fixed; top: 0; left: 0; width: 36px; height: 36px;
            border-radius: 50%;
            background: rgba(255,255,255,0.12);
            border: 1.8px solid rgba(255,255,255,0.96);
            box-shadow:
                0 0 0 1.4px rgba(34, 42, 58, 0.34),
                0 0 0 1px rgba(255,255,255,0.34),
                0 0 18px rgba(255,255,255,0.58);
            pointer-events: none; z-index: 1000;
            transform: translate(-50%, -50%);
            transition: width 0.2s, height 0.2s, box-shadow 0.2s, border-color 0.2s;
            cursor: grab;
        }
        #custom-cursor::after {
            content: '';
            position: absolute;
            top: 50%; left: 50%;
            width: 46%; height: 46%;
            transform: translate(-50%, -50%);
            border-radius: 50%;
            background: rgba(255,255,255,0.78);
            box-shadow: 0 0 0 0.8px rgba(34, 42, 58, 0.25);
        }
        #custom-cursor.dragging {
            cursor: grabbing;
            width: 40px; height: 40px;
            border-color: rgba(255,255,255,0.95);
            box-shadow:
                0 0 0 1.6px rgba(34, 42, 58, 0.38),
                0 0 0 1px rgba(255,255,255,0.4),
                0 0 22px rgba(255,255,255,0.68);
        }
        #tone-hover-info {
            position: fixed;
            z-index: 999;
            pointer-events: none;
            min-width: 180px;
            max-width: min(300px, 70vw);
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.5);
            background: rgba(36, 42, 58, 0.72);
            color: rgba(255,255,255,0.94);
            backdrop-filter: blur(4px);
            opacity: 0;
            transform: translateY(4px) scale(0.98);
            transition: opacity 120ms ease, transform 120ms ease;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }
        #tone-hover-info.visible {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        #tone-hover-info strong {
            font-size: 0.78rem;
            letter-spacing: 0.06em;
            font-weight: 700;
        }
        #tone-hover-info span {
            font-size: 0.7rem;
            line-height: 1.35;
            color: rgba(240,245,255,0.9);
        }

        /* --- Rhythm Score HUD --- */
        #score-hud {
            --score-bg-a: rgba(255,255,255,0.24);
            --score-bg-b: rgba(235,240,255,0.22);
            --score-step-off: rgba(120, 132, 162, 0.22);
            --score-step-kick: rgba(36, 48, 82, 0.98);
            --score-step-hat: rgba(36, 120, 212, 0.92);
            --score-step-hat-dense: rgba(233, 92, 62, 0.94);
            --score-playhead: rgba(255,255,255,0.98);
            position: fixed;
            left: 20px;
            right: 20px;
            bottom: 14px;
            z-index: 30;
            padding: 10px 12px 6px;
            border-radius: 14px;
            background:
                radial-gradient(circle at 18% 20%, var(--score-bg-a), transparent 58%),
                radial-gradient(circle at 84% 82%, var(--score-bg-b), transparent 62%),
                linear-gradient(180deg, rgba(255,255,255,0.82), rgba(245,246,252,0.74));
            backdrop-filter: blur(4px);
            box-shadow: 0 10px 24px rgba(34, 45, 73, 0.18);
            opacity: 0;
            transform: translateY(12px);
            transition: opacity 420ms ease, transform 420ms ease;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            max-height: calc(100vh - 30px);
            min-height: 80px;
            overflow: hidden;
        }
        #score-hud.visible {
            opacity: 1;
            transform: translateY(0);
        }
        #score-head {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            margin-bottom: 8px;
            color: rgba(55, 64, 90, 0.88);
            flex-shrink: 0;
        }
        #score-title {
            font-size: 0.84rem;
            letter-spacing: 0.12em;
            font-weight: 700;
            text-transform: uppercase;
        }
        #score-meta {
            font-size: 0.76rem;
            letter-spacing: 0.08em;
            opacity: 0.84;
        }
        #score-tracks {
            --steps: 64;
            --beat-span: 6.25%;
            --bar-span: 25%;
            display: flex;
            flex-direction: column;
            gap: var(--track-gap, 8px);
            padding: 2px 0;
            overflow-x: hidden;
            min-height: 0;
        }
        .score-row {
            display: grid;
            grid-template-columns: 62px 1fr;
            align-items: center;
            gap: 8px;
        }
        .score-row.preview .score-label {
            color: rgba(67, 83, 118, 0.96);
        }
        .score-label {
            font-size: var(--label-fs, 0.74rem);
            font-weight: 700;
            color: rgba(66, 72, 93, 0.92);
            letter-spacing: 0.05em;
            line-height: 1;
        }
        .score-grid {
            --steps: 64;
            position: relative;
            display: grid;
            grid-template-columns: repeat(var(--steps), minmax(0, 1fr));
            gap: 0;
        }
        .score-grid::before {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            background:
                repeating-linear-gradient(
                    to right,
                    transparent 0,
                    transparent calc(var(--beat-span) - 1px),
                    rgba(88, 98, 125, 0.2) calc(var(--beat-span) - 1px),
                    rgba(88, 98, 125, 0.2) var(--beat-span)
                ),
                repeating-linear-gradient(
                    to right,
                    transparent 0,
                    transparent calc(var(--bar-span) - 1px),
                    rgba(58, 66, 92, 0.4) calc(var(--bar-span) - 1px),
                    rgba(58, 66, 92, 0.4) var(--bar-span)
                );
        }
        .score-step {
            position: relative;
            z-index: 1;
            height: var(--step-h, 10px);
            border-radius: 2px;
            background: var(--score-step-off);
        }
        .score-step.on.kick {
            background: var(--score-step-kick);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32), 0 0 6px rgba(33, 56, 98, 0.55);
        }
        .score-step.on.hat {
            background: var(--score-step-hat);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 0 6px rgba(26, 94, 186, 0.5);
        }
        .score-step.on.hat-dense {
            background: var(--score-step-hat-dense);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 0 6px rgba(201, 74, 49, 0.45);
        }
        .score-step.on.snare {
            background: rgba(242, 129, 56, 0.98);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32), 0 0 7px rgba(216, 107, 39, 0.55);
        }
        .score-step.on.snare-alt {
            background: rgba(255, 168, 64, 0.98);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32), 0 0 7px rgba(229, 144, 50, 0.55);
        }
        .score-step.on.cymbal {
            background: rgba(120, 160, 210, 0.96);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), 0 0 7px rgba(100, 140, 195, 0.55);
        }
        .score-step.on.cymbal-alt {
            background: rgba(160, 190, 220, 0.96);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), 0 0 7px rgba(140, 170, 205, 0.55);
        }
        .score-step.on.bass {
            background: rgba(82, 65, 148, 0.96);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 0 7px rgba(72, 55, 130, 0.55);
        }
        .score-step.on.lead {
            background: rgba(200, 140, 60, 0.96);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 0 7px rgba(180, 120, 40, 0.55);
        }
        .score-step.on.texture {
            background: rgba(80, 185, 110, 0.96);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 0 7px rgba(60, 165, 90, 0.55);
        }
        /* Sustained note visual connections */
        .score-step.on.sus-start {
            border-radius: 2px 0 0 2px;
            margin-right: -1px;
            z-index: 2;
        }
        .score-step.on.sus-mid {
            border-radius: 0;
            margin-left: -1px;
            margin-right: -1px;
            z-index: 2;
            opacity: 0.82;
        }
        .score-step.on.sus-end {
            border-radius: 0 2px 2px 0;
            margin-left: -1px;
            z-index: 2;
            opacity: 0.82;
        }
        .score-step.on.sus-start,
        .score-step.on.sus-mid,
        .score-step.on.sus-end {
            box-shadow: none;
        }
        .score-step.on.sus-start {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(255,255,255,0.3), inset 1px 0 0 rgba(255,255,255,0.3), 0 0 7px rgba(72, 55, 130, 0.45);
        }
        .score-step.on.sus-end {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(255,255,255,0.3), inset -1px 0 0 rgba(255,255,255,0.3);
        }
        .score-step.on.sus-mid {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(255,255,255,0.3);
        }
        .score-step.finale-inactive {
            opacity: 0.18;
        }
        .score-step.finale-inactive.on {
            opacity: 0.22;
        }
        .score-step.playhead {
            outline: 2px solid var(--score-playhead);
            box-shadow: 0 0 0 1px rgba(24, 29, 45, 0.42), 0 0 14px var(--score-playhead);
            transform: scaleY(1.18);
        }
        /* Chord Score Row (CHILD1) */
        .score-grid-chord {
            display: grid;
            gap: 2px;
        }
        .score-chord-cell {
            height: 18px;
            border-radius: 3px;
            text-align: center;
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 18px;
            color: rgba(255,255,255,0.92);
            transition: background 150ms ease;
        }
        .score-chord-cell.chord-kg {
            background: rgba(80, 140, 210, 0.55);
        }
        .score-chord-cell.chord-kg.active {
            background: rgba(80, 140, 210, 0.88);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 0 8px rgba(80, 140, 210, 0.5);
        }
        .score-chord-cell.chord-home {
            background: rgba(210, 130, 70, 0.55);
        }
        .score-chord-cell.chord-home.active {
            background: rgba(210, 130, 70, 0.88);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 0 8px rgba(210, 130, 70, 0.5);
        }
        /* Chord bar labels (CHILD2+) */
        .score-bar-labels {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 0 6px;
        }
        .score-bar-label-grid {
            display: grid;
            gap: 2px;
            flex: 1;
        }
        .score-bar-label {
            height: var(--bar-label-h, 16px);
            border-radius: 3px;
            text-align: center;
            font-size: var(--label-fs, 0.68rem);
            font-weight: 700;
            line-height: var(--bar-label-h, 16px);
            color: rgba(140, 130, 160, 0.85);
            background: rgba(255,255,255,0.04);
            transition: color 150ms ease, background 150ms ease;
        }
        .score-bar-label.active {
            color: rgba(200, 190, 230, 1);
            background: rgba(255,255,255,0.10);
        }
        /* Compressed drum block (CHILD1) */
        .drum-block {
            display: flex;
            flex-direction: column;
            gap: 0;
        }
        #score-toggle-btn {
            display: none !important;
        }
        #score-toggle-btn.visible {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        /* --- Minigame Wrapper (Modal) --- */
        #minigame-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: rgba(0, 0, 0, 0.45); /* Overlay for main canvas */
            backdrop-filter: blur(5px); /* Blur for elements behind this wrapper */
            z-index: 100; /* Ensure it's on top of everything except custom-cursor */
            opacity: 0;
            pointer-events: none; /* Invisible initially, no interaction */
            transition: opacity 0.3s ease;
        }

        #minigame-wrapper.visible {
            opacity: 1;
            pointer-events: auto; /* Enable interaction when visible */
        }

        #minigame-canvas {
            width: 700px; /* Match SoccerMinigame.width */
            height: 440px; /* Match SoccerMinigame.height */
            background-color: #68b848; /* Same as the field color for continuity */
            border-radius: 16px;
            box-shadow: 0 0 0 4px rgba(255,255,255,0.9), /* White border */
                        0 0 24px rgba(255,255,255,0.7), /* Glow */
                        0 12px 30px rgba(0,0,0,0.4); /* Shadow */
        }
        
        /* --- Minigame Active State --- */
        body.minigame-active #main-canvas,
        body.minigame-active #ui-layer,
        body.minigame-active #score-hud {
            filter: blur(4px);
            transition: filter 0.5s ease;
        }
        body.minigame-active #custom-cursor {
            transform: translate(-50%, -50%) scale(0.6);
            transition: width 0.2s, height 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.3s ease;
        }

        /* Quit Button */
        #minigame-quit-btn {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 101;
            padding: 10px 20px;
            background: rgba(255, 255, 255, 0.9);
            border: none;
            border-radius: 20px;
            font-family: 'Zen Maru Gothic', sans-serif;
            font-weight: 800;
            color: #d45b5b;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
            transition: all 0.2s;
        }
        #minigame-quit-btn:hover {
            transform: scale(1.05);
            background: #fff;
        }

        /* Confirmation Modal */
        #minigame-modal {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(8px);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 200;
        }
        #minigame-modal .modal-content {
            background: #fff;
            padding: 30px;
            border-radius: 24px;
            text-align: center;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            max-width: 400px;
        }
        #minigame-modal .en { font-weight: 800; font-size: 20px; color: #333; margin-bottom: 5px; }
        #minigame-modal .jp { font-weight: 600; font-size: 16px; color: #666; margin-bottom: 25px; }
        #minigame-modal .modal-buttons { display: flex; gap: 15px; justify-content: center; }
        #minigame-modal button {
            padding: 12px 30px;
            border: none;
            border-radius: 12px;
            font-family: 'Zen Maru Gothic', sans-serif;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.2s;
        }
        #modal-yes { background: #e85050; color: #fff; }
        #modal-no { background: #f0f0f0; color: #333; }
        #modal-yes:hover { transform: scale(1.05); background: #f06060; }
        #modal-no:hover { transform: scale(1.05); background: #e0e0e0; }

        /* --- Score Pagination Indicator --- */
        .score-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            padding: 10px 0 6px;
            pointer-events: none;
        }
        .score-pagination::before {
            content: '';
            position: absolute;
            left: 0; right: 0;
            height: 1px;
            background: rgba(255,255,255,0.08);
        }
        .score-dot {
            width: 40px;
            height: 7px;
            border-radius: 4px;
            background: rgba(120,120,140,0.3);
            transition: background 0.4s, box-shadow 0.4s, transform 0.4s;
        }
        .score-dot.active {
            background: hsl(30, 8%, 48%);
            box-shadow: 0 0 12px hsla(30, 8%, 48%, 0.5), 0 0 4px hsla(30, 8%, 48%, 0.7);
            transform: scaleY(1.5);
        }

        /* --- Sound consent modal --- */
        #sound-modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: 9999;
            display: flex; align-items: center; justify-content: center;
            background: rgba(20, 18, 15, 0.7);
            backdrop-filter: blur(6px);
            transition: opacity 0.6s;
            cursor: default;
        }
        #sound-modal-overlay.hidden {
            opacity: 0; pointer-events: none;
        }
        #sound-modal {
            background:
                radial-gradient(circle at 20% 20%, rgba(255,236,210,0.9), rgba(255,236,210,0)),
                radial-gradient(circle at 80% 80%, rgba(255,244,220,0.7), rgba(255,244,220,0)),
                linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6));
            border-radius: 20px;
            padding: 36px 48px 32px;
            text-align: center;
            box-shadow: 0 16px 48px rgba(80,60,40,0.25);
            max-width: min(420px, 85vw);
            animation: modalIn 0.5s ease-out;
        }
        @keyframes modalIn {
            from { opacity: 0; transform: scale(0.92) translateY(16px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }
        .sound-modal-icon {
            font-size: 2.4rem;
            margin-bottom: 8px;
            opacity: 0.6;
        }
        .sound-modal-title {
            font-size: 1.3rem; font-weight: 700;
            color: #4a3c30;
            margin: 0 0 12px;
            letter-spacing: 0.06em;
        }
        .sound-modal-body {
            font-size: 0.92rem; line-height: 1.7;
            color: #5a4a3a;
            margin: 0 0 8px;
        }
        .sound-modal-hint {
            font-size: 0.78rem;
            color: #8a7a6a;
            margin: 0 0 20px;
        }
        #sound-modal-btn {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 1rem; font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #c89060, #a06830);
            border: none; border-radius: 28px;
            padding: 10px 36px;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(160,100,40,0.3);
            transition: transform 0.15s, box-shadow 0.15s;
        }
        #sound-modal-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 6px 20px rgba(160,100,40,0.4);
        }
        #sound-modal-btn:active {
            transform: scale(0.97);
        }

        /* --- OtoLogic Credit --- */
        #logo-credit {
            margin: 10px 0 0;
            font-size: 0.72rem;
            color: #5a4a3a;
            letter-spacing: 0.06em;
        }
        #logo-credit a {
            color: #5a4a3a;
            text-decoration: underline;
            cursor: pointer;
        }
        #logo-credit a:hover {
            color: #7a6a5a;
        }

        /* --- Settings Button --- */
        #settings-btn {
            position: fixed;
            top: 14px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 40;
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.82rem;
            font-weight: 700;
            color: #5a4a3e;
            background:
                radial-gradient(circle at 20% 20%, rgba(255,236,210,0.9), rgba(255,236,210,0)),
                linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6));
            border: 1px solid rgba(180,160,130,0.3);
            border-radius: 16px;
            padding: 7px 16px;
            cursor: pointer !important;
            box-shadow: 0 4px 14px rgba(80,60,40,0.15);
            backdrop-filter: blur(3px);
            transition: transform 0.15s, box-shadow 0.15s;
        }
        #settings-btn:hover {
            transform: translateX(-50%) scale(1.04);
            box-shadow: 0 6px 18px rgba(80,60,40,0.22);
        }

        /* --- Settings Panel --- */
        #settings-panel {
            position: fixed;
            top: 50px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 45;
            width: 280px;
            border-radius: 20px;
            background:
                radial-gradient(circle at 20% 20%, rgba(255,236,210,0.92), rgba(255,236,210,0)),
                radial-gradient(circle at 80% 80%, rgba(255,244,220,0.7), rgba(255,244,220,0)),
                linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6));
            backdrop-filter: blur(6px);
            box-shadow: 0 10px 32px rgba(80,60,40,0.22);
            padding: 10px 10px 12px;
            cursor: default !important;
        }
        #settings-panel.hidden {
            display: none;
        }
        #settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 2px 6px 6px;
            font-size: 0.82rem;
            font-weight: 700;
            color: #5a4a3e;
            letter-spacing: 0.08em;
        }
        #settings-close-btn {
            background: none;
            border: none;
            font-size: 1.2rem;
            color: #8a7a6a;
            cursor: pointer !important;
            padding: 0 4px;
            line-height: 1;
        }
        #settings-close-btn:hover {
            color: #5a4a3a;
        }
        #settings-tracks {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        /* --- Volume Row --- */
        .vol-row {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            border-radius: 8px;
            transition: opacity 0.2s;
        }
        .vol-row:hover {
            background: rgba(255,255,255,0.25);
        }
        .vol-mute-btn {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 1px solid rgba(120,100,80,0.25);
            background: rgba(255,255,255,0.5);
            font-size: 0.72rem;
            line-height: 22px;
            text-align: center;
            cursor: pointer !important;
            padding: 0;
            color: #5a4a3e;
            flex-shrink: 0;
            transition: background 0.15s, color 0.15s;
        }
        .vol-row.muted .vol-mute-btn {
            background: rgba(160,140,120,0.3);
            color: #aaa;
            text-decoration: line-through;
        }
        .vol-label {
            width: 40px;
            font-size: 0.68rem;
            font-weight: 700;
            color: #5a4a3e;
            text-align: right;
            flex-shrink: 0;
            letter-spacing: 0.02em;
        }
        .vol-dec-btn,
        .vol-inc-btn {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 1px solid rgba(120,100,80,0.2);
            background: rgba(255,255,255,0.4);
            font-size: 0.6rem;
            line-height: 18px;
            text-align: center;
            cursor: pointer !important;
            padding: 0;
            color: #7a6a5a;
            flex-shrink: 0;
            transition: background 0.1s;
        }
        .vol-dec-btn:hover,
        .vol-inc-btn:hover {
            background: rgba(255,255,255,0.7);
        }
        .vol-bar-wrap {
            flex: 1;
            height: 8px;
            border-radius: 4px;
            background: rgba(0,0,0,0.12);
            position: relative;
            cursor: pointer !important;
            min-width: 40px;
        }
        .vol-bar-fill {
            height: 100%;
            border-radius: 4px;
            position: absolute;
            top: 0;
            left: 0;
            pointer-events: none;
            transition: width 0.05s;
        }
        .vol-bar-thumb {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 1px 4px rgba(0,0,0,0.25);
            position: absolute;
            top: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
        }
        .vol-pct {
            width: 34px;
            font-size: 0.64rem;
            font-weight: 700;
            color: #7a6a5a;
            text-align: center;
            flex-shrink: 0;
        }

        /* Muted state */
        .vol-row.muted .vol-bar-wrap {
            pointer-events: none;
            opacity: 0.35;
        }
        .vol-row.muted .vol-dec-btn,
        .vol-row.muted .vol-inc-btn {
            pointer-events: none;
            opacity: 0.35;
        }
        .vol-row.muted .vol-label,
        .vol-row.muted .vol-pct {
            opacity: 0.5;
        }


        /* Cursor overrides for Settings area */
        #settings-panel *,
        #settings-btn {
            cursor: default !important;
        }
        #settings-panel button,
        #settings-panel .vol-bar-wrap,
        #settings-btn {
            cursor: pointer !important;
        }

        /* THIRTIES: melody preview glow */
        .score-row.melody-preview {
            animation: melodyPreviewPulse 0.8s ease-in-out infinite;
        }
        @keyframes melodyPreviewPulse {
            0%, 100% { background: rgba(255, 200, 100, 0.0); }
            50% { background: rgba(255, 200, 100, 0.2); }
        }

        /* THIRTIES: intro overlay */
        #thirties-intro-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: 100;
            display: flex; align-items: center; justify-content: center;
            background: rgba(30, 25, 18, 0.35);
            backdrop-filter: blur(2px);
            transition: opacity 0.6s;
            cursor: default;
        }
        #thirties-intro-overlay.hidden {
            opacity: 0; pointer-events: none;
        }
        #thirties-intro {
            background:
                radial-gradient(circle at 30% 20%, rgba(255,230,190,0.85), rgba(255,230,190,0)),
                radial-gradient(circle at 70% 80%, rgba(255,240,210,0.6), rgba(255,240,210,0)),
                linear-gradient(150deg, rgba(255,252,245,0.92), rgba(255,248,235,0.7));
            border-radius: 20px;
            padding: 32px 40px 28px;
            text-align: center;
            box-shadow: 0 14px 44px rgba(80,60,30,0.22);
            max-width: min(400px, 84vw);
            animation: modalIn 0.6s ease-out;
        }
        .thirties-intro-icon {
            font-size: 1.6rem;
            margin-bottom: 6px;
            opacity: 0.55;
        }
        .thirties-intro-body {
            font-size: 0.88rem; line-height: 1.85;
            color: #5a4a3a;
            margin: 0 0 6px;
        }
        .thirties-intro-en {
            font-size: 0.76rem; line-height: 1.75;
            color: #9a8a7a;
            margin: 0 0 6px;
        }
        .thirties-intro-hint {
            font-size: 0.78rem; line-height: 1.7;
            font-weight: 600;
            color: #6a5a48;
            background: rgba(200, 160, 80, 0.12);
            border-radius: 10px;
            padding: 8px 14px;
            margin: 14px 0 20px;
        }
        #thirties-intro-btn {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.92rem; font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #e0b870, #c89048);
            border: none; border-radius: 24px;
            padding: 9px 34px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(160,100,40,0.28);
            transition: transform 0.15s, box-shadow 0.15s;
        }
        #thirties-intro-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 6px 18px rgba(160,100,40,0.38);
        }
        #thirties-intro-btn:active {
            transform: scale(0.97);
        }

        /* --- CITY intro message overlay (same design as thirties) --- */
        #city-intro-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: 100;
            display: flex; align-items: center; justify-content: center;
            background: rgba(30, 25, 18, 0.35);
            backdrop-filter: blur(2px);
            transition: opacity 0.6s;
            cursor: default;
        }
        #city-intro-overlay.hidden {
            opacity: 0; pointer-events: none;
        }
        #city-intro {
            background:
                radial-gradient(circle at 30% 20%, rgba(255,230,190,0.85), rgba(255,230,190,0)),
                radial-gradient(circle at 70% 80%, rgba(255,240,210,0.6), rgba(255,240,210,0)),
                linear-gradient(150deg, rgba(255,252,245,0.92), rgba(255,248,235,0.7));
            border-radius: 20px;
            padding: 32px 40px 28px;
            text-align: center;
            box-shadow: 0 14px 44px rgba(80,60,30,0.22);
            max-width: min(400px, 84vw);
            animation: modalIn 0.6s ease-out;
        }
        #city-intro-btn {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.92rem; font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #e0b870, #c89048);
            border: none; border-radius: 24px;
            padding: 9px 34px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(160,100,40,0.28);
            transition: transform 0.15s, box-shadow 0.15s;
        }
        #city-intro-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 6px 18px rgba(160,100,40,0.38);
        }
        #city-intro-btn:active {
            transform: scale(0.97);
        }

        /* --- FINALE intro message overlay --- */
        #finale-message-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: 100;
            display: flex; align-items: center; justify-content: center;
            background: rgba(252, 250, 248, 0.82);
            opacity: 0;
            transition: opacity 1.8s ease;
            cursor: default;
        }
        #finale-message-box {
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            animation: modalIn 0.6s ease both;
        }
        .finale-msg-line {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 1.05rem;
            line-height: 2.2;
            color: #3a3535;
            text-align: center;
            margin: 0;
            padding: 0 24px;
            transition: opacity 0.8s ease;
        }
        .finale-msg-line-en {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.82rem;
            line-height: 1.6;
            color: #8a8585;
            font-style: italic;
            text-align: center;
            margin: 0 0 6px 0;
            padding: 0 24px;
        }
        #finale-proceed-btn {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.92rem; font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #9b7ed8, #6a4db8);
            border: none; border-radius: 24px;
            padding: 9px 34px;
            margin-top: 18px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(90,60,160,0.32);
            transition: transform 0.15s, box-shadow 0.15s, opacity 0.6s ease;
            opacity: 0;
        }
        #finale-proceed-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 6px 18px rgba(90,60,160,0.42);
        }
        #finale-proceed-btn:active {
            transform: scale(0.97);
        }
        #finale-proceed-btn.waiting {
            background: linear-gradient(135deg, #7a6aaa, #5a4888);
            cursor: default;
            pointer-events: none;
        }
        .finale-spinner {
            display: inline-block;
            animation: finaleSpin 1s linear infinite;
        }
        @keyframes finaleSpin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* --- Karaoke Display (FINALE) --- */
        #karaoke-display {
            position: fixed;
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 35;
            padding: 20px 28px 12px;
            border-radius: 12px;
            background: rgba(30,28,38,0.72);
            backdrop-filter: blur(6px);
            pointer-events: none;
            transition: opacity 0.6s;
            overflow: visible;
        }
        #karaoke-display.hidden {
            opacity: 0;
            display: none;
        }
        #karaoke-line {
            font-size: 1.6rem;
            letter-spacing: 0.12em;
            color: rgba(255,255,255,0.7);
            white-space: nowrap;
            text-shadow: 0 2px 8px rgba(0,0,0,0.4);
        }
        #karaoke-line .mora {
            display: inline-block;
            transition: color 0.15s, transform 0.15s;
        }
        #karaoke-line .mora.sung {
            color: #fff;
            transform: scale(1.08);
            text-shadow: 0 0 12px rgba(255,220,160,0.8);
        }
        #karaoke-line ruby {
            ruby-align: center;
            ruby-position: over;
        }
        #karaoke-line rt {
            font-size: 0.5em;
            font-weight: 400;
            color: rgba(255,255,255,0.5);
            letter-spacing: 0.02em;
            text-shadow: none;
        }
        #karaoke-line .mora.sung rt {
            color: rgba(255,255,255,0.75);
        }

        /* --- あゆみ (Life Report Card) --- */
        #ayumi-logo-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            z-index: 120;
            display: flex; align-items: flex-start; justify-content: center;
            padding-top: 18vh;
            pointer-events: none;
            opacity: 0;
            transition: opacity 2s ease;
        }
        .ayumi-logo-text {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-weight: 700;
            font-size: clamp(2.4rem, 8vw, 5rem);
            color: #5a4a3e;
            letter-spacing: 0.06em;
            text-shadow: 0 3px 0 rgba(255,255,255,0.7), 0 8px 20px rgba(110,88,62,0.15);
        }
        #ayumi-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            z-index: 110;
            background: rgba(248,245,240,0.96);
            overflow-y: auto;
            opacity: 0;
            transition: opacity 1.2s ease;
            cursor: default;
        }
        #ayumi-overlay.visible {
            opacity: 1;
        }
        #ayumi-container {
            max-width: 800px;
            margin: 0 auto;
            padding: 48px 28px 80px;
            transform: translateY(100vh);
        }
        .ayumi-title {
            font-size: clamp(1.4rem, 4vw, 2rem);
            font-weight: 700;
            color: #5a4a3e;
            text-align: center;
            margin: 0 0 36px;
            letter-spacing: 0.08em;
        }
        .ayumi-top-section {
            display: flex;
            flex-direction: row;
            gap: 32px;
            align-items: flex-start;
            margin-bottom: 40px;
        }
        .ayumi-pentagon-wrap {
            flex-shrink: 0;
        }
        #ayumi-pentagon-canvas {
            display: block;
            width: 280px;
            height: 280px;
        }
        .ayumi-stats-row {
            display: flex;
            justify-content: center;
            gap: 28px;
            margin-bottom: 32px;
        }
        .ayumi-stat-item {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(90,74,62,0.06);
            padding: 6px 16px;
            border-radius: 20px;
        }
        .ayumi-stat-icon {
            font-size: 1rem;
        }
        .ayumi-stat-label {
            font-size: 0.72rem;
            color: rgba(90,74,62,0.6);
            font-weight: 500;
        }
        .ayumi-stat-value {
            font-size: 0.88rem;
            font-weight: 700;
            color: #5a4a3e;
        }
        .ayumi-labels-list {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }
        .ayumi-label-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 3px 8px 3px 10px;
            border-left: 3px solid #999;
            background: rgba(255,255,255,0.5);
            border-radius: 0 4px 4px 0;
        }
        .ayumi-label-name {
            font-size: 0.74rem;
            color: #5a4a3e;
            font-weight: 500;
        }
        .ayumi-label-val {
            font-size: 0.76rem;
            font-weight: 700;
            color: #5a4a3e;
            min-width: 22px;
            text-align: right;
        }
        .ayumi-timeline {
            margin-top: 12px;
        }
        .ayumi-timeline h3 {
            font-size: 1.15rem;
            font-weight: 700;
            color: #5a4a3e;
            margin: 0 0 18px;
            letter-spacing: 0.08em;
        }
        .ayumi-phase {
            display: flex;
            flex-direction: row;
            align-items: flex-start;
            gap: 14px;
            margin-bottom: 14px;
        }
        .ayumi-phase-age {
            flex-shrink: 0;
            width: 80px;
            font-size: 0.82rem;
            font-weight: 700;
            color: rgba(90,74,62,0.7);
            padding-top: 4px;
        }
        .ayumi-phase-items {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .ayumi-item-tag {
            display: inline-flex;
            flex-direction: column;
            padding: 5px 12px;
            border-radius: 12px;
            background: rgba(90,74,62,0.10);
            color: #5a4a3e;
            font-size: 0.82rem;
            font-weight: 500;
        }
        .ayumi-item-desc {
            font-size: 0.7rem;
            font-weight: 400;
            color: rgba(90,74,62,0.55);
            margin-top: 1px;
        }
        @media (max-width: 700px) {
            .ayumi-stats-row {
                gap: 14px;
            }
            .ayumi-stat-item {
                padding: 5px 12px;
            }
            .ayumi-top-section {
                flex-direction: column;
                align-items: center;
            }
            #ayumi-pentagon-canvas {
                width: 240px;
                height: 240px;
            }
            .ayumi-labels-list {
                width: 100%;
            }
            .ayumi-phase {
                flex-direction: column;
                gap: 6px;
            }
            .ayumi-phase-age {
                width: auto;
            }
        }

        /* --- Lyrics section (Ayumi report card) --- */
        .ayumi-lyrics {
            margin-top: 24px;
            padding: 16px 20px;
            background: rgba(90,74,62,0.05);
            border-radius: 12px;
        }
        .ayumi-lyrics h3 {
            font-size: 1.05rem;
            font-weight: 700;
            color: #5a4a3e;
            margin: 0 0 12px;
            letter-spacing: 0.06em;
        }
        .ayumi-verse {
            font-size: 0.88rem;
            color: rgba(90,74,62,0.75);
            line-height: 1.7;
            margin: 0 0 6px;
            font-family: 'Zen Maru Gothic', sans-serif;
        }

        /* --- 歌を聴く button (Ayumi report card) --- */
        #ayumi-listen-btn {
            display: block;
            margin: 32px auto 0;
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.92rem; font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #9b7ed8, #6a4db8);
            border: none; border-radius: 24px;
            padding: 9px 34px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(90,60,160,0.32);
            transition: transform 0.15s, box-shadow 0.15s, opacity 0.4s ease;
        }
        #ayumi-listen-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 6px 18px rgba(90,60,160,0.42);
        }
        #ayumi-listen-btn:active {
            transform: scale(0.97);
        }

        /* --- Finale Ending Screen --- */
        #finale-ending-screen {
            position: fixed; inset: 0;
            z-index: 130;
            background: rgba(248,245,240,0.98);
            display: flex; align-items: center; justify-content: center;
            opacity: 0;
            transition: opacity 1s ease;
        }
        #finale-ending-screen.visible {
            opacity: 1;
        }
        #finale-ending-ornaments {
            position: absolute; inset: 0; pointer-events: none;
            opacity: 0;
            transition: opacity 2s ease 1.5s;
        }
        #finale-ending-screen.visible #finale-ending-ornaments {
            opacity: 1;
        }
        #finale-ending-ornaments .orb-a {
            right: 12%; top: 15%;
            width: 160px; height: 160px;
        }
        #finale-ending-ornaments .orb-b {
            left: 10%; bottom: 18%;
            width: 200px; height: 200px;
        }
        #finale-ending-content {
            text-align: center;
            transform: translateY(40px);
            opacity: 0;
            transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s,
                        opacity 1.5s ease 0.5s;
        }
        #finale-ending-screen.visible #finale-ending-content {
            transform: translateY(0);
            opacity: 1;
        }
        .finale-thanks-msg {
            font-size: clamp(1.2rem, 3.5vw, 1.8rem);
            color: #5a4a3e;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin: 0 0 40px;
            font-family: 'Zen Maru Gothic', sans-serif;
        }
        #finale-ending-buttons {
            display: flex; gap: 16px;
            justify-content: center;
            flex-wrap: wrap;
            opacity: 0;
            transition: opacity 1s ease 2.5s;
        }
        #finale-ending-screen.visible #finale-ending-buttons {
            opacity: 1;
        }
        #finale-save-btn,
        #finale-title-btn {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.92rem; font-weight: 700;
            color: #fff;
            border: none; border-radius: 24px;
            padding: 10px 32px;
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        #finale-save-btn {
            background: linear-gradient(135deg, #9b7ed8, #6a4db8);
            box-shadow: 0 4px 12px rgba(90,60,160,0.32);
        }
        #finale-title-btn {
            background: linear-gradient(135deg, #d8a07e, #b8784d);
            box-shadow: 0 4px 12px rgba(160,100,60,0.32);
        }
        #finale-save-btn:hover,
        #finale-title-btn:hover {
            transform: scale(1.04);
        }
        #finale-save-btn:active,
        #finale-title-btn:active {
            transform: scale(0.97);
        }

        /* --- Unlock Overlay (周回解放通知) --- */
        #unlock-overlay {
            position: fixed; inset: 0;
            z-index: 140;
            display: flex; align-items: center; justify-content: center;
            background: rgba(30, 22, 16, 0.72);
            backdrop-filter: blur(6px);
        }
        #unlock-card {
            background:
                radial-gradient(circle at 20% 20%, rgba(255, 236, 210, 0.9), rgba(255, 236, 210, 0)),
                radial-gradient(circle at 80% 80%, rgba(255, 244, 220, 0.7), rgba(255, 244, 220, 0)),
                linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,248,235,0.88));
            border-radius: 24px;
            padding: 40px 48px 36px;
            text-align: center;
            box-shadow: 0 20px 52px rgba(80, 60, 40, 0.3);
            max-width: min(440px, 88vw);
            animation: modalIn 0.5s ease-out;
        }
        .unlock-icon {
            font-size: 2.6rem;
            margin-bottom: 10px;
        }
        .unlock-title {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 1.3rem; font-weight: 700;
            color: #5a4a3e;
            margin: 0 0 14px;
        }
        .unlock-body {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.95rem; font-weight: 500;
            color: #6a5a4e;
            margin: 0 0 8px;
            line-height: 1.6;
        }
        .unlock-body-en {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.82rem; font-weight: 400;
            color: #8a7a6e;
            margin: 0 0 18px;
            line-height: 1.5;
        }
        .unlock-img {
            display: block;
            max-width: 320px;
            width: 80%;
            margin: 0 auto 18px;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(80, 60, 40, 0.18);
        }
        #unlock-ok-btn {
            font-family: 'Zen Maru Gothic', sans-serif;
            font-size: 0.95rem; font-weight: 700;
            color: #fff;
            border: none; border-radius: 24px;
            padding: 10px 40px;
            background: linear-gradient(135deg, #d8a07e, #b8784d);
            box-shadow: 0 4px 14px rgba(160, 100, 60, 0.32);
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        #unlock-ok-btn:hover {
            transform: scale(1.04);
        }
        #unlock-ok-btn:active {
            transform: scale(0.97);
        }

