:root {
  --void: #060608;
  --wall: #111116;
  --floor-top: #13131a;
  --warm-key: rgba(255, 245, 228, 0.088);
  --ink: #eef0f4;
  --ink-muted: rgba(238, 240, 244, 0.54);
  --lcd-bg: #d7dfe8;
  --lcd-ink: #303133;
  --lcd-ink-soft: #5b6067;
  --lcd-frame: #5d5e60;
  --shell-top: #f7f8fa;
  --shell-mid: #eceef1;
  --shell-bot: #dcdde2;
  --wheel-grey: #e4e5e8;
  --wheel-ink: #6a6c70;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 42% at 50% 4%, var(--warm-key), transparent 72%),
    radial-gradient(ellipse 38% 34% at 50% 46%, rgba(164, 196, 228, 0.048), transparent 70%),
    linear-gradient(180deg, var(--wall) 0%, #0b0b10 46%, #08080b 74%, var(--void) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.studio-hud {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: max(18px, env(safe-area-inset-top, 18px)) max(22px, env(safe-area-inset-right, 22px)) 12px 16px;
  pointer-events: none;
}

.studio-hud > * {
  pointer-events: auto;
}

.ipod-remote {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 4px 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--shell-top) 0%, var(--shell-mid) 56%, var(--shell-bot) 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 2px rgba(96, 99, 106, 0.24),
    0 10px 26px rgba(0, 0, 0, 0.56),
    0 0 0 0.5px rgba(0, 0, 0, 0.45);
  transition: box-shadow 260ms ease, transform 220ms ease;
}

.ipod-remote:hover {
  transform: translateY(-0.5px);
}

.ipod-remote[data-playing="true"] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 2px rgba(96, 99, 106, 0.24),
    0 10px 28px rgba(0, 0, 0, 0.58),
    0 0 24px -4px rgba(176, 208, 238, 0.44);
}

