/* ============================================================
   Footy Forfeit — Shared CSS
   Design tokens + base styles extracted from index.html
   Used by: auth.html, dashboard.html, league.html, forfeit.html
   ============================================================ */

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

:root {
  --bg: #0A0E13;
  --surface: #161B22;
  --surface-hover: #1C2128;
  --gold: #E5FF00;
  --gold-rgb: 229, 255, 0;
  --green: #00A651;
  --green-rgb: 0, 166, 81;
  --red: #E53935;
  --red-rgb: 229, 57, 53;
  --text: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #6B7280;
  --border: rgba(229, 255, 0, 0.12);
  --border-strong: rgba(229, 255, 0, 0.3);
  --font-display: 'Oswald', -apple-system, sans-serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Skip to main content (accessibility) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 99999;
  background: var(--gold);
  color: #0A0E13;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Nav bar ──────────────────────────────────────────────── */
.ff-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 19, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ff-nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.ff-nav-brand .gold { color: var(--gold); }
.ff-nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
}
.ff-nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.ff-nav-link:hover { color: var(--gold); text-decoration: none; }
.ff-nav-link.primary {
  background: var(--gold);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
}
.ff-nav-link.primary:hover { background: #d4ed00; color: var(--bg); }

/* ── Layout containers ───────────────────────────────────── */
.ff-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.ff-page-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.ff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.ff-card-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Forms ───────────────────────────────────────────────── */
.ff-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.ff-input,
.ff-select,
.ff-textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.ff-input:focus,
.ff-select:focus,
.ff-textarea:focus {
  border-color: var(--gold);
  background: var(--surface);
}
.ff-input::placeholder,
.ff-textarea::placeholder {
  color: var(--text-muted);
}
.ff-textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--font-body);
}

/* ── Buttons ─────────────────────────────────────────────── */
.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.15s var(--ease), background 0.2s, color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.ff-btn:active { transform: scale(0.97); }
.ff-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ff-btn-primary {
  background: var(--gold);
  color: var(--bg);
  width: 100%;
}
.ff-btn-primary:hover:not(:disabled) { background: #d4ed00; }
.ff-btn-primary.ff-success {
  background: #b8e600;
  color: var(--bg);
  pointer-events: none;
}

.ff-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.ff-btn-secondary:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }

.ff-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 44px;
}
.ff-btn-ghost:hover:not(:disabled) { color: var(--gold); }

/* ── Alerts / status ─────────────────────────────────────── */
.ff-alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}
.ff-alert-success {
  background: rgba(var(--green-rgb), 0.12);
  border: 1px solid rgba(var(--green-rgb), 0.4);
  color: var(--green);
}
.ff-alert-error {
  background: rgba(var(--red-rgb), 0.12);
  border: 1px solid rgba(var(--red-rgb), 0.4);
  color: var(--red);
}
.ff-alert-info {
  background: rgba(var(--gold-rgb), 0.08);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ── Severity badges (shared with main index) ─────────────── */
.sev-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.sev-badge.mild {
  background: rgba(var(--green-rgb), 0.15);
  color: var(--green);
}
.sev-badge.spicy {
  background: rgba(229, 135, 0, 0.15);
  color: #FFA630;
}
.sev-badge.full-send {
  background: rgba(var(--red-rgb), 0.15);
  color: var(--red);
}

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.lb-row.rank-1 { border-color: var(--gold); background: rgba(var(--gold-rgb), 0.04); }
.lb-rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--gold);
  min-width: 32px;
}
.lb-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}
.lb-stat {
  font-size: 13px;
  color: var(--text-secondary);
}
.lb-stat strong { color: var(--text); font-size: 16px; }

/* ── Spinner ─────────────────────────────────────────────── */
.ff-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 14, 19, 0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: ff-spin 0.7s linear infinite;
}
@keyframes ff-spin { to { transform: rotate(360deg); } }

