:root {
  --black: #050405;
  --paper: #f4eef1;
  --muted: #c2bac0;
  --dim: #a39ba0;
  --pink: #c26f9e;
  --pink-hot: #ec9dcc;
  --pink-soft: rgba(194, 111, 158, 0.17);
  --line: rgba(244, 238, 241, 0.24);
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --text-backdrop: 0 1px 2px #050405, 0 0 16px rgba(5, 4, 5, 0.92);
  --safe-top: max(20px, env(safe-area-inset-top));
  --safe-right: max(22px, env(safe-area-inset-right));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  --safe-left: max(22px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
  color: var(--paper);
  font-family: var(--font-mono);
  font-kerning: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  --live-bass: 0;
  --live-mid: 0;
  --live-air: 0;
  --beat-pulse: 0;
  min-height: 100svh;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

button,
kbd { font: inherit; }

button { color: inherit; }

button:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 5px;
}

[hidden] { display: none !important; }

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 49%, rgba(194, 111, 158, 0.055), transparent 31%),
    var(--black);
}

.grain {
  position: fixed;
  inset: -18%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
  animation: grain-shift 0.32s steps(2) infinite;
  mix-blend-mode: screen;
}

.scene-fx {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.scene-fx > i,
.frame-corners {
  position: absolute;
  inset: 0;
}

.scene-grid {
  opacity: 0.11;
  background:
    linear-gradient(rgba(238, 232, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 232, 235, 0.035) 1px, transparent 1px);
  background-position: center;
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0, rgba(0, 0, 0, 0.82) 42%, transparent 86%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0, rgba(0, 0, 0, 0.82) 42%, transparent 86%);
  transition: opacity 300ms ease, transform 800ms ease;
}

body.is-playing .scene-grid {
  opacity: calc(0.12 + var(--live-mid) * 0.09);
  transform: perspective(700px) rotateX(1.4deg) scale(calc(1 + var(--beat-pulse) * 0.004));
}

.scene-scan {
  top: -30% !important;
  bottom: -30% !important;
  width: 34%;
  opacity: 0.045;
  background: linear-gradient(90deg, transparent, rgba(194, 111, 158, 0.08), rgba(238, 232, 235, 0.025), transparent);
  filter: blur(7px);
  transform: skewX(-18deg) translateX(-120vw);
  animation: scene-scan 12s linear infinite;
}

body.is-playing .scene-scan {
  opacity: calc(0.04 + var(--live-air) * 0.14);
  animation-duration: 7s;
}

.scene-vignette {
  box-shadow:
    inset 0 0 120px rgba(0, 0, 0, 0.72),
    inset 0 0 22px rgba(194, 111, 158, calc(var(--live-bass) * 0.12));
}

.frame-corners { opacity: 0.28; }

.frame-corners i {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(238, 232, 235, 0.22);
}

.frame-corners i:nth-child(1) { top: 11px; left: 11px; border-top: 1px solid; border-left: 1px solid; }
.frame-corners i:nth-child(2) { top: 11px; right: 11px; border-top: 1px solid; border-right: 1px solid; }
.frame-corners i:nth-child(3) { right: 11px; bottom: 11px; border-right: 1px solid; border-bottom: 1px solid; }
.frame-corners i:nth-child(4) { bottom: 11px; left: 11px; border-bottom: 1px solid; border-left: 1px solid; }

body.is-playing .frame-corners {
  opacity: calc(0.32 + var(--beat-pulse) * 0.18);
}

body.visual-calm .grain { opacity: 0.025; }
body.visual-calm .scene-grid { opacity: 0.055; }
body.visual-calm.is-playing .scene-grid { opacity: calc(0.05 + var(--live-mid) * 0.035); }
body.visual-calm .scene-scan { opacity: 0.012; }
body.visual-calm.is-playing .scene-scan { opacity: calc(0.01 + var(--live-air) * 0.045); }
body.visual-calm .frame-corners { opacity: 0.18; }

body.visual-full .grain { opacity: 0.15; }
body.visual-full .scene-grid { opacity: 0.17; }
body.visual-full.is-playing .scene-grid { opacity: calc(0.2 + var(--live-mid) * 0.15); }
body.visual-full .scene-scan { opacity: 0.1; }
body.visual-full.is-playing .scene-scan { opacity: calc(0.08 + var(--live-air) * 0.28); }
body.visual-full .frame-corners { opacity: calc(0.42 + var(--beat-pulse) * 0.28); }

@keyframes scene-scan {
  to { transform: skewX(-18deg) translateX(430vw); }
}

@keyframes grain-shift {
  0% { transform: translate3d(-2%, 1%, 0); }
  25% { transform: translate3d(1%, -1%, 0); }
  50% { transform: translate3d(2%, 2%, 0); }
  75% { transform: translate3d(-1%, -2%, 0); }
  100% { transform: translate3d(-2%, 1%, 0); }
}

.topbar {
  position: fixed;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 420ms ease, transform 420ms ease;
  pointer-events: none;
}

body.show-intro .topbar,
body.has-started .topbar {
  opacity: 1;
  transform: translateY(0);
}

.wordmark {
  color: var(--paper);
  font-size: 14px;
  letter-spacing: -0.025em;
}

.wordmark span,
.result-main h2 span { color: var(--pink); }

.topbar-center {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  pointer-events: auto;
}

.signal-hud,
.section-rail {
  position: fixed;
  z-index: 8;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease, visibility 280ms;
}

body.is-playing .signal-hud,
body.is-playing .section-rail {
  visibility: visible;
  opacity: 1;
}

.signal-hud {
  top: calc(var(--safe-top) + 144px);
  right: var(--safe-right);
  width: 152px;
  transform: translateX(7px);
}

body.is-playing .signal-hud { transform: translateX(0); }

.signal-heading,
.signal-meter {
  display: grid;
  align-items: center;
}

