/* ══════════════════════════════════════════════════════════════════════
   PIXEL STUDIO - SEASONAL EVENTS
   ──────────────────────────────────────────────────────────────────────
   Loaded by head.twig ONLY while an event runs, so none of this exists
   for the normal store. Everything is scoped to html[data-event] anyway.

     1  event colours           the only per-event block most edits need
     2  splash
     3  menu item (the wheel)
     4  decorations             webs, spider, embers / lights, snow
     5  event page              hero, lock, calendar, loot, prize board
     6  motion, responsiveness
     7  the reveal              the full-screen opening and the prize card

   Adding an event: copy one block in section 1, give it its own
   decorations in section 4 if it needs any, and add its entry in
   store-config.js -> events.
   ══════════════════════════════════════════════════════════════════════ */


/* ── 1  EVENT COLOURS ─────────────────────────────────────────────────
   --color-primary is the store's own accent - buttons, links, glows and
   the page atmosphere all read it, so overriding it here re-themes the
   whole store at once. The selector outranks the :root block in
   head.twig, so the order the two load in does not matter.             */

html[data-event="halloween"] {
  --color-primary: #ff7a1a;
  --color-primary-hover: #ff9a3d;
  --ev-a: #ff7a1a;          /* pumpkin orange */
  --ev-b: #ffb547;          /* amber */
  --ev-c: #ffd25e;          /* candle yellow */
  --ev-rgb: 255, 122, 26;
  --ev-pill: linear-gradient(180deg, #2a180a 0%, #170d05 100%);
  --ev-emoji: "🎃";
}

html[data-event="christmas"] {
  --color-primary: #ff4d5a;
  --color-primary-hover: #ff6b76;
  --ev-a: #ff4d5a;          /* berry red */
  --ev-b: #2fbf71;          /* pine green */
  --ev-c: #f6c453;          /* gold */
  --ev-rgb: 255, 77, 90;
  --ev-pill: linear-gradient(180deg, #2a0f13 0%, #16080a 100%);
  --ev-emoji: "🎁";
}

html[data-event] {
  --ev-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ev-common: #9aa4b2;
  --ev-rare: #4fa3ff;
  --ev-epic: #b46bff;
  --ev-legendary: #ffb547;
}

/* the rotating conic gradients turn a custom property; browsers without
   @property simply keep them still, which is a fine fallback */
@property --ev-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes evSpin { to { transform: rotate(360deg); } }
@keyframes evAngle { to { --ev-angle: 360deg; } }


/* ── 2  SPLASH ──────────────────────────────────────────────────────── */

.ev-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #09080b;
  pointer-events: none;
  /* failsafe: gone on its own even if events.js never runs */
  animation: evSplashFailsafe 0.6s ease 4.6s forwards;
  transition: opacity 0.6s ease, transform 0.8s var(--ev-ease), filter 0.6s ease;
}

.ev-splash.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  filter: blur(4px);
}

@keyframes evSplashFailsafe {
  to { opacity: 0; visibility: hidden; }
}

.ev-splash-atmos {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(42% 38% at 50% 54%, rgba(var(--ev-rgb), 0.26) 0%, transparent 70%),
    radial-gradient(80% 60% at 50% 120%, rgba(var(--ev-rgb), 0.16) 0%, transparent 70%),
    radial-gradient(60% 50% at 50% -10%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.ev-splash-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: evRise 0.9s var(--ev-ease) both;
}

@keyframes evRise {
  from { opacity: 0; transform: translateY(14px); }
}

.ev-splash-art {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 6px;
  animation: evFloat 3.2s ease-in-out infinite;
}

.ev-splash-art img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 26px rgba(var(--ev-rgb), 0.45));
}

/* a pool of light under the item */
.ev-splash-art::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 150%;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--ev-rgb), 0.5), transparent);
  filter: blur(4px);
}

/* the image has not been uploaded yet - a glyph stands in */
.ev-splash-art.is-missing::after {
  content: var(--ev-emoji);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 92px;
  line-height: 1;
}

@keyframes evFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.ev-splash-brand { transform: scale(1.35); margin: 8px 0 4px; }

.ev-splash-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ev-b);
  text-shadow: 0 0 18px rgba(var(--ev-rgb), 0.6);
}

.ev-splash-bar {
  position: relative;
  width: 120px;
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.ev-splash-bar i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  background: linear-gradient(90deg, var(--ev-a), var(--ev-c));
  animation: evLoad 1.6s var(--ev-ease) both;
}

@keyframes evLoad { from { transform: scaleX(0); } }

/* the splash spider lowers itself on a thread from the top edge */
/* A black spider on a black screen is invisible, so it is backlit - a
   warm rim of light, the way a spider looks in torchlight. */
.ev-splash-spider {
  position: absolute;
  top: 0;
  left: 66%;
  width: 38px;
  color: #3b2c1f;
  filter:
    drop-shadow(0 0 1px rgba(255, 190, 120, 0.9))
    drop-shadow(0 0 10px rgba(var(--ev-rgb), 0.55));
  animation: evSpiderDrop 2.6s cubic-bezier(0.45, 0, 0.25, 1) 0.15s both;
}

.ev-splash-spider .ev-thread { background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 220, 180, 0.45)); }

@keyframes evSpiderDrop {
  0%   { transform: translateY(-60px); }
  55%  { transform: translateY(150px); }
  70%  { transform: translateY(138px); }
  100% { transform: translateY(150px); }
}

/* Christmas splash: a string of lights and a little snow */
.ev-splash-lights {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 4%;
}

.ev-splash-lights::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.ev-splash-lights i {
  position: relative;
  width: 9px;
  height: 13px;
  margin-top: 4px;
  border-radius: 50% 50% 45% 45%;
  --bulb: var(--ev-a);
  background: radial-gradient(circle at 50% 35%, #fff 0%, var(--bulb) 45%);
  box-shadow: 0 0 12px var(--bulb);
  animation: evTwinkle 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.23s);
}

.ev-splash-lights i:nth-child(4n + 2) { --bulb: var(--ev-c); }
.ev-splash-lights i:nth-child(4n + 3) { --bulb: var(--ev-b); }
.ev-splash-lights i:nth-child(4n + 4) { --bulb: #9fd4ff; }

.ev-splash-snow i {
  position: absolute;
  top: -10px;
  left: calc(var(--i) * 5.4%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: evSnow 5s linear infinite;
  animation-delay: calc(var(--i) * -0.37s);
}

.ev-splash-snow i:nth-child(3n) { width: 3px; height: 3px; animation-duration: 6.5s; }
.ev-splash-snow i:nth-child(4n) { width: 5px; height: 5px; opacity: 0.5; }


/* ── 3  MENU ITEM - the wheel ─────────────────────────────────────────
   No box: the label sits on the navbar on its own, and behind it the event
   page's sunburst turns - flattened to the label's own shape (a label is
   far wider than it is tall) and kept inside the navbar's row. The rays
   turn INSIDE a fixed ellipse, so nothing ever spills past it. The dark
   text-shadow keeps the label readable over the rays.

   It keeps turning with "reduce motion" on - see section 6.             */

.ev-nav-item { list-style: none; }

.ev-nav-link {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.3s var(--ev-ease), filter 0.3s ease;
}

.ev-nav-link:hover { transform: translateY(-1px); filter: brightness(1.1); }

.ev-nav-link:focus-visible {
  outline: 2px solid var(--ev-c);
  outline-offset: 4px;
  border-radius: 10px;
}

.ev-nav-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(var(--ev-rgb), 0.55);
}

/* the event page's own item - the image, or its drawing until the image
   is uploaded (event-nav.twig switches with .is-drawn) */
.ev-nav-icon {
  display: inline-grid;
  flex: none;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 7px rgba(var(--ev-rgb), 0.6));
  transition: transform 0.35s var(--ev-ease);
}

