/* =============================================================================
   Sportical · World Cup 2026 page
   Self-contained styles. The token block below is the design system and is
   intended to be promoted to a shared stylesheet when the home page adopts it.
   Colour discipline: near-black + two neutral grays + ONE blue accent.
   The blue is used ONLY for the primary action and the live indicator.
   ============================================================================= */

:root{
  /* ---- colour: dark (default) ---- */
  --bg:#0a0c10;
  --surface:#11141b;
  --surface-2:#161a23;
  --border:#232a36;
  --text:#eef1f7;
  --text-muted:#9aa3b3;     /* gray 1: secondary text */
  --text-subtle:#6b7384;    /* gray 2: meta / least important */
  --accent:#3b82f6;
  --accent-hover:#5a96f8;
  --accent-fg:#ffffff;
  --accent-soft:rgba(59,130,246,.14);
  --accent-ring:rgba(96,165,250,.55);

  /* ---- spacing scale ---- */
  --sp-1:4px;  --sp-2:8px;  --sp-3:12px; --sp-4:16px;
  --sp-5:24px; --sp-6:32px; --sp-7:48px; --sp-8:64px;

  /* ---- type scale ---- */
  --fs-xs:.75rem; --fs-sm:.85rem; --fs-base:1rem; --fs-md:1.075rem;
  --fs-lg:1.25rem; --fs-xl:1.6rem; --fs-2xl:2.1rem;
  --fw-normal:400; --fw-medium:550; --fw-semi:650; --fw-bold:800;

  /* ---- radius / elevation / layout ---- */
  --r-sm:8px; --r-md:12px; --r-lg:18px; --r-pill:999px;
  --shadow:0 18px 44px -26px rgba(0,0,0,.75);
  --shadow-pop:0 16px 36px -16px rgba(0,0,0,.6);
  --maxw:600px;

  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,
         system-ui,"Apple Color Emoji","Segoe UI Emoji",sans-serif;
}

html[data-theme="light"]{
  --bg:#ffffff;
  --surface:#f7f9fc;
  --surface-2:#eef2f8;
  --border:#e2e7f0;
  --text:#0e1320;
  --text-muted:#586073;
  --text-subtle:#838b9c;
  --accent:#2563eb;
  --accent-hover:#1d4ed8;
  --accent-fg:#ffffff;
  --accent-soft:rgba(37,99,235,.10);
  --accent-ring:rgba(37,99,235,.45);
  --shadow:0 18px 44px -26px rgba(20,40,80,.16);
  --shadow-pop:0 16px 36px -16px rgba(20,40,80,.18);
}

/* ---- reset / base ---- */
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  font-size:var(--fs-base);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
.wrap{max-width:var(--maxw);margin:0 auto;padding:var(--sp-5) var(--sp-4) var(--sp-8)}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent-ring);outline-offset:2px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.icon{width:18px;height:18px;flex:0 0 auto}

/* =============================== header ================================= */
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--sp-6)}
.brand{
  display:inline-flex;align-items:center;gap:.5em;
  text-decoration:none;color:var(--text);
  font-weight:var(--fw-bold);font-size:1.05rem;letter-spacing:.01em;
}
.brand svg{width:1.25em;height:1.25em;flex:0 0 auto}
.brand .cal{stroke:currentColor}
.brand .day{fill:var(--accent)}
.brand:hover{color:var(--text)}

.hero{margin-bottom:var(--sp-6)}
.eyebrow-row{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);margin-bottom:var(--sp-3)}
.eyebrow{
  font-size:var(--fs-xs);font-weight:var(--fw-semi);
  text-transform:uppercase;letter-spacing:.16em;color:var(--text-subtle);
}
.pill{
  display:inline-flex;align-items:center;gap:var(--sp-2);
  padding:5px 11px 5px 9px;border-radius:var(--r-pill);
  font-size:var(--fs-xs);font-weight:var(--fw-semi);
  color:var(--accent);background:var(--accent-soft);
  white-space:nowrap;
}
.pulse{
  width:7px;height:7px;border-radius:50%;background:var(--accent);
  position:relative;flex:0 0 auto;
}
.pulse::after{
  content:"";position:absolute;inset:0;border-radius:50%;
  background:var(--accent);
  animation:pulse 2s ease-out infinite;
}
@keyframes pulse{
  0%{transform:scale(1);opacity:.65}
  70%{transform:scale(3);opacity:0}
  100%{transform:scale(3);opacity:0}
}

