/* ==========================================================================
   AmsalFC — design-language layer (tokens only, no reference marks)
   --------------------------------------------------------------------------
   Visual language measured from a reference design extraction (DesignMD, 2026-11-03),
   applied to AMSAL FC branding only. No reference logos, crests, trademarks,
   player names, images or copy are used anywhere on this site.
   FONT SUBSTITUTION: the reference's proprietary fcb-condensed-bold /
   fcb-regular are NOT used. Display uses Barlow Condensed (free, already
   loaded on every page); body uses the reference fallback stack
   (Arial / Helvetica Neue / Helvetica / sans-serif).
   This file loads LAST on every page and is the visible theme. It
   consolidates the earlier pitch-gold / glass layers instead of stacking
   another competing layer: glass translucency, pitch backgrounds and
   competing card colours are neutralised here.
   EXCEPTION: the bracket BOARD (.board-*) is a tie-sheet document, not
   site chrome. It is explicitly preserved in its classic cream/gold
   theme at the end of this file and must still match the admin preview.
   Gold #fdc52c is used ONLY with dark text (#181733), never white on gold.
   ========================================================================== */

:root {
  --fcb-canvas: #181733;
  --fcb-canvas-2: #12122b;
  --fcb-surface: #154284;
  --fcb-surface-2: #1e3a6e;
  --fcb-text: #ffffff;
  --fcb-muted: #ffffffbf;
  --fcb-faint: #ffffff8c;
  --fcb-border: rgba(239, 239, 239, 0.22);
  --fcb-border-strong: #efefef;
  --fcb-gold: #fdc52c;
  --fcb-gold-2: #dab66b;
  --fcb-red: #cd122d;
  --fcb-focus: #5e9ed6;
  --fcb-ink: #181733;
  --fcb-gray: #727272;
  --fcb-display: "Barlow Condensed", "Arial Narrow", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --fcb-body: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --fcb-shadow-sm: rgba(0, 0, 0, 0.5) 0px 2px 4px 0px;
  --fcb-shadow-md: rgba(0, 0, 0, 0.15) 0px 5px 20px 0px;
}

/* ---------- Base: dark-first canvas, compact density ---------- */
html[data-theme="dark"] body,
body {
  background: var(--fcb-canvas) !important;
  color: var(--fcb-text) !important;
  font-family: var(--fcb-body) !important;
  font-size: 14px;
  line-height: 1.6;
}
body .glass-pitch-bg { display: none !important; }
body .container, body .wrap, body .tp-container {
  max-width: 1480px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body section, body .section { padding-top: 40px !important; padding-bottom: 40px !important; }

/* ---------- Typography: condensed-bold display, tight leading ---------- */
body h1, body h2, body h3, body h4,
body .club-title-white, body .section-title, body .dashboard-title,
body .tp-hero-title, body .tp-section-title {
  font-family: var(--fcb-display) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--fcb-text) !important;
  background: none !important;
  -webkit-text-fill-color: var(--fcb-text) !important;
  text-shadow: none !important;
}
body .tp-hero-title { font-size: clamp(56px, 9vw, 120px) !important; }
body h1:not(.tp-hero-title):not(.club-title-white) { font-size: 40px !important; }
body h2, body .section-title { font-size: 40px !important; }
body h3 { font-size: 28px !important; }
body h4, body .card-title { font-size: 18px !important; }
body .section-subtitle, body .dashboard-subtitle { color: var(--fcb-muted) !important; font-size: 16px; line-height: 1.69; }
body p, body li, body td, body th { color: var(--fcb-text); }
body small, body .caption { font-size: 12px; color: var(--fcb-muted); }

