:root {
  --bg: #07080f;
  --ink: #f5f3ec;
  --muted: #b9b6ab;
  --gold-1: #f9e6a6;
  --gold-2: #e2b452;
  --gold-3: #a8742a;
  --glass: rgba(18, 20, 34, 0.62);
  --glass-2: rgba(255, 255, 255, 0.06);
  --line: rgba(249, 230, 166, 0.18);
  --line-2: rgba(255, 255, 255, 0.10);
  --ok: #8fe3a8;
  --warn: #ffb27a;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- background slideshow ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.slide {
  position: absolute; inset: -4%; background: var(--img) center / cover no-repeat;
  opacity: 0; animation: show 20s infinite, drift 20s infinite;
}
@media (max-width: 700px) { .slide { background-image: var(--img-m); } }
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 4s; }
.slide:nth-child(3) { animation-delay: 8s; }
.slide:nth-child(4) { animation-delay: 12s; }
.slide:nth-child(5) { animation-delay: 16s; }
@keyframes show { 0% { opacity: 0 } 4% { opacity: 1 } 20% { opacity: 1 } 26% { opacity: 0 } 100% { opacity: 0 } }
@keyframes drift { 0% { transform: scale(1.04) translate(0, 0) } 26% { transform: scale(1.12) translate(-1.5%, -1%) } 100% { transform: scale(1.12) translate(-1.5%, -1%) } }
.shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 75% at 50% 10%, rgba(7, 8, 15, 0.15) 0%, rgba(7, 8, 15, 0.7) 62%, rgba(7, 8, 15, 0.95) 100%),
    linear-gradient(180deg, rgba(7, 8, 15, 0.5) 0%, rgba(7, 8, 15, 0.1) 28%, rgba(7, 8, 15, 0.88) 72%);
}
@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  .slide:first-child { opacity: 1; }
}

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1040px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 0;
}
.top .fc { height: 48px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.sponsor { display: flex; align-items: center; gap: 8px; }
.sponsor span { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sponsor img { height: 54px; width: auto; background: #fff; border-radius: 9px; padding: 3px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
@media (max-width: 420px) { .sponsor span { display: none; } .top .fc { height: 36px; } .sponsor img { height: 44px; } }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px max(48px, env(safe-area-inset-bottom)); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 34px 0 26px; }
.crest {
  width: 132px; height: auto; display: block; margin: 0 auto 10px;
  filter: drop-shadow(0 10px 30px rgba(226, 180, 82, .35)) drop-shadow(0 2px 6px rgba(0,0,0,.6));
  animation: rise .9s ease-out both;
}
@media (min-width: 760px) { .crest { width: 168px; } }
@media (max-width: 480px) { .crest { width: 104px; } .hero { padding: 22px 0 18px; } .tag { display: none; } }
.kicker { margin: 0; font: 700 .8rem/1 Inter, sans-serif; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-1); opacity: .9; }
h1 {
  margin: 8px 0 6px; font: 800 clamp(3rem, 12vw, 5.6rem)/0.95 "Barlow Condensed", sans-serif; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff 0%, #fff6dc 45%, var(--gold-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 0 transparent; filter: drop-shadow(0 6px 24px rgba(0,0,0,.55));
}
h1 span { background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; }
.meta { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: .04em; opacity: .9; }
.tag { margin: 10px auto 0; max-width: 34ch; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- segmented tabs ---------- */
.seg {
  display: flex; gap: 6px; padding: 6px; margin: 0 auto 16px; max-width: 440px;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 999px;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  appearance: none; border: 0; border-radius: 999px; padding: 11px 12px; cursor: pointer;
  font: 600 .98rem Inter, sans-serif; color: var(--muted); background: transparent; transition: background .2s, color .2s;
}
.seg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.seg button[aria-selected="true"] { color: #1b1406; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); box-shadow: 0 6px 18px rgba(226, 180, 82, .3); }
.seg button:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 2px; }

/* ---------- cards ---------- */
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
h2 { margin: 0 0 4px; font: 700 1.6rem/1.1 "Barlow Condensed", sans-serif; letter-spacing: .02em; color: var(--gold-1); }
.hint, .selfie-text p { color: var(--muted); margin: 0 0 14px; }
.selfie { display: flex; gap: 20px; align-items: center; }
@media (max-width: 560px) { .selfie { flex-direction: column; text-align: center; } }
.ring {
  flex: none; width: 124px; height: 124px; border-radius: 50%; padding: 4px; position: relative;
  background: conic-gradient(from 210deg, var(--gold-3), var(--gold-1), var(--gold-2), var(--gold-3));
  box-shadow: 0 10px 30px rgba(226, 180, 82, .25);
}
.ring img, .ring svg { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #10121f; display: block; }
.ring svg { padding: 26px; fill: none; stroke: var(--gold-1); stroke-width: 1.4; opacity: .8; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; text-decoration: none;
  appearance: none; border: 0; border-radius: 12px; padding: 13px 20px; font: 700 1rem Inter, sans-serif;
  transition: transform .12s, box-shadow .2s, opacity .2s;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.btn.gold { color: #1b1406; background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 60%, #c9953c); box-shadow: 0 8px 24px rgba(226, 180, 82, .32), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.ghost { color: var(--gold-1); background: var(--glass-2); border: 1px solid var(--line); }
.btn.small { padding: 9px 14px; font-size: .9rem; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 3px; }
input[type=file] { display: none; }

.status { margin: 16px 0 0; min-height: 1.5em; color: var(--muted); }
.status.ok { color: var(--ok); } .status.warn { color: var(--warn); }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -0.15em; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- save panel ---------- */
.save { margin: 16px 0 4px; padding: 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); }
.save .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.save .note { margin: 10px 0 0; font-size: .88rem; color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), var(--gold-1)); transition: width .3s; }

/* ---------- team picker ---------- */
.group { margin: 6px 0 10px; font: 700 .78rem Inter, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-bottom: 18px; }
.team {
  appearance: none; cursor: pointer; text-align: center; color: var(--ink); font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px;
  border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); transition: transform .15s, border-color .2s, background .2s;
}
.team:hover { transform: translateY(-2px); border-color: var(--line); }
.team img { width: 68px; height: 68px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.team span { font: 700 1.05rem/1.15 "Barlow Condensed", sans-serif; letter-spacing: .03em; }
.team small { color: var(--muted); font-size: .78rem; }
.team[aria-pressed="true"] { border-color: var(--gold-2); background: rgba(226, 180, 82, .12); box-shadow: 0 0 0 1px var(--gold-2) inset; }
.team:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 2px; }

/* ---------- photo grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 16px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } }
.grid button { appearance: none; border: 0; padding: 0; cursor: zoom-in; aspect-ratio: 3/2; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.06); }
@media (max-width: 480px) { .grid button { aspect-ratio: 1; border-radius: 6px; } }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.grid button:hover img { transform: scale(1.04); }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 10; background: rgba(4, 5, 10, .94); display: flex; align-items: center; justify-content: center; padding: 56px 8px 76px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.vclose, .vnav { position: absolute; appearance: none; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.1); border-radius: 50%; width: 44px; height: 44px; font-size: 1.3rem; line-height: 1; }
.vclose { top: max(10px, env(safe-area-inset-top)); right: 12px; }
.vnav { top: 50%; transform: translateY(-50%); font-size: 2rem; }
.vnav.prev { left: 8px; } .vnav.next { right: 8px; }
.vbar { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; }

/* ---------- footer ---------- */
footer { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 28px; }
.foot-brands { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; opacity: .9; }
.foot-brands img { height: 40px; width: auto; }
.foot-brands .klj { height: 46px; background: #fff; border-radius: 8px; padding: 3px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-2); }
