/* ==========================================================================================================
   FootballEval design system
   Inspired by the "Apex Academy Telemetry" (dark) and "Tactical Pitch Telemetry" (light) concepts:
   pitch-emerald accent, amber for ratings, tight 4-8px corners, tonal surfaces instead of heavy shadows.
   Self-hosted fonts (no third-party requests). Standalone: no CSS framework.
   ========================================================================================================== */

/* ---- Fonts -------------------------------------------------------------------------------------------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/inter-greek-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Chivo'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/chivo-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---- Tokens -------------------------------------------------------------------------------------------- */
:root {
  --fe-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Chivo has no Greek letters: Greek headings fall back to Inter automatically. */
  --fe-font-display: 'Chivo', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fe-r-sm: 4px; --fe-r-md: 8px; --fe-r-lg: 12px; --fe-r-pill: 999px;
  --fe-nav-h: 64px; --fe-topbar-h: 60px; --fe-sidebar-w: 240px;
  --fe-safe-top: env(safe-area-inset-top, 0px); --fe-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark: "Apex Academy Telemetry" (also the default if no theme has been chosen yet). */
:root, :root[data-theme='dark'] {
  color-scheme: dark;
  --fe-bg: #0b1118;
  --fe-surface: #111a24;          /* level 1: cards */
  --fe-surface-2: #192534;        /* level 2: sheets, active panels */
  --fe-surface-3: #203144;        /* level 3: floating chips */
  --fe-inset: #0b1118;            /* recessed fields inside cards */
  --fe-border: #1e293b;
  --fe-border-strong: #334155;
  --fe-text: #f8fafc;
  --fe-muted: #94a3b8;
  --fe-faint: #64748b;
  --fe-primary: #10b981;
  --fe-primary-hover: #34d399;
  --fe-on-primary: #04130c;
  --fe-primary-soft: rgba(16, 185, 129, 0.15);
  --fe-primary-text: #34d399;
  --fe-amber: #fbbf24;
  --fe-amber-strong: #f59e0b;
  --fe-amber-soft: rgba(245, 158, 11, 0.14);
  --fe-amber-text: #fbbf24;
  --fe-red: #f87171;
  --fe-red-soft: rgba(248, 113, 113, 0.14);
  --fe-red-text: #fca5a5;
  --fe-blue-soft: rgba(96, 165, 250, 0.14);
  --fe-blue-text: #93c5fd;
  --fe-glow: none;        /* no glows or blurs anywhere: flat, crisp surfaces */
  --fe-glow-amber: none;
  --fe-shadow-1: none;
  --fe-shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --fe-shadow-3: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  --fe-scrim: rgba(3, 7, 12, 0.7);
  --fe-hero: none;
}

/* Light: "Tactical Pitch Telemetry". */
:root[data-theme='light'] {
  color-scheme: light;
  --fe-bg: #f8fafc;
  --fe-surface: #ffffff;
  --fe-surface-2: #f1f5f9;
  --fe-surface-3: #e2e8f0;
  --fe-inset: #f8fafc;
  --fe-border: #e2e8f0;
  --fe-border-strong: #cbd5e1;
  --fe-text: #0f172a;
  --fe-muted: #64748b;
  --fe-faint: #94a3b8;
  --fe-primary: #059669;
  --fe-primary-hover: #10b981;
  --fe-on-primary: #ffffff;
  --fe-primary-soft: #ecfdf5;
  --fe-primary-text: #065f46;
  --fe-amber: #f59e0b;
  --fe-amber-strong: #d97706;
  --fe-amber-soft: #fffbeb;
  --fe-amber-text: #92400e;
  --fe-red: #ef4444;
  --fe-red-soft: #fef2f2;
  --fe-red-text: #991b1b;
  --fe-blue-soft: #eff6ff;
  --fe-blue-text: #1e40af;
  --fe-glow: none;
  --fe-glow-amber: none;
  --fe-shadow-1: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
  --fe-shadow-2: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --fe-shadow-3: 0 12px 28px -6px rgba(15, 23, 42, 0.12);
  --fe-scrim: rgba(15, 23, 42, 0.4);
  --fe-hero: none;
}

/* ---- Reset (the app no longer depends on a CSS framework) ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
summary::-webkit-details-marker { display: none; }

/* ---- Base ---------------------------------------------------------------------------------------------- */
body {
  margin: 0; background: var(--fe-bg); color: var(--fe-text);
  font-family: var(--fe-font-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding: 0 !important; /* the app shell handles safe areas itself */
}
h1, h2, h3, h4 { font-family: var(--fe-font-display); letter-spacing: -0.01em; color: var(--fe-text); }
a { color: var(--fe-primary-text); }
:focus-visible { outline: 2px solid var(--fe-primary); outline-offset: 2px; }
::selection { background: var(--fe-primary-soft); }
.fe-num { font-family: var(--fe-font-display); font-variant-numeric: tabular-nums; }
.fe-muted { color: var(--fe-muted); }
.fe-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.fe-icon { flex: none; vertical-align: middle; }

.fe-eyebrow { font-family: var(--fe-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fe-primary-text); }
.fe-label { font-family: var(--fe-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fe-muted); }
.fe-title { font-family: var(--fe-font-display); font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.fe-subtitle { color: var(--fe-muted); font-size: 14px; margin: 4px 0 0; }
.fe-h2 { font-family: var(--fe-font-display); font-size: 18px; font-weight: 700; margin: 0; }
@media (min-width: 768px) { .fe-title { font-size: 30px; } }

/* ---- App shell ----------------------------------------------------------------------------------------- */
.fe-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.fe-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  min-height: calc(var(--fe-topbar-h) + var(--fe-safe-top)); padding: var(--fe-safe-top) 16px 0;
  background: var(--fe-bg);
  border-bottom: 1px solid var(--fe-border);
}
.fe-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--fe-text); }
.fe-brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.fe-brand-mark img, .fe-login-mark img { width: 100%; height: 100%; display: block; }
.fe-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.fe-brand-text b { font-family: var(--fe-font-display); font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fe-topbar-spacer { flex: 1; }
.fe-iconbtn {
  width: 40px; height: 40px; border-radius: var(--fe-r-md); display: inline-grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--fe-border); color: var(--fe-muted); transition: color .15s, border-color .15s, background .15s;
}
.fe-iconbtn:hover { color: var(--fe-text); border-color: var(--fe-border-strong); }
.fe-avatar-btn { padding: 0; border-radius: 50%; border: 1px solid var(--fe-border-strong); background: var(--fe-surface-2); color: var(--fe-text);
  width: 40px; height: 40px; cursor: pointer; font-family: var(--fe-font-display); font-weight: 800; font-size: 13px; }

