/* home area: styles for this area's pages only (loaded on every page, so every rule is scoped by an area class or a page-specific selector). */

.area-home {
  --spring: linear(0, 0.22 7%, 0.62 17%, 0.92 27%, 1.05 36%, 1.07 44%, 1.03 56%, 1 70%, 1);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --d1: 0.15s; --d2: 0.25s; --d3: 0.45s;
}
@supports not (transition-timing-function: linear(0, 1)) { .area-home { --spring: cubic-bezier(0.34, 1.4, 0.64, 1); } }

/* ---- page rhythm: sections 72px apart, headings on one scale ------------------------------------------------ */
.area-home h2 { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2rem); line-height: 1.1; letter-spacing: -0.01em; }
.area-home .top-bots, .area-home .home-steps, .area-home .proof { margin-top: 4.5rem; }
.area-home .section-head { margin: 0 0 1.1rem; }
.area-home .section-head .more { font-size: 0.9375rem; }
.area-home .section-intro { max-width: 60ch; }
.area-home .home-steps > h2 { margin: 0 0 0.4rem; }

/* ---- the top: hero beside the arena, the rail below ------------------------------------------------------------ */
.area-home .home-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem 3rem; align-items: center; padding: 2rem 0 0; margin: 0 0 3rem; border-image: none; background: none; }
.area-home .home-top > [data-reload-url] { display: contents; }
.area-home .hero { display: block; padding: 0; grid-column: 1; grid-row: 1; }
.area-home .hm-stage { grid-column: 2; grid-row: 1; min-width: 0; }
.area-home .hm-rail-wrap, .area-home .day { grid-column: 1 / -1; }
.area-home .hm-rail-wrap { grid-row: 2; min-width: 0; margin-top: 1.5rem; }
.area-home .day { grid-row: 3; }

.area-home .hero .actions { margin-bottom: 0; }

/* the arena: one composed panel */
.area-home .hm-arena { display: grid; gap: 0.6rem; padding: 0.9rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; }
.area-home .hm-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.2rem 0.7rem; padding: 0.1rem 0.15rem 0.55rem; }
.area-home .hm-live { text-transform: capitalize; display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 650; font-size: 0.875rem; color: var(--check); }
.area-home .hm-live.is-paused { color: var(--amber); }
.area-home .hm-live .live-dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: none; }
.area-home .hm-live .live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: home-ping 1.8s ease-out infinite; }
.area-home .hm-final { font-size: 0.8125rem; font-weight: 650; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0 0.6rem; line-height: 1.5rem; }
.area-home .hm-gname { font-family: var(--font-head); font-weight: 600; font-size: 1.1875rem; color: var(--ink); text-decoration: none; }
.area-home .hm-gname:hover { text-decoration: underline; }
.area-home .hm-top .tag { margin-left: auto; }
.area-home .hm-result { flex-basis: 100%; font-size: 0.875rem; color: var(--ink-2); }
.area-home .hm-result .win, .area-home .hm-result strong { color: var(--teal); font-weight: 650; }
.area-home .hm-top .tag + .hm-result { flex-basis: auto; }

