/* Horse-Oracle — AI Competition redesign 1.0. Everything is scoped under .acr so it
   drops into the 2.5.x theme without touching other pages. Reads tokens from
   ai-competition.tokens.css (which falls back to the theme's own tokens). */

.acr { color: var(--acr-ink); font-family: var(--acr-serif); font-size: 18px; line-height: 1.6; }
.acr *, .acr *::before, .acr *::after { box-sizing: border-box; }
.acr p { margin: 0; }
.acr h1, .acr h2, .acr h3 { font-family: var(--acr-serif); font-weight: 400; line-height: 1.1; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.acr [hidden] { display: none !important; }
.acr a { color: var(--acr-gold-ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
.acr :focus-visible { outline: 2px solid var(--acr-gold); outline-offset: 3px; border-radius: 2px; }
.acr-wrap { max-width: var(--acr-max); margin: 0 auto; padding: 0 var(--acr-gutter); position: relative; }
.acr-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- example banner (crop-safe: one band on top, one tag per chart) ---------- */
.acr-banner { background: var(--acr-paper-2); color: var(--acr-ink); border-bottom: 2px dashed var(--acr-ink-2); font-family: var(--acr-sans); font-size: 15px; line-height: 1.45; padding: 12px var(--acr-gutter); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; text-align: center; }
.acr-banner__tag, .acr-ex { display: inline-flex; align-items: center; gap: 8px; font-family: var(--acr-sans); font-weight: 700; font-size: 13px; letter-spacing: .02em; line-height: 1; padding: 6px 10px; border-radius: 999px; border: 1.5px dashed currentColor; white-space: nowrap; }
.acr-banner__tag { color: var(--acr-ink); background: var(--acr-paper); }
.acr-banner { font-weight: 500; }
.acr-ex { position: absolute; right: var(--acr-gutter); top: -6px; color: var(--acr-ink-2); background: var(--acr-paper); }
.acr-board .acr-ex { color: var(--acr-on-night-2); background: var(--acr-night); top: -14px; }
.acr-sec .acr-ex { top: calc(-1 * clamp(40px, 5vw, 72px)); }
.acr-ex::before, .acr-banner__tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- head ---------- */
.acr-head { background: var(--acr-night); color: var(--acr-on-night); padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 5vw, 64px); position: relative; overflow: hidden; }
.acr-head::after { content: ""; position: absolute; right: -140px; top: -160px; width: 560px; height: 560px; border: 1px solid var(--acr-gold); border-radius: 50%; opacity: .2; pointer-events: none; }
.acr-posture { display: inline-flex; align-items: center; gap: 10px; font-family: var(--acr-sans); font-size: 14px; font-weight: 500; color: var(--acr-on-night-2); }
.acr-posture::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acr-gold); }
.acr-title { font-size: clamp(40px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -.02em; margin-top: 22px !important; max-width: 14ch; }
.acr-dek { font-size: clamp(21px, 2.1vw, 29px); line-height: 1.38; color: var(--acr-on-night); margin-top: 26px !important; max-width: 30em; }

/* ---------- board: races won ---------- */
.acr-board { background: var(--acr-night); color: var(--acr-on-night); padding: 8px 0 clamp(56px, 7vw, 88px); }
.acr-board__inner { border-top: 1px solid var(--acr-night-line); padding-top: clamp(32px, 4vw, 48px); position: relative; }
.acr-board h2 { font-size: clamp(26px, 2.6vw, 36px); color: var(--acr-on-night); }
.acr-bars { margin-top: 32px; display: grid; gap: 30px; }
.acr-bar { display: grid; grid-template-columns: minmax(0, 220px) 150px minmax(0, 1fr) 76px; align-items: center; gap: 0 24px; }
.acr-bar__label { font-family: var(--acr-sans); font-size: 18px; font-weight: 600; color: var(--acr-on-night); display: flex; align-items: center; gap: 12px; }
.acr-bar__big { display: flex; align-items: baseline; gap: 10px; }
.acr-bar__k { font-family: var(--acr-sans); font-stretch: 78%; font-weight: 600; font-size: clamp(54px, 5.6vw, 76px); line-height: .9; letter-spacing: -.02em; }
.acr-bar__of { font-family: var(--acr-sans); font-size: 15px; color: var(--acr-on-night-2); white-space: nowrap; }
.acr-bar__track { position: relative; height: 30px; background: var(--acr-night-3); border-radius: 0 4px 4px 0; }
.acr-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acr-ho-night); border-radius: 0 4px 4px 0; }
.acr-bar__fill--outline { background: transparent; border: 2px solid var(--acr-on-night-2); border-left-width: 2px; }
.acr-bar__pct { font-family: var(--acr-sans); font-size: 18px; font-weight: 600; color: var(--acr-on-night-2); text-align: right; font-variant-numeric: tabular-nums; }
.acr-caption { font-family: var(--acr-sans); font-size: 16px; color: var(--acr-on-night-2); margin-top: 30px !important; max-width: 46em; }
.acr-key { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; }
.acr-key--ho { background: var(--acr-ho-paper); }
.acr-board .acr-key--ho { background: var(--acr-ho-night); }
.acr-key--ref { border: 2px solid var(--acr-ink-2); }
.acr-key--none { background: var(--acr-ink-3); opacity: .5; border-radius: 3px; }
.acr-board .acr-key--ref { border-color: var(--acr-on-night-2); }
@media (max-width: 760px) {
    .acr-bar { grid-template-columns: 1fr auto; grid-template-areas: "label label" "big pct" "track track"; gap: 10px 16px; }
    .acr-bar__label { grid-area: label; } .acr-bar__big { grid-area: big; } .acr-bar__pct { grid-area: pct; align-self: end; } .acr-bar__track { grid-area: track; height: 24px; }
}

