/* ============================================================
   Design tokens — light / dark theming
   Dark is the default; [data-theme] is set by main.js before paint.
   ============================================================ */
:root {
  --bg:            #f4f6fb;
  --bg-secondary:  #eceff6;
  --bg-card:       #ffffff;
  --bg-elevated:   #ffffff;
  --bg-input:      #ffffff;
  --text:          #0f172a;
  --text-muted:    #5b6477;
  --text-faint:    #8a93a6;
  --border:        #e2e6ef;
  --border-strong: #cfd5e2;

  --primary:       #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft:  rgba(79, 70, 229, .10);
  --primary-text:  #ffffff;

  --accent:        #0ea371;
  --accent-soft:   rgba(14, 163, 113, .12);

  --success:       #0ea371;
  --success-soft:  rgba(14, 163, 113, .12);
  --danger:        #e11d48;
  --danger-soft:   rgba(225, 29, 72, .10);
  --warning:       #d97706;
  --warning-soft:  rgba(217, 119, 6, .12);
  --info:          #0284c7;
  --info-soft:     rgba(2, 132, 199, .10);

  --gold:          #d4a017;
  --silver:        #94a3b8;
  --bronze:        #c2703d;

  --shadow-sm:     0 1px 2px rgba(15, 23, 42, .06);
  --shadow:        0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg:     0 10px 40px rgba(15, 23, 42, .12);
  --ring:          0 0 0 3px rgba(79, 70, 229, .25);

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;

  --nav-bg:        rgba(255, 255, 255, .82);
  --nav-text:      #334155;
  --nav-h:         64px;
  --tabbar-h:      64px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:            #0a0e1a;
  --bg-secondary:  #121829;
  --bg-card:       #111727;
  --bg-elevated:   #161d30;
  --bg-input:      #0c1120;
  --text:          #e8ecf5;
  --text-muted:    #97a1b8;
  --text-faint:    #677089;
  --border:        #1f2840;
  --border-strong: #2c3654;

  --primary:       #7c73ff;
  --primary-hover: #8f88ff;
  --primary-soft:  rgba(124, 115, 255, .14);
  --primary-text:  #ffffff;

  --accent:        #34e0a1;
  --accent-soft:   rgba(52, 224, 161, .12);

  --success:       #34e0a1;
  --success-soft:  rgba(52, 224, 161, .12);
  --danger:        #ff5c7c;
  --danger-soft:   rgba(255, 92, 124, .12);
  --warning:       #fbbf24;
  --warning-soft:  rgba(251, 191, 36, .12);
  --info:          #38bdf8;
  --info-soft:     rgba(56, 189, 248, .12);

  --gold:          #fcd34d;
  --silver:        #cbd5e1;
  --bronze:        #f0a36b;

  --shadow-sm:     0 1px 2px rgba(0, 0, 0, .3);
  --shadow:        0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg:     0 16px 48px rgba(0, 0, 0, .5);
  --ring:          0 0 0 3px rgba(124, 115, 255, .35);

  --nav-bg:        rgba(10, 14, 26, .78);
  --nav-text:      #c3cadb;

  color-scheme: dark;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

/* Soft ambient glow behind content — gives depth without images */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, var(--accent-soft), transparent 60%);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--bg-secondary); padding: .1em .35em; border-radius: 5px; }
strong { font-weight: 650; }

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

::selection { background: var(--primary); color: #fff; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================================================
   Layout
   ============================================================ */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }

.main-content { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background: var(--nav-bg);
  color: var(--nav-text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--text); }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-soft);
}
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2.2; }

.nav-links {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
  flex-wrap: nowrap;
}

