/* Payday: a bank statement and a till receipt. Loaded after engine/src/style.css; never change engine/ for this.
   What makes it its own (the other story sites all use warm paper, PT Serif and round pills):
   - cool ruled ledger paper with a thin margin line, deep banknote green ink for money that is yours;
   - sans-serif text (system fonts with Cyrillic: Segoe UI, Roboto, Noto Sans), monospace for every figure;
   - square-ish edges, choices like statement rows, the ending card as a torn receipt.
   Dark mode: a banking app at night (green-black, mint accent). System fonts only, no downloads. */
:root {
  --bg: #e5ebe7;
  --surface: #ffffff;
  --ink: #17231e;
  --muted: #5a6962;
  --line: #cfd9d3;
  --accent: #1f6b4f;
  --accent-ink: #fff;
  --warm: #1f6b4f;
  --cold: #cfd9d3;
  --best: #1f6b4f; --good: #2f5f8f; --ok: #8a6a12; --bad: #b0352b;
  --up: #1f6b4f; --down: #b0352b; --past: #6b7a73;
  --radius: 4px;
  --rule: rgba(31, 107, 79, .07);
  --margin: rgba(176, 53, 43, .22);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", "DejaVu Sans Mono", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1512; --surface: #14201b; --ink: #e3ece7; --muted: #94a69d; --line: #26362f;
    --accent: #5fd0a0; --accent-ink: #06150f; --warm: #5fd0a0; --cold: #2a3a33;
    --best: #5fd0a0; --good: #7fb2e6; --ok: #e0bd5a; --bad: #f07f72; --up: #5fd0a0; --down: #f07f72; --past: #8a9b93;
    --rule: rgba(95, 208, 160, .05); --margin: rgba(240, 127, 114, .18);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1512; --surface: #14201b; --ink: #e3ece7; --muted: #94a69d; --line: #26362f;
  --accent: #5fd0a0; --accent-ink: #06150f; --warm: #5fd0a0; --cold: #2a3a33;
  --best: #5fd0a0; --good: #7fb2e6; --ok: #e0bd5a; --bad: #f07f72; --up: #5fd0a0; --down: #f07f72; --past: #8a9b93;
  --rule: rgba(95, 208, 160, .05); --margin: rgba(240, 127, 114, .18);
}

/* ---------- paper: ruled ledger lines and a margin line ---------- */
body {
  font: 18px/1.62 var(--sans);
  background:
    linear-gradient(90deg, transparent calc(50% - 356px), var(--margin) calc(50% - 356px), var(--margin) calc(50% - 355px), transparent calc(50% - 355px)),
    repeating-linear-gradient(180deg, transparent 0 28px, var(--rule) 28px 29px),
    var(--bg);
  background-attachment: fixed;
}
@media (max-width: 760px) { body { background: repeating-linear-gradient(180deg, transparent 0 28px, var(--rule) 28px 29px), var(--bg); } }

/* ---------- header: brand as a statement heading ---------- */
.top { font-family: var(--sans); border-bottom: 2px solid var(--ink); }
.brand { color: var(--ink); font: 700 13px/1 var(--mono); letter-spacing: .18em; }
.brand::before { content: "€ "; color: var(--accent); }
.seg button { border-radius: 3px; font-family: var(--sans); }
.seg button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- titles ---------- */
.section h1, .setup h1, .guide h1 { font-family: var(--sans); font-weight: 800; letter-spacing: -.025em; }
.section h1 { font-size: 42px; }
.section h1::after { content: ""; display: block; width: 64px; height: 4px; margin-top: 12px; background: var(--accent); }
.blurb, .section-blurb { font-family: var(--sans); }
.tag { font-family: var(--mono); letter-spacing: .12em; }

/* story card: a statement entry with a dated stripe on top */
.story-card { border-radius: var(--radius); border-top: 3px solid var(--accent); box-shadow: 0 1px 0 var(--line); }
.story-card h2 { font-family: var(--sans); font-weight: 800; letter-spacing: -.015em; }

