:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #f1edf7;
  background: #08070b;
  --muted: #aaa2b7;
  --edge: #332c40;
  --accent: #d2baff;
  --panel: #100e15;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { color: #1d102c; background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-underline-offset: .25em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
input[type="range"] { accent-color: var(--accent); min-width: 0; margin: 0; }
.site-bar { background: #08070b; }
.site-inner { max-width: 1320px; margin: auto; min-height: 41px; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.back { color: #b5adbf; font-size: .85rem; }
.back:hover { color: var(--accent); }
.page { max-width: 1320px; margin: auto; padding: clamp(10px, 2vh, 25px) 24px 22px; }
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: .99; letter-spacing: -.04em; }
.heading p, .settings-head p { color: var(--muted); margin-top: 9px; line-height: 1.5; font-size: .9rem; }
.heading-actions, .play-actions { display: flex; align-items: center; gap: 8px; }
.control, select {
  border: 1px solid var(--edge); border-radius: 7px; background: #191420; color: #f1edf7;
  padding: 9px 13px; min-height: 39px; font-weight: 650; font-size: .83rem;
}
.control:hover:enabled, select:hover:enabled { border-color: #9a7dc4; background: #271e34; }
.control.primary { background: var(--accent); border-color: transparent; color: #1a0d2a; min-width: 83px; }
.control.primary:hover:enabled { background: #e4d3ff; }
.studio { border: 1px solid var(--edge); border-radius: 14px; background: var(--panel); overflow: hidden; }
.transport, .playback { display: flex; align-items: center; gap: 16px; padding: 12px 14px; }
.transport { justify-content: space-between; }
.modes { display: flex; flex: 0 0 auto; gap: 2px; background: #0d0b12; border: 1px solid #2b2335; padding: 3px; border-radius: 8px; }
.modes button { background: transparent; border: 0; color: #b9aec7; font-weight: 700; font-size: .8rem; padding: 8px 11px; border-radius: 5px; white-space: nowrap; }
.modes button:hover { color: white; }
.modes button[aria-pressed="true"] { color: var(--accent); background: #2d1e40; }
.song, .speed { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; min-width: 0; }
.song select { width: clamp(140px, 25vw, 300px); min-width: 0; text-overflow: ellipsis; }
.song { flex-wrap: wrap; justify-content: flex-end; }
.song .control { white-space: nowrap; }
#save-song { border-color: #70578e; }
#song-library-status { color: #d9c0fb; flex-basis: 100%; text-align: right; overflow-wrap: anywhere; }
#song-library-status.error { color: #ffb9ad; }
.instrument { position: relative; border-block: 1px solid #30233f; background: #0a080e; }
.roll { height: clamp(240px, 43vh, 540px); background: radial-gradient(ellipse 80% 35% at 50% 100%, #20112e 0%, transparent 100%), #050407; position: relative; isolation: isolate; overflow: hidden; }
#roll { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.roll-top { position: absolute; z-index: 2; top: 0; left: 0; right: 0; padding: 13px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
#cue, .stats { background: #0a0810ed; border: 1px solid #332840; padding: 7px 10px; border-radius: 6px; color: #d5cbe1; font-size: .78rem; }
.stats { display: flex; gap: 14px; white-space: nowrap; }
.stats strong { color: #f5edff; margin-left: 4px; font-variant-numeric: tabular-nums; }
.strike { position: absolute; z-index: 1; bottom: 0; width: 100%; height: 2px; background: linear-gradient(90deg, #2fd9ff50, #7deaff 22%, #fff1fc 53%, #ca8fff 78%, #a253ff50); box-shadow: 0 -2px 16px #ae66ffce; }
.keyboard {
  position: relative; height: clamp(151px, 23vh, 224px); overflow: hidden; isolation: isolate;
  background: #24212a; touch-action: pan-x; user-select: none;
}
.piano-key {
  position: absolute; top: 0; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: 4px; padding: 0 0 10px;
  height: calc(100% - 7px); color: #17151a; background: #fafafa;
  border: 1px solid #c7c3c8; border-top: 0; border-radius: 0 0 6px 6px;
  box-shadow: inset 0 -5px 0 #e4e2e6, 0 4px 0 #b9b6bd;
}
.piano-key.black {
  height: 59%; z-index: 1; padding-bottom: 8px;
  color: #fff; background: #09090b; border-color: #16141a; overflow: hidden;
  box-shadow: inset 0 -4px 0 #27232d;
}
.piano-key:hover { background: #ece5fa; }
.piano-key.black:hover { background: #292134; }
.piano-key.is-down {
  background: #d9c5fc; border-color: #a287d2;
  box-shadow: inset 0 -2px 0 #b29bdb, 0 1px 0 #a287d2;
  transform: translateY(2px);
}
.piano-key.black.is-down {
  background: #593986; border-color: #593986;
  box-shadow: inset 0 -2px 0 #35224c;
}
.piano-key:focus-visible { z-index: 2; outline-offset: -3px; outline-color: #7950b2; }
.piano-key small { font-size: .84rem; font-weight: 650; white-space: pre; line-height: 1.08; }
.piano-key.black small { font-size: .7rem; }
.piano-key kbd, .bind kbd { font: 750 .66rem/1 Inter, system-ui, sans-serif; }
.piano-key kbd { color: #594177; }
.piano-key.black kbd { color: #c4a8ef; }
.piano-key small, .piano-key kbd {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.piano-key small { font-variant-numeric: tabular-nums; }
.piano-key .compact-key-label { letter-spacing: -.015em; }
.piano-key kbd { white-space: nowrap; }
.timeline { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.timeline input { width: 100%; }
#time { color: var(--muted); font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hint, .import-status { margin: 12px 1px 0; color: var(--muted); font-size: .83rem; line-height: 1.5; }
.import-status { color: var(--accent); }
.import-status.error { color: #ffb6a7; }
dialog { width: min(730px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 22px; border: 1px solid #5d4872; border-radius: 14px; background: #100e15; color: #f1edf7; }
dialog::backdrop { background: #030206d9; }
.language-setting { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 6px 12px; margin: 14px 0 0; padding: 0; border: 0; min-inline-size: 0; }
.language-setting legend { padding: 0 0 5px; }
.language-setting label { font-size: .9rem; }
.language-setting select, .language-setting input { width: 100%; min-width: 0; }
#piano-language-search { min-height: 36px; padding: 7px 10px; border: 1px solid var(--edge); border-radius: 7px; background: #181320; color: inherit; font: inherit; }
.language-setting :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#piano-language-status { grid-column: 1 / -1; margin: 0; color: var(--accent); font-size: .83rem; }
#piano-language-status:empty { display: none; }
dialog[dir="rtl"] p, dialog[dir="rtl"] label { overflow-wrap: anywhere; }
.binding-instructions #binding-range, #active-range { unicode-bidi: isolate; direction: ltr; }
.practice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.practice-grid fieldset { min-inline-size: 0; display: grid; align-content: start; gap: 9px; margin: 0; padding: 12px; border: 1px solid var(--edge); border-radius: 8px; }
.practice-grid legend { padding-inline: 5px; font-weight: 650; }
.practice-grid label { display: grid; gap: 4px; color: #d9cee6; font-size: .83rem; }
.practice-grid input[type="number"], .practice-grid textarea { min-width: 0; border: 1px solid var(--edge); border-radius: 7px; background: #1a1521; color: inherit; padding: 7px 9px; font: inherit; }
.practice-grid textarea { resize: vertical; width: 100%; }
.practice-grid .check-row { display: flex; align-items: center; gap: 6px; }
.practice-grid p { margin: 0; color: #c8bed5; font-size: .79rem; line-height: 1.4; }
.record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.record-actions a { text-decoration: none; }
#record-preview { width: 100%; min-width: 0; }
#open-practice-tools[data-recording] { border-color: #ff949e; color: #ffd3d7; }
#keyboard[data-labels="off"] small, #keyboard[data-labels="off"] kbd,
#keyboard[data-labels="typing"] small, #keyboard[data-labels="letters"] .solfege-key-label,
#keyboard[data-labels="solfege"] .compact-key-label { display: none; }
#keyboard[data-labels="letters"] .compact-key-label, #keyboard[data-labels="solfege"] .solfege-key-label,
#keyboard[data-labels="typing"] kbd:not([hidden]) { display: block; }
#keyboard.full-keyboard[data-labels="solfege"] small,
#keyboard.full-keyboard[data-labels="typing"] kbd { font-size: min(.64cqw, .73rem); }
@media (max-width: 585px) { .practice-grid { grid-template-columns: minmax(0, 1fr); } }
.settings-head, .settings-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-controls { margin: 18px 0 10px; }
.settings-controls label { font-size: .85rem; white-space: nowrap; }
.settings-controls input { flex: 1; }
.settings-controls output { color: var(--accent); margin-left: 4px; }
.background-settings { margin-top: 12px; border-bottom: 1px solid var(--edge); }
.background-settings summary { padding: 9px 0 12px; font-size: .95rem; font-weight: 650; cursor: pointer; }
.background-controls { display: grid; grid-template-columns: minmax(120px, .65fr) minmax(0, 1fr); gap: 14px; padding-bottom: 12px; }
.background-fields { display: grid; justify-items: start; gap: 7px; min-width: 0; font-size: .83rem; color: #c8bed5; }
.background-fields input { width: 100%; min-width: 0; }
.background-dim { display: flex; justify-content: space-between; width: 100%; }
.background-dim output { color: var(--accent); }
#background-status { margin: 0; min-height: 1em; }
.background-preview { aspect-ratio: 16 / 9; align-self: start; border-radius: 7px; border: 1px solid var(--edge); background: linear-gradient(#070708, #101011); }
.roll.has-background, .background-preview.has-background {
  background: linear-gradient(rgb(0 0 0 / var(--photo-dim)), rgb(0 0 0 / var(--photo-dim))),
    var(--stage-photo) center / cover no-repeat #08070b;
}
@media (max-width: 585px) {
  .background-controls { grid-template-columns: minmax(0, 1fr); }
  .background-preview { width: min(100%, 250px); }
}
.neon-colors { margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--edge); }
.neon-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 12px; }
.neon-heading h3 { margin: 0 auto 0 0; font-size: .99rem; }
.neon-heading label, .neon-option label, .binding-instructions { color: #c8bed5; font-size: .83rem; }
.neon-heading select { width: min(100%, 220px); }
.neon-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 12px; }
.neon-option {
  min-inline-size: 0;
  margin: 0;
  padding: 8px 12px 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.neon-option legend { padding: 0 5px; font-size: .87rem; font-weight: 600; }
.neon-option label { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.neon-option .neon-blend { grid-column: 1 / -1; justify-content: flex-start; }
.neon-option input[type="checkbox"] { margin: 0; accent-color: var(--accent); }
.neon-option input[type="color"] {
  display: block;
  width: 36px;
  height: 28px;
  padding: 2px;
  border: 1px solid #766485;
  border-radius: 5px;
  background: var(--panel);
  cursor: pointer;
}
.neon-preview {
  grid-column: 1 / -1;
  height: 28px;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: #080709;
}
.neon-preview::before {
  content: "";
  width: 52%;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neon-first), var(--neon-second));
  box-shadow: -12px 0 14px -6px var(--neon-first), 12px 0 14px -6px var(--neon-second);
}
.note-preview::before {
  width: 13px;
  height: 22px;
  border: 2px solid transparent;
  background:
    linear-gradient(100deg, #fff2, transparent 58%, #0405105c) padding-box,
    linear-gradient(var(--note-body-top), var(--note-body-bottom)) padding-box,
    linear-gradient(var(--note-rim-top), var(--note-rim-bottom)) border-box;
  box-shadow: 0 -3px 8px -3px var(--neon-first), 0 3px 8px -3px var(--neon-second);
}
.strike-preview::before { width: 90%; height: 3px; }
.mist-preview::before {
  width: 90%;
  height: 19px;
  filter: blur(3px);
  mask-image: linear-gradient(to top, #000, transparent);
}
.binding-instructions { margin: 10px 0 0; line-height: 1.5; }
#note-designer { width: min(860px, calc(100vw - 24px)); }
#note-designer .settings-head { position: sticky; top: -22px; z-index: 3; padding-block: 10px; background: #100e15; }
.heading .studio-launch { color: #e5d3ff; border-color: #745598; background: #251833; }
.designer-body { display: grid; grid-template-columns: minmax(145px, .72fr) minmax(0, 1fr); gap: 18px; padding-block: 12px; }
.designer-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; padding-block: 12px; border-top: 1px solid var(--edge); }
.designer-group h3 { grid-column: 1 / -1; margin: 0 0 2px; font-size: .95rem; }
.effect-shortcuts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.note-designer .effect-shortcuts .control { min-height: 36px; max-width: 100%; padding: 7px 10px; white-space: normal; }
.library-group { padding-top: 0; border-top: 0; }
.library-looks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.library-looks .control, .library-looks .control:hover:enabled {
  min-width: 0;
  min-height: 76px;
  padding: 42px 4px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: .75rem;
  background: var(--library-image) center 1px / 67px 54px no-repeat, radial-gradient(ellipse at center top, var(--library-light), #12101a 74%);
}
.library-looks [data-library-look="stars"] { --library-image: url("./kenney-vfx/star_09.png"); --library-light: #392955; }
.library-looks [data-library-look="lightning"] { --library-image: url("./kenney-vfx/spark_02.png"); --library-light: #20365d; }
.library-looks [data-library-look="orbit"] { --library-image: url("./kenney-vfx/circle_03.png"); --library-light: #504226; }
.library-looks .control[data-library-look="nanami"],
.library-looks .control[data-library-look="nanami"]:hover:enabled {
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 9px 14px;
  text-align: left;
  font-size: .85rem;
  background: var(--themed-card);
}
.library-looks [data-library-look="nanami"] {
  --themed-card:
    radial-gradient(ellipse at 87% 75%, #186678 0, #18667800 44%),
    radial-gradient(ellipse at 93% 20%, #4ce7df 0, #147580 25%, #14758000 61%),
    #102b35;
}
.library-looks .control[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.library-credit { grid-column: 1 / -1; margin: 0; font-size: .75rem; color: #c8bed5; }
.designer-palette { grid-column: 1 / -1; border-top: 1px solid var(--edge); padding-block: 9px; }
.designer-palette summary { cursor: pointer; font-size: .95rem; font-weight: 650; }
.designer-palette #neon-title { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.designer-palette .neon-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); }
.designer-preview { display: grid; align-content: start; gap: 8px; }
.note-designer { --preview-key-width: 64px; }
.designer-key {
  justify-self: center;
  width: var(--preview-key-width);
  text-align: center;
  margin-top: -8px;
  padding: 5px;
  border-radius: 0 0 5px 5px;
  background: #d9d0e8;
  color: #201631;
  font-size: .75rem;
}
#design-stage { position: relative; isolation: isolate; overflow: hidden; background: #080709; border: 1px solid var(--edge); border-radius: 7px; }
#design-preview { display: block; position: relative; z-index: 1; width: 100%; border-bottom: 2px solid var(--neon-first, #eef0f4); }
.designer-controls, .design-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; min-width: 0; }
.designer-controls label { display: grid; gap: 4px; min-width: 0; color: #c8bed5; font-size: .81rem; }
.designer-controls select, .designer-controls input { width: 100%; min-width: 0; }
.designer-controls #design-label-color {
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: #191422;
  cursor: pointer;
}
.designer-controls .note-text-auto { grid-column: 1 / -1; }
.note-shape-choices {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 76px), 1fr));
  gap: 6px;
}
.note-shape-library { grid-column: 1 / -1; min-width: 0; }
.note-shape-library summary { width: fit-content; padding: 3px 0; cursor: pointer; color: #ded2f0; font-size: .81rem; }
.note-shape-library .note-shape-choices { margin-top: 7px; }
.note-shape-library[open] > label { margin-top: 8px; }
.note-shape-library[open] .note-shape-choices { max-height: 310px; overflow: auto; padding: 3px; }
#shape-search { min-height: 36px; border-radius: 7px; border: 1px solid var(--edge); background: #191422; color: inherit; padding: 6px 9px; }
.studio-swatches, .studio-swatch-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.studio-swatches input[type="color"] { width: 39px; height: 34px; padding: 2px; border: 1px solid #685477; border-radius: 6px; background: #191422; cursor: pointer; }
.studio-swatch-actions .control { min-height: 34px; font-size: .76rem; }
.designer-controls .editor-check { display: flex; align-items: center; gap: 6px; }
.designer-controls .editor-check input { width: auto; accent-color: var(--accent); }
.note-shape-choices .note-shape-choice {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  padding: 5px;
  font-size: .73rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.note-shape-choice canvas { width: 25px; height: 25px; }
.note-shape-choice[aria-pressed="true"] { background: #322146; border-color: #ac87e4; }
#paint-editor, #outline-editor, #artwork-editor, #impact-artwork-editor, #mist-artwork-editor { grid-column: 1 / -1; min-width: 0; padding: 12px; border: 1px solid var(--edge); border-radius: 8px; }
.designer-controls input[type="number"] { min-height: 36px; padding: 6px 9px; border: 1px solid var(--edge); border-radius: 7px; background: #191422; color: #f1edf7; font: inherit; }
.designer-controls input[type="number"]:invalid { border-color: #ffb4a7; }
#outline-title { margin: 0; font-size: .92rem; }
#outline-editor p, #artwork-editor p, #impact-artwork-editor p { margin: 6px 0 9px; color: #c8bed5; font-size: .79rem; line-height: 1.45; }
#outline-pad {
  display: block;
  width: min(100%, 200px);
  margin-inline: auto;
  outline: 1px solid #8873af;
  border-radius: 4px;
  background: radial-gradient(circle, #58516a 1px, transparent 1px) 0 0 / 16px 16px, #111018;
  cursor: crosshair;
  touch-action: none;
}
#paint-title { margin: 0 0 8px; font-size: .92rem; }
.paint-tools { display: flex; flex-wrap: wrap; gap: 6px 9px; align-items: end; margin-bottom: 11px; }
.paint-tools [aria-pressed="true"] { background: #322146; border-color: #ac87e4; }
.paint-tools input[type="color"] { width: 42px; height: 30px; }
.paint-tools input[type="range"] { width: 85px; }
#paint-pad {
  display: block;
  width: min(100%, 180px);
  margin-inline: auto;
  border: 1px solid #8873af;
  border-radius: 4px;
  background: repeating-conic-gradient(#24202e 0% 25%, #171420 0% 50%) 0 0 / 16px 16px;
  cursor: crosshair;
  touch-action: none;
}
@media (min-width: 586px) {
  .designer-preview { position: sticky; top: 56px; align-self: start; }
}
.outline-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
#outline-status { margin-bottom: 0; }
#outline-status[data-error] { color: #ffb4a7; }
.design-actions { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto auto; }
.design-actions label { grid-column: 1 / -1; }
.design-actions input { background: #191422; border: 1px solid var(--edge); border-radius: 6px; padding: 6px 8px; color: inherit; }
#design-status { grid-column: 1 / -1; margin: 0; min-height: 1em; color: #c8bed5; font-size: .79rem; }
@media (max-width: 585px) {
  .neon-options { grid-template-columns: minmax(0, 1fr); }
  .neon-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .neon-heading h3 { grid-column: 1 / -1; margin-bottom: 3px; }
  .neon-heading select { width: 100%; }
  .designer-body { grid-template-columns: minmax(0, 1fr); }
  .designer-preview { width: min(100%, 300px); }
}
.binding-status { color: #c9bad9; font-size: .81rem; margin: 12px 0; min-height: 1.2em; }
.extra-key-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 12px; }
.extra-key-controls label { display: grid; gap: 4px; min-width: 0; color: #c8bed5; font-size: .83rem; }
#add-key-binding[aria-pressed="true"] { border-color: var(--accent); }
#extra-key-select { max-width: min(100%, 185px); }
#keyboard:not([data-labels="off"]) .piano-key[data-extra-key="true"] kbd:not([hidden]) {
  display: block;
  font-size: min(.8cqw, .68rem);
}
.bindings { display: grid; grid-template-columns: repeat(auto-fit,minmax(91px,1fr)); gap: 6px; }
.bind { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.bind kbd { color: var(--accent); }
.bind[aria-pressed="true"] { background: #31214a; border-color: var(--accent); }
@media (max-width: 640px) {
  .page, .site-inner { padding-inline: 12px; }
  .heading, .transport, .playback { flex-wrap: wrap; }
  .transport, .playback { padding: 9px; gap: 9px; }
  .transport .song { flex: 1 1 320px; justify-content: flex-start; }
  .song select { flex: 1 1 160px; width: auto; }
  .song .control { min-height: 42px; }
  #song-library-status { text-align: left; }
  .timeline { flex-basis: 100%; order: 2; }
  .speed { margin-left: auto; }
  .roll-top { padding: 7px; }
  .stats { gap: 8px; }
  .piano-key { padding-bottom: 5px; gap: 2px; }
  .piano-key.black { padding-bottom: 3px; }
  .settings-controls { flex-wrap: wrap; }
}
@media (min-width: 641px) and (max-height: 680px) {
  .site-inner { min-height: 48px; }
  .page { padding-top: 18px; }
  .heading { margin-bottom: 14px; }
  .transport, .playback { padding-block: 9px; }
  .roll { height: clamp(184px, 36vh, 240px); }
}

.credits { margin: 9px 1px 0; color: var(--muted); font-size: .72rem; }
.credits a { color: #d0c3e5; }
.piano-view { min-width: 0; container-type: inline-size; }
.piano-key small { font-size: clamp(.53rem, 2.3cqw, .84rem); }
.piano-key.black small { font-size: clamp(.43rem, 1.8cqw, .7rem); }
.piano-key kbd { font-size: clamp(.49rem, 1.8cqw, .66rem); }
.full-keyboard .piano-key kbd { display: none; }
.piano-key .compact-key-label, .full-keyboard .piano-key .solfege-key-label { display: none; }
.full-keyboard .piano-key .compact-key-label { display: block; font-size: min(.95cqw, .73rem); }
.full-keyboard .piano-key.black .compact-key-label { font-size: min(.77cqw, .68rem); }
.compact-key-label span { display: block; }
@container (min-width: 1060px) {
  .compact-key-label span { display: inline; }
  .full-keyboard .piano-key .compact-key-label { font-size: min(.76cqw, .73rem); }
  .full-keyboard .piano-key.black .compact-key-label { font-size: min(.60cqw, .68rem); }
}
.full-keyboard .piano-key { border-radius: 0 0 3px 3px; }
.range-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  padding: 7px 14px;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: .79rem;
}
.range-bar label { display: flex; align-items: center; gap: 8px; }
.range-bar input { accent-color: var(--accent); margin: 0; }
.audio-source { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; max-inline-size: 100%; }
.audio-source .control { min-height: 36px; padding: 6px 9px; }
.audio-source .control[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #2d1e40; }
.pedal-strip {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  inline-size: min(20rem, 100%);
  gap: 5px;
}
.pedal-strip .control {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 5px 6px;
  border-bottom-width: 3px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.pedal-strip .control kbd {
  color: var(--muted);
  font: inherit;
  font-size: .68rem;
  white-space: nowrap;
}
.pedal-strip .control:is([aria-pressed="true"], [data-playback-held]) {
  border-color: var(--accent);
  border-bottom-color: #ab8adf;
  background: var(--accent);
  color: #241733;
  transform: translateY(1px);
}
.pedal-strip .control:is([aria-pressed="true"], [data-playback-held]) kbd { color: #392953; }
.range-bar select { min-height: 30px; padding: 5px 8px; }
.typing-range-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.typing-range-controls .control { padding-inline: 7px; }
#active-range { min-inline-size: 7ch; text-align: center; color: #e7ddf4; }
#keyboard[data-two-hands="true"] .piano-key kbd:not([hidden]) {
  display: block;
  font-size: min(.7cqw, .66rem);
}
#keyboard[data-two-hands="true"][data-labels="off"] kbd { display: none; }
#keyboard[data-two-hands="true"] .piano-key[data-hand="left"] kbd { color: #a4f4df; }
#keyboard[data-two-hands="true"] .piano-key[data-hand="right"] kbd { color: #e1c4ff; }
#keyboard[data-two-hands="true"] .piano-key.is-down kbd { color: #24213f; }
#keyboard:not([data-labels="off"]) .piano-key[data-numpad="true"] kbd {
  display: block;
  font-size: min(.67cqw, .66rem);
  color: #ffdda3;
}
#keyboard .piano-key[data-numpad="true"].is-down kbd { color: #24213f; }
#keyboard[data-computer-full="true"]:not([data-labels="off"]) .piano-key kbd:not([hidden]) {
  display: block;
  font-size: min(.8cqw, .68rem);
}
#keyboard[data-computer-full="true"] .piano-key[data-numpad="true"] kbd {
  white-space: normal;
  text-align: center;
}
@media (max-height: 680px) and (min-width: 641px) {
  .roll { height: clamp(158px, 30vh, 240px); }
  .keyboard { height: clamp(145px, 24vh, 165px); }
}

@media (max-width: 380px) {
  .piano-key.black small { display: none; }
  .piano-key { gap: 3px; }
}
@container (max-width: 720px) {
  .full-keyboard .piano-key:not([data-octave-anchor], .is-down, .is-upcoming) small { visibility: hidden; }
  .full-keyboard .piano-key:is(.is-down, .is-upcoming, [data-octave-anchor]) .compact-key-label { font-size: min(1.06cqw, .73rem); }
  .full-keyboard .piano-key.black:is(.is-down, .is-upcoming) .compact-key-label { font-size: min(.82cqw, .68rem); }
  #keyboard.full-keyboard[data-labels="auto"] .piano-key:not(.is-down, .is-upcoming) kbd { display: none; }
}

.roll { background: linear-gradient(#070708, #101011); }
.strike {
  height: 3px;
  background: #f6f7ff;
  box-shadow: 0 0 6px 2px #e2e7ff, 0 -5px 16px 4px #e6eaff92;
}
.roll::before, #design-stage::before {
  content: "";
  position: absolute;
  inset: auto 0 1px;
  height: calc(clamp(30px, 9vh, 92px) * var(--mist-height, 1));
  background:
    radial-gradient(ellipse 44% 75% at 16% 104%, var(--mist-left, #eef0f4), transparent),
    radial-gradient(ellipse 44% 70% at 82% 103%, var(--mist-right, #eef0f4), transparent),
    var(--mist-spectrum, linear-gradient(90deg, var(--mist-left, #eef0f4), var(--mist-right, #eef0f4)));
  opacity: var(--mist-density, .66);
  mask-image: linear-gradient(to top, #000 1%, #0005 34%, transparent 88%);
  filter: blur(8px);
  pointer-events: none;
}
#design-stage::before { height: calc(54px * var(--mist-height, 1)); }
[data-mist="off"]::before,
.roll[data-studio-mist]::before,
#design-stage[data-studio-mist]::before,
.roll[data-mist="custom"]::before,
#design-stage[data-mist="custom"]::before,
.roll[data-mist="smoke"]::before,
#design-stage[data-mist="smoke"]::before { display: none; }
.smoke-layer {
  --plume-width: clamp(90px, 12vw, 220px);
  --plume-height: clamp(85px, 15vh, 175px);
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
#design-stage .smoke-layer { --plume-width: 102px; --plume-height: 96px; }
[data-mist="smoke"] > .smoke-layer { display: block; }
.custom-mist { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
[data-mist="custom"] > .custom-mist, [data-studio-mist] > .custom-mist { display: block; }
.smoke-layer span {
  position: absolute;
  inset-block-end: -17px;
  left: var(--origin);
  width: var(--plume-width);
  height: calc(var(--plume-height) * var(--mist-height, 1));
  color: var(--plume-tint, color-mix(in srgb, var(--mist-left, #eef0f4), var(--mist-right, #eef0f4) var(--tone)));
  background: currentColor;
  mask: url("./smoke-plume.png") center / 100% 100% no-repeat;
  filter: blur(2px);
  opacity: calc(var(--mist-density, .66) * .42);
  transform: translate(-50%, 19%) rotate(var(--tilt)) scale(var(--size));
}
@keyframes rising-smoke {
  0% { opacity: 0; transform: translate(-50%, 50%) rotate(0deg) scale(calc(var(--size) * .42)); }
  22% { opacity: calc(var(--mist-density, .66) * .86); }
  54% {
    opacity: calc(var(--mist-density, .66) * .48);
    transform: translate(calc(-50% + 20% * var(--drift)), calc(18% - 41% * var(--rise))) rotate(var(--tilt)) scale(var(--size));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + 49% * var(--drift)), calc(-12% - 68% * var(--rise))) rotate(calc(var(--tilt) * 1.6)) scale(calc(var(--size) * 1.75));
  }
}
@keyframes mist-drift {
  from { transform: translateX(-8%) scaleX(1.2); }
  to { transform: translateX(8%) scaleX(1.2); }
}
@keyframes mist-pulse {
  from { transform: scaleY(.7); }
  to { transform: scaleY(1.15); }
}
@keyframes mist-waves {
  0%, 100% { transform: translateX(-7%) scale(1.18, .82); }
  50% { transform: translateX(7%) scale(1.18, 1.2); }
}
@media (prefers-reduced-motion: no-preference) {
  [data-mist="drift"]::before { animation: mist-drift calc(5s / var(--mist-speed, 1)) ease-in-out infinite alternate; }
  [data-mist="pulse"]::before { transform-origin: bottom; animation: mist-pulse calc(2s / var(--mist-speed, 1)) ease-in-out infinite alternate; }
  [data-mist="waves"]::before { transform-origin: bottom; animation: mist-waves calc(3.6s / var(--mist-speed, 1)) ease-in-out infinite; }
  [data-mist-still]::before { animation: none; }
  [data-mist="smoke"] > .smoke-layer span { animation: rising-smoke calc(var(--lifetime) / var(--mist-speed, 1)) var(--phase) linear infinite; }
  [data-mist="smoke"][data-mist-still] > .smoke-layer span { animation: none; }
}
#roll { z-index: 1; }
.strike { z-index: 2; }
.colored-strike .strike {
  background:
    linear-gradient(#fff9, #fff0),
    linear-gradient(90deg, var(--neon-first), var(--neon-second));
  box-shadow: 0 0 7px 1px color-mix(in srgb, var(--strike-halo-left), var(--strike-halo-right));
}
.piano-key {
  height: calc(100% - 2px);
  border-color: #191a30;
  color: #e8e9ff;
  background: linear-gradient(#292b51 0, #474c88 23%, #3d4076 96%, #232441);
  box-shadow: inset 1px 0 #aeb4ff18;
}
.piano-key.black {
  height: 66%;
  background: linear-gradient(90deg, #11121c, #06070d 28%, #090a13 80%, #101220);
  border-color: #0c0d19;
  box-shadow: inset 0 -3px #141523;
}
.piano-key.is-down { background: #bfc6ff; box-shadow: inset 0 0 12px #f4f6ff; }
.piano-key.black.is-down { background: #a7acee; box-shadow: inset 0 0 10px #f4f6ff; }
.piano-key.is-upcoming:not(.is-down) { box-shadow: inset 0 5px 0 var(--cue-key-color, #c5d2ff); }
.piano-key.is-due:not(.is-down) { box-shadow: inset 0 5px 0 white, inset 0 9px 15px var(--cue-key-color, #c5d2ff); }
.full-keyboard .piano-key.is-upcoming .compact-key-label { visibility: visible; }

.studio {
  position: relative;
  display: grid;
  --keyboard-height: clamp(62px, 21dvh, 220px);
  min-height: max(340px, 100dvh);
  grid-template-rows: minmax(calc(180px + var(--keyboard-height)), 1fr) repeat(5, auto);
  border: 0;
  border-radius: 0;
}
.instrument {
  grid-row: 1;
  display: grid;
  min-height: 0;
  min-width: 0;
  border: 0;
}
.piano-focus { overflow: hidden; }
.piano-focus .studio { height: 100dvh; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.piano-focus .studio > :not(.instrument),
.piano-focus .roll-top { display: none; }
.focus-shortcut { display: none; }
.piano-focus .focus-shortcut {
  position: absolute; z-index: 2; top: 12px; left: 14px;
  display: flex; align-items: center; gap: 7px; pointer-events: none;
  color: #d5cbe1; background: #0a0810ed; border: 1px solid var(--edge);
  border-radius: 6px; padding: 5px 8px; font-size: .75rem;
}
.focus-shortcut kbd { color: var(--accent); }
.studio-sync-colors { grid-column: 1 / -1; }
.piano-view {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--keyboard-height);
  min-height: 0;
}
.roll, .keyboard { height: auto; min-height: 0; }
.heading {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  align-items: center;
  padding: 8px 14px;
  margin: 0;
  gap: 8px;
  pointer-events: none;
}
.heading h1 { font-size: 1rem; }
.heading-actions { pointer-events: auto; flex-wrap: wrap; gap: 4px; }
.heading .control { background: #101015d9; }
.roll-top { top: 52px; }
.transport { grid-row: 2; }
.playback { grid-row: 3; }
.performance-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.performance-picker select { max-width: 100%; }
.performance-status { color: var(--muted); font-size: .78rem; }
#performance-record[data-recording] { background: #e992a4; border-color: #e992a4; color: #1d1116; }
.range-bar { grid-row: 4; }
.transport, .playback, .range-bar { padding-block: 4px; background: #0b0a0e; }
.studio .control, .studio select { min-height: 29px; padding-block: 5px; }
.studio .modes button { padding-block: 5px; }
.piano-key kbd { color: #f1e6ff; }
.piano-key.is-down { color: #202044; }
.piano-key.is-down kbd { color: #29204e; }

.page {
  max-width: none;
  padding: 0;
}
.import-status {
  grid-row: 5;
  margin: 0;
  padding: 4px 14px;
  max-height: 3.5em;
  overflow: auto;
  overflow-wrap: anywhere;
}
.credits {
  grid-row: 6;
  margin: 0;
  padding: 4px 14px;
  line-height: 1.35;
}

@media (max-width: 550px) {
  .heading { padding-inline: 7px; }
  .heading-actions .control { padding-inline: 6px; }
  .modes { flex: 0 1 auto; max-inline-size: 100%; }
  .modes button { min-inline-size: 0; white-space: normal; overflow-wrap: anywhere; }
  .settings-controls label { white-space: normal; }
}
@media (max-width: 480px) {
  .heading { align-content: start; }
  .roll-top { top: 79px; }
}

@media (max-width: 640px), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .studio {
    --keyboard-height: clamp(48px, 9dvh, 72px);
    grid-template-rows: auto calc(62dvh + var(--keyboard-height)) repeat(5, auto);
  }
  .heading {
    position: static;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 4px 8px;
    gap: 6px;
    background: #0b0a0e;
  }
  .heading h1 { font-size: .86rem; white-space: nowrap; }
  .heading-actions { gap: 4px; }
  .instrument { grid-row: 2; }
  .piano-focus .instrument { grid-row: 1; }
  .roll-top { top: 0; padding: 5px 8px; }
  #cue, .stats { padding: 4px 6px; font-size: .72rem; }

  .transport, .playback, .range-bar { padding: 4px 8px; gap: 5px 8px; }
  .studio .control, .studio select { min-height: 32px; padding: 4px 7px; font-size: .75rem; }
  .studio .control.primary { min-width: 56px; }
  .studio .heading-actions .control { min-height: 30px; }
  .transport { grid-row: 4; flex-wrap: wrap; }
  .modes { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .studio .modes button { min-width: 0; min-height: 32px; padding: 4px; white-space: normal; }
  .transport .song { flex: 1 1 100%; justify-content: flex-start; gap: 5px; }
  .song select { flex: 1 1 5rem; width: auto; }
  .song .control { max-width: 100%; white-space: normal; }

  .playback { grid-row: 3; }
  #playback { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  #playback .play-actions { grid-column: 1; gap: 5px; }
  #playback .speed { grid-column: 3; grid-row: 1; gap: 4px; }
  #playback .timeline { grid-column: 1 / -1; grid-row: 2; gap: 6px; }
  .timeline input { min-height: 24px; }
  .range-bar { grid-row: 5; justify-content: flex-start; font-size: .75rem; }
  .range-bar label { gap: 5px; }
  .pedal-strip { flex: 1 1 200px; min-width: 0; }
  .studio .pedal-strip .control { gap: 1px; padding: 3px 4px; }
  .import-status { grid-row: 6; padding-inline: 8px; }
  .credits { grid-row: 7; padding-inline: 8px; }
}

:root.piano-fullscreen { overflow: hidden; }
.piano-fullscreen .page > :not(.studio) { display: none; }
.piano-fullscreen:not(.piano-focus) .studio {
  height: 100dvh;
  min-height: 0;
  overflow: auto;
}


.video-export:has(:not([hidden])) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px 0;
  color: var(--muted);
  font-size: .81rem;
}
.video-export p { margin: 0; }
.video-export progress { inline-size: min(144px, 100%); accent-color: var(--accent); }
.video-export[hidden], .video-export [hidden] { display: none; }
#video-record[aria-pressed="true"] { border-color: #e78091; color: #ffd0d7; }

.video-focus-actions {
  display: none;
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
  max-inline-size: min(65vw, 540px);
}
.piano-focus .video-focus-actions { display: flex; }
@media (max-width: 360px), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  html:not(.piano-focus) .video-focus-actions { display: flex; top: 42px; right: 8px; }
}
.video-focus-actions .video-export:has(:not([hidden])) {
  justify-content: end;
  padding: 5px 8px;
  border-radius: 6px;
  background: #0a0810ed;
  border: 1px solid var(--edge);
}

.fall-time-setting {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-block: 14px;
  font-size: .9rem;
}
.fall-time-setting label { min-inline-size: 0; overflow-wrap: anywhere; }
.fall-time-setting input { inline-size: 5.5em; padding: 6px 9px; font-variant-numeric: tabular-nums; }