h1{
  font-size:var(--fs-2xl);font-weight:var(--fw-bold);
  letter-spacing:-.022em;line-height:1.08;margin:0;
}
.intro{color:var(--text-muted);font-size:var(--fs-md);margin:var(--sp-3) 0 0;max-width:48ch}

/* =============================== cards ================================= */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:var(--sp-5);
  margin:var(--sp-5) 0;
}
.card-hero{box-shadow:var(--shadow)}
.card-title{font-size:var(--fs-md);font-weight:var(--fw-semi);margin:0 0 var(--sp-4)}
.card-sub{color:var(--text-muted);font-size:var(--fs-sm);margin:calc(-1 * var(--sp-2)) 0 var(--sp-4)}

/* =============================== buttons ================================= */
.btn{
  cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-2);
  width:100%;
  border:1px solid transparent;border-radius:var(--r-pill);
  padding:14px 20px;font-size:var(--fs-base);font-weight:var(--fw-semi);
  font-family:inherit;text-decoration:none;white-space:nowrap;
  transition:transform .08s ease,background .2s ease,border-color .2s ease,color .2s ease;
}
.btn:active{transform:translateY(1px)}
.btn .icon{width:20px;height:20px}

.btn-primary{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.btn-primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}

.btn-outline{background:transparent;color:var(--text);border-color:var(--border)}
.btn-outline:hover{border-color:var(--accent);background:var(--accent-soft)}

.btn-ghost{
  background:transparent;color:var(--text-muted);border-color:transparent;
  font-weight:var(--fw-medium);font-size:var(--fs-sm);padding:10px 16px;
}
.btn-ghost:hover{color:var(--text)}

.subscribe-actions{display:flex;flex-direction:column;gap:var(--sp-3)}
.subscribe-actions .btn-ghost{margin-top:var(--sp-1)}

/* =============================== chips ================================= */
.chips{
  display:grid;grid-template-columns:repeat(3,1fr);gap:var(--sp-3);
  margin:var(--sp-5) 0;
}
.chip{
  display:flex;flex-direction:column;align-items:center;gap:var(--sp-2);
  text-align:center;
  padding:var(--sp-4) var(--sp-2);
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  color:var(--text);font-size:var(--fs-sm);font-weight:var(--fw-medium);
}
.chip .icon{width:20px;height:20px;color:var(--text-muted)}

/* ===================== setup help (native details) ===================== */
.setup{margin-top:var(--sp-4);border-top:1px solid var(--border);padding-top:var(--sp-3)}
.setup>summary{
  cursor:pointer;list-style:none;
  display:flex;align-items:center;gap:var(--sp-2);
  color:var(--text-muted);font-size:var(--fs-sm);font-weight:var(--fw-medium);
}
.setup>summary::-webkit-details-marker{display:none}
.setup>summary::after{content:"+";margin-left:auto;color:var(--text-subtle);font-size:1.1em}
.setup[open]>summary::after{content:"–"}
.setup>summary:hover{color:var(--text)}
.setup-body{margin-top:var(--sp-3)}
.hint{color:var(--text-muted);font-size:var(--fs-sm);margin:var(--sp-3) 0 0;line-height:1.6}
.hint:first-child{margin-top:0}
.hint strong{color:var(--text);font-weight:var(--fw-semi)}
.hint em{font-style:normal;color:var(--text);background:var(--surface-2);padding:1px 6px;border-radius:var(--r-sm)}

/* ===================== team picker (combobox) ===================== */
.field{position:relative}
.field .icon-lead{
  position:absolute;left:14px;top:50%;transform:translateY(-50%);
  width:18px;height:18px;color:var(--text-subtle);pointer-events:none;
}
.input{
  width:100%;
  background:var(--surface-2);border:1px solid var(--border);
  color:var(--text);border-radius:var(--r-pill);
  padding:13px 16px;font-size:var(--fs-base);font-family:inherit;
}
.input::placeholder{color:var(--text-subtle)}
.input-lead{padding-left:42px}
.input:focus-visible{outline:2px solid var(--accent-ring);outline-offset:1px;border-color:transparent}

