/* ===================================================================
   KPMG Player Reels — front-end shell styling.

   Shared by the global landing (index.html), the per-player landing
   (rendered from templates/site/player_landing.html.j2) and 404.html.
   Palette + fonts + dot-texture are lifted verbatim from the reels'
   render/theme.css so the FE and the reels read as one product.

   MOBILE-FIRST: the reels render in a ~430px frame; these pages match.
   Layout is a single max-width column centred on the navy backdrop;
   desktop is the enhancement, not the primary target.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --navy:    #00091a;
  --kblue:   #00338D;
  --ksky:    #0077C8;
  --kgold:   #AF9157;
  --kgold-h: #C9A96E;
  --green:   #21C56E;
  --red:     #FF4D4D;
  --text:    rgba(255,255,255,0.95);
  --muted:   rgba(255,255,255,0.62);
  --muted2:  rgba(255,255,255,0.38);
  --font:    'Inter', ui-sans-serif, sans-serif;
  --display: 'Bebas Neue', Impact, sans-serif;
  --surface-card:   rgba(255,255,255,0.04);
  --surface-border: rgba(255,255,255,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* The `hidden` attribute must win over component `display` values below
   (otherwise e.g. `.test-badge { display: inline-flex }` keeps a hidden,
   empty pill in the layout). */
[hidden] { display: none !important; }

html { height: 100%; background: var(--navy); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--navy);
  background-image:
    radial-gradient(ellipse 900px 600px at 70% 8%,  rgba(0,52,141,0.28) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 15% 92%, rgba(0,32,91,0.22) 0%, transparent 55%),
    radial-gradient(ellipse 420px 320px at 50% 50%, rgba(175,145,87,0.05) 0%, transparent 50%);
  background-attachment: fixed;
  font-family: var(--font);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 18px;
  -webkit-font-smoothing: antialiased;
}

/* Dot texture (matches the reels' per-slide grid) */
body::before {
  content: ''; position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Single mobile-first column; centred + capped on larger screens. */
.page {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Header / brand lockup ── */
.site-header {
  padding: clamp(40px, 9vh, 72px) 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}
.brand-logo { height: 30px; width: auto; opacity: 0.92; }
.brand-rule {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--kgold), transparent);
}
.site-title {
  font-family: var(--display);
  font-size: clamp(40px, 12vw, 58px);
  letter-spacing: 2px; line-height: 0.92; color: #fff;
}
.site-title span {
  display: block; font-family: var(--font);
  font-size: clamp(12px, 3.4vw, 13px); font-weight: 400; letter-spacing: 0.4px;
  line-height: 1.5; color: var(--muted); margin-top: 12px; text-transform: none;
}

/* Tournament lockup — signals the live championship. */
.hero-logo {
  width: auto; height: clamp(72px, 19vw, 104px);
  filter: drop-shadow(0 4px 18px rgba(0,0,0,0.45));
}

/* "Live" status pill under the tournament logo. */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(33,197,110,0.3); background: rgba(33,197,110,0.08);
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--green);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(33,197,110,0.6); animation: live-ping 2s ease-out infinite;
}
@keyframes live-ping {
  0%   { box-shadow: 0 0 0 0 rgba(33,197,110,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(33,197,110,0); }
  100% { box-shadow: 0 0 0 0 rgba(33,197,110,0); }
}

/* Testing-only context badge (?event= override). Distinct from the footer's
   Confidential note — gold "testing" framing, hidden unless an override is set. */
.test-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(175,145,87,0.35); background: rgba(175,145,87,0.1);
  font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--kgold-h);
}

/* Login prompt — makes the gate obvious before the CTA. */
.login-prompt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-card); border: 1px solid var(--surface-border);
  animation: fadeUp 0.5s 0.18s ease both;
}
.login-prompt__lock { width: 26px; height: 26px; flex-shrink: 0; color: var(--kgold); }
.login-prompt__text { font-size: 12.5px; color: var(--muted); line-height: 1.5; text-align: left; }
.login-prompt__text strong { color: rgba(255,255,255,0.9); font-weight: 700; }

