/* ============================================================
   PulsePlay — design tokens + base + motion
   Stake-style: deep navy field, flat surfaces, hairline borders.
   Green reserved for primary CTAs, the live dot, and wins.
   ============================================================ */

:root {
  /* base surfaces (deep navy, not black) */
  --bg:        #0f212e;   /* page field            */
  --bg-1:      #0c1b25;   /* wells / ticker / inset */
  --surface:   #1a2c38;   /* cards                  */
  --surface-2: #213743;   /* rows / inputs / raised */
  --surface-3: #2b3f4d;   /* hover / pressed        */
  --line:        #263a47; /* subtle hairline        */
  --line-strong: #314757; /* visible divider/border */

  /* text */
  --text:   #ffffff;
  --text-1: #b1bad3;      /* muted blue-grey        */
  --text-2: #7d8fa1;
  --text-3: #56697a;

  /* accents — used sparingly */
  --green:    #1bd760;    /* primary CTA / live / win */
  --green-2:  #4fe389;
  --green-ink:#06210f;    /* text on green button (green is light) */
  --blue:     #4391e7;    /* links / secondary / home */
  --amber:    #f0a93b;    /* locked                  */
  --grey:     #8a9bad;    /* resolved                */
  --red:      #ed4f6b;    /* void / loss             */
  --win:      #1bd760;
  --lose:     #7d8fa1;

  /* outcome sides */
  --home: #4391e7;
  --away: #f0913f;
  --draw: #9b8afb;

  /* flat — no color glows */
  --glow-live:  0 0 #0000;
  --glow-amber: 0 0 #0000;
  --shadow-card: 0 0 #0000;
  --shadow-raise: 0 1px 2px rgba(0,0,0,.25);

  --r-card: 10px;
  --r-md:   8px;
  --r-sm:   6px;
  --r-pill: 999px;

  /* back-compat aliases (old token names used inline across JSX) */
  --live: var(--green);
  --live-2: var(--green-2);
  --live-ink: var(--green-ink);
  --amber-ink: #1a1101;
  --voidc: var(--red);

  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }

/* buttons/inputs don't inherit color by default — force it so no bare
   <button> ever falls back to the UA's near-black text on our dark surfaces */
button, input, textarea, select { color: inherit; font-family: inherit; }

#root { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.pp-scroll::-webkit-scrollbar { width: 0; height: 0; }
.pp-scroll { scrollbar-width: none; }

/* ============================================================
   Motion — functional only
   ============================================================ */
@keyframes pp-live-dot {
  0%,100% { opacity: 1; }
  50%     { opacity: .3; }
}
@keyframes pp-shimmer {
  0%   { background-position: -160% 0; }
  100% { background-position: 260% 0; }
}
@keyframes pp-ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes pp-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pp-pop {
  0%   { transform: scale(.97); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pp-confetti-fall {
  0%   { transform: translateY(-10px) rotate(0); opacity: 1; }
  100% { transform: translateY(420px) rotate(540deg); opacity: 0; }
}

.pp-rise  { animation: pp-rise .32s cubic-bezier(.2,.7,.2,1) both; }
.pp-pop   { animation: pp-pop .28s cubic-bezier(.2,.8,.2,1) both; }

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

/* ============================================================
   Atoms
   ============================================================ */
.pp-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 22px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  font-family: var(--sans);
}
.pp-pill--live    { color: var(--text-1); background: var(--surface-2); }
.pp-pill--live .pp-dot { color: var(--green); }
.pp-pill--locked  { color: var(--amber); background: rgba(240,169,59,.12); }
.pp-pill--review  { color: var(--text-1); background: var(--surface-2); }
.pp-pill--resolved{ color: var(--grey);  background: var(--surface-2); }
.pp-pill--void    { color: var(--red);   background: rgba(237,79,107,.12); }

.pp-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pp-live-dot 1.4s ease-in-out infinite; }

.pp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.pp-btn {
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  border: none; border-radius: var(--r-md); padding: 13px 18px;
  cursor: pointer; transition: filter .14s ease, background .14s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.pp-btn--live  { background: var(--green); color: var(--green-ink); }
.pp-btn--live:hover { filter: brightness(1.05); }
.pp-btn--ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
.pp-btn--ghost:hover { background: var(--surface-3); }

.pp-shimmer {
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: pp-shimmer 1.6s linear infinite;
}

/* tappable outcome row */
.pp-outcome {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .14s, background .14s;
  user-select: none;
}
.pp-outcome:hover { background: var(--surface-3); }
.pp-outcome:active { background: var(--surface-3); }
.pp-outcome[data-sel="1"] { border-color: var(--green); background: rgba(27,215,96,.08); }
.pp-outcome[data-win="1"] { border-color: var(--green); background: rgba(27,215,96,.10); }
.pp-outcome[data-lose="1"]{ opacity: .45; }
.pp-outcome[data-disabled="1"] { cursor: default; pointer-events: none; }

/* fill bar behind outcome showing share of pool */
.pp-outcome__fill {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  background: rgba(255,255,255,.05);
  transition: width .6s cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
}
