:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1a1d24;
  --panel-2: #222630;
  --text: #f7f8fb;
  --muted: #a8afbd;
  --line: #313743;
  --accent: #ffb000;
  --accent-2: #ffd36a;
  --danger: #ff6b6b;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1b2029 0, var(--bg) 38rem);
  color: var(--text);
}

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

.site-header,
main {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 42px 0 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.status {
  color: var(--muted);
  padding: 40px 0;
}

.status.error { color: #ffb4b4; }
.status:empty { display: none; }

.song-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-bottom: 56px;
}

.song-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 16px 45px rgba(0,0,0,.2);
}

.visual-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0c0e12;
}

.song-visual {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Placeholder artwork should fill the visual window. */
.song-card[data-state="ready"] .song-visual {
  object-fit: cover;
}

/* GIFs often include transparent/empty edges; keep those edges light. */
.song-card[data-state="playing"] .visual-frame,
.song-card[data-state="paused"] .visual-frame {
  background: #f2f2f0;
}

.state-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(8,9,12,.74);
  color: #dfe3ec;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  backdrop-filter: blur(10px);
}

.song-card[data-state="playing"] .state-pill {
  color: #17120a;
  background: var(--accent);
  border-color: transparent;
}

.song-card[data-state="paused"] .state-pill {
  color: #fff;
  background: #5f4bb6;
  border-color: transparent;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.song-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  line-height: 1.15;
}

.play-button,
.primary-button,
.ghost-button {
  min-height: 46px;
  border-radius: 14px;
  border: 0;
  font-weight: 850;
  cursor: pointer;
}

.play-button,
.primary-button {
  background: var(--accent);
  color: #17120a;
  padding: 0 21px;
}

.play-button:hover,
.primary-button:hover { background: var(--accent-2); }

.song-card[data-active="true"] .play-button {
  background: #fff;
  color: #111318;
}

.ghost-button {
  padding: 0 17px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

.creator-shell {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.creator-shell h1 { font-size: clamp(2.2rem, 7vw, 4rem); }
.creator-intro { max-width: 62ch; color: var(--muted); line-height: 1.55; }

.creator-panel {
  margin-top: 28px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.creator-panel h2 { margin-top: 0; }

.creator-form {
  display: grid;
  gap: 17px;
}

.field { display: grid; gap: 7px; }
.field label { font-weight: 750; }
.field small { color: var(--muted); }

.field input[type="text"],
.field input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #12151b;
  color: var(--text);
  padding: 12px;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.creator-message {
  min-height: 1.4em;
  color: var(--muted);
}
.creator-message.success { color: #91e6a8; }
.creator-message.error { color: #ff9f9f; }

.song-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.song-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.song-list li:last-child { border-bottom: 0; }
.song-list code { color: var(--muted); }

@media (max-width: 700px) {
  .song-grid { grid-template-columns: 1fr; }
  .site-header { align-items: center; padding-top: 28px; }
  .card-footer { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