/* ---------- sections ---------- */
.acr-sec { background: var(--acr-paper); padding: clamp(64px, 8vw, 112px) 0; }
.acr-sec--alt { background: var(--acr-paper-2); }
.acr-sec h2 { font-size: clamp(30px, 3.2vw, 44px); }
.acr-sec h2::before { content: ""; display: block; width: 36px; height: 2px; background: var(--acr-gold); margin-bottom: 22px; }
.acr-deck { font-size: 19px; color: var(--acr-ink-2); margin-top: 16px !important; max-width: 34em; }
.acr-reading { font-size: 20px; line-height: 1.5; margin-top: 24px !important; max-width: 30em; }
.acr-reading strong { font-weight: 700; }
.acr-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
@media (max-width: 900px) { .acr-split { grid-template-columns: 1fr; } }

/* marks: shape carries the meaning, colour only repeats it */
.acr-mark { display: inline-block; width: 20px; height: 20px; border-radius: 50%; flex: none; position: relative; }
.acr-mark--won { background: var(--acr-ho-paper); }
.acr-mark--placed { border: 3px solid var(--acr-ho-paper); }
.acr-mark--out::before { content: ""; position: absolute; left: 3px; right: 3px; top: 9px; height: 2.5px; border-radius: 2px; background: var(--acr-ink-3); }
.acr-mark--void::before, .acr-mark--void::after { content: ""; position: absolute; left: 9px; top: 2px; width: 2.5px; height: 16px; border-radius: 2px; background: var(--acr-ink-2); transform: rotate(45deg); }
.acr-mark--void::after { transform: rotate(-45deg); }

/* finish: counts + 96-race grid */
.acr-counts { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--acr-rule); }
.acr-counts li { display: grid; grid-template-columns: 28px 88px 1fr; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--acr-rule); }
.acr-counts__k { font-family: var(--acr-sans); font-stretch: 80%; font-weight: 600; font-size: 46px; line-height: 1; letter-spacing: -.015em; }
.acr-counts__l { font-family: var(--acr-sans); font-size: 17px; color: var(--acr-ink-2); }
.acr-grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 10px; padding: 24px; background: var(--acr-paper-2); border-radius: 6px; }
.acr-sec--alt .acr-grid { background: var(--acr-paper); }
.acr-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; cursor: default; }
.acr-cell .acr-mark { width: 100%; height: 100%; max-width: 26px; max-height: 26px; }
.acr-cell .acr-mark--out::before { top: calc(50% - 1.25px); }
.acr-cell:hover .acr-mark { transform: scale(1.15); }
.acr-grid-note { font-family: var(--acr-sans); font-size: 14px; color: var(--acr-ink-3); margin-top: 12px !important; }
@media (max-width: 640px) { .acr-grid { grid-template-columns: repeat(12, 1fr); gap: 6px; padding: 14px; } .acr-counts li { grid-template-columns: 24px 72px 1fr; } .acr-counts__k { font-size: 38px; } }