.fe-body { flex: 1; display: flex; min-width: 0; }
.fe-main { flex: 1; min-width: 0; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(var(--fe-nav-h) + var(--fe-safe-bottom) + 96px); }
@media (min-width: 1024px) { .fe-main { padding: 28px 32px 48px; } }

/* Sidebar (desktop) */
.fe-sidebar { display: none; }
@media (min-width: 1024px) {
  .fe-sidebar {
    display: flex; flex-direction: column; gap: 4px; width: var(--fe-sidebar-w); flex: none; padding: 20px 14px;
    position: sticky; top: calc(var(--fe-topbar-h) + var(--fe-safe-top)); height: calc(100vh - var(--fe-topbar-h) - var(--fe-safe-top));
    border-right: 1px solid var(--fe-border); background: var(--fe-bg);
  }
}
.fe-navlink {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--fe-r-md);
  color: var(--fe-muted); text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent; transition: background .15s, color .15s;
}
.fe-navlink:hover { color: var(--fe-text); background: var(--fe-surface); }
.fe-navlink.active { color: var(--fe-primary-text); background: var(--fe-primary-soft); border-color: color-mix(in srgb, var(--fe-primary) 40%, transparent); }
.fe-sidebar-foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--fe-faint); }

/* Bottom navigation (phones & tablets) */
.fe-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 6px 8px calc(6px + var(--fe-safe-bottom)); background: var(--fe-surface); border-top: 1px solid var(--fe-border);
}
.fe-bottomnav .fe-navlink { flex-direction: column; justify-content: center; gap: 2px; padding: 4px 2px; min-height: 48px; font-size: 10px; letter-spacing: 0.03em; text-align: center; }
@media (min-width: 1024px) { .fe-bottomnav { display: none; } }

/* Account menu */
.fe-menu { position: absolute; right: 12px; top: calc(var(--fe-topbar-h) + var(--fe-safe-top) - 4px); min-width: 240px; z-index: 60;
  background: var(--fe-surface-2); border: 1px solid var(--fe-border-strong); border-radius: var(--fe-r-lg); box-shadow: var(--fe-shadow-3); padding: 8px; }
.fe-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--fe-border); margin-bottom: 6px; }
.fe-menu-head b { display: block; font-family: var(--fe-font-display); }
.fe-menu-head span { color: var(--fe-muted); font-size: 12px; word-break: break-all; }
.fe-menu button { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 0; background: transparent; color: var(--fe-text); border-radius: var(--fe-r-md); cursor: pointer; font: inherit; font-size: 14px; }
.fe-menu button:hover { background: var(--fe-surface-3); }
.fe-menu-backdrop { position: fixed; inset: 0; z-index: 50; }

