/* Girlie Football — warm editorial. Cream + serif by day, warm brown by night. */

:root {
  --bg: #f6f1e7;
  --surface: #fffcf6;
  --surface-2: #f0e8da;
  --ink: #2b2320;
  --ink-2: #7a6c62;
  --line: #e6dccb;
  --accent: #d64b6f;        /* rose */
  --accent-ink: #ffffff;
  --accent-soft: #fbe3e9;
  --gold: #d9a441;          /* toggles, highlights */
  --field: #2f6b4f;         /* the scoreboard */
  --field-soft: #e2efe6;
  --danger: #a3261f;
  --shadow: 0 12px 34px rgba(80, 50, 30, 0.10);
  --radius: 22px;
  --tabbar-h: 76px;
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  --font-display: "Antic Didone", "Didot", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --display-soft: normal;
  --display-weight: 400;
}
/* Sackers Solid Antique Roman is a licensed font. Drop the file in ./fonts/ (or paste an
   Adobe Fonts <link> in index.html) and this picks it up; until then Cinzel stands in. */
@font-face {
  font-family: "Sackers Solid Antique Roman";
  src: url("fonts/SackersSolidAntiqueRoman.otf") format("opentype");
  font-display: swap;
}
:root[data-font="sackers"]  { --font-display: "Sackers Solid Antique Roman", "sackers-solid-antique-roman", "Cinzel", Georgia, serif; --display-soft: normal; --display-weight: 400; }
:root[data-font="sackers"] h1, :root[data-font="sackers"] .wordmark, :root[data-font="sackers"] .empty-title, :root[data-font="sackers"] .prose h2 { letter-spacing: 0.04em; }
:root[data-font="sackers"] h1 { font-size: 32px; }
:root[data-font="bodoni"]   { --font-display: "Bodoni Moda", "Didot", Georgia, serif; --display-soft: "opsz" 96; }
:root[data-font="italiana"] { --font-display: "Italiana", "Didot", Georgia, serif; --display-soft: normal; }
:root[data-font="gilda"]      { --font-display: "Gilda Display", "Didot", Georgia, serif; --font-body: "Inter", system-ui, sans-serif; --display-weight: 400; }
:root[data-font="instrument"] { --font-display: "Instrument Serif", Georgia, serif; --font-body: "Inter", system-ui, sans-serif; --display-weight: 400; }
:root[data-font="cormorant"] { --font-display: "Cormorant Garamond", Georgia, serif; --font-body: "Lato", system-ui, sans-serif; --display-weight: 600; }
:root[data-font="prata"]     { --font-display: "Prata", Georgia, serif; --font-body: "Lato", system-ui, sans-serif; --display-weight: 400; }

/* Dark mode — deep forest: dark green base, pink accent, brown scoreboard. */
:root[data-theme="dark"] {
  --bg: #16241d;
  --surface: #1f3128;
  --surface-2: #27392f;
  --ink: #f2e6dc;
  --ink-2: #a9b8ad;
  --line: #2c4034;
  --accent: #f48fb1;
  --accent-ink: #2a0d17;
  --accent-soft: #3a2a33;
  --gold: #e0b04a;
  --field: #6f3d33;
  --field-rim: #3b2418;
  --field-laces: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 16'%3E%3Cpath d='M4 8H96' stroke='%23f2e6dc' stroke-width='2' stroke-linecap='round' opacity='.9'/%3E%3Cpath d='M18 3V13M34 3V13M50 3V13M66 3V13M82 3V13' stroke='%23f2e6dc' stroke-width='2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  --field-soft: #2a3d33;
  --danger: #b6261c;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
  --btn-bg: #f2e6dc;
  --btn-ink: #d94b78;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #16241d; --surface: #1f3128; --surface-2: #27392f; --ink: #f2e6dc; --ink-2: #a9b8ad;
    --line: #2c4034; --accent: #f48fb1; --accent-ink: #2a0d17; --accent-soft: #3a2a33; --gold: #e0b04a;
    --field: #6f3d33; --field-rim: #3b2418; --field-laces: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 16'%3E%3Cpath d='M4 8H96' stroke='%23f2e6dc' stroke-width='2' stroke-linecap='round' opacity='.9'/%3E%3Cpath d='M18 3V13M34 3V13M50 3V13M66 3V13M82 3V13' stroke='%23f2e6dc' stroke-width='2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E"); --field-soft: #2a3d33; --danger: #b6261c; --shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
    --btn-bg: #f2e6dc; --btn-ink: #d94b78;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  padding: 0 16px calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}
h1, h2, .score, .empty-title, .card-text, .prose h2, .prose h3, .ask-a {
  font-family: var(--font-display);
  font-variation-settings: var(--display-soft);
}
h1, h2, .prose h2, .prose h3, .empty-title { font-weight: var(--display-weight); }
/* These serifs are light at small sizes; give the reading text room. */
.card-text, .ask-a { font-size: 22px; }
h1 { font-size: 38px; letter-spacing: 0.01em; }
/* Didones are for headlines; card text stays readable in the body face at these sizes. */
:root:not([data-font="instrument"]):not([data-font="cormorant"]):not([data-font="prata"]) .card-text,
:root:not([data-font="instrument"]):not([data-font="cormorant"]):not([data-font="prata"]) .ask-a { font-family: var(--font-body); font-size: 19px; }
:root[data-font="cormorant"] .card-text, :root[data-font="cormorant"] .ask-a { font-size: 24px; }
:root[data-font="cormorant"] h1 { font-size: 42px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-2); font-weight: 400; }
.small { font-size: 13px; }

