:root {
  --bg: #100e0c;
  --cream: #f3ecdf;
  --muted: #b3a89a;
  --gold: #d7b56d;
  --ink: #1a1208;
  --card: rgba(28, 22, 18, 0.94);
  --line: #3d3428;
  --danger: #e7b2a8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.45;
  background:
    radial-gradient(ellipse 90% 42% at 50% -8%, rgba(215, 181, 109, 0.2), transparent 58%),
    radial-gradient(ellipse 32% 90% at -5% 45%, rgba(92, 18, 18, 0.55), transparent 62%),
    radial-gradient(ellipse 32% 90% at 105% 45%, rgba(92, 18, 18, 0.55), transparent 62%),
    var(--bg);
}

body[data-screen="dj"] {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(215, 181, 109, 0.22), transparent 55%),
    var(--bg);
}

img { display: block; max-width: 100%; }

button, input { font: inherit; color: inherit; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.ghost, .btn.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #6a3a32;
}

button:disabled { opacity: 0.55; cursor: wait; }

button.hit {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  min-height: 72px;
  padding: 8px;
  border-radius: 14px;
  background: transparent;
  color: var(--cream);
  border: 1px solid transparent;
  font-weight: 500;
}

button.hit strong,
button.hit em { display: block; font-style: normal; }

button.hit em { color: var(--muted); margin-top: 2px; }

button.hit.on,
button.hit:hover { border-color: var(--gold); background: rgba(215, 181, 109, 0.08); }

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

.wrap {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}

body[data-screen="dj"] .wrap { width: min(980px, 100%); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.top-actions a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.brand {
  color: var(--cream);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.code-pill {
  font-family: var(--mono);
  letter-spacing: 0.16em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 6px 10px;
}

h1, h2, h3, .spot, .now-name, .next-name {
  font-family: var(--serif);
  font-weight: 560;
  line-height: 1.05;
  margin: 0;
}

h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); }

h2 { font-size: 1.7rem; }

.spot { font-size: clamp(2.4rem, 9vw, 3.8rem); margin: 6px 0 8px; }

.lede { color: var(--muted); margin: 8px 0 0; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card, .stage-card, .next-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 14px 0;
}

.stage-card { position: relative; padding-top: 26px; }

.stage-card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 10px;
  height: 8px;
  background-image: radial-gradient(circle, #e7c27a 2.4px, transparent 2.8px);
  background-size: 14px 8px;
  background-repeat: repeat-x;
}

label { display: block; margin: 12px 0 6px; color: var(--muted); }

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #17130f;
  font-size: 16px;
}

input::placeholder { color: #8d8174; }

.stack { display: grid; gap: 10px; margin-top: 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.actions button { flex: 1 1 140px; }

body[data-screen="dj"] .actions button {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  min-height: 64px;
  font-size: 1.05rem;
}

.room-code {
  font-family: var(--mono);
  font-size: clamp(3rem, 14vw, 5rem);
  letter-spacing: 0.18em;
  color: var(--gold);
  margin: 8px 0;
}

.conn { min-height: 1.2em; margin: 0; color: var(--gold-2, var(--gold)); }

.error { color: var(--danger); min-height: 1.2em; margin: 8px 0; }

.muted { color: var(--muted); }

.row, .hero-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.row img, .hero-row img, .ph {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #2a2118;
}

.ph {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.4rem;
}

.who { margin: 0; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }

.song { margin: 2px 0 0; overflow-wrap: anywhere; }

.song span, .now-artist { color: var(--muted); }

.mine { border-color: var(--gold); }

#line .row, #rest .row, #recent .row, #me .row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  margin-top: 8px;
}

.dj-hero {
  display: grid;
  gap: 8px;
}

@media (min-width: 860px) {
  .dj-hero { grid-template-columns: 1.4fr 0.9fr; align-items: stretch; }
}

.now-name, .next-name {
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  overflow-wrap: anywhere;
}

.now-song { font-size: clamp(1.3rem, 3vw, 2rem); margin: 8px 0 0; }

.section-title { margin: 22px 0 8px; font-size: 1.3rem; }

.tiny { font-size: 0.92rem; }

::selection { background: #d7b56d; color: #1a1208; }

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


.noshow {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 14px 14px;
  margin: 0 0 8px;
}

.noshow legend {
  padding: 0 6px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.choices { display: flex; gap: 8px; }

.choices button {
  flex: 1;
  min-height: 48px;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}

.choices button[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.45rem;
  margin: 10px 0 0;
  color: var(--gold);
}

.timer.urgent { color: var(--danger); }

.stage-note { color: var(--muted); margin: 8px 0 0; }

button.confirm,
button.putback {
  text-transform: none;
  letter-spacing: 0;
}

button.putback { min-height: 44px; flex: 0 0 auto; }

.history-item { margin-top: 10px; }

.wait {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--gold);
  margin: 4px 0 8px;
}

body[data-screen="now"] {
  background:
    radial-gradient(ellipse 70% 50% at 50% -8%, rgba(215, 181, 109, 0.24), transparent 58%),
    radial-gradient(ellipse 36% 80% at -8% 80%, rgba(92, 18, 18, 0.5), transparent 62%),
    radial-gradient(ellipse 36% 80% at 108% 80%, rgba(92, 18, 18, 0.5), transparent 62%),
    var(--bg);
}

body[data-screen="now"] .wrap {
  width: min(1600px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 6vw;
}

.display-code {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  margin: 0;
  font-family: var(--mono);
  letter-spacing: 0.18em;
  color: var(--gold);
  font-size: clamp(0.85rem, 1.4vw, 1.15rem);
}

.display { position: relative; }

.display-hero {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
}

.display-hero img,
.display-hero .ph {
  width: clamp(140px, 22vw, 320px);
  height: clamp(140px, 22vw, 320px);
  border-radius: 28px;
  font-size: clamp(3.5rem, 8vw, 7rem);
}

h1.display-name {
  font-size: clamp(3.6rem, 10vw, 9rem);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.display-song {
  font-size: clamp(1.6rem, 3.4vw, 3.2rem);
  margin: 0.35em 0 0;
  overflow-wrap: anywhere;
}

.display-artist {
  font-size: clamp(1.2rem, 2.3vw, 2.3rem);
  color: var(--muted);
  margin: 0.15em 0 0;
  overflow-wrap: anywhere;
}

.display-next {
  margin: 5vh 0 0;
  font-size: clamp(1.25rem, 2.5vw, 2.3rem);
  overflow-wrap: anywhere;
}

.display-next span {
  display: inline-block;
  margin-right: 0.7em;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72em;
}

body[data-screen="now"] .eyebrow {
  font-size: clamp(0.85rem, 1.5vw, 1.25rem);
  margin-bottom: 1rem;
}

.display-conn {
  position: absolute;
  left: 6vw;
  bottom: calc(16px + env(safe-area-inset-bottom));
}

.top-actions { flex-wrap: wrap; justify-content: flex-end; }

a.tv-link {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.tv-link-row { margin: 0; }

@media (max-width: 720px) {
  .display-hero { flex-direction: column; align-items: flex-start; }
}
