/* JukeVote — shared styles */
:root {
  --bg:        #0d0a1a;
  --bg-2:      #141029;
  --surface:   #1c1740;
  --surface-2: #261d52;
  --line:      #322a5e;
  --text:      #f1edff;
  --muted:     #9a92c4;
  --accent:    #ff2d95;
  --accent-2:  #8b5cf6;
  --good:      #36d399;
  --warn:      #fbbf24;
  --radius:    14px;
  --shadow:    0 18px 50px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(1100px 600px at 80% -10%, #2a1a4e 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #3a1140 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }

.brand {
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- layout ------------------------------------------------------------ */
.wrap     { max-width: 1180px; margin: 0 auto; padding: 24px; }
.narrow   { max-width: 440px; margin: 0 auto; padding: 48px 24px; }
.topbar   {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
}
.topbar .brand { font-size: 2.6rem; }
.row      { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread   { justify-content: space-between; }
.muted    { color: var(--muted); }
.center   { text-align: center; }

/* ---- cards ------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.05rem; margin-bottom: 14px; }
.card + .card { margin-top: 18px; }

/* ---- forms / buttons --------------------------------------------------- */
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=search] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 0.95rem;
}
input:focus { outline: 2px solid var(--accent-2); border-color: transparent; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:hover  { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
}
.btn-ghost  { background: transparent; }
.btn-block  { width: 100%; }
.btn-sm     { padding: 7px 12px; font-size: 0.85rem; }

.notice {
  border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; margin: 12px 0;
}
.notice-error { background: rgba(255, 45, 110, 0.14); color: #ff9bbb;
                border: 1px solid rgba(255, 45, 110, 0.3); }
.notice-ok    { background: rgba(54, 211, 153, 0.12); color: var(--good);
                border: 1px solid rgba(54, 211, 153, 0.3); }
.notice-warn  { background: rgba(251, 191, 36, 0.12); color: var(--warn);
                border: 1px solid rgba(251, 191, 36, 0.3); }
.hidden { display: none !important; }

/* ---- pills / badges ---------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 9px; border-radius: 999px;
}
.pill-next { background: var(--accent); color: #fff; }
.pill-cool { background: var(--surface-2); color: var(--muted); }
.pill-live { background: var(--good); color: #04231a; }

/* ---- landing ----------------------------------------------------------- */
.hero { text-align: center; padding: 70px 24px 30px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.hero p  { color: var(--muted); font-size: 1.15rem; max-width: 620px;
           margin: 16px auto 28px; }
.features { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.feature .ico { font-size: 1.8rem; }
.feature h3 { margin: 8px 0 4px; font-size: 1.05rem; }
.feature p  { color: var(--muted); font-size: 0.92rem; }

/* ---- host dashboard ---------------------------------------------------- */
.dash { display: grid; grid-template-columns: 1fr 360px; gap: 18px; }
.player-wrap { position: relative; aspect-ratio: 16 / 9; background: #000;
               border-radius: var(--radius); overflow: hidden;
               border: 1px solid var(--line); }
.player-wrap iframe, .player-wrap #player { width: 100%; height: 100%; border: 0; }
.player-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(13, 10, 26, 0.92); text-align: center; padding: 20px;
}
.qr-overlay {
  position: absolute; right: 14px; bottom: 14px;
  background: #fff; padding: 10px; border-radius: 10px; text-align: center;
}
.qr-overlay .code { color: #111; font-weight: 800; font-size: 0.8rem;
                    margin-top: 4px; letter-spacing: 0.1em; }

/* vote board */
.board { display: flex; flex-direction: column; gap: 8px; max-height: 420px;
         overflow-y: auto; }
.song {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
}
.song.is-now  { border-color: var(--good); }
.song.is-next { border-color: var(--accent); }
.song.is-cool { opacity: 0.55; }
.song .thumb { width: 64px; height: 40px; border-radius: 6px; object-fit: cover;
               flex: none; background: var(--surface-2); }
.song .meta  { flex: 1; min-width: 0; }
.song .title { font-weight: 700; font-size: 0.9rem;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .sub   { color: var(--muted); font-size: 0.78rem;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.votes {
  flex: none; min-width: 44px; text-align: center;
  font-weight: 900; font-size: 1.25rem;
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* drag-and-drop reordering (host board, draft/ended only) */
.song.is-draggable  { cursor: grab; }
.song.is-dragging   { opacity: 0.35; }
.song.drag-over     { border-color: var(--accent-2);
                      background: var(--surface); }
.drag-handle {
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: -3px;
  padding: 0 6px 0 2px;
  cursor: grab;
  user-select: none;
}

/* QR / side panel */
.qr-box { background: #fff; padding: 16px; border-radius: var(--radius);
          text-align: center; }
.qr-box canvas, .qr-box img { display: block; margin: 0 auto; }
.qr-box .code { color: #111; font-weight: 900; font-size: 1.3rem;
                letter-spacing: 0.18em; margin-top: 8px; }
.qr-box .hint { color: #555; font-size: 0.8rem; }

.search-results { display: flex; flex-direction: column; gap: 6px;
                  max-height: 260px; overflow-y: auto; margin-top: 10px; }

/* ---- guest page -------------------------------------------------------- */
.guest-now {
  display: flex; gap: 16px; align-items: flex-start;
}
.guest-now .art { width: 120px; height: 120px; border-radius: 10px;
                  object-fit: cover; flex: none; background: var(--surface-2); }
.lyrics {
  white-space: pre-wrap; font-size: 0.9rem; color: var(--muted);
  max-height: 260px; overflow-y: auto; margin-top: 10px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.vote-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--bg-2);
  color: var(--muted); font-size: 1.1rem; cursor: pointer;
}
.vote-btn.on { background: linear-gradient(110deg, var(--accent), var(--accent-2));
               border-color: transparent; color: #fff; }
.vote-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 880px) {
  .dash      { grid-template-columns: 1fr; }
  .features  { grid-template-columns: 1fr; }
}

/* ---- print: only the QR card -------------------------------------------*/
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0; margin: 0 auto; padding: 40px;
                background: #fff; color: #111; }
  .no-print { display: none !important; }
}
