:root {
  --cream: #fff6e6;
  --peppermint: #ff5d7a;
  --mint: #7bd6b6;
  --grape: #8a5cd1;
  --lemon: #ffd86b;
  --blue: #9ee7ff;
  --ink: #2c1a3a;
  --paper: #ffffff;
  --soft: rgba(44, 26, 58, 0.72);
  --logo: "Pacifico", "Brush Script MT", cursive;
  --display: "Bagel Fat One", "Impact", sans-serif;
  --sans: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, #ffd1dd 0 18px, transparent 19px),
    radial-gradient(circle at 86% 12%, #bde7ff 0 22px, transparent 23px),
    radial-gradient(circle at 92% 72%, #fff0a8 0 20px, transparent 21px),
    linear-gradient(145deg, #fff9ef, #f1fff8 48%, #ffe8f0);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 700;
}

a {
  color: inherit;
}

button,
input,
.button,
.small-link {
  font: inherit;
}

button,
.button,
.small-link {
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--peppermint);
  box-shadow: 4px 4px 0 var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 900;
  min-height: 48px;
  padding: 10px 14px;
  text-align: center;
  text-decoration: none;
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.28);
  opacity: 0.7;
}

.shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) 16px 34px;
}

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

.home-link,
.host-link {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
}

.host-link {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--lemon);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 12px;
  white-space: nowrap;
}

.title {
  margin: 0;
  font-family: var(--logo);
  font-size: clamp(3.7rem, 16vw, 7.4rem);
  font-weight: 400;
  line-height: 0.88;
  color: var(--peppermint);
  text-shadow: 4px 4px 0 var(--ink), 5px 5px 0 var(--ink);
  transform: rotate(-2deg);
}

.lede {
  max-width: 720px;
  margin: 18px 0 22px;
  color: var(--ink);
  font-size: clamp(1.05rem, 4.5vw, 1.45rem);
  font-weight: 900;
  line-height: 1.25;
}

.panel {
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: white;
  box-shadow: 7px 7px 0 var(--ink);
  padding: clamp(16px, 4vw, 26px);
}

.request-form,
.search-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.5fr) minmax(190px, 1fr) minmax(150px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--peppermint);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  padding: 10px 12px;
}

.trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--soft);
  font-weight: 900;
  line-height: 1.3;
}

.status[data-tone="bad"] {
  color: #b82042;
}

.status[data-tone="good"] {
  color: #157a55;
}

.results,
.queue-list,
.history-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.song-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 3px solid rgba(44, 26, 58, 0.16);
  border-radius: 8px;
  background: #fffaf2;
  padding: 10px;
}

.song-row img {
  width: 86px;
  aspect-ratio: 16 / 9;
  display: block;
  border: 2px solid var(--ink);
  border-radius: 6px;
  object-fit: cover;
}

.song-copy {
  min-width: 0;
}

.song-copy h3,
.now-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.12;
}

.song-copy p,
.now-copy p,
.meta {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.25;
}

.now {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.now img {
  width: 118px;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--ink);
  border-radius: 8px;
  object-fit: cover;
}

.skip-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  border-top: 3px solid rgba(44, 26, 58, 0.16);
  padding-top: 16px;
}

.skip-meter {
  height: 16px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fffaf2;
}

.skip-meter span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--grape);
}

.section-title {
  margin: 26px 0 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 7vw, 3.3rem);
  font-weight: 400;
  line-height: 0.95;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head .section-title {
  margin-top: 0;
}

.ghost-button {
  min-height: 40px;
  background: var(--lemon);
  color: var(--ink);
  padding: 8px 11px;
}

.queue-panel {
  display: grid;
  gap: 14px;
}