.signal-heading {
  grid-template-columns: 1fr auto;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.signal-heading strong {
  color: var(--pink-hot);
  font-size: 9px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.signal-meter {
  grid-template-columns: 25px 1fr 20px;
  gap: 7px;
  min-height: 22px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-meter i {
  height: 1px;
  background: rgba(238, 232, 235, 0.12);
}

.signal-meter b {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--pink);
  box-shadow: 0 0 9px rgba(194, 111, 158, 0.62);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 70ms linear;
}

.signal-meter em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.run-mods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.rhythm-counter {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.run-mods b {
  display: inline-grid;
  min-width: 23px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(194, 111, 158, 0.42);
  background: rgba(194, 111, 158, 0.08);
  color: var(--pink-hot);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.section-rail {
  top: 50%;
  left: var(--safe-left);
  transform: translate(-7px, -50%);
}

body.is-playing .section-rail { transform: translate(0, -50%); }

.section-rail ol {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.section-rail li {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;
  color: rgba(170, 162, 167, 0.42);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 180ms ease, transform 180ms ease;
}

.section-rail li i {
  position: relative;
  width: 18px;
  height: 1px;
  overflow: visible;
  background: rgba(238, 232, 235, 0.12);
}

.section-rail li i::after {
  content: "";
  position: absolute;
  inset: -1px auto -1px 0;
  width: calc(var(--section-progress, 0) * 100%);
  background: var(--pink);
  box-shadow: 0 0 8px rgba(194, 111, 158, 0.6);
}

.section-rail li.is-past { color: rgba(170, 162, 167, 0.62); }
.section-rail li.is-current { color: var(--paper); transform: translateX(5px); }
.section-rail li.is-current i { background: rgba(238, 232, 235, 0.28); }
.section-rail li.is-current::after { content: " / live"; color: var(--pink); }

.text-button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.text-button:hover {
  color: var(--paper);
  border-color: var(--pink);
}

.score-hud,
.combo-hud,
.resonance-hud,
.timeline,
.touch-controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease, visibility 280ms;
}

body.is-playing .score-hud,
body.is-playing .combo-hud,
body.is-playing .resonance-hud,
body.is-playing .timeline {
  visibility: visible;
  opacity: 1;
}

.score-hud {
  position: fixed;
  top: calc(var(--safe-top) + 66px);
  left: var(--safe-left);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transform: translateX(-7px);
}

body.is-playing .score-hud { transform: translateX(0); }

.score-hud > span,
.score-hud small,
.combo-hud span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.score-hud strong {
  margin: 4px 0 3px;
  font-size: 24px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.combo-hud {
  position: fixed;
  top: calc(var(--safe-top) + 64px);
  right: var(--safe-right);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transform: translateX(7px);
}

body.is-playing .combo-hud { transform: translateX(0); }

.combo-hud strong {
  color: var(--paper);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
}

.combo-hud.is-hot strong {
  color: var(--pink-hot);
  text-shadow: 0 0 28px rgba(194, 111, 158, 0.38);
}

.resonance-hud {
  position: fixed;
  left: var(--safe-left);
  bottom: calc(var(--safe-bottom) + 42px);
  z-index: 9;
  width: min(265px, 28vw);
  transform: translateY(8px);
}

body.is-playing .resonance-hud {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.resonance-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.resonance-copy strong {
  color: var(--paper);
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.resonance-track {
  height: 1px;
  margin: 8px 0 9px;
  overflow: visible;
  background: rgba(238, 232, 235, 0.16);
}

.resonance-track i {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--pink);
  box-shadow: 0 0 13px rgba(194, 111, 158, 0.62);
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 140ms linear;
}

#bend-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: default;
  transition: color 180ms ease;
}

#bend-button kbd,
.intro-controls kbd,
.choice-options kbd,
.touch-controls kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(238, 232, 235, 0.2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

#bend-button:not(:disabled) {
  color: var(--paper);
  cursor: pointer;
  animation: ready-pulse 1s ease-in-out infinite alternate;
}

#bend-button:not(:disabled) kbd {
  border-color: var(--pink);
  color: var(--pink-hot);
}

@keyframes ready-pulse {
  to { text-shadow: 0 0 12px rgba(194, 111, 158, 0.75); }
}

.timeline {
  position: fixed;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  left: var(--safe-left);
  z-index: 7;
  transform: translateY(8px);
}

body.is-playing .timeline { transform: translateY(0); }

.timeline-line {
  position: relative;
  height: 1px;
  background: rgba(238, 232, 235, 0.14);
}

.timeline-line > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--pink);
  box-shadow: 0 0 10px rgba(194, 111, 158, 0.42);
  transform: scaleX(0);
  transform-origin: left;
}

.timeline-line > b {
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 10px var(--pink);
  transform: translate(-50%, -50%);
}

#section-marks i {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: rgba(238, 232, 235, 0.3);
}

.timeline-copy {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 7px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-copy span:nth-child(2) { color: var(--muted); }
.timeline-copy span:last-child { text-align: right; }

.judgement {
  position: fixed;
  top: 61%;
  left: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(0.96);
}

.judgement.is-visible {
  animation: judgement-in 460ms cubic-bezier(.2,.8,.2,1) both;
}

.judgement strong {
  color: var(--paper);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.judgement small {
  margin-top: 4px;
  color: var(--pink);
  font-size: 9px;
}

.judgement[data-quality="miss"] strong { color: var(--muted); }

@keyframes judgement-in {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.94); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -9px) scale(1); }
}

.hold-hud {
  position: fixed;
  top: calc(61% + 52px);
  left: 50%;
  z-index: 10;
  display: flex;
  width: min(210px, 52vw);
  visibility: hidden;
  flex-direction: column;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 5px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}

.hold-hud.is-active {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.hold-hud span {
  color: var(--paper);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-shadow: var(--text-backdrop);
  text-transform: uppercase;
}

.hold-hud > i {
  height: 2px;
  background: rgba(238, 232, 235, 0.14);
}

.hold-hud b {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--pink-hot);
  box-shadow: 0 0 12px rgba(236, 157, 204, 0.72);
  transform: scaleX(0);
  transform-origin: left;
}

.lyric-stage {
  --lyric-progress: 0%;
  position: fixed;
  right: 19vw;
  bottom: calc(var(--safe-bottom) + 52px);
  left: 19vw;
  z-index: 9;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateY(9px);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms;
}

body.has-lyrics.is-playing .lyric-stage {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.lyric-stage::before {
  content: "";
  position: absolute;
  inset: -20px -9vw -18px;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(5, 4, 5, 0.78) 22%, rgba(5, 4, 5, 0.82) 78%, transparent);
}

.lyric-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lyric-meta span:last-child { color: var(--pink-hot); }

.lyric-current {
  position: relative;
  min-height: 1.22em;
  color: rgba(238, 232, 235, 0.68);
  font-size: clamp(19px, 2.25vw, 31px);
  line-height: 1.22;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 2px 22px #050405, 0 0 2px #050405;
}

.lyric-current p {
  margin: 0;
  font: inherit;
}

#lyric-line-fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--paper);
  text-shadow: 0 0 20px rgba(236, 157, 204, 0.25), 0 2px 22px #050405;
  clip-path: inset(0 calc(100% - var(--lyric-progress)) 0 0);
}

.lyric-next {
  overflow: hidden;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyric-stage.is-between .lyric-current {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.is-paused .lyric-stage { opacity: 0.42; }

.screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease, visibility 520ms;
}

.screen.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

#intro-screen {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  padding: clamp(92px, 11vh, 132px) clamp(34px, 7vw, 112px) clamp(74px, 9vh, 100px);
}

