/* Partyline - retro game show design system (placeholder codename).
   Hand-built: no frameworks. Palette: deep stage teal, warm burgundy,
   marquee gold, cream. */

:root {
  --stage: #0f2e2b;
  --stage-deep: #0a211f;
  --felt: #123b37;
  --burgundy: #7c1f2e;
  --burgundy-dark: #5e1521;
  --gold: #f2b632;
  --gold-soft: #ffd97a;
  --cream: #fdf6e3;
  --ink: #1c1611;
  --bulb-on: #ffd97a;
  --bulb-off: rgba(255, 217, 122, 0.18);
  --font-display: 'Alfa Slab One', 'Georgia', serif;
  --font-body: 'Public Sans', 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 10%, rgba(242, 182, 50, 0.07), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(124, 31, 46, 0.25), transparent 50%),
    var(--stage-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Halftone curtain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(253, 246, 227, 0.05) 1px, transparent 1.6px);
  background-size: 22px 22px;
}

.wrap { width: 100%; max-width: 900px; padding: 2rem 1.25rem 4rem; }

/* Marquee sign */
.marquee {
  position: relative;
  border: 3px solid var(--gold);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--burgundy) 0%, var(--burgundy-dark) 100%);
  padding: 2.2rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  margin: 2rem 0 2.5rem;
}

.marquee h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: 0.04em;
  color: var(--gold-soft);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 0 26px rgba(242, 182, 50, 0.35);
}
.tagline {
  margin-top: 0.6rem;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.85;
}

/* Starburst badge */
.starburst {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  padding: 0.55rem 1.1rem;
  clip-path: polygon(50% 0%, 61% 12%, 75% 6%, 81% 20%, 96% 21%, 94% 36%, 100% 50%, 94% 64%, 96% 79%, 81% 80%, 75% 94%, 61% 88%, 50% 100%, 39% 88%, 25% 94%, 19% 80%, 4% 79%, 6% 64%, 0% 50%, 6% 36%, 4% 21%, 19% 20%, 25% 6%, 39% 12%);
  transform: rotate(-6deg);
}

/* Panels & cards */
.panel {
  background: var(--felt);
  border: 1px solid rgba(242, 182, 50, 0.35);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.panel + .panel { margin-top: 1.25rem; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2rem;
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 5px 0 #b98217, 0 10px 22px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  text-decoration: none;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b98217; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.secondary {
  background: transparent;
  color: var(--cream);
  border: 2px solid rgba(253, 246, 227, 0.5);
  box-shadow: none;
}
.btn.big { font-size: 1.35rem; padding: 1.1rem 2.6rem; width: 100%; }
.btn.choice {
  width: 100%;
  background: var(--cream);
  box-shadow: 0 5px 0 #c9bfa5, 0 10px 22px rgba(0,0,0,0.4);
  font-size: 1.2rem;
  margin-top: 0.75rem;
  border-radius: 16px;
  padding: 1.2rem;
}
.btn.choice.picked { background: var(--gold-soft); }

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  font: inherit;
  font-size: 1.15rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 2px solid rgba(242, 182, 50, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  outline: none;
}
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 182, 50, 0.2); }
input.code {
  font-family: var(--font-display);
  font-size: 2.2rem;
  text-align: center;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  padding-left: 1.6rem;
}
label { display: block; margin: 1rem 0 0.4rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; color: var(--gold-soft); }

/* Big room code display */
.room-code {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 14vw, 7rem);
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  text-align: center;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 0 40px rgba(242, 182, 50, 0.4);
}

/* Player chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 1.2rem 0; }
.chip {
  background: var(--cream);
  color: var(--ink);
  font-weight: 800;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  box-shadow: 0 3px 0 #c9bfa5;
}
.chip.off { opacity: 0.4; }

/* Score rows */
.score-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 1.15rem;
}
.score-row:nth-child(odd) { background: rgba(253, 246, 227, 0.06); }
.score-row .pts { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--gold-soft); }

/* Center helpers */
.center { text-align: center; }
.mt { margin-top: 1.25rem; }
.mt-lg { margin-top: 2rem; }
.muted { opacity: 0.75; }
.error-box { background: rgba(124, 31, 46, 0.5); border: 1px solid var(--burgundy); border-radius: 10px; padding: 0.8rem 1rem; margin-top: 1rem; }