/* ---- Cards / layout helpers ---------------------------------------------------------------------------- */
.fe-card { background: var(--fe-surface); border: 1px solid var(--fe-border); border-radius: var(--fe-r-lg); padding: 16px; box-shadow: var(--fe-shadow-1); }
.fe-card + .fe-card { margin-top: 12px; }
.fe-grid > .fe-card, .fe-stack > .fe-card, .fe-stack > * + .fe-card, .fe-row > .fe-card { margin-top: 0; }
.fe-card--hero { background: var(--fe-hero), var(--fe-surface); }
.fe-card--raised { background: var(--fe-surface-2); border-color: var(--fe-border-strong); box-shadow: var(--fe-shadow-2); }
.fe-section { margin-top: 20px; }
.fe-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fe-stack { display: flex; flex-direction: column; gap: 12px; }
.fe-row { display: flex; align-items: center; gap: 12px; }
.fe-row--wrap { flex-wrap: wrap; }
.fe-grow { flex: 1; min-width: 0; }
.fe-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .fe-grid--2, .fe-grid--cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .fe-grid--cards { grid-template-columns: repeat(3, 1fr); } }
.fe-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.fe-divider { height: 1px; background: var(--fe-border); margin: 12px 0; border: 0; }
.fe-center { text-align: center; }
.fe-empty { text-align: center; padding: 36px 16px; color: var(--fe-muted); border: 1px dashed var(--fe-border-strong); border-radius: var(--fe-r-lg); }
.fe-empty .fe-icon { color: var(--fe-faint); margin-bottom: 8px; }

/* ---- Buttons ------------------------------------------------------------------------------------------- */
.fe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--fe-r-md); border: 1px solid var(--fe-border-strong); background: var(--fe-surface-2); color: var(--fe-text);
  font-family: var(--fe-font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.03em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.fe-btn:hover { border-color: var(--fe-primary); }
.fe-btn:active { transform: translateY(1px); }
.fe-btn[disabled], .fe-btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.fe-btn--primary { background: var(--fe-primary); border-color: var(--fe-primary); color: var(--fe-on-primary); box-shadow: var(--fe-glow); }
.fe-btn--primary:hover { background: var(--fe-primary-hover); border-color: var(--fe-primary-hover); }
.fe-btn--ghost { background: transparent; }
.fe-btn--amber { background: var(--fe-amber-strong); border-color: var(--fe-amber-strong); color: #1a1100; }
.fe-btn--amber:hover { border-color: var(--fe-amber); background: var(--fe-amber); }
.fe-btn--danger { background: var(--fe-red-soft); border-color: color-mix(in srgb, var(--fe-red) 45%, transparent); color: var(--fe-red-text); }
.fe-btn--danger:hover { border-color: var(--fe-red); }
.fe-btn--block { display: flex; width: 100%; }
.fe-btn--sm { min-height: 36px; padding: 0 12px; font-size: 12px; }
.fe-btn--icon { padding: 0; width: 44px; }
.fe-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.fe-btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--fe-on-primary) transparent var(--fe-on-primary) transparent; animation: fe-spin .8s linear infinite; }
.fe-btn:not(.fe-btn--primary).is-loading::after { border-color: var(--fe-text) transparent var(--fe-text) transparent; }
@keyframes fe-spin { to { transform: rotate(360deg); } }
.fe-btn-hint { display: block; font-family: var(--fe-font-body); font-size: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .8; margin-top: 1px; }

/* ---- Chips, tags, badges ------------------------------------------------------------------------------- */
.fe-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fe-chips::-webkit-scrollbar { display: none; }
.fe-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--fe-r-pill);
  background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-muted); font-family: var(--fe-font-display);
  font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.fe-chip:hover { border-color: var(--fe-border-strong); color: var(--fe-text); }
.fe-chip.is-active { background: var(--fe-primary-soft); border-color: var(--fe-primary); color: var(--fe-text); }
.fe-chip.is-active .fe-dot { background: var(--fe-primary); }
.fe-chip .fe-count { color: var(--fe-faint); font-weight: 600; }

