/* app.css — login screen + app shell. Shares the sandbox palette
   (css/styles.css) but uses a sans-serif face: the shell is the game,
   the mono sandbox is the lab. */

:root {
  --bg: #0e1218;
  --panel: #161c26;
  --panel2: #1c2432;
  --line: #2a3547;
  --text: #dbe4f0;
  --muted: #7f8ea6;
  --accent: #4fc37f;
  --accent2: #e0b34c;
  --fail: #c95b5b;
  /* glass layer over the pitch backdrop (assets/bg-pitch.jpg) */
  --glass: rgba(16, 21, 30, 0.55);
  --glass-heavy: rgba(13, 17, 25, 0.68);
  --glass2: rgba(28, 36, 50, 0.6);
  --glass-line: rgba(146, 172, 209, 0.16);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }

html { scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a63; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Login / title screen ---------- */

/* The pitch photo sits under a heavy dark gradient on every page — the image
   must read as texture, never compete with content (it is a bright daylight
   shot; the UI is dark). Panels above it are translucent + backdrop-blurred. */
.login-body, .app-body {
  background:
    linear-gradient(165deg, rgba(9, 13, 19, 0.84) 0%, rgba(9, 13, 19, 0.7) 45%, rgba(7, 14, 11, 0.84) 100%),
    url('../assets/bg-pitch.jpg') center / cover no-repeat;
}

.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 0;
}

.pitch-backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% -20%, rgba(79, 195, 127, 0.08), transparent 55%);
}
/* faint tactics-board lines */
.pitch-backdrop::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(219, 228, 240, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219, 228, 240, 0.025) 1px, transparent 1px);
  background-size: 90px 90px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.title-card {
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--glass-heavy);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  padding: 28px 30px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.wordmark { font-size: 30px; font-weight: 800; letter-spacing: 4px; }
.wordmark span { color: var(--accent); }
.version { color: var(--muted); font-size: 11px; margin-top: 2px; }

.crest { width: 96px; margin: 18px auto 6px; display: block; }
.club-line { color: var(--accent2); font-size: 13px; margin-bottom: 18px; }

.menu { display: flex; flex-direction: column; gap: 10px; }