/* Admin table */
table.admin { width: 100%; border-collapse: collapse; margin-top: 1rem; }
table.admin th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-soft); padding: 0.5rem; border-bottom: 1px solid rgba(242,182,50,0.3); }
table.admin td { padding: 0.55rem 0.5rem; border-bottom: 1px solid rgba(253,246,227,0.08); vertical-align: middle; }
table.admin input[type="text"] { font-size: 1rem; padding: 0.45rem 0.7rem; }
.row-actions button { margin-right: 0.4rem; }
.btn.small { font-size: 0.85rem; padding: 0.4rem 0.9rem; box-shadow: 0 3px 0 #b98217; }
.btn.small.secondary { box-shadow: none; }

.nav-pills { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.nav-pills .pill { border: 2px solid rgba(253,246,227,0.3); border-radius: 999px; padding: 0.4rem 1.1rem; cursor: pointer; background: transparent; color: var(--cream); font-weight: 700; }
.nav-pills .pill.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }

footer { margin-top: 3rem; text-align: center; font-size: 0.85rem; opacity: 0.6; }

/* ===== Partyline design language v2: motion + atmosphere ===== */

/* Real chase lights: two bulb layers alternating like a theater marquee */
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 26px;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--bulb-on) 3px, transparent 4.5px);
  background-size: 60px 30px;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 14px;
  animation: chase-a 1.1s steps(1) infinite;
}
.marquee::after {
  background-position: 30px 0;
  animation-name: chase-b;
}
@keyframes chase-a { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0.12; } }
@keyframes chase-b { 0%, 49.9% { opacity: 0.12; } 50%, 100% { opacity: 1; } }
.marquee h1 { animation: title-glow 3.2s ease-in-out infinite; }
@keyframes title-glow {
  0%, 100% { text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 22px rgba(242,182,50,.3); }
  50% { text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 44px rgba(255,217,122,.6); }
}

/* Velvet curtains framing the stage on wide screens */
@media (min-width: 1100px) {
  body::after {
    content: '';
    position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background:
      repeating-linear-gradient(90deg,
        #5e1521 0 26px, #7c1f2e 26px 52px, #481018 52px 78px);
    -webkit-mask: linear-gradient(90deg, #000 0 120px, transparent 150px calc(100% - 150px), #000 calc(100% - 120px));
    mask: linear-gradient(90deg, #000 0 120px, transparent 150px calc(100% - 150px), #000 calc(100% - 120px));
    opacity: .8;
  }
}

/* Spotlights sweeping behind the marquee */
.spotlights { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.spotlights i {
  position: absolute; top: -12%; width: 220px; height: 130%;
  background: linear-gradient(180deg, rgba(255,217,122,.14), transparent 70%);
  transform-origin: top center;
  filter: blur(6px);
}
.spotlights i:nth-child(1) { left: 12%; animation: sweep-l 9s ease-in-out infinite alternate; }
.spotlights i:nth-child(2) { right: 12%; animation: sweep-r 11s ease-in-out infinite alternate; }
@keyframes sweep-l { from { transform: rotate(-16deg); } to { transform: rotate(10deg); } }
@keyframes sweep-r { from { transform: rotate(16deg); } to { transform: rotate(-10deg); } }

/* Screen transitions: every phase change rises in */
#screen > * { animation: screen-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* Player chips pop when they land */
.chip { animation: chip-pop .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.chip:nth-child(2) { animation-delay: .05s; } .chip:nth-child(3) { animation-delay: .1s; }
.chip:nth-child(4) { animation-delay: .15s; } .chip:nth-child(5) { animation-delay: .2s; }
.chip:nth-child(6) { animation-delay: .25s; } .chip:nth-child(7) { animation-delay: .3s; }
.chip:nth-child(8) { animation-delay: .35s; }
@keyframes chip-pop { from { transform: scale(0) rotate(-8deg); } to { transform: none; } }

/* Starburst slowly spins and pulses */
.starburst { animation: burst-idle 6s ease-in-out infinite; }
@keyframes burst-idle {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.06); }
}

/* Drumroll shake for big reveals */
.shake { animation: shake .1s linear infinite; }
@keyframes shake {
  0% { transform: translate(1px, -1px); } 25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, 1px); } 75% { transform: translate(-1px, -1px); }
  100% { transform: translate(1px, -1px); }
}

/* Room code bulbs */
.room-code { animation: code-flicker 4s linear infinite; }
@keyframes code-flicker {
  0%, 100% { opacity: 1; } 92% { opacity: 1; } 93% { opacity: .75; }
  94% { opacity: 1; } 96% { opacity: .85; } 97% { opacity: 1; }
}

/* Score rows settle in */
.score-row { animation: row-in .35s ease both; }
.score-row:nth-child(2) { animation-delay: .06s; } .score-row:nth-child(3) { animation-delay: .12s; }
.score-row:nth-child(4) { animation-delay: .18s; } .score-row:nth-child(5) { animation-delay: .24s; }
.score-row:nth-child(6) { animation-delay: .3s; } .score-row:nth-child(7) { animation-delay: .36s; }
.score-row:nth-child(8) { animation-delay: .42s; }
@keyframes row-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

/* Panels breathe on hover (host voting cards) */
.panel { transition: transform .15s ease, box-shadow .15s ease; }
.panel:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.45); }

/* Mascot bob */
.mascot { animation: mascot-bob 3.4s ease-in-out infinite; display: block; margin: 0 auto; width: 170px; }
.marquee { background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 30%), linear-gradient(180deg, var(--burgundy) 0%, var(--burgundy-dark) 100%); }
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

/* Mute toggle */
.mute-btn {
  position: fixed; top: 14px; right: 14px; z-index: 1000;
  background: rgba(10,33,31,.85); border: 2px solid rgba(242,182,50,.5);
  color: var(--gold-soft); border-radius: 999px; padding: .45rem .8rem;
  font: inherit; font-weight: 800; cursor: pointer; font-size: .9rem;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