.ev-nav-icon img,
.ev-nav-icon svg {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ev-nav-icon svg,
.ev-nav-icon.is-drawn img { display: none; }
.ev-nav-icon.is-drawn svg { display: block; }

.ev-nav-link:hover .ev-nav-icon { transform: rotate(-10deg) scale(1.1); }

/* the frame: an ellipse a little wider than the label, no taller than the
   navbar row. --ev-ray-rgb / --ev-ray-a: colour and strength of the rays. */
.ev-nav-wheel {
  --ev-ray-rgb: var(--ev-rgb);
  --ev-ray-a: 0.4;
  position: absolute;
  left: -26px;
  right: -26px;
  top: 50%;
  z-index: -1;
  height: 62px;
  margin-top: -31px;
  pointer-events: none;
}

/* the rays: 15 wide ones, like the event page. The gradient turns inside
   the frame (--ev-angle), the frame itself never moves. The 0deg fallback
   keeps them, standing still, in a browser without @property. */
.ev-nav-wheel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(from var(--ev-angle, 0deg), rgba(var(--ev-ray-rgb), var(--ev-ray-a)) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(closest-side, transparent 8%, #000 30%, rgba(0, 0, 0, 0.5) 64%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 8%, #000 30%, rgba(0, 0, 0, 0.5) 64%, transparent 100%);
  animation: evAngle 16s linear infinite;
}

/* the warm glow over the rays' centre, breathing slowly */
.ev-nav-wheel::after {
  content: "";
  position: absolute;
  inset: 18% 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--ev-rgb), 0.55), rgba(var(--ev-rgb), 0.16) 60%, transparent);
  filter: blur(7px);
  animation: evGlow 3.6s ease-in-out infinite;
}

@keyframes evGlow {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

/* christmas: golden rays around the red glow */
html[data-event="christmas"] .ev-nav-wheel { --ev-ray-rgb: 246, 196, 83; --ev-ray-a: 0.36; }

/* mobile menu: the same wheel, a little smaller, left where the menu's
   other items start */
.ev-nav-item--mobile { margin: 6px 0 10px; padding-left: 8px; }
.ev-nav-item--mobile .ev-nav-link { padding: 10px 14px; font-size: 16px; }
.ev-nav-item--mobile .ev-nav-wheel { left: -18px; right: -18px; height: 54px; margin-top: -27px; }

/* ── 4  DECORATIONS ─────────────────────────────────────────────────
   Built by events.js after the page has loaded. All pointer-events:none,
   so nothing here can ever sit between a visitor and a button.         */

.ev-decor {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  z-index: 5;
  pointer-events: none;
}

.ev-decor * { pointer-events: none; }

/* corner webs, anchored to the top of the page - they scroll away with it
   instead of hanging over the content all the way down */
.ev-web {
  position: absolute;
  top: 0;
  width: clamp(96px, calc((100vw - 1240px) / 2 + 70px), 230px);
  height: auto;
  aspect-ratio: 1;
  color: rgba(255, 255, 255, 0.13);
}

.ev-web path { stroke-width: 1px; vector-effect: non-scaling-stroke; }
.ev-web .ev-web-spiral { opacity: 0.75; }
.ev-web--tl { left: 0; }
.ev-web--tr { right: 0; transform: scaleX(-1); }

.ev-splash .ev-web { color: rgba(255, 255, 255, 0.2); width: 230px; }

/* things that sit on the corner of a section - pumpkins, gifts */
.ev-sit {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  transform: translate(var(--tx, 0), var(--ty, 0));
}

/* a fixed square box, so the group has its final size before the image
   arrives - events.js measures it to place it on its corner */
.ev-sit img,
.ev-sit svg {
  display: block;
  width: var(--w, 58px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}

.ev-sit img + img,
.ev-sit svg + svg { --w: 38px; margin-left: -10px; }

/* a candle-glow puddle under the group */
.ev-sit::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 140%;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--ev-rgb), 0.35), transparent);
  filter: blur(3px);
  animation: evFlicker 3.4s ease-in-out infinite;
}

@keyframes evFlicker {
  0%, 100% { opacity: 0.75; }
  40%      { opacity: 1; }
  60%      { opacity: 0.6; }
}

/* hanging decorations - only on screens wide enough to have empty
   gutters beside the content, so they never hang over anything */
.ev-hang {
  position: absolute;
  top: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0;
  animation: evSway 5.5s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.ev-hang::before {
  content: "";
  width: 1px;
  height: var(--len, 120px);
  background: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.28));
}

.ev-hang img,
.ev-hang svg { width: var(--w, 34px); height: auto; }

@keyframes evSway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

@media (min-width: 1720px) {
  .ev-hang { display: flex; }
}

.ev-bat {
  color: #2e2219;
  filter:
    drop-shadow(0 0 1px rgba(255, 190, 120, 0.75))
    drop-shadow(0 0 8px rgba(var(--ev-rgb), 0.4));
}

.ev-hang-spider {
  display: block;
  width: var(--w, 24px);
  color: #2b221b;
  filter: drop-shadow(0 0 6px rgba(var(--ev-rgb), 0.35));
}

/* Christmas: glass baubles, a highlight and a little cap */
.ev-bauble {
  position: relative;
  display: block;
  width: var(--w, 28px);
  aspect-ratio: 1;
  margin-top: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 8%, transparent 22%), radial-gradient(circle at 50% 50%, var(--c), color-mix(in srgb, var(--c) 45%, #000) 100%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 55%, transparent);
}

.ev-bauble::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 30%;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(#d9c27a, #8c7434);
}

/* the wandering spider - fixed to the viewport so it is seen wherever the
   visitor is on the page, and hidden between its appearances */
.ev-spider-walk {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 26px;
  color: #3b2c1f;
  opacity: 0;
  pointer-events: none;
  /* backlit, or it disappears against the dark page */
  filter:
    drop-shadow(0 0 1px rgba(255, 190, 120, 0.85))
    drop-shadow(0 0 8px rgba(var(--ev-rgb), 0.45));
}

.ev-spider { display: block; width: 100%; height: auto; }
.ev-spider-eye { fill: var(--ev-c); filter: drop-shadow(0 0 2px var(--ev-a)); }

.ev-spider-legs path:first-child {
  transform-origin: 16px 18px;
  animation: evLegsL 0.36s ease-in-out infinite alternate;
}

.ev-spider-legs path:last-child {
  transform-origin: 24px 18px;
  animation: evLegsR 0.36s ease-in-out infinite alternate;
}

@keyframes evLegsL { to { transform: rotate(-5deg); } }
@keyframes evLegsR { to { transform: rotate(5deg); } }

/* the silk it hangs from, reaching up past the top of the screen */
.ev-thread {
  position: absolute;
  left: 50%;
  bottom: 62%;
  width: 1px;
  height: 100vh;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.35));
}

/* drop: down from the top edge, a pause, back up */
.ev-spider-walk.is-drop { left: var(--x, 10vw); }
.ev-spider-walk.is-drop.is-on { animation: evSpiderVisit 7s cubic-bezier(0.45, 0, 0.3, 1) both; }

