/* Public wheel page. Desktop/projector layout fits on one screen with no scrolling. */
:root { --wheel: min(calc(100vh - 200px), 44vw); } /* wheel.js shrinks this to fit */
body.no-footer { --wheel: min(calc(100vh - 160px), 44vw); }

.stage { min-height: 100vh; display: flex; flex-direction: column; }

.wheel-header { text-align: center; padding: 14px 16px 4px; }
.wheel-header h1 { font-size: clamp(1.6rem, 4.2vh, 3rem); line-height: 1.1; }
.wheel-header p { color: var(--muted); font-size: clamp(0.95rem, 2.2vh, 1.4rem); font-weight: 500; }

.wheel-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(12px, 2vw, 36px);
  align-items: start;
  padding: 10px clamp(12px, 2vw, 32px);
  max-width: 1900px; width: 100%; margin: 0 auto;
}

/* ----- wheel ----- */
.wheel-section { display: flex; flex-direction: column; align-items: center; }
.wheel-wrap { position: relative; width: var(--wheel); height: var(--wheel); margin-top: 14px; }
#wheel { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 50px rgba(131, 56, 236, 0.45), 0 0 100px rgba(255, 0, 110, 0.2); }
.hub {
  position: absolute; left: 50%; top: 50%; width: 15%; height: 15%; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a2a4a, #0a0a1a 70%);
  border: 4px solid var(--yellow);
  box-shadow: 0 0 18px rgba(255, 190, 11, 0.55);
}
.pointer {
  position: absolute; top: -16px; left: 50%; z-index: 5;
  width: 0; height: 0;
  border-left: clamp(14px, 1.9vh, 22px) solid transparent;
  border-right: clamp(14px, 1.9vh, 22px) solid transparent;
  border-top: clamp(28px, 3.8vh, 44px) solid var(--yellow);
  transform: translateX(-50%);
  transform-origin: 50% 0;
  filter: drop-shadow(0 0 8px rgba(255, 190, 11, 0.8));
}
.pointer.tick { animation: tick 0.12s ease-out; }
@keyframes tick { 50% { transform: translateX(-50%) rotate(-14deg); } }

.controls { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spin-btn {
  margin-top: clamp(8px, 1.6vh, 18px);
  padding: 0.4em 2.2em;
  font-family: var(--display); font-size: clamp(1.3rem, 3vh, 1.9rem); letter-spacing: 0.08em; text-transform: uppercase;
  border: 0; border-radius: 999px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 6px 26px rgba(131, 56, 236, 0.55);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.spin-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 8px 34px rgba(131, 56, 236, 0.75); }
.spin-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.status { margin-top: 10px; color: var(--muted); font-size: clamp(0.85rem, 1.8vh, 1.1rem); text-align: center; min-height: 1.5em; }
.status strong { color: var(--yellow); }

/* ----- song lists ----- */
.song-col {
  height: calc(var(--wheel) + 90px);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  overflow: hidden;
  font-size: 16px; /* adjusted by fitLists() */
}
.song-item {
  display: flex; align-items: center; gap: 0.6em;
  padding: 0 0.6em;
  border-radius: 0.5em;
  min-height: 0;
  transition: opacity 0.4s, background 0.4s;
}
.song-item .dot { width: 0.7em; height: 0.7em; border-radius: 50%; flex-shrink: 0; }
.song-item .txt { min-width: 0; line-height: 1.2; overflow: hidden; } /* fitLists() sizes text to fit */
.song-item .t { font-weight: 600; font-size: 1em; }
.song-item .a { color: var(--muted); font-size: 0.78em; display: block; }
.song-item .t { display: block; }
.song-item.sung { opacity: 0.3; }
.song-item.sung .t { text-decoration: line-through; }
.song-item.sung .dot { background: #555 !important; }
.song-item.winner { background: rgba(255, 190, 11, 0.22); opacity: 1; animation: pulse 1s ease 4; }
@keyframes pulse { 50% { background: rgba(255, 190, 11, 0.45); } }

/* ----- footer: QR + queue ----- */
.wheel-footer {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 30px);
  padding: 10px clamp(12px, 2vw, 32px) 14px;
  max-width: 1900px; width: 100%; margin: 0 auto;
  min-height: 0;
}
.signup-qr { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px 10px 10px; flex-shrink: 0; }
.signup-qr img { width: clamp(64px, 10vh, 120px); height: clamp(64px, 10vh, 120px); border-radius: 8px; background: #fff; }
.signup-qr strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--yellow); letter-spacing: 0.03em; }
.signup-qr span { font-size: 0.85rem; color: var(--muted); word-break: break-all; }

