/* Shiny events in the Shiny Dex hero (js/components/event-cards.js). While an event is on, the
   hero becomes a starry night sky with a glowing horizon in the colours of that event's game,
   and the events sit in it without frames: big sprite with twinkling stars, then the text.
   Files in css/ load in name order (index.html); later files win on equal selectors. */

/* The hero while slides are shown: dark in both themes, like .banner. Its look comes from one
   background layer per slide (.ev-bg, from js/components/event-slides.js) that cross-fade, so a
   change of slide never jumps from one design to the next. */
.hero.ev-themed {
  --text: #fff; --muted: rgba(255, 255, 255, .74); --faint: rgba(255, 255, 255, .55);
  --surface-2: rgba(255, 255, 255, .07); --border: rgba(255, 255, 255, .13); --border-2: rgba(255, 255, 255, .24);
  color: var(--text); background: #060815; border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color .8s;
}
/* Before the first render (js/pages/home.js adds .ready) the hero's static HTML would show 0%,
   "Recommended" and the plain design for a moment: keep its content hidden, and paint it dark
   already when this device showed slides last time (html[data-hero-slides], set in index.html). */
#homeView .hero:not(.ready) > * { visibility: hidden; }
/* And keep the room the hero and the region tabs took last time (html[data-boot-sizes], index.html). */
html[data-boot-sizes] #homeView .hero:not(.ready) { min-height: var(--boot-hero-h); }
html[data-boot-sizes] #homeView #regions:empty { min-height: var(--boot-regions-h); }
html[data-hero-slides] #homeView .hero:not(.ready) {
  background: radial-gradient(120% 60% at 50% 120%, rgba(255, 255, 255, .06), transparent 60%), linear-gradient(#060815, #0a0f26);
  border-color: rgba(255, 255, 255, .13);
}
.ev-bgs { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ev-bg { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease-in-out; }
.ev-bg.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ev-bg, .hero.ev-themed { transition: none; } }
/* Default design: a night sky with a glowing horizon in the game's colours. */
.ev-bg {
  background:
    radial-gradient(120% 60% at 50% 120%, color-mix(in srgb, var(--accent2) 70%, transparent), transparent 60%),
    radial-gradient(80% 50% at 85% 110%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 70%),
    linear-gradient(#060815, #0a0f26);
}
/* Stars: small dots scattered over the sky. */
.ev-bg::before {
  content: ""; position: absolute; inset: 0; opacity: .9;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 25% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 12%, #fff, transparent), radial-gradient(1px 1px at 55% 40%, #fff, transparent),
    radial-gradient(2px 2px at 68% 15%, #fff, transparent), radial-gradient(1px 1px at 78% 55%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 30%, #fff, transparent), radial-gradient(1px 1px at 5% 85%, #fff, transparent),
    radial-gradient(1px 1px at 33% 45%, #fff, transparent), radial-gradient(1.5px 1.5px at 62% 80%, #fff, transparent),
    radial-gradient(1px 1px at 95% 75%, #fff, transparent), radial-gradient(1px 1px at 47% 92%, #fff, transparent);
}
.hero.ev-themed .hero-glow { display: none; }
.hero.ev-themed .hero-text, .hero.ev-themed .hero-side { z-index: 1; }
.hero.ev-themed .stat { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero.ev-themed .ring .track { stroke: rgba(255, 255, 255, .16); }

.up-next.events { width: 280px; }
.ev-list { display: block; }
.rec-head[hidden] { display: none; }
/* Slides share one grid cell: the block is as tall as the tallest slide, so switching never jumps. */
.ev-slides { display: grid; }
/* The old slide fades out first, then the new one fades in, so their text never overlaps; the
   background layers cross-fade underneath over the whole change. */
.ev-slide { grid-area: 1 / 1; display: grid; gap: 4px; align-content: center; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease, visibility 0s .35s; }
.ev-slide.on { opacity: 1; visibility: visible; transform: none; transition: opacity .5s ease .4s, transform .5s ease .4s, visibility 0s .4s; }
.ev-dots { display: flex; justify-content: center; gap: 2px; margin-top: 10px; }
.ev-dots button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; padding: 0; background: none; cursor: pointer; }
.ev-dots button::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .35); transition: width .3s, background .3s; }
.ev-dots button[aria-current="true"]::before { width: 20px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .ev-slide, .ev-slide.on { transition: none; transform: none; } }

/* One event: no frame, the sprite with a few twinkling stars, then the text. */
.ev-card { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 0; color: #fff; }
.ev-open { position: absolute; inset: 0; z-index: 1; border: 0; background: none; cursor: pointer; border-radius: 16px; }
.ev-open:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ev-art { position: relative; flex: none; width: 112px; height: 112px; pointer-events: none; transition: transform .25s; }
.ev-card:hover .ev-art { transform: translateY(-3px) scale(1.03); }
.ev-sprite { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); }
.ev-card.soon .ev-sprite { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)) brightness(.8); }
.ev-art i { position: absolute; font-style: normal; line-height: 1; color: #fff; text-shadow: 0 0 8px #fff; animation: ev-twinkle 2.4s ease-in-out infinite; }
.ev-art i:nth-child(2) { left: 4px; top: 12px; font-size: 16px; }
.ev-art i:nth-child(3) { right: 6px; bottom: 26px; font-size: 11px; animation-delay: .8s; }
.ev-art i:nth-child(4) { right: 16px; top: 4px; font-size: 9px; animation-delay: 1.6s; }
.ev-card.soon .ev-art i { opacity: .5; animation: none; }
@keyframes ev-twinkle { 50% { opacity: .25; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .ev-art i { animation: none; } }

.ev-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.ev-when { display: inline-flex; align-items: center; gap: 6px; font: 700 9.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.ev-when i { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .5; }
.ev-card.live .ev-when i { background: #2bd67b; opacity: 1; box-shadow: 0 0 8px #2bd67b; }
.ev-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
/* The game, in its own colours (lightened so it reads on the night sky). */
.ev-game {
  margin-top: -2px; font-size: 12px; font-weight: 800; letter-spacing: -.01em;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, #fff), color-mix(in srgb, var(--accent2) 65%, #fff));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ev-how { font-size: 11.5px; line-height: 1.3; color: rgba(255, 255, 255, .72); }
.ev-code, .ev-got {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 3px; max-width: 100%;
  padding: 6px 9px; border-radius: 9px; font: 700 11px/1 var(--mono); letter-spacing: .06em; color: #fff;
  background: rgba(0, 0, 0, .28); border: 1px dashed rgba(255, 255, 255, .4);
}
.ev-code svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ev-got { border-style: solid; border-color: rgba(43, 214, 123, .6); color: #b8f5d2; letter-spacing: .02em; font-family: inherit; }

@media (max-width: 900px) {
  .up-next.events { width: 100%; flex: 1; }
  .ev-slide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 560px) {
  /* Phones: the old compact hero, the ring with the slides beside it. One event per slide, laid
     out small: sprite and name side by side, the code below; the date line is left out. */
  .up-next.events { flex: 1; min-width: 0; width: auto; }
  .ev-slide { grid-template-columns: 1fr; }
  .ev-card { align-items: flex-start; flex-wrap: wrap; gap: 2px 8px; padding: 0; }
  .ev-art { width: 64px; height: 64px; }
  .ev-art i:nth-child(2) { font-size: 12px; left: 0; top: 4px; }
  .ev-body { flex: 1; min-width: 0; gap: 2px; padding-top: 4px; }
  .ev-when { font-size: 8.5px; letter-spacing: .04em; }
  .ev-name { font-size: 14.5px; }
  .ev-game { font-size: 11px; margin-top: 0; }
  .ev-how { display: none; }
  .ev-code, .ev-got { flex-basis: 100%; justify-content: center; margin-top: 4px; padding: 6px 6px; font-size: 10.5px; letter-spacing: .03em; }
  .ev-code svg { width: 12px; height: 12px; }
  .ev-dots { margin-top: 4px; }
  .ev-dots button { width: 30px; height: 26px; }
}
@media (hover: none) { .ev-card:hover .ev-art { transform: none; } }

/* A new game's release countdown: logos (or the name), then the days to go. */
.ev-release { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 0 6px; }
.rel-logos { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; }
/* Twinkling stars around the logos (same animation as the event sprites). */
.rel-logos i { position: absolute; font-style: normal; line-height: 1; color: #fff; text-shadow: 0 0 8px #fff; pointer-events: none; animation: ev-twinkle 2.4s ease-in-out infinite; }
.rel-logos i:nth-of-type(1) { left: -6px; top: -4px; font-size: 15px; }
.rel-logos i:nth-of-type(2) { right: -4px; top: 6px; font-size: 11px; animation-delay: .6s; }
.rel-logos i:nth-of-type(3) { left: 46%; bottom: -6px; font-size: 10px; animation-delay: 1.2s; }
.rel-logos i:nth-of-type(4) { right: 22%; top: -10px; font-size: 8px; animation-delay: 1.8s; }
@media (prefers-reduced-motion: reduce) { .rel-logos i { animation: none; } }
.rel-logos img { height: 64px; max-width: 132px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .5)); }
.rel-word {
  font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, #fff), color-mix(in srgb, var(--accent2) 65%, #fff));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rel-count { display: flex; align-items: baseline; gap: 8px; }
.rel-count b { font-size: 46px; font-weight: 800; letter-spacing: -.05em; line-height: .95; text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent); }
.rel-pre, .rel-unit { font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.rel-count .rel-out { font-size: 30px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