@keyframes evSpiderVisit {
  0%   { opacity: 1; transform: translateY(-40px); }
  30%  { transform: translateY(var(--drop, 120px)); }
  36%  { transform: translateY(calc(var(--drop, 120px) - 10px)); }
  42%  { transform: translateY(var(--drop, 120px)); }
  70%  { transform: translateY(var(--drop, 120px)); }
  99%  { opacity: 1; transform: translateY(-40px); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* crawl: along the very top of the screen, no thread */
.ev-spider-walk.is-crawl .ev-thread { display: none; }
.ev-spider-walk.is-crawl { top: var(--y, 10px); width: 20px; }
.ev-spider-walk.is-crawl.is-on { animation: evSpiderCrawl 15s linear both; }
.ev-spider-walk.is-crawl.is-reverse.is-on { animation-name: evSpiderCrawlBack; }

@keyframes evSpiderCrawl {
  0%   { opacity: 1; transform: translateX(-40px) rotate(90deg); }
  45%  { transform: translateX(46vw) translateY(6px) rotate(96deg); }
  52%  { transform: translateX(50vw) translateY(6px) rotate(90deg); }
  99%  { opacity: 1; transform: translateX(calc(100vw + 40px)) rotate(84deg); }
  100% { opacity: 0; transform: translateX(calc(100vw + 40px)) rotate(84deg); }
}

@keyframes evSpiderCrawlBack {
  0%   { opacity: 1; transform: translateX(calc(100vw + 40px)) rotate(-90deg); }
  50%  { transform: translateX(50vw) translateY(5px) rotate(-94deg); }
  99%  { opacity: 1; transform: translateX(-40px) rotate(-88deg); }
  100% { opacity: 0; transform: translateX(-40px) rotate(-88deg); }
}

/* drifting particles - embers rise, snow falls. Behind the content
   (z-index -1), so they show in the gaps and through the glass panels,
   never over text. Pure CSS: no script runs while they move. */
.ev-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ev-particles i {
  position: absolute;
  left: var(--x);
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation-duration: var(--d, 18s);
  animation-delay: var(--delay, 0s);
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.ev-particles--ember i {
  bottom: -10px;
  background: radial-gradient(circle, #ffe2a8 0%, var(--ev-a) 60%, transparent 100%);
  box-shadow: 0 0 8px rgba(var(--ev-rgb), 0.8);
  animation-name: evEmber;
}

@keyframes evEmber {
  0%   { opacity: 0; transform: translate(0, 0); }
  12%  { opacity: var(--o, 0.6); }
  80%  { opacity: calc(var(--o, 0.6) * 0.6); }
  100% { opacity: 0; transform: translate(var(--drift, 30px), -105vh); }
}

.ev-particles--snow i {
  top: -10px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation-name: evSnow;
}

@keyframes evSnow {
  0%   { opacity: 0; transform: translate(0, 0); }
  8%   { opacity: var(--o, 0.7); }
  100% { opacity: var(--o, 0.7); transform: translate(var(--drift, 30px), 105vh); }
}

/* Christmas lights strung across the top of the page */
.ev-lights {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
}

.ev-lights-wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 40px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
}

.ev-bulb {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 9px;
  height: 13px;
  margin-left: -4.5px;
  border-radius: 50% 50% 45% 45%;
  --bulb: var(--ev-a);
  background: radial-gradient(circle at 50% 35%, #fff 0%, var(--bulb) 48%);
  box-shadow: 0 0 10px var(--bulb), 0 0 22px rgba(255, 255, 255, 0.05);
}

.ev-bulb::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 2.5px;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: #3b3b42;
}

.ev-lights.is-compact { height: 26px; }
.ev-lights.is-compact .ev-lights-wire { height: 26px; }
.ev-lights.is-compact .ev-bulb { width: 6px; height: 9px; margin-left: -3px; }
.ev-lights.is-compact .ev-bulb::before { left: 1.5px; width: 3px; height: 3px; top: -2px; }

.ev-bulb:nth-child(4n + 2) { --bulb: var(--ev-c); }
.ev-bulb:nth-child(4n + 3) { --bulb: var(--ev-b); }
.ev-bulb:nth-child(4n + 4) { --bulb: #9fd4ff; }

.ev-lights.is-twinkling .ev-bulb {
  animation: evTwinkle 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.31s);
}

@keyframes evTwinkle {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50%      { opacity: 0.55; filter: brightness(0.75); }
}

/* tab in the background: stop every decoration animation */
html.ev-paused .ev-particles i,
html.ev-paused .ev-spider-walk,
html.ev-paused .ev-hang,
html.ev-paused .ev-bulb,
html.ev-paused .ev-sit::before { animation-play-state: paused; }


/* ── 5  EVENT PAGE ──────────────────────────────────────────────────── */

.evp {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 40px;
  padding-bottom: 20px;
}

@media (min-width: 768px) {
  .evp { gap: 28px; margin-top: 56px; }
}

.evp-h2 {
  margin: 0;
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1 !important;
}

.evp-h2 span { color: var(--ev-a); }

@media (min-width: 768px) { .evp-h2 { font-size: 28px; } }

.evp-panel {
  position: relative;
  border-radius: 22px;
  background: var(--glass-bg, rgba(22, 22, 26, 0.8));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.075));
  box-shadow: var(--glass-shadow, none);
}

/* test mode banner - Template Options -> Event Test Mode */
.evp-test {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 11px 12px 11px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 214, 94, 0.55);
  background: rgba(255, 214, 94, 0.08);
  font-size: 12.5px;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.75);
}

.evp-test b {
  color: var(--ev-c);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.evp-test span { flex: 1; min-width: 220px; }

.evp-test-reset {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.evp-test-reset:hover { background: rgba(255, 255, 255, 0.1); }

/* ── hero ── */

.evp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  padding: 28px 22px;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(var(--ev-rgb), 0.14) 0%, transparent 60%),
    radial-gradient(60% 80% at 0% 100%, rgba(var(--ev-rgb), 0.08) 0%, transparent 70%),
    var(--glass-bg, rgba(22, 22, 26, 0.8));
}

@media (min-width: 900px) {
  .evp-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 30px;
    padding: 44px 44px;
  }
}

.evp-hero .ev-web {
  width: 170px;
  color: rgba(255, 255, 255, 0.08);
  z-index: 0;
}

.evp-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

.evp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.evp-eyebrow i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ev-a);
  box-shadow: 0 0 12px var(--ev-a);
}

.evp-title {
  margin: 0;
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff;
  line-height: 0.98 !important;
}

.evp-title span {
  display: block;
  color: var(--ev-a);
  text-shadow: 0 0 34px rgba(var(--ev-rgb), 0.45);
}

@media (min-width: 768px)  { .evp-title { font-size: 50px; } }
@media (min-width: 1200px) { .evp-title { font-size: 60px; } }

.evp-sub {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.65 !important;
  color: rgba(255, 255, 255, 0.6);
}

@media (min-width: 768px) { .evp-sub { font-size: 15px; } }

.evp-meta { display: flex; flex-wrap: wrap; gap: 7px; }

.evp-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.evp-chip--live {
  color: var(--ev-b);
  border-color: rgba(var(--ev-rgb), 0.4);
  background: rgba(var(--ev-rgb), 0.1);
}