/* ── Forfeit card (simplified from index.html) ─────────────── */
.ff-forfeit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ff-forfeit-head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #1C2128, #161B22);
  border-bottom: 1px solid var(--border);
}
.ff-forfeit-team {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ff-forfeit-body {
  padding: 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}
.ff-forfeit-body strong { color: var(--gold); font-weight: 700; }
.ff-forfeit-foot {
  padding: 14px 22px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* ── Forfeit reveal animations ──────────────────────────── */

/* Reduced-motion fallback: plain opacity fade for everyone */
.ff-forfeit-card.reveal-forfeit {
  animation: forfeitRevealReduced 0.3s ease forwards;
}
.ff-forfeit-card.reveal-forfeit .ff-forfeit-team {
  /* no shake in reduced-motion */
}

@keyframes forfeitRevealReduced {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Dramatic reveal for users who have no motion preference */
@media (prefers-reduced-motion: no-preference) {
  @keyframes forfeitReveal {
    0%   { opacity: 0; transform: scale(0.85); }
    40%  { opacity: 0; transform: scale(0.85); }
    75%  { opacity: 1; transform: scale(1.04); }
    100% { opacity: 1; transform: scale(1); }
  }

  @keyframes forfeitGlow {
    0%   { box-shadow: 0 0 0 0 rgba(var(--red-rgb), 0); }
    50%  { box-shadow: 0 0 0 8px rgba(var(--red-rgb), 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(var(--red-rgb), 0); }
  }

  @keyframes forfeitShake {
    0%   { transform: translateX(0); }
    14%  { transform: translateX(-4px); }
    28%  { transform: translateX(4px); }
    43%  { transform: translateX(-4px); }
    57%  { transform: translateX(4px); }
    71%  { transform: translateX(-4px); }
    85%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
  }

  .ff-forfeit-card.reveal-forfeit {
    animation:
      forfeitReveal 500ms var(--ease) forwards,
      forfeitGlow 600ms ease 100ms forwards;
  }

  .ff-forfeit-card.reveal-forfeit .ff-forfeit-team {
    animation: forfeitShake 300ms ease 200ms forwards;
  }
}

/* ── Utility ─────────────────────────────────────────────── */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }

/* ── Tipping UI ─────────────────────────────────────────── */
.tipping-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tip-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.tip-progress-count {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.tip-progress-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tip-progress-count.complete { color: var(--green); }

.tip-game {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.tip-game.tipped { border-color: rgba(var(--green-rgb), 0.3); }
.tip-game.locked { opacity: 0.7; }
.tip-game-meta {
  padding: 10px 16px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tip-game-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
}
.tip-team {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tip-team:hover { border-color: rgba(var(--gold-rgb), 0.3); }
.tip-team.selected {
  border-color: var(--gold);
  background: rgba(var(--gold-rgb), 0.08);
}
.tip-team.correct {
  border-color: var(--green);
  background: rgba(var(--green-rgb), 0.08);
}
.tip-team.incorrect {
  border-color: var(--red);
  background: rgba(var(--red-rgb), 0.06);
  opacity: 0.6;
}
.tip-team.winner-highlight {
  border-color: var(--green);
  background: rgba(var(--green-rgb), 0.06);
}
.tip-team:disabled { cursor: default; }
.tip-team-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tip-team-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
}
.tip-vs {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.tip-game-status {
  padding: 0 16px 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.tip-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.tip-result-badge.correct {
  background: rgba(var(--green-rgb), 0.12);
  color: var(--green);
}
.tip-result-badge.incorrect {
  background: rgba(var(--red-rgb), 0.12);
  color: var(--red);
}

.tip-margin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-top: 12px;
}
.tip-margin-card .ff-input {
  max-width: 120px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.round-scores-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.score-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.score-row:last-child { border-bottom: none; }
.score-row.loser { background: rgba(var(--red-rgb), 0.06); border-radius: 8px; padding: 10px 8px; }
.score-rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
}
.score-row.loser .score-rank { color: var(--red); }
.score-name { font-weight: 600; font-size: 14px; }
.score-tips {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
}
.score-row.loser .score-tips { color: var(--red); }

/* ── Round Hero ─────────────────────────────────────────── */
.round-hero {
  background: linear-gradient(135deg, rgba(var(--gold-rgb), 0.08), rgba(var(--gold-rgb), 0.02));
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.round-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.round-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.round-hero-title {
  font-size: 32px;
  letter-spacing: -0.01em;
}
.round-hero-stakes {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 14px 18px;
}
.round-hero-stakes-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(var(--gold-rgb), 0.15);
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--gold);
}
.round-hero-stakes-main {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
}
.round-hero-stakes-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Save Tips Button ──────────────────────────────────── */
.save-tips-btn {
  position: relative;
  font-size: 16px;
  padding: 16px 24px;
  margin-top: 16px;
}
.save-tips-btn.saved {
  background: var(--green);
  pointer-events: none;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 540px) {
  .ff-page, .ff-page-wide {
    padding: 16px 14px;
    /* Safe area: home-indicator on iPhone X+ */
    padding-bottom: max(60px, calc(60px + env(safe-area-inset-bottom)));
  }
  .ff-card { padding: 18px; }
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  .round-hero-title { font-size: 26px; }
  .round-hero-stakes { flex-direction: column; text-align: center; }
  .round-hero-stakes-icon { width: 36px; height: 36px; font-size: 18px; }
}

/* ─── 18+ Age Gate Modal ─── */
.age-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 19, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  /* Must sit above the QR widget (z-index: 10000) so the confirm button
     is clickable on mobile. Prior to this fix, mobile users were fully
     locked out of the product — QR widget's floating bubble sat over the
     age-confirm button and swallowed every tap. */
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: ff-fade-in 0.4s ease;
}
@keyframes ff-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.age-gate-modal {
  max-width: 460px;
  width: 100%;
  background: linear-gradient(180deg, #161B22 0%, #0A0E13 100%);
  border: 1px solid rgba(229, 255, 0, 0.25);
  border-radius: 22px;
  padding: 36px 30px 30px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.age-gate-emblem { margin-bottom: 14px; line-height: 1; }
.age-gate-modal h1 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 12px;
}
.age-gate-modal p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.age-gate-modal a { color: var(--gold); }
.age-gate-modal button {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s;
}
.age-gate-modal button:active { transform: scale(0.98); }
.age-confirm {
  background: var(--gold);
  color: var(--bg);
  margin-bottom: 8px;
}
.age-confirm:hover { background: #d4ed00; }
.age-deny {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1) !important;
}
.age-deny:hover { color: var(--text-secondary); }
.age-fineprint {
  margin-top: 16px !important;
  font-size: 11px !important;
  color: var(--text-muted) !important;
}

/* ─── Consent checkbox on auth ─── */
.ff-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 14px 0 4px;
  cursor: pointer;
  user-select: none;
  /* Bump effective hit area to 44px so the whole label row is tappable, not just the 18px box */
  padding: 13px 0;
  min-height: 44px;
}
.ff-consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
}
.ff-consent a { color: var(--gold); text-decoration: underline; }
.ff-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