.intro-copy {
  position: relative;
  z-index: 2;
  width: min(500px, 100%);
}

.eyebrow {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-copy h1 {
  margin: 20px 0 18px;
  color: var(--paper);
  font-size: clamp(66px, 9.2vw, 146px);
  font-weight: 400;
  line-height: 0.76;
  letter-spacing: -0.095em;
}

.intro-copy h1 span { color: var(--pink); }

.intro-copy > p {
  width: min(380px, 100%);
  margin: 0 0 18px;
  color: #aaa1a6;
  font-size: 13px;
  line-height: 1.65;
}

.track-selector {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: stretch;
  width: min(340px, 100%);
  min-height: 70px;
  margin-bottom: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.track-selector > button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.track-selector > button:hover {
  background: var(--pink-soft);
  color: var(--paper);
}

.track-selection-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.track-selection-copy small,
.track-selection-copy span {
  overflow: hidden;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.track-selection-copy strong {
  overflow: hidden;
  margin: 4px 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#track-dots {
  display: flex;
  gap: 4px;
  height: 2px;
  margin-top: 7px;
}

#track-dots b {
  flex: 1;
  height: 1px;
  background: rgba(238, 232, 235, 0.12);
}

#track-dots b.is-current {
  background: var(--pink);
  box-shadow: 0 0 7px rgba(194, 111, 158, 0.55);
}

.track-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(340px, 100%);
  margin: -3px 0 11px;
}

.track-tools > div { display: flex; align-items: center; gap: 13px; }

