/* demo.css — interactive recorded sample. Builds on ../styles.css tokens; same rules (radius 0, red = brand/selected/new). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }

.demo-head { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 3vw, 40px); }
.demo-head .wrap { display: grid; gap: 16px; max-width: calc(var(--wrap)); }
.demo-head h1 { font-size: clamp(34px, 4.6vw, 56px); }
.demo-head .lead { max-width: 70ch; }
.legend-line { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; }

/* ---- deck ---- */
.deck-wrap { padding-bottom: clamp(24px, 3vw, 40px); }
.deck { border: 1px solid var(--line-strong); background: var(--surface); display: grid; grid-template-columns: auto 1fr; gap: 16px 32px; padding: 20px 22px; align-items: center; }
.clock { display: grid; gap: 2px; min-width: 200px; }
.clock-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.clock-time { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock-sub { font-size: 13px; color: var(--muted); }
.deck-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.deck-buttons .btn kbd { margin-left: 4px; border-color: rgba(5, 5, 5, 0.6); color: var(--black); font-weight: 500; text-transform: none; }
.deck-buttons .btn-ghost kbd { border-color: var(--secondary); color: var(--text); }
.speed { display: inline-flex; border: 1px solid var(--secondary); }
.chip { min-width: 52px; height: 48px; padding: 0 12px; background: transparent; color: var(--body); border: 0; border-left: 1px solid var(--secondary); font-family: var(--mono); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip:first-child { border-left: 0; }
.chip.is-on { background: var(--text); color: var(--black); }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-on):hover { background: var(--surface-2); color: var(--text); } }

.scrub { grid-column: 1 / -1; display: block; }
.scrub input[type="range"] { width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.scrub input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.scrub input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line-strong); }
.scrub input[type="range"]::-moz-range-track { height: 4px; background: var(--line-strong); }
.scrub input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 28px; margin-top: -12px; background: var(--red); border: 0; border-radius: 0; box-shadow: 2px 2px 0 0 var(--red-dark); }
.scrub input[type="range"]::-moz-range-thumb { width: 16px; height: 28px; background: var(--red); border: 0; border-radius: 0; box-shadow: 2px 2px 0 0 var(--red-dark); }

.counters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 14px; }
.counters > div { padding: 4px 16px 0 0; border-left: 1px solid var(--line); padding-left: 16px; }
.counters > div:first-child { border-left: 0; padding-left: 0; }
.counters dt { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.counters dd { font-family: var(--display); font-weight: 600; font-size: 24px; color: var(--text); line-height: 1.2; }
.counters dd span { display: block; font-family: var(--mono); font-weight: 400; font-size: 12.5px; color: var(--muted); }

/* ---- board ---- */
.board { padding-bottom: clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.board-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px; align-items: start; }
.coins, .rows { border: 1px solid var(--line); background: var(--black); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel-head h2 { font-size: 18px; }
.panel-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.panel-note { padding: 12px 16px; font-size: 13px; line-height: 1.6; color: var(--muted); border-bottom: 1px solid var(--line); }
.linkish { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--body); font-family: var(--mono); font-size: 13px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.linkish kbd { margin-left: 4px; }

.coin-list { max-height: 640px; overflow-y: auto; }
.coin-list li { border-bottom: 1px solid var(--line); }
.coin-btn { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 48px; padding: 8px 16px; background: none; border: 0; color: var(--body); font-family: var(--mono); font-size: 14px; text-align: left; cursor: pointer; }
.coin-btn .rank { color: var(--muted); font-size: 12px; }
.coin-btn .sym { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-btn .sym small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.coin-btn .cnt { text-align: right; font-size: 13px; color: var(--body); white-space: nowrap; }
.coin-btn .cnt small { display: block; color: var(--muted); font-size: 12px; }
.coin-btn[aria-pressed="true"] { background: var(--active); box-shadow: inset 3px 0 0 0 var(--red); }
.coin-btn[aria-pressed="true"] .sym { color: var(--red); }
.coin-btn.is-new .sym::after { content: "new"; display: inline-block; margin-left: 8px; padding: 0 5px; border: 1px solid var(--red); color: var(--red); font-size: 10px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 2px; }
@media (hover: hover) and (pointer: fine) { .coin-btn:not([aria-pressed="true"]):hover { background: var(--surface-2); } }

.table-wrap { overflow-x: auto; max-height: 720px; overflow-y: auto; }
.table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.seq { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.seq th { position: sticky; top: 0; background: var(--surface); text-align: left; padding: 10px 12px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.seq td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; color: var(--body); }
.seq .num, .seq td.num { text-align: right; font-variant-numeric: tabular-nums; }
.seq td.route .to { color: var(--text); font-weight: 600; }
.seq td.grade { color: var(--text); }
.seq td.grade[data-g="d"] { color: var(--red); }
.seq td a { color: var(--text); display: inline-block; padding: 13px 0; margin: -13px 0; }
.prov dd a { display: inline-block; padding: 12px 0; margin: -12px 0; }
.seq tr.is-new td { background: var(--surface); }
.seq tr.empty td { white-space: normal; color: var(--muted); padding: 24px 16px; line-height: 1.7; }

/* ---- about ---- */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); }
.about-grid h2 { font-size: 26px; margin-bottom: 14px; }
.about-grid p { font-size: 15px; line-height: 1.7; }
.about-grid p + p { margin-top: 12px; }
.prov > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.prov dt { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.prov dd { overflow-wrap: anywhere; }
.prov .hash { font-size: 12.5px; color: var(--body); }
.about-grid .cta-row { margin-top: 20px; }

@media (max-width: 959px) {
  .deck { grid-template-columns: minmax(0, 1fr); }
  .deck-buttons { justify-content: flex-start; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .counters > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .board-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .coin-list { max-height: 360px; }
  .table-wrap { max-height: none; }
}
@media (max-width: 479px) {
  .clock-time { font-size: 36px; }
  .prov > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .seq tr.is-new td { animation: row-in 400ms var(--ease-out) both; }
  @keyframes row-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
}
