/* ============================================================
   STARDUST KARAOKE -- psychedelic edition
   Melty 60s poster art: cream paper, hot pink + teal + mustard,
   thick ink outlines, drippy sticker shapes, lava lamp energy.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Shrikhand&family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  --paper: #f3e8d2;
  --paper-2: #faf3e3;
  --pink: #e2578f;
  --pink-deep: #c93c74;
  --teal: #20705f;
  --teal-deep: #17493d;
  --gold: #d9a441;
  --ink: #31202c;
  --ink-soft: rgba(49, 32, 44, .55);
  --cream-text: #fdf6e5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 15px;
  min-height: 100%;
}

/* Joe's starfield photo -- the canvas adds a light twinkle on top */
body {
  background: #060309 url('/img/stars.jpg') center / cover fixed no-repeat;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 90px;
}

.wrap-wide { max-width: 1100px; }

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

.logo {
  text-align: center;
  margin: 18px 0 6px;
}

.logo-img {
  width: min(420px, 90%);
  height: auto;
  /* cream halo so the wordmark pops off the busy pattern */
  filter: drop-shadow(0 0 6px rgba(250, 243, 227, .95))
          drop-shadow(0 0 22px rgba(250, 243, 227, .8))
          drop-shadow(0 5px 0 rgba(49, 32, 44, .3));
}

/* text fallback if no logo image */
.logo h1 {
  font-family: 'Shrikhand', cursive;
  font-size: clamp(36px, 11vw, 60px);
  line-height: 1;
  margin: 0;
  color: var(--pink);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 3px 4px 0 var(--ink);
  transform: rotate(-2deg);
}

.logo .subtitle {
  font-family: 'Shrikhand', cursive;
  font-size: clamp(20px, 6vw, 30px);
  color: var(--gold);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 2px 3px 0 var(--ink);
  margin-top: 2px;
  transform: rotate(-2deg);
}

.logo .tagline {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--cream-text);
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px 1px 0 var(--ink), 1px 1px 0 var(--ink),
    2px 3px 0 var(--ink);
  margin-top: 10px;
}

/* image buttons + badge headers (Joe's sticker art) */
.img-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  display: block;
  margin: 0 auto;
  cursor: pointer;
}

.img-btn img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 5px 0 rgba(49, 32, 44, .3));
  transition: transform .12s;
}

.img-btn:hover { transform: none; box-shadow: none; }
.img-btn:hover img { transform: scale(1.04) rotate(-1deg); }
.img-btn:active { transform: none; box-shadow: none; }
.img-btn:active img { transform: scale(.96); }

.song-card .card-add {
  width: 96px;
  flex-shrink: 0;
}

.chip-row button img {
  height: 24px;
  width: auto;
  vertical-align: middle;
  margin-right: 6px;
}

.badge-h {
  display: block;
  width: min(230px, 64%);
  margin: 0 auto 14px;
  filter: drop-shadow(0 4px 0 rgba(49, 32, 44, .25));
}

/* ------------------------------------------------ ticker */

.ticker {
  background: var(--teal);
  border: 3px solid var(--ink);
  border-radius: 22px 30px 24px 32px / 30px 22px 32px 24px;
  box-shadow: 0 4px 0 rgba(49, 32, 44, .3);
  margin: 16px 0;
  padding: 0 18px;
  overflow: hidden;
}

.ticker marquee, .ticker .marquee-text {
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cream-text);
  padding: 9px 0;
  display: block;
  white-space: nowrap;
}

/* ------------------------------------------------ panels (sticker cards) */

/* panels are invisible -- content sits right on the pattern */
.panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 0;
  margin-bottom: 20px;
}

.panel h2 {
  font-family: 'Shrikhand', cursive;
  font-weight: 400;
  font-size: 19px;
  letter-spacing: .5px;
  color: var(--cream-text);
  text-shadow:
    -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink),
    -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink),
    3px 4px 0 var(--ink);
  margin: 0 0 14px;
  text-align: center;
}

.panel h2 .deco { color: var(--gold); }

/* ------------------------------------------------ buttons */

button, .btn {
  font-family: 'Shrikhand', cursive;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--cream-text);
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 20px 26px 22px 28px / 26px 20px 28px 22px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
  touch-action: manipulation;
  position: relative;
}

