        #playback-screen {
            position: absolute;
            inset: 0;
            pointer-events: none;
            opacity: 0;
            padding: max(18px, env(safe-area-inset-top, 0px) + 18px) 24px 0;
            box-sizing: border-box;
            transition: opacity 0.28s ease;
            overflow: hidden;
        }

        #playback-screen.active {
            opacity: 1;
        }

        #playback-screen.theme-selecting {
            background:
                radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.04), transparent 20%),
                radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.03), transparent 18%),
                linear-gradient(180deg, #202225, #16181b 46%, #121417 100%);
        }

        #playback-screen.theme-selecting::before,
        #playback-screen.theme-selecting::after {
            content: '';
            position: absolute;
            width: 62vw;
            height: 62vw;
            min-width: 360px;
            min-height: 360px;
            border-radius: 999px;
            filter: blur(72px);
            opacity: 0.42;
            pointer-events: none;
        }

        #playback-screen.theme-selecting::before {
            top: -24vh;
            left: -18vw;
            background:
                radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.08), transparent 34%),
                radial-gradient(circle, rgba(83, 89, 98, 0.12), transparent 66%);
            animation: drift-blue 20s ease-in-out infinite alternate;
        }

        #playback-screen.theme-selecting::after {
            right: -18vw;
            bottom: -28vh;
            background:
                radial-gradient(circle at 32% 36%, rgba(255, 255, 255, 0.06), transparent 34%),
                radial-gradient(circle, rgba(67, 71, 78, 0.12), transparent 68%);
            animation: drift-violet 24s ease-in-out infinite alternate;
        }

        #playback-screen .theme-floating-symbols {
            opacity: 0;
            transition: opacity 0.28s ease;
            z-index: 100;
        }

        #playback-screen.theme-selecting .theme-floating-symbols {
            opacity: 1;
        }

        #top-bar {
            position: relative;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
            pointer-events: auto;
        }

        #top-bar-left {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
            flex-wrap: wrap;
        }

        .top-bar-button {
            border: 1px solid rgba(255,255,255,0.16);
            background: rgba(10, 15, 25, 0.78);
            color: #f4fbff;
            border-radius: 999px;
            padding: 9px 14px;
            font-size: 12px;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            cursor: pointer;
            transition:
                transform 0.18s ease,
                border-color 0.18s ease,
                background 0.18s ease,
                box-shadow 0.18s ease,
                color 0.18s ease;
        }

        .top-bar-button:hover {
            transform: translateY(-2px);
            border-color: rgba(255,255,255,0.42);
            background: rgba(18, 32, 50, 0.92);
            color: #ffffff;
            box-shadow:
                0 0 0 1px rgba(255,255,255,0.14),
                0 10px 24px rgba(0,0,0,0.3),
                0 0 22px rgba(0, 210, 255, 0.16);
        }

        .top-bar-button:active {
            transform: translateY(0);
        }

        .top-bar-button.is-active {
            border-color: rgba(255, 120, 120, 0.62);
            background: rgba(72, 18, 24, 0.92);
            box-shadow:
                0 0 0 1px rgba(255, 120, 120, 0.18),
                0 12px 26px rgba(0,0,0,0.34),
                0 0 26px rgba(255, 82, 82, 0.2);
        }

        .top-bar-button.is-disabled {
            opacity: 0.5;
        }

        #background-toggle {
            min-width: 146px;
            text-align: left;
        }

        #background-toggle.is-readonly {
            cursor: default;
            pointer-events: none;
            opacity: 1;
        }

        #mode-status {
            color: rgba(255,255,255,0.68);
            font-size: 12px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        #theme-panel {
            position: absolute;
            top: 72px;
            left: 24px;
            width: min(680px, calc(100vw - 48px));
            min-height: 220px;
            display: none;
            grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
            gap: 14px;
            padding: 14px;
            border-radius: 18px;
            border: 1px solid rgba(255,255,255,0.2);
            background: linear-gradient(145deg, rgba(12, 18, 30, 0.96), rgba(8, 14, 24, 0.92));
            box-shadow:
                0 24px 46px rgba(0,0,0,0.45),
                inset 0 0 0 1px rgba(255,255,255,0.05);
            z-index: 120;
            pointer-events: auto;
        }

        #theme-panel.is-open {
            display: grid;
        }

        #playback-screen.theme-selecting #theme-panel {
            display: grid;
            top: clamp(195px, 26vh, 290px);
            left: 50%;
            width: min(1380px, calc(100vw - 80px));
            min-height: 0;
            grid-template-columns: minmax(620px, 1.1fr) minmax(440px, 0.9fr);
            gap: 52px;
            padding: 0;
            border: none;
            background: transparent;
            box-shadow: none;
            transform: translateX(-50%);
            z-index: 130;
        }
        #playback-screen.theme-selecting .theme-list {
            position: relative;
            height: 452px;
            overflow: hidden;
            perspective: 1200px;
            perspective-origin: 50% 50%;
            user-select: none;
        }

        #playback-screen.theme-selecting .theme-list > li {
            position: absolute;
            left: 0;
            right: 0;
            top: 50%;
            margin: 0;
            padding: 0;
            list-style: none;
            transform: translateY(-50%);
        }

        #playback-screen.theme-selecting .theme-list-item {
            position: relative;
            overflow: hidden;
            box-sizing: border-box;
            min-height: 98px;
            padding: 0 24px 12px 24px;
            border-radius: 16px;
            border: 3px solid transparent;
            background:
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)) padding-box,
                linear-gradient(180deg, #2f3338, #22262b 58%, #1b1f23 100%) padding-box,
                linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.1)) border-box;
            background-clip: padding-box, padding-box, border-box;
            display: flex;
            justify-content: flex-end;
            align-items: flex-end;
            font-size: clamp(22px, 1.65vw, 32px);
            font-weight: 600;
            letter-spacing: -0.01em;
            text-transform: none;
            color: rgba(255,255,255,0.96);
            text-shadow:
                0 2px 10px rgba(0,0,0,0.44),
                0 0 10px rgba(255,255,255,0.06);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.06),
                0 14px 26px rgba(0,0,0,0.22);
            transition:
                transform 0.32s cubic-bezier(0.2, 0.75, 0.2, 1),
                opacity 0.3s ease,
                border-color 0.26s ease,
                box-shadow 0.26s ease,
                background 0.26s ease,
                filter 0.3s ease;
            transform-origin: center center;
            will-change: transform, opacity, filter;
            cursor: grab;
            touch-action: none;
        }

        #playback-screen.theme-selecting .theme-list-item::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            opacity: 0.95;
            background:
                linear-gradient(180deg, rgba(255,255,255,0.05), transparent 44%),
                radial-gradient(circle at 86% 20%, rgba(72, 127, 255, 0.18), transparent 25%);
        }

        #playback-screen.theme-selecting .theme-list-item::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border: 1px solid rgba(255,255,255,0.07);
            opacity: 1;
            background:
                linear-gradient(180deg, rgba(255,255,255,0.06), transparent 22%),
                linear-gradient(0deg, rgba(255,255,255,0.03), transparent 24%);
            transition: opacity 0.26s ease, border-color 0.26s ease;
            pointer-events: none;
            z-index: 1;
        }

        #playback-screen.theme-selecting #theme-panel:not(.is-transitioning) .theme-list-item:hover,
        #playback-screen.theme-selecting #theme-panel:not(.is-transitioning) .theme-list-item:focus-visible {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)) padding-box,
                linear-gradient(180deg, #2f3338, #22262b 58%, #1b1f23 100%) padding-box,
                linear-gradient(
                    135deg,
                    rgba(120, 245, 255, 0.98) 0%,
                    rgba(64, 207, 255, 0.98) 20%,
                    rgba(38, 118, 255, 0.99) 54%,
                    rgba(76, 94, 255, 0.97) 76%,
                    rgba(255, 168, 229, 0.95) 100%
                ) border-box;
            background-clip: padding-box, padding-box, border-box;
            box-shadow:
                0 18px 34px rgba(0,0,0,0.28),
                0 0 0 1px rgba(95, 219, 255, 0.22),
                0 0 18px rgba(63, 143, 255, 0.22),
                0 0 32px rgba(255, 154, 223, 0.12);
            filter: brightness(1.03);
        }

        #playback-screen.theme-selecting #theme-panel:not(.is-transitioning) .theme-list-item:hover::after,
        #playback-screen.theme-selecting #theme-panel:not(.is-transitioning) .theme-list-item:focus-visible::after {
            opacity: 0.32;
            border-color: transparent;
        }

        #playback-screen.theme-selecting .theme-list-item.is-selected {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)) padding-box,
                linear-gradient(180deg, #2f3338, #22262b 58%, #1b1f23 100%) padding-box,
                linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.1)) border-box;
            background-clip: padding-box, padding-box, border-box;
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.06),
                0 14px 26px rgba(0,0,0,0.22);
            filter: brightness(1.02);
        }

        #playback-screen.theme-selecting .theme-list-item.is-active {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)) padding-box,
                linear-gradient(180deg, #2f3338, #22262b 58%, #1b1f23 100%) padding-box,
                linear-gradient(
                    135deg,
                    rgba(120, 245, 255, 0.98) 0%,
                    rgba(64, 207, 255, 0.98) 20%,
                    rgba(38, 118, 255, 0.99) 54%,
                    rgba(76, 94, 255, 0.97) 76%,
                    rgba(255, 168, 229, 0.95) 100%
                ) border-box;
            background-clip: padding-box, padding-box, border-box;
            box-shadow:
                0 18px 34px rgba(0,0,0,0.28),
                0 0 0 1px rgba(95, 219, 255, 0.22),
                0 0 18px rgba(63, 143, 255, 0.22),
                0 0 32px rgba(255, 154, 223, 0.12);
            filter: brightness(1.03);
        }

        #playback-screen.theme-selecting .theme-list-item.is-faded {
            pointer-events: none;
        }

        #playback-screen.theme-selecting .theme-list-item.is-selected::after {
            opacity: 0.28;
            border-color: transparent;
        }

        #theme-panel.is-transitioning .theme-list-item {
            pointer-events: none;
            backface-visibility: hidden;
            transform: translateZ(0);
            will-change: transform, opacity, filter;
        }

        #theme-panel.is-transitioning .theme-list-item::before,
        #theme-panel.is-transitioning .theme-list-item::after {
            opacity: 0 !important;
            transition: none;
        }

        #theme-panel.is-transitioning .theme-list-item.is-muted {
            transition:
                opacity 0.28s ease,
                transform 0.28s ease,
                filter 0.28s ease;
            opacity: 0.2;
            transform: translateY(8px) scale(0.965);
            filter: blur(1px);
        }

        #theme-panel.is-transitioning .theme-list-item.is-selected {
            z-index: 2;
            transform: translateY(-5px) scale(1);
            background:
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)) padding-box,
                linear-gradient(180deg, #2f3338, #22262b 58%, #1b1f23 100%) padding-box,
                linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.1)) border-box;
            background-clip: padding-box, padding-box, border-box;
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.06),
                0 14px 26px rgba(0,0,0,0.22);
            filter: brightness(1.02);
            animation: theme-list-enter-press 0.56s cubic-bezier(0.18, 0.82, 0.2, 1) forwards;
        }

        #theme-panel.is-transitioning.is-exiting {
            animation: theme-panel-exit-select 0.34s ease forwards;
        }

        #playback-screen.theme-selecting .theme-preview {
            border: none;
            border-radius: 14px;
            background: transparent;
            padding: 0;
            box-shadow: none;
            margin-left: 10px;
            gap: 16px;
        }

        #playback-screen.theme-selecting .theme-preview-media {
            aspect-ratio: 16 / 9;
            border-radius: 14px;
            border: 1px solid rgba(255,255,255,0.14);
            background:
                radial-gradient(circle at 24% 20%, rgba(255,255,255,0.13), transparent 30%),
                radial-gradient(circle at 78% 72%, rgba(108, 160, 255, 0.2), transparent 36%),
                linear-gradient(180deg, rgba(26, 32, 42, 0.95), rgba(14, 18, 26, 0.95));
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.06),
                0 16px 34px rgba(0,0,0,0.32);
        }

        #playback-screen.theme-selecting .theme-preview-meta {
            padding: 0 2px;
        }

        #playback-screen.theme-selecting .theme-preview-title {
            font-size: clamp(28px, 2vw, 36px);
            font-weight: 650;
            letter-spacing: -0.018em;
        }

        #playback-screen.theme-selecting .theme-preview-description {
            font-size: 19px;
            line-height: 1.48;
            max-width: none;
        }

        #playback-screen.theme-selecting .theme-preview-tag {
            display: none;
        }

        .theme-list {
            margin: 0;
            padding: 0;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .theme-list-item {
            border: 1px solid rgba(255,255,255,0.16);
            background: rgba(255,255,255,0.04);
            color: #f4fbff;
            border-radius: 12px;
            width: 100%;
            text-align: left;
            padding: 11px 12px;
            font-size: 12px;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            cursor: pointer;
            transition:
                transform 0.18s ease,
                border-color 0.18s ease,
                background 0.18s ease,
                box-shadow 0.18s ease;
        }

        .theme-list-item:hover {
            transform: translateY(-1px);
            border-color: rgba(255,255,255,0.34);
            background: rgba(255,255,255,0.08);
        }

        .theme-list-item.is-selected {
            border-color: rgba(255, 236, 120, 0.9);
            background: rgba(255, 224, 82, 0.16);
            box-shadow:
                inset 0 0 0 1px rgba(255, 240, 150, 0.2),
                0 8px 24px rgba(0,0,0,0.26);
        }

        .theme-preview {
            border-radius: 14px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.035);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .theme-preview-media {
            aspect-ratio: 16 / 9;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.1);
            background:
                radial-gradient(circle at 24% 20%, rgba(255,255,255,0.08), transparent 30%),
                linear-gradient(180deg, rgba(24, 29, 38, 0.92), rgba(14, 18, 24, 0.92));
        }

        .theme-preview-meta {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .theme-preview-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .theme-preview-title {
            font-size: 22px;
            font-weight: 600;
            letter-spacing: -0.01em;
            color: #f6fcff;
        }

        .theme-preview-tag {
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 10px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.75);
            background: rgba(255,255,255,0.06);
        }

        .theme-preview-description {
            margin: 0;
            font-size: 13px;
            line-height: 1.5;
            color: rgba(255,255,255,0.78);
            max-width: 44ch;
        }

        #bottom-ui {
            --bottom-ui-scale: 1;
            position: absolute;
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%) scale(var(--bottom-ui-scale));
            transform-origin: bottom center;
            width: 1680px;
            height: 124px;
            display: flex;
            gap: 12px;
            z-index: 100;
            pointer-events: auto;
            align-items: stretch;
            justify-content: center;
        }

        #bottom-ui.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .ui-hidden {
            display: none !important;
        }

        #key-panel {
            width: 230px;
            height: 100%;
            background: rgba(10, 15, 25, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 12px;
            padding: 10px 11px 10px 11px;
            box-sizing: border-box;
            box-shadow:
                0 15px 40px rgba(0,0,0,0.9),
                0 0 20px rgba(0,210,255,0.05);
            color: #fff;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            overflow: hidden;
        }

        #current-key-label {
            font-size: 15px;
            font-weight: 700;
            color: #00d2ff;
            margin-bottom: 4px;
            line-height: 1.05;
        }

        #key-hint {
            font-size: 8px;
            line-height: 1.15;
            color: rgba(255,255,255,0.68);
            margin-bottom: 8px;
        }

        .single-row {
            display: flex;
            margin-bottom: 8px;
        }

        .control-row {
            display: flex;
            gap: 6px;
            margin-top: 0;
        }

        .custom-select {
            position: relative;
            display: inline-block;
            width: 100%;
        }
        .custom-select select {
            width: 100%;
            height: 28px;
            position: static;
            left: unset;
            top: unset;
            z-index: 1;
            background: rgba(255,255,255,0.06);
            padding-right: 28px;
        }

        #sound-select,
        #key-select,
        #mode-select {
            flex: 1;
            height: 28px;
            padding: 0 8px;
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.14);
            background: rgba(255,255,255,0.06);
            color: #fff;
            outline: none;
            font-size: 10px;
            box-sizing: border-box;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            padding-right: 28px; /* 預留箭頭空間 */
        }

        /* 自訂下拉箭頭 */
        .custom-select::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 12px;
            width: 8px;
            height: 8px;
            pointer-events: none;
            border-left: 2px solid #fff;
            border-bottom: 2px solid #fff;
            transform: translateY(-60%) rotate(-45deg);
            opacity: 0.7;
            z-index: 2;
        }

        /* 讓 option 也盡量維持白字深底，雖然部分瀏覽器不支援 */
        #sound-select option,
        #key-select option,
        #mode-select option {
            background: #222;
            color: #fff;
        }

        #sound-select:disabled {
            opacity: 0.62;
            cursor: wait;
        }

        #piano-container {
            flex: 1;
            min-width: 0;
            height: 100%;
            background: rgba(10, 15, 25, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 12px;
            padding: 6px;
            box-sizing: border-box;
            box-shadow:
                0 15px 40px rgba(0,0,0,0.9),
                0 0 20px rgba(0,210,255,0.05);
            display: flex;
            overflow-x: auto;
            overflow-y: hidden;
            justify-content: center;
        }

        #record-slots {
            width: 182px;
            height: 100%;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            grid-template-rows: repeat(2, minmax(0, 1fr));
            gap: 7px;
            padding: 7px;
            box-sizing: border-box;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.15);
            background: rgba(10, 15, 25, 0.9);
            box-shadow:
                0 15px 40px rgba(0,0,0,0.9),
                0 0 20px rgba(0,210,255,0.05);
        }

        .record-slot-button {
            position: relative;
            min-width: 0;
            min-height: 0;
            aspect-ratio: 1;
            padding: 6px 4px;
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.04);
            color: #f8fcff;
            cursor: pointer;
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: 22px minmax(0, 1fr);
            align-items: center;
            justify-items: center;
            gap: 3px;
            overflow: hidden;
            transition:
                transform 0.22s ease,
                border-color 0.22s ease,
                background 0.22s ease,
                box-shadow 0.22s ease,
                color 0.22s ease;
        }

        .record-slot-button::before {
            content: '';
            position: absolute;
            inset: 0;
            background:
                linear-gradient(180deg, rgba(255,255,255,0.06), transparent 46%),
                radial-gradient(circle at 78% 24%, rgba(112, 204, 255, 0.18), transparent 42%);
            opacity: 0.66;
            pointer-events: none;
        }

        .record-slot-button:hover,
        .record-slot-button:focus-visible {
            transform: translateY(-2px);
            border-color: rgba(255,255,255,0.24);
            background: rgba(255,255,255,0.08);
            box-shadow: 0 10px 24px rgba(0,0,0,0.22);
            outline: none;
        }

        .record-slot-button:active {
            transform: translateY(0);
        }

        .record-slot-button.is-recording {
            border-color: rgba(255, 78, 92, 0.72);
            background: rgba(148, 22, 34, 0.34);
            box-shadow:
                0 0 0 1px rgba(255, 78, 92, 0.24),
                0 0 0 5px rgba(255, 42, 64, 0.08),
                0 0 26px rgba(255, 42, 64, 0.34),
                inset 0 0 18px rgba(255, 86, 104, 0.16);
        }

        .record-slot-button.is-recording::before {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.09), transparent 46%),
                linear-gradient(135deg, rgba(255, 87, 104, 0.3), transparent 58%),
                radial-gradient(circle at 78% 24%, rgba(255, 58, 78, 0.34), transparent 44%);
        }

        .record-slot-button.is-playing {
            border-color: rgba(92, 255, 156, 0.7);
            background: rgba(36, 155, 82, 0.28);
            box-shadow:
                0 0 0 1px rgba(92, 255, 156, 0.18),
                0 0 20px rgba(77, 255, 142, 0.3),
                0 0 34px rgba(74, 255, 132, 0.18),
                inset 0 0 18px rgba(112, 255, 170, 0.12);
        }

        .record-slot-button.is-playing::before {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.08), transparent 46%),
                radial-gradient(circle at 78% 24%, rgba(92, 255, 156, 0.38), transparent 44%);
        }

        .record-slot-button.has-clip:not(.is-recording):not(.is-playing) {
            border-color: rgba(255, 214, 108, 0.38);
            background: rgba(255, 214, 108, 0.12);
            box-shadow:
                0 0 0 1px rgba(255, 214, 108, 0.1),
                0 0 18px rgba(255, 214, 108, 0.08);
        }

        .record-slot-button.has-clip:not(.is-recording):not(.is-playing)::before {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.07), transparent 46%),
                radial-gradient(circle at 78% 24%, rgba(255, 214, 108, 0.24), transparent 44%);
        }

        .record-slot-key,
        .record-slot-status {
            position: relative;
            z-index: 1;
        }

        .record-slot-key {
            width: 22px;
            height: 22px;
            border-radius: 7px;
            display: grid;
            place-items: center;
            background: rgba(0,0,0,0.28);
            border: 1px solid rgba(255,255,255,0.12);
            font-size: 12px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }

        .record-slot-status {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            text-align: center;
        }

        #piano-ui {
            display: flex;
            width: 100%;
            min-width: 100%;
            height: 100%;
            position: relative;
            flex: 0 0 auto;
            margin: 0 auto;
            justify-content: center;
        }

        .key.white {
            flex: 1 0 1.923%;
            height: 100%;
            background: #fff;
            border: 1px solid #ccc;
            border-radius: 0 0 4px 4px;
            box-sizing: border-box;
            z-index: 1;
            transition: background 0.1s;
        }

        .key.black {
            flex: 0 0 1.2%;
            height: 60%;
            background: #222;
            border: 1px solid #000;
            margin-left: -0.6%;
            margin-right: -0.6%;
            z-index: 2;
            border-radius: 0 0 3px 3px;
            transition: background 0.1s;
        }

        .key.user-active {
            background: #00d2ff !important;
            box-shadow: 0 0 20px #00d2ff;
            border-color: #00d2ff;
        }

        .key.playback-active {
            background: #ff4d5f !important;
            box-shadow: 0 0 20px #ff4d5f;
            border-color: #ff4d5f;
        }

        .key.mixed-active {
            background: #c94cff !important;
            box-shadow: 0 0 22px #c94cff;
            border-color: #c94cff;
        }

        #absolute-pitch-ui {
            position: absolute;
            inset: 88px 24px 24px;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 100;
            pointer-events: auto;
        }

        #absolute-pitch-ui.active {
            display: flex;
        }
        .absolute-pitch-panel {
            position: relative;
            width: min(1120px, 100%);
            padding: 34px;
            border-radius: 36px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background:
                radial-gradient(circle at 16% 12%, rgba(124, 244, 255, 0.1), transparent 24%),
                radial-gradient(circle at 86% 18%, rgba(114, 124, 255, 0.12), transparent 28%),
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)),
                linear-gradient(180deg, #2a2f35, #1f2429 58%, #171b20 100%);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.07),
                0 28px 64px rgba(0,0,0,0.36);
            color: #f4fbff;
            overflow: hidden;
        }

        .absolute-pitch-panel::before {
            content: '';
            position: absolute;
            inset: 0 0 auto;
            height: 180px;
            background: linear-gradient(180deg, rgba(255,255,255,0.035), transparent 78%);
            pointer-events: none;
        }

        .absolute-pitch-panel::after {
            content: '';
            position: absolute;
            inset: auto 34px 132px;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
            pointer-events: none;
        }

        .absolute-pitch-shell {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            gap: 26px;
        }

        .absolute-pitch-header {
            display: grid;
            grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
            gap: 26px;
            align-items: stretch;
        }

        .absolute-pitch-intro {
            display: flex;
            flex-direction: column;
            gap: 18px;
            padding: 10px 4px 0 0;
        }

        .absolute-pitch-eyebrow {
            display: inline-flex;
            align-items: center;
            align-self: flex-start;
            gap: 10px;
            padding: 8px 14px;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 999px;
            background: rgba(255,255,255,0.04);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
            font-size: 11px;
            letter-spacing: 0.24em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.62);
        }

        .absolute-pitch-eyebrow::before,
        .absolute-pitch-eyebrow::after {
            content: '';
            width: 20px;
            height: 1px;
            background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.4));
        }

        .absolute-pitch-eyebrow::after {
            background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0));
        }

        .absolute-pitch-title {
            margin: 0;
            font-size: clamp(34px, 4.4vw, 58px);
            font-weight: 600;
            letter-spacing: 0.02em;
            line-height: 1.02;
            text-shadow: 0 10px 34px rgba(0,0,0,0.3);
        }

        .absolute-pitch-copy {
            margin: 0;
            max-width: 54ch;
            color: rgba(255,255,255,0.68);
            line-height: 1.8;
            font-size: 15px;
        }

        .absolute-pitch-copy strong {
            color: rgba(255,255,255,0.9);
            font-weight: 600;
        }

        .absolute-pitch-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .absolute-pitch-meta-chip {
            padding: 9px 14px;
            border-radius: 999px;
            border: 1px solid rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.04);
            font-size: 11px;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.58);
        }

        .absolute-pitch-stats {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 14px;
            min-width: 290px;
            align-self: start;
        }

        .absolute-pitch-stat {
            position: relative;
            padding: 16px 16px 18px;
            border-radius: 22px;
            background:
                linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)),
                rgba(16, 19, 24, 0.82);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.05),
                0 12px 24px rgba(0,0,0,0.14);
        }

        .absolute-pitch-stat::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent 45%);
            opacity: 0.45;
            pointer-events: none;
        }

        .absolute-pitch-stat-label {
            position: relative;
            font-size: 11px;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.46);
        }

        .absolute-pitch-stat-value {
            position: relative;
            margin-top: 8px;
            font-size: clamp(24px, 2.6vw, 32px);
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .absolute-pitch-stat-value.timer-alert {
            color: #ff9aa7;
            text-shadow: 0 0 18px rgba(255, 92, 122, 0.28);
        }

        .absolute-pitch-card {
            position: relative;
            border-radius: 30px;
            border: 1px solid rgba(255,255,255,0.08);
            background:
                radial-gradient(circle at top right, rgba(111, 201, 255, 0.11), transparent 24%),
                linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
                rgba(16, 19, 24, 0.84);
            padding: 28px;
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.05),
                0 18px 34px rgba(0,0,0,0.14);
        }

        .absolute-pitch-card::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border: 1px solid rgba(255,255,255,0.04);
            pointer-events: none;
        }

        .absolute-pitch-card-top {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 18px;
            align-items: end;
        }

        .absolute-pitch-kicker {
            font-size: 11px;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.48);
            margin-bottom: 8px;
        }

        .absolute-pitch-prompt {
            font-size: clamp(26px, 3.2vw, 40px);
            font-weight: 600;
            margin: 0;
            line-height: 1.12;
            max-width: 16ch;
        }

        .absolute-pitch-subprompt {
            margin: 12px 0 0;
            color: rgba(255,255,255,0.66);
            font-size: 15px;
            line-height: 1.78;
            max-width: 62ch;
        }

        .absolute-pitch-live-status {
            padding: 12px 16px;
            border-radius: 18px;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.04);
            min-width: 190px;
        }

        .absolute-pitch-live-status-label {
            font-size: 10px;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.44);
        }

        .absolute-pitch-live-status-value {
            margin-top: 8px;
            font-size: 14px;
            line-height: 1.6;
            color: rgba(255,255,255,0.82);
        }

        .absolute-pitch-feedback {
            min-height: 24px;
            margin-top: 18px;
            color: rgba(255,255,255,0.82);
            font-size: 14px;
            letter-spacing: 0.02em;
            padding-left: 2px;
        }

        .absolute-pitch-timer-track {
            position: relative;
            height: 14px;
            margin-top: 18px;
            border-radius: 999px;
            overflow: hidden;
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.07);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
        }

        .absolute-pitch-timer-bar {
            width: 100%;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, rgba(255,255,255,0.88), rgba(136, 220, 255, 0.86), rgba(122, 155, 255, 0.72));
            box-shadow:
                0 0 16px rgba(255,255,255,0.14),
                0 0 24px rgba(101, 188, 255, 0.14);
            transform-origin: left center;
            transition: transform 0.08s linear, background 0.18s ease;
        }

        .absolute-pitch-timer-bar.warning {
            background: linear-gradient(90deg, rgba(255,214,148,0.9), rgba(255,116,116,0.84));
            box-shadow: 0 0 14px rgba(255, 112, 112, 0.16);
        }

        .absolute-pitch-actions {
            display: flex;
            gap: 12px;
            margin-top: 22px;
            flex-wrap: wrap;
        }

        .absolute-pitch-mode-switch {
            display: inline-flex;
            padding: 4px;
            border-radius: 999px;
            background: rgba(255,255,255,0.045);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
        }

        .absolute-pitch-button {
            border: 1px solid rgba(255,255,255,0.09);
            background: rgba(255,255,255,0.05);
            color: #fff;
            border-radius: 999px;
            padding: 12px 18px;
            cursor: pointer;
            font-size: 12px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
        }

        .absolute-pitch-button:hover {
            transform: translateY(-2px);
            border-color: rgba(255,255,255,0.18);
            background: rgba(255,255,255,0.085);
            box-shadow: 0 0 14px rgba(255,255,255,0.06);
        }

        .absolute-pitch-button.primary {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05)),
                linear-gradient(135deg, rgba(120, 245, 255, 0.16), rgba(109, 124, 255, 0.06));
            border-color: rgba(255,255,255,0.18);
            box-shadow: 0 0 20px rgba(105, 187, 255, 0.08);
        }

        .absolute-pitch-button.mode-button {
            background: transparent;
            border-color: transparent;
            min-width: 96px;
        }

        .absolute-pitch-button.mode-button.is-selected {
            background: rgba(255,255,255,0.11);
            border-color: rgba(255,255,255,0.12);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.05),
                0 0 14px rgba(255,255,255,0.04);
        }

        .absolute-pitch-answer-grid {
            margin-top: 24px;
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 14px;
        }

        .absolute-pitch-answer {
            min-height: 88px;
            border-radius: 24px;
            border: 1px solid rgba(255,255,255,0.09);
            background:
                linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
                rgba(24, 28, 33, 0.92);
            color: #fff;
            font-size: 22px;
            font-weight: 700;
            cursor: pointer;
            transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.04),
                0 10px 24px rgba(0,0,0,0.12);
        }

        .absolute-pitch-answer-primary {
            display: block;
            font-size: 24px;
            font-weight: 800;
            line-height: 1.1;
        }

        .absolute-pitch-answer-secondary {
            display: block;
            margin-top: 8px;
            font-size: 12px;
            font-weight: 500;
            color: rgba(255,255,255,0.56);
            letter-spacing: 0.1em;
            text-transform: uppercase;
        }

        .absolute-pitch-answer:hover:not(:disabled) {
            transform: translateY(-4px);
            border-color: rgba(255,255,255,0.18);
            background:
                linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.018)),
                rgba(30, 35, 40, 0.96);
            box-shadow:
                0 0 0 1px rgba(95, 219, 255, 0.14),
                0 0 18px rgba(63, 143, 255, 0.12),
                0 18px 30px rgba(0,0,0,0.18);
            filter: brightness(1.03);
        }

        .absolute-pitch-answer:disabled {
            opacity: 0.55;
            cursor: default;
        }

        .absolute-pitch-answer.correct {
            background:
                linear-gradient(180deg, rgba(113, 195, 142, 0.24), rgba(89, 158, 116, 0.18)),
                rgba(35, 65, 46, 0.74);
            border-color: rgba(148, 212, 173, 0.38);
        }

        .absolute-pitch-answer.selected {
            background:
                linear-gradient(180deg, rgba(118, 162, 214, 0.22), rgba(81, 110, 180, 0.18)),
                rgba(29, 39, 63, 0.78);
            border-color: rgba(180, 203, 232, 0.34);
            box-shadow:
                0 0 0 1px rgba(164, 216, 255, 0.12),
                0 0 16px rgba(86, 170, 255, 0.14);
        }

        .absolute-pitch-answer.wrong {
            background:
                linear-gradient(180deg, rgba(182, 104, 118, 0.22), rgba(151, 88, 97, 0.18)),
                rgba(61, 31, 38, 0.76);
            border-color: rgba(212, 156, 166, 0.34);
        }

        .absolute-pitch-results {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 14px;
            margin-top: 24px;
        }

        .absolute-pitch-result-box {
            padding: 20px;
            border-radius: 24px;
            background:
                linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
                rgba(17, 21, 25, 0.86);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.04),
                0 12px 22px rgba(0,0,0,0.12);
        }

        .absolute-pitch-result-label {
            font-size: 11px;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.46);
        }

        .absolute-pitch-result-value {
            margin-top: 8px;
            font-size: clamp(28px, 2.6vw, 36px);
            font-weight: 700;
        }

        .absolute-pitch-result-note {
            margin-top: 8px;
            color: rgba(255,255,255,0.62);
            font-size: 14px;
            line-height: 1.65;
        }

        @media (max-height: 920px) {
            #mode-screen {
                padding: 20px 24px;
            }

            #mode-screen .mode-panel::before {
                inset: auto 0 92px;
            }

            .mode-panel {
                gap: 24px;
            }

            .mode-header {
                gap: 14px;
            }

            .mode-title-main {
                font-size: clamp(34px, 4.2vw, 56px);
            }

            .mode-grid {
                gap: 14px;
            }

            .mode-card {
                min-height: 250px;
                padding: 24px 20px 18px;
            }

            #absolute-pitch-ui {
                inset: 78px 20px 18px;
                align-items: flex-start;
                overflow-y: auto;
            }

            .absolute-pitch-panel {
                padding: 24px;
            }

            .absolute-pitch-panel::after {
                inset: auto 24px 108px;
            }

            .absolute-pitch-shell {
                gap: 20px;
            }

            .absolute-pitch-intro {
                gap: 14px;
                padding-top: 2px;
            }

            .absolute-pitch-title {
                font-size: clamp(30px, 3.6vw, 46px);
            }

            .absolute-pitch-copy {
                font-size: 14px;
                line-height: 1.68;
            }

            .absolute-pitch-card {
                padding: 22px;
            }

            .absolute-pitch-prompt {
                font-size: clamp(24px, 2.6vw, 34px);
            }

            .absolute-pitch-subprompt {
                font-size: 14px;
                line-height: 1.68;
            }

            .absolute-pitch-actions {
                margin-top: 18px;
            }

            .absolute-pitch-answer-grid {
                margin-top: 20px;
                gap: 12px;
            }

            .absolute-pitch-answer {
                min-height: 74px;
            }

            .absolute-pitch-answer-primary {
                font-size: 21px;
            }

            .absolute-pitch-results {
                margin-top: 20px;
            }
        }

        @media (max-width: 1100px) {
            .mode-grid {
                width: min(760px, 100%);
            }

            .mode-panel {
                width: min(900px, 100%);
            }

            .absolute-pitch-header {
                grid-template-columns: 1fr;
            }
        }

        @media (min-width: 1600px) {
            #mode-screen {
                padding: 48px 64px;
            }

            .mode-panel {
                width: min(1460px, calc(100vw - 128px));
                gap: 40px;
            }

            .mode-header {
                max-width: 980px;
            }

            .mode-title {
                gap: 12px;
            }

            .mode-title-main {
                font-size: clamp(50px, 3.8vw, 78px);
            }

            .mode-grid {
                gap: 24px;
                width: min(1080px, 100%);
            }

            .mode-card {
                min-height: 348px;
                padding: 32px 28px 24px;
            }

            #playback-screen.theme-selecting #theme-panel {
                width: min(1560px, calc(100vw - 120px));
                top: clamp(280px, 31vh, 400px);
                grid-template-columns: minmax(720px, 1.15fr) minmax(500px, 0.85fr);
                gap: 64px;
            }

            #playback-screen.theme-selecting .theme-list-item {
                min-height: 112px;
                padding: 0 28px 14px 28px;
                font-size: clamp(24px, 1.5vw, 34px);
            }



            #playback-screen.theme-selecting .theme-preview {
                margin-left: 0;
                gap: 20px;
            }


            #playback-screen.theme-selecting .theme-preview-title {
                font-size: clamp(30px, 1.8vw, 40px);
            }


            #playback-screen.theme-selecting .theme-preview-description {
                font-size: 20px;
                line-height: 1.55;
            }

        }

        @media (max-width: 820px) {
            #mode-screen {
                padding: 24px 18px;
            }

            #playback-screen {
                padding: max(12px, env(safe-area-inset-top, 0px) + 12px) 12px 0;
            }

            .floating-symbol {
                opacity: 0.72;
            }

            .mode-grid {
                grid-template-columns: 1fr;
            }

            .mode-card {
                min-height: 220px;
            }

            .mode-panel::after {
                display: none;
            }

            .mode-header {
                max-width: none;
                gap: 14px;
            }

            .mode-eyebrow {
                gap: 8px;
                padding: 7px 12px;
                letter-spacing: 0.18em;
            }

            .mode-eyebrow::before,
            .mode-eyebrow::after {
                width: 16px;
            }

            .mode-title {
                gap: 8px;
            }

            .mode-title-main {
                font-size: clamp(32px, 9vw, 48px);
                line-height: 1.08;
                white-space: normal;
            }

            .mode-header-meta {
                gap: 8px;
                font-size: 10px;
                letter-spacing: 0.14em;
            }

            .mode-header-meta span {
                padding: 0 8px;
            }

            #theme-panel {
                left: 12px;
                top: 68px;
                width: calc(100vw - 24px);
                grid-template-columns: 1fr;
                gap: 10px;
                padding: 12px;
            }

            #playback-screen.theme-selecting #theme-panel {
                width: calc(100vw - 24px);
                top: 58px;
                left: 12px;
                grid-template-columns: 1fr;
                gap: 16px;
                transform: none;
            }


            #theme-panel.is-transitioning.is-exiting {
                animation: theme-panel-exit-select-mobile 0.34s ease forwards;
            }

            #playback-screen.theme-selecting .theme-list-item {
                min-height: 68px;
                padding: 0 12px 8px 12px;
                font-size: clamp(17px, 4.8vw, 24px);
            }


            #playback-screen.theme-selecting .theme-preview-description {
                font-size: 16px;
            }


            #playback-screen.theme-selecting .theme-preview {
                margin-left: 0;
            }


            .theme-preview-title {
                font-size: 18px;
            }

            #bottom-ui {
                width: calc(100% - 24px);
                left: 12px;
                transform: none;
                bottom: 12px;
                flex-direction: column;
                height: auto;
            }

            #key-panel {
                width: 100%;
                height: auto;
            }

            #piano-container {
                min-height: 116px;
            }

            #record-slots {
                width: 100%;
                height: 148px;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                grid-template-rows: repeat(2, minmax(0, 1fr));
            }

            .record-slot-button {
                justify-self: center;
                width: min(100%, 62px);
            }

            .record-slot-status {
                width: 100%;
                text-align: center;
                font-size: 9px;
                letter-spacing: 0.04em;
            }

            #absolute-pitch-ui {
                inset: 82px 12px 12px;
            }

            .absolute-pitch-panel {
                padding: 20px;
            }


            .absolute-pitch-panel::after {
                inset: auto 20px 118px;
            }

            .absolute-pitch-shell {
                gap: 20px;
            }

            .absolute-pitch-card {
                padding: 20px;
            }

            .absolute-pitch-card-top {
                grid-template-columns: 1fr;
                align-items: start;
            }

            .absolute-pitch-live-status {
                min-width: 0;
            }

            .absolute-pitch-prompt {
                max-width: none;
            }

            .absolute-pitch-stats,
            .absolute-pitch-results,
            .absolute-pitch-answer-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