.queue-list,
.host-queue {
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item,
.host-queue-item {
  display: grid;
  gap: 10px;
  border: 3px solid rgba(44, 26, 58, 0.16);
  border-radius: 8px;
  background: #fffaf2;
  padding: 12px;
}

.queue-item {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}

.queue-rank {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 400;
}

.queue-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.queue-copy strong {
  overflow-wrap: anywhere;
  line-height: 1.12;
}

.queue-copy span,
.empty-note {
  color: var(--soft);
  line-height: 1.25;
}

.host-shell {
  width: min(1420px, 100%);
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(300px, 0.36fr);
  gap: clamp(14px, 2vw, 28px);
  margin: 0 auto;
  padding: clamp(14px, 2vw, 28px);
}

.stage {
  min-height: calc(100svh - 56px);
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: 16px;
}

.player-frame {
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #12081a;
  box-shadow: 7px 7px 0 var(--ink);
}

#youtube-frame,
.empty-player {
  width: 100%;
  height: 100%;
  min-height: 52svh;
}

#youtube-frame {
  display: block;
  border: 0;
}

.empty-player {
  display: grid;
  place-items: center;
  padding: 30px;
  color: white;
  text-align: center;
}

.host-board {
  align-content: center;
  gap: 22px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(rgba(18, 8, 26, 0.74), rgba(18, 8, 26, 0.74)),
    radial-gradient(circle at 20% 20%, rgba(255, 93, 122, 0.8), transparent 26%),
    radial-gradient(circle at 82% 26%, rgba(123, 214, 182, 0.78), transparent 24%),
    radial-gradient(circle at 50% 82%, rgba(255, 216, 107, 0.72), transparent 28%),
    #12081a;
  box-shadow: 7px 7px 0 var(--ink);
}

.empty-player h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 400;
  line-height: 0.9;
}

.empty-player .external-player h1 {
  font-size: clamp(2rem, 4.8vw, 5rem);
  overflow-wrap: anywhere;
}

.host-now {
  display: grid;
  gap: 12px;
}

.host-now .now {
  margin-top: 0;
}

.side {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.qr-card {
  display: grid;
  gap: 10px;
  text-align: center;
}

.qr-card img {
  width: min(100%, 310px);
  justify-self: center;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--cream);
}

.qr-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3.4vw, 4rem);
  font-weight: 400;
  line-height: 0.92;
}

.guest-url {
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.2;
}

.compact-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  border: 2px solid rgba(44, 26, 58, 0.16);
  border-radius: 8px;
  background: #fffaf2;
  padding: 9px;
}

.compact-list strong {
  display: block;
  line-height: 1.12;
}

.host-actions,
.host-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.host-actions button:last-child,
.host-actions .alt-button {
  background: var(--grape);
}

.host-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
}

.host-tools button {
  min-height: 40px;
  background: var(--blue);
  color: var(--ink);
}

.now-card {
  width: min(760px, 100%);
  display: grid;
  gap: 10px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: white;
  box-shadow: 7px 7px 0 var(--ink);
  color: var(--ink);
  padding: clamp(18px, 4vw, 30px);
}

.now-card h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
}

.now-card p {
  margin: 0;
  color: var(--soft);
  font-weight: 900;
  line-height: 1.25;
}

.eyebrow {
  color: var(--peppermint) !important;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.row-actions button,
.row-actions .small-link {
  min-height: 38px;
  border-width: 2px;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.85rem;
  padding: 7px 8px;
}

.row-actions button:nth-of-type(2),
.row-actions button:nth-of-type(3),
.row-actions .small-link {
  background: var(--lemon);
  color: var(--ink);
}

.row-actions button:nth-last-child(1),
.row-actions button:nth-last-child(2) {
  background: var(--grape);
}

@media (max-width: 760px) {
  .search-form,
  .request-form,
  .song-row,
  .skip-box,
  .now {
    grid-template-columns: 1fr;
  }

  .song-row img,
  .now img {
    width: 100%;
  }

  .song-row button {
    width: 100%;
  }

  .section-head,
  .row-actions {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }
}

@media (max-width: 980px) {
  .host-shell {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: auto;
  }
}