.combo-list{
  list-style:none;margin:var(--sp-2) 0 0;padding:var(--sp-1);
  position:absolute;left:0;right:0;top:100%;z-index:20;
  max-height:280px;overflow-y:auto;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  box-shadow:var(--shadow-pop);
}
.combo-opt{
  display:flex;align-items:center;gap:var(--sp-2);
  padding:10px 12px;border-radius:var(--r-sm);cursor:pointer;
  font-size:var(--fs-sm);color:var(--text);
}
.combo-opt.active,.combo-opt:hover{background:var(--accent-soft)}
.combo-empty{padding:10px 12px;color:var(--text-muted);font-size:var(--fs-sm)}

.team-result{margin-top:var(--sp-3)}
.team-result>.subscribe-actions{margin-top:var(--sp-3)}

/* =============================== match lists ================================= */
.section-title{
  font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.12em;
  color:var(--text-subtle);font-weight:var(--fw-semi);
  margin:var(--sp-6) 0 var(--sp-3);
}
.matches{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--sp-3)}
.match{
  display:flex;align-items:center;justify-content:space-between;gap:var(--sp-4);
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  padding:var(--sp-4);
}
.match-info{min-width:0;flex:1}
.match-row{display:flex;align-items:center;gap:var(--sp-3)}
.match-team{font-weight:var(--fw-semi);font-size:var(--fs-md);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.match-score{margin-left:auto;font-weight:var(--fw-bold);font-size:var(--fs-md);color:var(--text);font-variant-numeric:tabular-nums}
.match-vs{color:var(--text-subtle);font-size:var(--fs-xs);font-weight:var(--fw-medium);margin:2px 0}
.match-meta{color:var(--text-subtle);font-size:var(--fs-xs);margin-top:var(--sp-2)}
.match-when{text-align:right;flex:0 0 auto;display:flex;flex-direction:column;line-height:1.25}
.match-day{color:var(--text-subtle);font-size:var(--fs-xs);font-weight:var(--fw-medium)}
.match-time{color:var(--text);font-size:var(--fs-sm);font-weight:var(--fw-semi);font-variant-numeric:tabular-nums}
.match.done .match-time{color:var(--text-muted)}
.muted{color:var(--text-muted);font-size:var(--fs-sm);padding:var(--sp-2) 0}

/* =============================== footer area ================================= */
.feedback{margin:var(--sp-7) 0 0;color:var(--text-muted);font-size:var(--fs-sm);line-height:1.6}
.feedback a{color:var(--accent);text-decoration:none}
.feedback a:hover{text-decoration:underline}

.support-text{color:var(--text-muted);font-size:var(--fs-sm);margin:0 0 var(--sp-4);max-width:48ch}
/* donate is a quiet neutral secondary action so blue stays the only colour that pops */
.btn-kofi{
  width:auto;background:transparent;border-color:var(--border);color:var(--text-muted);
  font-size:var(--fs-sm);padding:12px 20px;
}
.btn-kofi:hover{background:transparent;border-color:var(--text-subtle);color:var(--text)}

footer{margin-top:var(--sp-7);border-top:1px solid var(--border);padding-top:var(--sp-5);
  color:var(--text-subtle);font-size:var(--fs-xs);line-height:1.9}
footer p{margin:0}
footer a{color:var(--text-muted);text-decoration:none}
footer a:hover{color:var(--text)}
.trust{
  display:inline-flex;align-items:center;gap:var(--sp-2);
  color:var(--text-muted);font-size:var(--fs-sm);font-weight:var(--fw-medium);
  margin-bottom:var(--sp-3);
}
.trust .icon{width:15px;height:15px;color:var(--text-subtle)}

/* =============================== about page ================================= */
.about h2{font-size:var(--fs-lg);font-weight:var(--fw-semi);letter-spacing:-.01em;color:var(--text);margin:var(--sp-6) 0 var(--sp-3)}
.about p{color:var(--text-muted);margin:0 0 var(--sp-4);line-height:1.7}
.about a{color:var(--accent);text-decoration:none}
.about a:hover{text-decoration:underline}
.about .disclaimer{color:var(--text-subtle);font-size:var(--fs-sm);margin:var(--sp-6) 0 0;padding-top:var(--sp-4);border-top:1px solid var(--border)}

/* =============================== home: calendars ================================= */
.calendars{display:flex;flex-direction:column;gap:var(--sp-3);margin-top:var(--sp-3)}
.cal-card{
  display:flex;align-items:center;gap:var(--sp-3);
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  padding:var(--sp-3) var(--sp-4);text-decoration:none;color:var(--text);
  transition:border-color .2s ease,transform .08s ease,background .2s ease;
}
a.cal-card:hover{border-color:var(--accent);background:var(--accent-soft)}
a.cal-card:active{transform:translateY(1px)}
.cal-icon{
  flex:0 0 auto;width:36px;height:36px;border-radius:var(--r-md);
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--surface-2);color:var(--text);
}
.cal-icon .icon{width:19px;height:19px}
.cal-body{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}
.cal-head{display:flex;align-items:center;gap:var(--sp-2);flex-wrap:wrap}
.cal-title{font-weight:var(--fw-semi);font-size:var(--fs-base)}
.cal-sub{color:var(--text-muted);font-size:var(--fs-sm)}
.cal-go{flex:0 0 auto;width:auto;white-space:nowrap}
.cal-go .icon{width:18px;height:18px}
/* muted "coming soon" placeholder */
.cal-soon{opacity:.6}
.cal-soon .cal-icon{color:var(--text-subtle)}
.cal-soon .cal-title{color:var(--text-muted);font-weight:var(--fw-medium)}
.cal-tag{
  flex:0 0 auto;font-size:var(--fs-xs);font-weight:var(--fw-semi);
  text-transform:uppercase;letter-spacing:.1em;color:var(--text-subtle);
}