button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
button:active, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

button.blue {
  background: var(--teal);
}

button.purple {
  background: var(--gold);
  color: var(--ink);
}

button.gray {
  background: var(--paper);
  color: var(--ink-soft);
}

button.small { font-size: 11px; padding: 7px 11px; letter-spacing: .5px; box-shadow: 0 3px 0 var(--ink); }
button.big { font-size: 18px; padding: 14px 22px; width: 100%; letter-spacing: 2px; }
button:disabled { opacity: .45; cursor: default; }

/* melty drips under the big buttons */
button.big::before, button.big::after {
  content: '';
  position: absolute;
  top: 100%;
  margin-top: 3px;
  background: inherit;
  border: 3px solid var(--ink);
  border-top: none;
  z-index: 1;
}

button.big::before {
  left: 18%;
  width: 12px;
  height: 20px;
  border-radius: 0 0 12px 12px;
}

button.big::after {
  right: 24%;
  width: 9px;
  height: 12px;
  border-radius: 0 0 9px 9px;
}

/* ------------------------------------------------ inputs */

input[type="text"], input[type="search"], input[type="password"] {
  width: 100%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 16px;
  padding: 13px 20px;
  color: var(--ink);
  background: #fffcf2;
  border: 3px solid var(--ink);
  border-radius: 999px;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(49, 32, 44, .12);
}

input:focus { border-color: var(--pink-deep); }
input::placeholder { color: #b3a68f; }

/* ------------------------------------------------ tabs (sticker chips) */

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.tabs button {
  flex: 1 1 auto;
  font-size: 13px;
  padding: 9px 6px;
  background: var(--paper-2);
  color: var(--teal);
  box-shadow: 0 3px 0 var(--ink);
  border-radius: 18px 24px 20px 26px / 24px 18px 26px 20px;
}

.tabs button.active {
  background: var(--pink);
  color: var(--cream-text);
  transform: rotate(-1.5deg);
}

.tab-page { display: none; }
.tab-page.active { display: block; }

/* ------------------------------------------------ song result cards */

.song-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #fffcf2;
  border: 2.5px solid var(--ink);
  border-radius: 18px 22px 18px 24px / 22px 18px 24px 18px;
  box-shadow: 0 3px 0 rgba(49, 32, 44, .22);
  padding: 10px;
  margin-bottom: 10px;
}

.song-card img {
  width: 92px;
  height: 52px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 12px;
  flex-shrink: 0;
  display: block;
}

/* thumbnail doubles as a preview button */
.thumb-preview {
  position: relative;
  flex-shrink: 0;
  width: 92px;
  height: 52px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  border-radius: 12px;
  cursor: pointer;
}
.thumb-preview:hover, .thumb-preview:active { transform: none; box-shadow: none; }

.thumb-preview .play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  background: rgba(49, 32, 44, .72);
  border: 2px solid var(--cream-text);
  border-radius: 50%;
  color: var(--cream-text);
  font-size: 10px;
  pointer-events: none;
}

.song-card .preview {
  flex: 0 0 100%;
  width: 100%;
}
.song-card .preview iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  display: block;
}

.song-card .meta { flex: 1; min-width: 0; }

.song-card .title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.song-card .sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--teal);
  margin-top: 3px;
}

.song-card button { flex-shrink: 0; }

/* ADD TO QUEUE button: a rounded rectangle zoomed tight on the "ADD TO QUEUE"
   text (background crop, not the whole square sticker) */