/* buttons: rectangular, like a banking app */
.primary, .secondary { border-radius: var(--radius); font-family: var(--sans); letter-spacing: .01em; }
.primary { box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.primary:active { transform: translateY(1px); box-shadow: none; }

/* ---------- status bar: figures in monospace ---------- */
.status { font-family: var(--sans); }
.stat-label { font-family: var(--mono); letter-spacing: .08em; }
.amount-value { font: 700 15px/1 var(--mono); }
.stat.amount { padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat.amount.low { border-color: var(--bad); }
.dot { border-radius: 2px; }
.cal-today, .cal-next, .cal-day { font-family: var(--mono); }
.cal-day { border-radius: 2px; }
.cal-day.mark { box-shadow: inset 0 -2px 0 var(--bad); }
.cal-day.today { background: var(--ink); color: var(--bg); }
.chip { font-family: var(--mono); border-radius: 3px; }
.chip.down::before { content: ""; }

/* ---------- reading ---------- */
.text p:first-child::first-letter { font-size: 1em; }
.echo { font-family: var(--sans); border-left-width: 4px; }
.beat.past + .beat.now { border-top: 1px dashed var(--muted); }

/* choices: statement rows with a mono line number */
.choices { gap: 0; border-top: 1px solid var(--line); }
.choice {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  padding: 14px 10px 14px 6px; font-family: var(--sans); font-size: 17px;
  transition: background .15s, box-shadow .15s;
}
.choice:hover, .choice:focus-visible { transform: none; background: var(--surface); box-shadow: inset 4px 0 0 var(--accent); }
.num { font: 700 13px/1 var(--mono); border-radius: 3px; border: 0; background: var(--accent); color: var(--accent-ink); width: 24px; height: 22px; }
.choice.locked .num { background: var(--cold); color: var(--muted); }
.needs { font-family: var(--mono); }

/* companions and events */
.companion-line { font-style: normal; }
.companion-line .who, .event-line .tag { font-family: var(--mono); letter-spacing: .1em; }

/* ---------- ending: a till receipt with a torn bottom edge ---------- */
.ending-card {
  position: relative; border: 1px solid var(--line); border-top: 6px solid var(--kind, var(--accent)); border-radius: 0;
  padding: 22px 22px 34px; font-family: var(--sans);
  --tear: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat,
          conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 18px 9px repeat-x;
  -webkit-mask: var(--tear); mask: var(--tear);
}
.ending-card .kind { font-family: var(--mono); letter-spacing: .16em; }
.ending-card h2 { font-family: var(--sans); font-weight: 800; letter-spacing: -.015em; }
.ending-card h3 { font-family: var(--mono); letter-spacing: .1em; border-top: 1px dashed var(--line); padding-top: 12px; }
.sources h3, .ending-card .facts h3 { font-family: var(--mono); }
.fact-source { font-family: var(--mono); font-size: .8em; }
.endings-map li { border-radius: 3px; font-family: var(--mono); }

/* ---------- notes (guides) and footer ---------- */
.guide h2 { font-family: var(--sans); font-weight: 800; }
.guide .note { border-radius: var(--radius); }
.guide-list a { font-family: var(--sans); font-weight: 800; }
.site-foot { border-top: 2px solid var(--ink); }
.ai-bar { border-radius: var(--radius); }
.setup input.name { border-radius: var(--radius); }

/* ---------- page mood "overdue" (engine v1.11.0 staging) ----------
   For the stretch where money is owed and the reminders come: a dark statement page with a red-ink cast,
   like the banking app at night when the balance is below zero. No glow, no movement: this is not danger,
   only debt. Set with "page": "overdue" on a scene entry (scenes/<id>/index.json). */
html:root[data-page="overdue"] {
  --bg: #24171a; --surface: #301f23; --ink: #f5e8e6; --muted: #cfaca8; --line: #4e3237;
  --accent: #f0907e; --accent-ink: #1c0d0c; --warm: #f0907e; --cold: #43363a;
  --best: #5fd0a0; --good: #8fb8e6; --ok: #e0bd5a; --bad: #f58a7c; --up: #5fd0a0; --down: #f58a7c; --past: #b8a29f;
  --rule: rgba(240, 144, 126, .05); --margin: rgba(240, 144, 126, .2);
  color-scheme: dark;
}