.area-home .hm-seats { display: grid; gap: 0.45rem; }
.area-home .hm-seats.is-table { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.area-home .hm-seat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.35rem 0.7rem; align-items: center; padding: 0.5rem 0.75rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sheet); overflow: hidden; transition: border-color var(--d2); }
.area-home .hm-seat.on { border-color: var(--rule-strong); }
.area-home .hm-sd { flex: none; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 50%; font: 700 0.75rem/1 var(--font-mono); color: var(--numeral); background: var(--ink-2); }
.area-home .s1 .hm-sd { background: var(--seat1-deep, var(--seat1)); }
.area-home .s2 .hm-sd { background: var(--seat2-deep, var(--seat2)); }
.area-home .hm-seat.on .hm-sd { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink-2); }
.area-home .hm-sn { font-weight: 650; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.area-home .hm-sn:hover { text-decoration: underline; }
.area-home .hm-sr { color: var(--ink-2); }
.area-home .hm-prov { margin-left: 0.4rem; font: 600 0.75rem var(--font); color: var(--amber); border: 1px solid var(--amber); border-radius: 999px; padding: 0 0.4rem; vertical-align: 0.1em; }
.area-home .hm-sc { display: inline-flex; align-items: center; gap: 0.4rem; justify-content: flex-end; min-width: 4.75rem; color: var(--ink-2); }
.area-home .hm-seat.on .hm-sc { color: var(--ink); }
.area-home .hm-w { color: var(--teal); font-family: var(--font); font-weight: 650; }
.area-home .hm-seat.won { border-color: var(--teal); }
.area-home .hm-clk.ticking { background: var(--ink); color: var(--paper); border-radius: 4px; padding: 0 0.35rem; }
.area-home .hm-bar { grid-column: 1 / -1; display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 3px; border: 0; border-radius: 2px; background: var(--rule); overflow: hidden; color: var(--ink-2); }
.area-home .hm-bar::-webkit-progress-bar { background: var(--rule); }
.area-home .hm-bar::-webkit-progress-value { background: var(--ink-2); transition: width 1s linear; }
.area-home .hm-bar::-moz-progress-bar { background: var(--ink-2); }
.area-home .hm-seat.on .hm-bar::-webkit-progress-value { background: var(--ink); }
.area-home .hm-seat.on .hm-bar::-moz-progress-bar { background: var(--ink); }
.area-home .s1.on .hm-bar::-webkit-progress-value { background: var(--seat1); }
.area-home .s1.on .hm-bar::-moz-progress-bar { background: var(--seat1); }
.area-home .s2.on .hm-bar::-webkit-progress-value { background: var(--seat2); }
.area-home .s2.on .hm-bar::-moz-progress-bar { background: var(--seat2); }

/* the 4:3 board frame, in the arena and in every rail card */
.area-home .hm-bw { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.area-home .hm-bw .mini-board { position: relative; display: grid; place-items: center; width: 100%; height: 100%; background: var(--paper); border-radius: 0; outline-offset: -3px; }
.area-home .hm-bw .mini-board:hover { box-shadow: none; }
/* the server's board fills the frame whatever its own shape (a tall or square one is letterboxed, never cropped) */
.area-home .hm-bw .ag-board { position: absolute; inset: 0; }
.area-home .hm-bw .ag-board, .area-home .hm-bw .ag-board svg { width: 100%; height: 100%; display: block; }
.area-home .hm-bw .no-board { color: var(--ink-2); font-size: 0.9375rem; text-decoration: none; }

/* think times, only when measured */
.area-home .hm-tele { display: grid; gap: 0.3rem; padding: 0.5rem 0.75rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sheet); font-size: 0.8125rem; color: var(--ink-2); }
.area-home .hm-tl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 0.2rem 0.9rem; align-items: center; }
.area-home .hm-tl .hm-sd { width: 0.625rem; height: 0.625rem; font-size: 0; }
.area-home .hm-tl b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-home .hm-tf .mono { color: var(--ink); font-size: 0.75rem; }
.area-home .hm-tf .mono.warn { color: var(--coral); }
.area-home .hm-tnote { margin: 0; font-size: 0.75rem; color: var(--ink-2); }

.area-home .hm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.7rem; }
.area-home .hm-actions .btn { min-height: 44px; transition: background-color var(--d1), transform var(--d2) var(--spring), border-color var(--d1); }
.area-home .hm-actions .btn:active, .area-home .hm-replay:active { transform: scale(0.97); }
.area-home .hm-empty { padding: 2rem 1.5rem; border: 1px dashed var(--rule-strong); border-radius: var(--r-sheet); }
.area-home .hm-empty h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }

/* games: a carousel of one equal compact card per game, the one shown larger is not in it */
.area-home .hm-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; margin: 0 0 0.9rem; }
.area-home .hm-sec-head h2 { margin: 0; }
.area-home .hm-count { display: none; margin: 0 0 0 auto; font-size: 0.8125rem; color: var(--ink-2); }
.area-home.has-rail .hm-count { display: block; }
.area-home .hm-rail-wrap.is-fit .hm-count { display: none; }
.area-home .hm-nav { display: none; gap: 0.5rem; }
.area-home.has-rail .hm-nav { display: flex; }
.area-home .hm-rail-wrap.is-fit .hm-nav, .area-home .hm-rail-wrap.is-fit .hm-prog { display: none; }
.area-home .hm-arrow { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--sheet); border: 1px solid var(--rule-strong); color: var(--ink); cursor: pointer; transition: border-color var(--d1), background-color var(--d1), opacity var(--d1), transform var(--d2) var(--spring); }
.area-home .hm-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.area-home .hm-arrow:hover:not(:disabled) { border-color: var(--teal); background: var(--hover); }
.area-home .hm-arrow:active:not(:disabled) { transform: scale(0.94); }
.area-home .hm-arrow:disabled { opacity: 0.35; cursor: default; }
.area-home .hm-arrow:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (hover: none) and (pointer: coarse) { .area-home .hm-nav { display: none; } }   /* touch: swipe */
/* the track scrolls inside its own box: its cards are 1/3.5 of it (the next one peeks), 1/2.5 on tablets, 1/1.2 on phones */
.area-home .hm-rail { --gap: 0.85rem; --per: 3.5; --bleed: var(--gutter, 32px); --fade-l: 0px; --fade-r: 0px; position: relative; display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; padding: 0.5rem var(--bleed) 0.9rem; margin: -0.25rem calc(-1 * var(--bleed)) 0; scroll-snap-type: x mandatory; scroll-padding-inline: var(--bleed); scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; contain: layout;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); }
.area-home.has-rail .hm-rail-wrap:not(.at-start) .hm-rail { --fade-l: calc(var(--bleed) + 1.5rem); }
.area-home.has-rail .hm-rail-wrap:not(.at-end) .hm-rail { --fade-r: calc(var(--bleed) + 1.5rem); }
.area-home .hm-rail::-webkit-scrollbar { display: none; }
.area-home .hm-card { position: relative; flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-width: 11rem; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; cursor: pointer; transition: border-color var(--d2), transform var(--d3) var(--spring), background-color var(--d2); }
.area-home .hm-card:hover { border-color: var(--teal); transform: translateY(-4px); background: var(--hover); }
.area-home .hm-card:focus-within { border-color: var(--teal); }
.area-home .hm-card.is-entering { animation: home-enter 0.45s var(--ease-out) both; }
.area-home .hm-ctop { display: flex; align-items: flex-start; gap: 0.5rem; min-height: 1.75rem; font-size: 0.875rem; }
.area-home .hm-ctop .hm-final, .area-home .hm-ctop .hm-live { flex: none; }
.area-home .hm-cname { min-width: 0; padding-top: 0.2rem; font-weight: 650; line-height: 1.2; color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.area-home .hm-card .hm-bw { border-radius: 8px; }
.area-home .hm-cvs { display: grid; gap: 0.15rem; }
.area-home .hm-cv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; font-size: 0.875rem; min-height: 1.5rem; }
.area-home .hm-cv .hm-sd { width: 1.2rem; height: 1.2rem; font-size: 0.75rem; }
.area-home .hm-cc { color: var(--ink-2); font-size: 0.75rem; }
.area-home .hm-cv.on .hm-cc { color: var(--ink); }
.area-home .hm-cv.won .hm-cc { color: var(--teal); }
.area-home .hm-cfoot { display: flex; margin-top: auto; }
/* .hm-pick is not a button: the card's whole-surface link (stretched-link pattern), invisible, under the Replay button. */
.area-home .hm-pick { position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.area-home .hm-replay { position: relative; z-index: 2; width: 100%; }  /* a shared .btn.ghost.small, lifted above the card-wide .hm-pick link */
.area-home .hm-pick:focus-visible, .area-home .hm-rail:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
/* where the strip is: a thin bar, its thumb as long as the share of the strip in view */
.area-home .hm-prog { display: none; position: relative; height: 3px; margin: 0.15rem 0 0; border-radius: 2px; background: var(--rule); overflow: hidden; }
.area-home.has-rail .hm-prog { display: block; }
.area-home .hm-prog-bar { position: absolute; top: 0; bottom: 0; left: var(--x, 0%); width: var(--w, 100%); border-radius: 2px; background: var(--teal); }
@keyframes home-enter { from { opacity: 0; transform: translateX(-16px) scale(0.96); } to { opacity: 1; transform: none; } }

/* set of the day */
.area-home .day { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; padding: 0.75rem 1rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); }
.area-home .day-ico { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--teal); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.area-home .day-title { font-family: var(--font-head); font-weight: 600; }
.area-home .day p { margin: 0; flex: 1 1 18rem; min-width: 0; color: var(--ink-2); font-size: 0.9375rem; }
.area-home .day p a { color: var(--ink); font-weight: 600; }
.area-home .day .more { margin-left: auto; font-weight: 650; color: var(--teal); text-decoration: none; }
.area-home .day .more::after { content: " \2192"; }
.area-home .day .more:hover { text-decoration: underline; }
.area-home .mono { font-family: var(--font-mono); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }


/* tournament teaser */
.area-home + .tourney-teaser, .tourney-teaser { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; padding: 0.65rem 1rem; margin: 0 0 2.5rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); }
.tourney-teaser .tt-main { flex: 1 1 16rem; min-width: 0; }
.tourney-teaser .tt-name { font-family: var(--font-head); font-weight: 700; color: var(--ink); text-decoration: none; }
.tourney-teaser .tt-name:hover { text-decoration: underline; }
.tourney-teaser .tt-fact { white-space: nowrap; }