/* ── Confidential badge ── */
.conf-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid rgba(175,145,87,0.25); background: rgba(175,145,87,0.06);
  font-size: 9px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--kgold); animation: fadeUp 0.6s 0.15s ease both;
}
.conf-badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--kgold); animation: pulse-dot 2.5s ease-in-out infinite;
}

/* ── Primary CTA (open passcode) ── */
.cta-zone {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 28px 0;
}
.btn-primary {
  width: 100%;
  min-height: 54px;
  padding: 16px 22px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #8a6e3a 0%, var(--kgold) 45%, var(--kgold-h) 100%);
  color: #000d1a; font-family: var(--font);
  font-size: 15px; font-weight: 900; letter-spacing: 0.4px;
  box-shadow: 0 6px 24px rgba(175,145,87,0.4);
  transition: transform .12s ease, box-shadow .12s ease;
  animation: fadeUp 0.5s 0.2s ease both;
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 3px 12px rgba(175,145,87,0.3); }
.cta-hint { font-size: 11px; color: var(--muted2); letter-spacing: 0.3px; }

/* ── Modal (passcode + first-login explainer) ── */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,5,15,0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.modal-scrim.open { opacity: 1; pointer-events: auto; }
@media (min-width: 520px) {
  .modal-scrim { align-items: center; padding: 20px; }
}
.modal {
  position: relative;
  width: 100%; max-width: 440px;
  background:
    radial-gradient(500px 300px at 80% 0%, rgba(0,52,141,0.35) 0%, transparent 60%),
    linear-gradient(155deg, #001030 0%, #000c1e 100%);
  border: 1px solid rgba(175,145,87,0.22);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(24px); transition: transform .26s cubic-bezier(.22,.68,0,1.2);
}
.modal-scrim.open .modal { transform: translateY(0); }
@media (min-width: 520px) {
  .modal { border-radius: 22px; transform: scale(0.96); }
  .modal-scrim.open .modal { transform: scale(1); }
}
.modal__grip {
  width: 40px; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.18); margin: -8px auto 16px;
}
@media (min-width: 520px) { .modal__grip { display: none; } }
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--surface-border); background: var(--surface-card);
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.modal__eyebrow {
  font-size: 9px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--kgold); margin-bottom: 6px;
}
.modal__title {
  font-family: var(--display); font-size: 30px; letter-spacing: 1.5px;
  text-transform: uppercase; color: #fff; line-height: 1; margin-bottom: 8px;
}
.modal__body { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }

/* ── Passcode input ── */
.passcode-form { display: flex; flex-direction: column; gap: 12px; }
.passcode-input {
  width: 100%; min-height: 54px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--surface-border); background: rgba(255,255,255,0.06);
  color: #fff; font-family: var(--font);
  font-size: 18px; font-weight: 700; letter-spacing: 1px; text-align: center;
}
.passcode-input::placeholder { color: var(--muted2); font-weight: 500; letter-spacing: 0.5px; }
.passcode-input:focus { outline: none; border-color: var(--ksky); box-shadow: 0 0 0 3px rgba(0,119,200,0.18); }
.passcode-input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,77,77,0.15); }
.passcode-error {
  min-height: 16px; font-size: 11.5px; color: var(--red); text-align: center;
  opacity: 0; transition: opacity .15s ease;
}
.passcode-error.show { opacity: 1; }
.btn-primary[disabled] { opacity: 0.6; cursor: progress; }

/* ── Passcode recovery ── */
.passcode-help-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
  padding: 8px; min-height: 40px;
}
.passcode-help-link:hover { color: var(--kgold-h); }
.passcode-help {
  margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  background: rgba(175,145,87,0.08); border: 1px solid rgba(175,145,87,0.22);
  font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center;
}
.passcode-help a { color: var(--kgold-h); font-weight: 700; text-decoration: none; white-space: nowrap; }
.passcode-help a:hover { text-decoration: underline; }