/* different horse: three bars on one scale */
.acr-same { font-family: var(--acr-sans); font-size: 16px; color: var(--acr-ink-2); padding: 14px 18px; border: 1px solid var(--acr-rule-2); border-radius: 6px; margin-bottom: 28px; }
.acr-same strong { color: var(--acr-ink); }
.acr-hbars { display: grid; gap: 22px; }
.acr-hbar { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 56px; align-items: center; gap: 0 18px; }
.acr-hbar__label { font-family: var(--acr-sans); font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.acr-hbar__track { position: relative; height: 26px; background: color-mix(in srgb, var(--acr-rule) 55%, transparent); border-radius: 0 4px 4px 0; }
.acr-hbar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.acr-hbar__fill--ho { background: var(--acr-ho-paper); }
.acr-hbar__fill--ref { border: 2px solid var(--acr-ink-2); background: transparent; }
.acr-hbar__fill--none { background: var(--acr-ink-3); opacity: .42; }
.acr-hbar__k { font-family: var(--acr-sans); font-stretch: 85%; font-weight: 600; font-size: 26px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .acr-hbar { grid-template-columns: 1fr auto; grid-template-areas: "label k" "track track"; gap: 8px 12px; } .acr-hbar__label { grid-area: label; } .acr-hbar__k { grid-area: k; } .acr-hbar__track { grid-area: track; } }

/* not counted */
.acr-held + .acr-held { margin-top: 56px; }
.acr-held__band { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border: 1.5px dashed var(--acr-ink-2); border-radius: 6px; font-family: var(--acr-sans); font-size: 16px; line-height: 1.5; color: var(--acr-ink-2); max-width: 46em; }
.acr-held__band strong { color: var(--acr-ink); }
.acr-held__band .acr-mark { margin-top: 1px; }
.acr-held__band > p { max-width: 53ch; } /* ~70 characters per line in Archivo 16px (1ch ~ 1.35 characters) */
.acr-held__title { font-size: 26px !important; margin-top: 32px !important; }
.acr-held__title::before { display: none !important; }
.acr-held__tally { font-family: var(--acr-sans); font-size: 16px; color: var(--acr-ink-2); margin-top: 8px !important; }

/* tables */
.acr-table { width: 100%; border-collapse: collapse; font-family: var(--acr-sans); font-size: 15.5px; font-variant-numeric: tabular-nums; margin-top: 20px; }
.acr-table th, .acr-table td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--acr-rule); font-weight: 400; vertical-align: middle; }
.acr-table thead th { font-weight: 600; font-size: 13.5px; color: var(--acr-ink-3); border-bottom: 2px solid var(--acr-ink); }
.acr-table tbody th { font-weight: 600; }
.acr-horse { display: inline-flex; gap: 10px; align-items: baseline; }
.acr-horse b { font-weight: 600; color: var(--acr-ink-2); min-width: 1.6em; }
.acr-out { display: inline-flex; gap: 10px; align-items: center; }
.acr-out .acr-mark { width: 16px; height: 16px; }
.acr-out .acr-mark--placed { border-width: 2.5px; }
.acr-out .acr-mark--out::before { top: 7px; }
@media (max-width: 700px) {
    .acr-table thead { display: none; }
    .acr-table, .acr-table tbody, .acr-table tr, .acr-table th, .acr-table td { display: block; width: 100%; }
    .acr-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--acr-rule); }
    .acr-table th, .acr-table td { border: 0; padding: 0; }
    .acr-table [data-label]::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--acr-ink-3); margin-bottom: 2px; }
}

/* caveats + glossary */
.acr-two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); }
@media (max-width: 900px) { .acr-two { grid-template-columns: 1fr; } }
.acr-two h2 { font-size: clamp(26px, 2.6vw, 34px) !important; }
.acr-list { list-style: none; margin: 24px 0 0; padding: 0; }
.acr-list li { padding: 14px 0 14px 24px; border-bottom: 1px solid var(--acr-rule); position: relative; color: var(--acr-ink-2); font-size: 17.5px; }
.acr-list li::before { content: ""; position: absolute; left: 0; top: 1.3em; width: 10px; height: 2px; background: var(--acr-gold); }
.acr-list strong { color: var(--acr-ink); font-weight: 700; }
.acr-gloss { margin: 24px 0 0; border-top: 1px solid var(--acr-rule); }
.acr-gloss div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--acr-rule); }
.acr-gloss dt { font-family: var(--acr-sans); font-weight: 600; font-size: 16px; }
.acr-gloss dd { margin: 0; color: var(--acr-ink-2); font-size: 17px; }
@media (max-width: 640px) { .acr-gloss div { grid-template-columns: 1fr; gap: 4px; } }