.fe-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--fe-r-sm); border: 1px solid var(--fe-border-strong);
  background: var(--fe-surface-2); color: var(--fe-muted); font-family: var(--fe-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.5;
}
.fe-tag--green { background: var(--fe-primary-soft); border-color: color-mix(in srgb, var(--fe-primary) 45%, transparent); color: var(--fe-primary-text); }
.fe-tag--amber { background: var(--fe-amber-soft); border-color: color-mix(in srgb, var(--fe-amber-strong) 45%, transparent); color: var(--fe-amber-text); }
.fe-tag--red { background: var(--fe-red-soft); border-color: color-mix(in srgb, var(--fe-red) 45%, transparent); color: var(--fe-red-text); }
.fe-tag--blue { background: var(--fe-blue-soft); border-color: color-mix(in srgb, #60a5fa 45%, transparent); color: var(--fe-blue-text); }
.fe-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--fe-r-pill); font-size: 12px; font-weight: 600; background: var(--fe-surface-2); border: 1px solid var(--fe-border); color: var(--fe-muted); }
.fe-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fe-faint); display: inline-block; flex: none; }
.fe-dot--green { background: var(--fe-primary); } .fe-dot--amber { background: var(--fe-amber-strong); } .fe-dot--red { background: var(--fe-red); }
.fe-score {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 10px; border-radius: var(--fe-r-sm); white-space: nowrap; flex: none; font-family: var(--fe-font-display); font-weight: 800; font-size: 14px;
  background: var(--fe-amber-soft); border: 1px solid color-mix(in srgb, var(--fe-amber-strong) 45%, transparent); color: var(--fe-amber-text);
}
.fe-score small { font-weight: 600; font-size: 11px; opacity: .75; }
.fe-score--none { background: var(--fe-surface-2); border-color: var(--fe-border); color: var(--fe-faint); }

/* ---- Stats --------------------------------------------------------------------------------------------- */
.fe-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fe-stat { background: var(--fe-surface); border: 1px solid var(--fe-border); border-radius: var(--fe-r-md); padding: 10px 6px; text-align: center; box-shadow: var(--fe-shadow-1); }
.fe-stat b { display: block; font-family: var(--fe-font-display); font-weight: 900; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fe-stat span { display: block; margin-top: 2px; font-family: var(--fe-font-display); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fe-muted); }
.fe-stat--green b { color: var(--fe-primary-text); } .fe-stat--amber b { color: var(--fe-amber-text); }

/* ---- Avatar -------------------------------------------------------------------------------------------- */
.fe-avatar {
  position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--fe-r-md);
  font-family: var(--fe-font-display); font-weight: 800; font-size: 17px; background: var(--fe-surface-2); color: var(--fe-text); border: 2px solid var(--fe-border-strong);
}
.fe-avatar--gk { border-color: #38bdf8; } .fe-avatar--df { border-color: #818cf8; } .fe-avatar--mf { border-color: var(--fe-primary); } .fe-avatar--fw { border-color: var(--fe-amber-strong); }
.fe-avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.fe-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.fe-avatar--photo { overflow: hidden; padding: 0; } .fe-avatar--photo img { object-fit: cover; padding: 0; border-radius: inherit; }

/* ---- Player card --------------------------------------------------------------------------------------- */
.fe-player { display: flex; flex-direction: column; gap: 12px; }
.fe-player .fe-actions { margin-top: auto; }
.fe-player-head { display: flex; align-items: center; gap: 12px; }
.fe-player-name { font-family: var(--fe-font-display); font-weight: 700; font-size: 17px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.fe-player-meta { color: var(--fe-muted); font-size: 13px; margin: 2px 0 0; }
.fe-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fe-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--fe-inset); border: 1px solid var(--fe-border); border-radius: var(--fe-r-md); font-size: 13px; }
.fe-kv .fe-label { white-space: nowrap; }
.fe-kv b { font-family: var(--fe-font-display); }
.fe-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* ---- Score ring ---------------------------------------------------------------------------------------- */
.fe-ring { --pct: 0; --ring: var(--fe-amber-strong); position: relative; width: 72px; height: 72px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--fe-surface-3) 0); display: grid; place-items: center; }
.fe-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--fe-surface); }
.fe-ring-inner { position: relative; text-align: center; line-height: 1; }
.fe-ring-inner b { display: block; font-family: var(--fe-font-display); font-weight: 900; font-size: 15px; color: var(--fe-amber-text); }
.fe-ring-inner span { font-size: 8px; font-weight: 700; letter-spacing: 0.08em; color: var(--fe-muted); }
.fe-bigscore { font-family: var(--fe-font-display); font-weight: 900; font-size: 40px; line-height: 1; color: var(--fe-amber-text); font-variant-numeric: tabular-nums; }
.fe-bigscore small { font-size: 16px; font-weight: 600; color: var(--fe-muted); }

/* ---- Progress bars ------------------------------------------------------------------------------------- */
.fe-bar { height: 8px; border-radius: var(--fe-r-pill); background: var(--fe-surface-3); overflow: hidden; }
.fe-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--fe-primary); width: calc(var(--w, 0) * 1%); transition: width .3s; }
.fe-bar--amber > i { background: var(--fe-amber-strong); }