.evp-chip--live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ev-a);
  animation: evPing 2s ease-out infinite;
}

@keyframes evPing {
  0%   { box-shadow: 0 0 0 0 rgba(var(--ev-rgb), 0.7); }
  80%, 100% { box-shadow: 0 0 0 7px rgba(var(--ev-rgb), 0); }
}

.evp-clock {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.evp-clock-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.evp-clock-time {
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1 !important;
}

.evp-clock-time small {
  margin: 0 3px;
  font-size: 0.5em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  vertical-align: 0.4em;
}

/* the stage: today's item, large */
.evp-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 18px 0 4px;
  text-align: center;
}

@media (min-width: 900px) { .evp-stage { margin-top: 0; } }

/* slow light rays behind the item */
.evp-stage-rays {
  position: absolute;
  top: 0;
  left: 50%;
  width: 380px;
  height: 380px;
  margin-left: -190px;
  margin-top: -36px;
  border-radius: 50%;
  background: repeating-conic-gradient(from var(--ev-angle, 0deg), rgba(var(--ev-rgb), 0.11) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%);
  mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: evAngle 40s linear infinite;
  pointer-events: none;
}

.evp-stage-day {
  position: relative;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ev-b);
}

.evp-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.evp-item:disabled { cursor: default; }

.evp-item img,
.evp-item svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 34px rgba(var(--ev-rgb), 0.4));
  transition: transform 0.4s var(--ev-ease), filter 0.4s ease;
}

.evp-item::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 80%;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--ev-rgb), 0.55), transparent);
  filter: blur(6px);
}

.evp-stage.is-ready .evp-item,
.evp-stage.is-gated .evp-item { animation: evFloat 3.4s ease-in-out infinite; }
.evp-stage.is-ready .evp-item:hover img,
.evp-stage.is-ready .evp-item:hover svg { transform: scale(1.05) rotate(-2deg); }

.evp-stage.is-locked .evp-item img,
.evp-stage.is-locked .evp-item svg { filter: grayscale(0.4) brightness(0.62) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6)); }

.evp-stage.is-done .evp-item img,
.evp-stage.is-done .evp-item svg { filter: brightness(0.45) saturate(0.6); }

/* while the reveal plays over the page, the stage's own item steps back */
.evp-stage.is-opening .evp-item { opacity: 0; transition: opacity 0.25s ease; }

.evp-stage-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.evp-stage-note {
  margin: 0;
  max-width: 34ch;
  font-size: 12.5px;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.45);
}

.evp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ev-ease), filter 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.evp-btn svg { width: 18px; height: 18px; }
.evp-btn:disabled { cursor: default; opacity: 0.55; }

.evp-btn--primary {
  color: #1a0d03;
  background: linear-gradient(180deg, var(--ev-b) 0%, var(--ev-a) 100%);
  box-shadow: 0 14px 32px -14px rgba(var(--ev-rgb), 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-event="christmas"] .evp-btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #ff6b76 0%, var(--ev-a) 100%);
}

.evp-btn--primary:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.07); }

.evp-btn--discord {
  color: #fff;
  background: #5865f2;
  box-shadow: 0 14px 30px -14px rgba(88, 101, 242, 0.9);
}

.evp-btn--discord:hover { transform: translateY(-2px); filter: brightness(1.08); }

.evp-btn--ghost {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.evp-btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.evp-btn:focus-visible,
.evp-day:focus-visible,
.evp-tab:focus-visible {
  outline: 2px solid var(--ev-c);
  outline-offset: 3px;
}

/* the reward, revealed where the item was */
.evp-reward {
  position: relative;
  width: min(100%, 360px);
  padding: 22px 20px 18px;
  border-radius: 18px;
  text-align: center;
  --tier: var(--ev-common);
  background:
    radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--tier) 26%, transparent) 0%, transparent 70%),
    rgba(12, 12, 15, 0.85);
  border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier) 12%, transparent), 0 24px 50px -24px color-mix(in srgb, var(--tier) 70%, transparent);
  animation: evReveal 0.6s var(--ev-ease) both;
}

@keyframes evReveal {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
}

.evp-reward[data-rarity="rare"]      { --tier: var(--ev-rare); }
.evp-reward[data-rarity="epic"]      { --tier: var(--ev-epic); }
.evp-reward[data-rarity="legendary"] { --tier: var(--ev-legendary); }

.evp-rarity {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  --tier: var(--ev-common);
  background: color-mix(in srgb, var(--tier) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent);
  color: var(--tier);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.evp-rarity[data-rarity="rare"]      { --tier: var(--ev-rare); }
.evp-rarity[data-rarity="epic"]      { --tier: var(--ev-epic); }
.evp-rarity[data-rarity="legendary"] { --tier: var(--ev-legendary); }

.evp-reward-title {
  display: block;
  margin-top: 12px;
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1 !important;
}

.evp-reward-sub {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.evp-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 6px 6px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.evp-code code {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evp-copy {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.evp-reward-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
}

.evp-reward-note a { color: var(--ev-b); }

/* stage buttons sit side by side when there are two */
.evp-stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* "this is the button" - when someone taps a locked day or the item */
.evp-btn.is-nudged { animation: evBtnNudge 0.7s var(--ev-ease); }

@keyframes evBtnNudge {
  0%, 100% { transform: none; }
  25%      { transform: translateY(-3px) scale(1.04); box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.35), 0 16px 34px -12px rgba(88, 101, 242, 0.9); }
  60%      { transform: translateY(0) scale(1); }
}

/* ── calendar ── */

.evp-cal { padding: 26px 18px 22px; }

@media (min-width: 768px) { .evp-cal { padding: 34px 32px 30px; } }

.evp-cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 22px;
}

.evp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.evp-legend li { display: inline-flex; align-items: center; gap: 7px; }

.evp-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.evp-legend .is-today i   { background: var(--ev-a); box-shadow: 0 0 8px var(--ev-a); }
.evp-legend .is-claimed i { background: #3ec98a; }
.evp-legend .is-missed i  { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); }

/* Six across: the regular days always fill whole rows (30 = 5 x 6 for
   Halloween, 24 = 4 x 6 for Christmas), and the finale gets the full
   width at the end. Three across on a phone - the same arithmetic. */
.evp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

@media (min-width: 640px)  { .evp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; } }
@media (min-width: 1100px) { .evp-grid { gap: 14px; } }

.evp-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 132px;
  padding: 12px 6px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%);
  color: #fff;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s var(--ev-ease), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 1100px) { .evp-day { min-height: 168px; padding-top: 14px; } }

.evp-day-no {
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.evp-day-date {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
}

.evp-day-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 2px 0;
}

@media (min-width: 1100px) { .evp-day-art { width: 82px; height: 82px; } }

.evp-day-art img,
.evp-day-art svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s var(--ev-ease), filter 0.35s ease;
}

.evp-day-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evp-day-state svg { width: 11px; height: 11px; flex: none; }

/* LOCKED - not yet: darkened, desaturated, a small lock */
.evp-day.is-locked .evp-day-art img,
.evp-day.is-locked .evp-day-art svg { filter: grayscale(0.9) brightness(0.38); }
.evp-day.is-locked:hover { transform: translateY(-1px); }

/* PAST - gone, and we do not know (visitor not signed in) */
.evp-day.is-past .evp-day-art img,
.evp-day.is-past .evp-day-art svg { filter: grayscale(0.6) brightness(0.55); }

