/* Banger Board — loud on purpose. */

:root {
  --ink: #17102e;
  --ink-2: #261b4f;
  --cream: #fff6e6;
  --pink: #ff3d8b;
  --yellow: #ffe14d;
  --mint: #3df5c0;
  --violet: #9a86ff;
  --muted: #bdb3e6;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--round);
  font-weight: 600;
  line-height: 1.35;
  background-color: var(--ink);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 61, 139, .22), transparent 38%),
    radial-gradient(circle at 92% 30%, rgba(61, 245, 192, .14), transparent 36%),
    radial-gradient(rgba(255, 255, 255, .07) 1.5px, transparent 1.6px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------- logo ---------- */

.top { text-align: center; padding: 10px 0 22px; }

.logo {
  --disc: clamp(96px, 29vw, 128px);
  display: inline-flex;
  align-items: center;
  transform: rotate(-2.5deg);
}

/* The title sits in front of the record and overlaps its right half. */
.logo h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(34px, 10.5vw, 50px);
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: .95;
  text-transform: uppercase;
  text-align: left;
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
}
.logo h1 span { display: block; }
.logo h1 span:first-child { color: var(--yellow); text-shadow: 4px 4px 0 var(--pink); }
.logo h1 span:last-child { color: var(--cream); text-shadow: 4px 4px 0 var(--violet); }

.record {
  flex: none;
  width: var(--disc);
  height: var(--disc);
  margin-right: calc(var(--disc) * -.46);
  animation: spin 2.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .01em;
}
.tag b { color: var(--mint); font-weight: 900; }

/* ---------- sticker cards ---------- */

.card {
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--pink);
  padding: 18px;
}

.request { background: var(--yellow); box-shadow: 6px 6px 0 var(--pink); }
.request h2 { font-size: 24px; font-weight: 900; letter-spacing: -.01em; margin-bottom: 12px; }

