/* web/arena-demo/page.css - the NativeCAD Arena demo page. Colours come from the site tokens the page's chrome
   defines (--paper, --ink, --muted, --line, --accent, --wash); the stage and the game frame are dark in both themes. */
:root { --pp-stage: #0d1116; --pp-panel: rgba(16, 21, 28, 0.82); --pp-line: rgba(160, 190, 220, 0.26); --pp-b: #3498db; --pp-ok: #2e8b57; --pp-open: #b7791f; --pp-bad: #c0392b; --ad-gold: #ffb020; }
html[data-theme="dark"] { --pp-ok: #7cc79a; --pp-open: #e2b866; --pp-bad: #ff7a6e; }
* { box-sizing: border-box; margin: 0; }
html, body { overflow-x: hidden; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font: 16px/1.6 system-ui, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1320px; margin: 0 auto; padding: 36px 20px 80px; overflow-wrap: break-word; }
main > section { margin-top: 64px; scroll-margin-top: 70px; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.12; margin: 8px 0 14px; letter-spacing: -0.02em; }
h2 { font-size: 1.55rem; line-height: 1.25; margin-bottom: 8px; letter-spacing: -0.01em; }
h3 { font-size: 1.02rem; margin: 0 0 6px; }
p { margin: 10px 0; }
.kicker { color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }
.lede { max-width: 78ch; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
code { font-size: .88em; }
kbd { display: inline-block; min-width: 1.7em; text-align: center; background: var(--wash); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font: 600 .82em/1.7 system-ui, sans-serif; margin: 0 1px; }
main a { color: var(--accent); }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; font: 600 1rem/1.3 system-ui, "Segoe UI", Roboto, sans-serif; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--paper); cursor: pointer; }
main a.btn { color: var(--ink); }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary, main a.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cta-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-band { margin-top: 64px; border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: var(--wash); }
.cta-band h2 { margin: 0 0 6px; font-size: 1.35rem; }
.cta-band p { color: var(--muted); margin: 0 0 16px; max-width: 64ch; }

/* hero */
.ad-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 18px 0 6px; }
.ad-hero .cta-btns { margin-top: 20px; }
.ad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ad-stats > div { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--wash); }
.ad-stats dt { font-size: clamp(1.35rem, 2.4vw, 1.9rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ad-stats dd { font-size: .86rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* the game */
.ad-game { margin-top: 18px; }
.ad-game-frame { position: relative; aspect-ratio: 16 / 9; max-height: 82vh; width: 100%; border-radius: 14px; overflow: hidden; background: #05060a; border: 1px solid var(--line); }
.ad-game-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ad-game-frame:fullscreen { border-radius: 0; border: 0; max-height: none; aspect-ratio: auto; }
.ad-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.62) saturate(1.05); }
.ad-game-frame.live .ad-poster { display: none; }
.ad-game-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; color: #f0ede4; padding: 20px; background: radial-gradient(ellipse at center, rgba(5, 6, 10, .25), rgba(5, 6, 10, .7)); }
.ad-game-cover[hidden] { display: none; }
.ad-game-cover p { max-width: 44ch; font-size: .92rem; margin: 0; text-shadow: 0 1px 3px #000; }
.ad-game-cover kbd { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }
.ad-play { font: 800 1.5rem/1 system-ui, "Segoe UI", sans-serif; color: #17120a; background: var(--ad-gold); border: 0; border-radius: 12px; padding: 18px 42px; cursor: pointer; box-shadow: 0 6px 28px rgba(255, 176, 32, .35); }
.ad-play:hover { background: #ffc24d; }
.ad-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ad-game-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.ad-game-bar .btn { padding: 7px 14px; font-size: .92rem; }
.ad-game-state { font-size: .88rem; }
.ad-keys { font-size: .92rem; color: var(--muted); line-height: 2.1; margin-top: 12px; }

/* Pinpoint */
.ad-pp { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; margin-top: 18px; }
.pp-stage { position: relative; height: min(74vh, 720px); min-height: 460px; border-radius: 14px; overflow: hidden; background: var(--pp-stage); color: #e6edf4; }
.pp-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.pp-bar { position: absolute; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; pointer-events: none; z-index: 2; }
.pp-top { top: 10px; } .pp-bottom { bottom: 10px; }
.pp-bar button { pointer-events: auto; font: 500 13px system-ui, "Segoe UI", Roboto, sans-serif; color: #e6edf4; background: var(--pp-panel); border: 1px solid var(--pp-line); border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.pp-bar button:hover { border-color: var(--pp-b); }
.pp-bar button[aria-pressed="true"] { background: rgba(52, 152, 219, 0.3); border-color: var(--pp-b); }
.pp-bar button[aria-pressed="false"][data-group] { opacity: .55; text-decoration: line-through; }
.pp-bar button.pp-danger { border-color: rgba(255, 90, 80, .6); }
.pp-bar button.pp-danger[aria-pressed="true"] { background: rgba(255, 59, 48, .35); border-color: #ff5a50; }
.pp-bar .sep { flex: 0 0 4px; }
.pp-label { font: 600 11px system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #9fb0c2; padding: 0 2px; }
#groups { display: contents; }
#groups i, .ad-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
#groups .n { color: #9fb0c2; }
.pp-note { position: absolute; left: 10px; right: 10px; bottom: 92px; z-index: 2; max-width: 620px; background: var(--pp-panel); border: 1px solid var(--pp-line); border-radius: 10px; padding: 8px 12px; font-size: .84rem; line-height: 1.45; color: #dfe7ef; pointer-events: none; }
.pp-note.red { border-color: #ff5a50; }
.pp-note.red b { color: #ff7a6e; }
.pp-note-sub { display: block; color: #9fb0c2; margin-top: 2px; }
#markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.pp-marker { position: absolute; left: 0; top: 0; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; font: 700 11px/18px system-ui, sans-serif; color: #0c140f; background: #6fdc9a; cursor: pointer; padding: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.pp-marker.bad { background: #ff7a6e; }
.pp-marker.note { background: #ffd54a; }
.pp-marker.on { outline: 3px solid var(--pp-b); z-index: 2; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; color: #9fb0c2; font-size: .95rem; pointer-events: none; }
.pp-under { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: .84rem; color: var(--muted); margin-top: 6px; }

.ad-record { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 76px; background: var(--wash); }
.ad-record h4 { font-size: 1rem; margin: 0 0 6px; }
.ad-record dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2px 22px; }
.ad-record dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; font-size: .88rem; padding: 3px 0; border-top: 1px solid var(--line); }
.ad-record dt { color: var(--muted); }
.ad-ok { color: var(--pp-ok); font-weight: 700; } .ad-bad { color: var(--pp-bad); font-weight: 700; }
.ad-pinlink { width: 22px; height: 22px; border-radius: 50%; border: 0; background: #6fdc9a; color: #0c140f; font: 700 11px/22px system-ui, sans-serif; cursor: pointer; padding: 0; }

.ad-pp-side { border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 8px; max-height: min(74vh, 720px); min-height: 460px; overflow-y: auto; overscroll-behavior: contain; }
.ad-pp-side h3 { font-size: 1rem; }
.ad-pp-side h3 .muted { font-weight: 400; font-size: .86rem; }
.ad-goals, .ad-pins { list-style: none; padding: 0; margin: 0; }
.ad-goal { border-top: 1px solid var(--line); padding: 7px 0; }
.ad-goal summary { cursor: pointer; font-size: .9rem; line-height: 1.4; }
.ad-goal details p { font-size: .84rem; margin: 6px 0 4px 4px; color: var(--muted); }
.pg-state { display: inline-block; min-width: 46px; text-align: center; font-size: .68rem; font-weight: 700; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; color: #fff; background: var(--pp-open); vertical-align: 1px; }
html[data-theme="dark"] .pg-state { color: #10151b; }
.s-met > details .pg-state { background: var(--pp-ok); }
.s-input > details .pg-state { background: var(--accent); color: #fff; }
.ad-rew { font-size: .68rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.ad-loose { font-size: .82rem; color: var(--muted); font-weight: 600; }
.ad-pins { margin: 5px 0 0 6px; }
.ad-pin { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; color: inherit; font: inherit; font-size: .86rem; padding: 4px 6px; cursor: pointer; }
.ad-pin:hover { background: var(--wash); }
.ad-pin.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ad-pin-n { width: 22px; height: 22px; border-radius: 50%; background: #6fdc9a; color: #0c140f; font: 700 11px/22px system-ui, sans-serif; text-align: center; }
.ad-pin.bad .ad-pin-n { background: #ff7a6e; } .ad-pin.note .ad-pin-n { background: #ffd54a; }
.ad-pin-s { font-size: .76rem; color: var(--pp-ok); white-space: nowrap; }
.ad-pin.bad .ad-pin-s { color: var(--pp-bad); }
.ad-pin-body { font-size: .84rem; padding: 2px 8px 8px 38px; }
.ad-pin-body p { margin: 4px 0; }
.pp-at { color: var(--muted); font-size: .8rem; }
.ad-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 28px; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.ad-legend b { color: var(--ink); }

/* pipeline */
.ad-pipe { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.ad-pipe > li { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 12px; background: var(--wash); font-size: .9rem; counter-increment: step; }
.ad-pipe > li::before { content: counter(step); position: absolute; top: -12px; left: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 12px/24px system-ui, sans-serif; text-align: center; }
.ad-pipe > li:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: 14px; color: var(--muted); font-size: 1rem; z-index: 1; }
.ad-pipe .ad-gate { border-color: var(--pp-ok); grid-column: span 1; }
.ad-num { font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.ad-guard { color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.ad-guard b { color: var(--ink); }
.ad-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.ad-ba figure { margin: 0; }
.ad-ba img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; background: var(--pp-stage); }
.ad-ba figcaption { font-size: .76rem; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.ad-pipe .btn { padding: 6px 12px; font-size: .86rem; }

/* what is made here */
.ad-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.ad-cards article { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--wash); font-size: .9rem; }
.ad-cards img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #05060a; }
.ad-cards h3, .ad-cards p { padding: 0 14px; }
.ad-cards h3 { margin-top: 12px; }
.ad-cards p { margin: 4px 0 14px; color: var(--muted); }
.ad-nopic { display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 1100px) {
  .ad-pp { grid-template-columns: minmax(0, 1fr); }
  .ad-pp-side { max-height: none; min-height: 0; overflow: visible; }
  .ad-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-pipe > li::after { display: none; }
  .ad-pipe .ad-gate { grid-column: span 2; }
  .ad-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  main { padding: 22px 14px 64px; }
  main > section { margin-top: 48px; }
  .ad-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .ad-legend { grid-template-columns: minmax(0, 1fr); }
  .pp-stage { height: 68vh; min-height: 420px; }
  .pp-bar { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; pointer-events: auto; }
  .pp-bar::-webkit-scrollbar { display: none; }
  .pp-bar > *, #groups > * { scroll-snap-align: start; flex: 0 0 auto; }
  .pp-bar button { padding: 6px 10px; font-size: 12px; }
  .pp-note { bottom: 52px; font-size: .78rem; }
  .ad-pipe { grid-template-columns: minmax(0, 1fr); }
  .ad-pipe .ad-gate { grid-column: auto; }
  .ad-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ad-record dl { grid-template-columns: minmax(0, 1fr); }
  .cta-band { padding: 22px 18px; } .cta-band .cta-btns .btn, .ad-hero .cta-btns .btn { flex: 1 1 100%; text-align: center; }
  .ad-play { font-size: 1.2rem; padding: 14px 32px; }
  .ad-game-cover p { font-size: .8rem; }
}

/* the shared chrome caps text blocks at a reading width; these are layout blocks */
main .ad-pipe, main .ad-goals, main .ad-pins, main .ad-stats, main .ad-record dl { max-width: none; }
[hidden] { display: none !important; }
.pp-cut { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; font: 500 13px system-ui, "Segoe UI", Roboto, sans-serif; color: #e6edf4; background: var(--pp-panel); border: 1px solid var(--pp-line); border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.pp-cut input { width: 110px; accent-color: var(--pp-b); }
.ad-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; max-width: 1320px; margin: 0 auto; padding: 16px 70px 0 20px; font-size: .92rem; }
.ad-nav a { color: var(--muted); text-decoration: none; }
.ad-nav a:hover { color: var(--accent); }
.ad-nav .ad-brand { font-weight: 700; color: var(--ink); font-size: 1rem; }
