:root {
  --text: #f1f5ff;
  --muted: rgba(225, 235, 255, 0.7);
  --panel: rgba(0, 0, 0, 0.64);
  --panel-border: rgba(255, 255, 255, 0.1);
  --accent: #7bc7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

body::before {
  inset: auto;
  top: -10rem;
  right: -8rem;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 99, 216, 0.22), rgba(80, 150, 255, 0.08) 50%, transparent 72%);
  filter: blur(22px);
  animation: previewDrift 24s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 86%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.viewer-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 2;
}

.top-nav {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: min(720px, calc(100vw - 36px));
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
}

.nav-link.current {
  background: linear-gradient(90deg, #ffffff, #b9d4ff);
  color: #05070c;
  font-weight: 700;
}

#preview-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.song-panel,
.settings-panel,
.transport-bar,
.hud-badges {
  position: absolute;
  z-index: 2;
}

.song-panel {
  top: 74px;
  left: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: min(440px, calc(100vw - 36px));
}

.cover-canvas {
  width: 124px;
  height: 124px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.song-meta h1,
.song-meta p {
  margin: 0;
  line-height: 1;
}

.song-meta h1,
.song-meta p {
  font-family: "Rajdhani", sans-serif;
  text-transform: lowercase;
}

.song-meta h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: 0.02em;
}

.song-meta p {
  font-size: 1.15rem;
  color: var(--text);
  opacity: 0.9;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag,
.hud-badge {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.settings-panel {
  top: 74px;
  right: 18px;
  width: min(360px, calc(100vw - 36px));
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
  font-family: "Rajdhani", sans-serif;
}

.viewer-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes previewDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2rem, 1rem, 0) scale(1.05); }
  100% { transform: translate3d(1rem, 2rem, 0) scale(0.95); }
}

.settings-header strong {
  font-size: 1.2rem;
}

#status-line {
  color: var(--muted);
  font-size: 0.95rem;
}

.settings-form,
.field,
.toggle-row,
.button-row {
  display: grid;
  gap: 10px;
}

.pair,
.triple {
  display: grid;
  gap: 10px;
}

.pair {
  grid-template-columns: 1fr 110px;
}

.triple {
  grid-template-columns: repeat(3, 1fr);
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

.toggle-row {
  grid-template-columns: repeat(3, 1fr);
  font-size: 0.92rem;
}

.toggle-row label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.button-row {
  grid-template-columns: 1fr 92px;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  min-height: 40px;
}

#generate-button {
  background: linear-gradient(90deg, #ffffff, #b9d4ff);
  color: #05070c;
  font-weight: 700;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.summary-panel,
.checks-panel {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

.summary-line,
.check-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-line + .summary-line,
.check-line + .check-line {
  margin-top: 6px;
}

.check-line span:last-child {
  color: var(--muted);
}

.transport-bar {
  left: 150px;
  right: 150px;
  bottom: 22px;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
}

.play-toggle {
  min-height: 44px;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
}

.seek-shell {
  display: flex;
  align-items: center;
}

.seek-bar {
  width: 100%;
  accent-color: #fff;
}

.transport-readout {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
}

.hud-badges {
  right: 150px;
  bottom: 86px;
  display: flex;
  gap: 8px;
}

.hud-badge.accent {
  background: rgba(140, 99, 216, 0.76);
  border-color: rgba(140, 99, 216, 0.95);
}

@media (max-width: 1100px) {
  .transport-bar {
    left: 18px;
    right: 18px;
  }

  .hud-badges {
    right: 18px;
  }
}

@media (max-width: 780px) {
  .top-nav {
    width: calc(100vw - 24px);
  }

  .song-panel {
    top: 104px;
    max-width: calc(100vw - 36px);
  }

  .cover-canvas {
    width: 96px;
    height: 96px;
  }

  .song-meta h1 {
    font-size: 2rem;
  }

  .settings-panel {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 130px;
    width: auto;
    max-height: 44vh;
    overflow: auto;
  }

  .triple,
  .toggle-row {
    grid-template-columns: 1fr;
  }

  .transport-bar {
    grid-template-columns: 80px 1fr;
  }

  .transport-readout {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .top-nav {
    top: 10px;
    gap: 8px;
  }

  .song-panel {
    top: 118px;
    left: 12px;
  }
}
