/* Almanac — an odds board for the hours New York is shut.
   Light by default, dark on request or by the system. Green, red and amber
   mean stands, undone and coin flip; they are never decoration. */

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --soft: #f3f6f6;
  --line: #e4e9ea;
  --line-2: #d3dadc;
  --ink: #13191b;
  --ink-2: #48545a;
  --muted: #7b878c;
  --accent: #0b8f80;
  --accent-bg: #e1f4f1;
  --good: #16934a;
  --good-bg: #e3f5e9;
  --bad: #d4343c;
  --bad-bg: #fce9e9;
  --warn: #a96f00;
  --warn-bg: #fff3d6;
  --shadow: 0 1px 2px rgb(16 24 26 / 5%), 0 1px 1px rgb(16 24 26 / 3%);
  --code: #f6f8f8;
  --f: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --m: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1517; --card: #161e21; --soft: #1c2629; --line: #253134; --line-2: #34433f;
    --ink: #eef3f3; --ink-2: #b2bec1; --muted: #7f8d91;
    --accent: #2cc3ae; --accent-bg: #133430;
    --good: #3fcf78; --good-bg: #133222; --bad: #ff6b70; --bad-bg: #3a1a1c; --warn: #f1b43c; --warn-bg: #3a2c10;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%); --code: #10181a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1517; --card: #161e21; --soft: #1c2629; --line: #253134; --line-2: #34433f;
  --ink: #eef3f3; --ink-2: #b2bec1; --muted: #7f8d91;
  --accent: #2cc3ae; --accent-bg: #133430;
  --good: #3fcf78; --good-bg: #133222; --bad: #ff6b70; --bad-bg: #3a1a1c; --warn: #f1b43c; --warn-bg: #3a2c10;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%); --code: #10181a;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* ---- top bar ---- */