/* ---- Tabs (category pills) ----------------------------------------------------------------------------- */
.fe-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.fe-tabs::-webkit-scrollbar { display: none; }
.fe-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--fe-r-md);
  background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-muted); font-weight: 600; font-size: 13px; cursor: pointer; transition: all .15s; font-family: inherit;
}
.fe-tab:hover { color: var(--fe-text); border-color: var(--fe-border-strong); }
.fe-tab.is-active { background: var(--fe-primary); border-color: var(--fe-primary); color: var(--fe-on-primary); font-weight: 700; box-shadow: var(--fe-glow); }
.fe-tab.is-off { opacity: .55; }
.fe-tab .fe-dot { background: var(--fe-border-strong); }
.fe-tab .fe-dot--green { background: var(--fe-primary); }
.fe-tab.is-active .fe-dot { background: var(--fe-on-primary); }

/* ---- Rating stars -------------------------------------------------------------------------------------- */
.fe-stars { display: flex; justify-content: center; gap: 6px; padding: 8px; background: var(--fe-inset); border: 1px solid var(--fe-border); border-radius: var(--fe-r-md); }
.fe-star { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--fe-border-strong); line-height: 0; border-radius: var(--fe-r-sm); transition: transform .1s, color .15s; }
.fe-star:hover { transform: scale(1.12); }
.fe-star:active { transform: scale(.94); }
.fe-star.is-on { color: var(--fe-amber); }
.fe-metric { display: flex; flex-direction: column; gap: 10px; }
.fe-metric-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fe-metric-name { font-family: var(--fe-font-display); font-weight: 700; font-size: 16px; line-height: 1.25; margin: 0; }
.fe-metric.is-missing { border-color: color-mix(in srgb, var(--fe-red) 55%, transparent); }

/* ---- Forms --------------------------------------------------------------------------------------------- */
.fe-field { display: flex; flex-direction: column; gap: 6px; }
.fe-field > label, .fe-field > .fe-label { font-size: 13px; font-weight: 600; color: var(--fe-text); }
.fe-input, .fe-select, .fe-textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--fe-text); background: var(--fe-inset);
  border: 1px solid var(--fe-border-strong); border-radius: var(--fe-r-md); box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.fe-textarea { min-height: 72px; resize: vertical; }
.fe-input:focus, .fe-select:focus, .fe-textarea:focus {
  outline: none; border-color: var(--fe-primary); box-shadow: 0 0 0 2px var(--fe-primary-soft);
}
.fe-input::placeholder, .fe-textarea::placeholder { color: var(--fe-faint); }
.fe-input[disabled], .fe-select[disabled] { opacity: .6; }
.fe-input.is-danger { border-color: var(--fe-red); }
.fe-select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.fe-help { font-size: 12px; color: var(--fe-muted); margin: 0; }
.fe-help--error { color: var(--fe-red-text); }
.fe-search { position: relative; }
.fe-search .fe-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fe-faint); pointer-events: none; }
.fe-search .fe-input { padding-left: 40px; }
.fe-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.fe-check input { width: 20px; height: 20px; accent-color: var(--fe-primary); margin: 1px 0 0; flex: none; }
.fe-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--fe-muted); }
.fe-switch input { position: absolute; opacity: 0; }
.fe-switch i { width: 38px; height: 22px; border-radius: var(--fe-r-pill); background: var(--fe-surface-3); border: 1px solid var(--fe-border-strong); position: relative; transition: background .15s; flex: none; }
.fe-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--fe-text); transition: transform .15s; }
.fe-switch input:checked + i { background: var(--fe-primary); border-color: var(--fe-primary); }
.fe-switch input:checked + i::after { transform: translateX(16px); background: var(--fe-on-primary); }
.fe-switch input:focus-visible + i { outline: 2px solid var(--fe-primary); outline-offset: 2px; }