.song-card .card-add {
  width: 96px;
  height: 58px;
  padding: 0;
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 16px 20px / 20px 16px 20px 16px;
  box-shadow: 0 3px 0 var(--ink);
  background: var(--teal) url('/img/btn-addqueue.png') no-repeat center 47% / 150%;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.song-card .card-add:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* ------------------------------------------------ now singing */

.now-singing {
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 30px 40px 32px 44px / 40px 30px 44px 32px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 20px 16px 24px;
  text-align: center;
  margin-bottom: 34px;
  position: relative;
}

/* drips off the now-singing card */
.now-singing::before, .now-singing::after {
  content: '';
  position: absolute;
  top: 100%;
  margin-top: 3px;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-top: none;
}

.now-singing::before {
  left: 14%;
  width: 14px;
  height: 24px;
  border-radius: 0 0 14px 14px;
}

.now-singing::after {
  right: 20%;
  width: 10px;
  height: 14px;
  border-radius: 0 0 10px 10px;
}

.now-singing .label {
  font-family: 'Shrikhand', cursive;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 1.5px 2px 0 var(--ink);
}

.now-singing .who {
  font-family: 'Shrikhand', cursive;
  font-size: 32px;
  color: var(--cream-text);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 2.5px 3.5px 0 var(--ink);
  margin: 8px 0 4px;
  line-height: 1.1;
}

.now-singing .what {
  font-weight: 600;
  font-size: 14px;
  color: var(--cream-text);
}

/* ------------------------------------------------ queue */

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

.queue-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffcf2;
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 16px 22px / 20px 16px 22px 16px;
  box-shadow: 0 3px 0 rgba(49, 32, 44, .22);
  padding: 10px 14px;
  margin-bottom: 9px;
}

.queue-list li.mine {
  background: #fdf0c8;
  border-color: var(--gold);
  box-shadow: 0 3px 0 var(--gold);
}

/* host-only: singers who tipped glow gold */
.queue-list li.tipper {
  background: #fdf0c8;
  border-color: var(--gold);
  box-shadow: 0 3px 0 var(--gold), 0 0 14px rgba(217, 164, 65, .5);
}

.queue-list .pos {
  font-family: 'Shrikhand', cursive;
  font-size: 17px;
  color: var(--pink-deep);
  min-width: 26px;
  text-align: center;
}

.queue-list .who { font-weight: 700; color: var(--ink); font-size: 14px; }
.queue-list .what { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-top: 1px; }

/* a singer's own queue row gets Change (✎) + Remove (✕) buttons */
.queue-list .q-info { flex: 1; min-width: 0; }
.queue-list .q-mine-btns { margin-left: auto; display: flex; gap: 5px; flex-shrink: 0; }
.queue-list .q-mine-btns button { padding: 7px 10px; font-size: 13px; }

/* "changing your song" banner above the search */
#edit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 16px 20px / 20px 16px 20px 16px;
  box-shadow: 0 3px 0 var(--ink);
  padding: 11px 14px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 13px;
}
#edit-banner #edit-banner-text { flex: 1; min-width: 0; }
#edit-banner button { flex-shrink: 0; }

.empty-note {
  text-align: center;
  color: var(--cream-text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px 1px 0 var(--ink), 1px 1px 0 var(--ink);
  padding: 14px 0;
}

/* ------------------------------------------------ popular / suggested */

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; justify-content: center; }

.chip-row button {
  font-size: 12px;
  background: var(--paper-2);
  color: var(--teal);
  padding: 7px 13px;
  box-shadow: 0 3px 0 var(--ink);
}

.chip-row button.active {
  background: var(--teal);
  color: var(--cream-text);
  transform: rotate(-1.5deg);
}

.pick-list { list-style: none; margin: 0; padding: 0; }

.pick-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fffcf2;
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 16px 22px / 20px 16px 22px 16px;
  box-shadow: 0 3px 0 rgba(49, 32, 44, .35);
  padding: 10px 14px;
  margin-bottom: 9px;
  font-size: 14px;
}
.pick-list li .song-name { color: var(--ink); font-weight: 600; }
.pick-list li .song-name .artist { color: var(--ink-soft); font-weight: 400; font-size: 12px; }

/* ------------------------------------------------ history */

.history-list { list-style: none; padding: 0; margin: 0; }

.history-list li {
  font-size: 13px;
  font-weight: 500;
  color: #4a3542;
  background: rgba(255, 252, 242, .93);
  border: 2px solid var(--ink);
  border-radius: 14px 18px 14px 20px / 18px 14px 20px 14px;
  box-shadow: 0 2px 0 rgba(49, 32, 44, .3);
  padding: 8px 14px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-list li button { flex-shrink: 0; }
.history-list .who { color: var(--teal); font-weight: 700; }
.history-list .skipped { text-decoration: line-through; opacity: .6; }

/* ------------------------------------------------ toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--teal);
  border: 3px solid var(--ink);
  color: var(--cream-text);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 22px 28px 24px 30px / 28px 22px 30px 24px;
  box-shadow: 0 4px 0 var(--ink);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  max-width: 90vw;
  text-align: center;
}

#toast.show { opacity: 1; }

/* ------------------------------------------------ pinned action bar */

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 3, 9, .82);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  border-top: 2.5px solid var(--ink);
}