/* ---------- Header / nav: surface on canvas, pill CTAs ---------- */
body .navbar, body header .navbar, body nav.navbar,
html[data-theme="dark"] body .navbar, html[data-theme="light"] body .navbar {
  background: var(--fcb-canvas) !important;
  border-bottom: 3px solid var(--fcb-gold) !important;
  box-shadow: none !important;
}
/* Nav links must stay white on the navy navbar in BOTH themes, since the
   navbar itself is navy in both themes. A previous layer made the dark
   navbar white with white links (invisible) — the selector above beats it. */
html[data-theme="dark"] body .nav-links a, html[data-theme="dark"] body .nav-links a span,
html[data-theme="light"] body .nav-links a, html[data-theme="light"] body .nav-links a span {
  color: #ffffff !important;
}
/* Beat the glass layer's body.glass-home .navbar .nav-links a span rule
   (3 classes) which otherwise forces dark-green link text on the navy bar. */
html[data-theme="dark"] body.glass-home .navbar .nav-links a span,
html[data-theme="light"] body.glass-home .navbar .nav-links a span,
body.glass-home .navbar .nav-links a span {
  color: #ffffff !important;
}
body .club-title-white { color: var(--fcb-text) !important; font-size: 28px !important; }
body .nav-links a, body .nav-links a span, body .admin-nav-links a {
  color: var(--fcb-text) !important;
  font-size: 14px;
  transition: color 200ms ease;
}
body .nav-links a:hover, body .nav-links a:hover span { color: var(--fcb-gold) !important; }
body .nav-links a i { color: var(--fcb-gold) !important; }
body .theme-toggle-btn {
  transform: none !important;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease !important;
  border: 1px solid var(--fcb-border) !important;
  color: var(--fcb-text) !important;
  background: transparent !important;
}
body .theme-toggle-btn:hover, body .theme-toggle-btn:focus-visible { transform: none !important; background: var(--fcb-surface) !important; }