/* top bots: tabs with a sliding indicator, rows as cards */
.area-home .standings-board { background: none; border: 0; border-radius: 0; }
.area-home .tab-strip { position: relative; display: flex; gap: 0.1rem; overflow-x: auto; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
.area-home .tab-strip button { position: relative; flex: none; min-height: 46px; padding: 0 1rem; background: none; border: 0; border-radius: 0; color: var(--ink-2); font: 600 0.9375rem var(--font); cursor: pointer; transition: color var(--d1); }
.area-home .tab-strip button:hover { color: var(--ink); background: none; }
.area-home .tab-strip button[aria-selected="true"] { color: var(--ink); }
.area-home .tab-strip button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-control); }
.area-home .tab-ink { position: absolute; left: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; width: var(--w, 0); background: var(--accent); transform: translateX(var(--x, 0)); transition: transform var(--d3) var(--spring), width var(--d3) var(--spring); }
.area-home .standings-board.is-tabbed .panel-title { display: none; }
.area-home .standings-board.is-tabbed .standing-panel { padding: 0.25rem 0 0; }
.area-home table.standings { border-collapse: separate; border-spacing: 0 6px; margin: 0; }
.area-home table.standings thead th { border-bottom: 0; padding: 0.3rem 0.9rem; font-size: 0.8125rem; color: var(--ink-2); font-weight: 500; }
.area-home table.standings tbody tr { transition: opacity var(--d3) var(--ease-out), translate var(--d3) var(--ease-out); }
.area-home table.standings tbody th, .area-home table.standings tbody td { background: var(--sheet); border: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0 0.9rem; height: 3.25rem; vertical-align: middle; transition: border-color var(--d2); }
.area-home table.standings tbody th { font-size: 0.9375rem; font-weight: 650; color: var(--ink); white-space: normal; }
.area-home table.standings tbody th a { text-decoration: none; }
.area-home table.standings tbody th a:hover { text-decoration: underline; }
.area-home table.standings tbody tr > :first-child { border-left: 1px solid var(--rule); border-radius: 10px 0 0 10px; }
.area-home table.standings tbody tr > :last-child { border-right: 1px solid var(--rule); border-radius: 0 10px 10px 0; }
.area-home table.standings tbody tr:hover > * { border-color: var(--rule-strong); background: var(--hover); }
.area-home table.standings tbody td.rank { color: var(--ink-2); }
.area-home table.standings tbody tr:first-child td.rank { color: var(--teal); }
.area-home table.standings .rating .rv { color: var(--ink); font-weight: 650; }
.area-home table.standings tbody tr:first-child .rating .rv { color: var(--teal); }
@starting-style { .area-home table.standings tbody tr:not([data-flip]) { opacity: 0; translate: 0 10px; } }
.area-home .standings-board .empty-state { margin: 0.5rem 0; padding: 2rem 1rem; border: 1px dashed var(--rule-strong); border-radius: 12px; text-align: center; }

/* your first game: three cards with large step numbers */
.area-home ol.steps-3 { gap: 0.9rem; margin: 1.1rem 0; }
.area-home ol.steps-3 li { display: grid; align-content: start; gap: 0.5rem; padding: 1.25rem 1.25rem 1.4rem; border-radius: 12px; transition: border-color var(--d2), transform var(--d3) var(--spring); }
.area-home ol.steps-3 li:hover { border-color: var(--rule-strong); transform: translateY(-3px); }
.area-home ol.steps-3 li::before { font-family: var(--font-head); font-size: 3rem; font-weight: 700; line-height: 1; color: var(--teal); border-bottom: 0; padding: 0; margin: 0 0 0.35rem; }
.area-home ol.steps-3 h3 { margin: 0; }

/* the run command: one block with its copy button */
.area-home .command { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0 0 1.25rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.area-home .command pre { margin: 0; border: 0; border-radius: 0; background: none; padding: 1rem 1.1rem; overflow-x: auto; white-space: pre; }
.area-home .command button { align-self: stretch; margin: 0; min-height: 0; padding: 0 1.25rem; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: var(--hover); color: var(--ink); font-weight: 600; transition: background-color var(--d1); }
.area-home .command button:hover { background: var(--rule); }
.area-home .command button.is-done { color: var(--check); }
.area-home .command .command-note { grid-column: 1 / -1; margin: 0; max-width: none; padding: 0.55rem 1.1rem; font-size: 0.875rem; border-top: 1px solid var(--rule); background: var(--sheet); }

/* the exchange explainer */
.area-home .one-move { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 0 1.25rem; }
.area-home .one-move summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-weight: 650; }
.area-home .one-move summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--r-control); }
.area-home .one-move[open] { padding-bottom: 1.25rem; }