.menu-btn {
  display: inline-block;
  background: var(--glass2);
  color: var(--text);
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit; font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.menu-btn:hover:not(:disabled) { background: #232d3e; border-color: #3a4a63; }
.menu-btn.primary { background: var(--accent); border-color: var(--accent); color: #0b1510; font-weight: 700; }
.menu-btn.primary:hover:not(:disabled) { background: #5fd691; border-color: #5fd691; }
.menu-btn.ghost { background: transparent; }
.menu-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.menu-btn.google { display: flex; align-items: center; justify-content: center; gap: 8px; }
.g-badge {
  background: #fff; color: #333; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.soon { color: var(--accent2); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

.auth-form { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.auth-form h3 { margin: 0 0 4px; font-size: 15px; text-align: center; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.auth-form input {
  background: rgba(20, 27, 38, 0.75); color: var(--text);
  border: 1px solid var(--glass-line); border-radius: 6px;
  padding: 8px 10px; font: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 8px; margin-top: 4px; }
.form-row .menu-btn { flex: 1; }
.form-error { color: var(--fail); font-size: 12px; margin: 0; text-align: center; }

.card-footer { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.test-creds { color: var(--muted); font-size: 11px; }
.test-creds b { color: var(--accent2); font-weight: 600; }

/* ---------- App shell ---------- */

.app-body { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* Mobile top bar + drawer scrim — hidden on desktop, activated by the
   media query at the bottom of the shell section. */
.topbar { display: none; }
.scrim { display: none; }
.nav-toggle {
  background: transparent; border: 1px solid var(--glass-line); border-radius: 8px;
  width: 38px; height: 38px; padding: 8px 9px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; border-radius: 1px; background: var(--text); }

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: rgba(13, 17, 24, 0.66);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border-right: 1px solid var(--glass-line);
  display: flex;
  flex-direction: column;
}

.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
}
.side-crest {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--glass2);
  border: 2px solid var(--accent2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2); font-weight: 800; font-size: 13px;
}
.side-club { font-weight: 700; font-size: 13px; }
.side-league { color: var(--muted); font-size: 11px; }

nav { flex: 1; overflow-y: auto; padding: 10px 0; }

.nav-section {
  padding: 14px 16px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-item {
  display: block;
  padding: 7px 16px 7px 14px;
  border-left: 2px solid transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.nav-item:hover { background: rgba(79, 195, 127, 0.06); }
.nav-item.active {
  border-left-color: var(--accent);
  background: rgba(79, 195, 127, 0.10);
  color: var(--accent);
  font-weight: 600;
}

.side-footer { border-top: 1px solid var(--line); padding: 12px 16px; }
.side-manager { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.logout {
  width: 100%;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px; font: inherit; font-size: 12px; cursor: pointer;
}
.logout:hover { color: var(--fail); border-color: var(--fail); }

.content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.content.full-bleed { padding: 0; overflow: hidden; }

.sandbox-frame { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Small screens (phones): sidebar becomes a slide-in drawer ---------- */

@media (max-width: 760px) {
  .app-body { flex-direction: column; }

  .topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: rgba(13, 17, 24, 0.66);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    backdrop-filter: blur(22px) saturate(1.3);
    border-bottom: 1px solid var(--glass-line);
    flex-shrink: 0;
  }
  .topbar-club { font-weight: 700; font-size: 14px; }

  .scrim {
    display: block;
    position: fixed; inset: 0; z-index: 40;
    background: rgba(5, 8, 12, 0.55);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: min(280px, 84vw);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
    /* the drawer sits over the photo directly — near-opaque, and no
       backdrop blur: animating a blurred fixed panel is a phone-GPU tax
       (and glitches some compositors) for no visible gain at this alpha */
    background: rgba(13, 17, 24, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .nav-open .sidebar { transform: translateX(0); }

  /* comfortable touch targets */
  .nav-item { padding: 11px 16px 11px 14px; font-size: 14px; }
  .logout { padding: 10px; }

  .content { padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }

  /* tables (league, squad, stats) scroll inside their card instead of
     stretching the page */
  .card { overflow-x: auto; }

  .view-head h2 { font-size: 18px; }
}

/* ---------- Views ---------- */

.view-head { margin-bottom: 18px; }
.view-head h2 { margin: 0; font-size: 20px; }
.view-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 10px; font-size: 13px; color: var(--accent2); text-transform: uppercase; letter-spacing: 1px; }
.card h3.spaced { margin-top: 16px; }
.card-link { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 12px; }

/* ---------- Brand ---------- */

.identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.identity-grid .card { margin-bottom: 0; }

.identity-name { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.identity-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.chip.ok { color: var(--accent); border-color: var(--accent); }
.chip.warn { color: var(--accent2); border-color: var(--accent2); }

.rename-row { display: flex; gap: 8px; margin-bottom: 6px; }
.rename-row input {
  flex: 1; min-width: 0;
  background: rgba(0, 0, 0, 0.25); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; font: inherit; font-size: 13px;
}
.rename-row input:focus { outline: none; border-color: var(--accent); }
.rename-row input:disabled { opacity: 0.45; }
.rename-row button {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 7px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.rename-row button:hover:not(:disabled) { background: rgba(79, 195, 127, 0.12); }
.rename-row button:disabled { opacity: 0.45; cursor: default; }

.identity-note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.identity-err { color: var(--fail); font-size: 12px; min-height: 14px; }

.colour-row { margin-bottom: 12px; }
.colour-row .lbl {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 6px;
}
.colour-row .lbl span { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 24px; height: 24px; border-radius: 6px; padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.18); cursor: pointer;
}
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.swatch.custom { background: none; }
.swatch.custom::-webkit-color-swatch-wrapper { padding: 1px; }
.swatch.custom::-webkit-color-swatch { border: none; border-radius: 4px; }

/* Crest editor (Phase 2) */
.crest-editor { display: flex; gap: 16px; align-items: flex-start; }
.crest-big { flex-shrink: 0; }
.crest-controls { flex: 1; min-width: 0; }
.crest-controls .lbl {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 6px;
}
.shape-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.shape-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--line); border-radius: 8px;
  padding: 4px; cursor: pointer; line-height: 0;
}
.shape-btn.sel { border-color: var(--accent); }
.crest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crest-actions button {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 6px 11px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.crest-actions button:hover { background: rgba(79, 195, 127, 0.12); }
.crest-actions button.danger { color: var(--fail); border-color: var(--fail); }
.crest-actions button.danger:hover { background: rgba(201, 91, 91, 0.12); }

/* Badge placements */
.side-crest.has-badge { background: transparent; border: none; line-height: 0; }
.club-cell { display: inline-flex; align-items: center; gap: 7px; }
.club-cell .club-badge { flex-shrink: 0; }
.fx-club { display: inline-flex; align-items: center; gap: 8px; }
.club-title-row { display: flex; align-items: center; gap: 14px; }
.club-title-row .club-badge { flex-shrink: 0; }

/* Kits designer (Phase 3) */
.kit-card { grid-column: 1 / -1; }
.kit-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.kit-tabs button {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.kit-tabs button.sel { color: var(--accent); border-color: var(--accent); background: rgba(79, 195, 127, 0.08); }
.kit-editor { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.kit-big { flex-shrink: 0; }
.kit-controls { flex: 1; min-width: 260px; }
.kit-controls .lbl {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 6px;
}
.template-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.template-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--line); border-radius: 8px;
  padding: 3px; cursor: pointer; line-height: 0;
}
.template-btn.sel { border-color: var(--accent); }
.opt-row { margin-bottom: 12px; }
.swatch.sm { width: 18px; height: 18px; border-radius: 5px; }
.sponsor-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zone-add {
  background: transparent; color: var(--accent);
  border: 1px dashed var(--accent); border-radius: 6px;
  padding: 6px 11px; font: inherit; font-size: 12px; cursor: pointer;
}
.zone-add:hover { background: rgba(79, 195, 127, 0.12); }
.sponsor-slot {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; color: var(--muted);
}
.sponsor-slot img { height: 20px; border-radius: 3px; display: block; }
.zone-x {
  background: none; border: none; color: var(--fail);
  font: inherit; font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1;
}

.fx-kit { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }

/* Image wizard modal */
.iw-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 8, 12, 0.7);
  display: flex; align-items: center; justify-content: center;
}
.iw-card {
  background: var(--panel);
  border: 1px solid var(--glass-line); border-radius: 12px;
  padding: 18px 20px; width: 348px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.iw-card h3 { margin: 0 0 12px; font-size: 13px; color: var(--accent2); text-transform: uppercase; letter-spacing: 1px; }
.iw-file { width: 100%; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.iw-stage { display: block; margin: 0 auto; background: rgba(0, 0, 0, 0.35); border-radius: 8px; cursor: grab; touch-action: none; }
.iw-zoom-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.iw-zoom { flex: 1; }
.iw-hint { color: var(--muted); font-size: 11px; margin: 8px 0 12px; }
.iw-actions { display: flex; justify-content: flex-end; gap: 8px; }
.iw-actions button {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.iw-actions .iw-save { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.iw-actions .iw-save:disabled { opacity: 0.45; cursor: default; }
.iw-actions .iw-save:hover:not(:disabled) { background: rgba(79, 195, 127, 0.12); }

.identity-hints .hint { color: var(--accent2); font-size: 12px; margin-bottom: 4px; }
.identity-preview { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.identity-preview .pad-preview { flex: 1; min-width: 0; border-radius: 8px; display: block; }
.crest-chip {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 2px solid; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.home-grid .card { margin-bottom: 0; }
.home-grid .next-match { grid-column: span 2; }
.home-grid .table-card { grid-column: 1 / -1; }

.stat-rows { display: flex; flex-direction: column; gap: 8px; }
.stat-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.stat-label { color: var(--muted); font-size: 11px; min-width: 96px; }
.stat-name { flex: 1; font-weight: 600; }
.stat-name .muted { font-weight: 400; font-size: 11px; }
.stat-value { color: var(--accent2); font-weight: 700; margin-left: auto; }

.teaser-line { margin: 0 0 6px; font-size: 14px; }
.teaser-sub { margin: 0; color: var(--muted); font-size: 12px; }

.fixture { margin-bottom: 14px; }
.fx-teams { font-size: 18px; font-weight: 700; }
.fx-vs { color: var(--muted); font-weight: 400; margin: 0 8px; font-size: 13px; }
.fx-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.fx-actions { display: flex; gap: 8px; }
.fx-actions .menu-btn { padding: 8px 14px; font-size: 13px; }

.form-row-badges { display: flex; gap: 6px; }
.form-badge {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #0b1510;
}
.f-W { background: var(--accent); }
.f-D { background: var(--accent2); }
.f-L { background: var(--fail); color: #fff; }
.f-next { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }

.result-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(42, 53, 71, 0.5);
  font-size: 13px;
}
.result-row:last-child { border-bottom: 0; }
.result-row.upcoming { color: var(--muted); }
.result-score { font-weight: 700; min-width: 34px; text-align: center; }
.result-opp { flex: 1; text-align: left; }
.result-meta { color: var(--muted); font-size: 11px; }

.result-item:last-child .result-row { border-bottom: 0; }
.result-row.clickable {
  width: 100%;
  background: none; border: 0; border-bottom: 1px solid rgba(42, 53, 71, 0.5);
  color: var(--text); font: inherit; font-size: 13px;
  cursor: pointer;
}
.result-row.clickable:hover { background: rgba(79, 195, 127, 0.05); }
.chevron { color: var(--muted); font-size: 11px; transition: transform 0.15s; }
.result-row.open .chevron { transform: rotate(180deg); }

/* nested inside a blurred card — plain translucency, no second backdrop-filter
   (nested blurs are costly and render inconsistently) */
.match-summary {
  background: rgba(24, 31, 43, 0.55);
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 8px 0 12px;
}
.summary-score { font-size: 16px; text-align: center; margin-bottom: 12px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.summary-grid h4 { margin: 0 0 6px; font-size: 12px; color: var(--accent2); text-transform: uppercase; letter-spacing: 1px; }
.scoresheet { list-style: none; margin: 0 0 10px; padding: 0 0 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.scoresheet li { padding: 2px 0; }
.lineup { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.lineup li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.lineup .pos { color: var(--muted); width: 28px; flex-shrink: 0; }
.lineup .rating { margin-left: auto; color: var(--accent2); font-weight: 700; }
.lineup .rating.motm { color: var(--accent); }

.scout-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 44px;
  align-items: center; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 53, 71, 0.5);
  font-size: 13px;
}
.scout-row:last-of-type { border-bottom: 0; }
.scout-who { font-weight: 600; }
.scout-who .muted { font-weight: 400; font-size: 11px; }
.scout-est { color: var(--muted); font-size: 12px; }
.scout-bar { height: 6px; background: rgba(20, 27, 38, 0.7); border: 1px solid var(--glass-line); border-radius: 4px; overflow: hidden; }
.scout-fill { height: 100%; background: var(--accent); }
.scout-pct { color: var(--accent2); font-weight: 700; text-align: right; font-size: 12px; }

.club-link { border-bottom: 1px dotted var(--muted); }
.club-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.back-link { display: inline-block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.back-link:hover { color: var(--accent); }

.club-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 14px; }
.club-grid .card { margin-bottom: 14px; }
.muted-inline { color: var(--muted); font-size: 10px; text-transform: none; letter-spacing: 0; }

.fav-lineup li { padding: 3px 0; border-bottom: 1px solid rgba(42, 53, 71, 0.4); }
.fav-lineup li:last-child { border-bottom: 0; }
.fav-lineup .starts { margin-left: auto; color: var(--muted); font-size: 11px; }
.fav-lineup .rating { margin-left: 12px; }

.ovr-hidden { color: var(--muted); font-weight: 700; }
.ovr-est { color: var(--accent2); font-size: 11px; white-space: nowrap; }
.ovr-known { color: var(--accent2); font-weight: 700; }

@media (max-width: 900px) {
  .club-grid { grid-template-columns: 1fr; }
}

/* No backdrop-filter support → fall back to the original solid panels. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .nation-card { background: var(--panel); }
  .sidebar, .title-card { background: rgba(16, 21, 30, 0.96); }
  .match-summary, .menu-btn, .side-crest { background: var(--panel2); }
}

.inbox-card { padding: 0; }
.inbox-msg { padding: 14px 16px; border-bottom: 1px solid rgba(42, 53, 71, 0.5); }
.inbox-msg:last-child { border-bottom: 0; }
.inbox-msg.unread { background: rgba(79, 195, 127, 0.04); }
.inbox-top { display: flex; align-items: center; gap: 8px; }
.inbox-from { color: var(--accent2); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.inbox-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.inbox-subject { font-weight: 700; margin: 3px 0 4px; }
.inbox-body { color: var(--muted); font-size: 13px; }

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.finance-tile { margin-bottom: 0; text-align: center; padding: 18px 12px; }
.tile-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.tile-value { font-size: 22px; font-weight: 800; color: var(--accent2); margin-top: 4px; }

.big-stat { font-size: 30px; font-weight: 800; margin: 2px 0 0; }
.big-stat .ordinal { font-size: 14px; vertical-align: super; }
.big-stat .muted { font-size: 13px; font-weight: 400; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  padding: 4px 8px; border-bottom: 1px solid var(--line);
}
.mini-table td { padding: 5px 8px; border-bottom: 1px solid rgba(42, 53, 71, 0.5); }
.mini-table th.num, .mini-table td.num { text-align: center; }
.mini-table .pts { font-weight: 700; }
.mini-table tr.us td { background: rgba(79, 195, 127, 0.10); font-weight: 600; }

.squad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.squad-table th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  padding: 4px 8px; border-bottom: 1px solid var(--line);
}
.squad-table td { padding: 5px 8px; border-bottom: 1px solid rgba(42, 53, 71, 0.5); }
.squad-table th.num, .squad-table td.num { text-align: center; }
.squad-table .pos { color: var(--muted); width: 40px; }
.squad-table .ovr { color: var(--accent2); font-weight: 700; }
.squad-table .season { color: var(--accent); background: rgba(79, 195, 127, 0.05); }
.squad-table th.season { color: var(--muted); }
.squad-table .trait { color: var(--accent); font-size: 12px; }
.squad-table .role { color: var(--accent2); font-size: 10px; border: 1px solid var(--accent2); border-radius: 3px; padding: 0 3px; margin-left: 3px; opacity: .85; }
.squad-table .dim { color: var(--muted, #9aa0a8); }

.hint-line { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.stub-card h3 { margin-top: 10px; }
.stub-badge {
  display: inline-block;
  background: rgba(224, 179, 76, 0.12);
  color: var(--accent2);
  border: 1px solid rgba(224, 179, 76, 0.4);
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.stub-list { margin: 6px 0 4px; padding-left: 18px; color: var(--text); }
.stub-list li { margin-bottom: 6px; font-size: 13px; }
.stub-card .menu-btn { margin-top: 10px; }

.nation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.nation-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text); font: inherit;
  cursor: not-allowed; opacity: 0.7;
}
.nation-flag { font-size: 24px; }
.nation-name { font-weight: 700; font-size: 13px; }
.nation-league { color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-grid .next-match { grid-column: auto; }
}

/* Roadmap — vertical timeline (entries reuse .card, covered by the glass fallback). */
.timeline { position: relative; max-width: 860px; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
  background: var(--glass-line);
}
.tl-entry { position: relative; margin-bottom: 16px; }
.tl-entry::before {
  content: '';
  position: absolute; left: -23px; top: 20px; width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(11, 15, 22, 0.9);
}
.tl-entry.future::before { background: var(--accent2); }
.tl-card { margin-bottom: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tl-date { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.tl-tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tl-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--glass-line); color: var(--muted);
}
.tl-tag.tag-engine { color: var(--accent); border-color: rgba(79, 195, 127, 0.4); }
.tl-tag.tag-tactics { color: #8fd3a8; border-color: rgba(143, 211, 168, 0.35); }
.tl-tag.tag-shell, .tl-tag.tag-match-ui { color: var(--accent2); border-color: rgba(224, 179, 76, 0.4); }
.tl-tag.tag-data { color: #6ea8e8; border-color: rgba(110, 168, 232, 0.4); }
.tl-tag.tag-design { color: #b08de0; border-color: rgba(176, 141, 224, 0.4); }
.tl-items { margin: 6px 0 2px; padding-left: 18px; }
.tl-items li { margin-bottom: 6px; font-size: 13px; line-height: 1.45; }
.tl-items li:last-child { margin-bottom: 0; }
/* Grouped ships inside a one-card day: gold sub-heading + its own list. */
.tl-items li.tl-group { list-style: none; margin: 14px 0 10px -18px; }
.tl-items li.tl-group:first-child { margin-top: 6px; }
.tl-items li.tl-group:last-child { margin-bottom: 0; }
.tl-subhead {
  display: block;
  color: var(--accent2); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 5px;
}
.tl-subitems { margin: 0; padding-left: 18px; }
