@import url("/static/assets/fonts/fonts.css");

/* Party Game OS — "PRIMETIME (warm)" theme.
   Warm studio dark base; ONE signature color (coral) with gold (--accent)
   reserved for winning only. Animations stay transform/opacity-only (60fps
   on TVs). The studio backdrop breathes with warm spotlights (.stage-bg). */
:root {
  /* ── Background ramp (deepest → app) — WARM studio dark ── */
  --bg-0: #14090a;          /* stage black (warm) */
  --bg-1: #1d0e0c;          /* app background */

  /* ── Surfaces / elevation (warm) ── */
  --surface:        #271310; /* flat card */
  --surface-raised: #351a14; /* raised / overlay */
  --recessed:       #190b09; /* inputs, wells */
  --hairline: rgba(255,236,222,.08);   /* quiet warm border */
  --line:     rgba(255,236,222,.14);   /* raised warm border */
  --shadow-1:      0 2px 12px rgba(0,0,0,.45);
  --shadow-raised: 0 26px 64px -20px rgba(0,0,0,.72);
  --glow-primary:  0 0 0 3px rgba(255,122,69,.42);   /* focus / active only */

  /* ── Brand: warm coral signature, gold the rare reward ── */
  --primary:     #ff7a45;   /* signature: buttons, active, brand, focus, bars */
  --primary-600: #f4612e;
  --primary-700: #db4d1d;   /* pressed / shadow side */
  --primary-soft:#ffa872;   /* lighter accents: timer, explain */
  --accent:      #ffc24d;   /* WINNER ONLY: champion, trophy, 1st place, room code */
  --accent-700:  #db9320;
  --title-grad:  linear-gradient(95deg,#ff5a5f,#ff8a4c 45%,#ffc24d);  /* marquee titles */

  /* ── Neutrals (warm) ── */
  --ink:   #fff3ea;
  --muted: #d2ad9d;

  /* ── Semantics (reserved, never decorative) ── */
  --good: #4cd693;
  --bad:  #ff4d4d;

  /* ── Legacy aliases → so existing rules recolor into the new system ── */
  --neon-1: var(--primary);
  --neon-2: var(--accent);
  --neon-3: var(--primary-soft);
  --gold:   var(--accent);
  --card:   var(--surface);
  --card-br: var(--line);
  --bg-2:   #3a1410;   /* warm mid tone for bumper/outro gradients */

  /* ── Type ── */
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font: var(--font-body);                 /* legacy alias */
  --w-body: 400; --w-label: 600; --w-strong: 700; --w-display: 800;

  /* ── Spacing scale (8px base) ── */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;
  --radius: 16px; --radius-lg: 24px; --radius-pill: 999px;

  /* ── Motion ── */
  --dur-fast: 140ms; --dur: 240ms; --dur-slow: 480ms;
  --ease-out:    cubic-bezier(.2,.7,.2,1);    /* routine */
  --ease-spring: cubic-bezier(.2,1.3,.35,1);  /* celebration only */
}

* { box-sizing: border-box; min-width: 0; }   /* min-width:0 lets flex/grid kids shrink */
html, body { margin: 0; height: 100%; max-width: 100%; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
body {
  font-family: var(--font-body);
  font-weight: var(--w-body);
  color: var(--ink);
  background-color: var(--bg-0);   /* solid dark fallback so text is NEVER white-on-white */
  /* warm studio wash: a top key-light + a deep floor shadow for real depth */
  background-image:
    radial-gradient(1300px 860px at 50% -14%, #45170f, transparent 72%),
    radial-gradient(1100px 700px at 50% 118%, #240c0a, transparent 70%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Studio backdrop: warm spotlights that slowly breathe + sweep (TV-show feel).
   transform/opacity only → 60fps on a TV. Paused under reduced-motion. ── */
.stage-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.stage-bg::before, .stage-bg::after { content: ""; position: absolute; border-radius: 50%; will-change: transform, opacity; }
/* Coral key spotlight from top-center, gently breathing. */
.stage-bg::before {
  width: 92vmax; height: 92vmax; top: -50vmax; left: 50%;
  background: radial-gradient(circle, rgba(255,118,66,.20), transparent 60%);
  transform: translateX(-50%);
  animation: spotBreath 9s var(--ease-out) infinite;
}
/* Gold fill spotlight drifting on one side. */
.stage-bg::after {
  width: 66vmax; height: 66vmax; top: -18vmax; left: 8%;
  background: radial-gradient(circle, rgba(255,194,77,.12), transparent 62%);
  animation: spotDrift 16s ease-in-out infinite;
}
@keyframes spotBreath {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .85; }
  50%      { transform: translateX(-50%) scale(1.12); opacity: 1; }
}
@keyframes spotDrift {
  0%, 100% { transform: translate(0, 0); opacity: .7; }
  50%      { transform: translate(46vw, 6vh); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-bg::before, .stage-bg::after { animation: none; }
}

/* Primary button — the signature color carries the CTA; restrained depth. */
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font-body);
  font-weight: var(--w-display); letter-spacing: .2px; color: #fff;
  background: var(--primary);
  padding: 16px 28px; border-radius: var(--radius); font-size: 1.05rem;
  box-shadow: 0 6px 0 var(--primary-700), 0 14px 30px rgba(0,0,0,.4);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--primary-700), 0 8px 18px rgba(0,0,0,.4); }
.btn:focus-visible { outline: none; box-shadow: var(--glow-primary), 0 6px 0 var(--primary-700), 0 14px 30px rgba(0,0,0,.4); }
.btn.secondary {
  color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line);
  box-shadow: none; font-weight: var(--w-strong);
}
.btn.secondary:hover { background: #2a2a48; }

/* Card — flat base of the 3-tier elevation system. */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }

.pill { display:inline-block; padding:6px 14px; border-radius:var(--radius-pill); background:var(--surface-raised); border:1px solid var(--hairline); color:var(--muted); font-weight:var(--w-label); }

/* Avatar = an inline SVG character (avatars.js). Sized off the context's
   font-size so existing .av/.my-av/.ip-av/.champ-av rules just work. */
.av { display:inline-block; vertical-align:middle; flex:0 0 auto;
  width:1.7em; height:1.7em; overflow:visible; }
.crown-svg { display:inline-block; vertical-align:middle; width:1.1em; height:.85em; }

.hidden { display: none !important; }

/* <select> readability: force our dark bg + light text (mobile browsers ignore a
   dark background on the closed select otherwise → invisible light-on-light). */
select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-color: var(--recessed); color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa0c0' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
select option { color: #10082a; background: #ffffff; }

/* All text inputs: dark field + readable ink (prevents light-on-light). */
input:not([type="checkbox"]):not([type="radio"]), textarea {
  background-color: var(--recessed); color: var(--ink);
  border: 1px solid var(--line); font-family: var(--font-body);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* Connection-lost / reconnecting banner (shared by TV + phone). */
.conn-banner { position: fixed; top: 0; left: 50%; z-index: 200;
  transform: translateX(-50%) translateY(-150%);
  margin-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 10px 18px; font-weight: var(--w-strong); font-size: .95rem;
  box-shadow: var(--shadow-raised);
  transition: transform var(--dur) var(--ease-out); }
.conn-banner.show { transform: translateX(-50%) translateY(0); }
.conn-banner .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: connPulse 1s ease-in-out infinite; }
@keyframes connPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pop-in { animation: popIn var(--dur) var(--ease-spring) both; }
.fade-up { animation: fadeUp var(--dur-slow) var(--ease-out) both; }
