/* Cyber Arena: a dark "ops room" look for the game screens, the app's own look for the rest. */

:root {
  --ops-bg: #0d1714; --ops-bg-2: #13221d; --ops-line: #23402f; --ops-ink: #dff5ea; --ops-ink-2: #8fb3a2;
  --ops-green: #39d98a; --ops-red: #ff5c5c; --ops-amber: #ffc547;
}

/* While a game runs: no tab bar or roaming pet in the way. */
body.arena-playing .tabbar, body.arena-playing .roam, body.arena-playing .fab { display: none !important; }
body[data-page="arena"] .roam { display: none !important; } /* the pet is already on screen as your handler */
body.arena-playing { padding-bottom: 16px; }

/* ---------- lobby ---------- */
.ar-hero { margin-top: 10px; padding: 16px; border-radius: 20px; background: linear-gradient(160deg, var(--ops-bg) 0%, #15302a 100%); color: var(--ops-ink); border: 1px solid var(--ops-line); }
.ar-hero-top { display: flex; gap: 12px; align-items: center; }
.ar-handler { flex: none; background: var(--ops-bg-2); border-radius: 18px; padding: 4px; }
.ar-hero h1 { margin: 0; font-size: 24px; color: var(--ops-ink); }
.ar-rank { margin: 2px 0 6px; font-size: 13px; color: var(--ops-ink-2); }
.ar-rank b { color: var(--ops-amber); }
.ar-xpbar { height: 6px; border-radius: 99px; background: var(--ops-bg-2); overflow: hidden; }
.ar-xpbar i { display: block; height: 100%; background: var(--ops-green); border-radius: 99px; }
.ar-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ar-stats > div { background: var(--ops-bg-2); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; }
.ar-stats b { font-size: 17px; }
.ar-stats span { font-size: 11px; color: var(--ops-ink-2); }

.ar-today, .ar-brief { margin-top: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.ar-today-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ar-today-head, .ar-brief-head { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.ar-today-head > div, .ar-brief-head > div { display: flex; flex-direction: column; }
.ar-today-head b, .ar-brief-head b { font-size: 21px; }
.ar-today-head > div > span, .ar-brief-head > div > span { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.ar-today-icon { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; background: var(--surface-2); border-radius: 16px; flex: none; }
.ar-today p { color: var(--ink-2); margin: 10px 0 12px; }
.ar-play { font-size: 18px; min-height: 52px; }
.ar-done { font-weight: 700; color: var(--ink) !important; }
.ar-handler-line { font-size: 14px; margin: 12px 0 0 !important; }
.ar-stars { display: inline-flex; gap: 2px; font-size: 22px; vertical-align: middle; }
.ar-stars i { font-style: normal; color: var(--line); }
.ar-stars i.on { color: var(--accent); }

.ar-packs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ar-more-row { text-decoration: none; color: inherit; align-items: center; gap: 12px; }
.ar-more-icon { font-size: 24px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; flex: none; }
.ar-more-row .main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ar-more-go { flex: none; font-weight: 800; font-size: 14px; color: var(--brand-ink); background: var(--brand); border-radius: 99px; padding: 6px 14px; }
.ar-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ar-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 11px; color: var(--ink-3); min-width: 0; }
.ar-day b { font-size: 18px; }
.ar-day small { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-day.today { border: 2px solid var(--brand); color: var(--ink); font-weight: 800; }
.ar-day.past { opacity: .6; }
.ar-day.played small { color: var(--ok); font-weight: 800; }
.ar-note { margin-top: 12px; }

/* ---------- briefing ---------- */
.ar-brief-pet { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 6px; }
.ar-brief-pet svg { flex: none; }
.ar-brief-pet .bubble { margin: 0; font-size: 14px; }
.ar-how { margin: 10px 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.ar-how li { margin: 4px 0; }
.ar-intel { background: var(--ops-bg); color: var(--ops-ink); border-radius: 14px; padding: 12px; margin: 10px 0; font-size: 14px; }
.ar-intel > b { display: block; margin-bottom: 6px; color: var(--ops-green); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.ar-intel-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--ops-line); }
.ar-tool-chip { background: var(--ops-bg-2); border-radius: 99px; padding: 3px 10px; font-weight: 700; white-space: nowrap; font-size: 13px; }
.ar-source { font-size: 13px; color: var(--ink-3); margin: 10px 0 14px; }

.ar-count { display: grid; place-items: center; min-height: 60vh; }
.ar-count b { font-size: 120px; font-weight: 800; color: var(--brand); animation: ar-pop .6s ease-out; }
@keyframes ar-pop { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- game frame ---------- */
.ar-game { margin-top: 8px; background: var(--ops-bg); color: var(--ops-ink); border-radius: 20px; padding: 12px; border: 1px solid var(--ops-line); min-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.ar-game.shake { animation: ar-shake .35s; }
@keyframes ar-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.ar-hud { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.ar-hud > :last-child { margin-left: auto; color: var(--ops-amber); font-size: 18px; }
.ar-quit { color: var(--ops-ink-2); text-decoration: none; font-size: 18px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 99px; background: var(--ops-bg-2); }
.ar-combo { color: var(--ops-amber); }
.ar-combo.hot { color: var(--ops-red); animation: ar-pulse .6s infinite alternate; }
@keyframes ar-pulse { to { transform: scale(1.15); } }
.ar-timer { height: 8px; border-radius: 99px; background: var(--ops-bg-2); overflow: hidden; margin: 10px 0 4px; }
.ar-timer i { display: block; height: 100%; width: 100%; background: var(--ops-green); border-radius: 99px; }
.ar-timer i.low { background: var(--ops-red); }
.ar-energy { margin: 8px 0 0; font-size: 12px; color: var(--ar-ink-2, #5b6259); }
.ar-energy b { color: var(--ar-ink, #1d231f); }
.ar-timer-sec { margin: -2px 0 4px; text-align: right; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Rapid Fire ---------- */
.ar-stage { flex: 1; display: flex; flex-direction: column; }
.ar-ask { margin: 8px 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ops-green); text-align: center; }
.ar-card { background: var(--ops-bg-2); border: 2px solid var(--ops-line); border-radius: 18px; padding: 16px; touch-action: pan-y; user-select: none; transition: transform .25s ease, border-color .15s; }
.ar-card.lean-left { border-color: var(--ops-red); }
.ar-card.lean-right { border-color: var(--ops-green); }
.ar-statement { font-size: 19px; font-weight: 700; line-height: 1.35; margin: 0; }
.ar-mail { font-size: 14px; }
.ar-mail-from { color: var(--ops-ink-2); font-size: 13px; word-break: break-word; }
.ar-mail-subj { font-weight: 800; font-size: 17px; margin: 6px 0; }
.ar-mail-body { line-height: 1.45; word-break: break-word; }
.ar-swipe-hint { text-align: center; font-size: 12px; color: var(--ops-ink-2); margin: 8px 0; }
.ar-two, .ar-four { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ar-four { margin-top: 14px; }
.ar-btn { min-height: 56px; border-radius: 16px; border: 2px solid var(--ops-line); background: var(--ops-bg-2); color: var(--ops-ink); font: inherit; font-weight: 800; font-size: 16px; padding: 8px; cursor: pointer; }
.ar-btn:active { transform: scale(.97); }
.ar-btn.good { border-color: color-mix(in srgb, var(--ops-green) 50%, var(--ops-line)); }
.ar-btn.bad { border-color: color-mix(in srgb, var(--ops-red) 50%, var(--ops-line)); }
.ar-btn.correct { background: var(--ops-green); color: #06200f; border-color: var(--ops-green); }
.ar-btn.wrong { background: var(--ops-red); color: #2a0505; border-color: var(--ops-red); }
.ar-btn:disabled { cursor: default; }
.ar-feedback { margin-top: 12px; padding: 12px 14px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; animation: ar-up .2s ease-out; }
.ar-feedback.ok { background: color-mix(in srgb, var(--ops-green) 18%, var(--ops-bg)); }
.ar-feedback.ok b { color: var(--ops-green); }
.ar-feedback.no { background: color-mix(in srgb, var(--ops-red) 16%, var(--ops-bg)); }
.ar-feedback.no b { color: var(--ops-red); }
.ar-feedback .btn { margin-top: 4px; background: var(--ops-green); color: #06200f; border-color: var(--ops-green); }
@keyframes ar-up { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Crack the Code ---------- */
.ar-clue { background: var(--ops-bg-2); border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.ar-clue b { color: var(--ops-green); }
.ar-grid { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 4px 0 8px; }
.ar-row { display: grid; grid-template-columns: repeat(var(--len), minmax(0, 46px)); gap: 6px; width: 100%; justify-content: center; }
.ar-row.shake { animation: ar-shake .35s; }
.ar-tile { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--ops-line); border-radius: 8px; font-weight: 800; font-size: clamp(16px, 5.5vw, 24px); text-transform: uppercase; }
.ar-tile.filled { border-color: var(--ops-ink-2); animation: ar-pop .12s; }
.ar-tile.hit { background: #2f9e62; border-color: #2f9e62; color: #fff; }
.ar-tile.near { background: #c99a2e; border-color: #c99a2e; color: #fff; }
.ar-tile.miss { background: #2a3530; border-color: #2a3530; color: var(--ops-ink-2); }
.ar-tile.flip { animation: ar-flip .45s ease both; }
@keyframes ar-flip { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.ar-known { text-align: center; letter-spacing: .2em; margin: 0 0 6px; color: var(--ops-amber); }
.ar-keys { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.ar-keys > div { display: flex; gap: 4px; justify-content: center; }
.ar-key { flex: 1 1 0; max-width: 40px; min-height: 50px; border: 0; border-radius: 8px; background: #2c3d36; color: var(--ops-ink); font: inherit; font-weight: 800; font-size: 15px; padding: 0; cursor: pointer; }
.ar-key.wide { max-width: 64px; flex: 1.6 1 0; font-size: 12px; }
.ar-key.hit { background: #2f9e62; }
.ar-key.near { background: #c99a2e; }
.ar-key.miss { background: #18211d; color: #5d7268; }
.ar-hint { color: var(--ops-ink-2) !important; margin: 10px auto 0; display: block; }

/* ---------- Breach Defense ---------- */
.ar-time.low { color: var(--ops-red); animation: ar-pulse .5s infinite alternate; }
.ar-health { display: flex; gap: 3px; margin: 8px 0; }
.ar-health i { flex: 1; height: 6px; border-radius: 99px; background: var(--ops-green); }
.ar-health i.bad { background: var(--ops-red); }
.ar-canvas-wrap { position: relative; border-radius: 14px; overflow: hidden; }
.ar-canvas-wrap canvas { display: block; width: 100%; height: auto; aspect-ratio: 360 / 440; touch-action: none; }
.ar-flash { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px 10px rgb(255 40 40 / .8); opacity: 0; }
.ar-flash.on { animation: ar-flash .5s ease-out; }
@keyframes ar-flash { from { opacity: 1; } to { opacity: 0; } }
.ar-status { min-height: 40px; font-size: 13px; line-height: 1.35; margin: 8px 2px; color: var(--ops-ink-2); }
.ar-status.warn { color: #ffb0a8; }
.ar-status.ok { color: #a9f0c9; }
.ar-status b { color: var(--ops-ink); }
.ar-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ar-tool { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 62px; border-radius: 14px; border: 2px solid var(--ops-line); background: var(--ops-bg-2); color: var(--ops-ink); font: inherit; font-weight: 800; font-size: 12px; cursor: pointer; padding: 6px 2px; }
.ar-tool span { font-size: 22px; }
.ar-tool:active { transform: scale(.95); }
.ar-tool:disabled { opacity: .55; }
.ar-tool i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--ops-red); width: 0; }

/* ---------- result ---------- */
.ar-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding-top: 14px; }
.ar-result h1 { margin: 6px 0 0; }
.ar-result .ar-stars { font-size: 34px; }
.ar-big { font-size: 44px; font-weight: 800; margin: 0; line-height: 1; }
.ar-big small { font-size: 16px; color: var(--ink-3); }
.ar-streak { font-weight: 700; margin: 0; }
.ar-debrief { display: flex; flex-direction: column; gap: 8px; }
.ar-deb { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ar-deb span { color: var(--ink-2); }
.ar-tomorrow { text-align: center; margin: 18px 0 10px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .ar-game.shake, .ar-row.shake, .ar-tile.flip, .ar-count b, .ar-combo.hot, .ar-time.low { animation: none; }
}

/* ---------- roadmap: today's challenge ---------- */
.ar-daily { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); }
.ar-daily.done { background: var(--surface); border-color: var(--line); }
.ar-daily-ico { font-size: 28px; flex: none; }
.ar-daily-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ar-daily-main small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ar-daily-main b { font-size: 18px; }
.ar-daily-main span { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-daily-go { flex: none; background: var(--brand); color: var(--brand-ink); font-weight: 800; border-radius: 99px; padding: 8px 16px; }
.ar-badges-btn { background: var(--ops-bg-2); border: 0; border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; color: var(--ops-ink); font: inherit; cursor: pointer; }
.ar-badges-btn b { font-size: 17px; }
.ar-badges-btn span { font-size: 11px; color: var(--ops-ink-2); }

/* ---------- roadmap: units and the winding path ---------- */
.ppath-wrap { margin-top: 18px; }
.punit { margin: 18px 0 6px; padding: 14px; border-radius: 18px; background: var(--c); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000); }
.punit.locked { background: var(--surface-2); color: var(--ink-2); box-shadow: none; border: 1px dashed var(--line); }
.punit-head { display: flex; align-items: center; gap: 10px; }
.punit-ico { font-size: 28px; flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgb(255 255 255 / .2); }
.punit-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.punit-title small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.punit-title b { font-size: 17px; line-height: 1.2; }
.punit-badge { flex: none; font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 99px; background: rgb(0 0 0 / .15); filter: grayscale(1); opacity: .45; }
.punit-badge.on { filter: none; opacity: 1; background: rgb(255 255 255 / .9); }
.punit-xp { height: 8px; border-radius: 99px; background: rgb(0 0 0 / .18); overflow: hidden; margin-top: 12px; }
.punit-xp i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.punit.locked .punit-xp i { background: var(--ink-3); }
.punit-xp-label { display: block; font-size: 12px; font-weight: 700; margin-top: 4px; opacity: .9; }
.punit-jump { margin-top: 10px; width: 100%; }

.ppath { position: relative; width: 300px; margin: 0 auto; }
.ppath-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.ptrack, .pfill { fill: none; stroke-width: 12; stroke-linecap: round; }
.ptrack { stroke: var(--line); }
.pfill { stroke-dasharray: 1 1; transition: stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1); }

.pnode { position: absolute; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; font: inherit; color: #fff; background: var(--c);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 65%, #000), inset 0 -4px 0 rgb(0 0 0 / .12); transition: transform .12s; }
.pnode.boss { width: 84px; height: 84px; }
.pnode:active:not([disabled]) { transform: translate(-50%, calc(-50% + 4px)); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 65%, #000); }
.pnode-ico { font-size: 28px; line-height: 1; }
.pnode.boss .pnode-ico { font-size: 38px; }
.pnode.locked { background: var(--surface-2); color: var(--ink-3); box-shadow: 0 6px 0 var(--line); cursor: default; }
.pnode.locked .pnode-ico { font-size: 22px; opacity: .7; }
.pnode.open { background: color-mix(in srgb, var(--c) 55%, var(--surface)); }
.pnode.current::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 4px solid var(--c); opacity: .5; animation: pnode-ring 1.6s ease-out infinite; }
@keyframes pnode-ring { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.25); opacity: 0; } }
.pnode-today { position: absolute; top: -6px; right: -6px; font-size: 18px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .3)); }
.pnode-stars { position: absolute; transform: translateX(-50%); pointer-events: none; white-space: nowrap; }
.pstars { display: inline-flex; gap: 1px; font-size: 15px; }
.pstars i { font-style: normal; color: var(--line); }
.pstars i.on { color: var(--accent); text-shadow: 0 1px 0 rgb(0 0 0 / .15); }
.pnode-start { position: absolute; transform: translateX(-50%); background: var(--surface); color: var(--ink); border: 2px solid var(--line); font-size: 12px; font-weight: 800;
  letter-spacing: .08em; padding: 3px 10px; border-radius: 10px; box-shadow: var(--shadow); animation: pnode-bob 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes pnode-bob { 50% { transform: translate(-50%, -4px); } }
.pnode-pet { position: absolute; pointer-events: none; }

/* the unlock: a cleared level's stars pop, the next level pops open */
.pnode.anim-unlock { animation: pnode-unlock .7s cubic-bezier(.2, 1.4, .4, 1) .6s both; }
@keyframes pnode-unlock {
  0% { transform: translate(-50%, -50%) scale(.6); filter: grayscale(1); }
  60% { transform: translate(-50%, -50%) scale(1.15); filter: none; }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.pnode.anim-clear { animation: pnode-clear .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pnode-clear { 50% { transform: translate(-50%, -50%) scale(1.12); } }
.anim-stars i { animation: star-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * .15s + .3s); }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ar-xpbar i { transition: width .8s cubic-bezier(.2, .8, .2, 1); }

/* ---------- briefing and results on the path ---------- */
.ar-brief-tag { margin: 10px 0 0; font-weight: 800; font-size: 14px; color: var(--c, var(--brand)); }
.ar-unlocked { font-weight: 700; margin: 6px 0 0; }
.ar-new-badges { font-weight: 800; color: var(--accent); margin: 4px 0 0; }

/* ---------- badges: overlay, shelf and the unlock card ---------- */
.ar-overlay { position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / .5); display: grid; place-items: center; padding: 16px; animation: ar-fade .2s ease both; }
.ar-overlay.sheet { place-items: end center; padding: 0; }
@keyframes ar-fade { from { opacity: 0; } }
.ar-sheet { width: 100%; max-width: 560px; max-height: 82vh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 16px 16px 28px; animation: ar-up .25s ease-out both; }
.ar-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 18px; }
.ar-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ar-bdg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 4px; border-radius: 16px; background: var(--surface-2); }
.ar-bdg-ico { font-size: 34px; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); filter: grayscale(1) brightness(.6); opacity: .35; }
.ar-bdg.on .ar-bdg-ico { filter: none; opacity: 1; background: radial-gradient(circle at 35% 30%, #fff6d8, #f2c14e); box-shadow: 0 3px 0 #c9952b; }
.ar-bdg b { font-size: 13px; line-height: 1.2; }
.ar-bdg small { font-size: 11px; color: var(--ink-3); line-height: 1.25; }
.ar-bdg:not(.on) b { color: var(--ink-2); }

.ar-unlock { position: relative; width: min(320px, 100%); background: var(--surface); border-radius: 24px; padding: 26px 18px 18px; text-align: center; box-shadow: 0 20px 60px rgb(0 0 0 / .35);
  animation: ar-card-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ar-card-in { from { transform: translateY(40px) scale(.9); opacity: 0; } }
.ar-unlock small { display: block; margin-top: 18px; position: relative; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ar-unlock h2 { margin: 4px 0; font-size: 24px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.ar-unlock p { color: var(--ink-2); margin: 0 0 16px; }
.ar-unlock-badge { position: relative; width: 112px; height: 112px; margin: 0 auto; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff6d8, #f2c14e 60%, #d99a22); box-shadow: 0 6px 0 #b9821c; animation: badge-pop .7s cubic-bezier(.2, 1.6, .4, 1) .15s both; }
.ar-unlock-badge span { font-size: 58px; }
@keyframes badge-pop { 0% { transform: scale(.4) rotate(-20deg); } 70% { transform: scale(1.15) rotate(4deg); } 100% { transform: none; } }
.ar-shine { position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 40%, rgb(255 255 255 / .75) 50%, transparent 60%); transform: translateX(-100%); animation: badge-shine 1.1s ease .7s both; }
@keyframes badge-shine { to { transform: translateX(100%); } }
.ar-unlock-burst { position: absolute; left: 50%; top: 82px; width: 0; height: 0; pointer-events: none; }
.ar-unlock-burst i { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: hsl(var(--h) 85% 58%); opacity: 0;
  animation: confetti .9s cubic-bezier(.1, .8, .3, 1) .3s both; }
@keyframes confetti {
  0% { transform: rotate(var(--a)) translateY(0) rotate(0); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(220deg); opacity: 0; }
}
.ar-unlock.calm, .ar-unlock.calm .ar-unlock-badge { animation: ar-fade .4s ease both; }

@media (prefers-reduced-motion: reduce) {
  .pnode, .pfill, .punit-xp i, .ar-xpbar i { transition: none; }
  .pnode.current::after, .pnode-start, .pnode.anim-unlock, .pnode.anim-clear, .anim-stars i, .ar-sheet, .ar-unlock-badge, .ar-shine { animation: none; }
  .ar-shine { display: none; }
}

/* ---------- hands-on formats: terminal, HTTP request, SQL table, code ---------- */
.term, .http, .code-block { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace; font-size: 13px; line-height: 1.45;
  background: #0b0f0d; color: #cfeedd; border-radius: 12px; padding: 10px 12px; text-align: left; overflow-wrap: anywhere; }
.term-cmd { white-space: pre-wrap; }
.term-ps { color: #39d98a; font-weight: 700; }
.term-out { margin: 2px 0 6px; white-space: pre-wrap; color: #9fb8ab; font: inherit; }
.term-live { min-height: 92px; cursor: pointer; }
.term-hidden { color: #ffc547; }
.term-hidden.ok { color: #39d98a; }
.term-hidden.no { color: #ff8a80; }
@media (prefers-reduced-motion: no-preference) {
  .term-live .term-cmd:last-of-type::after { content: "▌"; color: #39d98a; animation: term-blink 1s steps(1) infinite; }
}
@keyframes term-blink { 50% { opacity: 0; } }
.http-line { font-weight: 700; color: #fff; }
.http-m { padding: 1px 6px; border-radius: 6px; margin-right: 4px; background: #2c3d36; }
.http-get { background: #1f6f4a; } .http-post { background: #8a5a12; } .http-put, .http-patch { background: #2c5f9e; }
.http-delete { background: #8a2c2c; } .http-options { background: #5b4a9e; } .http-http11 { background: #2c3d36; }
.http-h { color: #9fb8ab; }
.http-gap { height: 6px; }
.code-block { margin: 0 0 4px; white-space: pre-wrap; color: #f2e6c9; }
.sql-table { overflow-x: auto; margin-bottom: 8px; }
.sql-table small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ops-green); margin-bottom: 4px; }
.sql-table table { border-collapse: collapse; width: 100%; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.sql-table th, .sql-table td { border: 1px solid var(--ops-line); padding: 3px 6px; text-align: left; }
.sql-table th { background: var(--ops-bg-2); color: var(--ops-green); }
.sql-q { font-size: 13px; }
.ar-card.has-block { padding: 12px; }
.ar-card.has-block .ar-statement { font-size: 16px; margin-top: 10px; }
.ar-card .term, .ar-card .http, .ar-card .code-block { margin-bottom: 4px; }

/* Predict the Output */
.ar-predict .ar-stage { gap: 10px; }
.pr-q { margin: 6px 0 0; font-weight: 700; font-size: 16px; }
.pr-form { display: flex; gap: 8px; }
.pr-input { flex: 1; min-width: 0; min-height: 50px; border-radius: 12px; border: 2px solid var(--ops-line); background: #0b0f0d; color: #e8fff2; padding: 0 12px;
  font: 600 16px ui-monospace, Consolas, monospace; }
.pr-input:focus { outline: none; border-color: var(--ops-green); }
.pr-form .btn { min-height: 50px; }
.ar-feedback code { font-family: ui-monospace, Consolas, monospace; background: rgb(0 0 0 / .3); padding: 1px 5px; border-radius: 5px; white-space: pre-wrap; }

/* ---------- skill, mastery, refresh, weekly ---------- */
.ar-weekly { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid color-mix(in srgb, #c99a1e 45%, var(--line)); }
.ar-skill, .ar-skill-change { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; margin: 8px 0 0; color: var(--ink-2); }
.ar-skill-change { justify-content: center; }
.ar-skill-bar { display: inline-block; width: 90px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.ar-skill-bar i { display: block; height: 100%; background: var(--c, var(--brand)); border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.ar-master { margin-top: 8px; border-color: #c99a1e; color: var(--ink); }
.pr-hint { margin: 0; font-size: 14px; color: var(--ops-amber); }

.pnode.crowned { background: radial-gradient(circle at 35% 30%, #fff3c4, #f2c14e 55%, #d99a22); color: #3a2a05; box-shadow: 0 6px 0 #b9821c, inset 0 -4px 0 rgb(0 0 0 / .12); }
.pnode-crown, .pnode-fade { position: absolute; bottom: -6px; right: -6px; font-size: 18px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .3)); }
.pnode.faded { filter: saturate(.45); }
.pnode.faded::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px dashed rgb(255 255 255 / .7); }
.pnode-need { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .ar-skill-bar i { transition: none; } }

/* ---------- learning: glossary, rules, confidence, field guide, skills ---------- */
.gl { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.ar-game { position: relative; }
.gl-pop { position: absolute; z-index: 5; max-width: 260px; background: #fffdf8; color: #1d231f; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.35;
  box-shadow: 0 8px 24px rgb(0 0 0 / .35); animation: ar-up .15s ease-out; }
.gl-pop b { display: block; text-transform: capitalize; }
.ar-rule { display: block; margin-top: 2px; padding: 6px 10px; border-radius: 10px; background: rgb(255 255 255 / .08); color: #ffe7a3; font-weight: 700; }
.conf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; padding: 8px; border-radius: 12px; background: rgb(255 197 71 / .14); font-size: 14px; }
.conf span { width: 100%; text-align: center; font-weight: 700; color: var(--ops-amber); }
.conf button { flex: 1; min-height: 40px; border-radius: 10px; border: 2px solid var(--ops-line); background: var(--ops-bg-2); color: var(--ops-ink); font: inherit; font-weight: 800; cursor: pointer; }
.conf-deb { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

.ar-guide-btn { width: 100%; margin-top: 10px; min-height: 44px; border-radius: 14px; border: 0; background: rgb(255 255 255 / .1); color: var(--ops-ink); font: inherit; font-weight: 800; cursor: pointer; }
.punit-skills { font: inherit; color: inherit; background: rgb(255 255 255 / .2); border: 0; border-radius: 99px; padding: 1px 8px; cursor: pointer; }
.punit.locked .punit-skills { display: none; }
.ar-guide { padding-bottom: 40px; }
.fg-unit { border: 1px solid var(--line); border-radius: 16px; margin: 10px 0; padding: 10px 12px; background: var(--surface); border-left: 6px solid var(--c); }
.fg-unit summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fg-unit summary small { color: var(--ink-3); margin-left: auto; font-weight: 700; }
.fg-unit h4 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.fg-skills, .fg-rules { margin: 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.fg-skills .sk-0 { color: var(--ink-3); }
.fg-card { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.fg-card p { margin: 4px 0 8px; }
.fg-why { color: var(--ink-2); font-size: 13px; margin: 6px 0 0 !important; }
.fg-intro .fg-title { margin: 8px 0 4px; font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.fg-intro .fg-text { font-size: 17px; line-height: 1.45; margin: 0 0 12px; }
.fg-intro .btn-row { margin-top: 14px; }
.ar-proven, .ar-cando { display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 420px; margin: 8px auto 0; padding: 10px 12px; border-radius: 14px; text-align: left;
  background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); }
.ar-cando small { color: var(--ink-3); }

/* ---------- drawn icons (Phosphor) instead of emoji ----------
   Every slot keeps its old font-size, and .ic is 1.15em, so sizes carry over.
   Colour now comes from the slot, not from whichever emoji font the phone has. */
.ar-stats b, .ar-badges-btn b { display: inline-flex; align-items: center; gap: 5px; }
.ar-stats .ic { width: 18px; height: 18px; }
.ar-stats .ic-fire { color: #ff9a3d; }
.ar-stats .ic-star, .ar-stats .ic-medal { color: var(--ops-amber); }
.ar-stats .ic .d { opacity: .35; }
.ar-daily-ico { display: grid; place-items: center; color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.ar-daily-ico .ic .d { opacity: .4; }
.ar-weekly .ar-daily-ico { color: #c99a1e; }
.ar-daily.done .ar-daily-ico { color: var(--brand); }
.ar-today-icon { color: var(--c, var(--brand)); }
.ar-today-icon .ic .d { opacity: .3; }
.punit-ico .ic .d { opacity: .35; }
.punit-badge.on { color: var(--c); }
.pnode .ic .d { opacity: .3; }
.pnode.locked .ic .d { opacity: .2; }
/* Little markers on a node sit on a white disc so they read on any unit colour. */
.pnode-today, .pnode-crown, .pnode-fade { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 15px;
  background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .25); filter: none; }
.pnode-today, .pnode-crown { color: #e0a21a; }
.pnode-fade { color: var(--ink-2); }
.pnode-need .ic { color: var(--accent); vertical-align: -0.15em; }
/* Stars: filled when earned, a soft outline when not. */
.ar-stars i, .pstars i { display: inline-grid; }
.ar-stars i .ic .d, .pstars i .ic .d { opacity: .25; }
.ar-stars i.on .ic .d, .pstars i.on .ic .d { opacity: 1; }
.pstars i.on { text-shadow: none; filter: drop-shadow(0 1px 0 rgb(0 0 0 / .18)); }
.ar-bdg-ico { color: var(--ink-2); }
.ar-bdg.on .ar-bdg-ico { color: #7a4c08; }
.ar-bdg-ico .ic .d, .ar-unlock-badge .ic .d { opacity: .3; }
.ar-unlock-badge span { display: grid; color: #7a4c08; }
.ar-brief-tag .ic, .ar-source .ic, .ar-streak .ic, .ar-unlocked .ic, .ar-new-badges .ic, .ar-note .ic { vertical-align: -0.2em; }
.ar-source .ic { color: var(--ink-2); }
.ar-quit .ic { width: 18px; height: 18px; }
.ar-combo { display: inline-flex; align-items: center; gap: 3px; }
.ar-btn .ic { width: 20px; height: 20px; vertical-align: -4px; }
.ar-btn.good .ic { color: var(--ops-green); }
.ar-btn.bad .ic { color: var(--ops-red); }
.ar-btn.correct .ic, .ar-btn.wrong .ic { color: inherit; }
.pnode-today .ic .d, .pnode-crown .ic .d { opacity: 1; }
/* A locked unit still shows whose colour it is. */
.punit.locked .punit-ico { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
/* Field Guide and learning layer icons */
.ar-guide-btn .ic, .punit-skills .ic, .fg-rules .ic, .ar-proven .ic, .ar-cando .ic, .conf-deb .ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; color: var(--c, var(--brand)); }
.fg-skills .ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.fg-skills .sk-2 .ic { color: var(--ok); }
.fg-skills .sk-1 .ic { color: var(--accent); }
.fg-skills .sk-0 .ic { color: var(--ink-3); }
.ar-rule .ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; color: inherit; }

.ar-climb-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin: 6px 0 0; font-weight: 700; color: var(--ink-2); font-size: 14px; }
.ar-bounty { margin: 4px 0 0; font-weight: 800; color: color-mix(in srgb, #c99a1e 75%, var(--ink)); text-align: center; }
.ar-how-climb .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--c, #c99a1e); }
.ar-bounties { margin-top: 10px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.ar-bounties h3 { margin: 0 0 6px; font: 800 17px/1.2 var(--font-display, var(--font)); display: flex; align-items: center; gap: 6px; }
.ar-bounties h3 .ic { width: 20px; height: 20px; color: #c99a1e; }
.ar-bounties h3 small { margin-left: auto; font: 700 12px var(--font); color: var(--ink-3); }
.ar-bty { display: flex; align-items: center; gap: 10px; padding: 9px 0; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); font-size: 14px; }
.ar-bty > span:nth-child(2) { flex: 1; }
.ar-bty-ico .ic { width: 20px; height: 20px; color: #c99a1e; display: block; }
.ar-bty b { font-size: 13px; color: color-mix(in srgb, #c99a1e 80%, var(--ink)); white-space: nowrap; }
.ar-bty.done { color: var(--ink-3); }
.ar-bty.done .ar-bty-ico .ic, .ar-bty.done b { color: var(--ok); }

/* API console (Predict the Output, Web unit) */
.api-log { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; font: 12px/1.4 ui-monospace, Consolas, monospace; }
.api-x { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgb(255 255 255 / .05); color: var(--ops-ink-2); }
.api-x span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-x b { color: var(--ops-ink); white-space: nowrap; }
.api-hidden { margin-top: 4px; }

/* ---------- intrusion track: the ops-console race to capture the flag (§12.3) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tr { --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace; --cyan: #4fd1e8;
  position: relative; flex: none; margin: 8px 0 2px; padding: 8px 0 4px; border-top: 1px solid var(--ops-line); border-bottom: 1px solid var(--ops-line); contain: layout paint; }
.tr-hud { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 20px; padding: 0 2px 6px;
  font: 700 11px/1 var(--mono); letter-spacing: .08em; color: var(--ops-ink-2); white-space: nowrap; }
.tr-num { color: var(--ops-ink); }
.tr-name { margin-left: 6px; color: var(--c); }
.tr-tags { display: flex; gap: 6px; }
.tr-tag { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--ops-line); }
.tr-tag .ic { width: 12px; height: 12px; }
.tr-vpn { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
.tr-trc { color: var(--ops-red); border-color: color-mix(in srgb, var(--ops-red) 40%, transparent); }
.tr-best { color: var(--ops-amber); }
.tr-line { position: relative; height: 28px; }
.tr-rail, .tr-fill, .tr-rv { position: absolute; left: 14px; width: var(--w); height: 2px; top: 13px; border-radius: 2px; }
.tr-rail { background: var(--ops-line); }
.tr-fill { background: var(--c); transform-origin: left; box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.tr-rv { top: 18px; background: var(--ops-red); transform-origin: left; transform: scaleX(0); opacity: .75; }
.traced .tr-rv { opacity: 1; box-shadow: 0 0 8px color-mix(in srgb, var(--ops-red) 70%, transparent); }
.tr-n { position: absolute; top: 14px; width: 8px; height: 8px; transform: translate(-50%, -50%); border-radius: 2px; background: var(--ops-bg); border: 1.5px solid var(--ops-line); transition: background-color .18s ease, border-color .18s ease; }
.tr-n.on { background: var(--c); border-color: var(--c); }
.tr-n.lock { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--ops-ink-2); background: var(--ops-bg-2); }
.tr-n.lock .ic { width: 12px; height: 12px; }
.tr-n.lock.on { background: var(--ops-bg-2); color: var(--c); }
.tr-n.secured { color: var(--ops-bg); background: var(--c); border-color: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 55%, transparent); }
.tr-flag { position: absolute; top: 1px; width: 26px; height: 26px; display: grid; place-items: center; color: color-mix(in srgb, var(--ops-amber) 45%, var(--ops-ink-2)); }
.tr-flag .ic { width: 22px; height: 22px; transition: filter .3s ease-out; }
.captured .tr-flag { color: var(--ops-amber); }
.captured .tr-flag .ic { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ops-amber) 75%, transparent)); }
.captured .tr-fill { background: var(--ops-amber); }
.tr-coins { position: absolute; right: -8px; top: -6px; font: 800 10px/1 var(--font-display, var(--font)); color: var(--ops-amber); }
.tr-cur { position: absolute; left: 0; top: 14px; width: 0; height: 0; z-index: 2; will-change: transform; }
.tr-dot { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 2px; transform: rotate(45deg); background: #fff;
  box-shadow: 0 0 0 2px var(--c), 0 0 12px color-mix(in srgb, var(--c) 80%, transparent); }
.captured .tr-dot { box-shadow: 0 0 0 2px var(--ops-amber), 0 0 14px var(--ops-amber); }
.tr-ring { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; box-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 50%, transparent); }
.vpn .tr-ring { opacity: 1; }
.tr-streak { position: absolute; top: 11px; height: 6px; border-radius: 3px; transform-origin: left; background: linear-gradient(90deg, transparent, #e8782a); pointer-events: none; }
.tr-scan { position: absolute; top: 4px; height: 20px; border-radius: 3px; background: linear-gradient(90deg, rgb(255 92 92 / .55), rgb(255 92 92 / 0)); pointer-events: none; }
.tr-msg { position: absolute; right: 0; top: 6px; padding: 3px 7px; border-radius: 6px; background: var(--ops-bg); font: 800 11px/1.1 var(--mono); letter-spacing: .06em; color: var(--ops-ink);
  opacity: 0; transform: translateY(3px); transition: opacity .16s ease-out, transform .16s cubic-bezier(.23,1,.32,1); pointer-events: none; white-space: nowrap; }
.tr-msg.show { opacity: 1; transform: none; }
.tr-msg.bad { color: var(--ops-red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ops-red) 50%, transparent); }
.tr-msg.good { color: var(--ops-green); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ops-green) 45%, transparent); }
.tr-msg.gold { color: var(--ops-amber); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ops-amber) 50%, transparent); }
.tr-msg.cyan { color: var(--cyan); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 50%, transparent); }
.tr-msg.fire { color: #e8782a; box-shadow: inset 0 0 0 1px rgb(232 120 42 / .5); }
.tr.glitch .tr-hud, .tr.glitch .tr-line, .ar-trace.glitch .th-wire { animation: tr-glitch .18s steps(3) both; }
@keyframes tr-glitch {
  0% { transform: translateX(3px); filter: drop-shadow(-2px 0 rgb(255 92 92 / .8)) drop-shadow(2px 0 rgb(79 209 232 / .8)); }
  50% { transform: translateX(-2px); filter: drop-shadow(2px 0 rgb(255 92 92 / .8)) drop-shadow(-2px 0 rgb(79 209 232 / .8)); }
  100% { transform: none; filter: none; }
}

/* ---------- every format looks different (§12.4) ---------- */
.ar-btn:active, .rb-m:active, .rb-p:active, .ar-track:active { transform: scale(.97); }
.ar-rapid .ar-stage.in .ar-card { animation: card-in .22s cubic-bezier(.23,1,.32,1) both; }
@keyframes card-in { from { transform: translateX(16px); opacity: 0; } }
/* SOC alert queue */
.ar-card.ticket { padding-top: 10px; }
.tk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 700 11px/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; color: var(--ops-ink-2); }
.tk-sev { padding: 3px 7px; border-radius: 5px; font-weight: 800; }
.sev-low .tk-sev { background: rgb(57 217 138 / .15); color: var(--ops-green); }
.sev-med .tk-sev { background: rgb(255 197 71 / .16); color: var(--ops-amber); }
.sev-high .tk-sev { background: rgb(255 92 92 / .16); color: var(--ops-red); }
.tk-src { margin-left: auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* status-code pad */
.ar-four.pad .ar-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; text-align: left; }
.ar-four.pad .ar-btn b { font: 800 24px/1 var(--font-display, var(--font)); }
.ar-four.pad .ar-btn small { font-size: 12px; font-weight: 700; opacity: .75; }
/* request builder */
.rb-job { margin: 0 0 10px; font: 800 19px/1.25 var(--font-display, var(--font)); }
.rb-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-m, .rb-p { min-height: 38px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--ops-line); background: var(--ops-bg-2); color: var(--ops-ink);
  font: 800 12px/1 ui-monospace, Consolas, monospace; cursor: pointer; transition: transform .12s ease-out, background-color .15s ease, opacity .15s ease; }
.rb-m.on[data-m="GET"] { background: #1f6f4a; border-color: #1f6f4a; } .rb-m.on[data-m="POST"] { background: #8a5a12; border-color: #8a5a12; }
.rb-m.on[data-m="PUT"], .rb-m.on[data-m="PATCH"] { background: #2c5f9e; border-color: #2c5f9e; } .rb-m.on[data-m="DELETE"] { background: #8a2c2c; border-color: #8a2c2c; }
.rb-url { display: flex; align-items: center; gap: 6px; min-height: 42px; margin: 10px 0; padding: 6px 8px; border-radius: 8px; border: 1px dashed var(--ops-line); background: #08100d; font: 13px/1.3 ui-monospace, Consolas, monospace; }
.rb-sel { padding: 3px 6px; border-radius: 5px; background: var(--ops-line); color: #fff; font-size: 11px; }
.rb-path { display: flex; flex-wrap: wrap; color: #fff; overflow-wrap: anywhere; }
.rb-path i { color: var(--ops-ink-2); font-style: normal; }
.rb-back { margin-left: auto; flex: none; width: 36px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--ops-ink-2); cursor: pointer; }
.rb-back .ic { width: 18px; height: 18px; }
.rb-pieces { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-p { font-weight: 600; font-size: 13px; }
.rb-p:disabled { opacity: .25; }
.rb-send { width: 100%; margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rb-send:disabled { opacity: .45; }
/* Query Quest live table */
.sql-table.live .sql-row { cursor: pointer; }
.sql-table.live .sql-row td { transition: background-color .15s ease; }
.sql-tick { width: 20px; text-align: center; }
.sql-row.sel td { background: rgb(57 217 138 / .16); }
.sql-row.sel .sql-tick::before { content: "✓"; color: var(--ops-green); font-weight: 800; }
.sql-row.hit td { background: rgb(57 217 138 / .28); }
.sql-row.miss td { background: rgb(255 197 71 / .22); }
.sql-row.wrong td { background: rgb(255 92 92 / .25); }
.rows-run { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* inbox inspection: a light mail client inside the ops console */
.ar-card.mail { padding: 0; overflow: hidden; background: #f7f8f6; color: #1d231f; border-color: #d9ddd8; }
.mail-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #e8ebe7; color: #4a524d; font: 800 12px/1 var(--font); }
.mail-top .ic { width: 16px; height: 16px; vertical-align: -3px; color: #3a9d5d; }
.mail-count b { color: #b3261e; }
.mail-part { display: block; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid #e3e6e2; background: none; color: inherit; font: 500 15px/1.4 var(--font); text-align: left; cursor: pointer; transition: background-color .15s ease; }
.mail-part small { display: block; margin-bottom: 1px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b736e; }
.mail-subj { font-weight: 800; }
.mail-part:last-child { border-bottom: 0; }
.mail-part.bad { background: #ffe9e6; }
.mail-part.fine { background: #ecf6ef; }
.mail-part em { display: flex; align-items: center; gap: 5px; margin-top: 4px; font: 800 12px/1.3 var(--font); font-style: normal; color: #b3261e; }
.mail-part.fine em { color: #2e7d4f; }
.mail-part em .ic { width: 14px; height: 14px; flex: none; }
/* the terminal round: no card frame, all terminal */
.fmt-shell .ar-card { background: #060b09; border-color: #1b2e24; }
.fmt-shell .ar-statement { font-family: ui-monospace, Consolas, monospace; font-size: 15px; color: var(--ops-green); }
.fmt-shell .ar-four .ar-btn { font-family: ui-monospace, Consolas, monospace; font-size: 13px; text-align: left; justify-content: flex-start; }
/* the decryptor */
.decrypt .ar-tile { font-family: ui-monospace, Consolas, monospace; }
.decrypt .ar-tile.hit { box-shadow: 0 0 10px rgb(57 217 138 / .45); }

/* ---------- Lesson: Duolingo-style learning for beginners (§12.1) ---------- */
.ar-game.ar-lesson { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ar-lesson .tr { --ops-bg: var(--surface); --ops-bg-2: var(--surface-2, var(--surface)); --ops-line: var(--line); --ops-ink: var(--ink); --ops-ink-2: var(--ink-3); }
.ls-top { display: flex; align-items: center; gap: 10px; }
.ls-top .ar-quit { color: var(--ink-3); }
.ls-bar { flex: 1; height: 14px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, var(--surface)); overflow: hidden; }
.ls-bar i { display: block; height: 100%; border-radius: 99px; background: #3fae6a; transform-origin: left; transform: scaleX(.02);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .28); transition: transform .35s cubic-bezier(.23,1,.32,1); }
.ls-run { min-width: 34px; display: inline-flex; align-items: center; gap: 2px; font: 800 14px/1 var(--font-display, var(--font)); color: #e8782a; }
.ls-run .ic { width: 18px; height: 18px; }
.ls-stage { flex: 1; padding: 18px 2px 12px; }
.ls-stage.in > * { animation: ls-in .26s cubic-bezier(.23,1,.32,1) both; }
.ls-stage.in > *:nth-child(2) { animation-delay: 40ms; } .ls-stage.in > *:nth-child(3) { animation-delay: 80ms; } .ls-stage.in > *:nth-child(4) { animation-delay: 120ms; }
@keyframes ls-in { from { opacity: 0; transform: translateY(8px); } }
.ls-kind { margin: 0; font: 800 13px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ls-q { margin: 8px 0 18px; font: 800 22px/1.28 var(--font-display, var(--font)); color: var(--ink); }
.ls-opts { display: flex; flex-direction: column; gap: 10px; }
.ls-opts.two { flex-direction: row; } .ls-opts.two .ls-opt { flex: 1; justify-content: center; }
.ls-opt, .ls-tile, .ls-chip { border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); color: var(--ink); cursor: pointer;
  transition: transform .12s ease-out, border-color .15s ease, background-color .15s ease; }
.ls-opt { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 14px; border-radius: 16px; font: 700 16px/1.3 var(--font); text-align: left; }
.ls-opt:active, .ls-tile:active, .ls-chip:active { transform: translateY(2px); border-bottom-width: 2px; }
.ls-key { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; border: 2px solid var(--line); font-size: 12px; color: var(--ink-3); }
.ls-opt.sel, .ls-tile.sel, .ls-chip.sel { border-color: #3b82c4; background: color-mix(in srgb, #3b82c4 12%, var(--surface)); }
.ls-opt.ok, .ls-chip.ok { border-color: #3fae6a; background: color-mix(in srgb, #3fae6a 14%, var(--surface)); }
.ls-opt.no, .ls-chip.no { border-color: #d9534f; background: color-mix(in srgb, #d9534f 12%, var(--surface)); }
.ls-teach { text-align: center; padding-top: 6px; }
.ls-ico .ic { width: 68px; height: 68px; color: #3a9d5d; }
.ls-teach small { display: block; margin-top: 8px; font: 800 12px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ls-teach h2 { margin: 6px 0 10px; font: 800 26px/1.2 var(--font-display, var(--font)); }
.ls-teach p { margin: 0 auto; max-width: 30ch; font-size: 18px; line-height: 1.45; }
.ls-ex { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 14px; text-align: left; font-size: 15px; line-height: 1.4;
  background: color-mix(in srgb, #ffc547 18%, var(--surface)); }
.ls-ex .ic { flex: none; width: 22px; height: 22px; color: #c99a1e; }
.ls-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ls-match > div { display: flex; flex-direction: column; gap: 10px; }
.ls-tile { min-height: 54px; padding: 8px 10px; border-radius: 14px; font: 700 15px/1.25 var(--font); }
.ls-tile.done { opacity: .35; border-color: #3fae6a; cursor: default; }
.ls-tile.bad { border-color: #d9534f; animation: ls-shake .3s ease-out; }
@keyframes ls-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.ls-gap { display: inline-block; min-width: 110px; margin: 0 4px; padding: 0 6px; border: 0; border-bottom: 3px solid var(--line); background: none; font: inherit; color: #3b82c4; cursor: pointer; }
.ls-gap.filled { border-color: #3b82c4; }
.ls-bank, .ls-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ls-chip { padding: 10px 14px; border-radius: 12px; font: 700 15px/1.2 var(--font); }
.ls-chip.used { opacity: .3; }
.ls-buckets { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; margin-top: 14px; }
.ls-bucket { min-height: 112px; display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; border-radius: 14px; border: 2px dashed var(--line);
  background: color-mix(in srgb, var(--ink) 4%, var(--surface)); color: var(--ink); font: inherit; cursor: pointer; }
.ls-bucket b { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.ls-in { display: flex; flex-direction: column; gap: 6px; }
.ls-in .ls-chip { padding: 6px 8px; font-size: 13px; border-bottom-width: 3px; }
.ls-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.ls-sheet { display: flex; flex-direction: column; gap: 4px; margin: 0 -12px; padding: 14px 16px 6px; font-size: 15px; line-height: 1.4; animation: ls-up .22s cubic-bezier(.23,1,.32,1); }
@keyframes ls-up { from { transform: translateY(14px); opacity: 0; } }
.ls-sheet.ok { background: color-mix(in srgb, #3fae6a 18%, var(--surface)); color: color-mix(in srgb, #2c8a52 75%, var(--ink)); }
.ls-sheet.no { background: color-mix(in srgb, #d9534f 15%, var(--surface)); color: color-mix(in srgb, #b03a36 80%, var(--ink)); }
.ls-sheet b { display: flex; align-items: center; gap: 6px; font: 800 19px/1.2 var(--font-display, var(--font)); }
.ls-sheet b .ic { width: 22px; height: 22px; }
.ls-sheet small { opacity: .8; }
.ls-foot { margin: 0 -12px -12px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
.ls-sheet:not([hidden]) + .ls-foot { background: inherit; }
.ls-sheet.ok + .ls-foot { background: color-mix(in srgb, #3fae6a 18%, var(--surface)); }
.ls-sheet.no + .ls-foot { background: color-mix(in srgb, #d9534f 15%, var(--surface)); }
.ls-check { width: 100%; min-height: 54px; border: 0; border-bottom: 4px solid #2c8a52; border-radius: 16px; background: #3fae6a; color: #fff;
  font: 800 17px/1 var(--font); letter-spacing: .02em; cursor: pointer; transition: transform .12s ease-out; }
.ls-check:active { transform: translateY(2px); border-bottom-width: 2px; }
.ls-check:disabled { background: color-mix(in srgb, var(--ink) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ink) 14%, var(--surface)); color: var(--ink-3); cursor: default; transform: none; }
.ls-check.no { background: #d9534f; border-color: #b03a36; }

/* ---------- Trace Hunt (§12.4) ---------- */
.ar-trace .th-time { display: inline-flex; align-items: center; gap: 4px; }
.ar-trace .th-time .ic { width: 16px; height: 16px; }
.th-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-lives { flex: none; white-space: nowrap; }
.th-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0 6px; font: 700 11px/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; color: var(--ops-ink-2); }
.th-lives i { display: inline-block; width: 10px; height: 10px; margin-left: 7px; border-radius: 2px; transform: rotate(45deg); border: 1.5px solid var(--ops-red); }
.th-lives i.on { background: var(--ops-green); border-color: var(--ops-green); }
.th-wire { position: relative; flex: 1; min-height: 380px; border: 1px solid var(--ops-line); border-radius: 14px; overflow: hidden; touch-action: manipulation;
  background: repeating-linear-gradient(0deg, transparent 0 23px, rgb(57 217 138 / .05) 23px 24px), #070d0b; }
.th-lane { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ops-line); }
.th-lane:first-child { left: 25%; } .th-lane:nth-child(2) { left: 75%; }
.th-pkt { position: absolute; top: 0; width: calc(50% - 10px); min-height: 52px; padding: 6px 8px; border-radius: 10px; border: 1px solid #2a4a3a;
  background: rgb(17 31 26 / .96); color: var(--ops-ink); font: 600 12px/1.3 ui-monospace, Consolas, monospace; text-align: left; overflow-wrap: anywhere; cursor: pointer; will-change: transform; }
.th-pkt small { display: block; margin-bottom: 2px; font-size: 9px; letter-spacing: .1em; color: var(--ops-ink-2); }
.th-pkt.blocked { animation: th-block .18s ease-out forwards; border-color: var(--ops-green); }
@keyframes th-block { to { opacity: 0; scale: .85; } }
.th-pkt.fp { border-color: var(--ops-amber); animation: th-fp .26s ease-out forwards; }
@keyframes th-fp { 30% { translate: -4px 0; } 60% { translate: 4px 0; } to { opacity: 0; translate: 0 0; } }
.th-pkt.leak { background: rgb(255 92 92 / .3); border-color: var(--ops-red); animation: th-block .22s ease-out forwards; }
.th-pkt.ok { opacity: 0; transition: opacity .16s ease; }
.th-flash { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, rgb(255 92 92 / .4)); opacity: 0; pointer-events: none; }
.th-flash.on { animation: th-flash .45s ease-out; }
@keyframes th-flash { from { opacity: 1; } to { opacity: 0; } }
.th-server { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--ops-bg-2); border: 1px solid var(--ops-line);
  font: 800 12px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.th-server .ic { width: 22px; height: 22px; color: var(--ops-green); flex: none; }
.th-msg { margin-left: auto; max-width: 68%; font: 600 12px/1.3 var(--font); letter-spacing: 0; color: var(--ops-ink-2); text-align: right; }
.th-msg.good { color: var(--ops-green); } .th-msg.bad { color: var(--ops-red); } .th-msg.warn { color: var(--ops-amber); }

/* ---------- path: track chips and the placement sheet (§12.2) ---------- */
.ar-tracks { display: flex; gap: 8px; margin: 12px -2px 0; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.ar-tracks::-webkit-scrollbar { display: none; }
.ar-track { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; scroll-snap-align: start;
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--surface); color: var(--ink); font: 800 13px/1 var(--font); cursor: pointer; transition: transform .12s ease-out; }
.ar-track > .ic:first-child { width: 18px; height: 18px; color: var(--c); }
.ar-track > .ic:last-child:not(:first-child) { width: 13px; height: 13px; }
.ar-track.locked { color: var(--ink-3); background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.ar-track.done { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.ar-track.done > .ic:last-child { color: var(--c); }
.ar-place p { margin: 10px 0; line-height: 1.45; }
.ar-place .ar-sheet-head .ic { width: 20px; height: 20px; color: var(--c); vertical-align: -4px; }
.ar-climb-line .ic, .ar-bounty .ic { width: 18px; height: 18px; vertical-align: -3px; color: #c99a1e; }

@media (prefers-reduced-motion: reduce) {
  .tr-n, .tr-msg, .ls-bar i, .rb-m, .rb-p, .ls-opt, .ls-tile, .ls-chip, .mail-part { transition: none; }
  .tr.glitch .tr-hud, .tr.glitch .tr-line, .ar-trace.glitch .th-wire, .ar-rapid .ar-stage.in .ar-card, .ls-stage.in > *, .ls-sheet, .th-pkt.fp, .ls-tile.bad { animation: none; }
}
.ls-block { margin: 12px 0 6px; text-align: left; }
.ls-teach .ls-block { margin-top: 16px; }

/* ---------- lessons with game feel ---------- */
.ls-top { position: relative; }
.ls-pop { position: absolute; right: 0; top: 34px; z-index: 3; padding: 4px 10px; border-radius: 99px; background: #3fae6a; color: #fff;
  font: 800 15px/1.2 var(--font-display, var(--font)); white-space: nowrap; pointer-events: none; animation: ls-pop-up .7s cubic-bezier(.23,1,.32,1) forwards; }
.ls-pop.fire { background: #e8782a; }
.ls-pop.lost { background: color-mix(in srgb, var(--ink) 55%, var(--surface)); }
@keyframes ls-pop-up { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 20% { opacity: 1; transform: translateY(0) scale(1.06); } 100% { opacity: 0; transform: translateY(-18px) scale(1); } }
.ls-run.pulse { animation: ls-run-pulse .24s cubic-bezier(.23,1,.32,1); }
@keyframes ls-run-pulse { from { transform: scale(1.35); } }
.ls-bar.fire i { background: linear-gradient(90deg, #f0a24a, #e8782a); }
.ls-bar i { position: relative; overflow: hidden; }
.ls-bar.fire i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .55) 50%, transparent 70%); animation: ls-shine 1.1s ease-out 1; }
@keyframes ls-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ls-opt.ok { animation: ls-ok .26s cubic-bezier(.23,1,.32,1); }
@keyframes ls-ok { 40% { transform: scale(1.04); } }
.ls-opt.no { animation: ls-shake .3s ease-out; }
.ls-done { text-align: center; padding-top: 10px; }
.ls-done-ico .ic { width: 84px; height: 84px; color: #3fae6a; }
.ls-done.perfect .ls-done-ico .ic { color: #c99a1e; }
.ls-done h2 { margin: 8px 0 4px; font: 800 28px/1.15 var(--font-display, var(--font)); }
.ls-done-bonus { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0; padding: 4px 12px; border-radius: 99px; background: color-mix(in srgb, #ffc547 25%, var(--surface)); font-weight: 800; color: color-mix(in srgb, #c99a1e 80%, var(--ink)); }
.ls-done-bonus .ic { width: 18px; height: 18px; }
.ls-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 10px; }
.ls-tile-stat { border-radius: 16px; border: 2px solid var(--c, #3fae6a); overflow: hidden; background: var(--surface); }
.ls-tile-stat small { display: block; padding: 5px 4px; background: var(--c, #3fae6a); color: #fff; font: 800 11px/1.1 var(--font); letter-spacing: .05em; text-transform: uppercase; }
.ls-tile-stat b { display: block; padding: 10px 4px 12px; font: 800 24px/1 var(--font-display, var(--font)); color: var(--c, #3fae6a); font-variant-numeric: tabular-nums; }
.ls-tile-stat.gold { --c: #d6a21e; } .ls-tile-stat.green { --c: #3fae6a; } .ls-tile-stat.fire { --c: #e8782a; }
.ls-done-sub { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.ls-done .ls-tile-stat { animation: ls-in .3s cubic-bezier(.23,1,.32,1) both; }
.ls-done .ls-tile-stat:nth-child(2) { animation-delay: 80ms; } .ls-done .ls-tile-stat:nth-child(3) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) { .ls-run.pulse, .ls-bar.fire i::after, .ls-opt.ok, .ls-opt.no, .ls-done .ls-tile-stat { animation: none; } }

/* ---------- chapter map: current chapter, one locked silhouette, cloud beyond ---------- */
.am-map { display: grid; gap: 14px; margin: 16px 0 10px; }
.am-done { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.am-done-sum { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.am-done-tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: var(--c); flex: none; }
.am-done-tick .ic { width: 15px; height: 15px; }
.am-done b { flex: 1; font-size: 14px; }
.am-done small { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.am-done-ticks { display: inline-flex; gap: 3px; }
.am-done-ticks i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); color: transparent; }
.am-done-ticks i.on { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); color: var(--c); }
.am-done-ticks .ic { width: 10px; height: 10px; }

/* Cleared chapters fold into one closed line, so the path only shows where she is going. */
.am-done-group { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.am-done-group > summary { --c: var(--brand, #1f3a2e); display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.am-done-group > summary::-webkit-details-marker { display: none; }
.am-done-group > summary:focus-visible { outline: 2px solid var(--brand, #1f3a2e); outline-offset: -2px; }
.am-done-group > summary b { flex: 1; font-size: 14px; }
.am-done-group > summary small { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.am-done-caret { display: grid; place-items: center; color: var(--ink-3); transition: transform .18s ease; }
.am-done-caret .ic { width: 14px; height: 14px; }
.am-done-group[open] .am-done-caret { transform: rotate(90deg); }
.am-done-group .am-done { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
@media (prefers-reduced-motion: reduce) { .am-done-caret { transition: none; } }

.am-chapter { border: 2px solid color-mix(in srgb, var(--c) 55%, var(--line)); border-radius: 22px; background:
  radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--c) 13%, transparent), transparent 60%), var(--surface); padding: 14px 12px 6px; box-shadow: 0 12px 30px rgb(0 0 0 / .06); }
.am-chapter-head { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.am-chapter-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); flex: none; }
.am-chapter-ico .ic { width: 30px; height: 30px; }
.am-chapter-head small { display: block; color: var(--ink-3); font: 800 10px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.am-chapter-head h2 { margin: 2px 0 0; font: 800 22px/1.15 var(--font-display, var(--font)); }
.am-chapter-head p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.am-chapter-mark { margin-left: auto; color: var(--c); font: 800 11px/1 var(--font); white-space: nowrap; }
.am-rule { margin: 10px 4px 0; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--ink-2); font-size: 12px; }
.am-rule .ic { width: 14px; height: 14px; vertical-align: -2px; }

.am-path { position: relative; width: 100%; max-width: 360px; margin: 4px auto 0; }
.am-track-svg { position: absolute; inset: 0 auto auto 50%; transform: translateX(-50%); max-width: 100%; }
.am-track { fill: none; stroke: color-mix(in srgb, var(--ink-3) 22%, transparent); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 12; }
.am-track-fill { fill: none; stroke-width: 7; stroke-linecap: round; opacity: .5; }
.am-node-wrap { position: absolute; width: 0; height: 0; }
.am-node { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); width: 66px; height: 66px; border-radius: 50%; border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 90%, #fff), var(--c)); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 52%, #0b0f0d), inset 0 3px 0 rgb(255 255 255 / .3); transition: transform .08s ease, box-shadow .08s ease; }
.am-node:active:not([disabled]) { transform: translate(-50%, calc(-50% + 5px)); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 52%, #0b0f0d), inset 0 3px 0 rgb(255 255 255 / .3); }
.am-node .ic { width: 26px; height: 26px; }
.am-node.current { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 16%, transparent), 0 6px 0 color-mix(in srgb, var(--c) 52%, #0b0f0d), inset 0 3px 0 rgb(255 255 255 / .3); animation: am-current 1.8s ease-in-out infinite; }
.am-node.done { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 62%, #fff), color-mix(in srgb, var(--c) 92%, #0b0f0d)); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 40%, #0b0f0d), inset 0 3px 0 rgb(255 255 255 / .28); }
.am-node.open { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--c) 20%, var(--surface))); color: var(--c); box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 22%, var(--line)), inset 0 3px 0 #fff; }
.am-node.locked { cursor: not-allowed; color: color-mix(in srgb, var(--ink-3) 70%, transparent); background: color-mix(in srgb, var(--surface) 72%, var(--line)); box-shadow: 0 5px 0 color-mix(in srgb, var(--line) 80%, transparent); filter: grayscale(1); }
.am-node.artifact { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), 0 6px 0 color-mix(in srgb, var(--c) 52%, #0b0f0d), inset 0 3px 0 rgb(255 255 255 / .3); }
.am-node.artifact.current { background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #111)); }
.am-tick, .am-play, .am-lock, .am-art { display: grid; place-items: center; }
/* The current level gets the handler beside it and a START flag above it. */
.am-start { position: absolute; left: 0; top: -56px; transform: translateX(-50%); padding: 3px 9px; border-radius: 999px; background: var(--c); color: #fff; font: 800 9px/1.2 var(--font); letter-spacing: .08em; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 55%, #0b0f0d); }
.am-pet { position: absolute; left: 42px; top: -38px; pointer-events: none; }
.am-node-wrap.rhs .am-pet { left: auto; right: 42px; }
.am-chap-bar { display: block; margin-top: 7px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--c) 16%, var(--line)); overflow: hidden; }
.am-chap-bar i { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.am-node-tier { position: absolute; right: -2px; bottom: -2px; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font: 800 9px/16px var(--font); }
.am-node-copy { position: absolute; left: 0; top: 58px; transform: translateX(-50%); width: 124px; text-align: center; }
.am-node-copy b { display: -webkit-box; overflow: hidden; font-size: 12px; line-height: 1.2; color: var(--ink); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.am-node-copy small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 10px; line-height: 1.25; }
.am-node.locked + .am-node-copy b { color: color-mix(in srgb, var(--ink) 60%, transparent); }
.am-node-stars { position: absolute; left: 0; top: 38px; transform: translateX(-50%); display: inline-flex; gap: 2px; }
.am-node-stars i { display: grid; place-items: center; color: var(--line); }
.am-node-stars i.on { color: #d6a21e; }
.am-node-stars .ic { width: 12px; height: 12px; }
/* A cleared chapter is a shelf, not a tombstone: every level in it can be replayed. */
.am-done-levels { display: grid; gap: 6px; padding: 0 12px 12px; }
.am-replay { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.am-replay:active { transform: translateY(1px); }
.am-replay b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--ink)); font-size: 11px; }
.am-replay span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-replay-stars { display: inline-flex; gap: 2px; }
.am-replay-stars em { display: grid; place-items: center; color: var(--line); font-style: normal; }
.am-replay-stars em.on { color: #d6a21e; }
.am-replay-stars .ic { width: 12px; height: 12px; }
@keyframes am-current { 50% { transform: translate(-50%, -50%) scale(1.06); } }

.am-next { display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--ink-3) 28%, var(--line)); background: color-mix(in srgb, var(--surface) 70%, var(--line)); }
.am-next-lock { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--ink-3) 12%, var(--surface)); color: var(--ink-3); flex: none; filter: blur(.3px) grayscale(1); }
.am-next b { font-size: 14px; }
.am-next p { margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }

.am-fog { position: relative; overflow: hidden; min-height: 150px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 80%, var(--line)), color-mix(in srgb, var(--surface) 55%, var(--line))); display: grid; place-items: center; text-align: center; padding: 38px 26px 28px; isolation: isolate; }
.am-fog::before { content: ""; position: absolute; inset: -20px; z-index: -1; background:
  radial-gradient(60px 38px at 20% 30%, rgb(255 255 255 / .55), transparent 65%),
  radial-gradient(90px 48px at 72% 40%, rgb(255 255 255 / .45), transparent 68%),
  radial-gradient(70px 42px at 48% 72%, rgb(255 255 255 / .35), transparent 70%);
  filter: blur(14px) saturate(.4); opacity: .85; }
.am-cloud { position: absolute; z-index: -1; width: 120px; height: 54px; border-radius: 999px; background: rgb(255 255 255 / .38); filter: blur(10px); }
.am-cloud.c1 { top: 8px; left: -24px; }
.am-cloud.c2 { top: 38px; right: -30px; width: 150px; height: 64px; }
.am-cloud.c3 { bottom: -18px; left: 30%; width: 170px; height: 70px; }
.am-fog p { margin: 0; display: inline-flex; align-items: center; gap: 6px; font: 800 15px/1.2 var(--font); color: var(--ink-2); }
.am-fog small { display: block; max-width: 290px; margin-top: 6px; color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.am-note { padding: 0 4px; }

.am-league { margin: 12px 0; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.am-league-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.am-league-head small { color: var(--ink-3); font-size: 10px; }
.am-league-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: 12px; }
.am-league-row.me { color: var(--ink); font-weight: 800; }
.am-league-row b { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.am-end { display: grid; gap: 12px; margin: 16px 0; }
.am-end-card { position: relative; display: grid; gap: 10px; padding: 18px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); }
.am-end-card.calibration { border-color: color-mix(in srgb, #39d98a 55%, var(--line)); background: radial-gradient(120% 120% at 0 0, color-mix(in srgb, #39d98a 12%, transparent), transparent 60%), var(--surface); }
.am-end-card.ng { border-color: color-mix(in srgb, #c99a1e 55%, var(--line)); }
.am-end-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, currentColor 8%, var(--surface)); color: #39d98a; }
.am-end-card.ng .am-end-ico { color: #c99a1e; }
.am-end-card small { color: var(--ink-3); font: 800 10px/1.2 var(--font); letter-spacing: .07em; text-transform: uppercase; }
.am-end-card h2 { margin: 2px 0 4px; font: 800 22px/1.15 var(--font-display, var(--font)); }
.am-end-card p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }

.am-big-score { margin: 8px 0; font: 800 42px/1 var(--font-display, var(--font)); }
.am-big-score small { font: 700 14px/1 var(--font); color: var(--ink-3); }
.am-result .ar-debrief { text-align: left; }
.am-end-actions { margin-top: 10px; }
.am-hint { margin: 8px 0; padding: 9px 11px; border-radius: 12px; background: color-mix(in srgb, #c99a1e 11%, var(--surface)); color: var(--ink-2); font-size: 13px; }
.am-hint .ic { width: 15px; height: 15px; vertical-align: -2px; }
.am-cal .am-cal-board { margin: 14px 0; }

.ar-lives { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font: 800 12px/1 var(--font); }
.ar-lives .ic { width: 16px; height: 16px; }
.ar-lives i { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--ink-3) 30%, transparent); }
.ar-lives i.on { background: #39d98a; }
.ar-lives-note { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.ar-rapid.map-level .tr { display: none; }
.am-drill-link { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 11px 13px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.am-drill-link > .ic { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.am-drill-link span { flex: 1; min-width: 0; }
.am-drill-link b { display: block; font-size: 13px; }
.am-drill-link small { display: block; color: var(--ink-3); font-size: 11px; }
.am-drill-list { display: grid; gap: 12px; margin: 14px 0; }
.am-drill-chapter { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 12px; }
.am-drill-chapter h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 800 15px/1.2 var(--font); }
.am-drill-chapter h2 .ic { width: 20px; height: 20px; color: var(--c); }
.am-drill-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.am-drill-topic { display: block; padding: 9px 10px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--c) 25%, var(--line)); background: color-mix(in srgb, var(--c) 5%, var(--surface)); color: var(--ink); text-decoration: none; }
.am-drill-topic b { display: block; font-size: 12px; line-height: 1.25; }
.am-drill-topic small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 10px; }
@media (max-width: 330px) { .am-drill-topics { grid-template-columns: 1fr; } }

.arena-home { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; padding: 12px 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, #39d98a 35%, var(--line)); background: linear-gradient(100deg, color-mix(in srgb, #39d98a 12%, var(--surface)), var(--surface)); text-decoration: none; color: var(--ink); }
.arena-home-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: color-mix(in srgb, #39d98a 18%, var(--surface)); flex: none; }
.arena-home-ico .ic { width: 24px; height: 24px; }
.arena-home > span:nth-child(2) { flex: 1; min-width: 0; }
.arena-home small { display: block; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.arena-home b { display: block; margin: 1px 0; font-size: 14px; }
.arena-home span span { display: block; color: var(--ink-3); font-size: 11px; }
.arena-home-go { flex: none; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--surface); font: 800 11px/1 var(--font); }

@media (max-width: 360px) {
  .am-node { width: 52px; height: 52px; }
  .am-node-copy { width: 104px; }
  .am-chapter { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .am-node.current { animation: none; }
  .am-cloud { filter: blur(10px) saturate(.4); }
}

/* Compact, but unmistakably the Arena: a branded banner — not a plain row, not a second hero. */
.arena-row {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 0; padding: 13px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1f3a2e 0%, #17322a 55%, #12271f 100%);
  color: #f2f7f3; text-decoration: none;
  border: 1px solid rgb(255 255 255 / .07);
  box-shadow: 0 8px 22px rgb(20 35 28 / .18);
}
.arena-row:active { transform: scale(.995); }
.arena-row-icon { flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgb(143 201 164 / .16); color: #8fc9a4; }
.arena-row-icon svg { width: 24px; height: 24px; }
.arena-row-main { flex: 1; min-width: 0; }
.arena-row-label { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8fc9a4; }
.arena-row-main b { display: block; margin-top: 2px; font-size: 16px; color: #fff; }
.arena-row-sub { display: block; margin-top: 2px; font-size: 12.5px; color: #a8c7b4; }
.arena-row-go { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: #8fc9a4; color: #10241a; font-weight: 700; font-size: 13px; }

/* ---------- pack switcher: drawn only once a second course pack exists ---------- */
.ar-packs { display: flex; gap: 8px; overflow-x: auto; margin: 2px 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.ar-packs::-webkit-scrollbar { display: none; }
.ar-pack { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid rgba(143, 201, 164, .35); background: rgba(255, 255, 255, .04); color: #cfe6d7;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ar-pack svg { width: 16px; height: 16px; }
.ar-pack.on { background: #8fc9a4; border-color: #8fc9a4; color: #10241a; }
.ar-pack:focus-visible { outline: 2px solid #8fc9a4; outline-offset: 2px; }

/* ---------- six subject packs, coming soon, and the depth layer ---------- */
.ar-more { border-style: dashed; opacity: .85; }
.ar-more:hover { opacity: 1; }
.ar-row-packs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.ar-row-pack { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgb(143 201 164 / .25); color: #a8c7b4; font-size: 12px; text-decoration: none; }
.ar-row-pack svg { width: 14px; height: 14px; }
.ar-soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ar-soon-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid #e7e1d3; background: #fffdf8; color: #1d231f; font: inherit; cursor: pointer; }
.ar-soon-card:hover { border-color: #cfc6b2; }
.ar-soon-ico { font-size: 20px; }
.ar-soon-card b { font-size: 14px; }
.ar-soon-card small { color: #5b6259; font-size: 12px; line-height: 1.35; }
.ar-soon-badge { display: inline-block; margin-top: 4px; padding: 2px 7px; border-radius: 999px; background: #f4e3bd; color: #6b4c12; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ar-soon-detail h4 { margin: 14px 0 6px; }
.ar-soon-topics { margin: 0 0 8px 18px; padding: 0; }
.ar-soon-topics li { margin: 3px 0; }
.ar-artifact { margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; background: #f6f3ec; color: #1d231f; border: 1px solid #e7e1d3; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.ar-tier { display: inline-block; margin: 6px 0 2px; padding: 2px 8px; border-radius: 999px; background: #f4e3bd; color: #6b4c12; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.ar-pairs { display: grid; gap: 8px; }
.ar-pair { padding: 10px 12px; border-radius: 12px; border: 1px solid #e7e1d3; background: #fffdf8; color: #1d231f; }
.ar-pair p { margin: 0 0 4px; }
.ar-pair small { color: #5b6259; }
.ar-cases, .ar-projects, .ar-gate { margin: 0 0 12px 18px; padding: 0; }
.ar-cases li, .ar-projects li, .ar-gate li { margin: 5px 0; }
.ar-projects p { margin: 4px 0 4px 22px; }
.ar-gate { list-style: none; margin-left: 0; }
.ar-gate li { color: #6b4c12; }
.ar-gate li.ok { color: #2f7a4f; }
.ar-mastered { margin: 8px 0 0; color: #e6b450; font-weight: 700; }
.ar-pro h4, .ar-soon h4 { margin: 16px 0 6px; }
textarea.ar-artifact { width: 100%; }

/* The subject chips sit above the dark hero now, so give them light-page contrast. */
.ar-pack { background: #fffdf8; border: 1px solid #d9d2c2; color: #1d231f; opacity: 1; }
.ar-pack svg { color: #2f7a4f; }
.ar-pack.on { background: #1f3a2e; border-color: #1f3a2e; color: #fffdf8; }
.ar-pack.on svg { color: #e6b450; }
.ar-pack:hover { border-color: #2f7a4f; }
.ar-more { color: #5b6259; border-style: dashed; }
