@font-face {
  font-family: Fig;
  src: url('/fonts/figtree.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Bri;
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --brand: #d97706;
  --brand-ink: #ffffff;
  --brand-dark: #5c3105;
  --brand-light: #fcd34d;
  --brand-soft: rgba(217, 119, 6, 0.2);
  --panel: rgba(13, 21, 34, 0.94);
  --panel-border: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #13352f;
  color: var(--text);
  font: 700 15px/1.4 Fig, system-ui, -apple-system, sans-serif;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

header.demo-hud,
footer.demo-footer,
#ticker,
#desk {
  position: fixed;
  z-index: 4;
  pointer-events: none;
}

button,
a.hud-btn,
a.cta-btn,
a.cta-link,
#stick {
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
  font: 800 14px Fig, system-ui, sans-serif;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--brand-light);
  outline-offset: 2px;
}

/* Top HUD */
header.demo-hud {
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.broadcast {
  background: rgba(14, 24, 38, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(5, 14, 20, 0.42);
  min-width: 0;
  max-width: min(58vw, 320px);
}

.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strip b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip span {
  flex: none;
  font-weight: 700;
  opacity: 0.9;
}

.scores {
  display: flex;
  align-items: center;
}

.scores .team-pill,
.scores strong,
.scores time {
  padding: 5px 9px;
}

.scores .team-pill {
  font-size: 12px;
  letter-spacing: 0.05em;
}

.scores .team-home {
  border-left: 4px solid var(--brand);
}

.scores .team-away {
  border-right: 4px solid #ef4444;
}

.scores strong {
  background: #f1f5f9;
  color: #0f172a;
  font: 800 18px/1 Bri, system-ui, sans-serif;
  padding: 6px 10px;
  white-space: nowrap;
}

.scores time {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 800;
  min-width: 52px;
  text-align: center;
  white-space: nowrap;
}

.scores time.urgent {
  color: #fde047;
}

.hud-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 24, 38, 0.88);
  color: #f8fafc;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(4, 12, 18, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.hud-btn:active {
  transform: scale(0.96);
}

.hud-btn-accent {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: rgba(255, 255, 255, 0.35);
}

.hud-btn-ghost {
  background: rgba(14, 24, 38, 0.72);
}

#ticker {
  top: 76px;
  left: 14px;
  background: rgba(14, 24, 38, 0.9);
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 800;
}

#ticker:empty {
  display: none;
}

/* Modal / Overlay Backdrop Layer */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(8, 15, 26, 0.56);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.overlay-card {
  width: min(94vw, 440px);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-top: 5px solid var(--brand);
  border-radius: 22px;
  padding: 20px 20px 18px;
  box-shadow: 0 22px 60px rgba(4, 9, 18, 0.7);
  display: grid;
  gap: 13px;
  pointer-events: auto;
  user-select: text;
}

.demo-campaign-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--brand-soft);
  border: 1.5px solid var(--brand);
  color: #ffffff;
}

.intro-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: -4px 0 0;
}

.overlay-card h1,
.overlay-card h2 {
  font-family: Bri, Fig, system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  overflow-wrap: anywhere;
}

.overlay-card h1 {
  font-size: clamp(28px, 6.5vw, 38px);
}

.overlay-card h2 {
  font-size: clamp(24px, 5.5vw, 30px);
}

.overlay-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.reward-teaser {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13.5px;
  color: #f8fafc;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.cta-btn:hover {
  filter: brightness(1.08);
}

.cta-btn:active {
  transform: translateY(2px);
}

.cta-brand {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 5px 0 var(--brand-dark);
}

.cta-secondary {
  background: #1e293b;
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  min-height: 44px;
  font-size: 13.5px;
}

.cta-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  min-height: 44px;
  font-size: 13.5px;
}

.intro-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 6px;
  color: var(--brand-light);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
}

.cta-link:hover {
  text-decoration: underline;
}

/* Goal Banner */
#goal-card {
  position: fixed;
  z-index: 12;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(86vw, 330px);
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(13, 21, 34, 0.94);
  border: 2px solid var(--brand);
  text-align: center;
  pointer-events: none;
  box-shadow: 0 16px 40px rgba(4, 10, 18, 0.55);
}

#goal-card h2 {
  margin: 0;
  font-family: Bri, sans-serif;
  font-size: 36px;
  color: var(--brand-light);
}

#goal-card p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #e2e8f0;
}

/* Reward Modal Specifics */
.score-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.score-tile {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 2px;
}

.score-tile span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.score-tile strong {
  font-family: Bri, sans-serif;
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.reward-offer {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--brand-light);
}

.voucher-ticket {
  padding: 13px 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed var(--brand);
  display: grid;
  gap: 8px;
}

.voucher-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.voucher-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voucher-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.voucher-copy-btn {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13.5px;
  box-shadow: 0 3px 0 var(--brand-dark);
}

.copy-status {
  min-height: 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #86efac;
}

.copy-status:empty {
  display: none;
}

/* Lead Capture Simulation Form */
.lead-form {
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 8px;
}

.lead-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
}