.action-bar .ab-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  text-decoration: none;
  line-height: 1.1;
  font-family: 'Shrikhand', cursive;
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: .3px;
  padding: 8px 6px;
  color: var(--cream-text);
  background: var(--pink);
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 18px 22px / 20px 16px 22px 18px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}

.action-bar .ab-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.action-bar .ab-tip { background: var(--gold); color: var(--ink); }
.action-bar .ab-skip { background: var(--teal); }

/* ------------------------------------------------ confirmation modal */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 3, 9, .72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.confirm-card {
  width: min(360px, 100%);
  text-align: center;
  background: var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: 26px 32px 26px 34px / 32px 26px 34px 26px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 26px 22px 24px;
  animation: pop-in .22s cubic-bezier(.2, 1.3, .5, 1);
}

@keyframes pop-in {
  from { transform: scale(.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-title {
  font-family: 'Shrikhand', cursive;
  font-size: 26px;
  color: var(--pink-deep);
  line-height: 1.1;
}

.confirm-song {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin: 12px 0 6px;
}

.confirm-place {
  font-family: 'Shrikhand', cursive;
  font-size: 22px;
  color: var(--teal);
  margin-bottom: 20px;
}

.confirm-card .big { width: 100%; }

/* ------------------------------------------------ footer */

.footer {
  text-align: center;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cream-text);
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px 1px 0 var(--ink), 1px 1px 0 var(--ink);
  margin-top: 34px;
  line-height: 2.2;
}

/* ------------------------------------------------ host dashboard */

.host-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 900px) {
  .host-grid { grid-template-columns: 1.4fr 1fr; }
}

.host-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.queue-list li.draggable { cursor: grab; }
.queue-list li.dragging { opacity: .4; border-style: dashed; }

.queue-list .row-btns {
  margin-left: auto;
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.drag-handle {
  color: rgba(49, 32, 44, .4);
  font-size: 15px;
  cursor: grab;
  user-select: none;
  padding: 0 2px;
}

.qr-box { text-align: center; padding: 8px; }

/* QR code sits inside the psychedelic frame art */
.qr-frame {
  position: relative;
  width: min(360px, 100%);
  margin: 0 auto;
}

.qr-frame .frame {
  width: 100%;
  display: block;
  filter: drop-shadow(0 0 8px rgba(250, 243, 227, .9))
          drop-shadow(0 0 20px rgba(250, 243, 227, .6));
}

.qr-frame #qr-img {
  position: absolute;
  left: 28.6%;
  top: 26.7%;
  width: 43.7%;
  height: 44.5%;
  background: #fff;
}

.qr-box .url {
  font-family: 'Shrikhand', cursive;
  font-size: 14px;
  letter-spacing: .5px;
  color: var(--cream-text);
  text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink);
  margin-top: 12px;
  word-break: break-all;
}

.stat-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-top: 14px;
}

.stat-row .num {
  font-family: 'Shrikhand', cursive;
  font-size: 26px;
  color: var(--pink-deep);
}

.stat-row .num { text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink); }

.stat-row .lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cream-text);
  text-shadow: -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink);
  margin-top: 2px;
}

/* ------------------------------------------------ name gate */

#name-gate { text-align: center; padding-top: 2vh; }

/* gate elements sit right on the pattern, like the mockup */
#name-gate .panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 14px 6px;
  margin-bottom: 0;
}

#name-gate .mic { font-size: 46px; }

#name-gate p {
  color: var(--cream-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px 1px 0 var(--ink), 1px 1px 0 var(--ink);
  line-height: 1.7;
}

.cosmic-headline {
  font-family: 'Shrikhand', cursive;
  font-size: clamp(20px, 6vw, 28px);
  color: var(--teal);
  text-shadow: 2px 2.5px 0 rgba(49, 32, 44, .25);
  margin: 6px 0 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
