:root {
  --bg: #090b11;
  --bg-soft: #131722;
  --panel: rgba(11, 15, 24, 0.86);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #edf2ff;
  --muted: rgba(237, 242, 255, 0.66);
  --faint: rgba(237, 242, 255, 0.4);
  --line: rgba(255, 255, 255, 0.1);
  --focus: #f0c676;
  --accent: #9ec7ff;
  --accent-strong: #d9ecff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --core-size: 19rem;
  --panel-width: min(31rem, 36vw);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 20%, rgba(151, 111, 57, 0.16), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(63, 90, 138, 0.14), transparent 28%),
    linear-gradient(160deg, #05070b 0%, #090b11 48%, #0e121b 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 4px,
      rgba(255, 255, 255, 0.01) 4px,
      rgba(255, 255, 255, 0.01) 5px
    );
  mix-blend-mode: screen;
  opacity: 0.35;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-width);
  overflow: hidden;
}

.experience {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.stage-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(34, 44, 67, 0.16), transparent 38%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 62%);
  filter: blur(0.8px);
}

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

.center-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--core-size);
  height: var(--core-size);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.core-halo {
  position: absolute;
  width: calc(var(--core-size) + 6rem);
  height: calc(var(--core-size) + 6rem);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(240, 198, 118, 0.18) 0%, rgba(240, 198, 118, 0.05) 32%, transparent 72%);
  filter: blur(20px);
  z-index: -2;
  animation: pulseHalo 10s ease-in-out infinite;
}

.art-shell {
  position: absolute;
  inset: 1.25rem;
  width: calc(var(--core-size) - 2.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0.8rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 40px rgba(0, 0, 0, 0.38);
}

.art-shell img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  filter: saturate(0.9) contrast(1.02);
}

.experience-copy,
.experience-controls {
  position: absolute;
  left: clamp(1rem, 3vw, 2rem);
  width: min(28rem, calc(100% - 2rem));
  z-index: 2;
}

.experience-copy {
  top: clamp(1rem, 3vw, 2rem);
}

.experience-controls {
  bottom: clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
}

.core-copy {
  max-width: 24rem;
  padding: 1rem 1.15rem;
  border-radius: 1.25rem;
  background: rgba(8, 11, 18, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  text-align: left;
}

.eyebrow,
.panel-kicker,
.overlay-kicker {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--faint);
}

#albumTitle {
  margin: 0.2rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 0.95;
}

.album-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.97rem;
  color: var(--muted);
}

.now-playing {
  margin: 0.8rem 0 0;
  font-size: 1.04rem;
  color: var(--accent-strong);
}

.time-readout {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.transport {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.7rem;
}

.control-button,
.overlay-button,
.text-button {
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.control-button {
  min-width: 4.5rem;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-button:hover,
.overlay-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.control-button-primary {
  background: linear-gradient(135deg, rgba(240, 198, 118, 0.94), rgba(226, 160, 95, 0.94));
  color: #17120d;
  border-color: rgba(255, 231, 181, 0.42);
}

.mode-pill {
  margin: 0;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hover-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 13rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.8rem;
  background: rgba(8, 11, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.interaction-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(16px);
}

.hidden {
  display: none;
}

.overlay-card {
  width: min(28rem, calc(100% - 2rem));
  padding: 1.5rem;
  border-radius: 1.5rem;
  background:
    linear-gradient(160deg, rgba(21, 27, 39, 0.94), rgba(10, 14, 24, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.overlay-card h2 {
  margin: 0.3rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.8rem;
}

.overlay-text {
  margin: 0.8rem 0 1rem;
  color: var(--muted);
}

.overlay-button {
  padding: 0.82rem 1.15rem;
  border-radius: 999px;
  color: #1d1610;
  background: linear-gradient(135deg, rgba(240, 198, 118, 1), rgba(226, 160, 95, 1));
}

.info-panel {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 12, 19, 0.92), rgba(7, 10, 16, 0.96));
  border-left: 1px solid var(--panel-border);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
}

.panel-section {
  padding: 1rem;
  border-radius: 1.15rem;
  background: rgba(11, 15, 24, 0.86);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel-section-header {
  padding-bottom: 1.2rem;
}

.track-headline-row,
.panel-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.track-number,
.panel-label {
  margin: 0;
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.theme-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #090b11;
  background: rgba(255, 255, 255, 0.85);
}

.panel-track-title {
  margin: 0.65rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.02;
}

.panel-section-name {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.panel-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.theme-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.theme-pill,
.text-button {
  border-radius: 999px;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.theme-pill[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.theme-dot {
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.text-button {
  padding: 0.2rem 0.65rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-status {
  font-size: 0.84rem;
  color: var(--muted);
}

.panel-section-lyrics {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.lyrics-content {
  margin: 0.8rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  flex: 1;
  min-height: 15rem;
  color: var(--text);
  line-height: 1.7;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92rem;
  scrollbar-width: thin;
}

.lyrics-content::-webkit-scrollbar {
  width: 10px;
}

.lyrics-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

@keyframes pulseHalo {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  :root {
    --panel-width: 100%;
    --core-size: 17rem;
  }

  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(66vh, 1fr) auto;
    overflow: visible;
  }

  .experience {
    height: auto;
    min-height: 66vh;
  }

  .experience-copy,
  .experience-controls {
    left: 1rem;
    width: calc(100% - 2rem);
  }

  .info-panel {
    height: auto;
    min-height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--panel-border);
  }
}

@media (max-width: 640px) {
  :root {
    --core-size: 14rem;
  }

  .center-core {
    width: min(calc(100% - 2rem), 20rem);
    height: min(calc(100% - 2rem), 20rem);
  }

  .experience-copy,
  .experience-controls {
    position: static;
    width: auto;
    margin-inline: 1rem;
  }

  .experience-copy {
    padding-top: 1rem;
  }

  .experience-controls {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    align-items: center;
  }

  .core-copy,
  .transport {
    justify-content: center;
  }

  .core-copy {
    text-align: center;
  }

  .info-panel,
  .panel-section {
    padding: 0.95rem;
  }

  .transport {
    gap: 0.5rem;
  }

  .control-button {
    min-width: 4rem;
    padding-inline: 0.85rem;
  }
}