/* ---------- page heads ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; padding: calc(22px + env(safe-area-inset-top)) 0 12px; }
body.framed .page-head { padding-top: 74px; }
body.framed .tabbar { padding-bottom: 18px; height: 94px; }
.eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }
.lede { margin: 0 0 18px; color: var(--ink-2); font-size: 16px; }
.icon-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  width: 48px; height: 48px; border-radius: 16px; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- scoreboard ---------- */
.scoreboard {
  position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: var(--field); color: #fff; border-radius: var(--radius);
  border: 2px solid var(--field-rim, transparent);
  padding: 16px 16px; margin: 6px 0 16px; box-shadow: var(--shadow);
}
/* Football laces along the top, only where the theme defines them. */
.scoreboard::before {
  content: ""; position: absolute; top: 5px; left: 50%; width: 100px; height: 16px;
  transform: translateX(-50%); background: var(--field-laces, none) no-repeat center / contain;
}
:root[data-theme="dark"] .scoreboard, :root:not([data-theme="light"]) .scoreboard { padding-top: 24px; }
.team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.team.home { justify-content: flex-end; }
.abbr { font-weight: 700; letter-spacing: 0.04em; opacity: 0.9; font-size: 15px; }
.score { font-size: 34px; font-weight: 800; line-height: 1; }
.mid { text-align: center; min-width: 0; max-width: 150px; }
.clock { font-weight: 700; font-size: 14px; }
.situation { font-size: 12px; opacity: 0.85; }

/* ---------- start button ---------- */
.controls { text-align: center; margin-bottom: 18px; }
.big-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--btn-bg); color: var(--btn-ink); border: 0;
  padding: 16px 30px; border-radius: 999px; font-size: 19px; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18); transition: transform .1s ease;
}
.big-btn:active { transform: scale(0.98); }
.big-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; opacity: .5; }
.big-btn.on { background: var(--btn-bg); color: var(--btn-ink); box-shadow: none; }
.big-btn.on .dot { background: var(--accent); opacity: 1; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.6); opacity: .6; } }
.status { color: var(--ink-2); font-size: 14px; margin: 10px 0 0; min-height: 1.4em; }
.status.err { color: var(--accent); }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); border: 1px solid var(--line); animation: pop .25s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-title { margin: 0 0 8px; font-size: 21px; line-height: 1.25; font-weight: 700; color: var(--ink); }
.card-title[hidden] { display: none; }
.card-text { margin: 0 0 10px; font-size: 20px; line-height: 1.42; }
.card-more { margin: 0 0 10px; }
.card-more[hidden] { display: none; }
.card-more > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 0;
}
.card-more > summary::-webkit-details-marker { display: none; }
.card-more > summary::after { content: "▾"; font-size: 12px; transition: transform .15s ease; }
.card-more[open] > summary::after { transform: rotate(180deg); }
.card-more-text {
  margin: 6px 0 0; font-size: 18px; line-height: 1.45; color: var(--ink-2);
  border-left: 2px solid var(--line); padding-left: 12px;
}
.card-meta { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; }

