/* Big Dog Gotta Eat — design system
   Palette: black / gray / orange (confirmed against the bulldog logo).
   Mobile-first, no build step. Pages link this once; page-specific rules go in
   a <style> block or page CSS, but reuse these tokens + components. */

:root {
  /* Brand */
  --orange:       #F26A21;   /* primary accent (logo collar/highlights) */
  --orange-600:   #d4560f;
  --ink:          #111214;   /* near-black background */
  --ink-2:        #1b1d21;   /* raised surface */
  --ink-3:        #262a30;   /* card / border on dark */
  --gray:         #8a9099;
  --gray-light:   #c7ccd2;
  --paper:        #f5f6f7;
  --white:        #ffffff;

  /* Semantic (dark is the site's default look) */
  --bg:           var(--ink);
  --surface:      var(--ink-2);
  --card:         var(--ink-3);
  --text:         #eef0f2;
  --text-muted:   var(--gray-light);
  --accent:       var(--orange);
  --border:       #33373d;
  --win:          #43c06a;
  --loss:         #e5544b;
  --tie:          var(--gray);

  --radius:       12px;
  --radius-sm:    8px;
  --maxw:         1040px;
  --gap:          16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Arial Black", "Helvetica Neue", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); text-transform: uppercase; }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.8rem); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 28px 0; }

/* ---- Top nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(17,18,20,.92); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--accent);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head);
  text-transform: uppercase; color: var(--text); font-size: 1rem; }
/* Logo is a circular badge sitting ~5% high on a white square. Clip it to a white
   circular chip and nudge the badge down 5% so it reads centered. */
.logo-chip { display: inline-block; overflow: hidden; border-radius: 50%; background: #fff;
  flex-shrink: 0; }
.logo-chip img { width: 100%; height: 100%; object-fit: contain; display: block;
  transform: translateY(5%); }
.nav .brand .logo-chip { width: 40px; height: 40px; }
.nav .links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav .links a {
  color: var(--text-muted); padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
}
.nav .links a:hover { color: var(--text); background: var(--ink-3); text-decoration: none; }
.nav .links a.active { color: var(--ink); background: var(--accent); }

/* ---- Cards ---- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card-grid { display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--accent); color: #1a1205; border: none; font-weight: 700;
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: .95rem;
}
.btn:hover { background: var(--orange-600); text-decoration: none; }
.btn.secondary { background: var(--ink-3); color: var(--text); border: 1px solid var(--border); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }

/* ---- Tables (stat tables, Baseball-Reference feel) ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--radius); }
table.stats { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums;
  font-size: .9rem; min-width: 560px; }
table.stats th, table.stats td { padding: 8px 10px; text-align: right; white-space: nowrap; }
table.stats th:first-child, table.stats td:first-child { text-align: left; position: sticky; left: 0;
  background: var(--card); }
table.stats thead th { background: var(--ink-3); color: var(--text-muted);
  text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; border-bottom: 2px solid var(--accent); }
table.stats tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
table.stats tbody tr:hover { background: rgba(242,106,33,.08); }
table.stats tfoot td { border-top: 2px solid var(--border); font-weight: 700; }

/* ---- Pills / result badges ---- */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem;
  font-weight: 700; }
.pill.w { background: rgba(67,192,106,.18); color: var(--win); }
.pill.l { background: rgba(229,84,75,.18); color: var(--loss); }
.pill.t { background: rgba(138,144,153,.2); color: var(--tie); }

/* ---- Stat tiles ---- */
.stat-row { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center; }
.stat-tile .value { font-family: var(--font-head); font-size: 1.9rem; color: var(--accent); }
.stat-tile .label { font-size: .75rem; text-transform: uppercase; color: var(--text-muted);
  letter-spacing: .05em; }

.muted { color: var(--text-muted); }
.center { text-align: center; }
.loading { padding: 40px; text-align: center; color: var(--text-muted); }

/* ---- Hero (home page) ---- */
.hero {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 24px 0;
}
.hero-logo { width: 120px; height: 120px; border: 3px solid var(--accent); }
.hero-main { flex: 1; min-width: 220px; }
.hero-season { text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; margin-bottom: 4px; }
.hero-record { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.hero-record .num { font-family: var(--font-head); font-size: clamp(2.2rem, 7vw, 3.4rem);
  color: var(--accent); line-height: 1; }
.hero-record .label { font-size: .85rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; }
.next-game { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; display: inline-block; }
.next-game .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin-bottom: 2px; }
.next-game .matchup { font-weight: 700; font-size: 1.05rem; }

/* ---- Champion badge (home hero) ---- */
.champ-badge { display: inline-block; margin: 0 0 12px; padding: 6px 14px;
  background: rgba(242,106,33,.15); border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); font-weight: 700; font-size: .95rem; }

/* ---- Editable placeholder marker ---- */
.edit-note { font-style: italic; color: var(--text-muted); font-size: .85rem;
  border-left: 2px dashed var(--border); padding-left: 10px; margin: 8px 0; }