.remote-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(110, 112, 118, 0.34);
  background: linear-gradient(180deg, #f3f4f6 0%, var(--wheel-grey) 100%);
  color: var(--wheel-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 1px 1.5px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 90ms ease;
}

.remote-key:hover {
  color: #2b2c2e;
  background: linear-gradient(180deg, #ffffff 0%, #e7e8ec 100%);
  border-color: rgba(88, 90, 96, 0.48);
}

.remote-key:active {
  transform: scale(0.95);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

.remote-key:focus-visible,
.remote-lcd:focus-visible {
  outline: 2px solid #8eb8e5;
  outline-offset: 2px;
}

.ipod-remote[data-playing="true"] .remote-mute {
  color: #2d2e30;
  border-color: rgba(78, 86, 96, 0.48);
}

.sound-glyph {
  display: none;
}

.mute-glyph {
  display: inline-flex;
}

.ipod-remote[data-playing="true"] .mute-glyph {
  display: none;
}

.ipod-remote[data-playing="true"] .sound-glyph {
  display: inline-flex;
}

.remote-next[hidden] {
  display: none;
}

.remote-lcd {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  max-width: 248px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1.5px solid var(--lcd-frame);
  background: linear-gradient(180deg, #cbd4de 0%, var(--lcd-bg) 52%, #d0dae4 100%);
  box-shadow:
    inset 0 1px 3px rgba(34, 38, 44, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--lcd-ink);
  font-family: ui-monospace, "SF Mono", "Menlo", "ChicagoFLF", monospace;
  font-size: 11.5px;
  letter-spacing: -0.015em;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.remote-lcd:hover {
  background: linear-gradient(180deg, #d3dde8 0%, #dee7f0 52%, #d5e0ea 100%);
}

.ipod-remote[data-playing="true"] .remote-lcd {
  background: linear-gradient(180deg, #d2dfec 0%, #dfe9f4 52%, #d4e1ee 100%);
  box-shadow:
    inset 0 1px 2.5px rgba(34, 42, 52, 0.24),
    inset 0 0 10px rgba(190, 222, 252, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.85);
}

.lcd-eq {
  display: none;
  align-items: flex-end;
  gap: 1.5px;
  height: 9px;
  flex-shrink: 0;
}

.lcd-eq i {
  display: block;
  width: 2px;
  height: 4px;
  background: var(--lcd-ink);
  transform-origin: bottom;
  animation: eq-bounce 0.95s ease-in-out infinite;
}

.lcd-eq i:nth-child(2) {
  height: 9px;
  animation-delay: -0.32s;
}

.lcd-eq i:nth-child(3) {
  height: 6px;
  animation-delay: -0.64s;
}

.ipod-remote[data-playing="true"] .lcd-eq {
  display: inline-flex;
}

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.32); }
  50% { transform: scaleY(1); }
}

.lcd-title {
  font-weight: 700;
  color: var(--lcd-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lcd-artist {
  color: var(--lcd-ink-soft);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

#stage {
  position: relative;
  overscroll-behavior: none;
  overflow: hidden;
  min-height: var(--app-height, 100vh);
  min-height: var(--app-height, 100dvh);
  display: grid;
  place-items: center;
  z-index: 1;
}

#stage[hidden] {
  display: none;
}

.set {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 440px;
  height: 692px;
  transform: translate(-50%, -50%) scale(var(--set-scale, 1));
  transform-origin: center;
  --set-scale: 1;
  --tilt-y: 0deg;
  --tilt-x: 0deg;
  --tilt-y-num: 0;
  --sheen-x: 50%;
}

.lcd-spill {
  position: absolute;
  left: 50%;
  top: 23%;
  width: 580px;
  height: 460px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 54% 50% at 50% 50%,
    rgba(176, 208, 238, 0.22) 0%,
    rgba(154, 192, 226, 0.085) 45%,
    transparent 74%
  );
  filter: blur(42px);
  opacity: 0.72;
  transition: opacity 700ms ease, transform 700ms ease;
}

html[data-playing="true"] .lcd-spill {
  opacity: 1;
  background: radial-gradient(
    ellipse 58% 52% at 50% 50%,
    rgba(182, 214, 244, 0.30) 0%,
    rgba(152, 192, 232, 0.11) 48%,
    transparent 75%
  );
  animation: spill-breathe 4.6s ease-in-out infinite;
}

@keyframes spill-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.88; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

.chassis-rig {
  position: relative;
  width: 440px;
  height: 692px;
  z-index: 2;
  transform: perspective(1150px) rotateY(var(--tilt-y, 0deg)) rotateX(var(--tilt-x, 0deg));
  transform-origin: 50% 62%;
  will-change: transform;
  transition: transform 460ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.chassis-rig.is-dragging {
  transition: transform 48ms linear;
}

#stage web-music-ipod {
  display: block;
  touch-action: none;
  cursor: grab;
  width: 440px;
  height: 692px;
  filter: drop-shadow(0 0 0.7px rgba(255, 255, 255, 0.16));
}

.chassis-rig.is-dragging web-music-ipod {
  cursor: grabbing;
}

.chassis-sheen {
  position: absolute;
  left: 12px;
  right: 13px;
  top: 2px;
  bottom: 2px;
  border-radius: 34px;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    112deg,
    transparent calc(var(--sheen-x, 50%) - 34%),
    rgba(255, 255, 255, 0.085) var(--sheen-x, 50%),
    transparent calc(var(--sheen-x, 50%) + 34%)
  );
  mix-blend-mode: screen;
  opacity: 0.7;
}

.wear {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.wear-tint {
  left: 3%;
  right: 3%;
  top: 0.4%;
  bottom: 0.2%;
  background: #efe3c8;
  opacity: 0.045;
  mix-blend-mode: multiply;
  border-radius: 32px;
}

.wear-edge-t {
  left: 7%;
  right: 7%;
  top: 0.5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  opacity: 0.55;
}

.wear-edge-b {
  left: 8%;
  right: 8%;
  bottom: 1.1%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.3), transparent);
  opacity: 0.62;
}

.wear-smudge {
  left: 32%;
  top: 9%;
  width: 26%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.28), transparent 70%);
  opacity: 0.3;
  filter: blur(2px);
}

