:root {
  --bg: #080c1a;
  --panel: #121a33;
  --panel-2: #1a2447;
  --line: rgba(148, 163, 184, 0.2);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --gold: #fbbf24;
  --eat: #22c55e;
  --discard: #f59e0b;
  --pass-l: #38bdf8;
  --pass-r: #a78bfa;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --card-w: min(64vw, 290px, 34vh);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
  cursor: pointer;
}

svg {
  width: 1em;
  height: 1em;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#touch-layer {
  position: absolute;
  inset: 0;
  display: none;
  touch-action: none;
}

#app[data-screen="play"] #touch-layer {
  display: block;
}

#safe-probe {
  position: fixed;
  inset: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  visibility: hidden;
  pointer-events: none;
}

/* ---------- screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0s linear 0.26s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0s;
}

.overlay {
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 22, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.panel {
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
  padding: 28px 22px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.panel h2 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--gold);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* ---------- buttons ---------- */

.btn {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease, background 0.2s ease, opacity 0.2s;
}

.btn:active {
  transform: scale(0.96);
}

.btn.primary {
  background: var(--gold);
  border-color: transparent;
  color: #1c1405;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}

.btn.wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
}

.icon-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 22px;
  transition: transform 0.08s ease, background 0.2s;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.14);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.pause-btn {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: calc(var(--safe-left) + 10px);
  z-index: 5;
  background: rgba(15, 23, 42, 0.55);
}

.pause-btn[hidden] {
  display: none;
}

/* ---------- title ---------- */

#screen-title {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.title-main {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: -6vh;
}

.logo-fan {
  position: relative;
  width: 200px;
  height: 120px;
  margin-bottom: 8px;
}

.mini-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 62px;
  height: 87px;
  margin-left: -31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  font-size: 34px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  transform-origin: 50% 140%;
  animation: bob 0.6s ease-in-out infinite alternate;
}

.mini-card svg {
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25));
}