/* the receipt chain: link lines draw in as the strip scrolls into view */
.area-home .receipt-chain { margin: 0 0 1.5rem; }
.area-home .receipt-chain ol { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0; margin: 0 0 0.75rem; }
.area-home .receipt-chain li.rc { flex: 0 0 auto; width: 13rem; display: grid; gap: 0.25rem; padding: 0.8rem 0.95rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; font-size: 0.75rem; line-height: 1.5; color: var(--ink-2); }
.area-home .receipt-chain li.rc::after { display: none; }
.area-home .receipt-chain li.rc b { font: 600 0.9375rem var(--font-head); color: var(--ink); }
.area-home .receipt-chain li.rc em { font-style: normal; color: var(--ink); }
.area-home .receipt-chain li.lk { flex: none; width: 2.75rem; height: 1.5rem; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.area-home .receipt-chain li.lk::after { display: none; }
.area-home .receipt-chain .lk svg { width: 100%; height: 8px; overflow: visible; }
.area-home .receipt-chain .lk path { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.area-home .receipt-chain li.lk:nth-child(2) { --i: 0; }
.area-home .receipt-chain li.lk:nth-child(4) { --i: 1; }
.area-home .receipt-chain.chain-js .lk path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.6s var(--ease-out) calc(var(--i) * 0.22s); }
.area-home .receipt-chain.chain-js.in .lk path { stroke-dashoffset: 0; }
@supports (animation-timeline: view()) {
  .area-home .receipt-chain .lk path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: none; animation: home-line linear both; animation-timeline: view(); animation-range: entry 20% entry calc(60% + var(--i) * 10%); }
  .area-home .receipt-chain.chain-js.in .lk path { stroke-dashoffset: 1; }
}
@keyframes home-line { to { stroke-dashoffset: 0; } }
@media (max-width: 68rem) {
  .area-home .receipt-chain ol { flex-direction: column; }
  .area-home .receipt-chain li.lk { width: 1.5rem; height: 2.25rem; }
  .area-home .receipt-chain .lk svg { transform: rotate(90deg); width: 2.25rem; }
  .area-home .receipt-chain li.rc { width: min(100%, 18rem); }
}
.area-home ol.proof-steps li { border-radius: 12px; }

/* one orchestrated reveal, played once on load; switched off (is-live) before the first reload of the cards */
@media (prefers-reduced-motion: no-preference) {
  .area-home:not(.is-live) .hero-text > * { animation: home-rise 0.6s var(--ease-out) both; }
  .area-home:not(.is-live) .hero-text > :nth-child(2) { animation-delay: 0.08s; }
  .area-home:not(.is-live) .hero-text > :nth-child(3) { animation-delay: 0.16s; }
  .area-home:not(.is-live) .hero-text > :nth-child(4) { animation-delay: 0.22s; }
  .area-home:not(.is-live) .hero-text > :nth-child(5) { animation-delay: 0.28s; }
  .area-home:not(.is-live) .hm-stage { animation: home-rise 0.7s 0.18s var(--ease-out) both; }
  .area-home:not(.is-live) .hm-rail-wrap { animation: home-rise 0.7s 0.4s var(--ease-out) both; }
}
@keyframes home-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes home-ping { to { transform: scale(3.2); opacity: 0; } }
::view-transition-group(home-board), ::view-transition-group(home-board-b) { animation-duration: 520ms; animation-timing-function: cubic-bezier(0.34, 1.3, 0.64, 1); }
@media (prefers-reduced-motion: reduce) {
  .area-home *, .area-home *::before, .area-home *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .area-home .hm-card:hover, .area-home ol.steps-3 li:hover { transform: none; }
  .area-home .hm-rail { scroll-behavior: auto; }
  .area-home .receipt-chain .lk path { stroke-dashoffset: 0 !important; }
}

@media (max-width: 62rem) {
  .area-home .hm-rail { --per: 2.5; }
  .area-home .home-top { grid-template-columns: minmax(0, 1fr); padding-top: 1rem; gap: 1.25rem; }
  .area-home .home-top:has(+ .tourney-teaser) { margin-bottom: 1.25rem; }   /* the teaser sits under the top, not a section away */
  .area-home .hero, .area-home .hm-stage, .area-home .hm-rail-wrap, .area-home .day { grid-column: 1; grid-row: auto; }
}
@media (max-width: 40rem) {
  .area-home .hm-rail { --per: 1.2; }
  .area-home .hm-card { min-width: 0; }
  .area-home .hm-arena { padding: 0.65rem; }
  .area-home .hm-seat { padding: 0.45rem 0.6rem; gap: 0.3rem 0.5rem; }
  .area-home .hm-sc { min-width: 3.5rem; }
  .area-home .hm-prov { display: none; }
  .area-home .hm-tl { grid-template-columns: auto minmax(0, 1fr) auto; }
  .area-home .hm-tl .hm-tf:nth-of-type(n+2) { grid-column: 2 / -1; }
  .area-home .command { grid-template-columns: minmax(0, 1fr); }
  .area-home .command button { padding: 0.7rem; border-left: 0; border-top: 1px solid var(--rule); }
  .area-home table.standings thead th:last-child, .area-home table.standings tbody td:last-child { display: none; }
}
.area-home .standings .tag { margin-left: 0.4rem; }