/* =============================== theme toggle ================================= */
.theme-toggle{
  position:absolute;top:var(--sp-3);right:var(--sp-3);z-index:30;
  width:40px;height:40px;border-radius:var(--r-pill);
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--surface);border:1px solid var(--border);color:var(--text);
  cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:border-color .2s ease,transform .08s ease;
}
.theme-toggle:hover{border-color:var(--accent)}
.theme-toggle:active{transform:translateY(1px)}
.theme-toggle .icon{width:18px;height:18px}
.theme-toggle .icon-moon{display:none}
html[data-theme="light"] .theme-toggle .icon-sun{display:none}
html[data-theme="light"] .theme-toggle .icon-moon{display:block}

/* =============================== team pages ================================= */
.crumbs{
  display:flex;flex-wrap:wrap;align-items:center;gap:6px;
  font-size:var(--fs-xs);color:var(--text-subtle);margin-bottom:var(--sp-5);
}
.crumbs a{color:var(--text-muted);text-decoration:none}
.crumbs a:hover{color:var(--text)}
.crumbs .sep{color:var(--text-subtle)}

.callout{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  padding:var(--sp-3) var(--sp-4);margin:var(--sp-4) 0;
  color:var(--text-muted);font-size:var(--fs-sm);line-height:1.55;
}
.callout strong{color:var(--text);font-weight:var(--fw-semi)}
.callout time{color:var(--text);font-variant-numeric:tabular-nums}

.links{margin:var(--sp-3) 0 0;font-size:var(--fs-sm)}
.links a{color:var(--accent);text-decoration:none}
.links a:hover{text-decoration:underline}

/* =================== explore / browse nav cards =================== */
.explore{display:flex;flex-direction:column;gap:var(--sp-3);margin:var(--sp-5) 0}
.nav-card{
  display:flex;align-items:center;gap:var(--sp-3);
  padding:var(--sp-4);
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  text-decoration:none;color:var(--text);
  transition:transform .08s ease,border-color .2s ease,background .2s ease;
}
.nav-card:hover{border-color:var(--accent);background:var(--accent-soft)}
.nav-card:active{transform:translateY(1px)}
.nav-card-icon{
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
  width:42px;height:42px;border-radius:var(--r-sm);
  background:var(--accent-soft);color:var(--accent);
}
.nav-card-icon .icon{width:22px;height:22px}
.nav-card-body{display:flex;flex-direction:column;min-width:0}
.nav-card-title{font-weight:var(--fw-semi);font-size:var(--fs-base);line-height:1.3}
.nav-card-desc{color:var(--text-muted);font-size:var(--fs-sm);line-height:1.35}
.nav-card-arrow{width:20px;height:20px;color:var(--text-subtle);margin-left:auto;flex:0 0 auto;transition:transform .15s ease,color .2s ease}
.nav-card:hover .nav-card-arrow{color:var(--accent);transform:translateX(2px)}

