:root {
  --nav-height: 0px;
  --rl-viewport-height: 100dvh;
  --font-display: "Arial Black", "Noto Sans TC", system-ui, sans-serif;
  --font-body: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", monospace;
  --sl-ink: #1d2725;
  --sl-paper: #fff8e8;
  --sl-coral: #ef725f;
  --sl-coral-dark: #aa463c;
  --sl-cyan: #65b8aa;
  --sl-cyan-dark: #256f68;
  --sl-yellow: #f2c85b;
  --sl-violet: #758ab5;
  --sl-track: #152c2c;
  --sl-track-soft: #23403d;
  --sl-wood: #9b613d;
  --sl-lane-d: #5cb0a9;
  --sl-lane-f: #d38b49;
  --sl-lane-j: #b7a24a;
  --sl-lane-k: #e06d5f;
}

* { box-sizing: border-box; }
html { color-scheme: light; background: #173a37; }
body { min-width: 320px; margin: 0; font-family: var(--font-body); background: #173a37; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, p, figure, fieldset, dl, dd { margin: 0; }
.skip-link {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  color: #fff8e8;
  background: #173a37;
}
.skip-link:focus { transform: none; }
.sl-home-link {
  display: inline-block;
  margin-bottom: 16px;
  color: #173a37;
  font-size: .76rem;
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.sl-home-link:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible { outline: 4px solid #fff8e8; outline-offset: 3px; }

.sl-page {
  flex: 1;
  min-height: calc(100vh - var(--nav-height));
  background: var(--sl-yellow);
  color: var(--sl-ink);
  overflow: hidden;
}

.sl-menu[hidden],
.sl-game[hidden],
.sl-result[hidden] { display: none; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sl-menu {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - var(--nav-height) - 64px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  align-items: center;
  gap: clamp(32px, 7vw, 96px);
  padding: clamp(40px, 6vw, 84px) 0;
}

.sl-menu-copy { max-width: 650px; }
.sl-brand {
  width: fit-content;
  margin-bottom: 20px;
  padding: 7px 12px;
  background: var(--sl-ink);
  color: #fff;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 900;
}
.sl-menu h1 {
  max-width: 14ch;
  margin-bottom: 18px;
  font-size: clamp(2.65rem, 5.5vw, 4.55rem);
  line-height: .98;
  letter-spacing: -.035em;
  color: var(--sl-ink);
}
.sl-lead {
  max-width: 54ch;
  margin-bottom: 26px;
  font-size: clamp(.98rem, 1.5vw, 1.12rem);
  line-height: 1.75;
  color: #3f354b;
}
.sl-lead kbd,
.sl-hit-key kbd {
  font-family: var(--font-mono);
  font-weight: 900;
}
.sl-lead kbd {
  display: inline-grid;
  min-width: 1.8em;
  min-height: 1.8em;
  place-items: center;
  border: 2px solid var(--sl-ink);
  border-radius: 5px;
  background: var(--sl-paper);
  box-shadow: 0 3px 0 var(--sl-ink);
}

.sl-song-line {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 590px;
  margin-bottom: 24px;
  padding: 13px 16px;
  background: rgba(255,255,255,.66);
  border: 2px solid var(--sl-ink);
  border-radius: 12px;
  width: 100%;
  color: var(--sl-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(29,39,37,.32);
  transition: transform .15s ease-out, background .15s ease-out;
}
.sl-song-line:hover { transform: translateY(-2px); background: rgba(255,255,255,.82); }
.sl-song-line:focus-visible { outline: 4px solid var(--sl-coral); outline-offset: 3px; }
.sl-song-line > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }
.sl-song-line strong { font-size: 1rem; }
.sl-song-line small { font-size: .72rem; color: #574b62; }
.sl-song-change { margin-left: auto; color: #8b3f38; font-size: .72rem; white-space: nowrap; }
.sl-vinyl {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--sl-ink);
  box-shadow: inset 0 0 0 6px #3f344c, inset 0 0 0 12px var(--sl-ink);
}
.sl-vinyl i {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--sl-coral);
  border: 2px solid var(--sl-paper);
}

.sl-difficulty {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 590px;
  gap: 8px;
  border: 0;
}
.sl-difficulty legend {
  margin-bottom: 9px;
  font-size: .78rem;
  font-weight: 900;
}
.sl-difficulty-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 8px;
  min-height: 68px;
  padding: 10px 11px;
  text-align: left;
  color: var(--sl-ink);
  background: rgba(255,255,255,.5);
  border: 2px solid rgba(23,18,31,.35);
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  transition: transform .16s ease-out, background .16s ease-out, border-color .16s ease-out;
}
.sl-difficulty-option:hover { transform: translateY(-2px); border-color: var(--sl-ink); }
.sl-difficulty-option:focus-visible { outline: 3px solid var(--sl-violet); outline-offset: 3px; }
.sl-difficulty-option.is-selected {
  background: var(--sl-paper);
  border-color: var(--sl-ink);
  transform: translateY(-3px);
  box-shadow: 0 4px 0 var(--sl-ink);
}
.sl-difficulty-option b { font-size: .95rem; }
.sl-difficulty-option span { font-size: .7rem; color: #62566e; }
.sl-difficulty-option i {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--sl-ink);
  color: #fff;
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
}
.sl-difficulty-copy {
  min-height: 1.7em;
  max-width: 590px;
  margin: 12px 0 16px;
  font-size: .78rem;
  color: #51455d;
}
.sl-start,
.sl-panel-primary,
.sl-panel-secondary {
  font: inherit;
  cursor: pointer;
}
.sl-start {
  display: flex;
  width: min(100%, 590px);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 12px 17px;
  color: #fff;
  background: var(--sl-coral);
  border: 2px solid var(--sl-ink);
  border-radius: 10px;
  box-shadow: 0 6px 0 var(--sl-ink);
  transition: transform .14s ease-out, box-shadow .14s ease-out, background .14s;
}
.sl-start:not(:disabled):hover { background: #ff4f43; transform: translateY(2px); box-shadow: 0 4px 0 var(--sl-ink); }
.sl-start:not(:disabled):active { transform: translateY(5px); box-shadow: 0 1px 0 var(--sl-ink); }
.sl-start:disabled { cursor: wait; filter: saturate(.45); opacity: .72; }
.sl-start span { font-size: 1rem; font-weight: 900; }
.sl-start small { font-size: .68rem; color: rgba(255,255,255,.86); }
.sl-menu-art {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 560px;
  place-items: center;
  border: 3px solid var(--sl-ink);
  border-radius: 16px;
  background: var(--sl-cyan);
  box-shadow: 12px 12px 0 var(--sl-ink);
  overflow: hidden;
}
.sl-menu-art::before,
.sl-menu-art::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
}
.sl-menu-art::before { width: 370px; height: 370px; background: var(--sl-violet); top: -170px; right: -105px; }
.sl-menu-art::after { width: 260px; height: 260px; background: var(--sl-coral); bottom: -125px; left: -90px; }
.sl-menu-art > p {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .78rem;
  font-weight: 900;
}
.sl-beat-pal {
  position: relative;
  display: flex;
  width: clamp(170px, 20vw, 235px);
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  gap: 32px;
  border: 5px solid var(--sl-ink);
  border-radius: 50%;
  background: var(--sl-yellow);
  box-shadow: 0 14px 0 rgba(23,18,31,.22);
  animation: sl-pal-breathe 1.846s ease-in-out infinite;
}
.sl-pal-eye {
  width: 18px;
  height: 25px;
  border-radius: 50%;
  background: var(--sl-ink);
  transform-origin: center;
  animation: sl-blink 4.6s linear infinite;
}
.sl-pal-mouth {
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: 55px;
  height: 25px;
  transform: translateX(-50%);
  border: 5px solid var(--sl-ink);
  border-top: 0;
  border-radius: 0 0 50px 50px;
}
.sl-key-demo {
  position: absolute;
  display: grid;
  width: 86px;
  height: 98px;
  place-items: center;
  align-content: center;
  border: 3px solid var(--sl-ink);
  border-radius: 11px;
  box-shadow: 0 7px 0 var(--sl-ink);
  transform: rotate(var(--tilt));
}
.sl-key-demo b { font: 900 2rem/1 var(--font-mono); }
.sl-key-demo span { font-size: .64rem; font-weight: 800; }
.sl-key-demo-f { --tilt: -11deg; left: 8%; top: 19%; background: var(--sl-coral); }
.sl-key-demo-j { --tilt: 9deg; right: 8%; bottom: 20%; background: var(--sl-paper); }
.sl-orbit { position: absolute; border: 3px solid rgba(23,18,31,.75); border-radius: 50%; }
.sl-orbit-one { width: 390px; height: 150px; transform: rotate(22deg); }
.sl-orbit-two { width: 330px; height: 410px; transform: rotate(-38deg); border-style: dashed; }

@keyframes sl-pal-breathe { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes sl-blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.08); } }

/* Game */
.sl-game {
  min-height: 100dvh;
  padding: 12px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--sl-ink);
  color: #fff;
}
.sl-game-hud {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 2fr) auto auto;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  width: min(1100px, 100%);
  min-height: 56px;
  margin: 0 auto 8px;
}
.sl-icon-button {
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--sl-track-soft);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}
.sl-track-name { display: grid; line-height: 1.25; }
.sl-track-name strong { font-size: .78rem; }
.sl-track-name span { font-size: .63rem; color: #bcb4c9; }
.sl-progress { height: 7px; background: #3b3148; overflow: hidden; border-radius: 999px; }
.sl-progress i { display: block; width: 0; height: 100%; background: var(--sl-yellow); }
.sl-hud-stat { display: grid; text-align: right; line-height: 1.2; }
.sl-hud-stat span { font-size: .58rem; color: #bcb4c9; }
.sl-hud-stat strong { min-width: 7.5ch; font: 800 .86rem/1.3 var(--font-mono); font-variant-numeric: tabular-nums; }
.sl-stage {
  position: relative;
  width: min(880px, 100%);
  height: calc(100dvh - 165px);
  min-height: 430px;
  max-height: 760px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: var(--sl-track);
  border: 1px solid rgba(255,255,255,.14);
  transition: transform .08s ease-out;
}
.sl-stage.is-impact { transform: scale(.995); }
#sl-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sl-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--sl-yellow);
  font: 900 clamp(4rem, 18vw, 9rem)/1 var(--font-mono);
  text-shadow: 6px 6px 0 var(--sl-coral-dark);
}
.sl-countdown.is-pop { animation: sl-countdown .7s cubic-bezier(.16,1,.3,1); }
@keyframes sl-countdown { from { transform: scale(1.65); opacity: 0; } 28% { transform: scale(1); opacity: 1; } to { opacity: .88; } }
.sl-judge {
  position: absolute;
  z-index: 3;
  top: 61%;
  left: 50%;
  display: grid;
  min-width: 180px;
  transform: translate(-50%, -50%) scale(.72);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.sl-judge strong { font-size: clamp(1.35rem, 4vw, 2.2rem); line-height: 1; text-shadow: 3px 3px 0 rgba(23,18,31,.72); }
.sl-judge span { margin-top: 6px; color: #fff; font: 800 .7rem/1 var(--font-mono); }
.sl-judge.is-show { animation: sl-judge-pop .46s cubic-bezier(.16,1,.3,1); }
.sl-judge.is-perfect strong { color: var(--sl-yellow); }
.sl-judge.is-great strong { color: #78e5df; }
.sl-judge.is-good strong { color: #d5c8ff; }
.sl-judge.is-miss strong { color: #ff877d; }
@keyframes sl-judge-pop { 0% { opacity: 0; transform: translate(-50%, -35%) scale(.55); } 25%, 68% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -72%) scale(.92); } }
.sl-combo {
  position: absolute;
  z-index: 2;
  top: 43%;
  left: 50%;
  display: grid;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.sl-combo.is-visible { opacity: 1; }
.sl-combo strong { font: 900 clamp(2rem, 7vw, 4rem)/.9 var(--font-mono); color: #fff; text-shadow: 3px 3px 0 rgba(23,18,31,.7); }
.sl-combo span { font-size: .55rem; font-weight: 900; letter-spacing: .18em; color: var(--sl-yellow); }
.sl-pause-layer {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23,18,31,.84);
}
.sl-pause-layer[hidden] { display: none; }
.sl-pause-panel { width: min(330px, calc(100% - 32px)); text-align: center; }
.sl-mini-pal {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--sl-ink);
  background: var(--sl-yellow);
  border-radius: 50%;
  font: 900 1.1rem/1 var(--font-mono);
}
.sl-pause-panel h2 { color: #fff; margin-bottom: 6px; }
.sl-pause-panel p { margin-bottom: 20px; color: #d7d0df; font-size: .82rem; }
.sl-panel-primary,
.sl-panel-secondary {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 900;
}
.sl-panel-primary { color: var(--sl-ink); background: var(--sl-yellow); border: 0; box-shadow: 0 4px 0 #a98600; }
.sl-panel-secondary { margin-top: 10px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.42); }
.sl-hit-controls {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  width: min(520px, calc(100% - 28px));
  gap: 12px;
  transform: translateX(-50%);
  pointer-events: none;
}
.sl-hit-key {
  display: flex;
  min-height: 68px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 10px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: transform .07s ease-out, filter .07s;
}
.sl-hit-key-f { background: var(--sl-coral-dark); }
.sl-hit-key-j { background: var(--sl-cyan-dark); }
.sl-hit-key kbd { font-size: 1.7rem; }
.sl-hit-key span { font-size: .68rem; }
.sl-hit-key.is-down { transform: translateY(4px) scale(.98); filter: brightness(1.35); }

/* Results */
.sl-result {
  width: min(960px, calc(100% - 32px));
  min-height: calc(100vh - var(--nav-height) - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, .78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(30px, 7vw, 84px);
  padding: 50px 0;
}
.sl-result[hidden] { display: none; }
.sl-result-grade { text-align: center; }
.sl-result-grade p { font-size: .72rem; font-weight: 900; }
.sl-result-grade > strong { display: block; margin-top: -8px; font: 900 clamp(5rem, 15vw, 9rem)/1 var(--font-mono); }
.sl-result-report { padding: clamp(24px, 4vw, 42px); background: var(--sl-paper); border: 3px solid var(--sl-ink); border-radius: 14px; box-shadow: 10px 10px 0 var(--sl-ink); }
.sl-result-song { margin-bottom: 6px; color: #6b5e75; font-size: .72rem; font-weight: 800; }
.sl-result-report h2 { margin-bottom: 22px; color: var(--sl-ink); font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.03em; }
.sl-result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.sl-result-summary div { padding: 12px 8px; border-top: 2px solid var(--sl-ink); }
.sl-result-summary span { display: block; font-size: .63rem; color: #695d73; }
.sl-result-summary strong { font: 900 .92rem/1.5 var(--font-mono); }
.sl-judgement-list { display: grid; gap: 5px; }
.sl-judgement-list div { display: flex; justify-content: space-between; padding: 7px 11px; border-radius: 6px; font: 800 .72rem/1.4 var(--font-mono); }
.sl-judgement-list .is-perfect { background: #ffe990; }
.sl-judgement-list .is-great { background: #baf2ee; }
.sl-judgement-list .is-good { background: #ded5fa; }
.sl-judgement-list .is-miss { background: #ffd1cd; }
.sl-result-tip { margin: 18px 0; font-size: .78rem; line-height: 1.7; color: #53475e; }
.sl-practice-offer {
  margin: 0 0 18px;
  padding: 15px;
  color: #fff8e8;
  background: #173a37;
  border-left: 7px solid var(--sl-yellow);
  border-radius: 7px;
}
.sl-practice-offer[hidden] { display: none; }
.sl-practice-offer p { margin: 0 0 11px; font-size: .78rem; font-weight: 800; line-height: 1.5; }
.sl-practice-offer div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sl-practice-offer button {
  min-height: 46px;
  padding: 9px 12px;
  color: var(--sl-ink);
  background: var(--sl-yellow);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}
.sl-practice-offer button + button { background: #fff8e8; }
.sl-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-result-actions .sl-panel-secondary { margin: 0; color: var(--sl-ink); border-color: rgba(23,18,31,.52); }

body.sl-immersive { overflow: hidden; background: var(--sl-ink); }
body.sl-immersive .navbar,
body.sl-immersive .footer { display: none; }
body.sl-immersive .sl-page { min-height: 100dvh; }

/* Production song picker */
.sl-song-dialog {
  width: min(900px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  color: var(--sl-ink);
  background: #f7e5b0;
  border: 3px solid var(--sl-ink);
  border-radius: 16px;
  box-shadow: 12px 12px 0 rgba(29,39,37,.72);
}
.sl-song-dialog::backdrop { background: rgba(12,29,28,.76); backdrop-filter: blur(4px); }
.sl-song-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  background: #173a37;
  color: #fff8e8;
  border-bottom: 3px solid var(--sl-ink);
}
.sl-song-dialog-head p { margin: 0 0 3px; color: #f2c85b; font-size: .66rem; font-weight: 900; }
.sl-song-dialog-head h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.25rem); }
.sl-song-dialog-head button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--sl-ink);
  background: #f2c85b;
  border: 2px solid #fff8e8;
  border-radius: 50%;
  cursor: pointer;
  font: 900 1.5rem/1 sans-serif;
}
.sl-song-categories {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 9px clamp(16px, 4vw, 58px);
  background: #f7e5b0;
  border-bottom: 3px solid var(--sl-ink);
}
.sl-song-categories button {
  min-height: 42px;
  padding: 6px 8px;
  color: #4b514c;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font: 900 clamp(.78rem, 1.5vw, 1rem)/1 var(--font-display);
  transition: color .16s ease-out, background .16s ease-out, transform .2s cubic-bezier(.16,1,.3,1);
}
.sl-song-categories button:hover,
.sl-song-categories button:focus-visible { color: var(--sl-ink); border-color: var(--sl-coral-dark); }
.sl-song-categories button.is-active {
  color: var(--sl-ink);
  background: var(--sl-yellow);
  border-color: var(--sl-ink);
  box-shadow: 0 3px 0 var(--sl-coral-dark);
  transform: translateY(-2px);
}
.sl-song-wheel-shell {
  position: relative;
  overflow: hidden;
  background: #23403d;
  border-bottom: 3px solid var(--sl-ink);
}
.sl-song-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  height: min(560px, calc(100dvh - 205px));
  min-height: 330px;
  padding: clamp(98px, 16vh, 150px) clamp(48px, 7vw, 76px);
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
}
.sl-song-list::-webkit-scrollbar { display: none; }
.sl-song-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 11px 18px;
  color: var(--sl-ink);
  background: rgba(255,248,232,.72);
  border: 2px solid rgba(29,39,37,.28);
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  opacity: .42;
  scroll-snap-align: center;
  text-align: left;
  transform: scale(.91);
  transition: transform .22s cubic-bezier(.16,1,.3,1), opacity .18s ease-out, background .18s ease-out, border-color .18s ease-out;
}
.sl-song-card:hover { opacity: .78; border-color: var(--sl-yellow); background: #fff8e8; }
.sl-song-card:focus-visible { outline: 4px solid var(--sl-yellow); outline-offset: 3px; }
.sl-song-card.is-wheel-near { opacity: .7; transform: scale(.96); }
.sl-song-card.is-wheel-active {
  z-index: 2;
  min-height: 112px;
  opacity: 1;
  color: #fff8e8;
  background: var(--sl-coral-dark);
  border-color: #fff8e8;
  box-shadow: 0 7px 0 var(--sl-ink);
  transform: scale(1.035);
}
.sl-current-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  display: none;
  padding: 4px 8px;
  color: var(--sl-ink);
  background: var(--sl-yellow);
  border: 2px solid var(--sl-ink);
  border-radius: 4px;
  font: 900 .58rem/1 var(--font-mono);
}
.sl-song-card.is-selected .sl-current-badge { display: block; }
.sl-song-number { font: 900 1.2rem/1 var(--font-mono); color: #a84c42; }
.sl-song-number,
.sl-song-card-copy strong,
.sl-song-card-copy small,
.sl-song-record,
.sl-song-record b {
  transition: color .16s ease-out, font-size .2s cubic-bezier(.16,1,.3,1);
}
.sl-song-card.is-wheel-active .sl-song-number { color: var(--sl-yellow); font-size: 1.65rem; }
.sl-song-card-copy { display: grid; min-width: 0; gap: 2px; }
.sl-song-card-copy strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: clamp(1.05rem, 2.4vw, 1.38rem); line-height: 1.08; }
.sl-song-card.is-wheel-active .sl-song-card-copy strong { font-size: clamp(1.55rem, 4vw, 2.35rem); }
.sl-song-card-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #655a62; font-size: .7rem; }
.sl-song-card.is-wheel-active .sl-song-card-copy small { margin-top: 6px; color: #ffeec5; font-size: .78rem; }
.sl-song-record { min-width: 52px; text-align: right; color: #7b6e55; font: 800 .58rem/1.35 var(--font-mono); }
.sl-song-record b { display: block; color: #a8463e; font-size: .82rem; }
.sl-song-card.is-wheel-active .sl-song-record { color: #ffeec5; }
.sl-song-card.is-wheel-active .sl-song-record b { color: var(--sl-yellow); font-size: 1.08rem; }
.sl-song-step {
  position: absolute;
  z-index: 4;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  color: var(--sl-ink);
  background: var(--sl-yellow);
  border: 2px solid #fff8e8;
  border-radius: 5px;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 900;
  transform: translateX(-50%);
}
.sl-song-step:hover, .sl-song-step:focus-visible { background: #fff0a5; }
.sl-song-step-prev { top: 11px; }
.sl-song-step-next { bottom: 11px; }
.sl-song-step span { font-size: .8rem; }
.sl-song-counter {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 17px;
  color: #fff8e8;
  font: 900 .72rem/1 var(--font-mono);
}
.sl-song-list[data-direction="next"] .sl-song-card.is-wheel-active { animation: sl-song-next .25s cubic-bezier(.16,1,.3,1); }
.sl-song-list[data-direction="previous"] .sl-song-card.is-wheel-active { animation: sl-song-previous .25s cubic-bezier(.16,1,.3,1); }
@keyframes sl-song-next { from { opacity: .35; transform: translateY(28px) scale(.94); } }
@keyframes sl-song-previous { from { opacity: .35; transform: translateY(-28px) scale(.94); } }
.sl-song-dialog-foot { margin: 0; padding: 11px 18px 14px; color: #655a62; font-size: .65rem; }

/* Beginner mode retains the whole band but turns the outer members into the
   cheering section; the playable surface itself is an unmistakable 2K game. */
.sl-game.is-2k .sl-performer-d,
.sl-game.is-2k .sl-performer-k { opacity: .58; filter: saturate(.65); }
.sl-game.is-2k .sl-hit-key-d,
.sl-game.is-2k .sl-hit-key-k { display: none; }
.sl-game.is-2k .sl-hit-key-f,
.sl-game.is-2k .sl-hit-key-j { min-height: 70px; }
.sl-game.is-ending .sl-progress { box-shadow: 0 0 0 2px #f2c85b; }

@media (max-width: 820px) {
  .sl-menu { grid-template-columns: 1fr; width: min(650px, calc(100% - 30px)); }
  .sl-menu-art { min-height: 390px; order: -1; }
  .sl-menu-copy { max-width: none; }
  .sl-menu h1 { max-width: 12ch; }
  .sl-result { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sl-menu { min-height: auto; padding: 28px 0 50px; }
  .sl-menu-art { min-height: 270px; box-shadow: 7px 7px 0 var(--sl-ink); }
  .sl-menu-art > p, .sl-orbit { display: none; }
  .sl-beat-pal { width: 130px; gap: 22px; border-width: 4px; }
  .sl-pal-eye { width: 13px; height: 18px; }
  .sl-pal-mouth { bottom: 31px; width: 38px; height: 18px; border-width: 4px; }
  .sl-key-demo { width: 62px; height: 72px; }
  .sl-key-demo b { font-size: 1.45rem; }
  .sl-menu h1 { font-size: clamp(2.5rem, 11vw, 3.7rem); }
  .sl-difficulty { grid-template-columns: repeat(2, 1fr); }
  .sl-difficulty-option { grid-template-columns: 1fr; }
  .sl-difficulty-option i { display: none; }
  .sl-start { align-items: flex-start; flex-direction: column; gap: 1px; }
  .sl-game { padding-top: 6px; }
  .sl-game-hud { grid-template-columns: auto 1fr auto auto; gap: 8px; }
  .sl-progress { grid-column: 1 / -1; grid-row: 2; }
  .sl-track-name { min-width: 0; }
  .sl-track-name strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .sl-stage { height: calc(100dvh - 150px); min-height: 360px; }
  .sl-hit-controls { bottom: max(8px, env(safe-area-inset-bottom)); gap: 7px; }
  .sl-hit-key { min-height: 58px; }
  .sl-result-summary { grid-template-columns: 1fr; }
  .sl-result-summary div { display: flex; justify-content: space-between; }
  .sl-result-actions { grid-template-columns: 1fr; }
  .sl-song-list { min-height: 300px; padding-right: 22px; padding-left: 22px; }
  .sl-song-dialog-head { padding: 16px; }
  .sl-song-dialog-head p { max-width: 34ch; }
  .sl-song-card { grid-template-columns: 38px minmax(0, 1fr); min-height: 64px; gap: 10px; padding: 10px 12px; }
  .sl-song-card.is-wheel-active { min-height: 104px; transform: scale(1.01); }
  .sl-song-record { display: none; }
  .sl-current-badge { right: 10px; }
}

@media (hover: hover) and (min-width: 760px) {
  .sl-hit-controls { opacity: .68; }
  .sl-hit-key { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-beat-pal, .sl-pal-eye, .sl-countdown.is-pop, .sl-judge.is-show { animation: none; }
  .sl-judge.is-show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .sl-difficulty-option, .sl-start, .sl-stage, .sl-hit-key, .sl-song-card,
  .sl-song-card * { transition: none; }
  .sl-song-list { scroll-behavior: auto; }
  .sl-song-list[data-direction] .sl-song-card.is-wheel-active { animation: none; }
}

/* Phone results are a single console-style summary screen. The score,
   judgement breakdown, coaching action and exit controls all remain visible
   without requiring a post-song scroll. */
@media (max-width: 640px) {
  .sl-result {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: stretch;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .sl-result-grade {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 82px;
    text-align: center;
  }
  .sl-result-grade p {
    margin: 0;
  }
  .sl-result-grade > strong {
    margin: 0;
    font-size: 3.8rem;
    line-height: .88;
  }
  .sl-result-report {
    min-height: 0;
    padding: 10px 11px;
    overflow: hidden;
    border-width: 2px;
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--sl-ink);
  }
  .sl-result-song {
    margin: 0 0 2px;
    overflow: hidden;
    font-size: .66rem;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .sl-result-report h2 {
    margin: 0 0 7px;
    font-size: clamp(1.35rem, 7vw, 1.8rem);
    line-height: 1.05;
  }
  .sl-result-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 7px;
  }
  .sl-result-summary div {
    display: block;
    padding: 6px 4px 4px;
  }
  .sl-result-summary span { font-size: .55rem; }
  .sl-result-summary strong { font-size: .78rem; line-height: 1.3; }
  .sl-judgement-list { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .sl-judgement-list div {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 5px 2px;
    font-size: .57rem;
  }
  .sl-judgement-list dd { font-size: .82rem; }
  .sl-result-tip {
    display: -webkit-box;
    margin: 7px 0;
    overflow: hidden;
    font-size: .66rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .sl-practice-offer {
    margin-bottom: 7px;
    padding: 7px 8px;
    border-left-width: 4px;
  }
  .sl-practice-offer p {
    margin-bottom: 5px;
    overflow: hidden;
    font-size: .62rem;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .sl-practice-offer div { grid-template-columns: 1fr 1fr; gap: 5px; }
  .sl-practice-offer button { min-height: 36px; padding: 6px 4px; font-size: .68rem; }
  .sl-result-actions { grid-template-columns: 1fr 1fr; gap: 6px; }
  .sl-result-actions .sl-panel-primary,
  .sl-result-actions .sl-panel-secondary {
    min-height: 42px;
    padding: 8px;
    font-size: .8rem;
  }
}

@media (max-width: 640px) and (max-height: 700px) {
  .sl-result { gap: 5px; padding-top: max(5px, env(safe-area-inset-top)); }
  .sl-result-grade { min-height: 66px; }
  .sl-result-grade > strong { font-size: 3rem; }
  .sl-result-report { padding-block: 7px; }
  .sl-result-tip { -webkit-line-clamp: 1; }
}

/* 狸尾公寓樂團版 ------------------------------------------------------- */
.sl-page {
  background-color: #f1c75d;
  background-image: linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(64,43,29,.08) 1px, transparent 1px);
  background-size: 28px 28px;
}
.sl-brand { background: #173a37; }
.sl-start { background: #c95246; }
.sl-start:not(:disabled):hover { background: #b9443a; }
.sl-lead kbd + kbd { margin-left: 3px; }

.sl-menu-art {
  min-height: 600px;
  padding: 28px 22px 64px;
  place-items: stretch;
  background: linear-gradient(#224c49 0 56%, #c89459 56% 59%, #865238 59%);
  box-shadow: 12px 12px 0 var(--sl-ink);
}
.sl-menu-art::before {
  width: 170px;
  height: 170px;
  top: -55px;
  right: -42px;
  background: #efd98a;
  opacity: .9;
}
.sl-menu-art::after {
  inset: 12% 7% auto;
  width: auto;
  height: 42%;
  border: 2px solid rgba(255,248,232,.22);
  border-radius: 12px;
  background: linear-gradient(90deg, transparent 49.5%, rgba(255,248,232,.18) 50%, transparent 50.5%), linear-gradient(transparent 49.5%, rgba(255,248,232,.18) 50%, transparent 50.5%);
}
.sl-menu-band {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px 4px;
}
.sl-menu-band figure { position: relative; display: grid; min-width: 0; place-items: end center; margin: 0; }
.sl-menu-band img { width: min(100%, 235px); max-height: 235px; object-fit: contain; filter: drop-shadow(0 8px 0 rgba(29,39,37,.2)); }
.sl-menu-band figcaption {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 6px;
  padding: 7px 8px;
  color: var(--sl-ink);
  background: rgba(255,248,232,.92);
  border: 2px solid var(--sl-ink);
  border-radius: 7px;
  box-shadow: 0 3px 0 rgba(29,39,37,.6);
}
.sl-menu-band figcaption kbd { grid-row: 1 / 3; font: 900 1.2rem/1 var(--font-mono); }
.sl-menu-band figcaption b { font-size: .74rem; }
.sl-menu-band figcaption span { overflow: hidden; font-size: .58rem; white-space: nowrap; text-overflow: ellipsis; color: #58625f; }
.sl-menu-art > p { z-index: 2; color: #fff8e8; text-shadow: 0 2px 0 rgba(29,39,37,.65); }

.sl-game { background: #112725; }
.sl-game-hud { grid-template-columns: auto minmax(130px, 1fr) minmax(110px, 1.6fr) auto auto auto; }
.sl-section-cue {
  display: grid;
  min-width: 78px;
  padding: 5px 9px;
  line-height: 1.1;
  text-align: center;
  color: var(--sl-ink);
  background: var(--sl-yellow);
  border-radius: 6px;
  transform: rotate(-1deg);
}
.sl-section-cue span { font-size: .52rem; font-weight: 800; }
.sl-section-cue strong { font-size: .72rem; }
.sl-section-cue.is-change { animation: sl-cue-change .48s cubic-bezier(.2,.8,.2,1); }
@keyframes sl-cue-change { 0% { transform: rotate(-1deg) scale(.72); } 55% { transform: rotate(2deg) scale(1.1); } }

.sl-stage {
  display: grid;
  grid-template-rows: clamp(108px, 22vh, 170px) minmax(0, 1fr);
  background: #173a37;
  border-color: rgba(255,248,232,.24);
  box-shadow: 0 0 0 1px rgba(0,0,0,.22), 0 18px 42px rgba(0,0,0,.25);
}
.sl-stage.is-impact { transform: scale(.998); }
.sl-band {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  padding: 8px 7% 0;
  overflow: hidden;
  background: linear-gradient(rgba(15,40,38,.18), rgba(15,40,38,.78)), radial-gradient(circle at 50% -30%, #6f8a74, #214744 68%);
  border-bottom: 5px solid #9d6845;
}
.sl-band::before {
  content: '';
  position: absolute;
  inset: 10px 5% 16px;
  border: 1px solid rgba(255,248,232,.18);
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 24.7%, rgba(255,248,232,.09) 25%, transparent 25.3%, transparent 49.7%, rgba(255,248,232,.09) 50%, transparent 50.3%, transparent 74.7%, rgba(255,248,232,.09) 75%, transparent 75.3%);
}
.sl-performer { position: relative; z-index: 1; display: grid; height: 100%; min-width: 0; place-items: end center; margin: 0; transform-origin: 50% 100%; }
.sl-performer img { width: min(100%, 145px); height: calc(100% - 24px); object-fit: contain; object-position: center bottom; filter: drop-shadow(0 6px 0 rgba(10,28,27,.28)); }
.sl-performer figcaption {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 4px;
  color: #fff8e8;
  border-radius: 4px;
  background: rgba(17,39,37,.82);
  font-size: .56rem;
}
.sl-performer figcaption kbd { font: 900 .72rem/1 var(--font-mono); }
.sl-performer.is-hit { animation: sl-band-hit .24s cubic-bezier(.2,.8,.2,1); }
.sl-performer.is-perfect img { filter: drop-shadow(0 0 12px #f2c85b) drop-shadow(0 6px 0 rgba(10,28,27,.25)); }
.sl-performer.is-miss { animation: sl-band-miss .42s ease-out; }
@keyframes sl-band-hit { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-10px) rotate(-2deg) scale(1.045); } }
@keyframes sl-band-miss { 20% { transform: translateX(-5px) rotate(-2deg); } 45% { transform: translateX(5px) rotate(2deg); } 70% { transform: translateX(-3px); } }
.sl-neighbour-note {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 10px;
  margin: 0;
  padding: 4px 8px;
  color: #4a3425;
  background: #fff4d6;
  border: 1px solid rgba(74,52,37,.6);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(17,39,37,.45);
  font-size: .55rem;
  font-weight: 800;
  transform: rotate(1.5deg);
}
.sl-lane-viewport { position: relative; min-height: 0; overflow: hidden; }
#sl-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sl-stage[data-section="chorus"] .sl-band { background: linear-gradient(rgba(43,37,24,.12), rgba(17,39,37,.72)), radial-gradient(circle at 50% -20%, #c4a44b, #28534e 68%); }
.sl-stage[data-section="break"] .sl-band { background: linear-gradient(rgba(10,32,31,.08), rgba(10,32,31,.76)), radial-gradient(circle at 50% -20%, #a05a4a, #234743 68%); }
.sl-stage[data-section="break"] .sl-performer-k { transform: scale(1.08); }
.sl-pause-character { width: 92px; height: 92px; margin: 0 auto 8px; object-fit: contain; }

.sl-hit-controls { width: min(700px, calc(100% - 28px)); gap: 8px; }
.sl-hit-key { min-width: 0; padding: 6px; gap: 8px; border-color: rgba(255,248,232,.72); }
.sl-hit-key-d { background: #367f79; }
.sl-hit-key-f { background: #9b5c2f; }
.sl-hit-key-j { background: #83742e; }
.sl-hit-key-k { background: #a8463e; }

@media (max-width: 820px) {
  .sl-menu-art { min-height: 530px; }
  .sl-menu-band img { max-height: 210px; }
}

@media (max-width: 640px) {
  .sl-menu-art { min-height: 410px; padding: 16px 10px 44px; }
  .sl-menu-band { gap: 2px; }
  .sl-menu-band img { max-height: 160px; }
  .sl-menu-band figcaption { padding: 4px; }
  .sl-menu-band figcaption span { display: none; }
  .sl-game-hud { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .sl-section-cue { grid-column: 2; grid-row: 2; justify-self: start; min-width: 66px; }
  .sl-progress { grid-column: 1 / -1; grid-row: 3; }
  .sl-stage { height: calc(100dvh - 178px); min-height: 420px; grid-template-rows: 96px minmax(0, 1fr); }
  .sl-band { padding: 5px 2% 0; }
  .sl-performer img { width: 100%; height: calc(100% - 18px); }
  .sl-performer figcaption b { display: none; }
  .sl-neighbour-note { display: none; }
  .sl-hit-controls { gap: 4px; }
  .sl-hit-key { min-height: 55px; flex-direction: column; gap: 0; }
  .sl-hit-key kbd { font-size: 1.35rem; }
  .sl-hit-key span { font-size: .54rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-performer.is-hit, .sl-performer.is-miss, .sl-section-cue.is-change { animation: none; }
}

/* Console-flow pass: one choice at a time, large type, no heavyweight media. */
.sl-menu {
  min-height: 100dvh;
  padding: 24px 0;
}
.sl-menu-copy { width: 100%; }
.sl-menu-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 590px;
  margin-bottom: 18px;
}
.sl-menu-nav .sl-home-link { margin: 0; }
.sl-menu h1 { margin-bottom: 12px; font-size: clamp(2.8rem, 5vw, 4.5rem); }
.sl-lead { margin-bottom: 18px; font-size: 1rem; line-height: 1.55; }
.sl-flow-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  font-size: .88rem;
  font-weight: 900;
}
.sl-flow-label span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff8e8;
  background: #173a37;
  border-radius: 50%;
  font: 900 .72rem/1 var(--font-mono);
}
.sl-song-line { margin-bottom: 17px; }
.sl-difficulty { margin-bottom: 10px; }
.sl-difficulty-copy { min-height: 42px; margin-bottom: 10px; }
.sl-menu-help {
  margin-top: 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  color: #3f4c49;
  font-size: .75rem;
  font-weight: 800;
}
.sl-menu-help kbd {
  padding: 3px 6px;
  color: #fff8e8;
  background: #173a37;
  border-radius: 4px;
  font: 800 .7rem/1 var(--font-mono);
}
.sl-copyright {
  margin-top: 6px;
  color: #3f4c49;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.sl-song-dialog {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.sl-song-dialog::backdrop { background: #173a37; backdrop-filter: none; }
.sl-song-dialog-head { min-height: 104px; padding: 20px clamp(22px, 5vw, 72px); }
.sl-song-dialog-head p { font-size: .82rem; }
.sl-song-dialog-head h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.sl-song-wheel-shell { height: calc(100dvh - 157px); }
.sl-song-list {
  height: 100%;
  padding: clamp(96px, 13vh, 140px) clamp(48px, 13vw, 210px);
}
.sl-song-card,
.sl-song-card.is-wheel-active {
  min-height: 92px;
  transition: transform .2s cubic-bezier(.16,1,.3,1), opacity .16s ease-out, background .16s ease-out, border-color .16s ease-out;
}
.sl-song-card.is-wheel-active { transform: scale(1.035); }
.sl-song-dialog-foot { height: 53px; padding: 15px clamp(22px, 5vw, 72px); font-size: .75rem; }

body.sl-low-fx .sl-stage,
body.sl-low-fx .sl-menu-art,
body.sl-low-fx .sl-result-report { box-shadow: none; }
body.sl-low-fx .sl-menu-art::before,
body.sl-low-fx .sl-menu-art::after { display: none; }
body.sl-low-fx .sl-performer img,
body.sl-low-fx .sl-menu-band img,
body.sl-low-fx .sl-game.is-2k .sl-performer-d,
body.sl-low-fx .sl-game.is-2k .sl-performer-k { filter: none; }
body.sl-low-fx .sl-performer,
body.sl-low-fx .sl-section-cue,
body.sl-low-fx .sl-judge,
body.sl-low-fx .sl-countdown,
body.sl-low-fx .sl-song-card,
body.sl-low-fx .sl-band.is-section-change .sl-performer { animation: none !important; transition: none !important; }
body.sl-low-fx .sl-song-card * { transition: none !important; }

@media (max-width: 820px) {
  .sl-menu { position: relative; display: block; width: 100%; padding: 20px max(18px, env(safe-area-inset-left)); }
  .sl-menu-copy { position: relative; z-index: 2; max-width: 620px; margin: 0 auto; }
  .sl-menu-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    min-height: 100%;
    height: 100%;
    opacity: .13;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
  }
  .sl-menu-art > p, .sl-menu-band figcaption { display: none; }
}

@media (max-width: 640px) {
  .sl-menu { min-height: 100dvh; padding-top: 14px; padding-bottom: 14px; }
  .sl-menu-nav { margin-bottom: 10px; }
  .sl-brand { margin-bottom: 10px; }
  .sl-menu h1 { max-width: none; margin-bottom: 8px; font-size: 2.55rem; }
  .sl-lead { margin-bottom: 11px; font-size: .9rem; line-height: 1.4; }
  .sl-flow-label { margin-bottom: 5px; font-size: .78rem; }
  .sl-song-line { min-height: 62px; margin-bottom: 10px; padding: 8px 11px; }
  .sl-difficulty { margin-bottom: 7px; }
  .sl-difficulty-option { min-height: 67px; padding: 8px 6px; }
  .sl-difficulty-copy { min-height: 34px; margin-bottom: 6px; font-size: .7rem; }
  .sl-start { min-height: 56px; }
  .sl-menu-help { margin-top: 10px; font-size: .66rem; }
  .sl-song-dialog-head { min-height: 88px; padding: 13px 16px; }
  .sl-song-dialog-head p { font-size: .68rem; }
  .sl-song-dialog-head h2 { font-size: 1.8rem; }
  .sl-song-wheel-shell { height: calc(100dvh - 133px); }
  .sl-song-list { min-height: 0; padding: 82px 18px; }
  .sl-song-card,
  .sl-song-card.is-wheel-active { min-height: 78px; }
  .sl-song-card.is-wheel-active { transform: scale(1.01); }
  .sl-song-dialog-foot { height: 45px; padding: 12px 16px; font-size: .64rem; }
}

/* Living-room scale: primary information remains readable from a TV distance. */
.sl-touch-hint { display: none; }
.sl-home-link {
  padding: 8px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

@media (min-width: 900px) {
  html { font-size: 18px; }
  .sl-menu {
    width: min(1500px, calc(100% - 72px));
    grid-template-columns: minmax(620px, 1fr) minmax(440px, .8fr);
    gap: clamp(48px, 6vw, 110px);
  }
  .sl-menu-copy { max-width: 760px; }
  .sl-menu-nav,
  .sl-song-line,
  .sl-difficulty { max-width: 720px; }
  .sl-home-link { font-size: 1rem; }
  .sl-brand { font-size: 1rem; }
  .sl-menu h1 { max-width: 11ch; font-size: 4.6rem; line-height: .98; }
  .sl-lead { max-width: 48ch; font-size: 1.2rem; line-height: 1.5; }
  .sl-flow-label { font-size: 1.08rem; }
  .sl-flow-label span { width: 32px; height: 32px; font-size: .9rem; }
  .sl-song-line { min-height: 84px; padding: 14px 18px; }
  .sl-vinyl { width: 54px; height: 54px; flex-basis: 54px; }
  .sl-vinyl i { inset: 18px; }
  .sl-song-line strong { font-size: 1.45rem; line-height: 1.2; }
  .sl-song-line small,
  .sl-song-change { font-size: 1rem; }
  .sl-difficulty-option { min-height: 104px; padding: 14px 12px; }
  .sl-difficulty-option b { font-size: 1.4rem; }
  .sl-difficulty-option span { font-size: 1rem; }
  .sl-difficulty-option i { width: 38px; height: 38px; font-size: 1.1rem; }
  .sl-difficulty-copy { min-height: 58px; font-size: 1.05rem; line-height: 1.55; }
  .sl-start { min-height: 78px; }
  .sl-start span { font-size: 1.5rem; }
  .sl-start small { font-size: .95rem; }
  .sl-menu-help { font-size: 1rem; }
  .sl-menu-help kbd { font-size: .9rem; }
  .sl-difficulty legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .sl-menu-band figcaption kbd { font-size: 1.45rem; }
  .sl-menu-band figcaption b { font-size: 1rem; }
  .sl-menu-band figcaption span { font-size: .8rem; }
  .sl-menu-art > p { font-size: 1rem; }
  .sl-menu-art { min-height: 0; height: min(790px, calc(100dvh - 56px)); }

  .sl-song-dialog-head { min-height: 126px; }
  .sl-song-dialog-head p { font-size: 1rem; }
  .sl-song-dialog-head h2 { font-size: 3rem; }
  .sl-song-dialog-head button { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.8rem; }
  .sl-song-wheel-shell { height: calc(100dvh - 190px); }
  .sl-song-dialog-foot { height: 64px; font-size: 1rem; }
  .sl-song-card,
  .sl-song-card.is-wheel-active { min-height: 108px; padding: 14px 24px; }
  .sl-song-number { font-size: 1.5rem; }
  .sl-song-card-copy strong { font-size: 1.45rem; }
  .sl-song-card-copy small { font-size: 1rem; }
  .sl-song-card.is-wheel-active .sl-song-number { font-size: 2rem; }
  .sl-song-card.is-wheel-active .sl-song-card-copy strong { font-size: 3rem; }
  .sl-song-card.is-wheel-active .sl-song-card-copy small { font-size: 1.1rem; }
  .sl-song-record { min-width: 74px; font-size: .9rem; }
  .sl-song-record b { font-size: 1.15rem; }
  .sl-song-step { min-height: 46px; padding: 9px 20px; font-size: 1rem; }
  .sl-song-counter { font-size: 1rem; }

  .sl-game-hud { min-height: 86px; padding: 12px 20px; gap: 18px; }
  .sl-icon-button { width: 54px; height: 54px; font-size: 1.3rem; }
  .sl-track-name strong { font-size: 1.35rem; }
  .sl-track-name span { font-size: .95rem; }
  .sl-section-cue { min-width: 112px; padding: 8px 12px; }
  .sl-section-cue span { font-size: .8rem; }
  .sl-section-cue strong { font-size: 1.05rem; }
  .sl-hud-stat span { font-size: .9rem; }
  .sl-hud-stat strong { font-size: 1.35rem; }
  .sl-progress { height: 10px; }
  .sl-performer figcaption { min-height: 30px; font-size: .85rem; }
  .sl-performer figcaption kbd { font-size: 1rem; }
  .sl-neighbour-note { padding: 7px 11px; font-size: .85rem; }
  .sl-hit-key kbd { font-size: 2rem; }
  .sl-hit-key span { font-size: .9rem; }
  .sl-judge strong { font-size: clamp(2.4rem, 4vw, 4rem); }
  .sl-judge span { font-size: 1rem; }

  .sl-result-song { font-size: 1rem; }
  .sl-result-report h2 { font-size: 3rem; }
  .sl-result-summary span { font-size: .9rem; }
  .sl-result-summary strong { font-size: 1.35rem; }
  .sl-judgement-list div { font-size: 1.05rem; }
  .sl-result-tip { font-size: 1.05rem; }
  .sl-panel-primary,
  .sl-panel-secondary { min-height: 58px; font-size: 1rem; }

}

/* Touch uses the same engine and charts, with controls sized for thumbs. */
body.sl-touch .sl-keyboard-hint { display: none; }
body.sl-touch .sl-touch-hint { display: inline; }
body.sl-touch .sl-hit-controls {
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  width: auto;
  max-width: none;
  gap: 8px;
  opacity: 1;
  transform: none;
}
body.sl-touch .sl-hit-key {
  min-height: 88px;
  padding: 10px 6px;
  touch-action: none;
  user-select: none;
}
body.sl-touch .sl-game.is-2k .sl-hit-key-f,
body.sl-touch .sl-game.is-2k .sl-hit-key-j { min-height: 104px; }
body.sl-touch .sl-hit-key kbd { font-size: 2rem; }
body.sl-touch .sl-hit-key span { font-size: .85rem; }
body.sl-touch .sl-song-card { touch-action: pan-y; }

@media (pointer: coarse) and (min-width: 700px) {
  body.sl-touch .sl-hit-controls { right: 4vw; left: 4vw; gap: 14px; }
  body.sl-touch .sl-hit-key { min-height: 112px; }
  body.sl-touch .sl-game.is-2k .sl-hit-key-f,
  body.sl-touch .sl-game.is-2k .sl-hit-key-j { min-height: 128px; }
  body.sl-touch .sl-hit-key kbd { font-size: 2.6rem; }
  body.sl-touch .sl-hit-key span { font-size: 1.1rem; }
}

@media (min-width: 900px) and (max-height: 800px) {
  html { font-size: 16px; }
  .sl-menu { min-height: 100dvh; padding: 12px 0; gap: 42px; }
  .sl-menu-nav { margin-bottom: 8px; }
  .sl-brand { margin-bottom: 8px; padding: 5px 9px; }
  .sl-menu h1 { margin-bottom: 6px; font-size: 3.35rem; }
  .sl-lead { margin-bottom: 8px; font-size: 1rem; line-height: 1.35; }
  .sl-flow-label { margin-bottom: 4px; font-size: .9rem; }
  .sl-flow-label span { width: 26px; height: 26px; font-size: .75rem; }
  .sl-song-line { min-height: 64px; margin-bottom: 8px; padding: 8px 12px; }
  .sl-vinyl { width: 44px; height: 44px; flex-basis: 44px; }
  .sl-vinyl i { inset: 14px; }
  .sl-song-line strong { font-size: 1.3rem; }
  .sl-song-line small,
  .sl-song-change { font-size: .85rem; }
  .sl-difficulty { margin-bottom: 6px; }
  .sl-difficulty-option { min-height: 76px; padding: 8px; }
  .sl-difficulty-option b { font-size: 1.2rem; }
  .sl-difficulty-option span { font-size: .85rem; }
  .sl-difficulty-option i { width: 30px; height: 30px; font-size: .9rem; }
  .sl-difficulty-copy { min-height: 38px; margin-bottom: 5px; font-size: .9rem; line-height: 1.35; }
  .sl-start { min-height: 60px; }
  .sl-start span { font-size: 1.3rem; }
  .sl-start small { font-size: .82rem; }
  .sl-menu-help { margin-top: 8px; font-size: .85rem; }
  .sl-menu-art { height: calc(100dvh - 24px); }
}

@media (max-width: 640px) {
  .sl-song-card-copy strong { font-size: 1.15rem; }
  .sl-song-card-copy small { font-size: .78rem; }
  .sl-song-card.is-wheel-active .sl-song-card-copy strong { font-size: 2rem; }
  .sl-song-card.is-wheel-active .sl-song-card-copy small { font-size: .9rem; }
  .sl-menu-help { font-size: .78rem; }
  .sl-track-name strong { font-size: .9rem; }
  .sl-track-name span { font-size: .72rem; }
  .sl-hud-stat span { font-size: .68rem; }
  .sl-hud-stat strong { font-size: .9rem; }
}

/* Gameplay attention hierarchy ------------------------------------------------
   The note highway owns central vision. Song identity sits on its upper edge;
   progress becomes a bright peripheral rail, and character motion expands only
   during low-density musical breathing room. */
.sl-game-hud {
  width: min(880px, 100%);
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
}
.sl-game-hud .sl-section-cue { justify-self: start; }

.sl-stage-now-playing {
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: start;
  gap: 2px;
  color: #fff8e8;
}
.sl-stage-now-playing span {
  color: var(--sl-yellow);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}
.sl-stage-now-playing strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 1.32rem;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sl-stage-now-playing small {
  color: #d6dfdc;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.sl-band .sl-performer {
  height: auto;
  align-self: stretch;
  padding-bottom: 0;
}
.sl-band .sl-performer img { height: calc(100% - 12px); max-height: 100%; }
.sl-band .sl-performer figcaption { display: none; }

.sl-lane-viewport .sl-progress {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  bottom: 0;
  width: 12px;
  height: auto;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 248, 232, .13);
  box-shadow: -1px 0 rgba(255, 248, 232, .22);
  pointer-events: none;
}
.sl-lane-viewport .sl-progress i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--song-progress, 0%);
  background: var(--sl-yellow);
  box-shadow: 0 -5px 12px rgba(242, 200, 91, .72);
  transition: height .12s linear;
}

@keyframes sl-band-hit-focused {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-3px) scale(1.012); }
}
@keyframes sl-section-band-cue {
  0% { transform: translateY(0); }
  42% { transform: translateY(-5px); }
  72% { transform: translateY(1px); }
}
.sl-band.is-section-change .sl-performer { animation: sl-section-band-cue .48s both cubic-bezier(.2,.8,.2,1); }
.sl-band.is-section-change .sl-performer:nth-child(2) { animation-delay: 35ms; }
.sl-band.is-section-change .sl-performer:nth-child(3) { animation-delay: 70ms; }
.sl-band.is-section-change .sl-performer:nth-child(4) { animation-delay: 105ms; }

.sl-stage:not(.is-visual-rest) .sl-performer.is-hit {
  animation: sl-band-hit-focused .16s cubic-bezier(.2,.8,.2,1);
}
.sl-stage:not(.is-visual-rest) .sl-performer.is-perfect img {
  filter: drop-shadow(0 6px 0 rgba(10,28,27,.25));
}
.sl-stage.is-visual-rest .sl-band {
  filter: brightness(1.035);
}

@media (min-width: 900px) {
  .sl-stage-now-playing span { font-size: .76rem; }
  .sl-stage-now-playing strong { font-size: 1.45rem; }
  .sl-stage-now-playing small { font-size: .8rem; }
  .sl-lane-viewport .sl-progress { width: 15px; }
}

@media (max-width: 640px) {
  .sl-game-hud { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .sl-stage-now-playing { grid-column: 2; grid-row: 1; gap: 1px; }
  .sl-stage-now-playing span { font-size: .58rem; }
  .sl-stage-now-playing strong { font-size: 1rem; }
  .sl-stage-now-playing small { font-size: .6rem; }
  .sl-band .sl-performer img { height: calc(100% - 8px); }
  .sl-lane-viewport .sl-progress { width: 9px; }
  .sl-practice-offer div { grid-template-columns: 1fr; }
}

/* Real wheel end-caps: the first and last songs need half a viewport of
   breathing room or native wheel/touch scrolling can never place them on the
   selection axis. Pseudo grid rows scale with the actual list height. */
.sl-song-list {
  --sl-song-wheel-cap: 0px;
  padding-block: 0;
}
.sl-song-list::before,
.sl-song-list::after {
  content: "";
  display: block;
  height: var(--sl-song-wheel-cap);
  pointer-events: none;
}

/* Content rows keep every category and wheel end-cap inside the viewport. */
.sl-song-dialog[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.sl-song-dialog[open] .sl-song-wheel-shell {
  height: auto;
  min-height: 0;
}
.sl-song-dialog[open] .sl-song-list { min-height: 0; }

@media (max-width: 700px) {
  .sl-song-categories { gap: 4px; padding: 7px 8px; }
  .sl-song-categories button { min-height: 38px; padding-inline: 3px; font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-lane-viewport .sl-progress i { transition: none; }
  .sl-stage.is-visual-rest .sl-band { filter: none; }
  .sl-band.is-section-change { animation: none; }
}

@media (max-width: 640px) {
  .sl-result .sl-practice-offer div { grid-template-columns: 1fr 1fr; }
}

/* Release shell: every public state owns the viewport; the song wheel keeps
   its intentional internal gesture while the document itself never scrolls. */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-width: 320px;
}

.sl-page {
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
}

.sl-page small {
  font-size: 1rem;
}

.sl-menu,
.sl-result {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sl-menu-art {
  min-height: 0;
  height: min(790px, calc(100dvh - 48px));
}

.sl-menu h1 {
  font-size: clamp(3rem, 5.5vw, 5.2rem);
}

.sl-home-link,
.sl-brand,
.sl-menu-art > p,
.sl-key-demo span,
.sl-menu-band figcaption b,
.sl-menu-band figcaption span,
.sl-song-categories button,
.sl-judge span,
.sl-combo span,
.sl-performer figcaption kbd,
.sl-song-record b {
  font-size: 1rem;
}

.sl-lead,
.sl-difficulty-copy,
.sl-menu-help,
.sl-copyright {
  font-size: 1rem;
  line-height: 1.45;
}

.sl-flow-label {
  font-size: 1.05rem;
}

.sl-flow-label span {
  width: 30px;
  height: 30px;
  font-size: .95rem;
}

.sl-song-line {
  min-height: 76px;
}

.sl-song-line strong {
  font-size: 1.25rem;
}

.sl-song-line small,
.sl-song-change {
  font-size: 1rem;
}

.sl-difficulty-option {
  min-height: 90px;
}

.sl-difficulty-option b {
  font-size: 1.2rem;
}

.sl-difficulty-option span {
  font-size: 1rem;
}

.sl-difficulty-option i {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.sl-start {
  min-height: 70px;
}

.sl-start span {
  font-size: 1.3rem;
}

.sl-start small {
  font-size: 1rem;
}

.sl-copyright {
  max-width: 62ch;
  margin-top: 14px;
  color: #3f4c49;
  font-weight: 800;
}

.sl-song-dialog-head p,
.sl-song-dialog-foot,
.sl-song-step,
.sl-song-counter,
.sl-song-card-copy small,
.sl-song-record,
.sl-current-badge {
  font-size: 1rem;
}

.sl-song-card-copy strong {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}

.sl-song-card.is-wheel-active .sl-song-card-copy strong {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.sl-game {
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.sl-game-hud {
  grid-row: 1;
  min-height: 0;
  margin-bottom: 8px;
}

.sl-stage {
  grid-row: 2;
  height: auto;
  min-height: 0;
  max-height: none;
}

.sl-hit-controls,
body.sl-touch .sl-hit-controls {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  grid-row: 3;
  width: min(760px, 100%);
  margin: 10px auto 0;
  transform: none;
}

.sl-hit-key {
  min-height: 74px;
}

.sl-hit-key kbd {
  font-size: 2rem;
}

.sl-hit-key span {
  font-size: 1rem;
}

.sl-hud-stat span,
.sl-stage-now-playing span,
.sl-stage-now-playing small,
.sl-section-cue span,
.sl-neighbour-note,
.sl-performer figcaption {
  font-size: 1rem;
}

.sl-hud-stat strong {
  font-size: 1.25rem;
}

.sl-stage-now-playing strong {
  font-size: 1.35rem;
}

.sl-section-cue strong {
  font-size: 1.1rem;
}

.sl-judge strong {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.sl-combo strong {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.sl-combo span {
  font-size: .9rem;
}

.sl-pause-panel p,
.sl-result-song,
.sl-result-summary span,
.sl-result-summary strong,
.sl-judgement-list div,
.sl-result-tip,
.sl-practice-offer p,
.sl-practice-offer button {
  font-size: 1rem;
}

.sl-result-report h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.sl-result-summary strong {
  font-size: 1.25rem;
}

.sl-result-grade p {
  font-size: 1rem;
}

.sl-result-actions .sl-panel-primary,
.sl-result-actions .sl-panel-secondary,
.sl-panel-primary,
.sl-panel-secondary {
  min-height: 58px;
  font-size: 1.05rem;
}

@media (max-width: 820px) {
  .sl-menu {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .sl-menu-copy {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(720px, 100%);
    height: 100%;
    min-height: 0;
    flex-direction: column;
    margin: 0 auto;
    overflow: hidden;
  }

  .sl-menu-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    opacity: .12;
    pointer-events: none;
  }

  .sl-menu-nav {
    flex: 0 0 auto;
  }

  .sl-menu h1 {
    flex: 0 0 auto;
    margin-bottom: 14px;
  }

  .sl-song-line,
  .sl-difficulty,
  .sl-start {
    flex: 0 0 auto;
  }

  .sl-difficulty-copy {
    overflow: hidden;
  }

  .sl-copyright {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 10px;
  }

  .sl-menu-help {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .sl-menu {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sl-menu-nav {
    margin-bottom: 8px;
  }

  .sl-home-link {
    min-height: 44px;
    font-size: 1rem;
  }

  .sl-brand {
    margin-bottom: 8px;
    font-size: 1rem;
  }

  .sl-menu h1 {
    margin-bottom: 10px;
    font-size: clamp(2.6rem, 11vw, 4rem);
  }

  .sl-lead {
    display: none;
  }

  .sl-flow-label {
    margin-bottom: 6px;
    font-size: 1rem;
  }

  .sl-song-line {
    min-height: 68px;
    margin-bottom: 10px;
  }

  .sl-song-line strong {
    font-size: 1.2rem;
  }

  .sl-song-line small,
  .sl-song-change {
    font-size: 1rem;
  }

  .sl-difficulty {
    gap: 6px;
    margin-bottom: 8px;
  }

  .sl-difficulty-option {
    min-height: 74px;
    padding: 8px;
  }

  .sl-difficulty-option b {
    font-size: 1.05rem;
  }

  .sl-difficulty-option span {
    font-size: 1rem;
  }

  .sl-difficulty-option i {
    width: 30px;
    height: 30px;
    font-size: .95rem;
  }

  .sl-difficulty-copy {
    display: -webkit-box;
    min-height: 42px;
    margin-bottom: 8px;
    font-size: .95rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .sl-start {
    min-height: 64px;
  }

  .sl-start span,
  .sl-start small {
    font-size: 1.1rem;
  }

  .sl-menu-help {
    display: none;
  }

  .sl-copyright {
    font-size: 1rem;
  }

  .sl-game {
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .sl-game-hud {
    gap: 6px;
    margin-bottom: 6px;
  }

  .sl-icon-button {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .sl-stage-now-playing span,
  .sl-stage-now-playing small,
  .sl-section-cue span,
  .sl-hud-stat span {
    font-size: 1rem;
  }

  .sl-stage-now-playing strong {
    font-size: 1.1rem;
  }

  .sl-hud-stat strong {
    font-size: 1rem;
  }

  .sl-stage {
    min-height: 0;
    border-radius: 8px;
  }

  .sl-hit-controls,
  body.sl-touch .sl-hit-controls {
    gap: 6px;
    margin-top: 8px;
  }

  .sl-hit-key,
  body.sl-touch .sl-hit-key {
    min-height: 82px;
  }

  .sl-hit-key kbd,
  body.sl-touch .sl-hit-key kbd {
    font-size: 1.8rem;
  }

  .sl-hit-key span,
  body.sl-touch .sl-hit-key span {
    font-size: .95rem;
  }

  .sl-result {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .sl-result-grade {
    min-height: 82px;
  }

  .sl-result-grade p,
  .sl-result-song,
  .sl-result-summary span,
  .sl-result-summary strong,
  .sl-judgement-list div,
  .sl-result-tip,
  .sl-practice-offer p,
  .sl-practice-offer button {
    font-size: 1rem;
  }

  .sl-result-grade > strong {
    font-size: 4rem;
  }

  .sl-result-report {
    min-height: 0;
    padding: 12px;
  }

  .sl-result-report h2 {
    margin-bottom: 8px;
    font-size: clamp(1.7rem, 7vw, 2.35rem);
  }

  .sl-result-summary {
    margin-bottom: 8px;
  }

  .sl-result-summary div {
    padding: 7px 5px;
  }

  .sl-judgement-list div {
    padding: 6px 3px;
  }

  .sl-result-tip {
    margin: 8px 0;
    line-height: 1.35;
  }

  .sl-practice-offer {
    margin-bottom: 8px;
    padding: 8px;
  }

  .sl-practice-offer button,
  .sl-result-actions .sl-panel-primary,
  .sl-result-actions .sl-panel-secondary {
    min-height: 48px;
    padding: 8px;
    font-size: .95rem;
  }

}

@media (max-height: 720px) {
  .sl-menu {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .sl-menu h1 {
    margin-bottom: 6px;
  }

  .sl-difficulty-option {
    min-height: 68px;
  }

  .sl-difficulty-copy {
    min-height: 34px;
    margin-bottom: 6px;
  }

  .sl-copyright {
    padding-top: 6px;
    font-size: 1rem;
    line-height: 1.25;
  }

  .sl-hit-key,
  body.sl-touch .sl-hit-key {
    min-height: 68px;
  }
}

@media (pointer: coarse) and (min-width: 700px) {
  .sl-hit-key,
  body.sl-touch .sl-hit-key {
    min-height: 112px;
  }
}

/* Keep the release shell inside the real visual viewport on mobile browsers. */
.sl-page {
  height: var(--rl-viewport-height);
  min-height: var(--rl-viewport-height);
}

.sl-menu {
  height: var(--rl-viewport-height);
  min-height: var(--rl-viewport-height);
}

.sl-menu-copy,
.sl-menu-nav,
.sl-song-line,
.sl-difficulty,
.sl-difficulty-copy,
.sl-start,
.sl-copyright {
  min-width: 0;
  max-width: 100%;
}

.sl-menu-copy {
  width: 100%;
}

.sl-song-line > span:nth-child(2),
.sl-song-line strong,
.sl-song-line small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sl-start small,
.sl-copyright {
  overflow-wrap: anywhere;
}

.sl-game {
  height: var(--rl-viewport-height);
  min-height: var(--rl-viewport-height);
}

@media (max-width: 820px) {
  .sl-menu {
    box-sizing: border-box;
  }

  .sl-menu-copy {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    flex: 0 1 auto;
  }

  .sl-menu-nav,
  .sl-song-line,
  .sl-difficulty,
  .sl-start {
    width: 100%;
  }
}

/* Final mobile menu contract.
   The menu is a fixed scene, so its content is deliberately budgeted instead
   of being clipped by a full-height flex child when browser chrome changes. */
@media (max-width: 820px) {
  .sl-page,
  .sl-menu {
    width: var(--rl-viewport-width, 100vw);
    height: var(--rl-viewport-height, 100dvh);
    min-height: 0;
    max-height: var(--rl-viewport-height, 100dvh);
  }

  .sl-menu {
    display: block;
    padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .sl-menu-copy {
    display: flex;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    flex-direction: column;
    overflow: hidden;
  }

  .sl-menu-nav {
    flex: 0 0 auto;
    margin: 0 0 2px;
    line-height: 1;
  }

  .sl-home-link {
    min-height: 30px;
    margin: 0;
    font-size: clamp(.78rem, 2.6vw, 1rem);
  }

  .sl-brand {
    flex: 0 0 auto;
    margin: 0 0 3px;
    padding: 4px 8px;
    font-size: clamp(.72rem, 2.5vw, .9rem);
  }

  .sl-menu h1 {
    flex: 0 0 auto;
    max-width: none;
    margin: 0 0 4px;
    font-size: clamp(2.1rem, 9vw, 3.5rem);
    line-height: .88;
  }

  .sl-lead {
    display: none;
  }

  .sl-flow-label {
    flex: 0 0 auto;
    gap: 6px;
    margin: 0 0 3px;
    font-size: clamp(.8rem, 2.8vw, 1rem);
    line-height: 1;
  }

  .sl-flow-label + .sl-flow-label {
    margin-top: 6px;
  }

  .sl-flow-label span {
    width: 22px;
    height: 22px;
    font-size: .72rem;
  }

  .sl-song-line {
    flex: 0 0 auto;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 6px 9px;
    gap: 8px;
  }

  .sl-vinyl {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .sl-vinyl i {
    inset: 13px;
  }

  .sl-song-line strong {
    font-size: clamp(.96rem, 3.8vw, 1.2rem);
    line-height: 1.1;
  }

  .sl-song-line small,
  .sl-song-change {
    font-size: clamp(.66rem, 2.7vw, .82rem);
  }

  .sl-difficulty {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
  }

  .sl-difficulty legend {
    margin-bottom: 3px;
    font-size: clamp(.72rem, 2.6vw, .9rem);
  }

  .sl-difficulty-option {
    min-height: 48px;
    padding: 6px 7px;
    border-width: 2px;
    border-radius: 7px;
  }

  .sl-difficulty-option b {
    font-size: clamp(.82rem, 3.3vw, 1.08rem);
    line-height: 1.05;
  }

  .sl-difficulty-option span {
    font-size: clamp(.58rem, 2.5vw, .76rem);
    line-height: 1.05;
  }

  .sl-difficulty-option i {
    display: grid;
    width: 23px;
    height: 23px;
    font-size: .7rem;
  }

  .sl-difficulty-copy {
    display: -webkit-box;
    flex: 0 0 auto;
    min-height: 0;
    height: 2.45em;
    max-width: none;
    margin: 4px 0;
    overflow: hidden;
    font-size: clamp(.64rem, 2.7vw, .78rem);
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .sl-start {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    min-height: 54px;
    height: 54px;
    padding: 7px 10px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .sl-start span {
    font-size: clamp(.96rem, 4vw, 1.2rem);
  }

  .sl-start small {
    font-size: clamp(.62rem, 2.6vw, .76rem);
    text-align: right;
  }

  .sl-menu-help {
    display: none;
  }

  .sl-copyright {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 4px;
    font-size: clamp(.62rem, 2.5vw, .76rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 820px) and (max-height: 720px) {
  .sl-menu {
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }

  .sl-menu-nav {
    margin-bottom: 0;
  }

  .sl-home-link {
    min-height: 26px;
  }

  .sl-brand {
    margin-bottom: 1px;
    padding-block: 3px;
  }

  .sl-menu h1 {
    margin-bottom: 2px;
    font-size: clamp(1.9rem, 8.4vw, 2.8rem);
  }

  .sl-flow-label {
    margin-bottom: 2px;
    font-size: .78rem;
  }

  .sl-flow-label + .sl-flow-label {
    margin-top: 4px;
  }

  .sl-flow-label span {
    width: 20px;
    height: 20px;
  }

  .sl-song-line {
    min-height: 48px;
    padding-block: 5px;
  }

  .sl-vinyl {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .sl-vinyl i {
    inset: 11px;
  }

  .sl-difficulty {
    gap: 3px;
  }

  .sl-difficulty-option {
    min-height: 42px;
    padding: 5px 6px;
  }

  .sl-difficulty-copy {
    height: 1.2em;
    margin: 3px 0;
    -webkit-line-clamp: 1;
  }

  .sl-start {
    min-height: 48px;
    height: 48px;
    padding-block: 5px;
  }

  .sl-copyright {
    padding-top: 2px;
    font-size: .6rem;
  }
}

@media (min-width: 821px) {
  /* The keyboard legend duplicates the visible controls and was the only
     block pushing the legal notice below a 900px desktop viewport. */
  .sl-menu-help {
    display: none;
  }
}

/* Final mobile readability contract.
   Increase the primary controls after the viewport budget is fixed; the
   non-essential lead text remains hidden so short phones do not clip the
   start button or legal notice. */
@media (max-width: 820px) {
  .sl-brand {
    font-size: clamp(.8rem, 2.8vw, 1rem);
  }

  .sl-menu h1 {
    margin-bottom: 6px;
    font-size: clamp(2.35rem, 10.5vw, 3.8rem);
    line-height: .9;
  }

  .sl-flow-label {
    font-size: clamp(.88rem, 3.2vw, 1.08rem);
  }

  .sl-flow-label span {
    width: 24px;
    height: 24px;
    font-size: .76rem;
  }

  .sl-song-line {
    min-height: 58px;
    padding-block: 7px;
  }

  .sl-vinyl {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .sl-vinyl i {
    inset: 14px;
  }

  .sl-song-line strong {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  }

  .sl-song-line small,
  .sl-song-change {
    font-size: clamp(.7rem, 2.9vw, .88rem);
  }

  .sl-difficulty-option {
    min-height: 54px;
    padding: 7px 8px;
  }

  .sl-difficulty-option b {
    font-size: clamp(.94rem, 3.8vw, 1.18rem);
  }

  .sl-difficulty-option span {
    font-size: clamp(.66rem, 2.8vw, .84rem);
  }

  .sl-difficulty-option i {
    width: 24px;
    height: 24px;
    font-size: .72rem;
  }

  .sl-difficulty-copy {
    height: 2.4em;
    margin: 5px 0;
    font-size: clamp(.7rem, 2.9vw, .86rem);
    line-height: 1.2;
  }

  .sl-start {
    min-height: 60px;
    height: 60px;
  }

  .sl-start span {
    font-size: clamp(1.12rem, 4.8vw, 1.45rem);
  }

  .sl-start small {
    font-size: clamp(.68rem, 2.8vw, .84rem);
  }

  .sl-copyright {
    padding-top: 5px;
    font-size: clamp(.72rem, 2.8vw, .9rem);
    line-height: 1.25;
  }
}