.demo-only-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
}

.lead-row {
  display: flex;
  gap: 8px;
}

.lead-row input {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(2, 6, 23, 0.78);
  color: #ffffff;
  font: 600 14px Fig, system-ui, sans-serif;
}

.lead-row input::placeholder {
  color: #94a3b8;
}

.lead-row button {
  flex: none;
  padding: 8px 13px;
}

.lead-feedback {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #86efac;
  line-height: 1.45;
}

.lead-feedback.is-warn {
  color: #fde047;
}

.lead-feedback:empty {
  display: none;
}

.reward-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Mobile Touchline Controls (mirrors Liga Saku ergonomics) */
#pad {
  position: fixed;
  z-index: 3;
  left: 0;
  bottom: 0;
  width: 46%;
  height: 48%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#pad #stick {
  --rim: clamp(82px, 15vmin, 108px);
  position: absolute;
  pointer-events: none;
  left: clamp(56px, 12vw, 130px);
  top: calc(100% - clamp(66px, 18vh, 112px));
  width: var(--rim);
  height: var(--rim);
  transform: translate(-50%, -50%);
  border: 1.5px solid rgba(240, 248, 220, 0.55);
  border-radius: 50%;
  background: rgba(16, 43, 36, 0.34);
  display: grid;
  place-items: center;
}

#stick i {
  width: 44%;
  height: 44%;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 32%, #ffffff, #cbd2c7);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(10, 30, 22, 0.5);
}

#pad.held #stick {
  border-color: var(--brand-light);
}

#radar {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  left: 50%;
  bottom: clamp(6px, 2vh, 14px);
  transform: translateX(-50%);
  width: clamp(84px, 14vw, 140px);
  height: auto;
  background: rgba(16, 45, 34, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
}

footer.demo-footer {
  inset: auto 12px max(10px, env(safe-area-inset-bottom));
  height: clamp(140px, 38vh, 182px);
}

.player {
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 10px;
  min-width: 102px;
  border-radius: 8px;
  background: rgba(14, 24, 38, 0.8);
  border-left: 4px solid var(--brand);
}

.player small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player b {
  display: block;
  font: 800 15px/1.2 Bri, system-ui, sans-serif;
}

progress {
  display: block;
  height: 5px;
  width: 100%;
  margin-top: 3px;
  accent-color: var(--brand);
}

#buttons {
  --key: clamp(52px, 14vmin, 68px);
  position: absolute;
  right: max(1px, env(safe-area-inset-right));
  bottom: 4px;
  width: calc(var(--key) * 2.42);
  height: calc(var(--key) * 2.42);
}

#buttons button {
  --rim: #82df97;
  position: absolute;
  width: var(--key);
  height: var(--key);
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 3px solid var(--rim);
  background: rgba(14, 28, 34, 0.84);
  color: #ffffff;
  font: 800 clamp(11px, 2.35vmin, 13.5px)/1 Fig, system-ui, sans-serif;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000000;
  display: grid;
  place-content: center;
  padding: 4px;
  box-shadow: 0 0 0 1.5px rgba(232, 237, 201, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

#buttons #shot {
  --rim: var(--brand);
  right: 0;
  top: 0;
  background: var(--brand);
  color: var(--brand-ink);
  text-shadow: none;
}

#buttons #through {
  --rim: #eed168;
  left: 3px;
  top: 19%;
}

#buttons #pass {
  --rim: #77cff1;
  left: 2px;
  bottom: 0;
}

#buttons #sprint {
  width: calc(var(--key) * 1.12);
  height: calc(var(--key) * 1.12);
  bottom: 0;
  right: 0;
}

#buttons button:active {
  transform: scale(0.94);
  filter: brightness(1.18);
}

#power {
  position: absolute;
  right: 14px;
  bottom: calc(100% + 4px);
  background: rgba(14, 24, 38, 0.9);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

#desk {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 24, 38, 0.82);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}

@media (pointer: coarse), (max-width: 900px) {
  #desk {
    display: none;
  }
}

@media (max-width: 540px) {
  header.demo-hud {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 6px;
  }
  .broadcast {
    flex: none;
    max-width: none;
  }
  .strip b {
    max-width: 148px;
  }
  .strip span {
    display: none;
  }
  .scores .team-pill,
  .scores strong,
  .scores time {
    padding: 4px 5px;
  }
  .scores .team-pill {
    font-size: 11px;
  }
  .scores strong {
    font-size: 14.5px;
    padding: 4px 6px;
  }
  .scores time {
    min-width: 40px;
    font-size: 12.5px;
  }
  .hud-controls {
    gap: 5px;
  }
  .hud-btn {
    padding: 0 8px;
    font-size: 11.5px;
  }
  #radar {
    left: 46%;
    bottom: 7px;
    width: 74px;
  }
  #buttons {
    --key: 53px;
  }
  .reward-actions {
    grid-template-columns: 1fr;
  }
  .lead-row {
    flex-direction: column;
  }
}

@media (max-width: 410px) {
  #radar {
    bottom: 82px;
    width: 68px;
    left: 43%;
  }
}