/* A player's name inside a card: looks like text, taps like a button. */
.who {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.who:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.whocard {
  position: fixed; left: 50%; transform: translateX(-50%); width: min(100% - 24px, 536px);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); z-index: 6;
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px;
  padding: 14px 14px 14px 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28); animation: pop .2s ease-out;
}
.whocard[hidden] { display: none; }
.who-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); flex-shrink: 0; }
.who-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who-text p { margin: 0; }
.who-name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.who-line { font-size: 13px; color: var(--ink-2); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.who-job { font-size: 15px; line-height: 1.35; margin-top: 4px !important; }
.who-extra { font-size: 13px; color: var(--ink-2); }
.who-close { background: var(--surface-2); border: 0; color: var(--ink-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; align-self: start; }
.card.thinking .card-text { color: var(--ink-2); font-style: italic; }
.card.thinking .card-text::after { content: "…"; animation: blink 1s steps(3) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.empty { background: var(--accent-soft); border-radius: var(--radius); padding: 22px 24px; }
.empty p { margin: 0 0 10px; }
.empty-title { font-size: 24px; font-weight: 700; }
.hint { color: var(--ink-2); font-size: 15px; margin-bottom: 0 !important; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- disclosures ---------- */
.disclosure { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; min-height: 48px; display: flex; align-items: center; gap: 6px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; color: var(--ink-2); }
details[open] summary::before { content: "▾"; }
.transcript { padding: 0 18px 14px; font-size: 14px; color: var(--ink-2); max-height: 260px; overflow: auto; white-space: pre-wrap; }
.play { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.play:last-child { border-bottom: 0; }
.play-head { font-weight: 700; color: var(--ink); font-size: 12px; margin-right: 4px; }
.play.scoring .play-head { color: var(--field); }
.play.turnover .play-head { color: var(--accent); }
.try-inner { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--field-soft); color: var(--ink); border: 0; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; min-height: 36px;
}
.chip:hover { outline: 2px solid var(--field); }
textarea, input[type=text], input[type=password], select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.inline { display: flex; flex-direction: column; gap: 4px; width: 100%; font-size: 13px; color: var(--ink-2); }
.btn {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px;
  padding: 14px 18px; font: inherit; font-weight: 700; cursor: pointer; min-height: 48px;
}
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- pregame prose ---------- */
.prose { display: flex; flex-direction: column; gap: 4px; }
.prose h2 { font-size: 26px; margin: 26px 0 8px; line-height: 1.15; }
.prose h3 { font-size: 20px; margin: 18px 0 6px; }
.prose p { margin: 0 0 8px; }
.prose ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.prose li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; font-size: 16px; line-height: 1.45; }
.prose li strong { display: block; font-size: 17px; margin-bottom: 2px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.prose .pre-note { font-size: 14px; color: var(--ink-2); }

/* ---------- ask ---------- */
.ask-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.ask-q { align-self: flex-end; max-width: 85%; background: var(--accent); color: var(--accent-ink); border-radius: 20px 20px 6px 20px; padding: 12px 16px; font-size: 16px; }
.ask-a { align-self: flex-start; max-width: 92%; background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 16px 18px; font-size: 19px; line-height: 1.42; box-shadow: var(--shadow); }
.ask-a.thinking { color: var(--ink-2); font-style: italic; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.ask-form textarea { flex: 1; resize: none; }
.ask-form .btn { flex-shrink: 0; }

/* ---------- settings (the Android screenshot: grouped rows, big labels, real switches) ---------- */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 8px; margin-bottom: 16px; }
.group-title { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 12px 0 2px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); min-height: 64px; }
.group > .row:first-of-type, .group-title + .row { border-top: 0; }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-label { font-size: 19px; font-weight: 500; }
.row-sub { font-size: 14px; color: var(--ink-2); }
.row-select, .row-input { width: auto; max-width: 46%; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; font-size: 15px; }
.row-range { width: 42%; accent-color: var(--gold); }
label.row { cursor: pointer; }

.switch { position: relative; width: 56px; height: 32px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .knob {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--line);
  transition: background .15s ease, border-color .15s ease;
}
.switch .knob::after {
  content: ""; position: absolute; top: 5px; left: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink-2); transition: transform .15s ease, background .15s ease;
}
.switch input:checked + .knob { background: var(--gold); border-color: var(--gold); }
.switch input:checked + .knob::after { background: #3b2a00; transform: translateX(24px); }
.switch input:focus-visible + .knob { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- tab bar (the wellness app: icons + labels along the bottom) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); z-index: 5;
}
.tab-btn {
  background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; min-height: 44px;
}
.tab-btn.active { color: var(--accent); }
.tab { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* wordmark: sits just above the tab bar, small and quiet */
.wordmark { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6px); text-align: center; font-family: var(--font-display); font-size: 15px; letter-spacing: 0.02em; color: var(--ink-2); pointer-events: none; z-index: 4; }
body.framed .wordmark { bottom: 104px; }
