:root {
  color-scheme: dark;
  --background: #070707;
  --surface: #0c0c0c;
  --surface-glass: #0c0c0cf5;
  --flagrant-red: #ff4300;
  --text: #ffffff;
  --muted: #a9a9a9;
  --track: #3b3b3b;
  --player-height: 154px;
  --system-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--text);
  font-family: var(--system-font);
  -webkit-font-smoothing: antialiased;
}

button,
input { -webkit-tap-highlight-color: transparent; }

button {
  cursor: pointer;
  font: inherit;
}

button:disabled {
  cursor: wait;
  opacity: .4;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--flagrant-red);
  outline-offset: 5px;
}

.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.crown-mark {
  position: absolute;
  top: clamp(24px, 5vh, 58px);
  left: 50%;
  width: clamp(58px, 6vw, 78px);
  transform: translateX(-50%);
  color: var(--flagrant-red);
  opacity: .78;
}

.crown-mark svg {
  display: block;
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px #ff430052);
}

.stage {
  position: relative;
  display: grid;
  min-height: calc(100svh - var(--player-height));
  padding: clamp(92px, 15vh, 150px) clamp(24px, 7vw, 130px) 74px;
  place-items: center;
}

.intro,
#lyric {
  grid-area: 1 / 1;
}

.intro {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  margin: 0;
  visibility: hidden;
  opacity: 0;
  text-align: center;
}

.intro.is-visible {
  visibility: visible;
}

.intro h1 {
  margin: 0 0 clamp(22px, 4vh, 38px);
  color: var(--text);
  font-size: clamp(2.25rem, 5.2vw, 5.6rem);
  font-weight: 620;
  letter-spacing: -.045em;
  line-height: 1.04;
  text-wrap: balance;
}

.intro p {
  margin: 8px 0 0;
  color: #c7c7c7;
  font-size: clamp(.92rem, 1.35vw, 1.2rem);
  font-weight: 430;
  letter-spacing: .025em;
  line-height: 1.45;
}

#lyric {
  position: relative;
  z-index: 1;
  width: min(100%, 1380px);
  margin: 0;
  opacity: 0;
  color: var(--text);
  font-family: var(--system-font);
  font-size: clamp(2.15rem, 5.15vw, 5.55rem);
  font-weight: 540;
  letter-spacing: -.038em;
  line-height: 1.17;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  will-change: opacity, transform, filter;
}

.queen-word {
  color: var(--text);
  font-weight: 690;
  white-space: nowrap;
  will-change: color, text-shadow;
}

.player {
  position: fixed;
  z-index: 3;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: var(--player-height);
  padding: 21px clamp(20px, 5vw, 80px) calc(19px + env(safe-area-inset-bottom));
  border-top: 1px solid #ffffff14;
  background: var(--surface-glass);
  box-shadow: 0 -20px 60px #0008;
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
}

.progress-row {
  display: flex;
  max-width: 1420px;
  margin: 0 auto 14px;
  align-items: center;
  gap: 19px;
}

.time {
  min-width: 36px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .045em;
}

.time:last-child { text-align: right; }

.range {
  --fill: 0%;
  appearance: none;
  -webkit-appearance: none;
  height: 24px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--flagrant-red) 0 var(--fill), var(--track) var(--fill) 100%);
}

.range::-moz-range-track {
  height: 3px;
  border-radius: 4px;
  background: var(--track);
}

.range::-moz-range-progress {
  height: 3px;
  border-radius: 4px;
  background: var(--flagrant-red);
}

.range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--flagrant-red);
  box-shadow: 0 0 0 4px #ff43001f, 0 0 14px #ff430088;
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--flagrant-red);
  box-shadow: 0 0 14px #ff430088;
}

.seek {
  flex: 1;
  min-width: 0;
}

.volume {
  width: 74px;
  --fill: 100%;
}

.controls-row {
  display: grid;
  max-width: 1420px;
  margin: auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.player-state {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .075em;
  text-transform: uppercase;
}

#state {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #8e8e8e;
}

body.playing .state-dot {
  background: var(--flagrant-red);
  box-shadow: 0 0 12px #ff4300bb;
}

.transport {
  display: flex;
  align-items: center;
  gap: 22px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 8px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #e8e8e8;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.icon-button:hover {
  color: var(--text);
  background: #ffffff10;
}

.icon-button:active { transform: scale(.93); }

.icon-button[aria-pressed="true"] {
  color: var(--flagrant-red);
  background: #ff430021;
  box-shadow: inset 0 0 0 1px #ff43002b;
}

button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-button {
  display: grid;
  width: 56px;
  height: 56px;
  padding: 0;
  place-items: center;
  border: 1px solid #ff4300;
  border-radius: 50%;
  background: var(--flagrant-red);
  color: #170500;
  box-shadow: 0 0 24px #ff430052;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.play-button svg { width: 24px; height: 24px; }

.play-button:hover {
  transform: scale(1.055);
  background: var(--flagrant-red);
  box-shadow: 0 0 34px #ff430080;
}

.play-button:active { transform: scale(.96); }

.extras {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 12px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

#audio { display: none; }

@media (max-width: 700px) {
  :root { --player-height: 147px; }

  .stage {
    min-height: calc(100svh - var(--player-height) - env(safe-area-inset-bottom));
    padding: 76px 24px 64px;
  }

  #lyric {
    font-size: clamp(1.82rem, 8.3vw, 3rem);
    line-height: 1.2;
    letter-spacing: -.033em;
  }

  .intro h1 { font-size: clamp(2rem, 10vw, 3.15rem); }
  .intro p { font-size: clamp(.84rem, 3.8vw, 1rem); }
  .crown-mark { top: 23px; width: 53px; }
  .player { padding: 17px 18px calc(17px + env(safe-area-inset-bottom)); }
  .progress-row { margin-bottom: 12px; gap: 12px; }
  .controls-row { grid-template-columns: 1fr auto 1fr; gap: 4px; }
  .player-state { gap: 6px; font-size: 9px; letter-spacing: .035em; }
  .transport { gap: 6px; }
  .extras { gap: 0; }
  .volume { display: none; }
  .icon-button { width: 35px; height: 40px; padding: 6px; }
  .play-button { width: 51px; height: 51px; }
}

@media (max-width: 350px) {
  #lyric { font-size: 1.68rem; }
  .player-state { max-width: 66px; letter-spacing: 0; }
  .transport { gap: 2px; }
  .extras .icon-button { width: 31px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  :root { --player-height: 108px; }
  .stage { padding: 48px 8vw 31px; }
  #lyric { font-size: clamp(1.42rem, 6.1vh, 2.5rem); line-height: 1.16; }
  .intro h1 { margin-bottom: 12px; font-size: clamp(1.55rem, 7.2vh, 2.3rem); }
  .intro p { margin-top: 3px; font-size: clamp(.68rem, 2.8vh, .84rem); line-height: 1.25; }
  .crown-mark { top: 12px; width: 40px; }
  .player { padding-top: 7px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .progress-row { margin-bottom: 1px; }
  .play-button { width: 44px; height: 44px; }
  .icon-button { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none !important; }
}