.queue { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.now { font-size: clamp(1rem, 2.2vh, 1.35rem); font-weight: 600; }
.now .label, .next .label { font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-right: 0.6em; font-weight: 700; }
.next .label { font-size: 0.8rem; flex-shrink: 0; }
.now .song { color: var(--yellow); }
.next { display: flex; align-items: center; gap: 4px; min-width: 0; }
.next ol { list-style: none; display: flex; gap: 8px; overflow: hidden; flex-wrap: nowrap; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.next li { flex-shrink: 0; background: rgba(255, 255, 255, 0.08); border-radius: 999px; padding: 0.3em 0.9em; font-size: clamp(0.85rem, 1.8vh, 1.05rem); font-weight: 500; }
.next li:first-child { background: rgba(255, 190, 11, 0.18); color: var(--yellow); }
.next .empty-q { color: var(--muted); background: none; padding-left: 0; }

/* ----- host tools ----- */
.host-tools { position: fixed; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0.35; transition: opacity 0.2s; z-index: 30; }
.host-tools:hover, .host-tools:focus-within { opacity: 1; }

/* ----- modal ----- */
.modal-overlay { position: fixed; inset: 0; background: rgba(5, 5, 15, 0.78); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid var(--yellow); border-radius: 28px;
  padding: clamp(28px, 5vh, 56px) clamp(28px, 5vw, 72px);
  text-align: center; max-width: min(92vw, 900px);
  box-shadow: 0 0 80px rgba(255, 190, 11, 0.35);
  animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalPop { from { transform: scale(0.3); opacity: 0; } }
.modal h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1rem, 2.6vh, 1.6rem); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.modal-song { font-family: var(--display); font-size: clamp(1.6rem, min(7vh, 8.5vw), 4.6rem); line-height: 1.08; color: var(--yellow); margin: 0.25em 0 0.15em; overflow-wrap: break-word; hyphens: auto; }
.modal-artist { font-size: clamp(1.1rem, 3vh, 1.9rem); color: #d8d6f0; margin-bottom: 1.2em; }
.btn-letsgo { font-size: clamp(1rem, 2.4vh, 1.3rem); padding: 0.7em 2.2em; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; }

/* ----- smaller screens: phones and tablets scroll normally ----- */
@media (max-width: 1000px), (max-height: 560px) {
  :root, body.no-footer { --wheel: min(92vw, 68vh, 640px); }
  .wheel-layout { grid-template-columns: 1fr; padding-bottom: 20px; }
  .wheel-section { order: -1; }
  .song-col { height: auto; display: block; font-size: 15px !important; padding: 8px; }
  .song-col .song-item { padding: 0.45em 0.6em; }
  #colRight { margin-top: -14px; border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
  #colLeft { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
  .controls { min-height: 0; }
  .wheel-footer { flex-direction: column; align-items: stretch; order: -1; min-height: 0; }
  .wheel-header { order: -2; }
  .signup-qr { display: none !important; }
  .next { flex-direction: column; align-items: flex-start; gap: 6px; }
  .next ol { flex-wrap: wrap; mask-image: none; }
  .host-tools { position: static; justify-content: center; opacity: 1; padding-bottom: 16px; }
}