/* ---- Banners ------------------------------------------------------------------------------------------- */
.fe-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--fe-r-md); border: 1px solid var(--fe-border-strong); background: var(--fe-surface-2); font-size: 13px; }
.fe-banner--amber { background: var(--fe-amber-soft); border-color: color-mix(in srgb, var(--fe-amber-strong) 45%, transparent); color: var(--fe-amber-text); }
.fe-banner--green { background: var(--fe-primary-soft); border-color: color-mix(in srgb, var(--fe-primary) 45%, transparent); color: var(--fe-primary-text); }
.fe-banner--red { background: var(--fe-red-soft); border-color: color-mix(in srgb, var(--fe-red) 45%, transparent); color: var(--fe-red-text); }
.fe-banner--blue { background: var(--fe-blue-soft); border-color: color-mix(in srgb, #60a5fa 45%, transparent); color: var(--fe-blue-text); }

/* ---- Sticky action bar --------------------------------------------------------------------------------- */
.fe-actionbar {
  position: fixed; left: 0; right: 0; z-index: 35; display: flex; gap: 10px; padding: 10px 16px;
  bottom: calc(var(--fe-nav-h) + var(--fe-safe-bottom)); background: var(--fe-bg);
  border-top: 1px solid var(--fe-border);
}
.fe-actionbar .fe-btn { flex: 1; min-width: 0; padding: 0 10px; }
.fe-actionbar .fe-btn--primary { flex: 1.6; }
@media (min-width: 1024px) {
  .fe-actionbar { position: sticky; bottom: 0; left: auto; right: auto; margin: 24px -4px 0; padding: 12px 4px; border-radius: var(--fe-r-lg); }
}

/* ---- Sheets (modals) ----------------------------------------------------------------------------------- */
.fe-scrim { position: fixed; inset: 0; z-index: 80; background: var(--fe-scrim); display: flex; align-items: flex-end; justify-content: center; }
.fe-sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--fe-surface-2); border: 1px solid var(--fe-border-strong);
  border-radius: var(--fe-r-lg) var(--fe-r-lg) 0 0; box-shadow: var(--fe-shadow-3); animation: fe-rise .22s ease-out;
}
.fe-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--fe-border); }
.fe-sheet-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.fe-sheet-body { padding: 16px; overflow-y: auto; }
.fe-sheet-foot .fe-btn:not(.fe-btn--icon) { flex: 1 1 140px; }
.fe-sheet-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 16px calc(12px + var(--fe-safe-bottom)); border-top: 1px solid var(--fe-border); }
@media (min-width: 768px) {
  .fe-scrim { align-items: center; padding: 24px; }
  .fe-sheet { border-radius: var(--fe-r-lg); animation-name: fe-pop; }
}
@keyframes fe-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fe-pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Toasts -------------------------------------------------------------------------------------------- */
.fe-toasts { position: fixed; z-index: 100; left: 12px; right: 12px; bottom: calc(var(--fe-nav-h) + var(--fe-safe-bottom) + 84px); display: flex; flex-direction: column; gap: 8px; max-width: 420px; margin: 0 auto; pointer-events: none; }
@media (min-width: 1024px) { .fe-toasts { left: auto; right: 24px; bottom: 24px; margin: 0; } }
.fe-toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--fe-r-md); border: 1px solid var(--fe-border-strong); background: var(--fe-surface-2); box-shadow: var(--fe-shadow-3); font-size: 14px; }
.fe-toast--success { border-color: var(--fe-primary); } .fe-toast--warning { border-color: var(--fe-amber-strong); } .fe-toast--error { border-color: var(--fe-red); }
.fe-toast .fe-icon { margin-top: 1px; }
.fe-toast--success .fe-icon { color: var(--fe-primary-text); } .fe-toast--warning .fe-icon { color: var(--fe-amber-text); } .fe-toast--error .fe-icon { color: var(--fe-red-text); }
.fe-toast details { font-size: 12px; opacity: .8; margin-top: 4px; }

/* ---- Lists / tables ------------------------------------------------------------------------------------ */
.fe-list { display: flex; flex-direction: column; }
.fe-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--fe-border); }
.fe-list-item:last-child { border-bottom: 0; }
.fe-scroll-x { overflow-x: auto; }
.fe-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fe-table th { text-align: left; padding: 8px 10px; font-family: var(--fe-font-display); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fe-muted); border-bottom: 1px solid var(--fe-border-strong); }
.fe-table td { padding: 10px; border-bottom: 1px solid var(--fe-border); vertical-align: top; }
.fe-table tr:hover td { background: color-mix(in srgb, var(--fe-primary) 4%, transparent); }

/* ---- Team picker (settings, autocomplete) -------------------------------------------------------------- */
.fe-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.fe-team {
  position: relative; text-align: center; padding: 12px 8px; border-radius: var(--fe-r-md); border: 1px solid var(--fe-border); background: var(--fe-surface); cursor: pointer;
  transition: border-color .15s, background .15s; color: var(--fe-text); font: inherit;
}
.fe-team:hover { border-color: var(--fe-border-strong); }
.fe-team.is-on { border-color: var(--fe-primary); background: var(--fe-primary-soft); }
.fe-team img { width: 48px; height: 48px; object-fit: contain; border-radius: var(--fe-r-sm); }
.fe-team span { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; line-height: 1.25; }
.fe-team .fe-tick { position: absolute; top: 6px; right: 6px; color: var(--fe-primary-text); }
.fe-dropdown { position: relative; }
.fe-dropdown-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; background: var(--fe-surface-2); border: 1px solid var(--fe-border-strong); border-radius: var(--fe-r-md); box-shadow: var(--fe-shadow-3); padding: 4px; }
.fe-dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--fe-r-sm); background: transparent; color: var(--fe-text); cursor: pointer; text-align: left; font: inherit; font-size: 14px; }
.fe-dropdown-item:hover { background: var(--fe-surface-3); }
.fe-dropdown-item img { width: 28px; height: 28px; object-fit: contain; }

