/* =========================================================
   VP+ AD GAMES — shared design system

   Tokens, reset, buttons and hero effects lifted from the VP+
   marketing site so the portal reads as the same product. If the
   brand shifts, change it here and everything follows.

   Loaded by every page. Page-specific rules live in portal.css
   and admin.css.
   ========================================================= */
:root {
  --bg:           hsl(240 20% 4%);
  --bg-elev:      hsl(240 15% 6%);
  --card:         hsl(240 15% 8%);
  --card-2:       hsl(240 15% 10%);
  --border:       hsl(240 10% 15%);
  --border-soft:  hsl(240 10% 12%);
  --fg:           hsl(0 0% 100%);
  --fg-muted:     hsl(240 5% 70%);
  --fg-dim:       hsl(240 5% 55%);

  --primary:      hsl(180 74% 63%);   /* cyan  — the Crochet challenge */
  --primary-2:    hsl(180 74% 73%);
  --mint:         hsl(160 76% 56%);   /* mint  — the Claymation challenge */
  --coral:        hsl(0 72% 71%);
  --gold:         hsl(43 84% 62%);    /* first place only */

  --radius-sm: .5rem;
  --radius:    .75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;

  --shadow-card: 0 1px 0 hsl(0 0% 100% / .03) inset, 0 30px 60px -30px hsl(0 0% 0% / .8);
  --shadow-glow: 0 0 0 1px hsl(180 74% 63% / .35), 0 10px 40px -10px hsl(180 74% 63% / .35);

  --container: 1200px;

  --font-sans: 'Lufga', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* =========================================================
   Reset + Base
   ========================================================= */
*,*::before,*::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
a, button, summary { touch-action: manipulation; }
:focus-visible {
  outline: 2px solid hsl(180 74% 63% / .7);
  outline-offset: 2px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

/* The whole app hides and shows panels with the `hidden` attribute, and
   any class that sets `display` outruns the UA stylesheet's [hidden]
   rule. Without this, a hidden flex/grid element stays on screen. */
[hidden] { display: none !important; }

::selection { background: hsl(180 74% 63% / .25); color: var(--fg); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}
@media (min-width: 768px) {
  .container { padding-inline: 2rem; }
}

.plus { color: var(--primary); font-weight: 700; }

.grad {
  background: linear-gradient(90deg, hsl(180 74% 63%), hsl(160 76% 56%) 60%, hsl(180 74% 73%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Glow on the gradient text — drop-shadow works through background-clip.
   Static on purpose: animating a filter forces the browser to re-rasterize
   the text plus every layer behind it, which flashes on some machines. */
.grad--glow {
  filter:
    drop-shadow(0 0 22px hsl(180 74% 63% / .65))
    drop-shadow(0 0 50px hsl(160 76% 56% / .4));
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .01em;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .25s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--ghost {
  background: hsl(0 0% 100% / .03);
  color: var(--fg);
  border-color: var(--border);
}
.btn--ghost:hover:not(:disabled) {
  background: hsl(0 0% 100% / .06);
  border-color: hsl(240 10% 25%);
}

.btn--sm  { padding: .5rem .8rem; font-size: .8rem; border-radius: .55rem; }
.btn--lg  { padding: .95rem 1.4rem; font-size: 1rem; }
.btn--xl  { padding: 1.15rem 1.8rem; font-size: 1.1rem; border-radius: var(--radius-lg); }

/* Glossy gradient pill with neon halo + sheen — works at any size.
   Sizing comes from .btn / .btn--xl separately. */
.btn--glow {
  position: relative;
  isolation: isolate;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -.005em;
  color: hsl(240 25% 6%);
  background:
    linear-gradient(180deg, hsl(180 80% 80%) 0%, hsl(180 74% 63%) 45%, hsl(160 76% 56%) 100%);
  border: 1px solid hsl(180 74% 80% / .9);
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / .55),
    0 0 0 4px hsl(180 74% 63% / .14),
    0 0 38px -8px hsl(180 74% 63% / .85),
    0 14px 40px -10px hsl(180 74% 63% / .55);
  transition: transform .2s ease, box-shadow .25s ease, filter .25s ease;
}
.btn--glow svg { width: 18px; height: 18px; }
/* Glossy sheen overlay */
.btn--glow::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, hsl(0 0% 100% / .35) 0%, transparent 45%);
  pointer-events: none;
  z-index: -1;
}
/* Outer bloom */
.btn--glow::after {
  content: "";
  position: absolute;
  inset: -55%;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, hsl(180 74% 63% / .5), transparent 55%);
  filter: blur(30px);
  z-index: -2;
  pointer-events: none;
  opacity: .9;
}
.btn--glow:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06) saturate(1.05);
}
.btn--glow.btn--xl {
  padding: 1.15rem 2rem;
  font-size: 1.05rem;
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / .55),
    0 0 0 6px hsl(180 74% 63% / .12),
    0 0 60px -10px hsl(180 74% 63% / .9),
    0 22px 60px -10px hsl(180 74% 63% / .65);
}
.btn--glow.btn--xl:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / .65),
    0 0 0 8px hsl(180 74% 63% / .18),
    0 0 80px -10px hsl(180 74% 63% / 1),
    0 26px 70px -10px hsl(180 74% 63% / .8);
}