/* ── Per-player landing: cards ── */
.player-header {
  padding: clamp(36px, 8vh, 60px) 0 6px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  animation: fadeUp 0.6s ease both;
}
.player-flag { font-size: 22px; line-height: 1; }
.player-name {
  font-family: var(--display); font-size: clamp(38px, 11vw, 54px);
  letter-spacing: 1.5px; text-transform: uppercase; color: #fff; line-height: 0.95;
}
.player-sub { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--kgold); }

.cards { display: flex; flex-direction: column; gap: 12px; padding: 28px 0 8px; }
.card {
  position: relative; display: flex; align-items: center; gap: 16px;
  min-height: 76px; padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none; color: inherit;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
  animation: fadeUp 0.5s ease both;
}
.card:active { transform: scale(0.99); }
@media (hover: hover) {
  .card:hover { border-color: rgba(175,145,87,0.28); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
}
.card--locked {
  opacity: 0.5; pointer-events: none;
  background: rgba(255,255,255,0.02); border-style: dashed;
}
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--kblue), rgba(0,51,141,0.55));
  font-family: var(--display); font-size: 20px; color: #fff; letter-spacing: 1px;
}
.card--locked .card-icon { background: rgba(255,255,255,0.05); color: var(--muted2); }
.card-body { flex: 1; min-width: 0; }
.card-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.2px; }
.card-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.card-meta strong { color: rgba(255,255,255,0.72); font-weight: 600; }
.card-score {
  font-family: var(--display); font-size: 26px; letter-spacing: 1px; flex-shrink: 0;
  color: var(--green);
}
.card-score--over { color: var(--red); }
.card-score--even { color: var(--kgold-h); }
.card-status {
  font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted2); flex-shrink: 0;
}
.card-arrow {
  width: 20px; height: 20px; flex-shrink: 0; color: var(--muted);
  transition: color .25s, transform .25s;
}
@media (hover: hover) { .card:hover .card-arrow { color: var(--kgold); transform: translateX(3px); } }

/* ── Featured card: the most recent reel, given prominence ── */
.card--featured {
  flex-direction: column; align-items: stretch; gap: 14px;
  padding: 18px 20px 16px;
  background:
    radial-gradient(420px 200px at 85% 0%, rgba(0,52,141,0.28) 0%, transparent 60%),
    linear-gradient(135deg, rgba(175,145,87,0.12) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(175,145,87,0.4);
  box-shadow: 0 10px 36px rgba(0,0,0,0.35);
}
.card-featured__eyebrow {
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--kgold-h);
}
.card-featured__main { display: flex; align-items: center; gap: 16px; }
.card-icon--lg { width: 60px; height: 60px; border-radius: 14px; font-size: 26px; }
.card-score--lg { font-size: 40px; }
.card-featured__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, #8a6e3a 0%, var(--kgold) 45%, var(--kgold-h) 100%);
  color: #000d1a; font-size: 14px; font-weight: 900; letter-spacing: 0.4px;
  box-shadow: 0 6px 20px rgba(175,145,87,0.32);
}
.card-featured__cta .card-arrow { color: #000d1a; width: 18px; height: 18px; }
.card--featured:active { transform: scale(0.99); }
@media (hover: hover) {
  .card--featured:hover { transform: translateY(-2px); box-shadow: 0 16px 46px rgba(0,0,0,0.4); }
  .card--featured:hover .card-featured__cta .card-arrow { transform: translateX(3px); }
}

/* ── Divider between the featured reel and the rest ── */
.cards-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 2px 2px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted2);
}
.cards-divider::before, .cards-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}

/* ── Footer ── */
.site-footer { padding: 20px 0 36px; text-align: center; margin-top: auto; animation: fadeUp 0.5s 0.4s ease both; }
.footer-rule { width: 32px; height: 1px; margin: 0 auto 14px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); }
.footer-note { font-size: 10px; color: var(--muted2); line-height: 1.6; }
.footer-note a { color: var(--kgold); text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }

/* ── 404 ── */
.notfound { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.notfound__code { font-family: var(--display); font-size: clamp(72px, 24vw, 120px); color: var(--kgold-h); line-height: 0.9; letter-spacing: 2px; }
.notfound__msg { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 300px; }

/* ── Animations ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-dot { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