.field { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.field em { font-style: normal; font-weight: 700; opacity: .6; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.field input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 12px 14px;
  font-size: 17px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  outline: none;
  transition: box-shadow .12s, transform .12s;
}
.field input::placeholder { color: #a79fc0; font-weight: 600; }
.field input:focus { box-shadow: 4px 4px 0 var(--pink); transform: translate(-1px, -1px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 900;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
  user-select: none;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible, .hype:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: default; }

.btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 15px 18px;
  font-size: 20px;
  letter-spacing: .01em;
  background: var(--pink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- the board ---------- */

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 2px 4px;
}
.section-head h2 { font-size: 28px; font-weight: 900; letter-spacing: -.01em; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  background: var(--mint);
  border-radius: 99px;
}

.hint { margin: 0 2px 16px; color: var(--muted); font-size: 15px; font-weight: 700; }
.hint svg { width: 13px; height: 13px; vertical-align: -1px; fill: var(--yellow); }

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

.song {
  --accent: var(--violet);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 5px 5px 0 var(--accent);
}
.song[data-rank="1"] { --accent: var(--yellow); }
.song[data-rank="2"] { --accent: var(--mint); }
.song[data-rank="3"] { --accent: var(--pink); }

.song.flash { animation: flash 1.1s ease-out 1; }
@keyframes flash {
  0%, 60% { background: var(--mint); }
  100% { background: var(--cream); }
}

.rank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 17px;
  font-weight: 900;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}
.song[data-rank="1"] .rank { background: var(--yellow); transform: rotate(-8deg) scale(1.1); }
.song[data-rank="2"] .rank { background: var(--mint); }
.song[data-rank="3"] .rank { background: var(--pink); }

.song-title { font-size: 18px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.song-artist { margin-top: 2px; font-size: 15px; font-weight: 700; color: #5a4f80; overflow-wrap: anywhere; }
.song-by { margin-top: 4px; font-size: 12.5px; font-weight: 800; color: #5a4f80; }
.song-by b { color: var(--ink); font-weight: 900; }
.badge {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 99px;
  transform: rotate(-2deg);
}

.hype {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 66px;
  padding: 8px 8px 7px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, background .15s;
  user-select: none;
}
.hype svg { width: 22px; height: 22px; fill: currentColor; }
.hype-count { font-size: 20px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.hype-label { font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.hype:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.hype[aria-pressed="true"] {
  background: var(--pink);
  box-shadow: none;
  transform: translate(3px, 3px);
  cursor: default;
}
.hype.pop svg { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-9px) scale(1.35); }
  100% { transform: translateY(0) scale(1); }
}

.empty {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
  border: 3px dashed rgba(189, 179, 230, .45);
  border-radius: 22px;
}
.empty strong { display: block; margin-bottom: 4px; font-size: 22px; font-weight: 900; color: var(--cream); }
.empty .tumble { display: block; font-size: 40px; margin-bottom: 6px; animation: tumble 3s ease-in-out infinite; }
@keyframes tumble { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }

.played { margin-top: 30px; color: var(--muted); }
.played summary { font-size: 15px; font-weight: 900; cursor: pointer; padding: 6px 2px; }
.played ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.played li { padding: 9px 12px; font-size: 14.5px; font-weight: 700; background: rgba(255, 255, 255, .06); border-radius: 12px; overflow-wrap: anywhere; }
.played li b { color: var(--cream); font-weight: 900; }

.foot { margin-top: 36px; text-align: center; color: rgba(189, 179, 230, .6); font-size: 12.5px; font-weight: 700; }

/* ---------- toasts, confetti, status ---------- */

#toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 14px;
  pointer-events: none;
}
.toast {
  max-width: 460px;
  padding: 12px 18px;
  font-size: 15.5px;
  font-weight: 900;
  text-align: center;
  color: var(--ink);
  background: var(--mint);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .45);
  animation: toast-in .3s cubic-bezier(.2, 1.5, .4, 1);
}
.toast.oops { background: var(--pink); }
.toast.bye { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.92); } }

.bit {
  position: fixed;
  z-index: 30;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  pointer-events: none;
}

.offline {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 25;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 99px;
}

/* ---------- host screen ---------- */

.host-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 28px 60px;
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.scan { position: sticky; top: 26px; text-align: center; }
.scan .logo { margin: 4px 0 26px; }
.scan .logo { --disc: 120px; }
.scan .logo h1 { font-size: 44px; }

.qr-card { padding: 18px 18px 16px; background: var(--yellow); transform: rotate(1.5deg); }
.qr-card h2 { font-size: 30px; font-weight: 900; letter-spacing: -.01em; line-height: 1.05; }
.qr-card p { margin-top: 2px; font-size: 16px; font-weight: 800; }
.qr {
  aspect-ratio: 1;
  overflow: hidden;
  margin: 12px 0 10px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
}
.qr svg { display: block; width: 100%; height: 100%; }
.qr-url {
  display: inline-block;
  max-width: 100%;
  padding: 5px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
  background: var(--ink);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.scan-note { margin-top: 22px; color: var(--muted); font-size: 13.5px; font-weight: 700; }

.board-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.board-head h2 { font-size: 40px; font-weight: 900; letter-spacing: -.02em; margin-right: auto; }
.stats { color: var(--muted); font-size: 16px; font-weight: 800; }
.stats b { color: var(--yellow); font-weight: 900; }
.btn-small { padding: 7px 12px; font-size: 14px; border-radius: 12px; }
.btn-danger { background: var(--pink); }

.host .song { grid-template-columns: 48px minmax(0, 1fr) auto auto; padding: 14px 16px; }
.host .rank { width: 48px; height: 48px; font-size: 21px; }
.host .song-title { font-size: 23px; }
.host .song-artist { font-size: 17px; }
.host .song-by { font-size: 14px; }

.votes {
  display: grid;
  justify-items: center;
  min-width: 70px;
  padding: 6px 10px;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 16px;
}
.votes b { font-size: 26px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.votes span { font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.votes.bump { animation: bump .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { 40% { transform: scale(1.22) rotate(-4deg); } }

.controls { display: grid; gap: 6px; }
.controls .btn { white-space: nowrap; }
.btn-played { background: var(--mint); }

.host .played li { display: flex; align-items: center; gap: 12px; }
.host .played li span { flex: 1; min-width: 0; }
.link {
  padding: 2px 4px;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--mint);
  background: none;
  border: 0;
  text-decoration: underline;
}

.keybox { margin-bottom: 16px; padding: 14px; background: var(--ink-2); border-radius: 16px; }
.keybox p { margin-bottom: 10px; color: var(--muted); font-size: 14.5px; font-weight: 700; }
.keybox p b { color: var(--cream); font-weight: 900; }
.keyrow { display: flex; gap: 8px; align-items: center; }
.keybox input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 16px; font-weight: 700; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.notice { margin-bottom: 16px; padding: 10px 14px; color: var(--muted); font-size: 14.5px; font-weight: 700; background: var(--ink-2); border-radius: 14px; }

/* Party screen: what you put on the projector. Controls step aside. */
.party .controls, .party .played, .party .host-only, .party .keybox { display: none; }
.party .host .song, body.party .song { grid-template-columns: 48px minmax(0, 1fr) auto; }
body.party .song-title { font-size: 27px; }
.party-exit { display: none; }
.party .party-exit { display: inline-flex; opacity: .5; }

@media (max-width: 860px) {
  .host-wrap { grid-template-columns: 1fr; gap: 30px; padding: 20px 16px 50px; }
  .scan { position: static; max-width: 380px; margin: 0 auto; }
  .board-head h2 { font-size: 30px; }
  .host .song { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .host .rank { width: 40px; height: 40px; font-size: 17px; }
  .host .song-title { font-size: 19px; }
  .controls { grid-column: 1 / -1; grid-auto-flow: column; justify-content: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