.top { display: flex; align-items: center; gap: 22px; padding: 14px clamp(16px, 4.5vw, 64px); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.logo { display: flex; align-items: center; gap: 9px; font: 800 21px var(--f); text-decoration: none; letter-spacing: -0.01em; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 10px; padding: 0 14px; color: var(--muted); }
.search input { flex: 1; border: 0; background: none; padding: 10px 0; outline: none; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.topright { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.clock { font: 600 13px var(--f); color: var(--warn); white-space: nowrap; }
.hub { display: inline-flex; align-items: center; gap: 7px; font: 600 13px var(--f); color: var(--accent); background: var(--accent-bg); padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.hub i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.seg { display: flex; background: var(--soft); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font: 600 13px var(--f); color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.themebtn { border: 1px solid var(--line); background: var(--card); width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); }
.themebtn .sun { display: none; }
:root[data-theme="dark"] .themebtn .sun { display: block; }
:root[data-theme="dark"] .themebtn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themebtn .sun { display: block; }
  :root:not([data-theme="light"]) .themebtn .moon { display: none; }
}

.tabs { display: flex; gap: 26px; padding: 0 clamp(16px, 4.5vw, 64px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { text-decoration: none; color: var(--ink-2); font-weight: 600; padding: 12px 0 11px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on, .tabs a:hover { color: var(--ink); border-bottom-color: var(--ink); }

main { padding: 26px clamp(16px, 4.5vw, 64px) 40px; max-width: 1440px; margin: 0 auto; }

/* ---- lead ---- */
.lead { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 26px; }
.eyebrow { font: 600 12.5px var(--f); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
h1 { font: 800 clamp(28px, 3.6vw, 40px)/1.1 var(--f); letter-spacing: -0.02em; text-wrap: balance; }
h1 span { color: var(--accent); }
.sub { color: var(--ink-2); margin-top: 10px; max-width: 62ch; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--soft); border-radius: 14px; padding: 16px 18px; display: grid; gap: 2px; }
.stat b { font: 800 clamp(30px, 3vw, 38px)/1.1 var(--f); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 14px; }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.col { display: grid; gap: 26px; min-width: 0; }
.side { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h3 { font: 700 18px var(--f); margin-bottom: 8px; }
.small { color: var(--muted); font-size: 13px; }
.chip { display: inline-block; font: 700 12.5px var(--f); padding: 5px 10px; border-radius: 7px; white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.acc { background: var(--accent-bg); color: var(--accent); }
.chip.dim { background: var(--soft); color: var(--muted); }

/* ---- featured ---- */
.feat { padding: 22px; }
.fhead { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.tk { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font: 800 13px var(--f); color: #fff; background: var(--ink); letter-spacing: 0.02em; }
.meta { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.feat h2 { font: 700 clamp(20px, 2.2vw, 26px)/1.2 var(--f); letter-spacing: -0.01em; }
.feat h2 .dn { color: var(--bad); } .feat h2 .up { color: var(--good); }
.fbody { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 26px; }
.out { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ol { flex: 1; font: 600 17px var(--f); }
.op { font: 800 30px var(--f); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.op.dim { color: var(--muted); }
.verdict { margin-top: 12px; color: var(--ink-2); font-size: 14.5px; }
.why { margin-top: 14px; display: grid; gap: 12px; }
.src { font: 500 11.5px var(--m); color: var(--accent); }
.wt { font-size: 14px; margin-top: 2px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.legend i.dash { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--line-2); }
.chart { height: 260px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.cfoot { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; margin-top: 6px; flex-wrap: wrap; }
.ask { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ask input { flex: 1; min-width: 0; background: var(--soft); border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; outline: none; }
.ask input:focus { border-color: var(--accent); }
.ask button { border: 0; background: var(--accent); color: #fff; font-weight: 700; padding: 0 18px; border-radius: 10px; }
:root[data-theme="dark"] .ask button { color: #062b26; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ask button { color: #062b26; } }
.answer { margin-top: 12px; background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; }
.answer p + p { margin-top: 4px; }

/* ---- grid of moves ---- */
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sechead h2 { font: 700 21px var(--f); }
.sorted { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.m { padding: 16px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; transition: border-color .15s, transform .15s; }
.m:hover { border-color: var(--line-2); transform: translateY(-1px); }
.m.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mh { display: flex; gap: 10px; align-items: center; }
.mh .tk { width: 38px; height: 38px; border-radius: 9px; font-size: 10.5px; }
.mh .nm { flex: 1; min-width: 0; }
.mh .nm b { display: block; font-weight: 700; }
.mh .nm small { color: var(--muted); font-size: 12.5px; }
.gauge { text-align: right; font: 800 19px/1 var(--f); font-variant-numeric: tabular-nums; }
.gauge small { display: block; font: 500 11px var(--f); color: var(--muted); margin-top: 3px; }
.m .call { text-align: center; padding: 9px; border-radius: 9px; font-weight: 700; font-size: 14px; }
.m .mf { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.empty { color: var(--muted); }
.more { margin-top: 14px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px; font-weight: 700; }

/* ---- side ---- */
.promo { background: linear-gradient(135deg, var(--accent-bg), var(--card) 75%); }
.promo p { color: var(--ink-2); font-size: 14px; }
.code { margin-top: 12px; font: 500 12px/1.55 var(--m); background: var(--code); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.copy { margin-top: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: 13px; }
.tools { margin-top: 10px; font-size: 12.5px !important; }
.tools code { font: 500 12px var(--m); color: var(--accent); }
.hot { list-style: none; padding: 0; display: grid; }
.hot li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; }
.hot li button { all: unset; cursor: pointer; font-weight: 600; }
.hot li button:focus-visible { outline: 2px solid var(--accent); }
.hot .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.hot li.muted { display: block; }
.rc { display: grid; grid-template-columns: auto 1fr 1fr; gap: 7px 14px; font-size: 14px; margin: 10px 0 8px; }
.rc .h { font-size: 12px; color: var(--muted); font-weight: 600; }
.rc .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-template-columns: 76px 1fr 38px; gap: 9px 10px; align-items: center; font-size: 14px; margin: 12px 0; }
.bars i { display: block; height: 8px; border-radius: 4px; width: var(--w); }
.bars b { font-variant-numeric: tabular-nums; text-align: right; }

/* ---- live record ---- */
.live .lr { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.live .lr div { background: var(--soft); border-radius: 12px; padding: 12px; }
.live .lr b { display: block; font: 800 22px var(--f); }
.live .lr span { color: var(--muted); font-size: 13px; }
.link { color: var(--accent); font-weight: 600; font-size: 13.5px; text-decoration: none; }

.foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--ink-2); }

/* ---- smaller screens ---- */
@media (max-width: 1120px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .hub { display: none; }
}
@media (max-width: 860px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .fbody { grid-template-columns: minmax(0, 1fr); }
  /* Phones keep the search and the New York clock: the header wraps to a
     second row instead of dropping them, and scrolls away rather than sticking. */
  .top { flex-wrap: wrap; row-gap: 10px; position: static; }
  .topright { display: contents; }
  .seg { margin-left: auto; }
  .clock { order: 3; flex-basis: 100%; }
  .search { order: 4; flex-basis: 100%; max-width: none; }
}
@media (max-width: 520px) {
  .top { gap: 10px; }
  .seg button { padding: 5px 7px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .op { font-size: 26px; }
  .chart { height: 210px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* replay: a past moment, said plainly */
.replay { margin: 0 auto; padding: 10px 18px; font: 500 14px var(--f); background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); text-align: center; }
.replay b { font-weight: 700; }
.replay a { color: inherit; font-weight: 700; margin-left: 6px; }
.replay[data-state="refused"] { background: var(--bad-bg); color: var(--bad); }
.replaypick { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 0; white-space: nowrap; }
.replaypick label { font: 600 13px var(--f); color: var(--ink-2); }
.replaypick .muted { font-weight: 500; color: var(--ink-3, var(--ink-2)); opacity: .75; }
.replaypick input { font: 500 13px var(--f); color: var(--ink); background: var(--bg-2, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; color-scheme: light dark; }
.replaypick button { font: 600 13px var(--f); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.replaypick button:hover, .replaypick input:focus-visible, .replaypick button:focus-visible { border-color: var(--ink); outline: none; }
.facts { margin-top: 10px; font: 500 12.5px/1.5 var(--f); color: var(--muted); }
.facts:empty, .copied:empty { display: none; }
.copied { margin-top: 8px; font: 600 13px var(--f); color: var(--good); }
.testedbadge { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 7px 14px; border-radius: 999px; background: var(--accent-bg, #e3f5f2); color: var(--accent); font: 600 13.5px var(--f); text-decoration: none; }
.testedbadge i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.testedbadge b { font-weight: 600; color: var(--ink-2); }
.testedbadge:hover, .testedbadge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.testedbadge.bad i { background: var(--bad); }