/* ---- "Use an AI agent": the hero's secondary menu button (templates/index.html, home.js) -------------------------- */
.area-home .hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; }
.area-home .ai-menu { position: relative; }
.area-home .ai-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.area-home .ai-menu > summary::-webkit-details-marker { display: none; }
.area-home .ai-menu .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: rotate var(--d2, 0.2s); }
.area-home .ai-menu[open] .chev { rotate: 180deg; }
.area-home .ai-menu[open] > summary { border-color: var(--teal); }
.area-home .ai-menu-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(21rem, calc(100vw - 2rem)); display: grid; gap: 0.15rem; padding: 0.5rem; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: 12px; box-shadow: 0 14px 36px rgb(0 0 0 / 0.5); }
.area-home .ai-menu-lead { margin: 0.2rem 0.4rem 0.4rem; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.area-home .ai-item { display: flex; align-items: center; min-height: 44px; padding: 0.4rem 0.75rem; border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.area-home .ai-item:hover, .area-home .ai-item:focus-visible { background: var(--hover, rgb(255 255 255 / 0.07)); outline: 2px solid transparent; }
.area-home .ai-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.area-home .ai-menu-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.4rem; margin: 0.45rem 0.4rem 0.1rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; color: var(--ink-2); }
.area-home .ai-menu-group svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.area-home .ai-menu-group span { font-weight: 400; color: var(--muted, var(--ink-2)); }
.area-home .ai-menu-hint { margin: 0.15rem 0.4rem 0.2rem; font-size: 0.75rem; line-height: 1.4; }
.area-home .ai-menu-hint code { overflow-wrap: anywhere; }
.area-home .ai-item-sub { min-height: 36px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.area-home .ai-item-copy { margin-top: 0.3rem; border-top: 1px solid var(--rule); border-radius: 0 0 8px 8px; }
.area-home .ai-menu-note, .area-home .ai-menu-foot { margin: 0.3rem 0.4rem 0.2rem; font-size: 0.8125rem; line-height: 1.45; }
.area-home .ai-menu-foot { padding-top: 0.5rem; border-top: 1px solid var(--rule); }
@media (max-width: 640px) {
  .area-home .hero .actions > .btn { flex: 1 1 10rem; justify-content: center; }
  .area-home .ai-menu { flex: 1 1 10rem; }
  .area-home .ai-menu > summary { width: 100%; justify-content: center; }
  .area-home .ai-item-sub { min-height: 44px; }
  .area-home .ai-menu[open] .ai-menu-pop { position: fixed; z-index: 60; inset: auto 0 0 0; width: auto; max-height: 80vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom)); box-shadow: 0 -14px 40px rgb(0 0 0 / 0.6); }
}

/* ---- the signed-in home (templates/home_user.html, web/home_user.py) --------------------------------------------- */
/* One column, sections in reading order; from 60rem the side column (.dash-side: Next for you, Challenges, Tournaments)
   sits beside the rest. The last explicit row is 1fr, so the side column's height never stretches the rows on the left. */
.area-dash { padding: 1.25rem 0 2rem; }
.area-dash .blk { position: relative; min-width: 0; margin: 0 0 0.9rem; padding: 0.9rem 1rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); }
.area-dash .blk.flat { padding: 0; background: transparent; border: 0; }
.area-dash .bh { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: -0.35rem 0 0.4rem; }
.area-dash .bh h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.25; }
.area-dash .bh > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.875rem; font-weight: 600; white-space: nowrap; color: var(--teal); text-decoration: none; }
.area-dash .bh > a:hover { text-decoration: underline; }
.area-dash .bh > .muted { font-size: 0.8125rem; }
.area-dash .mono { font-family: var(--font-mono); font-size: 0.75rem; }
.area-dash .dash-note { margin: 0 0 0.6rem; font-size: 0.875rem; color: var(--ink-2); }
.area-dash .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.area-dash .btn.block { display: flex; width: 100%; margin-top: 0.6rem; white-space: normal; text-align: center; }

