/* ──────────────────────────────────────────
   Vammo Copa 2026 — Stylesheet
   Colors guessed from vammo.com; update vars to match exact brand.
   ────────────────────────────────────────── */

:root {
  /* Brand — update these once you have exact values */
  --blue:         #1351D8;
  --blue-dark:    #0A3BAD;
  --blue-deeper:  #072D84;
  --blue-light:   #E8EFFD;
  --blue-mid:     #C5D5F8;

  /* Surfaces */
  --bg:           #F4F7FF;
  --surface:      #FFFFFF;
  --surface-2:    #EEF2FD;
  --header-bg:    #0B1527;
  --header-text:  #FFFFFF;

  /* Text */
  --text:         #111827;
  --text-2:       #4B5563;
  --text-3:       #9CA3AF;

  /* Borders */
  --border:       #DDE3F0;
  --border-2:     #C8D3EC;

  /* Feedback */
  --green:        #16A34A;
  --green-light:  #DCFCE7;
  --red:          #DC2626;
  --red-light:    #FEE2E2;
  --orange:       #D97706;
  --orange-light: #FEF3C7;

  /* Misc */
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 480px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100dvh; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input  { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ── App shell ── */
#app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ── Splash ── */
.splash {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
}
.splash-logo { font-size: 48px; }
.splash-text { color: var(--text-3); font-size: 14px; }

/* ── Header ── */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.3px;
}
.header-brand .bolt { font-size: 20px; }
.header-brand .cup  { font-size: 14px; font-weight: 500; opacity: .7; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-user {
  font-size: 13px; font-weight: 600; opacity: .9;
  background: rgba(255,255,255,.12); border-radius: 20px;
  padding: 4px 12px;
}
.btn-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--header-text);
  transition: background .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.15); }

/* ── Nav tabs ── */
.nav-tabs {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 90;
}
.nav-tab {
  flex: 1; padding: 13px 8px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.nav-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── Page body ── */
.page { max-width: var(--max-w); margin: 0 auto; width: 100%; padding: 0 0 80px; }

/* ── Auth screens ── */
.auth-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 20px;
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 32px 28px; width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center; margin-bottom: 24px;
}
.auth-logo .bolt { font-size: 40px; }
.auth-logo .brand { font-size: 22px; font-weight: 800; color: var(--blue); letter-spacing: -0.5px; }
.auth-logo .subtitle { font-size: 13px; color: var(--text-3); margin-top: 4px; }

.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--text-2); margin-bottom: 24px; line-height: 1.5; }

.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.form-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s; background: var(--bg);
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,81,216,.12); }
.form-input::placeholder { color: var(--text-3); }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

.sms-warning {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--orange-light); border: 1px solid #FCD34D;
  font-size: 13px; color: #92400E; line-height: 1.5;
}
.sms-warning strong { display: block; margin-bottom: 2px; }

.form-gap { margin-top: 16px; }
.form-gap-sm { margin-top: 10px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--blue); color: #fff; width: 100%;
}
.btn-primary:hover  { background: var(--blue-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--blue); font-size: 14px; padding: 8px 0; }
.btn-ghost:hover { opacity: .75; }

/* ── Round cards (home screen) ── */
.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-3); padding: 20px 20px 10px;
}
.round-card {
  background: var(--surface); margin: 0 16px 10px;
  border-radius: var(--radius); border: 1.5px solid var(--border);
  padding: 16px; cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  display: flex; align-items: center; gap: 14px;
}
.round-card:hover { box-shadow: var(--shadow); border-color: var(--blue-mid); }
.round-card.locked { opacity: .85; }
.round-card.unavailable { opacity: .5; cursor: default; }
.round-card.unavailable:hover { box-shadow: none; border-color: var(--border); }

.round-icon { font-size: 26px; flex-shrink: 0; }
.round-info { flex: 1; min-width: 0; }
.round-name { font-size: 15px; font-weight: 700; }
.round-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.round-badge {
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap;
}
.badge-open     { background: var(--green-light);  color: var(--green); }
.badge-locked   { background: var(--orange-light); color: var(--orange); }
.badge-live     { background: var(--blue-light);   color: var(--blue); }
.badge-done     { background: var(--surface-2);    color: var(--text-3); }
.badge-soon     { background: var(--surface-2);    color: var(--text-3); }

/* Pulsing dot for "live" */
.badge-live::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue);
  margin-right: 5px; animation: pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(1.3); }
}

/* ── Round detail / pick form ── */
.back-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--blue);
  position: sticky; top: 56px; z-index: 90;
}
.back-bar:hover { background: var(--blue-light); }

.round-header {
  padding: 20px 20px 0;
}
.round-header-title { font-size: 22px; font-weight: 800; }
.round-header-sub   { font-size: 14px; color: var(--text-2); margin-top: 4px; }

.lock-notice {
  margin: 16px 20px 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--orange-light); border: 1px solid #FCD34D;
  font-size: 13px; color: #92400E; display: flex; align-items: center; gap: 8px;
}

/* ── Match cards ── */
.matches-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }

.match-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); overflow: hidden;
  transition: border-color .15s;
}
.match-card.picked  { border-color: var(--blue-mid); }
.match-card.correct { border-color: var(--green); }
.match-card.wrong   { border-color: var(--red-light); }

.match-meta {
  padding: 8px 14px; background: var(--surface-2);
  font-size: 11px; font-weight: 600; color: var(--text-3);
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .5px;
}
.match-body { padding: 14px; }

.match-teams {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 8px; margin-bottom: 14px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.team-flag { font-size: 28px; line-height: 1; }
.team-name { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.2; }
.team.home { align-items: flex-start; }
.team.away { align-items: flex-end; }
.vs { font-size: 13px; font-weight: 700; color: var(--text-3); padding-top: 4px; }

/* Score badge (when match has result) */
.match-score {
  font-size: 20px; font-weight: 800; text-align: center; letter-spacing: 2px;
  padding: 2px 12px;
}

/* Pick buttons */
.pick-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
}
.pick-btn {
  padding: 9px 6px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; text-align: center;
  border: 1.5px solid var(--border); color: var(--text-2);
  background: var(--bg);
  transition: all .15s; cursor: pointer; line-height: 1.3;
}
.pick-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.pick-btn.selected {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.pick-btn.correct  { background: var(--green);  color: #fff; border-color: var(--green); }
.pick-btn.wrong    { background: var(--red);    color: #fff; border-color: var(--red);   }
.pick-btn.was-right { background: var(--green-light); color: var(--green); border-color: var(--green); }
.pick-btn[disabled] { cursor: default; }

/* No draw for knockout */
.pick-row.no-draw .pick-btn.draw-btn { display: none; }

/* ── Tiebreaker ── */
.tiebreaker-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 16px 20px;
  margin: 0 20px;
}
.tiebreaker-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.tiebreaker-sub   { font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.tiebreaker-input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 18px; font-weight: 700;
  text-align: center; outline: none; background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}
.tiebreaker-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,81,216,.12); }

/* ── Save bar ── */
.save-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 20px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.save-bar .btn-primary { flex: 1; }
.save-progress { font-size: 13px; color: var(--text-2); white-space: nowrap; }

/* ── Countdown notice ── */
.countdown-notice {
  margin: 12px 20px 0; padding: 11px 14px; border-radius: var(--radius-sm);
  background: #EEF6FF; border: 1px solid var(--blue-mid);
  font-size: 13px; color: var(--blue-dark);
}

/* ── Leaderboard ── */
.leaderboard-wrap { padding: 0 20px 20px; }

.my-rank-info {
  text-align: center; font-size: 13px; color: var(--text-2);
  padding: 12px 0 4px;
}
.ver-todos-btn {
  display: block; width: 100%; text-align: center;
  padding: 12px 0; margin-top: 4px;
  font-size: 14px; font-weight: 600; color: var(--blue);
  border-top: 1px solid var(--border); background: none; cursor: pointer;
}
.ver-todos-btn:hover { background: var(--blue-light); }
.ver-todos-btn:disabled { opacity: .5; cursor: default; }

.distribution-row {
  display: flex; gap: 8px; padding: 16px 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.dist-item {
  flex-shrink: 0; text-align: center; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; min-width: 64px;
}
.dist-n      { font-size: 22px; font-weight: 800; color: var(--blue); }
.dist-label  { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3); padding: 8px 4px; border-bottom: 1px solid var(--border);
}
.lb-table td { padding: 11px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.lb-table tr:last-child td { border-bottom: none; }
.lb-rank  { font-weight: 700; color: var(--text-3); width: 32px; }
.lb-name  { font-weight: 600; }
.lb-num   { font-weight: 700; color: var(--blue); text-align: right; }
.lb-table tr.me td { background: var(--blue-light); }
.lb-table tr.me .lb-rank { color: var(--blue); }

.medal-1::before { content: '🥇 '; }
.medal-2::before { content: '🥈 '; }
.medal-3::before { content: '🥉 '; }

/* ── All picks view ── */
.user-picks-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); margin-bottom: 10px; overflow: hidden;
}
.user-picks-header {
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.user-picks-name { font-size: 14px; font-weight: 700; }
.user-picks-score { font-size: 13px; font-weight: 600; color: var(--blue); }
.user-picks-list  { padding: 8px 0; }
.user-pick-row {
  display: flex; align-items: center; padding: 7px 14px; gap: 8px; font-size: 13px;
}
.user-pick-row + .user-pick-row { border-top: 1px solid var(--border); }
.user-pick-teams { flex: 1; color: var(--text-2); }
.user-pick-choice {
  font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 20px;
}
.pick-correct-bg { background: var(--green-light); color: var(--green); }
.pick-wrong-bg   { background: var(--red-light);   color: var(--red); }
.pick-pending-bg { background: var(--surface-2);    color: var(--text-3); }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-3); font-size: 14px;
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; border-radius: 24px;
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 999; white-space: nowrap;
  animation: toast-in .2s ease;
}
.toast.error { background: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Utilities ── */
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-3); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Responsive ── */
@media (min-width: 520px) {
  .round-card { margin: 0 20px 10px; }
  .save-bar { max-width: var(--max-w); left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
}