/* ---- Avatars / player cards ---- */
.avatar { border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 10px; }
.avatar-fallback { display: flex; align-items: center; justify-content: center;
  background: var(--ink-3); color: var(--accent); font-family: var(--font-head);
  font-size: 2rem; border: 2px solid var(--border); }
.player-card { text-align: center; color: var(--text); display: block; }
.player-card:hover { border-color: var(--accent); text-decoration: none; }
.player-card-name { font-weight: 700; margin-top: 4px; }

.photo-grid { display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 12px; }
.photo-tile { text-align: center; }

/* ---- Player bio (baseball-reference style) ---- */
.bio-header { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.bio-photo { margin: 0; border-radius: var(--radius); }
.bio-info { flex: 1; min-width: 220px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px;
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  color: var(--text-muted); font-size: .85rem; text-align: center; }
.site-footer .flags { display: flex; gap: 14px; justify-content: center; align-items: center;
  margin-bottom: 14px; }
/* Both flags are 3:2, so a shared height gives identical dimensions. */
.site-footer .flag { height: 44px; width: 66px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0,0,0,.5); }

/* ---- Back / subnav (in-app back nav, needed in standalone PWA mode) ---- */
.subnav { padding: 10px 16px 0; }
.back-btn { -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--ink-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px; font-size: .9rem; font-weight: 600;
  min-height: 40px; }
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Sortable stat tables ---- */
table.stats th.sortable { cursor: pointer; -webkit-user-select: none; user-select: none; }
table.stats th.sortable:hover { color: var(--text); }
table.stats th.sortable::after { content: "\2195"; opacity: .35; margin-left: 4px; font-size: .9em; }
table.stats th.sort-asc::after { content: "\2191"; opacity: 1; color: var(--accent); }
table.stats th.sort-desc::after { content: "\2193"; opacity: 1; color: var(--accent); }

/* ---- Season selector ---- */
.season-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.season-picker select { -webkit-appearance: none; appearance: none; font-size: 16px;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; }

/* ---- Game list (home: recent/upcoming) ---- */
.game-list { list-style: none; margin: 0; padding: 0; }
.game-line { display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: .92rem; }
.game-line:last-child { border-bottom: none; }
.game-line .vs { font-weight: 600; flex: 1; }

/* ---- Season detail ---- */
.season-hero { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 8px; }
.season-photo { border-radius: var(--radius); max-width: 320px; width: 100%; border: 1px solid var(--border); }
.season-recap { white-space: pre-wrap; }

/* ---- Header safe-area (notch) ---- */
.site-header { padding-top: env(safe-area-inset-top); }

/* ---- Mobile hardening ---- */
input, select, textarea, button { font-size: 16px; } /* iOS: <16px triggers zoom */
@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  .nav { gap: 8px; padding: 8px 12px; }
  .nav .brand { font-size: .85rem; }
  .nav .links a { padding: 6px 8px; font-size: .82rem; }
  .hero { gap: 16px; }
}

/* ========================================================================
   Depth & accent polish — richer surfaces, soft shadows, orange accents,
   while staying on the dark theme. (Appended: later rules intentionally
   enhance the base components above.)
   ===================================================================== */

/* Subtle background depth instead of flat black: a faint orange glow up top
   and a soft light wash, over the base ink. */
body {
  background:
    radial-gradient(1100px 460px at 50% -220px, rgba(242,106,33,.09), transparent 70%),
    radial-gradient(900px 600px at 100% -100px, rgba(255,255,255,.028), transparent 60%),
    var(--ink);
  min-height: 100vh;
}

/* Cards & tiles: gentle top-to-bottom gradient, inset highlight, soft shadow. */
.card, .stat-tile, .next-game {
  background: linear-gradient(180deg, #21252c 0%, #171a1f 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.03);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover, .stat-tile:hover {
  border-color: rgba(242,106,33,.45);
  box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 0 0 1px rgba(242,106,33,.14),
              0 10px 26px rgba(242,106,33,.08);
}
/* Only clickable cards lift, so info cards don't jitter on hover. */
a.card:hover, .player-card:hover { transform: translateY(-3px); }

.stat-tile .value { text-shadow: 0 1px 12px rgba(242,106,33,.22); }

.btn { box-shadow: 0 2px 8px rgba(242,106,33,.28); }
.btn:hover { box-shadow: 0 5px 16px rgba(242,106,33,.42); }
.btn.secondary { box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* Section headers: full-width accent underline under the whole title. */
main h2 { padding-bottom: 8px; border-bottom: 2px solid rgba(242,106,33,.5); }

/* Sticky header + nav: a bit of lift and a gradient wash. */
.site-header {
  background: linear-gradient(180deg, rgba(23,25,29,.96), rgba(17,18,20,.92));
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}


/* Stat table header: accent underline instead of a hard border. */
table.stats thead th { box-shadow: inset 0 -2px 0 rgba(242,106,33,.45); }

/* Result pills get a touch more presence. */
.pill { box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }

/* (Spine flame treatment removed — to be replaced with an asset later.) */