.track-tools button {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.track-tools button:hover {
  border-color: var(--pink);
  color: var(--paper);
}

.track-tools span {
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranked-state {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(410px, 100%);
  margin: -8px 0 16px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranked-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dim);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.ranked-state.is-online { color: var(--muted); }

.ranked-state.is-online i {
  background: var(--pink);
  box-shadow: 0 0 11px rgba(194, 111, 158, 0.8);
}

.difficulty {
  display: flex;
  width: min(340px, 100%);
  margin-bottom: 15px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.difficulty button {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 5px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.difficulty button + button { padding-left: 5px; }

.difficulty button + button::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 1px;
  background: var(--line);
}

.difficulty span {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.difficulty small {
  color: var(--dim);
  font-size: 8px;
}

.difficulty button.is-selected span { color: var(--paper); }
.difficulty button.is-selected span::before { content: "+ "; color: var(--pink); }

.mod-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(340px, 100%);
  min-height: 38px;
  margin: -6px 0 10px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mod-summary:hover,
.mod-summary.has-mods {
  border-color: var(--pink);
  background: rgba(194, 111, 158, 0.055);
  color: var(--paper);
}

.mod-summary span { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.mod-summary small { color: var(--pink); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.mod-summary strong { overflow: hidden; font-size: 10px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.mod-summary > i { color: var(--pink-hot); font-size: 14px; font-style: normal; }

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: min(340px, 100%);
  min-height: 48px;
  padding: 0 15px 0 17px;
  border: 1px solid var(--pink);
  background: var(--pink);
  color: var(--black);
  font-size: 11px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-action:hover {
  background: transparent;
  color: var(--paper);
  transform: translateY(-2px);
}

.primary-action i { font-size: 16px; font-style: normal; }

.intro-controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 19px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.intro-controls span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.intro-controls kbd {
  min-width: 18px;
  min-height: 17px;
  padding: 0 4px;
  color: var(--muted);
}

.intro-orbit {
  position: relative;
  justify-self: center;
  width: min(42vw, 570px);
  aspect-ratio: 1;
  animation: orbit-enter 1.1s cubic-bezier(.2,.8,.2,1) both;
}

.intro-orbit::before,
.intro-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.intro-orbit::before {
  inset: -1%;
  opacity: 0.34;
  background: repeating-conic-gradient(from 5deg, rgba(238, 232, 235, 0.42) 0 0.42deg, transparent 0.42deg 5deg);
  -webkit-mask-image: radial-gradient(circle, transparent 68%, #000 68.2% 69%, transparent 69.2%);
  mask-image: radial-gradient(circle, transparent 68%, #000 68.2% 69%, transparent 69.2%);
  animation: orbit-turn 48s linear infinite reverse;
}

.intro-orbit::after {
  inset: 15%;
  border: 1px dashed rgba(194, 111, 158, 0.16);
  box-shadow:
    0 0 55px rgba(194, 111, 158, 0.07),
    inset 0 0 55px rgba(194, 111, 158, 0.045);
  animation: orbit-turn 31s linear infinite;
}

@keyframes orbit-enter {
  from { opacity: 0; transform: scale(0.84) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.orbit {
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(238, 232, 235, 0.16);
  border-radius: 50%;
  animation: orbit-turn 17s linear infinite;
}

.orbit-b {
  inset: 23%;
  border-color: rgba(194, 111, 158, 0.38);
  animation-direction: reverse;
  animation-duration: 11s;
}

.orbit i {
  position: absolute;
  top: 50%;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 18px var(--pink);
}

.orbit-b i { top: 11%; right: 18%; width: 4px; height: 4px; }

.orbit-core {
  position: absolute;
  inset: 39%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(238, 232, 235, 0.3);
  border-radius: 50%;
}

.orbit-core::before,
.orbit-core::after {
  content: "";
  position: absolute;
  width: 280%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 232, 235, 0.15), transparent);
}

.orbit-core::after { transform: rotate(90deg); }

.orbit-core b {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 32px rgba(194, 111, 158, 0.9);
  animation: core-breathe 1.79s ease-in-out infinite alternate;
}

.orbit-core b::before,
.orbit-core b::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(236, 157, 204, 0.42);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-core b::before { width: 35px; height: 35px; }
.orbit-core b::after { width: 64px; height: 64px; border-style: dashed; opacity: 0.54; }

@keyframes orbit-turn { to { transform: rotate(360deg); } }
@keyframes core-breathe { to { transform: scale(1.7); opacity: 0.58; } }

.orbit-label {
  position: absolute;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.label-a { top: 4%; left: 26%; }
.label-b { right: 0; bottom: 28%; }
.label-c { bottom: 8%; left: 14%; color: var(--pink); }

.intro-foot {
  position: fixed;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  left: var(--safe-left);
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.phrase-screen {
  position: fixed;
  top: 22%;
  left: 50%;
  z-index: 9;
  width: min(560px, 82vw);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 450ms ease, transform 450ms ease;
}

.phrase-screen.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.phrase-index {
  margin-bottom: 10px;
  color: var(--pink);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.phrase-screen p {
  margin: 0;
  color: var(--paper);
  font-size: clamp(18px, 2.1vw, 26px);
  line-height: 1.4;
  text-shadow: 0 2px 20px var(--black);
}

.choice-screen {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 70px 24px 90px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(5, 4, 5, 0.48), rgba(5, 4, 5, 0.08) 47%, transparent 72%);
  transition: opacity 240ms ease, visibility 240ms;
}

.choice-screen.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.choice-heading {
  margin-bottom: 28px;
  text-align: center;
}

.choice-heading span {
  color: var(--pink);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.choice-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.choice-options {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1px minmax(180px, 280px);
  gap: 30px;
  align-items: stretch;
}

.choice-options > i { background: var(--line); }

.choice-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 126px;
  padding: 17px;
  border: 0;
  background: rgba(5, 4, 5, 0.56);
  color: var(--paper);
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease;
}

.choice-options button:hover,
.choice-options button.is-armed {
  color: var(--pink-hot);
  transform: translateY(-4px);
}

.choice-options button::after {
  content: "";
  width: 0;
  height: 1px;
  margin-top: 15px;
  background: var(--pink);
  transition: width 180ms ease;
}

.choice-options button:hover::after { width: 58%; }

.choice-options kbd { margin-bottom: 15px; }

.choice-options strong {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.choice-options span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.analysis-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  visibility: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  background: rgba(5, 4, 5, 0.94);
  transition: opacity 220ms ease, visibility 220ms;
}

.analysis-screen.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.analysis-screen small {
  color: var(--pink);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.analysis-screen strong {
  margin: 14px 0 22px;
  color: var(--paper);
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.05em;
}

.analysis-screen > i {
  display: block;
  width: min(360px, 72vw);
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.analysis-screen > i b {
  display: block;
  width: 36%;
  height: 1px;
  background: var(--pink);
  box-shadow: 0 0 12px rgba(194, 111, 158, 0.7);
  animation: analysis-scan 1.1s ease-in-out infinite;
}

.analysis-screen p {
  margin: 13px 0 0;
  color: var(--dim);
  font-size: 10px;
}

@keyframes analysis-scan {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

.result-screen {
  display: grid;
  grid-template-columns: 0.38fr 1fr 0.7fr;
  grid-template-rows: 1fr auto;
  gap: 40px 7vw;
  align-items: center;
  padding: 100px clamp(30px, 7vw, 110px) 62px;
  background: radial-gradient(circle at 18% 50%, rgba(194, 111, 158, 0.08), transparent 32%);
}

.result-screen::before,
.result-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.result-screen::before {
  top: 50%;
  left: 18%;
  width: min(54vw, 680px);
  aspect-ratio: 1;
  border: 1px solid rgba(194, 111, 158, 0.12);
  background: repeating-conic-gradient(from 0deg, rgba(238, 232, 235, 0.09) 0 0.45deg, transparent 0.45deg 7.5deg);
  -webkit-mask-image: radial-gradient(circle, transparent 57%, #000 57.2% 57.6%, transparent 58%, #000 73%, transparent 73.5%);
  mask-image: radial-gradient(circle, transparent 57%, #000 57.2% 57.6%, transparent 58%, #000 73%, transparent 73.5%);
  transform: translate(-50%, -50%);
  animation: orbit-turn 44s linear infinite;
}

.result-screen::after {
  top: 50%;
  left: 18%;
  width: min(28vw, 340px);
  aspect-ratio: 1;
  border: 1px dashed rgba(238, 232, 235, 0.09);
  box-shadow: 0 0 90px rgba(194, 111, 158, 0.07);
  transform: translate(-50%, -50%);
  animation: orbit-turn 29s linear infinite reverse;
}

.result-grade {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-grade span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-grade strong {
  color: var(--pink);
  font-size: clamp(116px, 17vw, 240px);
  font-weight: 400;
  line-height: 0.86;
  text-shadow: 0 0 80px rgba(194, 111, 158, 0.18);
}

.result-grade small {
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-main h2 {
  margin: 14px 0 15px;
  font-size: clamp(48px, 7vw, 108px);
  font-weight: 400;
  line-height: 0.87;
  letter-spacing: -0.08em;
}

.result-main > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.result-main .result-online {
  margin-top: 17px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-main .result-online.is-ranked { color: var(--pink); }

.result-main .result-mods {
  margin-top: 9px;
  color: var(--pink);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.carried-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 27px;
  padding: 0;
  list-style: none;
}

.carried-list li {
  color: var(--paper);
  font-size: 11px;
}

.carried-list li::before { content: "+ "; color: var(--pink); }

.timing-signature {
  width: min(430px, 100%);
  margin-top: 19px;
}

.timing-signature > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timing-signature > div strong { color: var(--muted); font-weight: 400; }
.timing-signature > div span:last-child { text-align: right; }

#timing-bars {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 32px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent 49.8%, rgba(238, 232, 235, 0.32) 50%, transparent 50.2%);
}

#timing-bars b {
  flex: 1;
  min-height: 1px;
  background: var(--pink);
  box-shadow: 0 0 8px rgba(194, 111, 158, 0.3);
  transform: scaleY(var(--timing-height, 0.05));
  transform-origin: bottom;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1);
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.result-stats div {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.result-stats small,
.result-stats strong {
  display: block;
  font-weight: 400;
}

.result-stats small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.result-stats strong {
  color: var(--paper);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.result-actions {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  gap: 25px;
}

.secondary-action {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.secondary-action:hover { color: var(--paper); border-color: var(--pink); }

.touch-controls {
  position: fixed;
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 36px);
  z-index: 10;
  display: flex;
  gap: 7px;
}

.touch-controls button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
}

.touch-controls span { font-size: 8px; text-transform: uppercase; }

.touch-controls button.is-active kbd {
  border-color: var(--pink);
  color: var(--paper);
  background: var(--pink-soft);
  box-shadow: 0 0 17px rgba(194, 111, 158, 0.35);
}

dialog {
  position: relative;
  width: min(520px, calc(100vw - 38px));
  padding: 34px;
  border: 1px solid rgba(238, 232, 235, 0.18);
  background: rgba(10, 8, 10, 0.97);
  color: var(--paper);
}

dialog[open] { animation: dialog-enter 190ms ease-out both; }

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

dialog::backdrop {
  background: rgba(5, 4, 5, 0.75);
  backdrop-filter: blur(7px);
}

dialog h2 {
  margin: 13px 0 14px;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.05em;
}

dialog > p {
  color: #a9a1a6;
  font-size: 11px;
  line-height: 1.65;
}

dialog dl { margin: 23px 0; }

dialog dl div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.45;
}

dialog dt { color: var(--pink); }
dialog dd { margin: 0; color: var(--muted); }
dialog .dialog-note { color: var(--dim); }

#help-dialog {
  width: min(680px, calc(100vw - 38px));
  max-height: min(860px, calc(100svh - 38px));
  overflow-y: auto;
}

.rhythm-guide {
  margin: 4px 0 21px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.rhythm-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 18px;
}

.rhythm-guide-grid > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 49px;
  border-bottom: 1px solid var(--line);
}

.rhythm-guide-grid > div > i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(194, 111, 158, 0.4);
  color: var(--pink-hot);
  font-size: 11px;
  font-style: normal;
}

.rhythm-guide-grid span,
.rhythm-guide-grid strong,
.rhythm-guide-grid small { display: block; }
.rhythm-guide-grid strong { color: var(--paper); font-size: 11px; font-weight: 400; }
.rhythm-guide-grid small { margin-top: 4px; color: var(--dim); font-size: 9px; line-height: 1.35; }

.visual-setting {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 4px 0 21px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.visual-setting > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.visual-setting > div:first-child span { color: var(--pink); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.visual-setting > div:first-child small { color: var(--dim); font-size: 9px; }
.visual-modes { display: flex; border: 1px solid var(--line); }

.visual-modes button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.visual-modes button + button { border-left: 1px solid var(--line); }
.visual-modes button:hover,
.visual-modes button.is-selected { background: var(--pink-soft); color: var(--paper); }
.visual-modes button.is-selected::before { content: "+ "; color: var(--pink-hot); }

.mod-dialog {
  width: min(760px, calc(100vw - 38px));
  max-height: min(820px, calc(100svh - 38px));
  overflow-y: auto;
}

.mod-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.mod-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.mod-list > button:nth-child(odd) { border-right: 1px solid var(--line); }

.mod-list > button:hover,
.mod-list > button.is-selected {
  background: rgba(194, 111, 158, 0.075);
  color: var(--paper);
}

.mod-list > button.is-selected {
  box-shadow: inset 2px 0 0 var(--pink), inset 0 0 24px rgba(194, 111, 158, 0.025);
}

.mod-list > button::before {
  display: grid;
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  place-items: center;
  border: 1px solid rgba(238, 232, 235, 0.12);
  color: var(--dim);
  font-size: 9px;
}

.mod-list > button.is-selected::before { border-color: var(--pink); color: var(--pink-hot); }
.mod-list > button[data-mod="mirror"]::before { content: "↔"; }
.mod-list > button[data-mod="shuffle"]::before { content: "⤨"; }
.mod-list > button[data-mod="hidden"]::before { content: "◌"; }
.mod-list > button[data-mod="sudden"]::before { content: "◉"; }
.mod-list > button[data-mod="precision"]::before { content: "+"; }
.mod-list > button[data-mod="blackout"]::before { content: "×"; }
.mod-list > button[data-mod="doubletime"]::before { content: "»"; }
.mod-list > button[data-mod="halftime"]::before { content: "‹"; }
.mod-list > button[data-mod="focus"]::before { content: "◎"; }
.mod-list > button[data-mod="echo"]::before { content: "↗"; }
.mod-list > button[data-mod="outward"]::before { content: "⇱"; }
.mod-list > button[data-mod="pure"]::before { content: "Ⅰ"; }
.mod-list > button[data-mod="autoplay"]::before { content: "◇"; }

.mod-list > button.is-selected strong::before { content: "+ "; color: var(--pink-hot); }
.mod-list > button span { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.mod-list > button strong { font-size: 11px; font-weight: 400; }
.mod-list > button small { color: var(--dim); font-size: 9px; line-height: 1.35; }
.mod-list > button > i { flex: none; margin-left: 14px; color: var(--pink); font-size: 9px; font-style: normal; }

.practice-lab {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.25fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.practice-lab > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.practice-lab > div:first-child span { color: var(--pink); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.practice-lab > div:first-child small { color: var(--dim); font-size: 9px; line-height: 1.35; }

.practice-stepper {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  min-height: 38px;
  border: 1px solid var(--line);
}

.practice-stepper button,
#practice-loop,
.mod-footer > button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.practice-stepper button:hover,
#practice-loop:hover,
#practice-loop.is-selected,
.mod-footer > button:hover { color: var(--paper); background: var(--pink-soft); }

.practice-stepper strong {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--paper);
  font-size: 10px;
  font-weight: 400;
  text-align: center;
}

#practice-loop {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
}

.mod-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-top: 17px;
}

.mod-footer p { display: flex; margin: 0; flex-direction: column; gap: 4px; }
.mod-footer strong { color: var(--paper); font-size: 11px; font-weight: 400; }
.mod-footer span { color: var(--dim); font-size: 9px; }
.mod-footer > button { padding: 8px 0; border-bottom: 1px solid var(--line); }

.account-dialog { width: min(570px, calc(100vw - 38px)); }

.account-modes,
.board-difficulties {
  display: flex;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-modes { margin: 25px 0 22px; }

.account-modes button,
.board-difficulties button {
  flex: 1;
  padding: 11px 6px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.account-modes button:hover,
.account-modes button.is-selected,
.board-difficulties button:hover,
.board-difficulties button.is-selected {
  background: rgba(194, 111, 158, 0.08);
  color: var(--paper);
}

.account-modes button.is-selected::before,
.board-difficulties button.is-selected::before { content: "+ "; color: var(--pink); }

#account-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

#account-form label { display: block; }

#account-form label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#account-form input {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: rgba(238, 232, 235, 0.025);
  color: var(--paper);
  font: inherit;
  font-size: 12px;
  user-select: text;
  -webkit-user-select: text;
}

#account-form input:focus { border-color: var(--pink); }

.network-action {
  min-height: 39px;
  padding: 9px 14px;
  border: 1px solid var(--pink);
  background: var(--pink-soft);
  color: var(--paper);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

#account-submit { grid-column: 1 / 3; }

.network-action:disabled { opacity: 0.45; cursor: wait; }

.network-status {
  min-height: 13px;
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.5;
}

.network-status.is-error { color: #e79baa; }

.account-user { margin-top: 28px; }

.account-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 6px 16px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.account-identity span,
.account-identity small { color: var(--dim); font-size: 9px; text-transform: uppercase; }
.account-identity strong { color: var(--paper); font-size: 26px; font-weight: 400; letter-spacing: -0.05em; }
.account-identity small { grid-column: 2; }

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 0;
}

.account-stats small,
.account-stats strong { display: block; font-weight: 400; }
.account-stats small { margin-bottom: 6px; color: var(--dim); font-size: 8px; text-transform: uppercase; }
.account-stats strong { color: var(--paper); font-size: 14px; font-variant-numeric: tabular-nums; }

.account-actions { display: flex; align-items: center; gap: 21px; }

.leaderboard-dialog {
  width: min(900px, calc(100vw - 38px));
  max-height: min(790px, calc(100svh - 38px));
  padding: 34px 38px 28px;
  overflow: hidden;
}

.leaderboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.leaderboard-heading h2 { margin-bottom: 7px; }
.leaderboard-heading p { margin: 0; color: var(--dim); font-size: 9px; }

.leaderboard-heading > strong {
  color: var(--pink);
  font-size: 52px;
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.board-difficulties { margin: 25px 0 13px; }

.leaderboard-columns,
.leaderboard-list li {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 130px 90px 70px;
  gap: 18px;
  align-items: center;
}

.leaderboard-columns {
  padding: 0 12px 8px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leaderboard-list {
  min-height: 180px;
  max-height: min(410px, 48svh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border-top: 1px solid var(--line);
  scrollbar-color: var(--pink) transparent;
}

.leaderboard-list li {
  min-height: 48px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  animation: board-row 220ms ease both;
}

@keyframes board-row {
  from { opacity: 0; transform: translateX(7px); }
  to { opacity: 1; transform: translateX(0); }
}

.leaderboard-list li.is-viewer { background: rgba(194, 111, 158, 0.08); color: var(--paper); }
.leaderboard-list li > strong { color: var(--paper); font-size: 13px; font-weight: 400; }
.leaderboard-list li > span:first-child { display: flex; align-items: center; gap: 13px; min-width: 0; }
.leaderboard-list li b { width: 24px; color: var(--pink); font-size: 9px; font-weight: 400; }

.leaderboard-player-button {
  overflow: hidden;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.leaderboard-player-button:hover { border-color: var(--pink); color: var(--paper); }

.leaderboard-viewer {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 1px solid var(--pink);
  color: var(--muted);
  font-size: 10px;
}

.leaderboard-viewer strong { color: var(--paper); font-weight: 400; }

.player-profile {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 34px 38px;
  overflow-y: auto;
  background: rgba(10, 8, 10, 0.995);
}

.player-profile > button {
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.player-profile > div:nth-of-type(1) { margin: 42px 0 26px; }
.player-profile > div:nth-of-type(1) span,
.player-profile > div:nth-of-type(1) strong { display: block; }
.player-profile > div:nth-of-type(1) span { color: var(--pink); font-size: 9px; text-transform: uppercase; }
.player-profile > div:nth-of-type(1) strong { margin-top: 8px; font-size: clamp(38px, 7vw, 82px); font-weight: 400; letter-spacing: -0.07em; }

.player-profile-stats {
  display: flex;
  gap: 28px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

#player-profile-bests { margin: 20px 0 0; padding: 0; list-style: none; }
#player-profile-bests li { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
#player-profile-bests strong { color: var(--paper); font-weight: 400; }

.keybind-remap {
  margin: 4px 0 21px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.keybind-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--pink);
  font-size: 10px;
}

.keybind-heading > span {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.keybind-heading button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.keybind-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.keybind-grid button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.keybind-grid button:hover,
.keybind-grid button.is-listening {
  border-color: var(--pink);
  background: var(--pink-soft);
  color: var(--paper);
}

.keybind-grid button.is-listening kbd {
  color: var(--pink-hot);
}

.keybind-grid kbd {
  overflow: hidden;
  max-width: 44px;
  color: var(--paper);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#remap-status {
  margin: 9px 0 0;
  color: var(--dim);
  font-size: 9px;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 17px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.pause-label,
.bend-label {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.pause-label {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(5, 4, 5, 0.8);
  color: var(--paper);
  font-size: 11px;
}

body.is-paused .pause-label { opacity: 1; }

.bend-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--pink-hot);
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(194, 111, 158, 0.8);
}

.bend-label span {
  font-size: 10px;
  letter-spacing: 0.3em;
}

.bend-label strong {
  margin-top: 7px;
  font-size: 28px;
  font-weight: 400;
}

body.is-bending .bend-label { animation: bend-label 950ms ease both; }

@keyframes bend-label {
  0% { opacity: 0; transform: translate(-50%, -43%) scale(0.9); }
  25%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(1.03); }
}

body.is-bending .grain {
  opacity: 0.25;
  animation-duration: 0.16s;
  mix-blend-mode: color-dodge;
}

body.is-bending #game { filter: saturate(1.18) contrast(1.04); }

.status-live {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Readable at play speed: small type stays technical without becoming faint. */
.topbar,
.score-hud,
.combo-hud,
.resonance-hud,
.signal-hud,
.section-rail,
.timeline,
.touch-controls { text-shadow: var(--text-backdrop); }

.wordmark { font-size: 15px; }
.topbar-center,
.text-button { font-size: 11px; }

.score-hud,
.combo-hud,
.signal-hud {
  background: linear-gradient(90deg, rgba(5, 4, 5, 0.7), rgba(5, 4, 5, 0.16) 78%, transparent);
}

.combo-hud,
.signal-hud {
  background: linear-gradient(270deg, rgba(5, 4, 5, 0.7), rgba(5, 4, 5, 0.16) 78%, transparent);
}

.score-hud { padding: 8px 14px 8px 0; }
.combo-hud { padding: 8px 0 8px 14px; }
.signal-hud { padding: 9px 0 10px 13px; }

.score-hud > span,
.score-hud small,
.combo-hud span,
.resonance-copy,
#bend-button { font-size: 10px; }

.signal-heading,
.signal-meter,
.signal-meter em { font-size: 9px; }
.signal-heading strong { font-size: 10px; }
.run-mods b { min-width: 25px; height: 20px; font-size: 8px; }
.section-rail li { color: rgba(194, 186, 192, 0.64); font-size: 8px; }

.timeline-copy { color: var(--dim); font-size: 9px; }
.lyric-meta { font-size: 10px; }
.lyric-current { color: rgba(244, 238, 241, 0.78); font-size: clamp(21px, 2.35vw, 33px); }
.lyric-next { color: var(--muted); font-size: 12px; }
.lyric-stage.is-between .lyric-current { color: var(--muted); font-size: 15px; }

.eyebrow { font-size: 10px; }
.intro-copy > p { color: var(--muted); font-size: 14px; }
.track-selection-copy small,
.track-selection-copy span { color: var(--dim); font-size: 10px; }
.track-selection-copy strong { font-size: 15px; }
.track-tools button,
.ranked-state { font-size: 10px; }
.track-tools span { color: var(--dim); font-size: 9px; }
.difficulty span { font-size: 11px; }
.difficulty small { color: var(--dim); font-size: 9px; }
.mod-summary small { font-size: 10px; }
.mod-summary strong { font-size: 11px; }
.primary-action { font-size: 12px; }
.intro-controls { color: var(--dim); font-size: 10px; }
.orbit-label,
.intro-foot { font-size: 9px; }

.phrase-index,
.choice-heading span { font-size: 10px; }
.choice-heading p { font-size: 12px; }
.choice-options span { color: var(--muted); font-size: 11px; }

.result-grade span,
.result-grade small,
.result-main .result-mods,
.result-main .result-online,
.result-stats small { font-size: 10px; }
.result-main > p { color: var(--muted); font-size: 13px; }
.carried-list li { font-size: 12px; }
.timing-signature > div { font-size: 9px; }
.result-stats strong { font-size: 17px; }
.secondary-action { font-size: 11px; }

dialog > p { color: var(--muted); font-size: 12px; }
dialog dl div { font-size: 11px; }
dialog dd { color: var(--muted); }
dialog .dialog-note { color: var(--dim); }
.mod-list > button strong { font-size: 12px; }
.mod-list > button small { color: var(--dim); font-size: 10px; }
.mod-list > button > i,
.practice-lab > div:first-child span,
.practice-lab > div:first-child small,
.practice-stepper button,
#practice-loop,
.mod-footer > button,
.mod-footer span { font-size: 10px; }
.mod-footer strong { font-size: 12px; }

.account-modes button,
.board-difficulties button,
.network-action,
.leaderboard-list li,
.leaderboard-viewer,
.player-profile-stats,
#player-profile-bests li,
.keybind-heading,
.keybind-grid button { font-size: 11px; }

.network-status,
.leaderboard-heading p,
.leaderboard-columns,
.account-identity span,
.account-identity small,
.account-stats small,
.player-profile > div:nth-of-type(1) span,
#remap-status { font-size: 10px; }

.rhythm-guide-grid strong { font-size: 12px; }
.rhythm-guide-grid small,
.visual-setting > div:first-child small,
.visual-modes button { font-size: 10px; }

@media (hover: hover) and (pointer: fine) and (min-width: 801px) {
  body.is-playing .touch-controls { visibility: visible; opacity: 0.42; pointer-events: auto; }
}

@media (max-width: 800px) {
  :root {
    --safe-top: max(16px, env(safe-area-inset-top));
    --safe-right: max(14px, env(safe-area-inset-right));
    --safe-left: max(14px, env(safe-area-inset-left));
  }

  .topbar { grid-template-columns: auto 1fr; gap: 10px; }
  .topbar-center { display: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .text-button { font-size: 9px; white-space: nowrap; }

  #intro-screen {
    display: block;
    padding: 92px 24px 82px;
  }

  .intro-copy { width: min(420px, 100%); }

  .intro-copy h1 {
    margin-top: 14px;
    font-size: clamp(62px, 20vw, 96px);
    line-height: 0.79;
  }

  .intro-copy > p { margin-bottom: 20px; }
  .difficulty { width: min(330px, 100%); }
  .track-selector { width: min(330px, 100%); }
  .track-tools { width: min(330px, 100%); }
  .track-tools > span { display: none; }
  .ranked-state { width: min(330px, 100%); }
  .mod-summary { width: min(330px, 100%); }
  .primary-action { width: min(330px, 100%); }

  .intro-orbit {
    position: fixed;
    right: -27vw;
    bottom: -12vw;
    width: 80vw;
    opacity: 0.38;
  }

  .frame-corners { opacity: 0.22; }
  .scene-grid { background-size: 54px 54px; }

  .intro-foot span:first-child { display: none; }
  .intro-foot { justify-content: flex-end; }

  .score-hud { top: calc(var(--safe-top) + 46px); }
  .score-hud strong { font-size: 18px; }
  .combo-hud { top: calc(var(--safe-top) + 49px); }
  .combo-hud strong { font-size: 36px; }

  .signal-hud {
    top: calc(var(--safe-top) + 96px);
    right: var(--safe-right);
    width: 98px;
  }

  .signal-heading span,
  .signal-meter span,
  .signal-meter em,
  .rhythm-counter,
  .run-mods { display: none; }
  .signal-heading { grid-template-columns: 1fr; border-bottom: 0; text-align: right; }
  .signal-meter { grid-template-columns: 1fr; min-height: 12px; }

  .section-rail {
    top: calc(var(--safe-top) + 106px);
    left: var(--safe-left);
    transform: translateY(-7px);
  }

  body.is-playing .section-rail { transform: translateY(0); }
  .section-rail ol { flex-direction: row; gap: 5px; }
  .section-rail li { display: block; }
  .section-rail li i { display: block; width: 18px; }
  .section-rail li span,
  .section-rail li::after { display: none; }

  .resonance-hud {
    right: var(--safe-right);
    bottom: calc(var(--safe-bottom) + 107px);
    left: var(--safe-left);
    width: auto;
  }

  #bend-button {
    position: absolute;
    right: 0;
    bottom: 8px;
  }

  .timeline { bottom: var(--safe-bottom); }
  .timeline-copy span:nth-child(2) { display: none; }
  .timeline-copy { grid-template-columns: 1fr 1fr; }

  .lyric-stage {
    right: var(--safe-right);
    bottom: calc(var(--safe-bottom) + 158px);
    left: var(--safe-left);
  }

  .lyric-stage::before { right: -14px; left: -14px; }
  .lyric-meta { margin-bottom: 6px; font-size: 8px; }
  .lyric-meta span:first-child { display: none; }
  .lyric-current { font-size: clamp(17px, 5.2vw, 23px); line-height: 1.18; }
  .lyric-next { max-width: 92vw; margin-top: 6px; font-size: 10px; }
  .lyric-stage.is-between .lyric-current { font-size: 12px; }

  body.is-playing .touch-controls {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .touch-controls {
    right: var(--safe-right);
    bottom: calc(var(--safe-bottom) + 40px);
    left: var(--safe-left);
    justify-content: space-between;
    gap: 8px;
  }

  .touch-controls button { flex: 1; width: auto; min-height: 47px; }
  .touch-controls kbd { width: 100%; min-height: 34px; }

  .phrase-screen { top: 17%; }
  .judgement { top: 55%; }
  .hold-hud { top: calc(55% + 48px); }

  .choice-screen { padding: 72px 16px 132px; }
  .choice-heading { margin-bottom: 19px; }
  .choice-options {
    width: 100%;
    grid-template-columns: 1fr 1px 1fr;
    gap: 9px;
  }

  .choice-options button { min-width: 0; min-height: 118px; padding: 12px 7px; }
  .choice-options strong { font-size: 15px; }
  .choice-options span { max-width: 130px; line-height: 1.35; }

  .result-screen {
    display: grid;
    grid-template-columns: 0.35fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 22px 18px;
    align-content: center;
    padding: 78px 22px 30px;
    overflow-y: auto;
  }

  .result-screen::before,
  .result-screen::after { left: 22%; }

  .result-grade { grid-row: 1; }
  .result-grade strong { font-size: 100px; }
  .result-main { grid-column: 2; }
  .result-main h2 { font-size: 50px; }
  .result-main > p { line-height: 1.5; }
  .carried-list { margin-top: 15px; gap: 5px 12px; }
  .timing-signature { margin-top: 13px; }

  .result-stats {
    grid-column: 1 / 3;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 9px;
  }

  .result-stats strong { font-size: 12px; }

  .result-actions {
    grid-column: 1 / 3;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .result-actions .primary-action { width: 100%; }
  .result-actions .secondary-action { align-self: center; }

  dialog { padding: 30px 24px 24px; }
  dialog dl div { grid-template-columns: 82px 1fr; }
  .rhythm-guide-grid { grid-template-columns: 1fr; }
  .visual-setting { grid-template-columns: 1fr; gap: 11px; }
  .visual-modes { width: 100%; }
  .visual-modes button { flex: 1; }
  #account-form { grid-template-columns: 1fr; }
  #account-submit { grid-column: 1; }
  .account-stats { grid-template-columns: 1fr 1fr; }
  .leaderboard-dialog { padding: 30px 14px 20px; }
  .leaderboard-heading { padding: 0 10px; }
  .leaderboard-heading > strong { font-size: 38px; }
  .leaderboard-heading h2 { font-size: 22px; }
  .board-difficulties { margin-right: 10px; margin-left: 10px; }
  .leaderboard-columns,
  .leaderboard-list li { grid-template-columns: minmax(120px, 1fr) 90px 58px; gap: 8px; }
  .leaderboard-columns span:last-child,
  .leaderboard-list li > span:last-child { display: none; }
  .leaderboard-list li { padding-right: 8px; padding-left: 8px; }
  .player-profile { padding: 30px 22px; }
  .player-profile-stats { flex-wrap: wrap; gap: 12px 20px; }

  .mod-dialog { padding: 30px 16px 22px; }
  .mod-list { grid-template-columns: 1fr; margin-top: 19px; }
  .mod-list > button:nth-child(odd) { border-right: 0; }
  .mod-list > button { min-height: 56px; padding-right: 10px; padding-left: 10px; }
  .mod-list > button::before { width: 20px; height: 20px; margin-right: 8px; }
  .practice-lab { grid-template-columns: 1fr auto; gap: 12px; }
  .practice-stepper { grid-column: 1 / 3; grid-row: 2; }
  #practice-loop { grid-column: 2; grid-row: 1; }
  .mod-footer { align-items: flex-end; }
}

@media (max-height: 700px) and (min-width: 801px) {
  #intro-screen { padding-top: 78px; padding-bottom: 55px; }
  .intro-copy h1 { font-size: clamp(62px, 8.2vw, 108px); }
  .intro-copy > p { margin-bottom: 16px; }
  .difficulty { margin-bottom: 13px; }
  .mod-summary { min-height: 32px; margin-bottom: 7px; }
  .intro-controls { margin-top: 12px; }
  .result-screen { padding-top: 78px; padding-bottom: 45px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Library release: readable controls, quieter menus, reachable actions. */
#intro-screen {
  align-items: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-top: 82px;
  padding-bottom: 64px;
}
.intro-copy { width: min(480px, 100%); }
.intro-copy > :not(h1), .result-main > p, dialog {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.intro-copy h1 { font-size: clamp(68px, 7vw, 100px); line-height: .84; margin: 16px 0 22px; }
.intro-copy > p { width: 100%; font-size: 16px; line-height: 1.5; margin-bottom: 20px; }
.intro-copy .eyebrow { font-size: 11px; letter-spacing: .1em; }
.intro-copy :is(.track-selector, .track-tools, .difficulty, .mod-summary, .primary-action, .ranked-state) { width: 100%; }
.track-selection-copy strong { font-size: 20px; line-height: 1.3; }
.track-selection-copy small, .track-selection-copy span { font-size: 12px; letter-spacing: .02em; }
.track-selector { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.track-tools { display: block; margin: 0 0 16px; }
.track-tools > div { flex-wrap: wrap; gap: 4px 16px; }
.track-tools button { min-height: 40px; padding: 6px 0; font-size: 14px; text-align: left; }
.track-tools #library-button { color: var(--pink-hot); font-weight: 650; }
.track-tools > span { display: block; font-size: 11px; letter-spacing: .03em; margin-top: 8px; }
.ranked-state { font-size: 11px; letter-spacing: .02em; margin: 0 0 12px; }
.difficulty { margin-bottom: 10px; }
.difficulty span { font-size: 15px; }
.difficulty small { font-size: 11px; white-space: nowrap; }
.difficulty button { min-height: 58px; gap: 5px; }
.mod-summary { min-height: 44px; }
.mod-summary small { font-size: 12px; }
.mod-summary strong { font-size: 13px; }
.primary-action { min-height: 48px; font-size: 16px; }
.intro-controls { font-size: 12px; margin-top: 18px; line-height: 1.7; }
body.show-intro .grain { opacity: .015; }
body.show-intro .scene-fx { opacity: .3; }
body:not(.is-playing) .topbar::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--safe-top)) calc(-1 * var(--safe-right)) -10px calc(-1 * var(--safe-left));
  z-index: -1;
  background: #050405f5;
  pointer-events: none;
}
body.show-intro .intro-foot { pointer-events: none; background: #050405e8; padding: 7px 0; }
dialog :is(p, dd, .dialog-note) { font-size: 14px; line-height: 1.55; }
dialog dl div { font-size: 14px; }
.mod-list > button strong { font-size: 15px; }
.mod-list > button small { font-size: 12px; line-height: 1.4; }
@media (max-height: 800px) {
  .intro-controls { display: none; }
  .intro-copy h1 { font-size: 70px; margin-top: 12px; margin-bottom: 16px; }
  .intro-copy > p { margin-bottom: 14px; }
  #intro-screen { padding-top: 72px; padding-bottom: 52px; }
}
@media (max-width: 800px) {
  #intro-screen { padding-left: 24px; padding-right: 24px; padding-top: 82px; }
  .intro-copy { width: min(480px, 100%); }
  .intro-orbit { opacity: .16; pointer-events: none; }
  body.show-intro .intro-foot { display: none; }
  .intro-copy h1 { font-size: 70px; }
  .difficulty span { font-size: 14px; }
  .difficulty small { font-size: 10px; }
  .topbar-actions .text-button { font-size: 11px; min-height: 36px; }
}
@media (max-width: 440px) {
  .topbar { grid-template-columns: 1fr; gap: 4px; }
  .topbar-actions { justify-content: space-between; }
  #intro-screen { padding-top: 116px; }
  .track-tools > div { gap: 4px 12px; }
}