/* MISSED - signed in, gone, never opened */
.evp-day.is-missed { background: rgba(255, 255, 255, 0.012); border-style: dashed; }
.evp-day.is-missed .evp-day-art img,
.evp-day.is-missed .evp-day-art svg { filter: grayscale(1) brightness(0.3); opacity: 0.7; }

/* CLAIMED - opened: dimmed, with a check and what was inside */
.evp-day.is-claimed .evp-day-art img,
.evp-day.is-claimed .evp-day-art svg { filter: brightness(0.5) saturate(0.6); }

.evp-day.is-claimed .evp-day-state { color: #57d99b; background: rgba(62, 201, 138, 0.12); }

.evp-day-check {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3ec98a;
  color: #06140d;
  box-shadow: 0 0 0 3px rgba(12, 12, 15, 0.9), 0 6px 14px -4px rgba(62, 201, 138, 0.8);
}

.evp-day-check svg { width: 13px; height: 13px; }

/* TODAY - the strongest thing on the page */
.evp-day.is-today {
  border-color: rgba(var(--ev-rgb), 0.65);
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(var(--ev-rgb), 0.22) 0%, transparent 75%),
    rgba(var(--ev-rgb), 0.05);
  box-shadow: 0 0 0 1px rgba(var(--ev-rgb), 0.25), 0 18px 40px -18px rgba(var(--ev-rgb), 0.9);
}

.evp-day.is-today .evp-day-no { color: var(--ev-b); }
.evp-day.is-today .evp-day-state { color: #1a0d03; background: linear-gradient(180deg, var(--ev-b), var(--ev-a)); }
html[data-event="christmas"] .evp-day.is-today .evp-day-state { color: #fff; }

.evp-day.is-today .evp-day-art img,
.evp-day.is-today .evp-day-art svg {
  filter: drop-shadow(0 8px 16px rgba(var(--ev-rgb), 0.6));
  animation: evFloat 2.8s ease-in-out infinite;
}

.evp-day.is-today:hover { transform: translateY(-3px); }
.evp-day.is-today:hover .evp-day-art img,
.evp-day.is-today:hover .evp-day-art svg { transform: scale(1.08) rotate(-3deg); }

/* a soft ring that keeps pulsing out of today's cell */
.evp-day.is-today::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(var(--ev-rgb), 0.6);
  animation: evRing 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes evRing {
  0%   { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

.evp-day.is-nudged { animation: evNo 0.4s ease; }

@keyframes evNo {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* the finale: the full last row */
.evp-day--finale {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: flex-start;
  gap: 16px;
  min-height: 0;
  padding: 16px 18px;
  text-align: left;
  background:
    radial-gradient(60% 140% at 0% 50%, rgba(var(--ev-rgb), 0.14) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%);
}

.evp-day--finale .evp-day-art { width: 84px; height: 84px; flex: none; }

/* the finale stays special even while it is locked: a warm edge, and its
   item only half in shadow so there is something to look forward to */
.evp-day--finale.is-locked {
  border-color: rgba(var(--ev-rgb), 0.28);
  box-shadow: inset 0 0 0 1px rgba(var(--ev-rgb), 0.08), 0 18px 40px -26px rgba(var(--ev-rgb), 0.7);
}

.evp-day--finale.is-locked .evp-day-art img,
.evp-day--finale.is-locked .evp-day-art svg {
  filter: grayscale(0.35) brightness(0.62) drop-shadow(0 0 18px rgba(var(--ev-rgb), 0.35));
}

.evp-day--finale.is-locked .evp-day-no { color: var(--ev-b); }

@media (min-width: 1100px) {
  .evp-day--finale { min-height: 0; padding: 18px 26px; }
  .evp-day--finale .evp-day-art { width: 108px; height: 108px; }
}

.evp-finale-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.evp-finale-title {
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1 !important;
}

.evp-finale-text {
  font-size: 12.5px;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) { .evp-finale-title { font-size: 24px; } }

.evp-day-teaser {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ev-c);
  box-shadow: 0 0 8px var(--ev-c);
}

/* ── loot ── */

.evp-loot { padding: 26px 18px; }

@media (min-width: 768px) { .evp-loot { padding: 34px 32px; } }

.evp-tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

@media (min-width: 900px) { .evp-tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

.evp-tier {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 15px;
  border-radius: 15px;
  --tier: var(--ev-common);
  border: 1px solid color-mix(in srgb, var(--tier) 26%, transparent);
  background:
    radial-gradient(100% 80% at 0% 0%, color-mix(in srgb, var(--tier) 14%, transparent) 0%, transparent 70%),
    rgba(255, 255, 255, 0.02);
  transition: transform 0.3s var(--ev-ease), border-color 0.3s ease;
}

.evp-tier:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tier) 50%, transparent); }
.evp-tier[data-rarity="rare"]      { --tier: var(--ev-rare); }
.evp-tier[data-rarity="epic"]      { --tier: var(--ev-epic); }
.evp-tier[data-rarity="legendary"] { --tier: var(--ev-legendary); }

.evp-tier ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evp-tier li {
  font-size: 12.5px;
  line-height: 1.4 !important;
  color: rgba(255, 255, 255, 0.72);
}

.evp-tier[data-rarity="legendary"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 220, 140, 0.12) 48%, transparent 66%);
  background-size: 250% 100%;
  animation: evShine 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes evShine {
  0%   { background-position: 140% 0; }
  60%, 100% { background-position: -60% 0; }
}

/* ── prize board ── */

.evp-board { padding: 26px 18px 22px; }

@media (min-width: 768px) { .evp-board { padding: 34px 32px 30px; } }

.evp-board-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.evp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.evp-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.evp-tab b {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
}

.evp-tab[aria-selected="true"] {
  color: #1a0d03;
  background: linear-gradient(180deg, var(--ev-b), var(--ev-a));
}

html[data-event="christmas"] .evp-tab[aria-selected="true"] { color: #fff; }
.evp-tab[aria-selected="true"] b { color: rgba(26, 13, 3, 0.6); }
html[data-event="christmas"] .evp-tab[aria-selected="true"] b { color: rgba(255, 255, 255, 0.7); }

.evp-board-list {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 640px)  { .evp-board-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .evp-board-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }

.evp-win {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border-radius: 15px;
  --tier: var(--ev-common);
  border: 1px solid color-mix(in srgb, var(--tier) 26%, transparent);
  background:
    radial-gradient(100% 90% at 100% 100%, color-mix(in srgb, var(--tier) 12%, transparent) 0%, transparent 70%),
    rgba(255, 255, 255, 0.02);
  animation: evReveal 0.5s var(--ev-ease) both;
}

.evp-win[data-rarity="rare"]      { --tier: var(--ev-rare); }
.evp-win[data-rarity="epic"]      { --tier: var(--ev-epic); }
.evp-win[data-rarity="legendary"] { --tier: var(--ev-legendary); }

.evp-win-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.evp-win-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--tier);
  background: color-mix(in srgb, var(--tier) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier) 28%, transparent);
}

.evp-win-icon svg { width: 18px; height: 18px; }

.evp-win-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25 !important;
}

.evp-win-meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
}

