/* ============================================================
   TEAM PICKER - "Pitch" minimal design system
   One warm-neutral palette + a single orange accent.
   Light is default; [data-theme="dark"] overrides.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* warm-neutral light palette */
  --bg:        #ffffff;
  --bg-2:      #f1efea;
  --surface:   #ffffff;
  --surface-2: #f4f2ee;
  --surface-3: #eceae4;
  --border:    #e6e3dc;
  --border-2:  #dcd8cf;
  --text:      #1b1a17;
  --text-2:    #6c685f;
  --text-3:    #9a958b;

  /* single accent: football pitch green */
  --accent:        #2e7d32;
  --accent-press:  #1b5e20;
  --accent-weak:   rgba(46, 125, 50, 0.10);
  --accent-ring:   rgba(46, 125, 50, 0.22);
  --on-accent:     #ffffff;

  /* muted semantic tints (very restrained, for record/outcome) */
  --pos:  #3f7d52;   /* win  */
  --warn: #b07a1a;   /* draw */
  --neg:  #b34a3f;   /* loss */
  --pos-weak:  rgba(63, 125, 82, 0.12);
  --warn-weak: rgba(176, 122, 26, 0.12);
  --neg-weak:  rgba(179, 74, 63, 0.12);

  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius:    10px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-pop: 0 16px 50px -12px rgba(28, 24, 18, 0.22), 0 2px 6px -1px rgba(28, 24, 18, 0.08);
  --shadow-sm:  0 1px 2px rgba(28, 24, 18, 0.05);

  --font: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --t: .18s var(--ease);

  --maxw: 1160px;
}

[data-theme="dark"] {
  --bg:        #000000;
  --bg-2:      #0e0d0c;
  --surface:   #1a1917;
  --surface-2: #211f1c;
  --surface-3: #2a2723;
  --border:    #2c2925;
  --border-2:  #383430;
  --text:      #f4f2ee;
  --text-2:    #a7a299;
  --text-3:    #6f6a62;

  --accent:        #4ade80;
  --accent-press:  #22c55e;
  --accent-weak:   rgba(74, 222, 128, 0.13);
  --accent-ring:   rgba(74, 222, 128, 0.26);
  --on-accent:     #052e16;

  --pos:  #6fc088;
  --warn: #e0b25a;
  --neg:  #e08b80;
  --pos-weak:  rgba(111, 192, 136, 0.13);
  --warn-weak: rgba(224, 178, 90, 0.13);
  --neg-weak:  rgba(224, 139, 128, 0.13);

  --shadow-pop: 0 18px 56px -12px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
}

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

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }
/* The legal footer is a fixed bar, so content has to stop above it or the
   last line scrolls underneath. The mobile block raises this to clear the
   tab bar as well. */
body { padding-bottom: 44px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01";
  font-size: 15px;
  line-height: 1.5;
  transition: background var(--t), color var(--t);
}

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}

svg.ic { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: block; }
svg.ic-sm { width: 15px; height: 15px; }
svg.ic-lg { width: 22px; height: 22px; }

/* ---------- Inputs ---------- */
input, select, textarea {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  width: 100%;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  -webkit-appearance: none; appearance: none;
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: var(--surface-2); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239a958b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 34px; cursor: pointer;
}
label.field { display: block; }
label.field > span.lbl {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; letter-spacing: 0.01em;
}
.req { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
  user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn .ic, .btn .ic-sm { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-press); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-3); }
[data-theme="dark"] .btn-ghost { background: var(--surface-2); }
[data-theme="dark"] .btn-ghost:hover { background: var(--surface-3); }

.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: transparent; color: var(--neg); border-color: color-mix(in srgb, var(--neg) 32%, transparent); }
.btn-danger:hover { background: var(--neg-weak); }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon {
  padding: 0; width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-2); border: 1px solid transparent;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; }

/* chip / pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: var(--surface-2);
  color: var(--text-2); border: 1px solid var(--border);
}
.pill-accent { background: var(--accent-weak); color: var(--accent); border-color: transparent; font-variant-numeric: tabular-nums; }

/* ---------- Avatar ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: -0.02em;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border);
}
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-accent { background: var(--accent-weak); color: var(--accent); border-color: transparent; }

/* ---------- App shell ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: env(safe-area-inset-top) 26px 0;
  height: calc(62px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

/* ---------- Bottom tab bar (mobile only; shown via media query) ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar:empty { display: none; }
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  height: 56px;
  color: var(--text-3); font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: color var(--t);
  -webkit-tap-highlight-color: transparent;
}
.tabbar a.active { color: var(--accent); }
.tabbar a .ic { width: 22px; height: 22px; stroke-width: 2; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.03em; font-size: 16px; white-space: nowrap; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
}
.brand .mark svg { width: 17px; height: 17px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background var(--t), color var(--t); cursor: pointer;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active .ic { color: var(--accent); }
.appbar .spacer { flex: 1; }
.appbar-right { display: flex; align-items: center; gap: 10px; }
.userchip { display: inline-flex; align-items: center; gap: 9px; padding: 4px 4px 4px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.userchip .nm { font-size: 13px; font-weight: 600; color: var(--text-2); }

.page { max-width: var(--maxw); margin: 0 auto; padding: 34px 26px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

/* ============================================================
   View transitions
   ============================================================ */
.view { display: none; }
.view.active { display: block; }
@media (prefers-reduced-motion: reduce) { .view, .fadeup { animation: none !important; } }

.fadeup { }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Homepage SEO prose block
   Server-rendered on the home view so crawlers see real content
   whether or not they execute the SPA JS. Kept below main#app so
   it's not clobbered by the SPA's view-swap logic.
   ============================================================ */
.seo-content {
  max-width: 780px; width: calc(100% - 40px);
  margin: 8px auto 96px; padding: 32px 32px 48px;
  color: var(--text-2); font-size: 15px; line-height: 1.7;
  text-align: left;
}
.seo-content h2 {
  color: var(--text); font-size: 22px; margin: 40px 0 12px;
  letter-spacing: -0.01em;
}
.seo-content h2:first-child { margin-top: 0; }
.seo-content p { margin-bottom: 14px; }
.seo-content strong { color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  .seo-content { padding: 24px 20px 40px; font-size: 14.5px; }
  .seo-content h2 { font-size: 19px; }

  /* Appbar keeps brand + user chip + logout; primary nav moves to tabbar */
  .appbar {
    padding: env(safe-area-inset-top) 12px 0;
    gap: 10px;
    height: calc(56px + env(safe-area-inset-top));
  }
  .appbar .nav { display: none; }
  .userchip { padding: 3px 3px 3px 8px; }
  .userchip .nm { display: none; }

  /* Show bottom tab bar and leave room in the scroll area for it */
  .tabbar { display: flex; }
  /* Two stacked bars at the bottom: the 56px tab bar, and the legal
     footer bar sitting flush on top of it. Content has to clear both or
     it scrolls underneath and collides with the words. */
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

  .page { padding: 22px 16px 40px; }
  .page-head h1 { font-size: 24px; }
}

/* The brand mark is a filled glyph, not a stroked path like every other
   icon, so it has to opt out of the stroke svg.ic applies. Higher
   specificity than svg.ic, so no !important needed.
   Scoped tightly to .brand: .mark-lg looks similar but holds ordinary
   stroked icons (mail, key, alert, check, x) on the auth screens, and
   filling those would turn each one into a solid wedge. */
.brand .mark svg { fill: currentColor; stroke: none; }