.d-left {
  background: linear-gradient(var(--pass-l), #0369a1);
  --r: -24deg;
  animation-delay: -0.45s;
}

.d-left svg {
  transform: rotate(90deg);
}

.d-up {
  background: linear-gradient(var(--discard), #c2410c);
  --r: -8deg;
  animation-delay: -0.3s;
}

.d-up svg {
  transform: rotate(180deg);
}

.d-down {
  background: linear-gradient(var(--eat), #15803d);
  --r: 8deg;
  animation-delay: -0.15s;
}

.d-right {
  background: linear-gradient(var(--pass-r), #6d28d9);
  --r: 24deg;
}

.d-right svg {
  transform: rotate(-90deg);
}

@keyframes bob {
  from {
    transform: rotate(var(--r)) translateY(0);
  }
  to {
    transform: rotate(var(--r)) translateY(-8px);
  }
}

.logo {
  margin: 0;
  font-size: clamp(46px, 14vw, 76px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo .beat {
  color: var(--gold);
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.start-btn {
  margin-top: 6vh;
  min-height: 56px;
  padding: 0 34px;
  border-radius: 999px;
  border: 2px solid rgba(251, 191, 36, 0.7);
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: breathe 1.3s ease-in-out infinite;
}

.start-btn:active {
  transform: scale(0.95);
}

@keyframes breathe {
  50% {
    box-shadow: 0 0 0 10px rgba(251, 191, 36, 0.08);
    background: rgba(251, 191, 36, 0.18);
  }
}

.fine {
  margin: 0;
  color: rgba(148, 163, 184, 0.75);
  font-size: 13px;
}

/* ---------- bars ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  flex: none;
}

.bar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.bar-spacer {
  width: 46px;
}

.bar-actions {
  display: flex;
  gap: 8px;
}

.brand-sm {
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
}

.brand-sm b {
  color: var(--gold);
}

/* ---------- song select ---------- */

.tutorial-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 14px;
  font-weight: 600;
  flex: none;
}

.tutorial-tip[hidden] {
  display: none;
}

.tutorial-tip span {
  flex: 1;
}

.tip-close {
  border: 0;
  background: none;
  font-size: 22px;
  width: 32px;
  height: 32px;
  color: var(--muted);
}

.carousel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 calc(-16px - var(--safe-left)) 0 calc(-16px - var(--safe-right));
  padding: 10px calc(50% - var(--card-w) / 2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.song-card {
  --accent: #22c55e;
  position: relative;
  flex: 0 0 var(--card-w);
  aspect-ratio: 5 / 7;
  max-height: 100%;
  scroll-snap-align: center;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #0b1024));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transform: scale(0.86);
  opacity: 0.5;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.28s;
  cursor: pointer;
}

.song-card.focused {
  transform: scale(1);
  opacity: 1;
}

.song-card canvas {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 52%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  opacity: 0.95;
}

.song-card .pip {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.song-card h3 {
  margin: 0;
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.song-card .style {
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.85;
}

.song-card .meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.song-card .meta span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 800;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 8px 0 12px;
  flex: none;
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s, transform 0.2s;
}

.dots i.on {
  background: var(--gold);
  transform: scale(1.3);
}

.song-panel {
  display: grid;
  gap: 10px;
  width: min(100%, 440px);
  margin: 0 auto;
  flex: none;
}

.diff-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.diff-tabs[hidden] {
  display: none;
}

.diff-tabs button {
  --c: #4ade80;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s, transform 0.08s;
}

.diff-tabs button:active {
  transform: scale(0.95);
}

.diff-tabs [data-diff="normal"] {
  --c: #38bdf8;
}

.diff-tabs [data-diff="hard"] {
  --c: #f472b6;
}

.diff-tabs button[aria-selected="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.diff-tabs .lv {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 7px;
  background: var(--c);
  color: #0b1024;
  font-size: 13px;
  font-weight: 900;
}

.best-line {
  margin: 0;
  min-height: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.best-line b {
  color: var(--text);
}

.best-line .tag {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  background: #38bdf8;
  color: #0b1024;
}

.best-line .tag.ap {
  background: var(--gold);
}

.play-btn {
  position: relative;
  min-height: 60px;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(251, 191, 36, 0.25);
  color: #1c1405;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.08s;
}

.play-btn:active {
  transform: scale(0.97);
}

.play-fill {
  position: absolute;
  inset: 0;
  width: calc(var(--p, 1) * 100%);
  background: var(--gold);
  transition: width 0.2s;
}

.play-label {
  position: relative;
}

/* ---------- results ---------- */

#screen-results {
  justify-content: center;
  background: rgba(6, 9, 22, 0.66);
}

.results {
  width: min(100%, 440px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
  max-height: 100%;
  overflow-y: auto;
  padding: 14px;
}

.res-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.res-head p {
  margin: 2px 0 0;
  font-weight: 800;
  font-size: 14px;
}

.res-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.res-rank {
  --rank-color: var(--gold);
  flex: none;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 4px solid var(--rank-color);
  color: var(--rank-color);
  font-size: 68px;
  font-weight: 900;
  font-style: italic;
  opacity: 0;
  transform: scale(2.2) rotate(-14deg);
}

.res-rank.stamped {
  animation: stamp 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: scale(2.2) rotate(-14deg);
  }
  70% {
    opacity: 1;
    transform: scale(0.94) rotate(-5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(-6deg);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--rank-color) 14%, transparent);
  }
}

.res-scorebox {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.res-score {
  font-size: clamp(34px, 11vw, 46px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.res-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  animation: pop 0.35s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.res-badge.fc {
  background: #38bdf8;
  color: #0b1024;
}

.res-badge.ap {
  background: linear-gradient(90deg, #fde047, #f472b6, #a78bfa, #38bdf8);
  color: #0b1024;
}

.res-badge[hidden],
.res-best[hidden] {
  display: none;
}

.res-best {
  color: var(--gold);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.08em;
  animation: pop 0.35s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

.res-judges {
  display: grid;
  gap: 7px;
}

.jrow {
  display: grid;
  grid-template-columns: 70px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
}

.jrow i {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.jrow b {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: currentColor;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.jrow em {
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.jrow.perfect {
  color: #fde047;
}

.jrow.great {
  color: #f472b6;
}

.jrow.good {
  color: #5eead4;
}

.jrow.miss {
  color: #f87171;
}

.res-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.res-stats div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.res-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.res-stats dd {
  margin: 2px 0 0;
  font-weight: 900;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.res-graph {
  width: 100%;
  height: 84px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.res-actions,
.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------- settings ---------- */

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  width: min(100%, 520px);
  margin: 0 auto;
  padding-bottom: 12px;
}

.group {
  margin-top: 14px;
  padding: 6px 14px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.group h3 {
  margin: 10px 0 4px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  font-weight: 700;
}

.row > span {
  flex: 1;
}

.row input[type="range"] {
  flex: 1.4;
  accent-color: var(--gold);
  height: 32px;
}

.row output {
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 800;
}

.note {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.note.center {
  text-align: center;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 22px;
  font-weight: 900;
}

.stepper output {
  min-width: 70px;
  text-align: center;
  color: var(--text);
}

.seg {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.seg button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}

.seg button[aria-pressed="true"] {
  background: var(--gold);
  color: #1c1405;
}

.toggle input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 50px;
  height: 30px;
  margin: 0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s;
  flex: none;
}

.toggle input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle input:checked {
  background: var(--eat);
}

.toggle input:checked::before {
  transform: translateX(20px);
}

/* ---------- calibration ---------- */

.lead {
  margin: 10px auto 0;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.cal-pad {
  flex: 1;
  min-height: 180px;
  margin: 14px 0;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 2px dashed var(--line);
  touch-action: none;
}

.cal-dot {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde68a, var(--gold) 60%, rgba(251, 191, 36, 0.2));
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.4);
  pointer-events: none;
}

.cal-scale {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cal-marks {
  position: relative;
  flex: 1;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(90deg, transparent 49.5%, rgba(255, 255, 255, 0.6) 49.5% 50.5%, transparent 50.5%), rgba(255, 255, 255, 0.06);
}

.cal-marks i {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gold);
}

.cal-readout {
  margin: 14px 0 2px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.cal-count {
  margin: 0 0 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- import ---------- */

.import-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.file-btn {
  display: grid;
  place-items: center;
  margin-top: 6px;
}

.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}

.steps li::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex: none;
}

.steps li.active {
  color: var(--text);
}

.steps li.active::before {
  border-color: var(--gold);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.steps li.done {
  color: var(--eat);
}

.steps li.done::before {
  background: currentColor;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.prog {
  margin-left: auto;
  width: 34%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.prog b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
}

.import-result {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.import-result[hidden],
.error[hidden] {
  display: none;
}

.import-summary {
  margin: 0;
  font-weight: 700;
  line-height: 1.5;
}

.error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  font-weight: 700;
}

/* ---------- misc ---------- */

#toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#rotate-hint {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  text-align: center;
  background: var(--bg);
}

#rotate-hint div {
  display: grid;
  gap: 6px;
}

#rotate-hint b {
  font-size: 22px;
}

#rotate-hint span {
  color: var(--muted);
}

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  #rotate-hint {
    display: grid;
  }
}

@media (min-height: 760px) {
  .song-panel {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mini-card,
  .start-btn {
    animation: none;
  }
  .screen {
    transition: opacity 0.15s;
    transform: none;
  }
}