.evp-empty {
  grid-column: 1 / -1;
  padding: 22px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.evp-rules {
  margin: 0;
  padding: 0 4px;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.evp-alert {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 77, 79, 0.1);
  border: 1px solid rgba(255, 77, 79, 0.3);
  font-size: 12.5px;
  color: #ffb3b4;
}


/* ── 6  MOTION, RESPONSIVENESS ─────────────────────────────────────── */

@media (max-width: 767px) {
  /* nothing in the corners that could crowd the menu button */
  .ev-decor .ev-web { width: 92px; opacity: 0.8; }
  .ev-sit { display: none; }
  .evp-item { width: 170px; height: 170px; }
  .evp-stage-rays { width: 300px; height: 300px; margin-left: -150px; }
  .evp-clock-time { font-size: 26px; }
  .evp-day-state { font-size: 8.5px; letter-spacing: 0.06em; padding: 2px 6px; }
}

/* Reduced motion. Windows maps its "Animation effects" switch onto this
   query and this store runs with it off - the same reason custom.css keeps
   its hover effects and the slowly turning feedback card. So two things
   are deliberately NOT stopped here:
     · the slow sunbursts - the navbar wheel and the rays behind the item:
       small, slow and the whole point of the look
     · the reveal (.evx) - it plays because the visitor clicked "open", it
       is not ambient motion
   Everything that drifts across the page - decorations, embers, snow, the
   splash - still stops. */
@media (prefers-reduced-motion: reduce) {
  /* the splash's own failsafe fade is NOT listed here - it is what takes
     the splash down if events.js never runs, motion or no motion */
  .ev-splash *,
  .ev-hang,
  .ev-sit::before,
  .ev-lights .ev-bulb,
  .evp-chip--live i,
  .evp-day.is-today .evp-day-art img,
  .evp-day.is-today .evp-day-art svg,
  .evp-day.is-today::after,
  .evp-stage.is-ready .evp-item,
  .evp-tier::after {
    animation: none !important;
  }
  .ev-splash { transition: opacity 0.2s ease; }
  /* moving decorations are not built at all - see events.js */
}


/* ── reworked page: clock hint, loot chances, special days, haul ───── */

.evp-clock-hint {
  max-width: 38ch;
  font-size: 12px;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.45);
}

.evp-loot-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.evp-tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.evp-tier-chance {
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--tier);
  font-variant-numeric: tabular-nums;
}

