@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #e8eced;
  --muted: #8e999d;
  --soft: #aab5b6;
  --night: #151b24;
  --night-deep: #10151d;
  --panel: #1d252e;
  --line: rgba(207, 221, 218, 0.16);
  --mint: #a6ead3;
  --coral: #ff806b;
  --yellow: #f2c778;
  --mono: "DM Mono", monospace;
  --display: "Space Grotesk", sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--night-deep);
  color: var(--ink);
  font-family: var(--display);
}
body {
  overflow-x: hidden;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 78% 18%,
      rgba(72, 111, 105, 0.24),
      transparent 28%
    ),
    linear-gradient(135deg, #182029 0%, #121820 62%, #10151c 100%);
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
}
.screen {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  animation: appear 0.6s ease both;
}
.is-hidden {
  display: none;
}
.screen--menu {
  display: flex;
  align-items: center;
  padding: 7vw 10vw;
}
.menu-copy {
  max-width: 560px;
  z-index: 2;
}
.eyebrow {
  color: var(--mint);
  font: 500 10px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 22px;
}
.status-dot,
.live-pill i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 128, 107, 0.12);
  margin-right: 9px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(4.8rem, 12vw, 10.5rem);
  line-height: 0.78;
  letter-spacing: -0.09em;
  margin: 0 0 38px;
  font-weight: 700;
}
h1 span,
.brand-button span {
  color: var(--coral);
}
.lede {
  color: var(--soft);
  font-size: 17px;
  line-height: 1.55;
  max-width: 380px;
  margin-bottom: 42px;
}
.menu-actions {
  display: grid;
  gap: 9px;
  max-width: 390px;
}
.button {
  border: 1px solid var(--line);
  background: rgba(29, 37, 46, 0.5);
  min-height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  transition: 0.2s ease;
}
.button:hover,
.button:focus-visible {
  border-color: var(--mint);
  transform: translateX(7px);
  background: rgba(166, 234, 211, 0.08);
  outline: none;
}
.button--primary {
  background: var(--mint);
  border-color: var(--mint);
  color: #14211f;
  font-weight: 700;
}
.button--primary:hover,
.button--primary:focus-visible {
  background: #c0f6e2;
}
.button--quiet {
  color: var(--muted);
}
.button-index {
  font: 11px var(--mono);
  opacity: 0.7;
  min-width: 25px;
}
.button-arrow {
  margin-left: auto;
  font-size: 20px;
}
.hint-line,
.menu-side-note {
  color: var(--muted);
  font: 11px var(--mono);
}
.hint-line {
  margin: 24px 0 0;
}
.menu-orbit {
  position: absolute;
  width: 52vw;
  height: 52vw;
  max-width: 740px;
  max-height: 740px;
  right: 4vw;
  top: 12%;
  border: 1px solid rgba(166, 234, 211, 0.12);
  border-radius: 50%;
  transform: rotate(-18deg);
}
.menu-orbit:before,
.menu-orbit:after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(166, 234, 211, 0.1);
  border-radius: 50%;
}
.menu-orbit:after {
  inset: 27%;
  border-color: rgba(255, 128, 107, 0.15);
}
.menu-orbit span {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--coral);
  border-radius: 50%;
  top: 16%;
  left: 14%;
  box-shadow: 0 0 20px var(--coral);
}
.menu-orbit span:nth-child(2) {
  top: 75%;
  left: 83%;
  background: var(--mint);
  box-shadow: 0 0 20px var(--mint);
}
.menu-orbit span:nth-child(3) {
  top: 45%;
  left: 49%;
  width: 5px;
  height: 5px;
  background: var(--yellow);
}
.menu-side-note {
  position: absolute;
  right: 10vw;
  bottom: 10vh;
  line-height: 2;
  text-align: right;
}
.menu-side-note span {
  color: var(--coral);
  font-size: 21px;
}
.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
}
.brand-button {
  border: 0;
  padding: 0;
  background: transparent;
  font: 700 16px var(--display);
  letter-spacing: -0.06em;
}
.session-title {
  text-align: center;
}
.session-title h2 {
  font-size: 15px;
  margin: 8px 0 0;
  font-weight: 500;
}
.live-pill {
  color: var(--muted);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.live-pill i {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(166, 234, 211, 0.1);
  width: 5px;
  height: 5px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.icon-button,
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}
.icon-button {
  font-size: 23px;
}
.text-button {
  font: 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.icon-button:hover,
.text-button:hover,
.brand-button:hover {
  color: var(--mint);
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 5vw;
  max-width: 1450px;
  margin: 0 auto;
  padding: 7vh 5vw;
}
.practice-column {
  min-width: 0;
}
.practice-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 28px;
}
.practice-heading h2,
.settings-layout h2 {
  font-size: clamp(2.7rem, 5vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  margin: 0;
}
.practice-heading em,
.settings-layout em {
  color: var(--coral);
  font-style: normal;
}
.tempo-readout {
  text-align: right;
}
.tempo-readout span,
.big-stat span,
.stat-grid span,
.meter-label {
  display: block;
  color: var(--muted);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tempo-readout strong {
  display: block;
  color: var(--mint);
  font: 21px var(--mono);
  margin-top: 6px;
}
.note-time-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 3px 5px;
  color: var(--muted);
  font: 8px var(--mono);
}
.note-stage {
  height: 245px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(12.5% - 1px),
      rgba(255, 255, 255, 0.07) 12.5%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 4px,
      rgba(255, 255, 255, 0.045) 4px,
      rgba(255, 255, 255, 0.045) 5px
    );
}
.stage-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.stage-cross {
  color: var(--coral);
  font: 22px var(--mono);
}
.stage-empty p {
  margin: 6px 0;
  font-size: 14px;
}
.stage-empty small {
  color: var(--muted);
  font: 10px var(--mono);
}
.note-block {
  position: absolute;
  left: 0;
  top: 0;
  width: 1%;
  min-width: 6px;
  padding: 0 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--mint);
  color: #17211f;
  font: 7px/1 var(--mono);
  line-height: 8px;
  white-space: nowrap;
  animation: note-bar-in 0.12s ease both;
  transform-origin: left;
}
.note-block.alt {
  background: var(--coral);
  color: #281817;
}
.piano-shell {
  margin-top: 36px;
}
.piano-meta,
.keyboard-scroll-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.piano-meta {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.piano-meta b {
  color: var(--mint);
  font-size: 13px;
}
.piano-meta small {
  color: var(--muted);
  font: 10px var(--mono);
}
.keyboard-help {
  opacity: 0.65;
}
.keyboard-viewport {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 17px 0 9px;
  scrollbar-color: var(--mint) var(--panel);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.piano {
  display: flex;
  position: relative;
  height: 174px;
  min-width: 1340px;
  padding: 0 8px;
}
.white-key {
  flex: 1 0 31px;
  height: 174px;
  background: linear-gradient(100deg, #edf1e9 0%, #c9d0c9 100%);
  border: 1px solid #83918c;
  border-radius: 0 0 4px 4px;
  position: relative;
  color: #66706d;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.white-key:hover,
.white-key.active {
  background: var(--mint);
}
.white-key.keyboard-unbound,
.black-key.keyboard-unbound {
  visibility: hidden;
}
.white-key.keyboard-unbound .black-key:not(.keyboard-unbound) {
  visibility: visible;
}
.white-key span {
  position: absolute;
  left: 50%;
  bottom: 25px;
  transform: translateX(-50%);
  font: 9px var(--mono);
  white-space: nowrap;
}
.white-key .key-bind {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  color: #334441;
  font: 600 7px var(--mono);
  text-transform: uppercase;
}
.black-key {
  position: absolute;
  z-index: 2;
  width: 20px;
  height: 105px;
  top: 0;
  background: linear-gradient(100deg, #27333a, #080c10);
  border: 1px solid #020507;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.4);
  color: #829490;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.black-key:hover,
.black-key.active {
  background: var(--coral);
  color: #2a1816;
}
.black-key span {
  position: absolute;
  bottom: 25px;
  width: 100%;
  text-align: center;
  font: 8px var(--mono);
  white-space: nowrap;
}
.black-key .key-bind {
  position: absolute;
  bottom: 8px;
  width: 100%;
  color: #c8d6d1;
  text-align: center;
  font: 600 6px var(--mono);
  text-transform: uppercase;
}
.black-key:hover .key-bind,
.black-key.active .key-bind {
  color: #2a1816;
}
.keyboard-scroll-hint {
  padding-top: 6px;
  font-size: 9px;
  opacity: 0.65;
}
.stats-panel {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.panel-heading,
.meter-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-live {
  color: var(--coral);
  font: 10px var(--mono);
}
.big-stat {
  padding: 35px 0;
  border-bottom: 1px solid var(--line);
}
.big-stat strong {
  display: block;
  font: 34px var(--mono);
  letter-spacing: -0.08em;
  margin-top: 9px;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 12px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}
.stat-grid strong {
  display: block;
  color: var(--soft);
  font: 17px var(--mono);
  margin-top: 8px;
}
.meter-block,
.recent-block {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.meter-label button,
.recent-list button {
  color: var(--mint);
  background: none;
  border: 0;
  text-transform: uppercase;
  font: 9px var(--mono);
}
.meter {
  height: 5px;
  margin-top: 14px;
  background: #303b42;
}
.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width 0.25s ease;
}
.recent-list {
  min-height: 60px;
  padding-top: 14px;
}
.recent-empty {
  color: var(--muted);
  font: 10px var(--mono);
}
.recent-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font: 10px var(--mono);
}
.recent-row b {
  color: var(--mint);
}
.recent-row .recent-kind {
  color: var(--yellow);
  text-transform: uppercase;
}
.recent-row .recent-kind--fast {
  color: var(--coral);
}
.recent-row .recent-kind--hold {
  color: var(--mint);
}
.recent-row span {
  color: var(--muted);
}
.settings-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12vw;
  max-width: 1050px;
  margin: 0 auto;
  padding: 15vh 5vw;
}
.settings-card {
  position: relative;
  padding: 22px 26px 26px;
  background: rgba(29, 37, 46, 0.9);
  border: 1px solid rgba(166, 234, 211, 0.22);
  box-shadow:
    18px 22px 0 rgba(8, 12, 16, 0.26),
    0 24px 70px rgba(0, 0, 0, 0.22);
}
.settings-card::before {
  content: "";
  position: absolute;
  top: 23px;
  right: 26px;
  width: 7px;
  height: 7px;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 128, 107, 0.1);
}
.settings-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 17px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.card-kicker,
.card-status {
  color: var(--muted);
  font: 10px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-status {
  color: var(--mint);
  margin-right: 24px;
}
.card-status i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: var(--mint);
}
.settings-card .setting-group:first-child {
  border-top: 0;
}
.settings-intro {
  color: var(--muted);
  max-width: 260px;
  line-height: 1.6;
  margin-top: 28px;
}
.setting-group {
  border-top: 1px solid var(--line);
  padding: 24px 0 30px;
}
.setting-title {
  display: flex;
  align-items: start;
  gap: 17px;
}
.setting-number {
  color: var(--coral);
  font: 11px var(--mono);
}
.setting-title h3 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 500;
}
.setting-title p {
  color: var(--muted);
  font: 10px var(--mono);
  margin: 0;
}
.setting-title output {
  margin-left: auto;
  color: var(--mint);
  font: 14px var(--mono);
}
.settings-controls input[type="range"] {
  accent-color: var(--coral);
  width: calc(100% - 42px);
  margin: 28px 0 0 42px;
}
.piano-mode-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 25px 0 0 42px;
  padding: 0;
  border: 0;
}
.piano-mode-selector legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.piano-mode-selector label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.piano-mode-selector input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.piano-mode-selector label span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 5px;
  margin-left: -1px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 9px var(--mono);
  text-align: center;
  text-transform: uppercase;
}
.piano-mode-selector input:checked + span {
  position: relative;
  z-index: 1;
  border-color: var(--mint);
  background: var(--mint);
  color: #14211f;
}
.piano-mode-selector input:focus-visible + span {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.bind-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  margin: 25px 0 0 42px;
}
.bind-key {
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 44px;
  color: var(--mint);
  font: 12px var(--mono);
}
.bind-key:hover,
.bind-key.awaiting {
  border-color: var(--coral);
  color: var(--coral);
}
.bind-key small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 5px;
}
.save-settings {
  width: 100%;
  margin-top: 9px;
}
.toast {
  position: fixed;
  z-index: 20;
  right: 25px;
  bottom: 25px;
  padding: 13px 17px;
  background: var(--mint);
  color: #13201e;
  font: 11px var(--mono);
  transform: translateY(80px);
  transition: 0.3s ease;
}
.toast.show {
  transform: translateY(0);
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes note-in {
  from {
    opacity: 0;
    transform: scaleY(0.15) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}
@keyframes note-bar-in {
  from {
    opacity: 0;
    transform: scaleX(0.35);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}
@media (max-width: 850px) {
  .screen--menu {
    padding: 15vw 8vw;
    align-items: flex-start;
  }
  .menu-orbit {
    width: 90vw;
    height: 90vw;
    top: 45%;
    right: -20%;
    opacity: 0.7;
  }
  .menu-side-note {
    display: none;
  }
  .play-layout,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 50px;
    padding-top: 8vh;
  }
  .stats-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 28px 0 0;
  }
  .settings-layout {
    padding-top: 10vh;
  }
  .keyboard-help {
    display: none;
  }
}
@media (max-width: 520px) {
  .topbar {
    height: 75px;
    padding: 0 6vw;
  }
  .session-title h2 {
    font-size: 13px;
  }
  .practice-heading {
    align-items: start;
    gap: 16px;
  }
  .practice-heading h2 {
    font-size: 2.8rem;
  }
  .tempo-readout {
    padding-top: 31px;
  }
  .piano {
    min-width: 1150px;
  }
  .bind-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .screen--menu h1 {
    font-size: 22vw;
  }
}

.rhythm-shell {
  background:
    radial-gradient(ellipse at 78% 32%, rgba(255, 128, 107, 0.1), transparent 30%),
    radial-gradient(ellipse at 16% 88%, rgba(166, 234, 211, 0.08), transparent 36%),
    linear-gradient(135deg, #182029 0%, #121820 62%, #10151c 100%);
}
.screen--rhythm {
  min-height: 100vh;
}
.rhythm-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 760px);
  gap: clamp(36px, 7vw, 100px);
  justify-content: center;
  padding: 7vh 5vw 5vh;
}
.level-rail {
  padding-top: 12px;
}
.rail-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.rail-heading .eyebrow,
.difficulty-block .eyebrow {
  margin-bottom: 17px;
}
.rail-heading > span {
  color: var(--muted);
  font: 9px var(--mono);
  white-space: nowrap;
}
.level-list {
  border-top: 1px solid var(--line);
}
.level-button {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.level-button:hover:not(:disabled),
.level-button.selected {
  color: var(--ink);
  background: rgba(166, 234, 211, 0.055);
}
.level-button.selected {
  box-shadow: inset 2px 0 var(--mint);
}
.level-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.level-number {
  color: var(--coral);
  font: 11px var(--mono);
}
.level-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.level-copy strong {
  font-size: 13px;
  font-weight: 500;
}
.level-copy small,
.level-mark {
  color: var(--muted);
  font: 9px var(--mono);
}
.level-mark {
  margin-left: auto;
  font-size: 8px;
}
.level-button.selected .level-mark {
  color: var(--mint);
}
.difficulty-block {
  margin-top: 35px;
}
.difficulty-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
}
.difficulty-selector label {
  position: relative;
  cursor: pointer;
}
.difficulty-selector input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.difficulty-selector label span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  margin-right: -1px;
  color: var(--muted);
  font: 10px var(--mono);
}
.difficulty-selector input:checked + span {
  position: relative;
  border-color: var(--coral);
  background: rgba(255, 128, 107, 0.12);
  color: var(--ink);
}
.difficulty-selector input:focus-visible + span {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}
.game-column {
  min-width: 0;
}
.song-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 27px;
}
.song-heading .eyebrow {
  margin-bottom: 14px;
}
.track-player-wrap {
  width: min(100%, 420px);
  margin: 0 0 18px;
}
#youtube-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #080c10;
}
#youtube-player iframe {
  display: block;
  width: 100%;
  height: 100%;
}
.track-credit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  color: var(--muted);
  font: 9px var(--mono);
}
.track-credit a {
  color: var(--mint);
  text-decoration: none;
}
.track-credit a:hover {
  text-decoration: underline;
}
.song-heading h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.song-heading h1 em {
  color: var(--coral);
  font-style: normal;
}
.song-tempo {
  display: grid;
  gap: 4px;
  padding: 0 0 3px 14px;
  text-align: right;
}
.song-tempo strong {
  color: var(--mint);
  font: 25px var(--mono);
}
.song-tempo span,
.game-hud > div > span {
  color: var(--muted);
  font: 9px var(--mono);
  text-transform: uppercase;
}
.game-hud {
  display: grid;
  grid-template-columns: 1.05fr 0.8fr 0.8fr 1.4fr;
  gap: 16px;
  align-items: end;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.game-hud > div:not(.hud-progress) strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font: 18px var(--mono);
}
.game-hud > div:first-child strong {
  color: var(--mint);
}
.hud-progress .progress-track {
  height: 3px;
  margin-top: 12px;
  background: rgba(232, 236, 237, 0.16);
}
.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width 0.12s linear;
}
.hud-health {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
}
.health-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.health-label span {
  color: var(--muted);
  font: 9px var(--mono);
  text-transform: uppercase;
}
.health-label strong {
  color: var(--mint);
  font: 11px var(--mono);
}
.health-track {
  height: 5px;
  background: rgba(232, 236, 237, 0.16);
}
.health-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--mint);
  transition: width 0.18s ease, background-color 0.18s ease;
}
.health-track[data-state="low"] i {
  background: var(--coral);
}
.rhythm-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: min(53vh, 440px);
  min-height: 300px;
  margin-top: 17px;
  overflow: hidden;
  border: 1px solid rgba(207, 221, 218, 0.13);
  background:
    linear-gradient(180deg, rgba(16, 21, 29, 0.8), rgba(29, 37, 46, 0.56)),
    repeating-linear-gradient(0deg, transparent 0, transparent 54px, rgba(255,255,255,.035) 55px);
  touch-action: none;
}
.lane {
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(207, 221, 218, 0.1);
  transition: background 0.12s ease;
  touch-action: none;
}
.lane:last-of-type {
  border-right: 0;
}
.lane:nth-child(odd) {
  background: rgba(166, 234, 211, 0.018);
}
.lane.lane-hit {
  background: rgba(166, 234, 211, 0.2);
}
.lane > b {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 3%;
  left: 0;
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  margin: auto;
  border: 1px solid rgba(166, 234, 211, 0.55);
  border-radius: 50%;
  background: #17211f;
  color: var(--mint);
  font: 11px var(--mono);
}
.fall-note {
  position: absolute;
  z-index: 2;
  top: 0;
  left: calc(50% - 12px);
  width: 24px;
  height: 24px;
  border: 2px solid rgba(232, 236, 237, 0.9);
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 15px rgba(166, 234, 211, 0.48);
  transform: translateY(-50%);
}
.fall-note::after {
  position: absolute;
  inset: -2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.68;
  transform: scale(var(--approach-scale, 2.4));
  transform-origin: center;
}
.lane:nth-child(even) .fall-note {
  background: var(--coral);
  box-shadow: 0 0 15px rgba(255, 128, 107, 0.38);
}
.hit-line {
  position: absolute;
  z-index: 1;
  top: 82%;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(232, 236, 237, 0.7);
  box-shadow: 0 0 12px rgba(166, 234, 211, 0.55);
  pointer-events: none;
}
.board-message,
.countdown {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  background: rgba(16, 21, 29, 0.38);
  pointer-events: none;
}
.board-message strong,
.countdown {
  color: var(--ink);
  font: 700 27px var(--display);
}
.board-message span {
  color: var(--muted);
  font: 10px var(--mono);
}
.countdown {
  color: var(--mint);
  font-size: 54px;
  text-shadow: 0 0 30px rgba(166, 234, 211, 0.4);
}
.is-hidden,
.countdown:empty {
  display: none;
}
.judge-callout {
  position: absolute;
  z-index: 5;
  top: 61%;
  right: 0;
  left: 0;
  color: var(--mint);
  font: 700 13px var(--mono);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.judge-good {
  color: var(--yellow);
}
.judge-miss {
  color: var(--coral);
}
.judge-pop {
  animation: judge-pop 0.5s ease both;
}
@keyframes judge-pop {
  0% { opacity: 0; transform: translateY(8px) scale(0.9); }
  25% { opacity: 1; transform: translateY(0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-5px); }
}
.lane-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 8px;
  background: var(--line);
}
.lane-keys span {
  display: grid;
  min-height: 29px;
  place-items: center;
  background: rgba(29, 37, 46, 0.86);
  color: var(--muted);
  font: 10px var(--mono);
}
.game-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}
.game-controls p,
.game-footnote {
  margin: 0;
  color: var(--muted);
  font: 9px var(--mono);
}
.game-button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--mint);
  background: var(--mint);
  color: #14211f;
  font: 600 11px var(--mono);
  white-space: nowrap;
}
.game-button:hover:not(:disabled) {
  background: #c0f6e2;
}
.game-button--secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}
.game-button--secondary:hover:not(:disabled) {
  border-color: var(--mint);
  background: rgba(166, 234, 211, 0.08);
}
.game-button:disabled {
  cursor: default;
  opacity: 0.62;
}
.game-button span {
  font-size: 14px;
}
.game-actions {
  display: flex;
  gap: 8px;
}
.rhythm-bind-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.game-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  margin-top: 19px;
  text-transform: uppercase;
}
.result-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 16, 0.82);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.result-overlay[hidden] {
  display: none;
}
.result-dialog {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(166, 234, 211, 0.32);
  background: #1b242c;
  box-shadow: 14px 18px 0 rgba(8, 12, 16, 0.3);
  animation: appear 0.25s ease both;
}
.result-dialog .eyebrow {
  margin-bottom: 14px;
}
.result-dialog h2 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1;
}
.result-dialog > p:not(.eyebrow) {
  color: var(--soft);
  line-height: 1.55;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 17px 0;
  margin: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 9px var(--mono);
}
.result-stats strong {
  display: block;
  margin-top: 7px;
  color: var(--mint);
  font-size: 18px;
}
@media (max-width: 850px) {
  .rhythm-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    max-width: 760px;
    padding-top: 30px;
  }
  .level-rail {
    padding: 0;
  }
  .level-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .level-button {
    min-height: 70px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 6px;
    padding: 7px 3px;
  }
  .level-number {
    font-size: 9px;
  }
  .level-copy {
    flex: 0 0 100%;
    text-align: center;
  }
  .level-copy strong {
    font-size: 10px;
  }
  .level-copy small,
  .level-mark {
    display: none;
  }
  .difficulty-block {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 17px;
  }
  .difficulty-block .eyebrow {
    margin: 0;
  }
  .difficulty-selector {
    width: min(100%, 300px);
  }
}
@media (max-width: 520px) {
  .rhythm-layout {
    gap: 22px;
    padding: 26px 5vw 34px;
  }
  .song-heading {
    margin-bottom: 18px;
  }
  .song-heading h1 {
    font-size: 2.5rem;
  }
  .game-hud {
    grid-template-columns: 1fr 0.65fr 0.8fr;
    gap: 9px;
  }
  .hud-progress {
    grid-column: 1 / -1;
  }
  .rhythm-board {
    height: 46vh;
    min-height: 280px;
  }
  .game-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .game-controls .game-button {
    width: 100%;
  }
  .game-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .game-actions #start-button {
    grid-column: 1 / -1;
  }
  .result-dialog {
    padding: 27px 23px;
  }
}
