/* The home and gallery pages' flashier look: big hero with a countdown strip,
   Live now banner, photo showcase and sponsor spotlight. Builds on /style.css. */

:root {
  --live: #ff3b4e;
  --glow: 0 0 24px rgba(124, 192, 255, 0.45);
}

/* ---------- 3. Live now banner ---------- */

.live-banner {
  position: sticky;
  top: var(--header-h, 0px);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #5b0011, #b3001f 50%, #5b0011);
  background-size: 200% 100%;
  animation: live-sweep 4s linear infinite;
  color: #fff;
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}
.live-banner[hidden] {
  display: none;
}
.live-banner b {
  font-weight: 800;
  white-space: nowrap;
}
.live-banner [data-live-vs] {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}
.live-banner .go {
  flex: none;
  padding: 3px 12px;
  border-radius: 99px;
  background: #fff;
  color: #b3001f;
  font-weight: 800;
}
.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.7);
  animation: live-pulse 1.4s ease-out infinite;
}
@keyframes live-pulse {
  to {
    box-shadow: 0 0 0 14px rgba(255, 59, 78, 0);
  }
}
@keyframes live-sweep {
  to {
    background-position: -200% 0;
  }
}

/* ---------- 1. Big hero ---------- */

.fx-hero {
  position: relative;
  margin: 0 calc(50% - 50vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: #000;
  text-align: center;
  /* Room left for the photo on the first screen (under the header, banner and countdown strip). */
  --photo-max-h: calc(100svh - var(--header-h, 80px) - var(--live-h, 0px) - var(--strip-h, 90px));
}
/* The whole photo shows, in its own shape: as wide as the screen, or narrower when the screen is short. */
.fx-hero .photo {
  position: relative;
  z-index: 1;
  width: min(100%, calc(var(--photo-max-h) * var(--ratio, 1.333)));
  aspect-ratio: var(--ratio, 1.333);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}
.fx-hero .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 50% 50%;
  animation: ken-burns 24s ease-in-out infinite alternate;
}
/* On wide screens, a blurred copy of the photo fills the sides. */
.fx-hero .backdrop {
  position: absolute;
  inset: -40px;
  background: var(--photo) 50% 50% / cover no-repeat;
  filter: blur(28px) brightness(0.45);
}
@keyframes ken-burns {
  /* A gentle zoom, so only a sliver of the edges comes and goes. */
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04);
  }
}
.fx-hero .content {
  position: relative;
  z-index: 1;
  width: 100%;
  animation: rise 0.9s ease-out both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}
@media (max-width: 699px) {
  .live-banner {
    gap: 8px;
    font-size: 1rem;
  }
}
/* The countdown: a thin strip along the bottom of the photo. */
.countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 18px;
  padding: 8px 16px;
  border-top: 1px solid rgba(124, 192, 255, 0.6);
  background: rgba(5, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  box-shadow: 0 -6px 22px rgba(61, 139, 255, 0.35);
}
.countdown[hidden] {
  display: none;
}
.countdown .info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 10px;
  min-width: 0;
}
.countdown .label {
  color: var(--accent);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.countdown .name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
}
.countdown .where {
  color: var(--muted);
  font-size: 0.9rem;
}
.countdown .clock {
  display: flex;
  gap: 6px;
  font-family: 'Barlow Condensed', sans-serif;
}
/* Small glowing blue boxes, one per number. */
.countdown .unit {
  display: inline-flex;
  align-items: baseline;
  padding: 1px 7px;
  border: 1px solid #2c5a9c;
  border-radius: 8px;
  background: linear-gradient(180deg, #1d3a66, #0d1d36);
  box-shadow: 0 0 12px rgba(61, 139, 255, 0.55);
}
.countdown .num {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.countdown .unit small {
  margin-left: 1px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}
/* Each number flips down like a ballpark scoreboard card when it changes. */
.countdown .clock {
  perspective: 500px;
}
.countdown .unit {
  position: relative;
  isolation: isolate;
}
/* The seam of a flip card, behind the number. */
.countdown .unit::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.45);
}
.countdown .num {
  display: inline-block;
  transform-origin: 50% 0;
}
.countdown .unit.flip .num {
  animation: flip-down 0.45s cubic-bezier(0.3, 1.4, 0.6, 1);
}
@keyframes flip-down {
  from {
    transform: rotateX(-95deg);
    opacity: 0.2;
  }
  60% {
    opacity: 1;
  }
}
.countdown.today .clock {
  display: none;
}
/* Phones: just the name and the clock (the Next up card below has the dates and place). */
@media (max-width: 699px) {
  .countdown {
    gap: 2px 14px;
    padding: 6px 12px;
  }
  .countdown .label,
  .countdown .where {
    display: none;
  }
  .countdown.today .label {
    display: inline;
  }
}

/* ---------- 5. Photo showcase ---------- */

.showcase {
  position: relative;
  margin: 28px 0 8px;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: var(--glow);
}
.showcase img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.2s ease, transform 6s ease;
}
.showcase img.on {
  opacity: 1;
  transform: scale(1);
}
.showcase .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-size: 0.95rem;
}
.showcase .dots {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 6px;
}
.showcase .dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.showcase .dots span.on {
  background: var(--accent);
}
.see-all {
  display: inline-block;
  margin: 4px 0 20px;
  padding: 10px 0;
  font-weight: 700;
}

