:root {
  color-scheme: dark;
  --ink: #f1ede3;
  --muted: #bcc0c5;
  --gold: #e7c978;
  --panel: rgba(20, 25, 39, .72);
  --line: rgba(229, 226, 216, .18);
  --serif: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

.practice-layout { display: flex; align-items: stretch; gap: 15px; }
.practice-layout .stage-wrap { flex: 1 1 auto; min-width: 0; }
.online-panel { flex: 0 0 266px; width: 266px; margin-top: 15px; padding: 13px; border: 1px solid rgba(229,218,185,.24); background: rgba(22,30,43,.72); }
.online-panel[hidden], .song-options[hidden] { display: none; }
.online-panel-head { display: flex; align-items: center; gap: 8px; color: #efe3bf; font-size: 12px; }
.online-panel-head span { color: #e7c978; }
.online-panel p { color: #c2c9c3; font-size: 10px; line-height: 1.65; }
.online-panel iframe { display: block; width: 100%; height: 200px; border: 0; background: #111; }
.online-panel a { color: #ebd8a7; font-size: 10px; }
.online-help { margin-top: 12px; }
.song-options { margin-top: 19px; padding-top: 17px; border-top: 1px solid rgba(229,226,216,.18); }
.song-actions { display: grid; gap: 6px; margin-top: 11px; }
.song-actions button { padding: 6px 8px; text-align: left; color: #e7e5dc; background: rgba(255,255,255,.04); border: 1px solid rgba(226,224,215,.18); border-radius: 3px; font-size: 11px; }
.song-actions button.selected { color: #f6e3aa; border-color: rgba(233,207,142,.66); background: rgba(184,160,100,.14); }
.song-options p { color: #aeb8bb; font-size: 10px; line-height: 1.6; }
.song-options label { color: #e6e4dc; font-size: 11px; }
.song-options label span { color: #aeb8bb; }
.song-options input { width: 64px; margin-left: 6px; padding: 3px 5px; color: #f1ede3; background: rgba(20,25,38,.65); border: 1px solid rgba(226,224,215,.3); border-radius: 3px; }
@media (max-width: 650px) {
  .practice-layout { flex-wrap: wrap; }
  .practice-layout .stage-wrap { flex-basis: 100%; }
  .online-panel { flex-basis: 100%; width: 100%; margin-top: 0; }
  .online-panel iframe { max-width: 420px; }
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #1d2736; }
body { margin: 0; min-width: 720px; color: var(--ink); font: 14px/1.5 var(--serif); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #f7d782; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.game-frame {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 13% 109%, rgba(118, 119, 164, .38), transparent 38%),
    radial-gradient(ellipse at 62% 118%, rgba(101, 148, 137, .33), transparent 40%),
    linear-gradient(165deg, #20283a 0%, #242d40 44%, #344653 100%);
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 26px;
  background: rgba(20, 26, 39, .80);
  border-bottom: 1px solid rgba(225, 223, 211, .10);
}
.brand { width: 198px; flex: none; display: flex; align-items: center; gap: 12px; }
.brand-emblem { width: 37px; height: 37px; flex: none; border: 2px solid #dad7c9; border-radius: 50%; display: grid; place-items: center; color: #e5dfcf; background: rgba(239, 233, 213, .08); box-shadow: inset 0 0 0 3px rgba(237, 232, 217, .1); }
.brand-emblem span { font-size: 18px; line-height: 1; }
.brand-copy { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand-copy strong { font-size: 16px; letter-spacing: .04em; font-weight: 700; }
.brand-copy span { color: #c7c5c2; font-size: 12px; border-left: 1px solid #777c85; padding-left: 9px; }
.top-transport { min-width: 0; flex: 1; display: flex; align-items: center; gap: 17px; }
.play-button, .reset-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid rgba(241, 234, 218, .34); border-radius: 25px;
  white-space: nowrap; font-weight: 700; font-size: 12px; transition: background .15s, border-color .15s;
}
.play-button { min-width: 112px; height: 37px; color: #283447; background: #ece8dc; }
.play-button:hover { background: #fffaf0; border-color: #fff6de; }
.play-icon { font-size: 12px; }
.reset-button { height: 37px; padding: 0 15px; color: #edeae1; background: rgba(25, 31, 45, .5); }
.reset-button:hover { background: rgba(255, 255, 255, .12); }
.reset-button span { font-size: 21px; line-height: 1; font-weight: 400; }
.timeline { flex: 1; min-width: 100px; }
.timeline-labels { display: flex; justify-content: space-between; margin-bottom: 7px; color: #d7d7d2; font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-track { height: 4px; border-radius: 5px; background: rgba(236, 235, 224, .28); overflow: hidden; }
.progress-track div { width: 0; height: 100%; background: #efcf78; }
.top-note { display: flex; gap: 7px; align-items: center; white-space: nowrap; color: #bac0c5; font-size: 10px; }
kbd { padding: 3px 5px; border: 1px solid #abaea9; border-radius: 3px; color: #e3e2da; font: 10px var(--serif); }

.app-shell { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 212px minmax(390px, 1fr) 285px; }
.sidebar {
  display: flex; flex-direction: column;
  padding: 26px 21px 21px;
  background: linear-gradient(90deg, rgba(20, 24, 38, .65), rgba(25, 30, 43, .38));
  border-right: 1px solid rgba(232, 231, 220, .10);
}
.section-caption { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #e1dfd9; }
.section-caption span { height: 16px; width: 3px; background: #d8c698; }
.sidebar-track { padding: 22px 0 0; }
.record-art { height: 116px; display: flex; justify-content: center; align-items: center; }
.record-inner { width: 110px; height: 110px; border-radius: 50%; border: 3px solid rgba(224, 214, 191, .75); display: grid; place-items: center; background: radial-gradient(circle, #626b7b 0 20%, #374555 21% 32%, #50647a 33% 34%, #273447 35% 56%, #667180 57% 58%, #344455 59% 100%); box-shadow: 0 0 0 4px rgba(228, 219, 197, .12), 0 12px 32px rgba(0,0,0,.18); }
.record-inner span { display: grid; place-items: center; width: 39px; height: 39px; color: #efe4c8; border-radius: 50%; background: rgba(26, 34, 48, .7); font: 28px/1 Georgia, serif; }
.track-kind { display: inline-block; margin-top: 18px; padding: 2px 10px; border-radius: 2px; color: #f4e7d3; background: #9a7465; font-size: 10px; }
.side-track-title { margin-top: 7px; font-weight: 700; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.side-track-sub { color: #b6bbc1; font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }
.track-rule, .side-divider { height: 1px; background: linear-gradient(90deg, rgba(225,225,220,.32), rgba(225,225,220,.04)); }
.track-rule { margin: 15px 0 10px; }
.track-data { display: flex; justify-content: space-between; margin: 8px 0; color: #b7bdc3; font-size: 11px; }
.track-data strong { color: #ece9df; font-weight: 600; }
.side-divider { margin: 21px 0; }
.side-actions { display: grid; gap: 5px; margin-top: 13px; }
.side-actions button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 2px; border: 0; background: transparent; text-align: left; color: #e9e7df; font-size: 11px; }
.side-actions button:hover { color: #ffe6a1; }
.action-icon { display: grid; place-items: center; flex: none; width: 25px; height: 25px; color: #303847; background: #eae6da; border-radius: 50%; font: 17px/1 Georgia, serif; }
.action-arrow { margin-left: auto; color: #a8aaab; font-size: 20px; }
.sidebar-bottom { margin-top: auto; padding-top: 20px; color: #aeb5b8; font-size: 10px; line-height: 1.8; }
.sidebar-bottom span { color: #8e9ba0; }

.workspace { min-width: 0; padding: 23px 21px 14px; }
.practice-card { min-width: 0; }
.card-head { min-height: 52px; display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.track-heading h1 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: .02em; }
.track-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 7px; color: #bcc1c4; font-size: 11px; }
.track-meta i { width: 3px; height: 3px; border-radius: 50%; background: #a7b0b3; }
.practice-label { display: flex; align-items: center; gap: 7px; padding: 4px 10px; border: 1px solid rgba(232, 218, 183, .30); border-radius: 16px; color: #eee8d9; white-space: nowrap; font-size: 11px; }
.small-star { color: #e8cd8a; font-size: 10px; }
.stage-wrap {
  position: relative; height: clamp(420px, calc(100vh - 218px), 750px); margin-top: 15px;
  overflow: hidden; border: 1px solid rgba(226, 230, 227, .13); border-radius: 3px;
  background: radial-gradient(ellipse at 50% 92%, rgba(142, 180, 155, .28), transparent 43%), radial-gradient(ellipse at 12% 92%, rgba(81, 119, 112, .22), transparent 45%), linear-gradient(180deg, #27334c 0%, #344658 50%, #496a64 100%);
  box-shadow: inset 0 0 90px rgba(11, 19, 33, .2);
}
.stage-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 17% 21%, rgba(255,255,255,.18) 0 1px, transparent 2px), radial-gradient(circle at 81% 34%, rgba(255,255,255,.13) 0 1px, transparent 2px); background-size: 133px 113px, 197px 161px; opacity: .42; pointer-events: none; }
.stage-wrap::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -20%; height: 34%; border-radius: 50%; border: 1px solid rgba(235, 220, 164, .14); box-shadow: 0 -10px 75px rgba(210, 191, 131, .08); pointer-events: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-top { position: absolute; top: 15px; left: 18px; right: 18px; display: flex; align-items: start; justify-content: space-between; color: rgba(240, 239, 230, .76); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
.completion-track { position:absolute; z-index:1; top:0; left:0; right:0; height:4px; background:rgba(235,230,210,.13); overflow:hidden; pointer-events:none; }
.completion-track > div { width:0; height:100%; background:linear-gradient(90deg,#e1bd69,#ffdf85); box-shadow:0 0 8px rgba(255,218,125,.65); transition:width .10s linear; }
.performance-display { display:flex; flex-direction:column; align-items:flex-start; gap:2px; line-height:1.2; text-shadow:0 2px 5px rgba(16,22,33,.55); }
.performance-display > span { color:rgba(240,239,230,.82); font-size:10px; }
.performance-display strong { color:#f8dc83; font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; }
.performance-display em { font-size:13px; font-style:normal; font-weight:600; }
.stage-status { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.stage-mode { color: rgba(232, 232, 221, .72); }
.combo-display { position: absolute; left: 50%; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; text-shadow: 0 2px 5px rgba(19,28,35,.5); }
.combo-display strong { color: #f6e9bf; font-family: Georgia, serif; font-size: 27px; font-weight: 400; line-height: 1; }
.combo-display span { font-size: 10px; margin-top: 3px; color: #e9e8de; }
.stage-hint { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; text-shadow: 0 2px 8px #273642; pointer-events: none; transition: opacity .2s; }
.stage-hint.hidden { opacity: 0; }
.hint-diamond { color: #eedb9e; font-size: 17px; margin-bottom: 9px; }
.stage-hint strong { color: #f3eee0; font-size: 17px; letter-spacing: .1em; }
.stage-hint span:last-child { color: #d2d9d3; font-size: 11px; margin-top: 6px; }
.feedback { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); opacity: 0; pointer-events: none; color: #ffdf85; font-size: 18px; font-weight: 700; text-shadow: 0 0 9px rgba(255,206,100,.7), 0 2px 3px #473c35; transition: opacity .15s; }
.feedback.visible { opacity: 1; }
.stage-foot { position: absolute; left: 18px; right: 18px; bottom: 12px; display: flex; justify-content: space-between; color: rgba(235, 239, 225, .67); font-size: 10px; pointer-events: none; }
.under-stage { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.stats { display: flex; gap: 35px; }
.stats > div { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.stats span { color: #b7c1c3; font-size: 11px; }
.stats strong { color: #f4efdf; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats small { font-size: 11px; color: #c8ceca; font-weight: 400; }
.practice-tip { color: #b3bec0; text-align: right; font-size: 10px; }
.practice-tip span { color: #e2ca85; font-size: 8px; margin-right: 5px; }
.message { min-height: 18px; color: #ffd4ac; font-size: 11px; }
.message.success { color: #e9dcaf; }

.control-column { padding: 25px 21px 18px; border-left: 1px solid rgba(232, 231, 220, .12); background: linear-gradient(90deg, rgba(22, 27, 40, .40), rgba(18, 22, 35, .72)); }
.controls-head { display: flex; align-items: center; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.settings-glyph { width: 31px; height: 31px; border: 1px solid #cfc6ac; border-radius: 50%; display: grid; place-items: center; color: #eadcb8; font-size: 14px; }
.controls-head h2 { margin: 0; font-size: 16px; letter-spacing: .04em; }
.controls-head p { margin: 1px 0 0; color: #9ba5ac; letter-spacing: .12em; font-size: 8px; }
.panel { padding: 18px 0; border-bottom: 1px solid var(--line); }
.panel:last-child { border: 0; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.panel-title h3 { margin: 0; font-size: 13px; }
.panel-title > span { font-size: 10px; color: #aab0b4; }
.range-block + .range-block { margin-top: 14px; }
.range-label, .setting-label { display: flex; align-items: center; justify-content: space-between; color: #d9dbd7; font-size: 11px; }
.range-label output, .setting-label strong { font-size: 11px; color: #f2e8ce; font-weight: 600; font-variant-numeric: tabular-nums; }
.range-point { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; border: 1px solid #d7c493; color: #f1deb0; border-radius: 50%; font-size: 10px; }
input[type="range"] { display: block; appearance: none; width: 100%; height: 4px; margin: 13px 0 7px; border: 0; border-radius: 4px; background: rgba(227, 229, 220, .35); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border: 2px solid #e9e4d8; border-radius: 2px; background: #c0aa7a; transform: rotate(45deg); box-shadow: 0 1px 4px #161b25; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #e9e4d8; border-radius: 2px; background: #c0aa7a; transform: rotate(45deg); }
.loop-row, .offset-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.loop-row strong, .offset-row strong { display: block; font-size: 11px; color: #e8e7df; font-weight: 600; }
.loop-row small, .offset-row small { display: block; margin-top: 3px; color: #adb5b8; font-size: 10px; }
.switch { position: relative; display: block; width: 37px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span:not(.sr-only) { position: absolute; inset: 0; border: 1px solid #d4ccbc; border-radius: 14px; background: rgba(17,21,31,.55); }
.switch span:not(.sr-only)::before { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: #e7e1d4; transition: transform .15s; }
.switch input:checked + span { background: #9b865f; }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid #f7d782; outline-offset: 3px; }
.segments { display: flex; gap: 5px; margin-top: 9px; }
.segments button { flex: 1; min-width: 0; padding: 6px 0; border: 1px solid rgba(226,224,215,.25); border-radius: 15px; color: #e4e2da; background: rgba(21,26,39,.5); font-size: 10px; }
.segments button:hover { border-color: #e6d3a4; }
.segments button.selected { color: #313947; border-color: #eee7d7; background: #eae5d9; font-weight: 700; }
.scroll-label { margin-top: 18px; }
.offset-row { padding-top: 12px; border-top: 1px solid rgba(227,229,220,.10); }
.offset-input { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border: 1px solid rgba(226,224,215,.25); border-radius: 13px; background: rgba(21,26,39,.5); color: #c3c6c2; font-size: 10px; }
.offset-input input { width: 42px; border: 0; background: transparent; color: #f0e9da; text-align: right; font-size: 11px; }
.key-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.key-grid button { height: 28px; padding: 0; border: 1px solid #dedcd3; border-radius: 3px; color: #343c4b; background: #ece9df; font-weight: 700; font-size: 11px; }
.key-grid button:hover, .key-grid button.listening { background: #f3d895; border-color: #fff0c7; }
.key-help { margin: 9px 0 0; color: #aeb8bb; font-size: 10px; }

@media (max-width: 1150px) {
  .app-shell { grid-template-columns: 175px minmax(360px, 1fr) 250px; }
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .workspace { padding-left: 15px; padding-right: 15px; }
  .control-column { padding-left: 16px; padding-right: 16px; }
  .top-note { display: none; }
  .brand { width: 153px; }
  .stats { gap: 18px; }
}
@media (max-width: 850px) {
  body { min-width: 0; }
  .topbar { gap: 12px; padding: 0 15px; }
  .brand { width: auto; }
  .brand-copy span, .reset-button { display: none; }
  .app-shell { grid-template-columns: minmax(0, 1fr) 240px; }
  .sidebar { grid-column: 1 / -1; display: block; padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .sidebar > .section-caption, .record-art, .track-rule, .track-data, .side-divider, .sidebar-bottom { display: none; }
  .sidebar-track { display: inline-flex; align-items: center; gap: 10px; padding: 0; }
  .track-kind, .side-track-title, .side-track-sub { margin: 0; }
  .side-actions { display: inline-flex; margin: 0 0 0 20px; gap: 12px; }
  .side-actions button { width: auto; }
  .action-arrow { display: none; }
  .stage-wrap { height: 480px; }
  .practice-tip { display: none; }
}
@media (max-width: 650px) {
  .brand-copy { display: none; }
  .app-shell { display: block; }
  .sidebar { display: flex; flex-wrap: wrap; gap: 10px; }
  .side-actions { margin-left: 0; flex-wrap: wrap; }
  .workspace { padding: 18px 14px 0; }
  .control-column { border-left: 0; padding: 15px 20px; }
  .controls-head { padding-bottom: 12px; }
  .stage-wrap { height: 410px; }
}

@media (max-height: 780px) and (min-width: 851px) {
  .stage-wrap { height: clamp(400px, calc(100vh - 240px), 750px); }
  .sidebar { padding-top: 20px; }
  .record-art { height: 95px; }
  .record-inner { width: 90px; height: 90px; }
  .track-kind { margin-top: 12px; }
  .side-divider { margin: 14px 0; }
  .control-column { padding-top: 17px; }
  .controls-head { padding-bottom: 12px; }
  .panel { padding: 11px 0; }
  .panel-title { margin-bottom: 11px; }
  .range-block + .range-block { margin-top: 9px; }
  .loop-row { margin-top: 10px; }
  .scroll-label { margin-top: 12px; }
  .offset-row { margin-top: 9px; padding-top: 9px; }
  .key-help { margin-top: 7px; }
}


/* Theme choice stays beside the score so the practice settings retain their space. */
.theme-picker { display:flex; align-items:center; gap:9px; flex:none; margin-top:2px; white-space:nowrap; }
.theme-picker label { color:#d6d8d2; font-size:11px; }
.theme-picker label span { color:#e8cd8a; margin-right:3px; }
.theme-picker select { width:132px; height:30px; padding:0 25px 0 11px; border:1px solid rgba(232,218,183,.38); border-radius:16px; color:#f3eee1; background:#303a4a; cursor:pointer; font-size:11px; }
.theme-picker select:hover { border-color:#ebd4a1; }
.theme-picker option { background:#303a4a; color:#f3eee1; }
.stage-wrap[data-theme="wind"] { background:radial-gradient(ellipse at 50% 92%,rgba(150,224,194,.36),transparent 48%),radial-gradient(ellipse at 10% 42%,rgba(98,190,177,.16),transparent 42%),linear-gradient(180deg,#243c4c 0%,#315a62 55%,#54867a 100%); }
.stage-wrap[data-theme="geo"] { background:radial-gradient(ellipse at 50% 92%,rgba(218,168,82,.33),transparent 48%),radial-gradient(ellipse at 90% 30%,rgba(192,143,74,.16),transparent 46%),linear-gradient(180deg,#383442 0%,#5a4b47 55%,#836851 100%); }
.stage-wrap[data-theme="electro"] { background:radial-gradient(ellipse at 50% 92%,rgba(178,126,225,.33),transparent 48%),radial-gradient(ellipse at 90% 30%,rgba(186,123,212,.18),transparent 46%),linear-gradient(180deg,#302e4a 0%,#4b3d63 55%,#675378 100%); }
.stage-wrap[data-theme="hydro"] { background:radial-gradient(ellipse at 50% 92%,rgba(128,205,231,.34),transparent 48%),radial-gradient(ellipse at 10% 40%,rgba(98,166,220,.19),transparent 42%),linear-gradient(180deg,#203849 0%,#31546d 55%,#4a7d92 100%); }
.stage-wrap[data-theme="pyro"] { background:radial-gradient(ellipse at 50% 95%,rgba(236,136,77,.33),transparent 48%),radial-gradient(ellipse at 90% 40%,rgba(220,101,71,.16),transparent 44%),linear-gradient(180deg,#3d303c 0%,#613f40 55%,#8d5949 100%); }
.stage-wrap[data-theme="dendro"] { background:radial-gradient(ellipse at 50% 92%,rgba(178,214,119,.31),transparent 48%),radial-gradient(ellipse at 8% 36%,rgba(119,174,119,.18),transparent 42%),linear-gradient(180deg,#30403f 0%,#485d4a 55%,#71835b 100%); }
.stage-wrap[data-theme="dream"] { background:radial-gradient(ellipse at 50% 49%,rgba(216,232,172,.22),transparent 40%),radial-gradient(ellipse at 50% 100%,rgba(197,219,159,.29),transparent 48%),linear-gradient(180deg,#394747 0%,#627364 55%,#87957a 100%); }
.stage-wrap[data-theme="frost"] { background:radial-gradient(ellipse at 83% 25%,rgba(207,225,250,.20),transparent 34%),radial-gradient(ellipse at 50% 95%,rgba(154,179,216,.28),transparent 47%),linear-gradient(180deg,#292f49 0%,#3c4b69 55%,#60728f 100%); }
@media (max-width:650px) {
  .theme-picker { gap:5px; }
  .theme-picker label { font-size:10px; }
  .theme-picker select { width:112px; }
}

/* Performance view: full-screen scene, quiet HUD, and an on-demand practice drawer. */
html { background:#192638; }
body { min-width:0; }
.game-frame { position:relative; min-height:600px; height:100vh; overflow:hidden; background:#1a283a; }
.topbar { position:absolute; z-index:10; inset:0 0 auto; height:72px; padding:0 32px; gap:24px; border:0; background:linear-gradient(180deg,rgba(13,21,34,.82),rgba(16,25,38,.45) 72%,transparent); }
.brand { width:auto; min-width:200px; }
.brand-emblem { width:36px; height:36px; border-color:rgba(249,244,226,.8); background:rgba(30,41,55,.32); }
.brand-copy strong { color:#f5f2e8; }
.brand-copy span { color:#d9ddd6; border-color:rgba(233,233,220,.45); }
.top-transport { justify-content:flex-end; gap:16px; }
.timeline { flex:0 1 260px; min-width:100px; }
.timeline-labels { color:#e7e9e2; }
.progress-track { background:rgba(240,238,222,.28); }
.play-button { min-width:112px; height:36px; color:#303948; background:#ece8dc; border-color:rgba(255,252,239,.7); box-shadow:0 2px 10px rgba(5,11,17,.16); }
.reset-button { height:36px; background:rgba(18,28,41,.3); border-color:rgba(244,241,228,.45); }
.tools-toggle { display:flex; align-items:center; gap:8px; flex:none; padding:0; border:0; color:#f3f1e9; background:transparent; font-size:12px; font-weight:700; white-space:nowrap; }
.tools-toggle:hover { color:#f7d993; }
.tools-orb { display:grid; place-items:center; width:34px; height:34px; border:1px solid rgba(245,241,225,.68); border-radius:50%; background:rgba(30,41,54,.45); color:#f4e7c7; font-size:15px; }
.tools-toggle:hover .tools-orb { border-color:#f4d995; background:rgba(229,211,159,.16); }
.app-shell { position:relative; display:block; height:100%; min-height:600px; }
.workspace { position:absolute; inset:0; padding:0; }
.practice-card { position:absolute; inset:0; }
.card-head { position:absolute; z-index:4; top:94px; left:40px; right:40px; min-height:0; align-items:flex-start; pointer-events:none; }
.track-heading { max-width:min(350px,38vw); text-shadow:0 2px 8px rgba(8,15,24,.75); }
.track-heading h1 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#fffdf3; font-size:17px; font-weight:700; }
.track-meta { margin-top:5px; color:rgba(238,241,232,.82); }
.theme-picker { pointer-events:auto; margin:2px 0 0; padding:4px 0 4px 12px; border-radius:20px; background:rgba(19,32,47,.30); text-shadow:0 1px 4px rgba(8,15,24,.65); }
.theme-picker label { color:#edf0e9; }
.theme-picker select { height:28px; background:rgba(28,41,56,.68); }
.stage-wrap[data-theme] {
  --theme-wash:rgba(22,42,54,.18);
  --theme-glow:rgba(180,207,184,.10);
  position:absolute; inset:0; width:100%; height:100%; margin:0; overflow:hidden; border:0; border-radius:0;
  background:
    linear-gradient(180deg,rgba(13,23,38,.36) 0%,rgba(15,27,39,.20) 46%,rgba(13,23,34,.48) 100%),
    radial-gradient(ellipse at 50% 90%,var(--theme-glow),transparent 58%),
    linear-gradient(var(--theme-wash),var(--theme-wash)),
    url("../assets/practice-terrace.webp") center center / cover no-repeat;
  box-shadow:inset 0 0 130px rgba(9,17,28,.25);
}
.stage-wrap[data-theme="wind"] { --theme-wash:rgba(20,100,81,.34); --theme-glow:rgba(110,224,176,.19); }
.stage-wrap[data-theme="geo"] { --theme-wash:rgba(112,67,30,.45); --theme-glow:rgba(225,172,89,.19); }
.stage-wrap[data-theme="electro"] { --theme-wash:rgba(80,40,108,.44); --theme-glow:rgba(190,145,235,.20); }
.stage-wrap[data-theme="hydro"] { --theme-wash:rgba(25,88,124,.37); --theme-glow:rgba(113,198,237,.19); }
.stage-wrap[data-theme="pyro"] { --theme-wash:rgba(123,52,33,.45); --theme-glow:rgba(245,145,85,.19); }
.stage-wrap[data-theme="dendro"] { --theme-wash:rgba(58,102,43,.40); --theme-glow:rgba(173,218,125,.20); }
.stage-wrap[data-theme="dream"] { --theme-wash:rgba(93,119,67,.36); --theme-glow:rgba(222,237,181,.19); }
.stage-wrap[data-theme="frost"] { --theme-wash:rgba(45,52,104,.40); --theme-glow:rgba(190,217,253,.18); }
.stage-wrap::before { opacity:.28; }
.stage-wrap::after { content:none; }
.completion-track { z-index:3; top:70px; height:3px; background:rgba(246,239,214,.14); }
.stage-top { z-index:3; top:151px; left:40px; right:40px; color:#eceee7; }
.performance-display > span { color:rgba(246,246,236,.86); }
.performance-display strong { font-size:18px; color:#ffe293; }
.performance-display em { font-size:14px; }
.combo-display { top:-50px; text-shadow:0 2px 9px rgba(8,15,23,.75); }
.combo-display strong { color:#fffdf3; font-size:34px; }
.combo-display span { color:#f4f1e6; }
.stage-status { text-shadow:0 2px 6px rgba(8,15,24,.7); }
.stage-hint { top:43%; text-shadow:0 2px 10px rgba(9,18,26,.85); }
.stage-hint strong { font-size:19px; }
.stage-hint span:last-child { color:#ecf0e7; }
.feedback { top:69%; }
.stage-foot { z-index:2; left:40px; right:40px; bottom:14px; color:rgba(246,246,234,.72); text-shadow:0 1px 5px rgba(10,18,26,.7); }
.under-stage { position:absolute; z-index:4; left:40px; right:40px; bottom:38px; min-height:0; pointer-events:none; text-shadow:0 2px 7px rgba(8,15,24,.8); }
.stats { gap:27px; }
.stats span, .practice-tip { color:rgba(239,242,233,.80); }
.stats strong { color:#fffdf2; }
.message { position:absolute; z-index:5; left:50%; bottom:82px; transform:translateX(-50%); min-height:0; max-width:min(90%,620px); padding:6px 15px; border-radius:20px; background:rgba(22,32,43,.68); color:#ffe1ba; white-space:nowrap; text-align:center; }
.message:empty { display:none; }
.message.success { color:#f7e7b7; }
.practice-layout { position:absolute; inset:0; }
.stage-wrap[data-theme].with-player { width:calc(100% - 302px); }
.online-panel { position:absolute; z-index:5; right:20px; top:172px; width:266px; margin:0; }
.tools-drawer .song-options { border-color:rgba(72,79,85,.18); }
.tools-drawer .song-actions button { color:#526068; background:rgba(255,255,249,.48); border-color:rgba(100,109,110,.3); }
.tools-drawer .song-actions button.selected { color:#695838; background:#f0e3c1; border-color:#b8a16d; }
.tools-drawer .song-options p { color:#717e80; }
.tools-drawer .song-options label { color:#526068; }
.tools-drawer .song-options label span { color:#899295; }
.tools-drawer .song-options input { color:#4c5861; background:rgba(255,255,249,.55); border-color:rgba(100,109,110,.3); }
@media (max-width:650px) {
  .stage-wrap[data-theme].with-player { width:calc(100% - 232px); }
  .online-panel { right:8px; width:218px; padding:8px; }
  .online-panel iframe { width:200px; }
}
.tools-drawer[hidden] { display:none; }
.tools-drawer { --line:rgba(72,79,85,.18); position:absolute; z-index:20; top:78px; right:26px; display:flex; flex-direction:column; width:min(610px,calc(100vw - 52px)); max-height:calc(100% - 100px); overflow:hidden; color:#394450; border:1px solid rgba(255,252,239,.8); border-radius:8px; background:linear-gradient(145deg,rgba(241,239,226,.98),rgba(221,225,218,.98)); box-shadow:0 18px 60px rgba(6,12,21,.40), inset 0 0 0 3px rgba(255,252,239,.28); }
.drawer-head { display:flex; justify-content:space-between; align-items:center; flex:none; padding:15px 22px 13px; border-bottom:1px solid rgba(74,83,88,.18); }
.drawer-head span { color:#8a806a; font-size:10px; letter-spacing:.1em; }
.drawer-head h2 { margin:2px 0 0; color:#37434f; font-size:17px; letter-spacing:.05em; }
.drawer-close { display:grid; place-items:center; width:31px; height:31px; border:1px solid #aeb3ab; border-radius:50%; background:rgba(255,255,248,.6); color:#58616b; font-size:22px; line-height:1; }
.drawer-close:hover { background:#fffdf1; }
.drawer-columns { display:grid; grid-template-columns:210px minmax(0,1fr); overflow-y:auto; min-height:0; }
.tools-drawer .sidebar { display:flex; padding:18px 20px; background:rgba(215,220,212,.40); border-right:1px solid rgba(82,90,90,.14); }
.tools-drawer .section-caption { color:#46515b; }
.tools-drawer .section-caption span { background:#b49a67; }
.tools-drawer .sidebar-track { padding-top:12px; }
.tools-drawer .record-art { height:88px; }
.tools-drawer .record-inner { width:80px; height:80px; border-color:rgba(129,125,108,.7); }
.tools-drawer .track-kind { margin-top:10px; background:#a28b73; color:#fffdf4; }
.tools-drawer .side-track-title { color:#3c4752; }
.tools-drawer .side-track-sub, .tools-drawer .track-data, .tools-drawer .sidebar-bottom, .tools-drawer .sidebar-bottom span { color:#778184; }
.tools-drawer .track-data strong { color:#4b5660; }
.tools-drawer .track-rule, .tools-drawer .side-divider { background:linear-gradient(90deg,rgba(79,88,87,.28),rgba(79,88,87,.04)); }
.tools-drawer .side-divider { margin:16px 0; }
.tools-drawer .side-actions { display:grid; gap:4px; margin:10px 0 0; }
.tools-drawer .side-actions button { width:100%; color:#48545d; font-size:11px; }
.tools-drawer .side-actions button:hover { color:#a07b3e; }
.tools-drawer .action-icon { background:#65717a; color:#f7f5eb; }
.tools-drawer .action-arrow { display:block; color:#9b9f98; }
.tools-drawer .control-column { padding:18px 22px; background:transparent; border:0; }
.tools-drawer .controls-head { padding-bottom:11px; border-color:rgba(72,79,85,.18); }
.tools-drawer .controls-head h2, .tools-drawer .panel-title h3 { color:#46515b; }
.tools-drawer .settings-glyph { color:#9b845c; border-color:#b7a98d; }
.tools-drawer .panel { padding:11px 0; border-color:rgba(72,79,85,.16); }
.tools-drawer .panel-title { margin-bottom:10px; }
.tools-drawer .panel-title > span, .tools-drawer .loop-row small, .tools-drawer .offset-row small, .tools-drawer .key-help { color:#899295; }
.tools-drawer .range-label, .tools-drawer .setting-label, .tools-drawer .loop-row strong, .tools-drawer .offset-row strong { color:#5a656c; }
.tools-drawer .range-label output, .tools-drawer .setting-label strong { color:#566169; }
.tools-drawer .range-point { border-color:#b7a47c; color:#907b55; }
.tools-drawer input[type="range"] { background:rgba(100,113,118,.25); }
.tools-drawer input[type="range"]::-webkit-slider-thumb { border-color:#fbfaf3; background:#ab946b; box-shadow:0 1px 4px rgba(44,50,52,.3); }
.tools-drawer .segments button { border-color:rgba(100,109,110,.3); color:#59656d; background:rgba(255,255,249,.45); }
.tools-drawer .segments button.selected { background:#68757e; border-color:#68757e; color:#fffdf5; }
.tools-drawer .offset-input { background:rgba(255,255,249,.45); border-color:rgba(100,109,110,.3); color:#6e7779; }
.tools-drawer .offset-input input { color:#4c5861; }
.tools-drawer .key-grid button { background:#f7f6ee; border-color:#c1c7c1; color:#4d5863; }
.tools-drawer .key-grid button:hover, .tools-drawer .key-grid button.listening { background:#f1dca7; }
@media (max-width:850px) {
  .game-frame { min-height:600px; }
  .app-shell { display:block; }
  .topbar { gap:12px; padding:0 18px; }
  .brand { min-width:0; }
  .brand-copy span { display:none; }
  .timeline { flex-basis:140px; }
  .reset-button { display:inline-flex; }
  .card-head { left:22px; right:22px; }
  .stage-top { left:22px; right:22px; }
  .under-stage { left:22px; right:22px; }
  .stage-foot { left:22px; right:22px; }
  .tools-drawer .sidebar > .section-caption { display:flex; }
  .tools-drawer .record-art { display:flex; }
  .tools-drawer .track-rule, .tools-drawer .side-divider { display:block; }
  .tools-drawer .track-data { display:flex; }
  .tools-drawer .sidebar-bottom { display:block; }
  .tools-drawer .sidebar-track { display:block; }
}
@media (max-width:650px) {
  .topbar { gap:9px; }
  .brand-copy, .timeline, .tools-label { display:none; }
  .brand { flex:none; }
  .top-transport { flex:1; gap:8px; }
  .reset-button { min-width:35px; width:35px; padding:0; font-size:0; }
  .reset-button span { font-size:21px; }
  .card-head { top:88px; }
  .track-heading { max-width:48vw; }
  .track-heading h1 { font-size:15px; }
  .theme-picker { gap:4px; padding-left:7px; }
  .theme-picker label { font-size:10px; }
  .theme-picker select { width:102px; padding-left:7px; }
  .stage-top { top:144px; }
  .combo-display { top:-42px; }
  .stage-mode { display:none; }
  .under-stage { bottom:39px; }
  .stats { gap:11px; }
  .stats > div { gap:4px; }
  .stats span, .stats small { font-size:10px; }
  .practice-tip { display:none; }
  .stage-foot { font-size:9px; }
  .tools-drawer { top:72px; right:12px; width:calc(100vw - 24px); max-height:calc(100% - 84px); }
  .drawer-columns { display:block; }
  .tools-drawer .sidebar { display:block; border-right:0; border-bottom:1px solid rgba(82,90,90,.14); }
  .tools-drawer .record-art, .tools-drawer .sidebar-bottom { display:none; }
  .tools-drawer .side-actions { display:grid; }
}

.hit-window-label { margin-top:14px; }
.setting-help { margin:3px 0 0; color:#899295; font-size:10px; }
.feedback[data-kind="miss"] { color:#ffd1c1; text-shadow:0 0 9px rgba(255,142,118,.55),0 2px 4px #463638; }