.nav-links a, .nav-links .btn-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--nav-text);
  padding: .5rem .8rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-links a:hover, .nav-links .btn-link:hover { color: var(--text); background: var(--bg-secondary); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-links .icon { width: 17px; height: 17px; }

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.1rem;
  border-radius: 10px;
  color: var(--nav-text);
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.btn-icon:hover { background: var(--bg-secondary); color: var(--text); border-color: var(--border-strong); }
.btn-icon .icon { width: 18px; height: 18px; pointer-events: none; }
#theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
[data-theme="dark"] #theme-toggle .icon-moon { display: none; }

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: .3rem;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1rem 1rem;
  gap: .15rem;
  position: sticky;
  top: var(--nav-h);
  z-index: 99;
  box-shadow: var(--shadow-lg);
}
.mobile-menu a, .mobile-menu .btn-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  padding: .75rem .75rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
}
.mobile-menu a:hover, .mobile-menu .btn-link:hover { background: var(--bg-secondary); text-decoration: none; }
.mobile-menu.open { display: flex; }

/* Bottom tab bar — phones only; the thumb-friendly way to move around */
.tabbar { display: none; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-faint);
  font-size: .82rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.15rem;
  border-radius: 11px;
  font-family: inherit;
  font-size: .93rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
  text-decoration: none;
  line-height: 1.35;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary  { background: var(--primary); color: var(--primary-text); box-shadow: 0 4px 14px var(--primary-soft); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-text); }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-secondary); color: var(--text); }