/* 1. the status strip */
.area-dash .dash-hello { display: flex; flex-direction: column; gap: 0.7rem; }
.area-dash .dh-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.area-dash .dh-top h1 { margin: 0; font-size: 1.375rem; line-height: 1.2; overflow-wrap: anywhere; }
.area-dash .dash-lead { margin: 0; font-size: 0.9375rem; max-width: 60ch; }
.area-dash .dash-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.area-dash .dstat { min-width: 0; padding: 0.5rem 0.6rem; background: var(--field); border: 1px solid var(--rule); border-radius: var(--r-control); }
.area-dash .dstat small { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.area-dash .dstat b { display: block; overflow: hidden; font: 600 1rem/1.3 var(--font-head); white-space: nowrap; text-overflow: ellipsis; }
.area-dash .dstat .sub { display: block; font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }
.area-dash .dash-claim { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin: 0; padding: 0.45rem 0.6rem 0.45rem 0.75rem; font-size: 0.875rem; background: rgb(46 230 197 / 0.07); border: 1px dashed rgb(46 230 197 / 0.45); border-radius: var(--r-control); }
.area-dash .dash-inbox { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.8125rem; color: var(--ink-2); }
.area-dash .dash-inbox .ic { margin-top: 0.15rem; width: 16px; height: 16px; color: var(--teal); }
.area-dash .dash-inbox p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.area-dash .dash-inbox b { color: var(--ink); font-weight: 600; }
.area-dash .dash-inbox[hidden] { display: none; }

/* 2. Playing now */
.area-dash .live-set { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; align-items: center; padding: 0.5rem 0; }
.area-dash .live-set + .live-set { border-top: 1px solid var(--rule); }
.area-dash :is(.ls-bw, .lc-bw) { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-control); }
.area-dash :is(.ls-bw, .lc-bw) .mini-board { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 0; }
.area-dash :is(.ls-bw, .lc-bw) .ag-board { position: absolute; inset: 0; width: 100%; height: 100%; }
.area-dash :is(.ls-bw, .lc-bw) .board-msg-none { display: none; }
.area-dash :is(.ls-bw, .lc-bw) .no-board { font-size: 0.75rem; color: var(--ink-2); text-align: center; padding: 0.25rem; text-decoration: none; }
.area-dash .ls-main { min-width: 0; }
.area-dash .ls-who { margin: 0; font-weight: 600; font-size: 0.9375rem; overflow-wrap: anywhere; }
.area-dash .ls-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.6rem; margin: 0.15rem 0 0.4rem; font-size: 0.8125rem; color: var(--ink-2); }

