/* ==========================================================================
   Bluejay theme
   The scoreboard spirit lives in the numbers: scores, clocks, ranks and stats
   use a dot-matrix "bulb" face. Everything else stays quiet: one clean sans,
   flat warm-dark surfaces, thin rules instead of heavy boxes.
   Loaded after styles.css; remaps the legacy tokens so older pages follow.
   ========================================================================== */

:root {
  --bg: #0f0e0c;
  --surface: #161512;
  --surface-2: #1c1a17;
  --rule: #26231f;
  --rule-strong: #34302a;
  --window: #080807;

  --ink: #f1ebdf;
  --ink-2: #aaa294;
  --ink-3: #746d61;

  --bulb: #ffb21c;
  --bulb-dim: rgba(255, 178, 28, 0.08);
  --bulb-glow: 0 0 5px rgba(255, 168, 20, 0.45), 0 0 14px rgba(255, 140, 0, 0.18);
  --bulb-red: #ff4a3d;
  --bulb-red-glow: 0 0 5px rgba(255, 60, 45, 0.5);
  --bulb-green: #57e36b;
  --bulb-green-glow: 0 0 5px rgba(80, 230, 100, 0.45);

  --red: #d63a2f;

  /* Shot zones (validated on dark surface, all-pairs CVD-safe) */
  --zone-rim: #e76624;
  --zone-mid: #9887ef;
  --zone-three: #00a888;

  --font-digits: 'Doto', 'Share Tech Mono', ui-monospace, monospace;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-plate: var(--font-ui);
  --font-label: var(--font-ui);

  /* Legacy tokens used across older templates */
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --bg-tertiary: var(--surface-2);
  --bg-card: var(--surface);
  --card-bg: var(--surface);
  --background: var(--bg);
  --surface-alt: var(--surface-2);
  --text-primary: var(--ink);
  --text: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --text-muted: var(--ink-3);
  --border-color: var(--rule);
  --border: var(--rule);
  --accent-primary: var(--red);
  --accent-color: var(--red);
  --accent: var(--red);
  --accent-secondary: var(--bulb-green);
  --accent-gold: var(--bulb);
  --accent-orange: #e76624;
  --accent-purple: #9887ef;
  --live-red: var(--bulb-red);
  --final-green: var(--bulb-green);
  --success: var(--bulb-green);
  --warning: var(--bulb);
  --scheduled-blue: #8fc1ff;
  --radius: 10px;
  --radius-sm: 6px;
}

html { background: var(--bg); }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--bulb); }
.app { max-width: 1200px; }

/* ---------- Top bar ----------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 20px 0 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand .sb-digits { font-size: 1.7rem; letter-spacing: 0.08em; }
.brand-sub { color: var(--ink-3); font-size: 0.9rem; }
.topnav { display: flex; gap: 22px; }
.topnav a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--ink); }
.topnav a.on { color: var(--ink); border-bottom-color: var(--bulb); }
.topuser { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 0.9rem; color: var(--ink-2); }
.topuser a { color: var(--ink-2); text-decoration: none; }
.topuser a:hover { color: var(--ink); }
.topuser .signin { color: #fff; background: var(--red); padding: 6px 14px; border-radius: 6px; font-weight: 600; }
.topuser .signin:hover { color: #fff; filter: brightness(1.1); }

/* Hide legacy headers if a template still has one */
.header, .site-header { display: none !important; }

/* ---------- Sections (flow, no boxes) ----------------------------------- */
.block { margin-bottom: 40px; }
.block-title,
.section-title {
  font-family: var(--font-ui) !important;
  font-size: 1.05rem !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--ink) !important;
  text-shadow: none !important;
  padding: 0 0 10px !important;
  margin: 0 0 16px !important;
  border-bottom: 1px solid var(--rule) !important;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.block-title small { font-weight: 400; font-size: 0.82rem; color: var(--ink-3); }

.label { font-size: 0.8rem; color: var(--ink-3); font-weight: 500; }
.muted { color: var(--ink-2); }
.tiny { font-size: 0.8rem; color: var(--ink-3); }

/* ---------- Cards (used sparingly: game cards) -------------------------- */
.card-flat {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
}

/* ---------- Scoreboard numbers ----------------------------------------- */
.sb-digits {
  position: relative;
  display: inline-block;
  font-family: var(--font-digits);
  font-weight: 900;
  color: var(--bulb);
  text-shadow: var(--bulb-glow);
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.sb-digits[data-ghost]::before {
  content: attr(data-ghost);
  position: absolute;
  inset: 0;
  color: var(--bulb-dim);
  text-shadow: none;
  pointer-events: none;
}
.sb-digits > span { position: relative; }
.sb-digits.red { color: var(--bulb-red); text-shadow: var(--bulb-red-glow); }
.sb-digits.green { color: var(--bulb-green); text-shadow: var(--bulb-green-glow); }
.sb-digits.dim { color: var(--ink-3); text-shadow: none; }

.sb-window {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--window);
  border-radius: 6px;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.8);
  padding: 7px 10px 5px;
  min-width: 52px;
}

/* ---------- LED meter (scouting card) ----------------------------------- */
.sb-meter {
  position: relative;
  height: 12px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, transparent 0 7px, var(--bg) 7px 9px), #221f1b;
  overflow: hidden;
}
.sb-meter > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: repeating-linear-gradient(90deg, transparent 0 7px, var(--bg) 7px 9px), var(--meter-color, var(--bulb));
}

/* ---------- Buttons / inputs ------------------------------------------- */
.btn-ghost {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: #4a443b; }
.btn-red {
  font-family: var(--font-ui);
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary, .add-note-btn, .save-note-log { background: var(--red) !important; color: #fff !important; }
.btn, .btn-primary, .btn-secondary, .btn-danger { border-radius: 6px; font-family: var(--font-ui); }

input, select, textarea {
  font-family: var(--font-ui);
  background: var(--window) !important;
  color: var(--ink) !important;
  border: 1px solid var(--rule-strong) !important;
  border-radius: 6px !important;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--bulb) !important; }

table { font-variant-numeric: tabular-nums; }
th { font-weight: 500; color: var(--ink-3); }

.footer {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.8rem;
  padding: 30px 0 40px;
  border-top: 1px solid var(--rule);
  margin-top: 20px;
}

/* Older pages' cards: flat, thin border */
.card, .stat-card, .notes-section, .game-log, .player-header, .source-card, .list-card, .team-prospects {
  background: var(--surface) !important;
  border: 1px solid var(--rule) !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}

/* ---------- Chips ------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.88rem;
  white-space: nowrap;
}
.chip:hover { border-color: var(--rule-strong); color: var(--ink); }
.chip .rk { font-family: var(--font-digits); font-weight: 900; color: var(--bulb); font-size: 0.92rem; }
.chip .pos { color: var(--ink-3); font-size: 0.78rem; }

/* ---------- Tooltip ---------------------------------------------------- */
.sb-tip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: #050505;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  max-width: 260px;
  opacity: 0;
  transition: opacity 0.08s;
}
.sb-tip.on { opacity: 1; }
.sb-tip b { color: var(--bulb); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 760px) {
  .topbar { gap: 14px; }
  .topuser { margin-left: 0; }
}

/* Older pages: plain headings, no glow */
h1, h2, h3 { font-family: var(--font-ui); text-shadow: none; }

.board-container { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; }