/* Discord blurple — the one place we go off-palette, because the
   button has to read as Discord's at a glance. */
.btn--discord {
  background: hsl(235 86% 65%);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid hsl(235 86% 75% / .6);
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / .25),
    0 0 40px -10px hsl(235 86% 65% / .9),
    0 14px 40px -12px hsl(235 86% 65% / .7);
}
.btn--discord:hover:not(:disabled) {
  background: hsl(235 86% 70%);
  transform: translateY(-1px);
}
.btn--discord svg { width: 22px; height: 22px; }

/* =========================================================
   Hero atmospherics — beam, corner glows, masked grid.
   Drop <div class="fx"> with these three children behind any
   full-bleed section to get the VP+ look.
   ========================================================= */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

/* Aurora light beam streaming down from the top */
.fx__beam {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%) rotate(8deg);
  width: 56vw;
  max-width: 720px;
  height: 110%;
  background:
    radial-gradient(ellipse at top, hsl(180 74% 63% / .55), transparent 60%),
    radial-gradient(ellipse at center, hsl(160 76% 56% / .35), transparent 65%);
  filter: blur(80px);
  opacity: .55;
}
.fx__glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: .25;
}
.fx__glow--1 {
  background: radial-gradient(circle, hsl(180 74% 63% / .55), transparent 60%);
  top: -240px; left: -200px;
}
.fx__glow--2 {
  background: radial-gradient(circle, hsl(160 76% 56% / .5), transparent 60%);
  bottom: -260px; right: -200px;
}
.fx__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(hsl(240 10% 22% / .8) 1px, transparent 1px),
    linear-gradient(90deg, hsl(240 10% 22% / .8) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 35%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, black 0%, transparent 75%);
  opacity: .55;
}

/* =========================================================
   Pills & chips
   ========================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid hsl(0 0% 100% / .08);
  background: hsl(240 15% 8% / .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.pill i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px 1px hsl(180 74% 63% / .9);
}

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* =========================================================
   Prize cards — rendered on the welcome page and the Prizes tab
   from window.VPAG.prizes, so the styles are shared.
   ========================================================= */
.prz {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  max-width: 880px;
  margin-inline: auto;
}
@media (min-width: 780px) { .prz { grid-template-columns: 1fr 1fr; } }

.prz__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.9rem 1.6rem;
  text-align: center;
  background: linear-gradient(180deg, var(--card), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.prz__card[data-tone="gold"] {
  --accent: hsl(43 84% 62%);
  border-color: hsl(43 84% 62% / .34);
  box-shadow: var(--shadow-card), 0 0 60px -20px hsl(43 84% 62% / .65);
}
.prz__card[data-tone="mint"] { --accent: hsl(160 76% 56%); }
.prz__card::before {
  content: "";
  position: absolute;
  inset: -60% -20% 60% -20%;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--accent) 30%, transparent), transparent 65%);
  filter: blur(50px);
  z-index: -1;
}
.prz__place {
  display: inline-block;
  margin-bottom: .9rem;
  padding: .3rem .95rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 34%, transparent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}
.prz__title {
  margin: 0 0 .5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--accent);
}
/* The value is the hero of the card: it's what they're actually winning.
   Big number, small suffix, lit up in the card's accent. */
.prz__value {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  margin-bottom: 1.1rem;
  padding: .5rem 1.35rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / .2),
    0 0 30px -6px color-mix(in oklab, var(--accent) 75%, transparent);
}
.prz__value b {
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--accent);
  text-shadow:
    0 0 14px color-mix(in oklab, var(--accent) 85%, transparent),
    0 0 36px color-mix(in oklab, var(--accent) 55%, transparent);
}
.prz__value i {
  font-style: normal;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--accent) 65%, var(--fg));
}

/* The pulse rides a blurred bloom behind the pill, animating only opacity
   and transform. Both are compositor properties, so the breathe never
   re-rasterizes the text or the card behind it. */
.prz__value::before {
  content: "";
  position: absolute;
  inset: -70%;
  border-radius: inherit;
  background: radial-gradient(ellipse at center,
    color-mix(in oklab, var(--accent) 60%, transparent), transparent 62%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
  animation: przBloom 3.4s ease-in-out infinite;
}
/* offset the second card so the two never breathe in lockstep */
.prz__card:nth-child(2) .prz__value::before { animation-delay: -1.7s; }

@keyframes przBloom {
  0%, 100% { opacity: .4;  transform: scale(.92); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .prz__value::before { animation: none; opacity: .8; transform: none; }
}
.prz__sub {
  margin: 0 0 .9rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--fg);
}
.prz__detail { margin: 0; color: var(--fg-muted); font-size: .9rem; }

/* =========================================================
   Footer
   ========================================================= */
.foot {
  border-top: 1px solid var(--border-soft);
  margin-top: 4rem;
  padding: 1.75rem 0;
  background: hsl(240 20% 3%);
}
.foot__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--fg-dim);
}
.foot__mark { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg-muted); }
.foot__mark img { height: 22px; width: auto; }

/* =========================================================
   Motion preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