/* ---------- Buttons, pills, tags, chips, badges ---------- */
body .btn, body .tp-btn, body button.btn, body a.btn,
body .tp-btn-accent, body .tp-btn-ghost, body .admin-btn-action {
  border-radius: 9999px !important;
  padding: 12px 20px !important;
  font-size: 14px;
  font-weight: 600;
  transition: color 200ms ease, background-color 200ms ease, box-shadow 200ms ease, transform 200ms ease !important;
  transform: none !important;
}
body .tp-btn-accent, body .btn-primary, body .btn.gold {
  background: var(--fcb-gold) !important;
  color: var(--fcb-ink) !important;
  border: 1px solid var(--fcb-gold) !important;
  box-shadow: var(--fcb-shadow-sm) !important;
}
body .tp-btn-accent:hover, body .btn-primary:hover { filter: brightness(1.06); }
body .tp-btn-ghost, body .btn-secondary, body .btn.ghost {
  background: transparent !important;
  color: var(--fcb-text) !important;
  border: 1px solid var(--fcb-border-strong) !important;
}
body .glass-pill, body .pill, body .badge, body .chip, body .tag,
body .badge-live, body .badge-upcoming, body .badge-finished {
  border-radius: 9999px !important;
  padding: 4px 12px !important;
  font-size: 12px;
  font-weight: 600;
}
body .badge-live { background: var(--fcb-red) !important; color: #fff !important; }
body .badge-upcoming { background: var(--fcb-gold) !important; color: var(--fcb-ink) !important; }
body .badge-finished, body .badge { background: var(--fcb-surface) !important; color: var(--fcb-text) !important; }

/* ---------- Cards: surface floating on canvas, single shadow ---------- */
body .glass-card, body .glass, body .dashboard-card, body .admin-item-card,
body .admin-stat-card, body .admin-user-card, body .news-card, body .tp-news-grid > *,
body .pc, body .ground-card, body .match-card, body .fx, body .m {
  background: var(--fcb-surface) !important;
  color: var(--fcb-text) !important;
  border: 1px solid var(--fcb-border) !important;
  border-radius: 8px !important;
  box-shadow: var(--fcb-shadow-sm) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body .pc h3, body .ground-card h3, body .ground-card .card-title,
body .dashboard-card h3, body .news-card h3 { color: var(--fcb-text) !important; }
body .pc p, body .pc .r, body .ground-card p, body .ground-card .card-desc,
body .dashboard-card p, body .news-card p, body .admin-item-sub {
  color: var(--fcb-muted) !important;
}
body .ground-card h3, body .ground-card p { color: var(--fcb-text) !important; }
body .ground-card p { color: var(--fcb-muted) !important; }
/* Squad grid: keep the responsive columns from the previous fix */
body #squad-grid, body #staff-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}
@media (min-width: 601px) { body #squad-grid, body #staff-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (min-width: 901px) { body #squad-grid, body #staff-grid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (min-width: 1201px) { body #squad-grid, body #staff-grid { grid-template-columns: repeat(5, 1fr) !important; } }

/* ---------- Hero ---------- */
body .tp-hero, body .hero { background: linear-gradient(90deg, #154284, #181733) !important; }
body .tp-hero-sub, body .hero .lede { color: var(--fcb-muted) !important; font-size: 16px; line-height: 1.69; }
body .hero-match-deck .glass-card, body .hero-club-card, body .hero-cup-card {
  background: var(--fcb-surface) !important;
  color: var(--fcb-text) !important;
}
body .tp-featured-foot { flex-wrap: wrap !important; gap: 4px 12px !important; }
body .tp-featured-foot span:first-child { flex: 1 1 180px !important; min-width: 0 !important; overflow-wrap: anywhere !important; }
body .tp-featured-foot span:last-child { flex-shrink: 0 !important; white-space: nowrap !important; }

/* ---------- Forms, inputs, tables ---------- */
body input, body select, body textarea, body .control-input, body .control-select {
  background: var(--fcb-canvas-2) !important;
  color: var(--fcb-text) !important;
  border: 1px solid var(--fcb-border) !important;
  border-radius: 8px !important;
  font-size: 14px;
}
body input::placeholder, body textarea::placeholder { color: var(--fcb-faint) !important; }
body label, body .control-label { color: var(--fcb-text) !important; }
body table { color: var(--fcb-text) !important; }
body th { background: var(--fcb-surface-2) !important; color: var(--fcb-text) !important; }
body td { border-color: var(--fcb-border) !important; }

/* ---------- Modals, panels, toasts, footer ---------- */
body .modal, body .modal-content, body .login-modal-card, body .match-detail-content,
body .player-detail-content, body .news-panel, body .toast {
  background: var(--fcb-surface) !important;
  color: var(--fcb-text) !important;
  border: 1px solid var(--fcb-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--fcb-shadow-md) !important;
}
body footer, body .footer {
  background: var(--fcb-canvas-2) !important;
  color: var(--fcb-muted) !important;
  border-top: 3px solid var(--fcb-gold) !important;
}
body footer a { color: var(--fcb-text) !important; }
body footer a:hover { color: var(--fcb-gold) !important; }

/* ---------- Admin chrome ---------- */
body .admin-sidebar, body .admin-layout, body .admin-main {
  background: var(--fcb-canvas) !important;
  color: var(--fcb-text) !important;
}
body .admin-sidebar a, body .admin-nav-tabs button, body .admin-tab-btn {
  color: var(--fcb-text) !important;
  border-radius: 9999px !important;
  transition: color 200ms ease, background-color 200ms ease !important;
}
body .admin-sidebar a.active, body .admin-tab-btn.active {
  background: var(--fcb-gold) !important;
  color: var(--fcb-ink) !important;
}
body .error-message { color: #ff8a96 !important; }
body a { color: var(--fcb-text); transition: color 200ms ease; }
body a:hover { color: var(--fcb-gold); }

/* ---------- Focus: never suppress without a replacement ring ---------- */
body :focus-visible {
  outline: 3px solid var(--fcb-focus) !important;
  outline-offset: 2px !important;
}
body :focus:not(:focus-visible) { outline: none; }

/* ---------- Motion: 200ms hover, 300ms default, no bounce ---------- */
body *, body *::before, body *::after {
  transition-duration: 300ms;
  transition-timing-function: ease;
}
body a, body button, body .nav-links a { transition-duration: 200ms; }
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- LIGHT MODE: same tokens, inverted sensibly ---------- */
html[data-theme="light"] body {
  background: #f5f5f6 !important;
  color: var(--fcb-ink) !important;
}
html[data-theme="light"] body h1, html[data-theme="light"] body h2,
html[data-theme="light"] body h3, html[data-theme="light"] body h4,
html[data-theme="light"] body .section-title, html[data-theme="light"] body .dashboard-title,
html[data-theme="light"] body .tp-hero-title, html[data-theme="light"] body .club-title-white {
  color: var(--fcb-ink) !important;
  -webkit-text-fill-color: var(--fcb-ink) !important;
}
html[data-theme="light"] body .tp-hero, html[data-theme="light"] body .hero {
  background: linear-gradient(90deg, #154284, #181733) !important;
}
html[data-theme="light"] body .tp-hero-title { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html[data-theme="light"] body .tp-hero-sub { color: #ffffffbf !important; }
html[data-theme="light"] body .navbar { background: var(--fcb-canvas) !important; }
/* The navbar is navy in both themes, so its title stays white in both —
   overriding the light-mode heading rule that would make it dark ink. */
html[data-theme="light"] body.glass-home .navbar .club-title-white,
html[data-theme="dark"] body.glass-home .navbar .club-title-white,
body .navbar .club-title-white {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html[data-theme="light"] body .nav-links a, html[data-theme="light"] body .nav-links a span { color: #fff !important; }
html[data-theme="light"] body p, html[data-theme="light"] body li,
html[data-theme="light"] body td, html[data-theme="light"] body th,
html[data-theme="light"] body label { color: var(--fcb-ink) !important; }
html[data-theme="light"] body .glass-card, html[data-theme="light"] body .glass,
html[data-theme="light"] body .dashboard-card, html[data-theme="light"] body .admin-item-card,
html[data-theme="light"] body .admin-stat-card, html[data-theme="light"] body .admin-user-card,
html[data-theme="light"] body .news-card, html[data-theme="light"] body .pc,
html[data-theme="light"] body .ground-card, html[data-theme="light"] body .match-card,
html[data-theme="light"] body .modal, html[data-theme="light"] body .modal-content,
html[data-theme="light"] body .login-modal-card, html[data-theme="light"] body .match-detail-content,
html[data-theme="light"] body .player-detail-content, html[data-theme="light"] body .news-panel {
  background: #ffffff !important;
  color: var(--fcb-ink) !important;
  border-color: #ddd !important;
  box-shadow: var(--fcb-shadow-md) !important;
}
html[data-theme="light"] body .pc h3, html[data-theme="light"] body .ground-card h3,
html[data-theme="light"] body .dashboard-card h3, html[data-theme="light"] body .news-card h3,
html[data-theme="light"] body .pc p, html[data-theme="light"] body .ground-card p,
html[data-theme="light"] body .dashboard-card p, html[data-theme="light"] body .news-card p,
html[data-theme="light"] body .admin-item-sub { color: var(--fcb-ink) !important; }
html[data-theme="light"] body .pc .r, html[data-theme="light"] body .ground-card .card-desc,
html[data-theme="light"] body .section-subtitle, html[data-theme="light"] body .dashboard-subtitle,
html[data-theme="light"] body small { color: #444 !important; }
html[data-theme="light"] body input, html[data-theme="light"] body select,
html[data-theme="light"] body textarea, html[data-theme="light"] body .control-input,
html[data-theme="light"] body .control-select {
  background: #ffffff !important;
  color: var(--fcb-ink) !important;
  border-color: #bbb !important;
}
html[data-theme="light"] body input::placeholder, html[data-theme="light"] body textarea::placeholder { color: var(--fcb-gray) !important; }
html[data-theme="light"] body th { background: var(--fcb-surface) !important; color: #fff !important; }
html[data-theme="light"] body td { border-color: #ddd !important; }
html[data-theme="light"] body .admin-sidebar, html[data-theme="light"] body .admin-main { background: #f5f5f6 !important; }
html[data-theme="light"] body .admin-sidebar a, html[data-theme="light"] body .admin-nav-tabs button,
html[data-theme="light"] body .admin-tab-btn { color: var(--fcb-ink) !important; }
html[data-theme="light"] body .tp-btn-ghost, html[data-theme="light"] body .btn-secondary {
  color: var(--fcb-ink) !important;
  border-color: var(--fcb-ink) !important;
}
html[data-theme="light"] body a { color: var(--fcb-ink); }
html[data-theme="light"] body a:hover { color: var(--fcb-surface) !important; }
html[data-theme="light"] body footer, html[data-theme="light"] body .footer {
  background: var(--fcb-canvas) !important;
  color: #ffffffbf !important;
}
html[data-theme="light"] body footer a { color: #fff !important; }

/* ==========================================================================
   BRACKET BOARD PRESERVATION — tie-sheet document, NOT site chrome.
   Scoped to data-board-style="classic" ONLY: the classic board must
   still match the admin preview exactly (cream cards, ink text, gold
   Final, pitch-stripe stage), and these rules win over the site chrome
   above for classic board elements only, in both themes. Every other
   style (slant, glass, neon, paper, blueprint, gold, led, candy,
   night, royal, forest, sunset, mono) is deliberately NOT pinned here,
   so its theme variables from club-design.css actually render.
   ========================================================================== */
body .board-container[data-board-style="classic"],
body .board-container[data-board-style="classic"] .board-stage,
body .board-container[data-board-style="classic"] .board-world,
body .board-container[data-board-style="classic"] .board-col-headers,
body .board-container[data-board-style="classic"] .board-brand-header {
  background: revert-layer;
}
body .board-container[data-board-style="classic"] .board-stage {
  background: repeating-linear-gradient(90deg, #133a27 0 140px, #0e2f1f 140px 280px) !important;
}
body .board-container .board-card, body .board-box, body [class*="board-card"] {
  background: #f7f3e8 !important;
  color: #14281e !important;
  border: 1px solid #d8cfae !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
body .board-container .board-card *, body .board-box * { color: #14281e !important; }
body .board-container .final-card, body .board-box.final-card {
  background: #f7f3e8 !important;
  box-shadow: inset 0 0 0 2px #f2c230 !important;
}
body .board-tie-sheet-badge {
  background: #f2c230 !important;
  color: #14281e !important;
}

/* ---- Bracket board cards are a single surface (2026-11-03). ----
   The global body input rule above (bordered boxes, !important) must
   never reach inputs inside a board card — that rule is what made
   every round/date/time/score field render as a little box. Board
   inputs stay borderless on the card's own background; their text
   colour is inherited from the card so themed cards keep their ink. */
body .board-world input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
}
/* Light-theme form rule (html[data-theme="light"] body input) outranks
   the override above on specificity, so without this stronger rule the
   Studio was still showing white boxes in light mode. This selector
   beats it outright; dark mode was already covered by the rule above. */
html[data-theme="light"] body .board-world input,
html[data-theme="dark"] body .board-world input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
}
body .board-world input::placeholder {
  color: var(--muted) !important;
  opacity: 0.65 !important;
}

/* Same single-surface rule for board selects (the card-design select):
   the global body select rule would otherwise paint it as a form box. */
body .board-world select {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
}
html[data-theme="light"] body .board-world select,
html[data-theme="dark"] body .board-world select {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
}