.group{margin:var(--sp-6) 0}
.group-title{font-size:var(--fs-md);font-weight:var(--fw-semi);margin:0 0 var(--sp-3)}
.standings{width:100%;border-collapse:collapse;font-size:var(--fs-sm)}
.standings th,.standings td{padding:8px 6px;text-align:center;border-bottom:1px solid var(--border)}
.standings thead th{
  color:var(--text-subtle);font-weight:var(--fw-semi);
  font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.04em;
}
.standings td{color:var(--text-muted);font-variant-numeric:tabular-nums}
.standings .pos{color:var(--text-subtle);width:1.6em}
.standings .team{text-align:left;color:var(--text);font-weight:var(--fw-medium)}
.standings .team a{color:var(--text);text-decoration:none}
.standings .team a:hover{color:var(--accent)}
.standings .pts{color:var(--text);font-weight:var(--fw-bold)}
.standings tbody tr:hover{background:var(--accent-soft)}

/* =============================== bracket ================================= */
.bracket-hint{color:var(--text-subtle);font-size:var(--fs-xs);margin:0 0 var(--sp-3)}
.bracket-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;max-width:100%;padding-bottom:var(--sp-3)}
/* the bracket page widens its column so desktop sees the whole bracket at once;
   the reading blocks stay narrow, only the bracket uses the extra width. This
   avoids the 100vw full-bleed trick (which overflows on mobile). */
body.bracket-page .wrap{max-width:920px}
body.bracket-page .crumbs,
body.bracket-page .hero,
body.bracket-page .bracket-hint,
body.bracket-page .card,
body.bracket-page .links,
body.bracket-page .feedback,
body.bracket-page footer,
body.bracket-page .bx-single{max-width:600px}
.bracket{display:inline-flex;gap:var(--sp-3);align-items:stretch}
.bx-round{display:flex;flex-direction:column;flex:0 0 160px;width:160px}
.bx-round-title{
  font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.1em;
  color:var(--text-subtle);font-weight:var(--fw-semi);margin:0 0 var(--sp-3);white-space:nowrap;
}
.bx-col{display:flex;flex-direction:column;justify-content:space-around;gap:var(--sp-3);flex:1}
.bx-single{max-width:260px}
.bx-match{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  padding:var(--sp-2) var(--sp-3);
}
.bx-side{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-2);padding:4px 0}
.bx-side + .bx-side{border-top:1px solid var(--border)}
.bx-team{
  font-size:var(--fs-sm);font-weight:var(--fw-medium);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.bx-side.tbd .bx-team{color:var(--text-subtle);font-weight:var(--fw-normal)}
.bx-side.win .bx-team{color:var(--accent);font-weight:var(--fw-semi)}
.bx-score{
  font-variant-numeric:tabular-nums;font-weight:var(--fw-semi);
  color:var(--text-muted);font-size:var(--fs-sm);
}
.bx-side.win .bx-score{color:var(--accent)}
.bx-meta{display:block;margin-top:var(--sp-2);color:var(--text-subtle);font-size:var(--fs-xs)}

/* =============================== motion ================================= */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}

/* =============================== responsive ================================= */
@media (max-width:420px){
  .chip{padding:var(--sp-3) var(--sp-1)}
  .chip span{font-size:var(--fs-xs)}
  h1{font-size:var(--fs-xl)}
  .cal-card{padding:var(--sp-4);flex-wrap:wrap}
  .cal-go{flex:1 1 100%;width:100%}
  .standings .col-opt{display:none}
  .standings th,.standings td{padding:8px 4px}
}