/* ---- Login --------------------------------------------------------------------------------------------- */
.fe-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 400px); justify-content: center; align-content: center; padding: calc(24px + var(--fe-safe-top)) 16px calc(24px + var(--fe-safe-bottom)); background: var(--fe-bg); }
.fe-login-card { width: 100%; max-width: 400px; }
.fe-login-mark { width: 84px; height: 84px; margin: 0 auto 18px; }
.fe-login .fe-title { letter-spacing: -0.02em; }
.fe-login .fe-card { padding: 20px; }

/* Sign-in buttons: our own face; Google's real button sits invisibly on top of it so the click still goes to Google. */
.fe-signin { position: relative; height: 48px; }
.fe-signin-face, .fe-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; padding: 0 16px; border-radius: var(--fe-r-md);
  background: var(--fe-surface-2); border: 1px solid var(--fe-border-strong); color: var(--fe-text);
  font-family: var(--fe-font-display); font-weight: 700; font-size: 15px; cursor: pointer; transition: border-color .15s, background .15s;
}
.fe-signin:hover .fe-signin-face, .fe-signin-btn:hover { border-color: var(--fe-text); background: var(--fe-surface-3); }
.fe-signin:focus-within .fe-signin-face { outline: 2px solid var(--fe-primary); outline-offset: 2px; }
.fe-signin-btn:disabled { opacity: .6; cursor: default; }
.fe-signin-btn--apple { background: #fff; color: #000; border-color: #fff; }
.fe-signin-btn--apple:hover { background: #e9e9ea; border-color: #e9e9ea; }
:root[data-theme='light'] .fe-signin-btn--apple { background: #000; color: #fff; border-color: #000; }
:root[data-theme='light'] .fe-signin-btn--apple:hover { background: #1c1c1e; border-color: #1c1c1e; }
.fe-signin-overlay { position: absolute; inset: 0; overflow: hidden; opacity: 0.01; }
.fe-signin-overlay > div, .fe-signin-overlay iframe { width: 100% !important; }
.fe-or { display: flex; align-items: center; gap: 10px; color: var(--fe-muted); font-size: 12px; margin: 4px 0; }
.fe-or::before, .fe-or::after { content: ""; flex: 1; height: 1px; background: var(--fe-border); }

/* ---- Charts -------------------------------------------------------------------------------------------- */
.fe-chart { position: relative; height: 320px; width: 100%; }
@media (min-width: 768px) { .fe-chart { height: 400px; } }

/* ---- Misc ---------------------------------------------------------------------------------------------- */
#blazor-error-ui { background: var(--fe-amber-soft); color: var(--fe-amber-text); border-top: 1px solid var(--fe-amber-strong); display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: .75rem 1.25rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---- Attendance ------------------------------------------------------------------------------------------------- */
.fe-stats--3 { grid-template-columns: repeat(3, 1fr); }
.fe-stat--red b { color: var(--fe-red-text); }
.fe-menu a.fe-menu-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; color: var(--fe-text); text-decoration: none; border-radius: var(--fe-r-md); font-size: 14px; }
.fe-menu a.fe-menu-link:hover { background: var(--fe-surface-3); }

.fe-datebar { display: flex; align-items: center; gap: 10px; }
.fe-datebar .fe-iconbtn { width: 48px; height: 48px; flex: none; }
.fe-datebar .fe-iconbtn:disabled { opacity: .35; cursor: default; }
.fe-datebar-label { position: relative; flex: 1; min-width: 0; text-align: center; padding: 6px 8px; background: var(--fe-surface); border: 1px solid var(--fe-border); border-radius: var(--fe-r-md); }
.fe-datebar-label b { display: block; font-family: var(--fe-font-display); font-size: 18px; line-height: 1.2; }
.fe-datebar-label span { display: block; font-size: 12px; color: var(--fe-muted); }
.fe-datebar-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.fe-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fe-mini { padding: 8px 10px; background: var(--fe-inset); border: 1px solid var(--fe-border); border-radius: var(--fe-r-md); }
.fe-mini b { display: block; font-family: var(--fe-font-display); font-size: 15px; margin-top: 2px; white-space: nowrap; }
.fe-ok { color: var(--fe-primary-text); } .fe-warn { color: var(--fe-amber-text); } .fe-bad { color: var(--fe-red-text); }

.fe-att { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.fe-att.is-absent { border-color: color-mix(in srgb, var(--fe-red) 50%, transparent); }
.fe-att.is-late { border-color: color-mix(in srgb, var(--fe-amber-strong) 50%, transparent); }
.fe-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.fe-seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 6px;
  font: inherit; font-family: var(--fe-font-display); font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--fe-inset); color: var(--fe-muted); border: 1px solid var(--fe-border-strong); border-radius: var(--fe-r-md);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background .12s, color .12s, border-color .12s;
}
.fe-seg-btn:active { transform: scale(.97); }
.fe-seg-btn--present.is-on, .fe-seg-btn--notified.is-on { background: var(--fe-primary-soft); border-color: var(--fe-primary); color: var(--fe-primary-text); }
.fe-seg-btn--late.is-on { background: var(--fe-amber-soft); border-color: var(--fe-amber-strong); color: var(--fe-amber-text); }
.fe-seg-btn--absent.is-on, .fe-seg-btn--nonotice.is-on { background: var(--fe-red-soft); border-color: var(--fe-red); color: var(--fe-red-text); }
.fe-seg--sm .fe-seg-btn { min-height: 44px; font-size: 13px; }
.fe-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fe-notice .fe-seg { flex: 1; min-width: 220px; }
.fe-attbar { justify-content: center; }
.fe-attbar-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1; font-size: 13px; color: var(--fe-muted); }
.fe-attbar-counts b { color: var(--fe-text); }

/* ---- Player attendance (history) ---------------------------------------------------------------------------------- */
.fe-attsum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fe-attsum-rate { font-family: var(--fe-font-display); font-weight: 900; font-size: 40px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fe-monthbars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.fe-monthbar { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fe-monthbar-pct { font-size: 11px; font-weight: 700; color: var(--fe-muted); font-variant-numeric: tabular-nums; }
.fe-monthbar-track { width: 100%; max-width: 36px; height: 80px; display: flex; align-items: flex-end; background: var(--fe-inset); border: 1px solid var(--fe-border); border-radius: var(--fe-r-sm); overflow: hidden; }
.fe-monthbar-fill { width: 100%; background: var(--fe-primary); }
.fe-monthbar-fill.is-warn { background: var(--fe-amber-strong); } .fe-monthbar-fill.is-bad { background: var(--fe-red); }
.fe-monthbar-label { font-size: 11px; color: var(--fe-muted); text-transform: uppercase; letter-spacing: .04em; }
.fe-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.fe-dot-s { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; }
.fe-dot-s--present { background: var(--fe-primary); }
.fe-dot-s--late { background: var(--fe-amber-strong); }
.fe-dot-s--absent { background: transparent; border-color: var(--fe-red); }
.fe-dot-s--absent.is-notified { background: var(--fe-red); opacity: .55; }
.fe-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--fe-muted); }
.fe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fe-legend .fe-dot-s { width: 12px; height: 12px; }

/* ---- Player photo field (roster form) ---------------------------------------------------------------------------- */
.fe-photofield { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.fe-photofield .fe-avatar--lg { width: 88px; height: 88px; font-size: 28px; }
.fe-langbtn { width: auto; min-width: 40px; padding: 0 10px; font-family: var(--fe-font-display); font-weight: 800; font-size: 13px; letter-spacing: .04em; }

/* ---- Regular absences ----------------------------------------------------------------------------------------- */
.fe-regular-offer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--fe-border); display: flex; flex-direction: column; gap: 8px; }
.fe-dot-s--regular { background: var(--fe-border-strong); border-color: var(--fe-border-strong); opacity: .7; }