.floor {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 320vw;
  height: 44vh;
  pointer-events: none;
  isolation: isolate;
  z-index: 1;
  background: linear-gradient(180deg, var(--floor-top) 0%, #0a0a10 42%, var(--void) 100%);
}

.floor::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 28px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 50%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 50%, transparent);
  filter: blur(6px);
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 16%,
    rgba(255, 255, 255, 0.035) 28%,
    rgba(255, 255, 255, 0.08) 40%,
    rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.08) 60%,
    rgba(255, 255, 255, 0.035) 72%,
    transparent 84%,
    transparent 100%
  );
}

.floor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 476px;
  height: 48px;
  transform: translate(calc(-50% + var(--tilt-y-num, 0) * -1.4px), -45%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse 62% 32% at 50% 74%, rgba(255, 255, 255, 0.052), transparent 70%),
    radial-gradient(ellipse 54% 46% at 50% 22%, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.72) 38%, rgba(0, 0, 0, 0.3) 66%, transparent 100%);
  filter: blur(9px);
  transition: transform 280ms ease-out;
}

.floor > .occlusion {
  position: absolute;
  left: 50%;
  top: -1px;
  width: 404px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #000;
  filter: blur(1.2px);
  z-index: 2;
}

.studio-hint {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 18px));
  transform: translateX(-50%);
  margin: 0;
  z-index: 10;
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.72;
  transition: opacity 700ms ease;
}

.studio-hint.is-quiet {
  opacity: 0.26;
}

html.is-short .studio-hint {
  display: none;
}

.studio-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 1px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font: 500 10.5px/1.3 inherit;
  color: inherit;
}

#fallback {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 56px 24px;
  background: var(--void);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

#fallback .fb-title {
  margin: 0 0 36px;
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.02em;
}

#fallback ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 36rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#fallback a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
}

#fallback a:hover,
#fallback a:focus-visible {
  border-bottom-color: var(--ink);
}

noscript {
  display: block;
  max-width: 38rem;
  margin: 64px auto;
  padding: 0 24px;
}

noscript ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

noscript li {
  margin: 8px 0;
}

noscript a {
  color: var(--ink);
}

@media (min-height: 920px) {
  .set { --set-scale: 1.03; }
}

@media (max-height: 860px) {
  .set { --set-scale: 0.90; }
}

@media (max-height: 780px) {
  .set { --set-scale: 0.82; }
}

@media (max-height: 700px) {
  .set { --set-scale: 0.74; }
}

@media (max-height: 620px) {
  .set { --set-scale: 0.64; }
}

@media (max-height: 480px) {
  .set { --set-scale: 0.52; }
}

@media (max-width: 560px) {
  .studio-hud {
    padding: max(12px, env(safe-area-inset-top, 12px)) 14px 10px;
  }
  .remote-lcd {
    max-width: 175px;
    padding: 0 9px;
  }
  .lcd-artist {
    display: none;
  }
  .studio-hint {
    font-size: 11px;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }
  .studio-hint .hint-keys {
    display: none;
  }
}

@media (max-width: 460px) {
  html, body {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }
  .set { --set-scale: 0.78; }
}

@media (max-width: 400px) {
  .set { --set-scale: 0.74; }
}

@media (max-width: 640px), (pointer: coarse) {
  body::after {
    display: none;
  }
  .chassis-rig {
    transform: none !important;
    transition: none;
    will-change: auto;
  }
  .chassis-sheen,
  .wear,
  .lcd-spill,
  .floor::before {
    display: none !important;
  }
  #stage web-music-ipod {
    filter: none;
  }
  .floor::after {
    filter: blur(5px);
  }
  .studio-hint {
    font-size: 11px;
  }
}

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