.evp-h3 {
  margin: 24px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.evp-specials {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) { .evp-specials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.evp-special {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  --tier: var(--ev-common);
  border: 1px solid color-mix(in srgb, var(--tier) 30%, transparent);
  background: color-mix(in srgb, var(--tier) 6%, transparent);
}

.evp-special[data-rarity="rare"]      { --tier: var(--ev-rare); }
.evp-special[data-rarity="epic"]      { --tier: var(--ev-epic); }
.evp-special[data-rarity="legendary"] { --tier: var(--ev-legendary); }

.evp-special-day {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tier);
}

.evp-special-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.evp-special-prize {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

/* codes in the haul list */
.evp-code--small { margin-top: 4px; padding: 4px 4px 4px 10px; }
.evp-code--small code { font-size: 13px; }
.evp-code--small .evp-copy { height: 28px; padding: 0 10px; }

/* test mode: every day is a button */
.evp-day.is-testable { cursor: pointer; }
.evp-day.is-testable:hover { transform: translateY(-2px); border-color: rgba(255, 214, 94, 0.45); }

/* test mode: "preview a drop" - one button per rarity */
.evp-test-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.evp-test-preview em {
  margin-right: 4px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

.evp-test-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  --tier: var(--ev-common);
  border: 1px solid color-mix(in srgb, var(--tier) 50%, transparent);
  background: color-mix(in srgb, var(--tier) 12%, transparent);
  color: var(--tier);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.evp-test-chip[data-rarity="rare"]      { --tier: var(--ev-rare); }
.evp-test-chip[data-rarity="epic"]      { --tier: var(--ev-epic); }
.evp-test-chip[data-rarity="legendary"] { --tier: var(--ev-legendary); }
.evp-test-chip:hover { background: color-mix(in srgb, var(--tier) 22%, transparent); }

/* what a code needs - minimum basket, end date - wherever a prize shows */
.evp-reward-terms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.evp-reward-terms li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.evp-reward-terms li.is-key {
  border-color: color-mix(in srgb, var(--tier) 50%, transparent);
  background: color-mix(in srgb, var(--tier) 12%, transparent);
  color: #fff;
}

.evp-reward .evp-btn { width: 100%; margin-top: 14px; }

.evp-tier li small,
.evp-special-prize small {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
}

.evp-win-terms {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}


/* ── 7  THE REVEAL ───────────────────────────────────────────────────
   Opening an item plays out over the whole page, like an egg hatch: the
   item flies from the stage to the middle of the screen, shakes three
   times - harder each time, glowing in the colour of what is inside -
   bursts in a flash, and the prize card rises out of the light with the
   sunburst turning behind it. A click during the shake skips to the card.

   Built by events.js (EventPage.reveal). Phases are classes on .evx:
     is-in        on screen: the item arrives and the shake runs
     is-waiting   the shake is over but the server has not answered yet
     is-burst     the flash
     is-revealed  the card
     is-leaving   fading out
   --tier is the prize's colour: common keeps the event's own.          */

html.evx-open { overflow: hidden; }

.evx {
  --tier: var(--ev-a);
  --tier-rgb: var(--ev-rgb);   /* the same colour as numbers - see evxItemCharge */
  --evx-item: min(300px, 64vw);
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;     /* a short phone can still scroll to the button */
  padding: 72px 16px 40px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.evx[data-rarity="rare"]      { --tier: var(--ev-rare); --tier-rgb: 79, 163, 255; }
.evx[data-rarity="epic"]      { --tier: var(--ev-epic); --tier-rgb: 180, 107, 255; }
.evx[data-rarity="legendary"] { --tier: #ffd24d; --tier-rgb: 255, 210, 77; }

.evx.is-in { opacity: 1; }
.evx.is-leaving { opacity: 0; transition-duration: 0.25s; }

/* the page sinks into the night, lit from the middle */
.evx-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(55% 45% at 50% 48%, color-mix(in srgb, var(--tier) 20%, transparent) 0%, transparent 72%),
    radial-gradient(130% 100% at 50% 50%, rgba(12, 7, 5, 0.8) 0%, rgba(3, 2, 2, 0.97) 72%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* low fog drifting along the bottom - purple and pumpkin, or frost */
.evx-fog {
  position: fixed;
  left: -10%;
  right: -10%;
  bottom: -12%;
  height: 46%;
  background:
    radial-gradient(48% 60% at 28% 100%, rgba(150, 90, 220, 0.2), transparent 70%),
    radial-gradient(44% 55% at 76% 100%, rgba(var(--ev-rgb), 0.18), transparent 70%);
  filter: blur(18px);
  animation: evxFog 9s ease-in-out infinite alternate;
  pointer-events: none;
}

html[data-event="christmas"] .evx-fog {
  background:
    radial-gradient(48% 60% at 28% 100%, rgba(170, 210, 255, 0.16), transparent 70%),
    radial-gradient(44% 55% at 76% 100%, rgba(var(--ev-rgb), 0.15), transparent 70%);
}

@keyframes evxFog { to { transform: translateX(4%) scale(1.06); } }

/* embers / snow inside the reveal, over the backdrop */
.evx .ev-particles { position: fixed; z-index: 1; }

/* the sunburst - the event page's rays, big, in the prize's colour, with a
   finer second wheel turning the other way */
.evx-rays {
  --rs: min(1200px, 165vmax);
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: var(--rs);
  height: var(--rs);
  margin: calc(var(--rs) / -2) 0 0 calc(var(--rs) / -2);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.7s ease, transform 1.1s var(--ev-ease);
  pointer-events: none;
}

.evx-rays::before,
.evx-rays::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.evx-rays::before {
  background: repeating-conic-gradient(color-mix(in srgb, var(--tier) 32%, transparent) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, transparent 5%, #000 15%, rgba(0, 0, 0, 0.55) 32%, transparent 58%);
  mask: radial-gradient(circle, transparent 5%, #000 15%, rgba(0, 0, 0, 0.55) 32%, transparent 58%);
  animation: evSpin 36s linear infinite;
}

.evx-rays::after {
  background: repeating-conic-gradient(color-mix(in srgb, var(--tier) 16%, transparent) 0deg 3deg, transparent 3deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 8%, #000 18%, transparent 44%);
  mask: radial-gradient(circle, transparent 8%, #000 18%, transparent 44%);
  animation: evSpin 54s linear infinite reverse;
}

.evx.is-in .evx-rays { opacity: 0.3; transform: scale(0.7); }
.evx.is-burst .evx-rays,
.evx.is-revealed .evx-rays { opacity: 1; transform: none; }

/* the light gathering behind the item while it shakes */
.evx-glow {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(560px, 120vw);
  height: min(560px, 120vw);
  margin: calc(min(560px, 120vw) / -2) 0 0 calc(min(560px, 120vw) / -2);
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tier) 58%, transparent), color-mix(in srgb, var(--tier) 18%, transparent) 55%, transparent);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

.evx.is-in .evx-glow { animation: evxCharge 3s ease-in forwards; }
.evx.is-burst .evx-glow,
.evx.is-revealed .evx-glow { animation: evxSettle 1.2s ease-out forwards; }

@keyframes evxCharge {
  0%   { opacity: 0; transform: scale(0.5); }
  25%  { opacity: 0.4; transform: scale(0.75); }
  100% { opacity: 1; transform: scale(1.15); }
}

@keyframes evxSettle {
  0%   { opacity: 1; transform: scale(1.35); }
  100% { opacity: 0.5; transform: scale(1.05); }
}

/* the item: arrives from where it sat on the stage (--fx/--fy/--fs, set
   by events.js), then the egg-hatch shake - three bursts, each harder,
   rocking on its base */
.evx-item {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: var(--evx-item);
  height: var(--evx-item);
  margin: calc(var(--evx-item) / -2) 0 0 calc(var(--evx-item) / -2);
  transform-origin: 50% 88%;
  opacity: 0;
  pointer-events: none;
}

.evx-item > img,
.evx-item > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.55));
}

.evx.is-in .evx-item {
  animation:
    evxArrive 0.65s var(--ev-ease) forwards,
    evxHatch 2.25s linear 0.75s forwards;
}

.evx.is-in .evx-item > img,
.evx.is-in .evx-item > svg { animation: evxItemCharge 2.25s ease-in 0.75s forwards; }

@keyframes evxArrive {
  from { opacity: 0.5; transform: translate(var(--fx, 0px), var(--fy, 60px)) rotate(0deg) scale(var(--fs, 0.4)); }
  to   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
}

@keyframes evxHatch {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  4%   { transform: translate(0, 0) rotate(-7deg) scale(1); }
  9%   { transform: translate(0, 0) rotate(7deg) scale(1); }
  14%  { transform: translate(0, 0) rotate(-4deg) scale(1); }
  18%  { transform: translate(0, 0) rotate(0deg) scale(1); }
  32%  { transform: translate(0, 0) rotate(0deg) scale(1); }
  35%  { transform: translate(0, -12px) rotate(-11deg) scale(1.03); }
  39%  { transform: translate(0, 0) rotate(11deg) scale(1.03); }
  43%  { transform: translate(0, -4px) rotate(-9deg) scale(1.03); }
  47%  { transform: translate(0, 0) rotate(8deg) scale(1.03); }
  52%  { transform: translate(0, 0) rotate(0deg) scale(1.03); }
  62%  { transform: translate(0, 0) rotate(0deg) scale(1.05); }
  65%  { transform: translate(-9px, 0) rotate(-14deg) scale(1.07); }
  68%  { transform: translate(9px, 0) rotate(14deg) scale(1.08); }
  71%  { transform: translate(-10px, 0) rotate(-15deg) scale(1.09); }
  74%  { transform: translate(10px, 0) rotate(15deg) scale(1.1); }
  77%  { transform: translate(-10px, 0) rotate(-15deg) scale(1.11); }
  80%  { transform: translate(10px, 0) rotate(15deg) scale(1.12); }
  83%  { transform: translate(-9px, 0) rotate(-13deg) scale(1.13); }
  86%  { transform: translate(9px, 0) rotate(13deg) scale(1.14); }
  89%  { transform: translate(-7px, 0) rotate(-10deg) scale(1.15); }
  92%  { transform: translate(7px, 0) rotate(10deg) scale(1.16); }
  95%  { transform: translate(-4px, 0) rotate(-6deg) scale(1.17); }
  100% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.18); }
}

/* rgba(), not color-mix(): Chrome interpolates a shadow colour that moves
   from black to a color-mix() in oklab and lands on garbage - the glow
   came out green. Plain rgba() interpolates in sRGB and stays true. */
@keyframes evxItemCharge {
  0%   { filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.55)) brightness(1); }
  60%  { filter: drop-shadow(0 0 18px rgba(var(--tier-rgb), 0.7)) brightness(1.12); }
  100% { filter: drop-shadow(0 0 44px rgba(var(--tier-rgb), 1)) brightness(1.45); }
}

/* the server is slow: keep trembling, at full charge, until it answers */
.evx.is-waiting .evx-item { animation: evxTremble 0.16s linear infinite alternate; opacity: 1; }

@keyframes evxTremble {
  from { transform: translate(-4px, 0) rotate(-6deg) scale(1.18); }
  to   { transform: translate(4px, 0) rotate(6deg) scale(1.18); }
}

/* the burst: the item swells and goes white, a ring, a flash */
.evx.is-burst .evx-item,
.evx.is-revealed .evx-item { animation: evxPop 0.45s cubic-bezier(0.4, 0, 1, 1) forwards; }

.evx.is-burst .evx-item > img,
.evx.is-burst .evx-item > svg,
.evx.is-revealed .evx-item > img,
.evx.is-revealed .evx-item > svg { animation: evxWhiteOut 0.45s ease-in forwards; }

@keyframes evxPop {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.18); }
  40%  { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.38); }
  100% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(1.9); }
}

@keyframes evxWhiteOut {
  from { filter: drop-shadow(0 0 44px rgba(var(--tier-rgb), 1)) brightness(1.45); }
  to   { filter: drop-shadow(0 0 60px rgba(var(--tier-rgb), 1)) brightness(3); }
}

.evx-ring {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  border: 3px solid var(--tier);
  box-shadow: 0 0 30px var(--tier), inset 0 0 30px var(--tier);
  opacity: 0;
  pointer-events: none;
}

.evx.is-burst .evx-ring { animation: evxRing 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }

@keyframes evxRing {
  0%   { opacity: 0.9; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(3.2); }
}

