:root {
  color-scheme: dark;
  --bg: #07100d;
  --panel: #121a17;
  --panel-strong: #19231f;
  --text: #f3f8f1;
  --muted: #a7b4ad;
  --line: #26332e;
  --accent: #78df94;
  --accent-strong: #54c875;
  --danger: #ff8b8b;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(120, 223, 148, 0.12), transparent 34rem),
    linear-gradient(180deg, #07100d 0%, #0a0f0d 100%);
}

button, input { font: inherit; }
button {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  color: #06110d;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
button:hover { background: var(--accent-strong); }
button:disabled { cursor: wait; opacity: 0.65; }
button.secondary {
  color: var(--text);
  background: #26332e;
  border: 1px solid var(--line);
}
button.secondary:hover { background: #314139; }

input {
  width: 100%;
  min-height: 56px;
  border: 1px solid #314139;
  border-radius: var(--radius);
  padding: 0 1rem;
  color: var(--text);
  background: #202730;
  outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(120, 223, 148, 0.18); }
label { display: grid; gap: 0.5rem; color: var(--muted); font-size: 0.95rem; }

.guest-shell, .host-shell {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}
.host-shell { width: min(1180px, calc(100% - 2rem)); }
.hero { margin-bottom: 2rem; }
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; letter-spacing: 0; line-height: 1.02; }
h1 { font-size: clamp(3rem, 8vw, 5.8rem); max-width: 9ch; }
h2 { font-size: clamp(1.4rem, 4vw, 2.4rem); }
.now-playing, .status {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
  background: rgba(18, 26, 23, 0.92);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.26);
}
.panel + .panel { margin-top: 1.25rem; }
.wish-form { display: grid; gap: 1rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.message { min-height: 1.5rem; margin: 0; color: var(--muted); }
.message.success { color: var(--accent); }
.message.error { color: var(--danger); }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-heading span {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #06110d;
  background: var(--accent);
  font-weight: 900;
}
.track-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.track-list li {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  overflow-wrap: anywhere;
}
.track-list strong { color: var(--text); }
.track-list span, .muted { color: var(--muted); }
.empty-list li { color: var(--muted); }

.host-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.qr-card {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #06110d;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.qr-card img { display: block; width: 132px; height: 132px; }
.qr-card figcaption { margin-top: 0.35rem; }
.player-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  min-width: 220px;
}
.hidden-player {
  position: fixed;
  left: -220px;
  bottom: -160px;
  width: 180px;
  height: 120px;
  opacity: 0.01;
  pointer-events: none;
}
.host-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
}

@media (max-width: 760px) {
  .form-grid, .host-grid, .player-panel { grid-template-columns: 1fr; }
  .host-header { align-items: stretch; }
  .qr-card img { width: 108px; height: 108px; }
  .controls { min-width: 0; }
  h1 { font-size: clamp(2.6rem, 14vw, 4rem); }
}

@media (max-width: 520px) {
  .host-header { flex-direction: column; }
  .qr-card { width: max-content; }
}