.btn-success  { background: var(--success); color: #04120c; }
.btn-success:hover { filter: brightness(1.07); color: #04120c; }
.btn-link     { background: none; border: none; color: var(--primary); cursor: pointer; font-family: inherit; font-size: inherit; padding: 0; }
.btn-full     { width: 100%; }
.btn-sm       { padding: .35rem .75rem; font-size: .83rem; border-radius: 9px; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-danger-outline { border: 1px solid var(--danger); color: var(--danger); background: none; }
.btn-danger-outline:hover { background: var(--danger); color: #fff; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 1rem; font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card h4 { margin: 1.4rem 0 .6rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }

/* ============================================================
   Flash messages — float in as toasts
   ============================================================ */
.flash {
  display: block;
  padding: .8rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: .93rem;
  font-weight: 500;
  border: 1px solid;
  animation: flash-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.flash-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.flash-error   { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.flash-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.flash-info    { background: var(--info-soft);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.flash-info code { background: rgba(0,0,0,.15); color: inherit; }
[data-theme="light"] .flash-success { color: #057a55; }
[data-theme="light"] .flash-info    { color: #0369a1; }
[data-theme="light"] .flash-warning { color: #92400e; }

.flash-stack {
  position: fixed;
  top: calc(var(--nav-h) + .75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(92vw, 460px);
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.flash-stack .flash {
  pointer-events: auto;
  background-color: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.flash-stack .flash-success { background-image: linear-gradient(var(--success-soft), var(--success-soft)); }
.flash-stack .flash-error   { background-image: linear-gradient(var(--danger-soft), var(--danger-soft)); }
.flash-stack .flash-warning { background-image: linear-gradient(var(--warning-soft), var(--warning-soft)); }
.flash-stack .flash-info    { background-image: linear-gradient(var(--info-soft), var(--info-soft)); }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .84rem; font-weight: 600; color: var(--text-muted); }
.form-group small  { color: var(--text-faint); font-size: .8rem; }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .85rem; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-group-btn { justify-content: flex-end; align-items: flex-end; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="email"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: .62rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  font-size: .95rem;
}
.checkbox-label small { color: var(--text-muted); font-size: .8rem; }

.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form input { flex: 1; min-width: 120px; }
.inline-form-small { display: flex; gap: .3rem; align-items: center; }

.help-text { font-size: .85rem; color: var(--text-muted); margin-top: .5rem; }

/* ============================================================
   Page header
   ============================================================ */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.page-eyebrow { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); margin-bottom: .35rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.back-link:hover { color: var(--text); text-decoration: none; }
.subtitle { color: var(--text-muted); font-size: .95rem; margin-top: .3rem; }

/* ============================================================
   Tabs — scrollable pill chips
   ============================================================ */
.tabs {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  margin: 0 -1.25rem 1.5rem;
  padding: .15rem 1.25rem .35rem;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: .45rem .95rem;
  border-radius: 999px;
  font-size: .87rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all .15s;
}
.tab:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* ============================================================
   Matches — "to-do" nudge
   ============================================================ */
.todo-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--primary-soft), var(--accent-soft));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--text);
}
.todo-banner:hover { text-decoration: none; color: var(--text); border-color: var(--primary); }
.todo-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
}
.todo-text { flex: 1; min-width: 0; }
.todo-text strong { display: block; font-size: 1rem; }
.todo-text span { font-size: .87rem; color: var(--text-muted); }
.todo-go { font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }

.todo-done {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.todo-done .todo-icon { background: var(--success); color: #04120c; }

/* ============================================================
   Match cards
   ============================================================ */
.phase-section { margin-bottom: 2.25rem; }
.phase-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: .75rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.phase-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.day-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-faint);
  margin: 1rem 0 .45rem .15rem;
}
.day-label:first-child { margin-top: 0; }
.day-label.is-today { color: var(--accent); }

.match-list { display: flex; flex-direction: column; gap: .55rem; }

.match-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr 150px;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .2s, transform .15s;
}
.match-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.match-card.needs-tip { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.match-card.needs-tip::before {
  content: "";
  position: absolute;
  left: -1px; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.match-card.finished { background: color-mix(in srgb, var(--bg-card) 70%, var(--bg)); }

.match-card-kickoff { display: flex; flex-direction: column; gap: .15rem; line-height: 1.2; }
.kick-time { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kick-status { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.kick-status.is-open { color: var(--accent); }
.kick-status.is-ft   { color: var(--text-muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.is-open .dot { box-shadow: 0 0 0 3px var(--accent-soft); }
.lock-icon { font-size: .85rem; }

.match-card-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .9rem;
  font-weight: 600;
  min-width: 0;
}
.team { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-home { justify-content: flex-end; text-align: right; }
.team-away { justify-content: flex-start; }

.flag { border-radius: 4px; vertical-align: middle; display: inline-block; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.2); flex-shrink: 0; }
.flag-sm { width: 26px; height: 19px; }
.flag-lg { border-radius: 8px; width: 72px; height: 54px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.25); }

/* Placeholder for TBD / unknown team flags */
.flag-placeholder {
  display: inline-block;
  width: 26px;
  height: 19px;
  background: repeating-linear-gradient(45deg, var(--bg-secondary), var(--bg-secondary) 4px, var(--border) 4px, var(--border) 8px);
  border-radius: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.flag-placeholder-lg { width: 72px; height: 54px; border-radius: 8px; }

.vs {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 34px;
  padding: 0 .6rem;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg-secondary);
}
.vs.score {
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
}
.vs strong { font-weight: 800; }

.match-card-pred { display: flex; justify-content: flex-end; }
.pred-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: .3rem .35rem .3rem .65rem;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.pred-badge .pred-label { font-size: .68rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.pred-badge:not(:has(.points-badge)) { padding-right: .65rem; }
.pred-good { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.pred-ok   { background: var(--info-soft);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.pred-bad  { background: var(--danger-soft);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.pred-missing { font-size: .85rem; color: var(--text-faint); }
.points-badge {
  font-size: .75rem;
  font-weight: 700;
  background: var(--text);
  color: var(--bg);
  border-radius: 7px;
  padding: .12rem .45rem;
}
.pred-good .points-badge { background: var(--success); color: #04120c; }
.pred-ok   .points-badge { background: var(--info); color: #fff; }
.pred-bad  .points-badge { background: var(--danger); color: #fff; }
.joker-icon { font-size: .9rem; }

.tip-cta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  padding: .4rem .8rem;
  border-radius: 10px;
  background: var(--primary-soft);
  transition: background .15s, color .15s;
}
.match-card:hover .tip-cta { background: var(--primary); color: #fff; }

/* ============================================================
   Match detail
   ============================================================ */
.match-hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 2rem;
  margin-bottom: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.match-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(400px 200px at 15% 0%, var(--primary-soft), transparent 70%),
    radial-gradient(400px 200px at 85% 100%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.match-hero > * { position: relative; }
.match-hero-phase {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1.25rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.match-hero-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  word-break: break-word;
  text-align: center;
}
.hero-score { text-align: center; min-width: 120px; }
.final-score {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.final-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .12em; margin-top: .4rem; }
.kickoff-time { font-size: 1.05rem; font-weight: 700; display: block; }
.kickoff-date { font-size: .85rem; color: var(--text-muted); display: block; }
.countdown {
  display: inline-block;
  margin-top: .6rem;
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.lock-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .6rem;
  padding: .25rem .65rem;
  border-radius: 999px;
}
.lock-status.locked { color: var(--danger); background: var(--danger-soft); }
.lock-status.open   { color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   Prediction form — big, thumb-friendly scoreboard with steppers
   ============================================================ */
.pred-form { display: flex; flex-direction: column; gap: 1rem; }

.pred-scoreboard {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pred-team-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem .75rem 1rem;
  gap: .75rem;
}

.pred-team-name {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  min-height: 2.4em;
}

.stepper { display: flex; align-items: center; gap: .5rem; }
.step-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s, border-color .12s, transform .08s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.step-btn:hover { border-color: var(--primary); color: var(--primary); }
.step-btn:active { transform: scale(.92); background: var(--primary-soft); }

.goals-input {
  width: 84px;
  height: 84px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0;
  border: 2px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg-card);
  color: var(--text);
  line-height: 1;
  -moz-appearance: textfield;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.goals-input::-webkit-outer-spin-button,
.goals-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.goals-input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.goals-input:not(:placeholder-shown) { border-color: var(--primary); }
.goals-input.bump { transform: scale(1.08); }

.pred-sep-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 0;
  min-width: 20px;
}
.pred-sep-colon {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-faint);
  line-height: 1;
  /* centre on the score boxes: hint + gap + half a box, minus half the colon */
  margin-bottom: 3.3rem;
}
.pred-sep-label { display: none; }

.pred-hint {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Joker — a toggle card instead of a tiny checkbox */
.joker-row {
  padding: .9rem 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.joker-row:has(input:checked) { border-color: var(--warning); background: var(--warning-soft); }
.joker-row .checkbox-label { flex-wrap: wrap; }
.joker-row .checkbox-label span { font-weight: 600; }
.joker-active { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-soft); }
.joker-used   { color: var(--text-muted); font-size: .9rem; }

.btn-predict {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: .01em;
}

.pred-summary { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 1.05rem; }
.pred-score {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: .2rem 1rem;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.points-big {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: .35rem .8rem;
  border-radius: 10px;
}

/* Stats bars */
.stat-bars { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.1rem; }
.stat-bar-row { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center; gap: .75rem; }
.stat-label { font-size: .9rem; font-weight: 500; }
.stat-bar { background: var(--bg-secondary); border-radius: 999px; height: 10px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.stat-fill.home { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #fff)); }
.stat-fill.draw { background: linear-gradient(90deg, var(--warning), color-mix(in srgb, var(--warning) 60%, #fff)); }
.stat-fill.away { background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 60%, #fff)); }
.stat-count { text-align: right; font-size: .85rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.most-common { font-size: .93rem; color: var(--text-muted); }
.result-summary { display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; padding: .9rem 1rem; background: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border); }
.result-hit { font-weight: 600; }
.prophets { color: var(--text-muted); font-size: .9rem; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap, .pred-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.card .table-wrap, .card .pred-table-wrap { border-radius: 12px; }

.leaderboard-table, .admin-table, .pred-history-table, .rules-table, .pred-table {
  width: 100%;
  /* separate + 0 spacing looks the same but keeps the inset row edges crisp */
  border-collapse: separate;
  border-spacing: 0;
  font-size: .93rem;
}
.leaderboard-table th, .admin-table th, .pred-history-table th, .rules-table th, .pred-table th {
  background: var(--bg-secondary);
  padding: .7rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.leaderboard-table td, .admin-table td, .pred-history-table td, .rules-table td, .pred-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leaderboard-table tbody tr:last-child td,
.admin-table tbody tr:last-child td,
.pred-history-table tbody tr:last-child td,
.rules-table tbody tr:last-child td,
.pred-table tbody tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr, .admin-table tbody tr, .pred-history-table tbody tr, .pred-table tbody tr { transition: background .12s; }
.leaderboard-table tbody tr:hover td, .admin-table tbody tr:hover td, .pred-history-table tbody tr:hover td, .pred-table tbody tr:hover td { background: var(--bg-secondary); }

/* Result rows: a colored edge reads cleaner than a tinted row */
.row-good td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.row-ok   td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.row-bad  td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row-me   td { background: var(--primary-soft); }
.row-me   td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.row-update td { background: var(--warning-soft); }

.num { font-variant-numeric: tabular-nums; }
.rank-cell { text-align: center; width: 56px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.points-cell { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.points-cell strong { font-weight: 800; }
.hide-sm { /* hidden on mobile, shown via media query below */ }
.player-link { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); font-weight: 600; }
.player-link:hover { color: var(--primary); text-decoration: none; }
.you-tag {
  font-size: .68rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: .12rem .45rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
  vertical-align: middle;
}
.username-tag { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
.settings-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; }
.action-cell { white-space: nowrap; }

/* Avatars — initials on a hue derived from the user id */
.avatar {
  --h: 240;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: hsl(var(--h) 80% 92%);
  background: linear-gradient(135deg, hsl(var(--h) 65% 52%), hsl(calc(var(--h) + 40) 65% 42%));
  text-transform: uppercase;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.35rem; }
.avatar-xl { width: 76px; height: 76px; font-size: 1.6rem; }

/* ============================================================
   Leaderboard podium
   ============================================================ */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.podium-spot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1.25rem .75rem 1rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .15s, border-color .15s;
}
.podium-spot:hover { transform: translateY(-2px); text-decoration: none; color: var(--text); }
.podium-spot.p1 { order: 2; padding-top: 1.75rem; padding-bottom: 1.5rem; border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--bg-card)), var(--bg-card)); }
.podium-spot.p2 { order: 1; }
.podium-spot.p3 { order: 3; }
.podium-spot.is-me { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.podium-medal {
  position: absolute;
  top: -12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  color: #1a1203;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.p1 .podium-medal { background: var(--gold); }
.p2 .podium-medal { background: var(--silver); }
.p3 .podium-medal { background: var(--bronze); }
.podium-name { font-weight: 700; font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.podium-pts { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.p1 .podium-pts { font-size: 2rem; }
.podium-pts small { font-family: var(--font); font-size: .72rem; font-weight: 600; color: var(--text-muted); margin-left: .15rem; }
.podium-badges { font-size: .95rem; min-height: 1.2em; }

/* ============================================================
   Badges
   ============================================================ */
.badges-cell { white-space: nowrap; }
.badge-icon { font-size: 1.1rem; cursor: default; }
.badge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem; }
.badge-item { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; background: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border); }
.badge-emoji { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); flex-shrink: 0; }
.badge-info strong { display: block; font-size: .93rem; }
.badge-info small  { color: var(--text-muted); font-size: .78rem; }
.ranking-note { font-size: .82rem; color: var(--text-faint); margin-top: .9rem; }

/* League UI */
.league-banner {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.league-context-tag {
  font-size: .72rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  padding: .15rem .55rem;
  border-radius: 999px;
  vertical-align: middle;
}
.league-stat-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab-sm {
  padding: .3rem .75rem;
  font-size: .8rem;
  font-weight: 500;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .15s;
}
.tab-sm:hover { background: var(--bg-secondary); text-decoration: none; color: var(--text); }
.tab-sm.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.empty-league-card { text-align: center; padding: 2.5rem; }

/* Admin league management */
.league-card-header { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.league-card-header h3 { margin-bottom: 0; }
.member-list { display: flex; flex-direction: column; gap: .4rem; }
.member-row { display: flex; align-items: center; justify-content: space-between; padding: .45rem .7rem; background: var(--bg-secondary); border-radius: 9px; }
.admin-tag { background: var(--warning); color: #1a1203; padding: .1rem .4rem; border-radius: 5px; font-size: .7rem; font-weight: 700; }
.league-tag { display: inline-block; background: var(--primary-soft); color: var(--primary); font-size: .74rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; margin: .1rem .1rem; }

/* Match visibility */
.bulk-actions { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: .5rem; }
.visibility-cell { width: 44px; text-align: center; }
.btn-visibility {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; padding: .2rem; border-radius: 6px;
  transition: transform .1s;
}
.btn-visibility:hover { transform: scale(1.2); }
.vis-off { opacity: .35; }
.row-hidden td { opacity: .55; }

/* ============================================================
   Profile
   ============================================================ */
.profile-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.5rem; }
.profile-head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card:first-child .stat-value { color: var(--primary); }
.stat-name  { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }

.phase-tag { display: block; font-size: .75rem; color: var(--text-faint); margin-top: .1rem; }
.profile-meta { color: var(--text-muted); font-size: .9rem; margin-top: .2rem; }

/* ============================================================
   Rules page
   ============================================================ */
.rules-card { max-width: 780px; }
.rules-card p  { margin-bottom: .9rem; line-height: 1.7; color: var(--text-muted); }
.rules-card p strong { color: var(--text); }
.rules-card ol, .rules-card ul { padding-left: 1.4rem; color: var(--text-muted); }
.rules-card li { margin-bottom: .45rem; line-height: 1.7; }
.rules-card .rules-table { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rule-note { font-size: .9rem; color: var(--text-muted); background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); padding: .7rem .9rem; border-radius: 10px; margin-bottom: .75rem; }
.highlight-row td { font-weight: 700; background: var(--primary-soft); }

/* ============================================================
   Login / join pages
   ============================================================ */
.login-page { background: var(--bg); }
.login-page::before {
  background:
    radial-gradient(600px 400px at 20% 20%, var(--primary-soft), transparent 70%),
    radial-gradient(600px 400px at 80% 80%, var(--accent-soft), transparent 70%);
}
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 400px;
}
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-logo {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-soft);
}
.login-logo .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.login-header h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; margin: .9rem 0 .2rem; }
.login-header p { color: var(--text-muted); font-size: .92rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.login-form .btn { padding: .8rem; font-size: 1rem; margin-top: .25rem; }
.theme-toggle-login { position: fixed; top: 1rem; right: 1rem; }

.demo-box {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .9rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: var(--info-soft);
  border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
}
.demo-title { font-size: .78rem; font-weight: 700; color: var(--info); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .1rem; }
.demo-cred {
  display: flex;
  align-items: center;
  gap: .45rem;
  width: 100%;
  padding: .55rem .7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, transform .08s;
}
.demo-cred:hover { border-color: var(--primary); }
.demo-cred:active { transform: scale(.99); }
.demo-role { font-weight: 600; min-width: 3.6rem; }
.demo-sep { color: var(--text-faint); }
.demo-note { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }

/* ============================================================
   Admin forms
   ============================================================ */
.match-form { display: flex; flex-direction: column; gap: .8rem; }
.result-form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.result-inputs { display: flex; align-items: center; gap: .75rem; }
.result-inputs .form-group { flex: 1; max-width: 120px; }
.match-hero-compact { margin-bottom: 1rem; line-height: 1.8; }
.current-result { padding: .6rem .85rem; background: var(--bg-secondary); border-radius: 10px; margin-bottom: .75rem; font-size: .95rem; }
.filter-card { padding: .9rem 1.25rem; }
.filter-form .form-row { margin-bottom: 0; }
.old-value { color: var(--text-muted); text-decoration: line-through; }
.create-tag { font-size: .75rem; background: var(--success); color: #04120c; padding: .1rem .4rem; border-radius: 5px; font-weight: 700; }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state { color: var(--text-muted); text-align: center; padding: 2.5rem 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .container { padding: 0 1rem; }
  .tabs { margin: 0 -1rem 1.25rem; padding: .15rem 1rem .35rem; }
  .main-content { padding-top: 1.25rem; padding-bottom: calc(var(--tabbar-h) + 2rem + env(safe-area-inset-bottom)); }
  .has-tabbar .footer { padding-bottom: calc(var(--tabbar-h) + 1.25rem + env(safe-area-inset-bottom)); }

  .nav-links { display: none; }
  .hamburger { display: grid; margin-left: auto; }
  .has-tabbar .hamburger { display: none; }
  .has-tabbar #theme-toggle { margin-left: auto; }

  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 150;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
  .tabbar a, .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    font-family: inherit;
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-faint);
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .icon { width: 22px; height: 22px; pointer-events: none; }
  .tabbar span { pointer-events: none; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a.active .icon { stroke-width: 2.4; }

  .has-tabbar .mobile-menu { position: fixed; top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); left: 0; right: 0; border-top: 1px solid var(--border); border-bottom: none; border-radius: 18px 18px 0 0; padding-top: 1rem; }

  .flash-stack { top: calc(var(--nav-h) + .5rem); }

  .match-card {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: .7rem .75rem;
    padding: .85rem .95rem;
  }
  .match-card-kickoff { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; gap: .6rem; }
  .kick-time { font-size: .88rem; }
  .match-card-pred    { grid-column: 2; grid-row: 1; }
  .match-card-teams   { grid-column: 1 / -1; grid-row: 2; gap: .6rem; font-size: .93rem; }
  .vs { min-width: 50px; height: 30px; }
  .team { gap: .45rem; }
  .team-name { white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
  .flag-sm, .flag-placeholder:not(.flag-placeholder-lg) { width: 22px; height: 16px; }

  .todo-banner { padding: .85rem .95rem; gap: .8rem; }
  .todo-icon { width: 36px; height: 36px; }
  .todo-text span { display: none; }
  .todo-text strong { font-size: .93rem; }
  .tip-cta { padding: .3rem .65rem; font-size: .8rem; }

  .match-hero { padding: 1.4rem 1rem 1.6rem; }
  .match-hero-teams { gap: .5rem; }
  .hero-team { font-size: .98rem; }
  .flag-lg, .flag-placeholder-lg { width: 56px; height: 42px; }
  .final-score { font-size: 2.5rem; }
  .hero-score { min-width: 90px; }

  .pred-team-col { padding: 1rem .35rem .9rem; }
  /* On phones the +/- sit under the box as two wide, thumb-sized buttons */
  .stepper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "score score" "minus plus";
    gap: .45rem;
    width: 100%;
    max-width: 150px;
  }
  .stepper .goals-input { grid-area: score; width: 100%; height: 76px; font-size: 2.5rem; border-radius: 16px; }
  .stepper .step-btn[data-step="-1"] { grid-area: minus; }
  .stepper .step-btn[data-step="1"]  { grid-area: plus; }
  .step-btn { width: 100%; height: 44px; font-size: 1.4rem; }
  .pred-sep-colon { font-size: 1.8rem; margin-bottom: 6.4rem; }

  .podium { gap: .5rem; }
  .podium-spot { padding: 1.1rem .4rem .8rem; }
  .podium-spot.p1 { padding-top: 1.4rem; padding-bottom: 1.1rem; }
  .podium-name { font-size: .82rem; }
  .podium-pts { font-size: 1.3rem; }
  .p1 .podium-pts { font-size: 1.6rem; }
  .podium .avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

  .hide-sm { display: none; }
  .avatar { width: 30px; height: 30px; font-size: .7rem; }
  .leaderboard-table td, .leaderboard-table th { padding: .65rem .6rem; }
  .stat-bar-row { grid-template-columns: 100px 1fr 28px; gap: .5rem; }
  .stat-label { font-size: .82rem; }
  .card { padding: 1.1rem; }
}


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