.evx-flash {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: radial-gradient(circle at 50% 50%, #fff 0%, color-mix(in srgb, var(--tier) 70%, #fff) 16%, color-mix(in srgb, var(--tier) 35%, transparent) 40%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.evx.is-burst .evx-flash { animation: evxFlash 0.75s ease-out forwards; }

@keyframes evxFlash {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  100% { opacity: 0; }
}

/* what flies out: confetti, and bats or stars. events.js sets each piece's
   path (--x/--y out, --x2/--y2 where it falls to) and its look */
.evx-bits {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 0;
  height: 0;
  pointer-events: none;
}

.evx-bit {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2);
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  animation: evxFly var(--d) cubic-bezier(0.12, 0.7, 0.3, 1) var(--delay, 0s) forwards;
}

@keyframes evxFly {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.5); }
  55%  { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
  100% { opacity: 0; transform: translate(var(--x2), var(--y2)) rotate(var(--r2)) scale(0.9); }
}

.evx-bit--round { border-radius: 50%; box-shadow: 0 0 8px var(--c); }
.evx-bit--star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

.evx-bit--bat {
  height: auto;
  margin-top: -10px;
  background: none;
  color: #241a14;
  filter: drop-shadow(0 0 1px rgba(255, 190, 120, 0.85)) drop-shadow(0 0 10px rgba(var(--ev-rgb), 0.55));
}

.evx-bit--bat svg {
  display: block;
  width: 100%;
  transform-origin: 50% 40%;
  animation: evxFlap 0.16s ease-in-out infinite alternate;
}

@keyframes evxFlap { to { transform: scaleY(0.5); } }

/* "click to skip" while it shakes */
.evx-skip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 6;
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.evx.is-in .evx-skip { opacity: 1; transition-delay: 1.1s; }
.evx.is-burst .evx-skip,
.evx.is-revealed .evx-skip { opacity: 0; transition-delay: 0s; }

.evx-x {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.2s ease;
}

.evx-x svg { width: 18px; height: 18px; }
.evx-x:hover { background: rgba(255, 255, 255, 0.12); }
.evx.is-revealed .evx-x { opacity: 1; pointer-events: auto; }

/* ── the card ── */

.evx-card {
  position: relative;
  z-index: 3;
  width: min(440px, 100%);
  margin: auto;              /* centred, and still reachable when taller than the screen */
  padding: 30px 26px 20px;
  overflow: hidden;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--tier) 24%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, rgba(26, 17, 12, 0.9) 0%, rgba(10, 8, 8, 0.94) 100%);
  border: 1px solid color-mix(in srgb, var(--tier) 48%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 40px 90px -30px rgba(0, 0, 0, 0.95),
    0 0 90px -20px color-mix(in srgb, var(--tier) 60%, transparent);
  visibility: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.9);
}

html[data-event="christmas"] .evx-card {
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--tier) 24%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, rgba(24, 12, 15, 0.9) 0%, rgba(9, 7, 9, 0.94) 100%);
}

.evx.is-revealed .evx-card {
  visibility: visible;
  animation: evxCardIn 0.75s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

@keyframes evxCardIn { to { opacity: 1; transform: none; } }

/* the card's contents rise one after another (--i is the order) */
.evx-card .evx-in { opacity: 0; transform: translateY(12px); }

.evx.is-revealed .evx-card .evx-in {
  animation: evxUp 0.55s var(--ev-ease) forwards;
  animation-delay: calc(0.15s + var(--i, 0) * 0.07s);
}

@keyframes evxUp { to { opacity: 1; transform: none; } }

/* a cobweb in the card's corner - halloween only */
.evx-card .ev-web {
  position: absolute;
  top: 0;
  right: 0;
  width: 130px;
  color: rgba(255, 255, 255, 0.1);
  transform: scaleX(-1);
  pointer-events: none;
}

/* legendary: a slow sheen across the whole card */
.evx[data-rarity="legendary"] .evx-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 232, 160, 0.16) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: evShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.evx-rarity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tier) 55%, transparent);
  background: color-mix(in srgb, var(--tier) 15%, transparent);
  color: var(--tier);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.evx-rarity svg { width: 13px; height: 13px; }

/* the number - huge, lit from above in the prize's colour, with a glint
   running across it */
.evx-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  line-height: 0.85 !important;
}

.evx-amount b {
  font-size: clamp(78px, 24vw, 116px);
  font-weight: 900;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  background:
    linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.95) 50%, transparent 60%),
    linear-gradient(180deg, #fff 0%, #fff 34%, color-mix(in srgb, var(--tier) 65%, #fff) 66%, var(--tier) 100%);
  background-size: 260% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 26px color-mix(in srgb, var(--tier) 55%, transparent));
}

.evx.is-revealed .evx-amount b { animation: evxGlint 3.4s ease-in-out 1s infinite; }

@keyframes evxGlint {
  0%        { background-position: 120% 0, 0 0; }
  45%, 100% { background-position: -20% 0, 0 0; }
}

.evx-amount span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-weight: 900;
}

.evx-amount i {
  font-style: normal;
  font-size: clamp(36px, 10vw, 50px);
  color: #fff;
  line-height: 0.85 !important;
}

.evx-amount small {
  font-size: clamp(18px, 5vw, 24px);
  letter-spacing: 0.08em;
  color: var(--tier);
  line-height: 1 !important;
}

.evx-amount--text b { font-size: clamp(34px, 9vw, 46px); letter-spacing: -0.02em; }

.evx-title {
  margin: 14px 0 0;
  font-family: "Montserrat", "Poppins", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3 !important;
}

.evx-sub {
  max-width: 34ch;
  margin: 8px auto 0;
  font-size: 13.5px;
  line-height: 1.55 !important;
  color: rgba(255, 255, 255, 0.62);
}

.evx-terms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.evx-terms li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

.evx-terms li svg { width: 12px; height: 12px; color: var(--tier); }

.evx-terms li.is-key {
  border-color: color-mix(in srgb, var(--tier) 55%, transparent);
  background: color-mix(in srgb, var(--tier) 14%, transparent);
  color: #fff;
}

.evx-code-label {
  display: block;
  margin-top: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.evx-code {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--tier) 60%, transparent);
  background: rgba(0, 0, 0, 0.35);
}

.evx-code code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
}

.evx-copy {
  flex: none;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.evx-copy:hover { background: rgba(255, 255, 255, 0.16); }
.evx-copy.is-done { background: color-mix(in srgb, var(--tier) 35%, transparent); }

.evx-cta {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ev-b) 0%, var(--ev-a) 100%);
  color: #1a0d03;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 18px 40px -16px rgba(var(--ev-rgb), 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.25s var(--ev-ease), filter 0.25s ease;
}

html[data-event="christmas"] .evx-cta {
  color: #fff;
  background: linear-gradient(180deg, #ff6b76 0%, var(--ev-a) 100%);
}

.evx-cta svg { width: 18px; height: 18px; }
.evx-cta:hover { transform: translateY(-2px); filter: brightness(1.07); }

.evx-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: evShine 2.8s ease-in-out 1.4s infinite;
  pointer-events: none;
}

.evx-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.5);
}

.evx-back {
  margin-top: 4px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.evx-back:hover { color: #fff; }

.evx button:focus-visible,
.evx a:focus-visible {
  outline: 2px solid var(--tier);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .evx { padding: 64px 12px 28px; }
  .evx-card { padding: 26px 18px 16px; border-radius: 22px; }
  .evx-title { font-size: 14px; }
  .evx-code code { font-size: 16px; }
}