/* source line + full table */
.acr-source { font-family: var(--acr-sans); font-size: 15px; line-height: 1.65; color: var(--acr-ink-3); max-width: 54ch; } /* ~70 characters per line in Archivo 15px */
.acr-source code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13.5px; color: var(--acr-ink-2); background: var(--acr-paper-2); padding: 1px 6px; border-radius: 3px; }
.acr-source a { font-weight: 600; }
.acr-details { margin-top: 24px; font-family: var(--acr-sans); }
.acr-details summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--acr-ink-2); min-height: 44px; display: inline-flex; align-items: center; list-style: none; }
.acr-details summary::-webkit-details-marker { display: none; }
.acr-details summary::before { content: "+"; margin-right: 10px; font-weight: 400; }
.acr-details[open] summary::before { content: "\2212"; }
.acr-scroll { max-height: 560px; overflow: auto; }

/* fallback */
.acr-fallback { max-width: var(--acr-max); margin: 56px auto; padding: 0 var(--acr-gutter); }
.acr-fallback p { max-width: 40em; color: var(--acr-ink-2); }
.acr-fallback .acr-fallback__title { font-family: var(--acr-serif); font-size: 28px; color: var(--acr-ink); border-top: 2px solid var(--acr-gold); padding-top: 20px; margin-bottom: 10px; }

/* tooltip */
.acr-tip { position: fixed; z-index: 60; pointer-events: none; max-width: 300px; background: var(--acr-night, #101e16); color: var(--acr-on-night, #f2ede0); border: 1px solid var(--acr-night-line, #2c4537); border-radius: 6px; padding: 10px 12px; font-family: var(--acr-sans, Arial, sans-serif); font-size: 14px; line-height: 1.45; box-shadow: 0 10px 28px rgba(10, 18, 14, .28); }
.acr-tip strong { display: block; font-weight: 600; margin-bottom: 2px; }
.acr-tip__row { display: flex; justify-content: space-between; gap: 18px; color: var(--acr-on-night-2, #bcc7bf); }

@media (prefers-reduced-motion: no-preference) {
    .acr[data-acr-state="live"] .acr-bar__fill, .acr[data-acr-state="example"] .acr-bar__fill { animation: acr-grow .7s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
    @keyframes acr-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* 2.6.3 rebuild: Claude site fixes v1, mapped. Prose 68ch / notes 72ch on the text, never the panel. */
.acr-held__tally { max-width: var(--measure-prose, 68ch); }
.acr-caption { max-width: var(--measure-note, 72ch); }
/* Focus ring: 2px ink on paper; dark head and board keep the gold ring */
.acr :is(a, button, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.acr :is(.acr-head, .acr-board) :is(a, button, summary):focus-visible { outline-color: var(--acr-gold); }

/* 2.6.6: EquinEdge section. Reuses the bars, deck, reading and table styles above. */
.acr-key--ee { border-radius: 3px; background: var(--acr-ink-2); }
.acr-hbar__fill--ee { background: var(--acr-ink-2); }
.acr .acr-eenote { font-family: var(--acr-sans); font-size: 16px; line-height: 1.5; color: var(--acr-ink-2); margin-top: 18px; max-width: 53ch; } /* ~70 characters per line in Archivo 16px */
.acr .acr-eenote strong { color: var(--acr-ink); }
.acr-ee { margin-top: 32px; }
.acr-ee .acr-eenote { margin-top: 22px; }
.acr-sec--ee .acr-details { margin-top: 28px; }
.acr-sec--ee { padding-bottom: 0; } /* the next section is the same shade; one gap, not two */
.acr .acr-same--2 { margin-top: 28px; }
.acr-eesplit { margin-top: 22px; }

/* 2.6.9: hold notes, held band, tally and weekend totals to about 70 characters a line (kept from 2.6.7). */
.acr .acr-eenote, .acr-held__band > p { max-width: 50ch; }
.acr .acr-held__tally { max-width: 50ch; }
.acr .acr-subhead { font-size: 26px; margin-top: 36px; }
.acr [data-acr=ee-weekend-totals] { margin-bottom: 32px; }


/* 2.6.12: muted tags for hand-built counted rows and off-turf rows */
.acr-tag{display:inline-block;margin-left:8px;padding:0 6px;border:1px solid currentColor;border-radius:3px;font-size:11px;font-style:italic;font-weight:500;opacity:.7;line-height:18px;vertical-align:middle}

/* 2.6.13: captions and "same horse" notes stay at about 70 characters a line (16px Archivo, same 50ch measure as .acr-eenote). */
.acr-caption,
.acr-same { max-width: 50ch; }