/* Gallery page: tiles zoom on hover, every few photos a bigger one, fade in as they load. */
.fx-gallery .grid {
  grid-auto-flow: dense;
}
.fx-gallery .grid figure {
  overflow: hidden;
  border-radius: 14px;
  animation: rise 0.6s ease-out both;
}
.fx-gallery .grid figure img {
  transition: transform 0.5s ease, filter 0.5s ease;
}
.fx-gallery .grid figure:hover img,
.fx-gallery .grid figure:focus-visible img {
  transform: scale(1.08);
  filter: brightness(1.08);
}
@media (min-width: 700px) {
  .fx-gallery .grid figure:nth-child(7n + 1) {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* ---------- 7. Sponsor spotlight ---------- */

.sponsor {
  margin: 34px calc(50% - 50vw) 0;
  padding: 34px 16px 38px;
  text-align: center;
  background: radial-gradient(ellipse at center, #13284a 0%, #070b12 70%);
  border-top: 1px solid #1f3b66;
  border-bottom: 1px solid #1f3b66;
}
.sponsor .kicker {
  color: var(--accent);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sponsor .name {
  margin: 6px 0 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff, var(--accent), #fff);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
.sponsor .name img {
  max-height: 110px;
  margin: 0 auto;
}
.sponsor p {
  max-width: 560px;
  margin: 8px auto 0;
  color: var(--muted);
}
@keyframes shine {
  to {
    background-position: -200% 0;
  }
}

/* Headings and buttons get a little glow. */
.fx h2 {
  text-shadow: 0 0 18px rgba(124, 192, 255, 0.35);
}
.fx .btn.primary {
  box-shadow: 0 0 18px rgba(61, 139, 255, 0.5);
}

/* Things that slide in as they scroll into view. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
/* Finished tournaments stay faded after sliding in. */
.trow.past.reveal.in {
  opacity: 0.62;
}

/* Phones and people who prefer less motion: keep it still. */
@media (prefers-reduced-motion: reduce) {
  .fx-hero .bg,
  .fx-hero .content,
  .live-banner,
  .live-dot,
  .sponsor .name,
  .fx-gallery .grid figure {
    animation: none;
  }
  .showcase img,
  .reveal {
    transition: none;
  }
  .countdown .unit.flip .num {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* For screen readers only (the hero's page title). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Live scores in the countdown strip ---------- */

.strip-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #b3001f;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}
.strip-live[hidden] {
  display: none;
}
.strip-live .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.4s ease-out infinite;
}

/* Before the tournament starts: a quiet steel-blue "Coming soon" instead of the red live button. */
.strip-live.soon {
  background: #2a3a52;
  color: #c9d6ea;
  cursor: default;
}
.strip-live.soon .dot {
  background: #8fa3c0;
  animation: none;
}

/* ---------- The 3D logo at the top of the home page (/logo3d.js) ---------- */

:root {
  --stage-h: clamp(190px, 28vw, 320px);
}
.logo-stage {
  position: relative;
  height: var(--stage-h);
  margin: 0 calc(50% - 50vw);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse 60% 70% at 50% 55%, #0c2149 0%, #04091a 55%, #000 80%);
}
/* The still logo shows until the 3D one is drawn (and stays without 3D or with less motion). */
.logo-stage img {
  height: 80%;
  width: auto;
  max-width: 92%;
  object-fit: contain;
  /* The wordmark is drawn on black: fade its edges into the glow. */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
  transition: opacity 0.6s ease;
}
.logo-stage .logo-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  touch-action: pan-y; /* swiping up and down still scrolls */
  cursor: grab;
}
.logo-stage .logo-3d:active {
  cursor: grabbing;
}
.logo-stage.is-3d .logo-3d {
  opacity: 1;
}
.logo-stage.is-3d img {
  opacity: 0;
}
/* Keep the team photo and countdown on the first screen under the logo. */
.home .fx-hero {
  --photo-max-h: max(260px, calc(100svh - var(--header-h, 80px) - var(--live-h, 0px) - var(--strip-h, 90px) - var(--stage-h)));
}
/* The big logo is right there, so on the home page the header is just the menu, spread across. */
.home .site-header .brand {
  display: none;
}
.home .nav {
  width: 100%;
  justify-content: space-evenly;
}
@media (min-width: 641px) {
  .home .nav a {
    font-size: 1.25rem;
    padding: 4px 22px;
  }
}

/* ---------- Photo banner on the other pages (Info, Contact...) ---------- */

.page-hero {
  position: relative;
  margin: 0 calc(50% - 50vw) 18px;
  min-height: clamp(150px, 26vw, 260px);
  display: flex;
  align-items: flex-end;
  background: #000 var(--photo-small) var(--pos, 50% 45%) / cover no-repeat;
}
@media (min-width: 700px) {
  .page-hero {
    background-image: var(--photo);
  }
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.8));
}
.page-hero h1 {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 0 16px 16px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 0 22px rgba(124, 192, 255, 0.35);
}