/* 3. Your bots */
.area-dash ul.bots { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.area-dash .bot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 0.6rem; padding: 0.5rem 0.6rem 0.55rem 0.75rem; background: var(--field); border: 1px solid var(--rule); border-radius: var(--r-control); }
.area-dash .bot .nm { display: flex; align-items: center; gap: 0.4rem; min-width: 0; font-weight: 700; }
.area-dash .bot .nm .ic { width: 16px; height: 16px; color: var(--ink-2); }
.area-dash .bot .nm a { min-width: 0; overflow: hidden; color: var(--ink); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.area-dash .bot .nm a:hover { text-decoration: underline; }
.area-dash .bot .facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.7rem; margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.area-dash .bot .facts .mono { color: var(--ink); }

/* 4. Next for you: one card, one action */
.area-dash .dash-next { background: linear-gradient(180deg, rgb(46 230 197 / 0.09), rgb(46 230 197 / 0.02)), var(--sheet); border-color: rgb(46 230 197 / 0.5); }
.area-dash .dash-next .kicker { margin: 0; font: 600 0.75rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.area-dash .dash-next h2 { margin: 0.3rem 0 0.35rem; font-size: 1.125rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.area-dash .dash-next p { margin: 0 0 0.7rem; font-size: 0.875rem; color: var(--ink-2); }
.area-dash .dash-next .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.area-dash .dash-next progress.progress { margin: 0.4rem 0 0.75rem; color: var(--teal); }
.area-dash .dash-next progress.progress::-webkit-progress-value { background: var(--teal); }
.area-dash .dash-next progress.progress::-moz-progress-bar { background: var(--teal); }
.area-dash .dash-next .cd { color: var(--amber); }
.area-dash .dash-newbot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin: 0 0 0.25rem; }
.area-dash .dash-newbot label { display: flex; flex: 1 1 12rem; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; color: var(--ink-2); }
.area-dash .dash-newbot input { width: 100%; }
.area-dash .dash-next .or { margin: 0.4rem 0; font-size: 0.75rem; }
.area-dash .dash-runfirst button { width: 100%; white-space: normal; }
.area-dash .dash-next .dash-note { margin: 0.7rem 0 0; }

/* 5 and 7. compact rows: what, a line of facts, the action */
.area-dash ul.rows { margin: 0; padding: 0; list-style: none; }
.area-dash .row-i { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.1rem 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--rule); font-size: 0.875rem; }
.area-dash .row-i:first-child { border-top: 0; padding-top: 0; }
.area-dash .row-i .t { grid-column: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.area-dash .row-i .s { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.4rem; font-size: 0.8125rem; color: var(--ink-2); }
.area-dash .row-i .a { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.area-dash .rd { font-family: var(--font-mono); font-size: 0.75rem; white-space: nowrap; }
.area-dash .pos { color: var(--check); font-family: var(--font-mono); font-size: 0.8125rem; }
.area-dash .neg { color: var(--coral); font-family: var(--font-mono); font-size: 0.8125rem; }
.area-dash .dash-take { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.area-dash .dash-next .dash-take { align-items: flex-start; }
.area-dash .dash-take .quick-take { display: flex; flex-direction: column; align-items: inherit; gap: 0.15rem; margin: 0; }
.area-dash .dash-take .quick-take button { white-space: nowrap; }
.area-dash .dash-take .quick-take button:disabled { background: transparent; border-color: var(--rule-strong); color: var(--ink-2); font-weight: 500; }
.area-dash .quick-why { display: block; max-width: 11rem; font-size: 0.75rem; line-height: 1.3; color: var(--ink-2); text-align: right; }
.area-dash .dash-next .quick-why { text-align: left; max-width: none; }
.area-dash .pick-another { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.75rem; color: var(--ink-2); }

/* 6. Tournaments */
.area-dash .tn { padding: 0.55rem 0.7rem; background: var(--field); border: 1px solid var(--rule); border-radius: var(--r-control); font-size: 0.875rem; }
.area-dash .tn + .tn { margin-top: 0.5rem; }
.area-dash .tn .top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; }
.area-dash .tn .top a { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.area-dash .tn .top a:hover { text-decoration: underline; }
.area-dash .tn .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.7rem; margin: 0 0 0.3rem; font-size: 0.8125rem; color: var(--ink-2); }
.area-dash .tn .cd { color: var(--amber); }
.area-dash .tn form { margin: 0.2rem 0 0; }

/* 8. Live on apigaming */
.area-dash .dash-live .bh { padding: 0 0.15rem; }
.area-dash .dash-rail { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.2rem; scrollbar-width: none; overscroll-behavior-x: contain; }
.area-dash .dash-rail::-webkit-scrollbar { display: none; }
.area-dash .lcard { flex: none; width: 9rem; padding: 0.4rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-control); }
.area-dash .lcard:hover { border-color: var(--teal); }
.area-dash .lc-t { display: flex; flex-direction: column; align-items: stretch; min-height: 44px; margin-top: 0.3rem; font-size: 0.75rem; line-height: 1.3; color: var(--ink-2); text-decoration: none; }
.area-dash .lc-t b { min-width: 0; overflow: hidden; color: var(--ink); font-size: 0.8125rem; white-space: nowrap; text-overflow: ellipsis; }
.area-dash .dash-day { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--ink-2); }
.area-dash .dash-day .ic { margin-top: 0.1rem; color: var(--amber); }
.area-dash .dash-day b { color: var(--ink); }
.area-dash .dash-links { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-top: 0.5rem; font-size: 0.875rem; }
.area-dash .dash-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--teal); text-decoration: none; }

/* the setup checklist (a user with no bot) */
.area-dash ol.steps { margin: 0; padding: 0; list-style: none; }
.area-dash .steps li { display: grid; grid-template-columns: 1.375rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-top: 1px solid var(--rule); font-size: 0.875rem; }
.area-dash .steps li:first-child { border-top: 0; }
.area-dash .steps .mk { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; color: var(--on-action); border: 1.5px solid var(--rule-strong); border-radius: 50%; }
.area-dash .steps .mk .ic { width: 12px; height: 12px; stroke-width: 3; }
.area-dash .steps .done .mk { background: var(--teal); border-color: var(--teal); }
.area-dash .steps .done .what { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--rule-strong); }
.area-dash .steps .cur .mk { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(46 230 197 / 0.2); }
.area-dash .steps .st { font-size: 0.75rem; color: var(--ink-2); }

@media (min-width: 60rem) {
  .area-dash .dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; grid-template-rows: repeat(5, auto) 1fr; column-gap: 1.25rem; align-items: start; }
  .area-dash .dash-col1 { grid-column: 1; }
  .area-dash .dash-side { grid-column: 2; grid-row: 1 / -1; }
  .area-dash .dash-hello { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .area-dash .dash-hello .dh-top { flex: 1 1 14rem; }
  .area-dash .dash-stats { flex: 0 1 30rem; }
  .area-dash .dash-hello .dash-inbox { flex-basis: 100%; }
  .area-dash .dash-hello .dash-claim { flex: 0 1 auto; }
  .area-dash ul.bots { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
  .area-dash .live-set { grid-template-columns: 9rem minmax(0, 1fr); }
}