/* The white ball needs a crisp outline on the light theme. */
.fe-brand-mark img, .fe-login-mark img { border-radius: 50%; }
:root[data-theme='light'] .fe-brand-mark img, :root[data-theme='light'] .fe-login-mark img { box-shadow: 0 0 0 1.5px var(--fe-border-strong); }

/* ---- Public pages (privacy notice, parent consent) ------------------------------------------------------------------ */
.fe-public { min-height: 100vh; min-height: 100dvh; background: var(--fe-bg); }
.fe-public-bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--fe-safe-top)) 16px 10px; border-bottom: 1px solid var(--fe-border); background: var(--fe-bg); position: sticky; top: 0; z-index: 10; }
.fe-public-main { max-width: 720px; margin: 0 auto; padding: 20px 16px calc(40px + var(--fe-safe-bottom)); }
.fe-prose h2 { font-family: var(--fe-font-display); font-size: 17px; margin: 24px 0 6px; }
.fe-prose p, .fe-prose li { line-height: 1.6; color: var(--fe-text); }
.fe-prose p { margin: 0 0 12px; }
.fe-prose ul { padding-left: 22px; margin: 6px 0; list-style: disc; } .fe-prose li { margin-bottom: 6px; }
.fe-prose .fe-muted { color: var(--fe-muted); }
