/* =====================================================================
   Automation Arcade — standalone game page styles.
   Uses the design tokens from styles.css (:root). Loaded only on arcade.html.
   ===================================================================== */
[hidden] { display: none !important; }

.arc-hero { padding: clamp(5.5rem, 11vw, 8rem) 0 1rem; text-align: center; position: relative; }
.arc-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(59,130,246,0.16), transparent 70%),
    radial-gradient(40% 40% at 80% 10%, rgba(245,158,11,0.10), transparent 70%);
}
.arc-hero h1 { margin: 0.6rem 0 0.8rem; }
.arc-hero-p { max-width: 62ch; margin: 0 auto; color: var(--text-dim); line-height: 1.65; }

.arc-section { padding-top: 2rem; }
.arc-shell { max-width: 980px; margin: 0 auto; }

/* ---- start screen ---- */
.arc-screen { animation: arcFade .35s var(--ease); }
@keyframes arcFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.arc-start-inner {
  text-align: center; max-width: 640px; margin: 0 auto;
  background: var(--grad-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(1.6rem, 4vw, 2.8rem); box-shadow: var(--shadow-lg);
}
.arc-start-badge, .arc-start-inner .arc-start-badge {
  display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--amber-bright); background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35); border-radius: var(--r-full); padding: 0.3rem 0.8rem; margin-bottom: 1rem;
}
.arc-tag { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.64rem; letter-spacing: 0.06em; border-radius: var(--r-full); padding: 0.14rem 0.5rem; border: 1px solid transparent; }
.arc-tag-free { color: var(--green); background: rgba(63,185,80,0.12); border-color: rgba(63,185,80,0.35); }
.arc-tag-mem { color: var(--amber-bright); background: rgba(245,158,11,0.16); border-color: rgba(245,158,11,0.42); }
.arc-tag-mem.is-unlocked { color: var(--green); background: rgba(63,185,80,0.12); border-color: rgba(63,185,80,0.35); }
.arc-start-inner h2 { margin: 0 0 0.7rem; }
.arc-start-inner > p { color: var(--text-dim); line-height: 1.65; max-width: 52ch; margin: 0 auto 1.4rem; margin-top: 20px; }
.arc-how { list-style: none; padding: 0; margin: 0 auto 1.6rem; max-width: 460px; text-align: left; display: grid; gap: 0.6rem; }
.arc-how li { display: flex; align-items: center; gap: 0.7rem; color: var(--text); font-size: 0.95rem; }
.arc-how-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #fff;
  background: var(--grad-primary);
}
.arc-fineprint { font-size: 0.82rem; color: var(--text-faint); margin: 1rem 0 0; }

/* ---- HUD ---- */
.arc-hud {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.7rem 1rem; margin-bottom: 1.1rem;
}
.arc-hud-item { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.92rem; color: var(--text); }
.arc-hud-item b { color: #fff; font-weight: 700; }
.arc-hud-sep { color: var(--text-faint); margin: 0 0.15rem; }
.arc-ic { width: 17px; height: 17px; color: var(--blue-bright); }
.arc-hud-score .arc-ic { color: var(--amber-bright); }
.arc-progress { flex: 1; display: flex; gap: 5px; min-width: 120px; }
.arc-progress i {
  flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.09);
  transition: background .3s var(--ease);
}
.arc-progress i.done { background: var(--grad-primary); }
.arc-progress i.current { background: var(--amber); box-shadow: 0 0 8px rgba(245,158,11,0.6); }
.arc-progress i.locked { background: rgba(245,158,11,0.14); box-shadow: inset 0 0 0 1px rgba(245,158,11,0.4); }

/* ---- task panel ---- */
.arc-task {
  background: var(--grad-surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--blue); border-radius: var(--r); padding: 1.1rem 1.3rem; margin-bottom: 1.2rem;
}
.arc-task-tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-bright); }
.arc-task h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); margin: 0.35rem 0 0.4rem; }
.arc-task p { color: var(--text-dim); margin: 0; line-height: 1.6; }

/* ---- board ---- */
.arc-board { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.arc-col { min-width: 0; }
.arc-col-h { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin: 0 0 0.6rem; display: flex; align-items: baseline; gap: 0.5rem; }
.arc-col-note { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint); text-transform: none; letter-spacing: 0; }
.arc-bank, .arc-solution {
  display: flex; flex-direction: column; gap: 0.55rem;
  min-height: 220px; padding: 0.7rem; border-radius: var(--r);
  background: rgba(0,0,0,0.22); border: 1px dashed var(--border-strong);
}
.arc-solution { border-style: solid; border-color: var(--border-blue); background: rgba(59,130,246,0.05); }
.arc-empty { color: var(--text-faint); font-size: 0.85rem; text-align: center; margin: auto; padding: 1rem; font-family: var(--font-mono); }

/* ---- step cards ---- */
.arc-step {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  background: var(--grad-surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 0.7rem 0.8rem; cursor: pointer; text-align: left;
  color: var(--text); font-size: 0.9rem; line-height: 1.35; transition: .18s var(--ease);
}
.arc-step:hover { border-color: var(--blue-bright); transform: translateY(-1px); box-shadow: var(--shadow); }
.arc-step .arc-step-ico { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: rgba(59,130,246,0.14); color: var(--blue-bright); }
.arc-step .arc-step-ico svg { width: 15px; height: 15px; }
.arc-step-label { flex: 1; }
.arc-step-add { flex: none; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

/* solution slot */
.arc-slot {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: linear-gradient(180deg, rgba(59,130,246,0.10), rgba(59,130,246,0.04));
  border: 1px solid var(--border-blue); border-radius: 10px; padding: 0.6rem 0.7rem;
  color: var(--text); font-size: 0.9rem; line-height: 1.35; animation: arcPop .25s var(--ease);
}
@keyframes arcPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.arc-slot-num {
  flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: #0a0e17; background: var(--grad-accent);
}
.arc-slot-label { flex: 1; min-width: 0; }
.arc-slot-ctrl { flex: none; display: flex; gap: 0.2rem; }
.arc-slot-ctrl button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: rgba(0,0,0,0.25); color: var(--text-dim); cursor: pointer; display: grid; place-items: center;
  font-size: 0.9rem; line-height: 1; transition: .15s var(--ease);
}
.arc-slot-ctrl button:hover:not(:disabled) { border-color: var(--blue-bright); color: var(--text); }
.arc-slot-ctrl button:disabled { opacity: 0.3; cursor: default; }
.arc-slot-ctrl .arc-x:hover { border-color: var(--amber); color: var(--amber-bright); }

/* shake on wrong answer */
.arc-shake { animation: arcShake .4s; }
@keyframes arcShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }

/* ---- controls ---- */
.arc-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.arc-feedback { margin: 0; font-size: 0.9rem; min-height: 1.3em; flex: 1; }
.arc-feedback.err { color: var(--amber-bright); }
.arc-feedback.ok { color: var(--green); }

/* ---- success overlay ---- */
.arc-success {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.2rem; background: rgba(4,7,14,0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: arcFade .3s var(--ease);
}
.arc-success-card {
  width: min(560px, 96vw); max-height: 92vh; overflow-y: auto; text-align: center;
  background: var(--grad-surface); border: 1px solid var(--border-blue); border-radius: var(--r-lg);
  padding: clamp(1.3rem, 4vw, 2rem); box-shadow: var(--shadow-lg);
}
.arc-success-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--green); background: rgba(63,185,80,0.14); border: 1px solid rgba(63,185,80,0.4);
  border-radius: var(--r-full); padding: 0.3rem 0.8rem; margin-bottom: 0.9rem;
}
.arc-success-card h3 { font-size: 1.3rem; margin: 0 0 0.4rem; }
.arc-earned { color: var(--amber-bright); font-family: var(--font-mono); font-size: 0.95rem; margin: 0 0 1.1rem; }

/* ---- code reveal ---- */
.arc-codewrap { text-align: left; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); margin-bottom: 1rem; background: #1e1e1e; }
.arc-code-bar { display: flex; align-items: center; gap: 6px; padding: 0.5rem 0.8rem; background: #181818; border-bottom: 1px solid #2a2a2a; }
.arc-cd { width: 11px; height: 11px; border-radius: 50%; }
.arc-cd.r { background: #ff5f56; } .arc-cd.y { background: #ffbd2e; } .arc-cd.g { background: #27c93f; }
.arc-code-file { margin-left: 0.5rem; font-family: var(--font-mono); font-size: 0.78rem; color: #cfcfcf; }
/* a small C# language pill after the file name, on every code surface */
.arc-code-file::after {
  content: "C#"; margin-left: 0.55rem; padding: 0.04rem 0.42rem; border-radius: 5px;
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.03em; vertical-align: middle;
  color: #8fc7f5; background: rgba(86,156,214,0.16); border: 1px solid rgba(86,156,214,0.34);
}
.arc-code {
  margin: 0; padding: 0.95rem 1.05rem; overflow-x: auto; font-family: var(--font-mono);
  font-size: 0.855rem; line-height: 1.72; color: #e4e4e4; tab-size: 4; -moz-tab-size: 4;
  -webkit-font-smoothing: antialiased; scrollbar-width: thin;
}
/* refined, VS Code Dark+ inspired token palette (shared by every code surface) */
.arc-code .c-kw { color: #569cd6; } .arc-code .c-ty { color: #4ec9b0; }
.arc-code .c-str { color: #ce9178; } .arc-code .c-cmt { color: #7ca672; font-style: italic; }
.arc-code .c-num { color: #b5cea8; } .arc-code .c-fn { color: #dcdcaa; }

/* line-number gutter — the highlighter wraps each source line in a `.cl` block,
   so the count hangs off that. Depends only on `.cl` (which exists only in
   numbered output), so it works whether the `.lined` marker lands on the <pre>
   or the <code>. */
.arc-code code { counter-reset: aln; }
.arc-code .cl {
  display: block; counter-increment: aln; position: relative; padding-left: 3.2em;
  border-radius: 4px; transition: background .12s var(--ease);
}
.arc-code .cl::before {
  content: counter(aln); position: absolute; left: 0; top: 0; width: 2.3em;
  text-align: right; padding-right: 0.6em; color: #5a6675; opacity: 0.85;
  border-right: 1px solid rgba(255,255,255,0.07); user-select: none; -webkit-user-select: none;
}
.arc-code .cl:hover { background: rgba(120,170,255,0.06); }
.arc-lesson-link { display: inline-block; font-family: var(--font-mono); font-size: 0.82rem; color: var(--blue-bright); margin-bottom: 1.1rem; }
.arc-lesson-link:hover { text-decoration: underline; }

/* ---- end screen ---- */
.arc-end-inner { text-align: center; max-width: 620px; margin: 0 auto; }
.arc-endline { color: var(--text-dim); line-height: 1.65; margin: 0.5rem 0 1.4rem; }
.arc-card-canvas {
  width: 100%; max-width: 440px; height: auto; border-radius: 18px;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); margin: 0 auto 1.2rem; display: block;
}
.arc-end-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-bottom: 2.2rem; }
.arc-cta {
  background: var(--grad-surface); border: 1px solid var(--border-blue); border-radius: var(--r-lg);
  padding: clamp(1.4rem, 4vw, 2.2rem); box-shadow: var(--shadow);
}
.arc-cta h3 { font-size: 1.3rem; margin: 0 0 0.5rem; }
.arc-cta p { color: var(--text-dim); line-height: 1.6; margin: 0 auto 1.3rem; max-width: 48ch; }

/* ---- responsive ---- */
@media (max-width: 680px) {
  .arc-board { grid-template-columns: 1fr; }
  .arc-solution { min-height: 120px; }
  .arc-controls { flex-direction: column; align-items: stretch; }
  .arc-controls-btns { justify-content: space-between; }
  .arc-controls-btns .btn { flex: 1; }
  .arc-feedback { text-align: center; }
  .arc-floor { grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); }
}

/* ============================ "wow" redesign ============================ */

/* model viewport (the signature) */
.arc-stage { position: relative; overflow: hidden; margin-bottom: 1.2rem; padding: 0.9rem 1rem 1rem; border-radius: var(--r); border: 1px solid var(--border-strong); background: linear-gradient(180deg, rgba(10,14,23,0.6), rgba(13,20,36,0.5)); transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.arc-stage.running { border-color: var(--border-blue); }
.arc-stage.finished { border-color: rgba(63,185,80,0.5); box-shadow: 0 0 26px rgba(63,185,80,0.16); }
.arc-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(115deg, transparent 34%, rgba(251,191,36,0.20) 50%, transparent 66%); }
.arc-stage.finished::after { animation: arcSweep .85s var(--ease); }
@keyframes arcSweep { from { opacity: 1; transform: translateX(-55%); } to { opacity: 0; transform: translateX(55%); } }
.arc-stage-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }
.arc-stage-tag { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.arc-stage-hud { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--text); }
.arc-stage.running .arc-stage-hud { color: var(--cyan); }
.arc-stage.finished .arc-stage-hud { color: var(--green); }
.arc-floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; padding: 0.85rem; border-radius: 10px; background-color: rgba(0,0,0,0.28); background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 24px 24px; }

/* elements on the model */
.arc-el { aspect-ratio: 1; border-radius: 5px; border: 1px solid var(--border-strong); background: rgba(255,255,255,0.03); position: relative; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.52rem; color: transparent; transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), color .2s var(--ease); }
.arc-el.on { border-color: transparent; transform: scale(1.05); box-shadow: 0 0 0 1px rgba(96,165,250,0.45), 0 0 10px rgba(59,130,246,0.45); }
.arc-floor[data-kind="views"] .arc-el.on { background: rgba(63,185,80,0.28); color: #c8f0d0; }
.arc-floor[data-kind="views"] .arc-el.on::after { content: "\2713"; }
.arc-floor[data-kind="doors"] .arc-el.on { background: rgba(59,130,246,0.34); }
.arc-floor[data-kind="doors"] .arc-el.on::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 2px; background: var(--amber-bright); box-shadow: 0 0 6px var(--amber); }
.arc-floor[data-kind="walls"] .arc-el.on { background: rgba(245,158,11,0.30); color: var(--amber-bright); }
.arc-floor[data-kind="walls"] .arc-el.on::after { content: "2h"; }
.arc-floor[data-kind="rooms"] .arc-el.on { background: rgba(63,185,80,0.28); color: #c8f0d0; }
.arc-floor[data-kind="rooms"] .arc-el.on::after { content: attr(data-num); }
.arc-floor[data-kind="grid"] .arc-el { background: transparent; border-color: transparent; }
.arc-floor[data-kind="grid"] .arc-el::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); transition: all .25s var(--ease); }
.arc-floor[data-kind="grid"] .arc-el.on { transform: none; box-shadow: none; }
.arc-floor[data-kind="grid"] .arc-el.on::before { width: 78%; height: 78%; border-radius: 4px; background: rgba(59,130,246,0.5); box-shadow: 0 0 10px rgba(59,130,246,0.6); }
.arc-floor[data-kind="walls-colour"] .arc-el.on[data-g="0"] { background: rgba(220,50,50,0.5); box-shadow: 0 0 9px rgba(220,50,50,0.45); }
.arc-floor[data-kind="walls-colour"] .arc-el.on[data-g="1"] { background: rgba(245,158,11,0.5); box-shadow: 0 0 9px rgba(245,158,11,0.45); }
.arc-floor[data-kind="walls-colour"] .arc-el.on[data-g="2"] { background: rgba(120,145,170,0.5); box-shadow: 0 0 9px rgba(120,145,170,0.4); }

/* running-code strip */
.arc-runline { display: block; margin-top: 0.7rem; padding: 0.5rem 0.7rem; border-radius: 8px; border: 1px solid var(--border); background: rgba(0,0,0,0.3); font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; overflow-x: auto; }
.arc-runline.live { color: var(--cyan); border-color: var(--border-blue); box-shadow: 0 0 12px rgba(34,211,238,0.22); animation: arcRunPulse .8s var(--ease) infinite; }
@keyframes arcRunPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ---- execution trace (the live code simulation) ---- */
.arc-trace {
  margin-top: 0.7rem; display: grid; gap: 0.7rem;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: stretch;
}
.arc-trace-code-wrap {
  min-width: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-blue); background: rgba(0,0,0,0.4);
  box-shadow: 0 0 20px rgba(34,211,238,0.12);
}
.arc-trace-bar { display: flex; align-items: center; gap: 6px; padding: 0.45rem 0.7rem; background: #181818; border-bottom: 1px solid #2a2a2a; }
.arc-trace-tag { margin-left: 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); }
.arc-trace-file { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: #cfcfcf; }
.arc-trace-code {
  list-style: none; margin: 0; padding: 0.55rem 0; counter-reset: tl;
  max-height: 260px; overflow-y: auto; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.58;
  -webkit-font-smoothing: antialiased; scrollbar-width: thin;
}
.arc-tl {
  counter-increment: tl; display: flex; gap: 0.7rem; padding: 0.05rem 0.8rem 0.05rem 0;
  color: #6b7480; border-left: 2px solid transparent; transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.arc-tl::before {
  content: counter(tl); flex: none; width: 2.2em; text-align: right; padding-right: 0.2rem;
  color: #4a5460; user-select: none;
}
.arc-tl code { white-space: pre; color: inherit; }
.arc-tl.ran { color: #b7c6cf; }
.arc-tl.hot {
  background: linear-gradient(90deg, rgba(34,211,238,0.16), rgba(34,211,238,0.02));
  border-left-color: var(--cyan); color: #eaf6fb;
}
.arc-tl.hot::before { color: var(--cyan); }
.arc-trace-code .c-kw { color: #569cd6; } .arc-trace-code .c-ty { color: #4ec9b0; }
.arc-trace-code .c-str { color: #ce9178; } .arc-trace-code .c-cmt { color: #7ca672; font-style: italic; }
.arc-trace-code .c-num { color: #b5cea8; } .arc-trace-code .c-fn { color: #dcdcaa; }
.arc-tl.ran code, .arc-tl.hot code { filter: none; }

.arc-trace-side { min-width: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.arc-trace-txn {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7rem; border-radius: 9px;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid var(--border-strong); background: rgba(0,0,0,0.28); color: var(--text-faint);
  transition: .2s var(--ease);
}
.arc-trace-txn-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.arc-trace-txn.open { color: var(--amber-bright); border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.08); }
.arc-trace-txn.done { color: var(--green); border-color: rgba(63,185,80,0.5); background: rgba(63,185,80,0.1); }
.arc-trace-watch-h { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.arc-trace-watch { list-style: none; margin: 0; padding: 0.5rem 0.65rem; display: flex; flex-direction: column; gap: 0.4rem; border-radius: 9px; border: 1px solid var(--border-strong); background: rgba(0,0,0,0.28); flex: 1; }
.arc-wrow { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.74rem; }
.arc-wk { color: var(--blue-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-wv { color: var(--text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-wv.hot { color: var(--amber-bright); }
.arc-trace-console {
  padding: 0.5rem 0.65rem; border-radius: 9px; border: 1px solid var(--border-blue); background: rgba(34,211,238,0.05);
  font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.45; color: var(--cyan);
  min-height: 3.2em; overflow: hidden;
}
@media (max-width: 640px) {
  .arc-trace { grid-template-columns: 1fr; }
  .arc-trace-code { max-height: 210px; }
}

/* ---- step rationale (the "why" under each placed step) ---- */
.arc-slot-title { display: block; }
.arc-slot-note { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.35; color: var(--text-faint); }
.arc-solution.locked .arc-slot-note { color: var(--text-dim); }

/* ---- Revit API reference chip under each placed step ---- */
.arc-slot-api {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem;
  margin-top: 5px; padding: 4px 8px; border-radius: 7px;
  border: 1px solid var(--border-blue); background: rgba(78,201,176,0.05);
  font-family: var(--font-mono); font-size: 0.66rem; line-height: 1.3;
}
.arc-slot-api-ns { color: var(--cyan); opacity: 0.85; letter-spacing: 0.02em; }
.arc-slot-api-sig { color: #4ec9b0; word-break: break-word; }
.arc-slot-api-ret { color: var(--amber-bright); margin-left: auto; white-space: nowrap; }
.arc-solution.locked .arc-slot-api { opacity: 0.8; }

/* ---- live "Revit API call" readout in the execution trace ---- */
.arc-trace-api {
  padding: 0.5rem 0.65rem; border-radius: 9px;
  border: 1px solid var(--border-blue); background: rgba(78,201,176,0.06);
  display: flex; flex-direction: column; gap: 0.28rem;
}
.arc-trace-api-h { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.arc-trace-api-sig { font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.35; color: #4ec9b0; word-break: break-word; }
.arc-trace-api-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.64rem; }
.arc-trace-api-ns { color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-trace-api-ret { color: var(--amber-bright); white-space: nowrap; }

/* mini controls */
.arc-controls-btns { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.arc-mini { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); background: transparent; border: 1px solid var(--border-strong); border-radius: var(--r-full); padding: 0.5rem 0.85rem; cursor: pointer; transition: .18s var(--ease); }
.arc-mini:hover:not(:disabled) { border-color: var(--blue-bright); color: var(--text); }
.arc-mini:disabled { opacity: 0.4; cursor: default; }

/* solution pipeline connector + states */
.arc-solution .arc-slot { position: relative; }
.arc-solution .arc-slot:not(:last-child)::after { content: ""; position: absolute; left: 22px; bottom: -0.55rem; width: 2px; height: 0.55rem; background: linear-gradient(var(--border-blue), transparent); }
.arc-solution.locked { pointer-events: none; }
.arc-solution.locked .arc-slot { border-color: var(--border-blue); }
.arc-solution.locked .arc-slot-ctrl { opacity: 0.3; }
.arc-step.hint { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 0 14px rgba(245,158,11,0.5); animation: arcHint .9s var(--ease) 2; }
@keyframes arcHint { 0%,100% { box-shadow: 0 0 0 1px var(--amber), 0 0 12px rgba(245,158,11,0.45); } 50% { box-shadow: 0 0 0 1px var(--amber), 0 0 22px rgba(245,158,11,0.8); } }
.arc-slot.bad, .arc-step.bad { border-color: var(--amber) !important; box-shadow: 0 0 0 1px var(--amber), 0 0 16px rgba(245,158,11,0.6); }

/* code type-in reveal */
.arc-code { min-height: 3em; }

/* focus visibility (a11y) */
.arc-step:focus-visible, .arc-mini:focus-visible, .arc-slot-ctrl button:focus-visible, #arc-run:focus-visible, #arc-begin:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }

/* ============================ "wow" feature pack ============================
   Sound toggle · streak multiplier · keycaps · star ratings · combo callout ·
   personal-best badge · celebration confetti.
   ========================================================================= */

/* confetti overlay */
.arc-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 300; }

/* sound toggle in the HUD */
.arc-sound {
  flex: none; margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-full); border: 1px solid var(--border-strong); background: rgba(0,0,0,0.25);
  color: var(--text-dim); cursor: pointer; transition: .18s var(--ease);
}
.arc-sound:hover { border-color: var(--blue-bright); color: var(--text); }
.arc-sound svg { width: 17px; height: 17px; }
.arc-sound .arc-sound-off { display: block; }
.arc-sound .arc-sound-on { display: none; }
.arc-sound.is-on { color: var(--cyan); border-color: var(--border-blue); }
.arc-sound.is-on .arc-sound-off { display: none; }
.arc-sound.is-on .arc-sound-on { display: block; }

/* streak (combo) indicator */
.arc-hud-streak {
  gap: 0.3rem !important; color: var(--amber-bright);
  padding: 0.15rem 0.55rem; border-radius: var(--r-full);
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4);
  animation: arcStreakPop .4s var(--ease);
}
.arc-hud-streak .arc-flame { font-size: 0.95rem; filter: drop-shadow(0 0 6px rgba(245,158,11,0.6)); animation: arcFlame 1.1s ease-in-out infinite; }
.arc-hud-streak b { color: var(--amber-bright) !important; }
.arc-streak-x { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; color: var(--amber); }
@keyframes arcStreakPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes arcFlame { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1px) scale(1.12); } }

/* keycaps on available steps */
.arc-key {
  flex: none; min-width: 18px; height: 18px; padding: 0 4px; display: inline-grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; color: var(--text-faint);
  background: rgba(0,0,0,0.35); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 5px; line-height: 1;
}
.arc-step:hover .arc-key { color: var(--blue-bright); border-color: var(--border-blue); }

/* personal-best badge on the start screen */
.arc-best {
  display: inline-flex; align-items: center; gap: 0.5rem; margin: 1rem auto 0;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim);
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--r-full); padding: 0.4rem 0.9rem;
}
.arc-best b { color: var(--amber-bright); }
.arc-best-ico { font-size: 1rem; }

/* ---- Career Console (persistent lifetime progression on the start screen) ---- */
.arc-career {
  max-width: 520px; margin: 1.4rem auto 0; text-align: left;
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow); animation: arcFade .4s var(--ease);
}
.arc-career-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.85rem; }
.arc-career-title { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.arc-career-ic { font-size: 0.95rem; }
.arc-daystreak {
  display: inline-flex; align-items: center; gap: 0.3rem; flex: none;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--amber-bright);
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4);
  border-radius: var(--r-full); padding: 0.18rem 0.6rem; animation: arcStreakPop .4s var(--ease);
}
.arc-daystreak.today { color: var(--green); background: rgba(63,185,80,0.12); border-color: rgba(63,185,80,0.4); }
.arc-daystreak b { font-size: 0.9rem; }
.arc-daystreak .arc-flame { filter: drop-shadow(0 0 6px rgba(245,158,11,0.6)); animation: arcFlame 1.1s ease-in-out infinite; }
.arc-daystreak.today .arc-flame { filter: drop-shadow(0 0 6px rgba(63,185,80,0.6)); }
.arc-daystreak-lbl { color: var(--text-faint); }

.arc-career-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; }
.arc-stat {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem; text-align: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.7rem 0.4rem;
}
.arc-stat b { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.arc-stat span { font-size: 0.62rem; letter-spacing: 0.03em; color: var(--text-faint); line-height: 1.2; }

.arc-daily {
  display: flex; align-items: center; gap: 0.7rem; margin-top: 0.75rem;
  background: linear-gradient(100deg, rgba(59,130,246,0.10), rgba(245,158,11,0.08));
  border: 1px solid var(--border-blue); border-radius: var(--r); padding: 0.6rem 0.8rem;
}
.arc-daily-ic { font-size: 1.15rem; flex: none; }
.arc-daily-txt { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.arc-daily-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-bright); }
.arc-daily-title { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-daily-reset { flex: none; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-faint); white-space: nowrap; }

@media (max-width: 480px) {
  .arc-career-grid { grid-template-columns: repeat(2, 1fr); }
  .arc-daily-title { white-space: normal; }
}

/* ---- Hall of Fame — arcade high-score tables on the start screen ---- */
.arc-hof-card {
  max-width: 520px; margin: 1.4rem auto 0; text-align: left;
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow); animation: arcFade .4s var(--ease);
}
.arc-hof-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.arc-hof-title { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.arc-hof-ic { font-size: 1rem; filter: drop-shadow(0 0 8px rgba(245,158,11,0.5)); }
.arc-hof-tabs { display: inline-flex; gap: 0.25rem; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--r-full); padding: 0.2rem; }
.arc-hof-tab {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--text-dim);
  background: transparent; border: 0; border-radius: var(--r-full); padding: 0.28rem 0.75rem; cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.arc-hof-tab:hover { color: var(--text); }
.arc-hof-tab.sel { color: #fff; background: var(--grad-primary); box-shadow: 0 2px 10px rgba(59,130,246,0.35); }

.arc-hof-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.28rem; }
.arc-hof-row {
  display: grid; grid-template-columns: 1.9rem 1fr auto auto; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.6rem; border-radius: var(--r); border: 1px solid transparent;
  background: rgba(255,255,255,0.03); font-family: var(--font-mono);
}
.arc-hof-row.top { background: rgba(245,158,11,0.07); }
.arc-hof-row.is-you { border-color: var(--border-blue); background: rgba(59,130,246,0.12); }
.arc-hof-row.fresh { animation: arcHofPop .7s var(--ease); }
@keyframes arcHofPop {
  0% { transform: scale(.92); box-shadow: 0 0 0 rgba(245,158,11,0); }
  45% { transform: scale(1.035); box-shadow: 0 0 24px rgba(245,158,11,0.55); }
  100% { transform: scale(1); box-shadow: none; }
}
.arc-hof-rank { font-size: 0.9rem; font-weight: 700; color: var(--text-faint); text-align: center; }
.arc-hof-row.top .arc-hof-rank { font-size: 1.05rem; }
.arc-hof-name { font-size: 0.98rem; font-weight: 700; letter-spacing: 0.14em; color: #fff; }
.arc-hof-row.is-you .arc-hof-name { color: var(--blue-bright); }
.arc-hof-meta { font-size: 0.7rem; color: var(--text-faint); white-space: nowrap; }
.arc-hof-pts { font-size: 0.92rem; font-weight: 700; color: var(--amber-bright); text-align: right; min-width: 3.2rem; }
.arc-hof-empty { text-align: center; color: var(--text-faint); font-size: 0.82rem; padding: 0.9rem; font-family: var(--font-mono); }
.arc-hof-foot { font-size: 0.68rem; color: var(--text-faint); font-family: var(--font-mono); margin: 0.75rem 0 0; text-align: center; line-height: 1.5; }

/* ---- Hall of Fame — the "AAA" initials-entry screen ---- */
.arc-hof-entry {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center;
  padding: 1.2rem; background: rgba(4,7,14,0.80); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: arcFade .25s var(--ease);
}
.arc-hof-entry-card {
  width: min(440px, 100%); text-align: center;
  background: var(--grad-surface); border: 1px solid var(--border-blue);
  border-radius: var(--r-lg); padding: clamp(1.4rem, 4vw, 2.2rem);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(59,130,246,0.22);
}
.arc-hof-entry-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.16em; font-weight: 700;
  color: #0a0e17; background: var(--grad-accent); border-radius: var(--r-full); padding: 0.34rem 0.95rem;
  box-shadow: 0 0 22px rgba(245,158,11,0.5); animation: arcHofBadge 1.4s ease-in-out infinite;
}
@keyframes arcHofBadge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.arc-hof-entry-sub { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); margin: 0.9rem 0 0.1rem; letter-spacing: 0.05em; }
.arc-hof-entry-score {
  font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1; margin: 0.1rem 0 0.2rem;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.arc-hof-entry-hint { font-size: 0.82rem; color: var(--text-dim); margin: 0.55rem 0 0.85rem; }
.arc-hof-cells { display: flex; justify-content: center; gap: 0.7rem; margin: 0 0 1.2rem; }
.arc-hof-cell { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.arc-hof-arrow {
  width: 2.6rem; height: 1.5rem; display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-dim); font-size: 0.7rem;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.arc-hof-arrow:hover { background: rgba(255,255,255,0.10); color: #fff; border-color: var(--border-strong); }
.arc-hof-char {
  width: 2.6rem; height: 3.2rem; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.30); border: 1px solid var(--border); border-radius: var(--r);
}
.arc-hof-cell.active .arc-hof-char {
  color: var(--blue-bright);
  box-shadow: 0 0 0 1px var(--blue-bright), 0 0 20px rgba(59,130,246,0.45);
  animation: arcHofCaret 1s steps(1) infinite;
}
@keyframes arcHofCaret { 0%,100% { border-color: var(--blue-bright); } 50% { border-color: rgba(255,255,255,0.12); } }
.arc-hof-cell.active .arc-hof-arrow { color: var(--blue-bright); border-color: var(--border-blue); }
.arc-hof-entry-tip { font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-faint); margin: 0.9rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  .arc-hof-card, .arc-hof-entry { animation: none !important; }
  .arc-hof-row.fresh, .arc-hof-entry-badge, .arc-hof-cell.active .arc-hof-char { animation: none !important; }
  .arc-hof-tab, .arc-hof-arrow { transition: none !important; }
}

/* star ratings in the success overlay */
.arc-stars { display: flex; justify-content: center; gap: 0.35rem; margin: 0 0 0.6rem; font-size: 2rem; line-height: 1; }
.arc-star { color: rgba(255,255,255,0.14); transform: scale(.8); transition: color .25s var(--ease), transform .35s var(--ease), text-shadow .25s; }
.arc-star.on { color: var(--amber-bright); transform: scale(1); text-shadow: 0 0 14px rgba(245,158,11,0.7); animation: arcStarPop .45s var(--ease); }
@keyframes arcStarPop { 0% { transform: scale(.3) rotate(-25deg); } 60% { transform: scale(1.3) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }

/* combo bonus callout */
.arc-combo {
  display: inline-block; margin: 0 0 0.8rem; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  color: var(--amber-bright); background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.4);
  border-radius: var(--r-full); padding: 0.3rem 0.85rem; animation: arcStreakPop .4s var(--ease);
}

/* new-best banner + end-screen stars */
.arc-newbest {
  display: inline-block; margin: 0.4rem 0 0.6rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em;
  color: #0a0e17; background: var(--grad-accent); border-radius: var(--r-full); padding: 0.35rem 0.95rem; font-weight: 700;
  box-shadow: 0 0 22px rgba(245,158,11,0.5); animation: arcStreakPop .5s var(--ease);
}
.arc-endstars { margin: 0.2rem 0 0.4rem; font-size: 1.15rem; color: var(--amber-bright); }
.arc-endstars-n { letter-spacing: 0.15em; text-shadow: 0 0 12px rgba(245,158,11,0.6); }
.arc-endstars-d { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-dim); margin-left: 0.4rem; }
.arc-endstars-d b { color: #fff; }

/* keep the sound button reachable on small HUDs */
@media (max-width: 680px) {
  .arc-sound { margin-left: 0; }
  .arc-hud { justify-content: space-between; }
}

/* ============================ "incredible" pack ============================
   Per-level best time · achievement badges + toasts · drag-to-reorder.
   ========================================================================= */

/* best-time chip in the HUD */
.arc-hud-best { gap: 0.3rem !important; color: var(--amber-bright); }
.arc-hud-best b { color: var(--amber-bright) !important; }
.arc-hud-best-ic { filter: drop-shadow(0 0 5px rgba(245,158,11,0.55)); }

/* ---- drag-to-reorder ---- */
.arc-slot { cursor: grab; user-select: none; }
.arc-slot:active { cursor: grabbing; }
.arc-slot-grip {
  flex: none; width: 12px; align-self: stretch; margin: -0.2rem 0; border-radius: 4px;
  background-image: radial-gradient(currentColor 1.1px, transparent 1.2px);
  background-size: 5px 5px; background-position: center; color: var(--text-faint); opacity: 0.45;
  transition: opacity .15s var(--ease);
}
.arc-slot:hover .arc-slot-grip { opacity: 0.8; color: var(--blue-bright); }
.arc-slot-ctrl button { cursor: pointer; }
.arc-slot.arc-dragging {
  cursor: grabbing; position: relative; z-index: 5; opacity: 0.96;
  border-color: var(--blue-bright); box-shadow: 0 12px 28px rgba(0,0,0,0.45), 0 0 0 1px var(--blue-bright);
  transition: none;
}
.arc-dragging-active { cursor: grabbing; }
.arc-dragging-active .arc-slot:not(.arc-dragging) { transition: transform .16s var(--ease); }
/* drop indicator line */
.arc-slot.drop-before::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: -6px; height: 3px; border-radius: 3px;
  background: var(--grad-accent); box-shadow: 0 0 10px rgba(245,158,11,0.7);
}
.arc-solution.drop-end::after {
  content: ""; display: block; height: 3px; margin: 0.2rem 6px 0; border-radius: 3px;
  background: var(--grad-accent); box-shadow: 0 0 10px rgba(245,158,11,0.7);
}
body.arc-noselect { user-select: none; -webkit-user-select: none; }

/* ---- achievement toasts ---- */
.arc-toasts {
  position: fixed; top: 1rem; right: 1rem; z-index: 400; display: flex; flex-direction: column;
  gap: 0.6rem; pointer-events: none; max-width: min(340px, calc(100vw - 2rem));
}
.arc-toast {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem;
  background: linear-gradient(135deg, rgba(20,27,45,0.97), rgba(13,20,36,0.97));
  border: 1px solid var(--border-blue); border-left: 3px solid var(--amber-bright);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  transform: translateX(120%); opacity: 0; transition: transform .42s var(--ease), opacity .42s var(--ease);
}
.arc-toast.in { transform: none; opacity: 1; }
.arc-toast.out { transform: translateX(120%); opacity: 0; }
.arc-toast-ico {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.35rem;
  background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.4);
  filter: drop-shadow(0 0 8px rgba(245,158,11,0.35));
}
.arc-toast-body { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.arc-toast-kicker { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-bright); }
.arc-toast-title { font-weight: 700; color: #fff; font-size: 0.98rem; }
.arc-toast-desc { font-size: 0.78rem; color: var(--text-dim); line-height: 1.35; }

/* ---- achievement showcase on the end screen ---- */
.arc-ach-wrap {
  text-align: left; background: var(--grad-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.1rem 1.2rem 1.2rem; margin: 0 auto 1.4rem; max-width: 480px;
}
.arc-ach-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.8rem; }
.arc-ach-head span:first-child { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }
.arc-ach-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--amber-bright); }
.arc-ach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.arc-badge {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center;
  padding: 0.7rem 0.4rem; border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(0,0,0,0.22); transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.arc-badge-ico { font-size: 1.6rem; line-height: 1; }
.arc-badge-name { font-size: 0.68rem; color: var(--text-dim); line-height: 1.2; }
.arc-badge.earned { border-color: rgba(245,158,11,0.42); background: rgba(245,158,11,0.08); }
.arc-badge.earned .arc-badge-name { color: var(--text); }
.arc-badge.locked { opacity: 0.5; }
.arc-badge.locked .arc-badge-ico { filter: grayscale(1); opacity: 0.6; }
.arc-badge.fresh { border-color: var(--amber-bright); box-shadow: 0 0 18px rgba(245,158,11,0.4); animation: arcBadgePop .55s var(--ease); }
@keyframes arcBadgePop { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.18) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }

@media (max-width: 680px) {
  .arc-toasts { top: auto; bottom: 1rem; right: 0.75rem; left: 0.75rem; max-width: none; }
  .arc-toast { transform: translateY(140%); }
  .arc-toast.in { transform: none; }
  .arc-toast.out { transform: translateY(140%); }
}

/* ============================ "Arcade Pro" pack ============================
   Automator level + XP bar · playable Daily Build (clickable card + HUD chip).
   ========================================================================= */

/* ---- Automator level bar (career console) ---- */
.arc-levelbar {
  display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.75rem;
  padding: 0.6rem 0.7rem; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--r);
}
.arc-lvl-badge {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  gap: 0; line-height: 1; color: #0a0e17; background: var(--grad-accent);
  box-shadow: 0 0 16px rgba(245,158,11,0.35);
}
.arc-lvl-badge-k { font-family: var(--font-mono); font-size: 0.5rem; letter-spacing: 0.14em; font-weight: 700; opacity: 0.75; }
.arc-lvl-badge b { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800; }
.arc-lvl-info { flex: 1; min-width: 0; }
.arc-lvl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.arc-lvl-title { font-family: var(--font-mono); font-size: 0.83rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-lvl-xp { flex: none; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-faint); white-space: nowrap; }
.arc-lvl-track { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.arc-lvl-track i { display: block; height: 100%; width: 4%; border-radius: 4px; background: var(--grad-primary); box-shadow: 0 0 10px rgba(59,130,246,0.5); transition: width .8s var(--ease); }

/* ---- playable Daily Build card ---- */
.arc-daily { cursor: pointer; transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease); }
.arc-daily:hover { border-color: var(--blue-bright); transform: translateY(-1px); box-shadow: var(--shadow); }
.arc-daily:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.arc-daily-sub { font-family: var(--font-mono); font-size: 0.64rem; color: var(--amber-bright); margin-top: 0.18rem; line-height: 1.3; }
.arc-daily-sub.solved { color: var(--green); }
.arc-daily-play {
  flex: none; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; background: var(--grad-primary); border: none; border-radius: var(--r-full);
  padding: 0.42rem 0.9rem; cursor: pointer; transition: filter .15s var(--ease), transform .15s var(--ease);
  box-shadow: 0 2px 10px rgba(59,130,246,0.35);
}
.arc-daily-play:hover { filter: brightness(1.08); transform: translateY(-1px); }
.arc-daily-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- Daily Build chip in the HUD ---- */
.arc-hud-daily {
  gap: 0.35rem !important; color: var(--amber-bright);
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4);
  border-radius: var(--r-full); padding: 0.15rem 0.65rem;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
}
.arc-hud-daily-ic { font-size: 0.9rem; }

@media (max-width: 480px) {
  .arc-daily { flex-wrap: wrap; }
  .arc-daily-play { width: 100%; margin-top: 0.4rem; }
}

/* ============================ "Arcade Legend" pack ========================
   Mission Map (level select w/ best stars + times) · Automator rank-up moment ·
   copy-the-C# button. All additive, localStorage-backed, no backend.
   ========================================================================= */

/* ---- Mission Map ---- */
.arc-map { margin-top: 0.85rem; }
.arc-map-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem; }
.arc-map-title { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); display: inline-flex; align-items: center; gap: 0.35rem; }
.arc-map-note { font-family: var(--font-mono); font-size: 0.66rem; color: var(--amber-bright); text-align: right; }
.arc-map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.arc-map-cell {
  display: flex; flex-direction: column; gap: 0.3rem; text-align: left; cursor: pointer;
  padding: 0.55rem 0.6rem 0.5rem; border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(0,0,0,0.22); color: var(--text); font: inherit;
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.arc-map-cell:hover { transform: translateY(-2px); border-color: var(--blue-bright); box-shadow: var(--shadow); background: rgba(59,130,246,0.08); }
.arc-map-cell:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.arc-map-top { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.arc-map-num { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 800; color: #fff; }
.arc-map-top .crown { width: 0.9em; height: 0.9em; }
.arc-map-crown { font-size: 0.9rem; line-height: 1; filter: drop-shadow(0 0 6px rgba(245,158,11,0.5)); }
.arc-map-name { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-map-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; margin-top: 0.1rem; }
.arc-map-stars { font-size: 0.72rem; letter-spacing: 0.04em; color: var(--amber-bright); }
.arc-map-time { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-faint); white-space: nowrap; }
.arc-map-time.new { color: var(--blue-bright); font-weight: 700; }
.arc-map-cell.played { border-color: rgba(96,165,250,0.28); }
.arc-map-cell.mastered { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.07); }
.arc-map-cell.mastered:hover { border-color: var(--amber-bright); background: rgba(245,158,11,0.12); }
.arc-map-cell.locked { opacity: 0.82; }
.arc-map-cell.locked .arc-map-name { color: var(--text-faint); }

/* ---- Automator rank-up banner (success overlay) + toast variant ---- */
.arc-rankup {
  display: flex; align-items: center; gap: 0.6rem; margin: 0 auto 0.9rem; max-width: 340px;
  padding: 0.5rem 0.75rem; border-radius: 12px;
  background: linear-gradient(135deg, rgba(245,158,11,0.16), rgba(59,130,246,0.14));
  border: 1px solid rgba(245,158,11,0.5); box-shadow: 0 0 22px rgba(245,158,11,0.28);
  animation: arcRankPop .6s var(--ease);
}
@keyframes arcRankPop { 0% { transform: scale(.6) translateY(8px); opacity: 0; } 55% { transform: scale(1.06); } 100% { transform: scale(1) translateY(0); opacity: 1; } }
.arc-rankup-ic { font-size: 1.5rem; line-height: 1; filter: drop-shadow(0 0 8px rgba(245,158,11,0.5)); }
.arc-rankup-txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; min-width: 0; }
.arc-rankup-txt b { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 800; color: #fff; }
.arc-rankup-title { font-size: 0.74rem; color: var(--amber-bright); }
.arc-rankup-tag {
  margin-left: auto; flex: none; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.12em; color: #0a0e17; background: var(--grad-accent); border-radius: var(--r-full);
  padding: 0.2rem 0.55rem;
}
.arc-toast-rankup { border-left-color: #60A5FA; }
.arc-toast-rankup .arc-toast-kicker { color: var(--blue-bright); }
.arc-toast-rankup .arc-toast-ico { background: rgba(59,130,246,0.16); border-color: rgba(96,165,250,0.45); filter: drop-shadow(0 0 8px rgba(59,130,246,0.4)); }

/* ---- copy-the-C# button (code header) ---- */
.arc-code-copy {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.32rem; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; color: #cfcfcf;
  background: #232323; border: 1px solid #3a3a3a; border-radius: 7px; padding: 0.24rem 0.55rem;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.arc-code-copy svg { width: 13px; height: 13px; }
.arc-code-copy:hover { background: #2d2d2d; color: #fff; border-color: #4a4a4a; }
.arc-code-copy:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.arc-code-copy.copied { color: #7ee787; border-color: rgba(63,185,80,0.55); background: rgba(63,185,80,0.14); }
.arc-code-copy.failed { color: var(--amber-bright); border-color: rgba(245,158,11,0.5); }

@media (max-width: 480px) {
  .arc-map-grid { grid-template-columns: repeat(2, 1fr); }
  .arc-rankup-tag { display: none; }
}

/* ============================ "Grand Prix" pack ============================
   Time medals (gold/silver/bronze) scaled to level complexity · a live
   medal-pace chip that slides gold→silver→bronze as the clock ticks · medal
   reveal on the win screen · a trophy shelf in the career console · medals on
   the mission map. A pure-speed layer atop the star (accuracy) rating —
   additive, localStorage-backed, no backend.
   ========================================================================= */

/* live medal-pace chip in the HUD */
.arc-hud-pace { gap: 0.3rem !important; border-radius: var(--r-full); padding: 0.15rem 0.55rem; border: 1px solid transparent; transition: color .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease); }
.arc-hud-pace .arc-pace-ico { font-size: 0.9rem; }
.arc-hud-pace b { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; }
.arc-hud-pace.pace-gold { color: var(--amber-bright); background: rgba(245,158,11,0.14); border-color: rgba(245,158,11,0.42); }
.arc-hud-pace.pace-gold b { color: var(--amber-bright) !important; }
.arc-hud-pace.pace-gold .arc-pace-ico { filter: drop-shadow(0 0 6px rgba(245,158,11,0.6)); }
.arc-hud-pace.pace-silver { color: #cbd6e6; background: rgba(203,214,230,0.10); border-color: rgba(203,214,230,0.30); }
.arc-hud-pace.pace-silver b { color: #e6edf6 !important; }
.arc-hud-pace.pace-bronze { color: #d99a63; background: rgba(208,138,82,0.13); border-color: rgba(208,138,82,0.38); }
.arc-hud-pace.pace-bronze b { color: #e6a870 !important; }
.arc-hud-pace.pace-finish { color: var(--text-faint); background: rgba(255,255,255,0.04); border-color: var(--border-strong); }
.arc-hud-pace.pace-finish b { color: var(--text-dim) !important; }

/* medal reveal in the success overlay */
.arc-medal { display: inline-flex; align-items: center; gap: 0.55rem; margin: 0 auto 0.9rem; padding: 0.4rem 0.7rem 0.4rem 0.5rem; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: rgba(255,255,255,0.03); animation: arcMedalPop .5s var(--ease); }
.arc-medal-ico { font-size: 1.55rem; line-height: 1; }
.arc-medal-txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.arc-medal-txt b { font-family: var(--font-mono); font-size: 0.9rem; color: #fff; }
.arc-medal-txt span { font-size: 0.68rem; color: var(--text-dim); }
.arc-medal-new { flex: none; font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em; color: #0a0e17; background: var(--grad-accent); border-radius: var(--r-full); padding: 0.16rem 0.45rem; }
.arc-medal.medal-gold { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.10); box-shadow: 0 0 22px rgba(245,158,11,0.28); }
.arc-medal.medal-gold .arc-medal-ico { filter: drop-shadow(0 0 8px rgba(245,158,11,0.6)); }
.arc-medal.medal-silver { border-color: rgba(203,214,230,0.4); background: rgba(203,214,230,0.07); }
.arc-medal.medal-bronze { border-color: rgba(208,138,82,0.42); background: rgba(208,138,82,0.09); }
.arc-medal.medal-finish { border-style: dashed; }
.arc-medal.medal-finish .arc-medal-txt b { color: var(--text-dim); }
@keyframes arcMedalPop { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.18) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }

/* trophy shelf in the career console */
.arc-medalshelf { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.75rem; padding: 0.5rem 0.8rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--r); }
.arc-medalshelf-lbl { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); display: inline-flex; align-items: center; gap: 0.35rem; }
.arc-medalshelf-tally { display: inline-flex; align-items: center; gap: 0.75rem; }
.arc-medalshelf .ms { font-family: var(--font-mono); font-size: 0.84rem; color: var(--text-dim); }
.arc-medalshelf .ms b { color: #fff; font-weight: 700; }
.arc-medalshelf .ms-g b { color: var(--amber-bright); }

/* medals on the mission map */
.arc-map-medal { font-size: 0.92rem; line-height: 1; filter: drop-shadow(0 0 5px rgba(245,158,11,0.4)); }
.arc-map-cell.gold { border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.08); }
.arc-map-cell.gold:hover { border-color: var(--amber-bright); background: rgba(245,158,11,0.13); }

@media (max-width: 480px) {
  .arc-medalshelf { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
}

/* ============================ BLITZ MODE ============================ */

/* start-screen launcher card */
.arc-blitzcard {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.9rem; text-align: left;
  margin: 1.1rem 0 0.2rem; padding: 0.95rem 1.05rem;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(251,113,133,0.10) 55%, rgba(59,130,246,0.10));
  border: 1px solid rgba(245,158,11,0.42); border-radius: var(--r-lg);
  cursor: pointer; transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.arc-blitzcard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: radial-gradient(70% 120% at 0% 0%, rgba(245,158,11,0.18), transparent 60%);
}
.arc-blitzcard:hover { transform: translateY(-2px); border-color: var(--amber-bright); box-shadow: 0 12px 34px rgba(245,158,11,0.20); }
.arc-blitzcard:focus-visible { outline: 2px solid var(--amber-bright); outline-offset: 3px; }
.arc-blitzcard-bolt {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.55rem; background: var(--grad-accent); box-shadow: 0 6px 20px rgba(251,113,133,0.35);
  animation: arcBoltPulse 1.9s ease-in-out infinite;
}
@keyframes arcBoltPulse { 0%,100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.08); filter: brightness(1.18); } }
.arc-blitzcard-txt { position: relative; display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; flex: 1; }
.arc-blitzcard-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-bright); }
.arc-blitzcard-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700; font-size: 1.15rem; color: #fff; line-height: 1.1; }
.arc-blitzcard-sub { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.arc-blitzcard-best { font-family: var(--font-mono); font-size: 0.68rem; color: var(--amber-bright); margin-top: 0.15rem; }
.arc-blitzcard-best b { color: #fff; }
.arc-blitz-play {
  position: relative; flex: none; align-self: center; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #1a1204;
  background: var(--grad-accent); border: none; border-radius: var(--r-full);
  padding: 0.55rem 1.05rem; cursor: pointer; transition: transform .16s var(--ease), filter .16s var(--ease);
}
.arc-blitz-play:hover { transform: translateY(-1px); filter: brightness(1.08); }
.arc-blitz-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 520px) {
  .arc-blitzcard { flex-wrap: wrap; }
  .arc-blitz-play { width: 100%; }
}

/* Blitz HUD — big clock, combo, ships */
.arc-hud--blitz { border-color: rgba(245,158,11,0.45); box-shadow: inset 3px 0 0 var(--amber); }
.arc-hud-blitz { gap: 0.85rem !important; }
.arc-blitz-clock {
  position: relative; display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); border-radius: var(--r-full); padding: 0.12rem 0.6rem;
  color: var(--amber-bright); background: rgba(245,158,11,0.13); border: 1px solid rgba(245,158,11,0.4);
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.arc-blitz-clock-ic { font-size: 0.9rem; }
.arc-blitz-clock b { font-size: 1.02rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.arc-blitz-clock.low { color: var(--amber-bright); background: rgba(245,158,11,0.2); border-color: rgba(245,158,11,0.55); }
.arc-blitz-clock.urgent {
  color: var(--red); background: rgba(255,107,107,0.16); border-color: rgba(255,107,107,0.6);
  animation: arcBlitzUrgent 0.85s ease-in-out infinite;
}
.arc-blitz-clock.urgent b { color: var(--red); }
@keyframes arcBlitzUrgent { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,107,107,0.35); } 50% { transform: scale(1.05); box-shadow: 0 0 14px 2px rgba(255,107,107,0.45); } }
.arc-blitz-bonus {
  position: absolute; left: 50%; top: -0.4rem; transform: translate(-50%, 0); opacity: 0; pointer-events: none;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--green); white-space: nowrap;
}
.arc-blitz-bonus.show { animation: arcBonusFloat 0.9s var(--ease) forwards; }
.arc-blitz-bonus.danger { color: var(--red); }
@keyframes arcBonusFloat { 0% { opacity: 0; transform: translate(-50%, 4px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -22px); } }
.arc-blitz-combo {
  display: inline-flex; align-items: baseline; gap: 0.1rem; font-family: var(--font-mono); font-size: 0.82rem; color: var(--amber-bright);
  padding: 0.1rem 0.45rem; border-radius: var(--r-full); background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.4);
  animation: arcComboPop 0.3s var(--ease);
}
.arc-blitz-combo b { font-size: 0.98rem; font-weight: 700; color: #fff; }
@keyframes arcComboPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.arc-blitz-cleared { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.88rem; color: var(--text-dim); }
.arc-blitz-cleared b { color: #fff; font-weight: 700; }

/* Blitz results overlay */
.arc-blitzend {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.2rem; background: rgba(4,7,14,0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: arcFade .3s var(--ease);
}
.arc-blitzend-card {
  width: min(500px, 96vw); max-height: 92vh; overflow-y: auto; text-align: center;
  background: var(--grad-surface); border: 1px solid rgba(245,158,11,0.45); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.2rem); box-shadow: var(--shadow-lg);
}
.arc-blitzend-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--amber-bright); background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.42);
  border-radius: var(--r-full); padding: 0.3rem 0.85rem; margin-bottom: 1rem;
}
.arc-blitzend-newbest {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; color: #1a1204;
  background: var(--grad-accent); border-radius: var(--r-full); padding: 0.28rem 0.85rem; margin-bottom: 0.9rem;
  animation: arcPop .4s var(--ease);
}
.arc-blitzend-score {
  font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 800; font-size: clamp(3.2rem, 12vw, 4.6rem);
  line-height: 1; background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--amber-bright);
}
.arc-blitzend-scorelbl { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); margin-bottom: 1.3rem; }
.arc-blitzend-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-bottom: 1.2rem; }
.arc-blitzend-stat {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--r); padding: 0.7rem 0.4rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.arc-blitzend-stat b { font-size: 1.35rem; color: #fff; font-weight: 700; }
.arc-blitzend-stat span { font-size: 0.66rem; color: var(--text-faint); letter-spacing: 0.02em; }
.arc-blitzend-line { color: var(--text-dim); line-height: 1.6; margin: 0 0 1.3rem; }
.arc-blitzend-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.arc-blitzend-actions .btn { flex: 1; min-width: 130px; }

/* =====================================================================
   GHOST RACER — live race-your-best HUD chip + success-overlay verdict.
   ===================================================================== */
.arc-hud-ghost {
  gap: 0.32rem !important; border-radius: var(--r-full); padding: 0.15rem 0.55rem;
  border: 1px solid transparent;
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.arc-hud-ghost .arc-ghost-ico { font-size: 0.92rem; }
.arc-hud-ghost b { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; }
.arc-hud-ghost .arc-ghost-delta { font-family: var(--font-mono); font-size: 0.66rem; opacity: 0.95; }
.arc-hud-ghost.ghost-ahead { color: var(--green); background: rgba(63,185,80,0.13); border-color: rgba(63,185,80,0.4); }
.arc-hud-ghost.ghost-ahead b { color: var(--green) !important; }
.arc-hud-ghost.ghost-ahead .arc-ghost-ico { filter: drop-shadow(0 0 6px rgba(63,185,80,0.55)); }
.arc-hud-ghost.ghost-behind { color: #fb7185; background: rgba(251,113,133,0.13); border-color: rgba(251,113,133,0.42); animation: arcGhostFlip .4s var(--ease); }
.arc-hud-ghost.ghost-behind b { color: #fb7185 !important; }
@keyframes arcGhostFlip { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* head-to-head verdict banner on the success overlay */
.arc-ghost-result {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0 auto 0.85rem;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  border-radius: var(--r-full); padding: 0.35rem 0.9rem; border: 1px solid transparent;
  animation: arcStreakPop .4s var(--ease);
}
.arc-ghost-result .arc-ghr-ic { font-size: 1rem; }
.arc-ghost-result b { color: #fff; }
.arc-ghost-result.win { color: var(--green); background: rgba(63,185,80,0.14); border-color: rgba(63,185,80,0.42); }
.arc-ghost-result.tie { color: var(--cyan); background: rgba(34,211,238,0.12); border-color: rgba(34,211,238,0.38); }
.arc-ghost-result.lose { color: var(--text-dim); background: rgba(255,255,255,0.04); border-color: var(--border-strong); }

/* Challenge-a-friend button on the success overlay */
.arc-challenge-btn {
  display: block; width: 100%; margin: 0 0 0.7rem;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--blue-bright);
  background: rgba(59,130,246,0.10); border: 1px dashed var(--border-blue); border-radius: var(--r);
  padding: 0.6rem 0.9rem; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease), color .16s var(--ease);
}
.arc-challenge-btn:hover { background: rgba(59,130,246,0.16); border-color: var(--blue-bright); transform: translateY(-1px); }
.arc-challenge-btn:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.arc-challenge-btn.copied { color: var(--green); background: rgba(63,185,80,0.14); border-style: solid; border-color: rgba(63,185,80,0.5); }
.arc-challenge-btn.failed { color: var(--amber-bright); border-color: rgba(245,158,11,0.5); }

/* =====================================================================
   INCOMING CHALLENGE — start-screen banner shown for a shared #c= link.
   ===================================================================== */
.arc-challengecard {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.9rem; text-align: left;
  margin: 0 0 1.3rem; padding: 0.95rem 1.05rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.14), rgba(34,211,238,0.10) 55%, rgba(63,185,80,0.10));
  border: 1px solid var(--border-blue); border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(59,130,246,0.14); animation: arcStreakPop .45s var(--ease);
}
.arc-challengecard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: radial-gradient(70% 120% at 0% 0%, rgba(34,211,238,0.16), transparent 60%);
}
.arc-challengecard-flag {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.55rem; background: linear-gradient(135deg, #3B82F6, #22D3EE);
  box-shadow: 0 6px 20px rgba(34,211,238,0.32); animation: arcBoltPulse 1.9s ease-in-out infinite;
}
.arc-challengecard-txt { position: relative; display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; flex: 1; }
.arc-challengecard-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.arc-challengecard-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700; font-size: 1.15rem; color: #fff; line-height: 1.1; }
.arc-challengecard-sub { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.arc-challengecard-play {
  position: relative; flex: none; align-self: center; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #04121a;
  background: linear-gradient(135deg, #3B82F6, #22D3EE); border: none; border-radius: var(--r-full);
  padding: 0.55rem 1.1rem; cursor: pointer; transition: transform .16s var(--ease), filter .16s var(--ease);
}
.arc-challengecard-play:hover { transform: translateY(-1px); filter: brightness(1.08); }
.arc-challengecard-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 520px) {
  .arc-challengecard { flex-wrap: wrap; }
  .arc-challengecard-play { width: 100%; }
}

/* =====================================================================
   SPEEDRUN — the "Gauntlet". Clear every level back-to-back on one clock,
   racing the pace of your own best run. Live pace chip, per-level splits,
   sum-of-best golden splits, and a shareable record. Violet identity so it
   reads instantly apart from Blitz's amber.
   ===================================================================== */

/* start-screen launcher card */
.arc-srcard {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.9rem; text-align: left;
  margin: 0.75rem 0 0.2rem; padding: 0.95rem 1.05rem;
  background: linear-gradient(135deg, rgba(167,139,250,0.14), rgba(59,130,246,0.10) 55%, rgba(34,211,238,0.10));
  border: 1px solid rgba(167,139,250,0.42); border-radius: var(--r-lg);
  cursor: pointer; transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.arc-srcard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background: radial-gradient(70% 120% at 0% 0%, rgba(167,139,250,0.20), transparent 60%);
}
.arc-srcard:hover { transform: translateY(-2px); border-color: var(--purple); box-shadow: 0 12px 34px rgba(167,139,250,0.22); }
.arc-srcard:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.arc-srcard-bolt {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: linear-gradient(135deg, #A78BFA, #22D3EE); box-shadow: 0 6px 20px rgba(167,139,250,0.38);
  animation: arcBoltPulse 2.1s ease-in-out infinite;
}
.arc-srcard-txt { position: relative; display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; flex: 1; }
.arc-srcard-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--purple); }
.arc-srcard-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700; font-size: 1.15rem; color: #fff; line-height: 1.1; }
.arc-srcard-sub { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.arc-srcard-best { font-family: var(--font-mono); font-size: 0.68rem; color: var(--purple); margin-top: 0.15rem; }
.arc-srcard-best b { color: #fff; }
.arc-sr-play {
  position: relative; flex: none; align-self: center; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #120a26;
  background: linear-gradient(135deg, #A78BFA, #22D3EE); border: none; border-radius: var(--r-full);
  padding: 0.55rem 1.05rem; cursor: pointer; transition: transform .16s var(--ease), filter .16s var(--ease);
}
.arc-sr-play:hover { transform: translateY(-1px); filter: brightness(1.08); }
.arc-sr-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 520px) {
  .arc-srcard { flex-wrap: wrap; }
  .arc-sr-play { width: 100%; }
}

/* ============================ "Debug Mode" pack ==========================
   A shipped plugin comes back broken with one hidden fault. Find + fix it.
   Emerald accent to set it apart from Blitz (amber) and Speedrun (purple).
   Reuses the whole level engine; additive over the classic flow.
   ========================================================================= */
.arc-dbgcard {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.9rem; text-align: left;
  margin: 0.75rem 0 0.2rem; padding: 0.95rem 1.05rem;
  background: linear-gradient(135deg, rgba(63,185,80,0.15), rgba(34,211,238,0.09) 60%, rgba(59,130,246,0.09));
  border: 1px solid rgba(63,185,80,0.42); border-radius: var(--r-lg);
  cursor: pointer; transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.arc-dbgcard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background: radial-gradient(70% 120% at 0% 0%, rgba(63,185,80,0.20), transparent 60%);
}
.arc-dbgcard:hover { transform: translateY(-2px); border-color: var(--green); box-shadow: 0 12px 34px rgba(63,185,80,0.22); }
.arc-dbgcard:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.arc-dbgcard-bug {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: linear-gradient(135deg, #3FB950, #22D3EE); box-shadow: 0 6px 20px rgba(63,185,80,0.38);
  animation: arcBugWobble 2.4s ease-in-out infinite;
}
@keyframes arcBugWobble { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.arc-dbgcard-txt { position: relative; display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; flex: 1; }
.arc-dbgcard-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); }
.arc-dbgcard-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700; font-size: 1.15rem; color: #fff; line-height: 1.1; }
.arc-dbgcard-sub { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.arc-dbgcard-best { font-family: var(--font-mono); font-size: 0.68rem; color: var(--green); margin-top: 0.15rem; }
.arc-dbgcard-best b { color: #fff; }
.arc-dbg-play {
  position: relative; flex: none; align-self: center; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #06210d;
  background: linear-gradient(135deg, #3FB950, #22D3EE); border: none; border-radius: var(--r-full);
  padding: 0.55rem 1.05rem; cursor: pointer; transition: transform .16s var(--ease), filter .16s var(--ease);
}
.arc-dbg-play:hover { transform: translateY(-1px); filter: brightness(1.08); }
.arc-dbg-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 520px) {
  .arc-dbgcard { flex-wrap: wrap; }
  .arc-dbg-play { width: 100%; }
}

/* ---- Debug chip in the HUD ---- */
.arc-hud-debug {
  gap: 0.35rem !important; color: var(--green);
  background: rgba(63,185,80,0.12); border: 1px solid rgba(63,185,80,0.4);
  border-radius: var(--r-full); padding: 0.15rem 0.65rem;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
}
.arc-hud-debug-ic { font-size: 0.9rem; }

/* ---- "broken plugin" banner above the board ---- */
.arc-bugbanner {
  display: flex; align-items: flex-start; gap: 0.6rem; margin: 0.7rem 0 0;
  padding: 0.7rem 0.9rem; border-radius: var(--r-md, 12px);
  background: linear-gradient(135deg, rgba(255,107,107,0.12), rgba(63,185,80,0.08));
  border: 1px solid rgba(255,107,107,0.38);
}
.arc-bugbanner-ic { flex: none; font-size: 1.15rem; line-height: 1.3; animation: arcBugWobble 2.4s ease-in-out infinite; }
.arc-bugbanner-txt { font-size: 0.84rem; color: var(--text); line-height: 1.5; }
.arc-bugbanner-txt b { color: #fff; }

/* HUD pace chip — running total + live delta vs your best-run pace */
.arc-hud-sr {
  gap: 0.32rem !important; border-radius: var(--r-full); padding: 0.15rem 0.6rem;
  color: var(--purple); background: rgba(167,139,250,0.13); border: 1px solid rgba(167,139,250,0.4);
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.arc-hud-sr .arc-sr-ico { font-size: 0.9rem; }
.arc-hud-sr b { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.arc-hud-sr .arc-sr-delta { font-family: var(--font-mono); font-size: 0.66rem; opacity: 0.95; }
.arc-hud-sr.sr-ahead { color: var(--green); background: rgba(63,185,80,0.13); border-color: rgba(63,185,80,0.4); }
.arc-hud-sr.sr-ahead .arc-sr-delta { color: var(--green); }
.arc-hud-sr.sr-behind { color: #fb7185; background: rgba(251,113,133,0.13); border-color: rgba(251,113,133,0.42); }
.arc-hud-sr.sr-behind .arc-sr-delta { color: #fb7185; }

/* split banner on the success overlay */
.arc-split {
  display: inline-flex; align-items: center; gap: 0.7rem; margin: 0 auto 0.85rem; flex-wrap: wrap; justify-content: center;
  font-family: var(--font-mono); border-radius: var(--r-full); padding: 0.4rem 0.95rem;
  border: 1px solid rgba(167,139,250,0.4); background: rgba(167,139,250,0.10);
  animation: arcStreakPop .4s var(--ease);
}
.arc-split-ic { font-size: 1.05rem; }
.arc-split-txt { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.arc-split-txt b { font-size: 1.05rem; color: #fff; font-weight: 700; }
.arc-split-txt span { font-size: 0.7rem; color: var(--purple); }
.arc-split-total { font-size: 0.72rem; color: var(--text-dim); }
.arc-split-total b { color: #fff; }
.arc-split.win { border-color: rgba(63,185,80,0.45); background: rgba(63,185,80,0.12); }
.arc-split.win .arc-split-txt span { color: var(--green); }
.arc-split.gold { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.12); box-shadow: 0 0 20px rgba(245,158,11,0.22); }
.arc-split.gold .arc-split-txt span { color: var(--amber-bright); }
.arc-split.lose .arc-split-txt span { color: #fb7185; }

/* speedrun results overlay */
.arc-srend {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.2rem; background: rgba(4,7,14,0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: arcFade .3s var(--ease);
}
.arc-srend-card {
  width: min(520px, 96vw); max-height: 92vh; overflow-y: auto; text-align: center;
  background: var(--grad-surface); border: 1px solid rgba(167,139,250,0.45); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.2rem); box-shadow: var(--shadow-lg);
}
.arc-srend-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--purple); background: rgba(167,139,250,0.14); border: 1px solid rgba(167,139,250,0.42);
  border-radius: var(--r-full); padding: 0.3rem 0.85rem; margin-bottom: 1rem;
}
.arc-srend-newbest {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; color: #120a26;
  background: linear-gradient(135deg, #A78BFA, #22D3EE); border-radius: var(--r-full); padding: 0.28rem 0.85rem; margin-bottom: 0.9rem;
  animation: arcPop .4s var(--ease);
}
.arc-srend-time {
  font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 800; font-size: clamp(3.2rem, 12vw, 4.6rem);
  line-height: 1; background: linear-gradient(135deg, #C4B5FD, #22D3EE); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--purple);
  font-variant-numeric: tabular-nums;
}
.arc-srend-timelbl { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); margin-bottom: 1.3rem; }
.arc-srend-timelbl b { color: #fff; }
.arc-srend-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-bottom: 1.1rem; }
.arc-srend-stat {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--r); padding: 0.7rem 0.4rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.arc-srend-stat b { font-size: 1.2rem; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.arc-srend-stat span { font-size: 0.62rem; color: var(--text-faint); letter-spacing: 0.02em; }
.arc-srend-splits { list-style: none; margin: 0 0 1.1rem; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 0.28rem; }
.arc-srend-split {
  display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0.4rem 0.6rem; border-radius: var(--r-sm); background: rgba(255,255,255,0.03); border: 1px solid var(--border);
}
.arc-srend-split.gold { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.arc-srend-split-n { flex: none; width: 1.3rem; color: var(--text-faint); }
.arc-srend-split-name { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-srend-split-d { flex: none; font-size: 0.68rem; }
.arc-srend-split-d.up { color: var(--green); }
.arc-srend-split-d.down { color: #fb7185; }
.arc-srend-split-t { flex: none; color: #fff; font-weight: 700; min-width: 2.7rem; text-align: right; }
.arc-srend-line { color: var(--text-dim); line-height: 1.6; margin: 0 0 1.3rem; }
.arc-srend-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.arc-srend-actions .btn { flex: 1; min-width: 130px; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .arc-srcard-bolt, .arc-split, .arc-srend-newbest, .arc-dbgcard-bug, .arc-bugbanner-ic { animation: none !important; }
  .arc-srcard, .arc-sr-play, .arc-hud-sr, .arc-dbgcard, .arc-dbg-play { transition: none !important; }
  .arc-screen, .arc-slot, .arc-el, .arc-runline.live, .arc-step.hint, .arc-stage.finished::after, .arc-shake,
  .arc-hud-streak, .arc-flame, .arc-star.on, .arc-combo, .arc-newbest, .arc-badge.fresh,
  .arc-career, .arc-daystreak, .arc-rankup, .arc-medal,
  .arc-blitzcard-bolt, .arc-blitz-clock.urgent, .arc-blitz-bonus.show, .arc-blitz-combo, .arc-blitzend-newbest,
  .arc-hud-ghost.ghost-behind, .arc-ghost-result, .arc-challengecard, .arc-challengecard-flag { animation: none !important; }
  .arc-el, .arc-step, .arc-slot, .arc-stage, .arc-star, .arc-toast, .arc-badge, .arc-lvl-track i, .arc-daily,
  .arc-map-cell, .arc-code-copy, .arc-hud-pace, .arc-hud-ghost, .arc-challenge-btn, .arc-challengecard-play, .arc-blitzcard, .arc-blitz-play, .arc-blitz-clock { transition: none !important; }
  .arc-toast { transform: none; opacity: 1; }
}

/* =====================================================================
   ARCADE CABINET — unlockable visual skins.
   Each skin just remaps the design tokens on the arcade regions, so every
   HUD, board, button and overlay recolours in one shot. The picker itself
   lives on the start screen. Themes are gated behind lifetime XP in JS.
   ===================================================================== */

/* ---- the picker ---- */
.arc-cabinet { margin: 1.5rem 0 0; text-align: left; border-top: 1px solid var(--border); padding-top: 1.35rem; }
.arc-cabinet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.arc-cabinet-title { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text); font-weight: 600; }
.arc-cabinet-ic { font-size: 1rem; }
.arc-cabinet-note { font-size: 0.7rem; color: var(--text-faint); font-family: var(--font-mono); }
.arc-theme-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 0.55rem; }
.arc-theme-chip {
  display: flex; align-items: center; gap: 0.6rem; text-align: left; cursor: pointer; width: 100%;
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.55rem 0.6rem; color: var(--text); position: relative;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.arc-theme-chip:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.arc-theme-chip.sel { border-color: var(--border-blue); box-shadow: 0 0 0 1px var(--border-blue), 0 10px 24px rgba(0,0,0,0.28); }
.arc-theme-chip.locked { cursor: not-allowed; opacity: 0.6; }
.arc-theme-chip.locked:hover { transform: none; border-color: var(--border); }
.arc-theme-sw {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(135deg, var(--s1) 0%, var(--s1) 38%, var(--s2) 38%, var(--s2) 68%, var(--s3) 68%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.arc-theme-meta { display: flex; flex-direction: column; gap: 0.08rem; min-width: 0; }
.arc-theme-name { font-size: 0.86rem; font-weight: 600; line-height: 1.15; }
.arc-theme-state { font-size: 0.67rem; color: var(--text-faint); font-family: var(--font-mono); }
.arc-theme-chip.sel .arc-theme-state { color: var(--blue-bright); }
.arc-theme-tick { margin-left: auto; color: var(--blue-bright); font-weight: 700; font-size: 0.95rem; }
.arc-theme-chip.shake { animation: arcShake 0.4s var(--ease); }
@keyframes arcShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-4px)} 40%{transform:translateX(4px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(3px)} }

/* the whole cabinet gives a quick brightness pop when you switch skins */
.arc-theme-flash .arc-shell { animation: arcThemeFlash 0.5s var(--ease); }
@keyframes arcThemeFlash { from { filter: brightness(1.32) saturate(1.15); } to { filter: none; } }

/* new-cabinet toast wears a colourful edge */
.arc-toast-theme { border-color: var(--border-blue); }

/* smooth the recolour when a skin is applied */
.arc-shell, .arc-success-card, .arc-blitzend-card { transition: background 0.4s var(--ease), border-color 0.4s var(--ease); }

/* ---- skin token maps -------------------------------------------------
   Applied to the arcade play area + the two floating overlays so the whole
   game recolours. Custom properties inherit, so remapping them here cascades
   into every descendant that reads var(--token). ------------------------ */

/* BLUEPRINT — drafting-table cyan on deep navy */
body[data-arc-theme="blueprint"] .arc-shell,
body[data-arc-theme="blueprint"] .arc-success-card,
body[data-arc-theme="blueprint"] .arc-blitzend-card,
body[data-arc-theme="blueprint"] .arc-hof-entry-card,
body[data-arc-theme="blueprint"] .arc-toasts {
  --bg: #071A2F; --bg-2: #0A2038; --surface: #0C2438; --surface-2: #102B44; --surface-3: #173A57;
  --glass: rgba(10,32,56,0.55); --glass-strong: rgba(6,22,42,0.82);
  --border: rgba(125,227,255,0.15); --border-strong: rgba(125,227,255,0.30); --border-blue: rgba(79,195,247,0.48);
  --blue: #4FC3F7; --blue-bright: #7DE3FF; --blue-deep: #2E9CD6;
  --amber: #8FD3FF; --amber-bright: #CDE8FF; --cyan: #7DE3FF; --green: #5FD0A0;
  --text: #EAF6FF; --text-dim: #9EC4DE; --text-faint: #8FB4CE;
  --grad-primary: linear-gradient(135deg, #4FC3F7 0%, #7DE3FF 100%);
  --grad-accent: linear-gradient(135deg, #7DE3FF 0%, #4FC3F7 100%);
  --grad-surface: linear-gradient(160deg, rgba(16,43,68,0.7) 0%, rgba(6,22,42,0.5) 100%);
  --grad-text: linear-gradient(120deg, #7DE3FF 0%, #CDE8FF 60%, #EAF6FF 100%);
}

/* SYNTHWAVE — neon magenta and a sunset grid */
body[data-arc-theme="synthwave"] .arc-shell,
body[data-arc-theme="synthwave"] .arc-success-card,
body[data-arc-theme="synthwave"] .arc-blitzend-card,
body[data-arc-theme="synthwave"] .arc-hof-entry-card,
body[data-arc-theme="synthwave"] .arc-toasts {
  --bg: #160726; --bg-2: #1B0930; --surface: #23103C; --surface-2: #2B1547; --surface-3: #361B57;
  --glass: rgba(35,16,60,0.55); --glass-strong: rgba(22,7,38,0.82);
  --border: rgba(255,79,216,0.16); --border-strong: rgba(255,79,216,0.32); --border-blue: rgba(34,211,238,0.48);
  --blue: #FF4FD8; --blue-bright: #FF7BE3; --blue-deep: #C838B0;
  --amber: #FDE047; --amber-bright: #FEF08A; --cyan: #22D3EE; --green: #34E0C0;
  --text: #F6E9FF; --text-dim: #C9A9E0; --text-faint: #BC9AD6;
  --grad-primary: linear-gradient(135deg, #FF4FD8 0%, #22D3EE 100%);
  --grad-accent: linear-gradient(135deg, #FDE047 0%, #FF4FD8 100%);
  --grad-surface: linear-gradient(160deg, rgba(43,21,71,0.72) 0%, rgba(22,7,38,0.55) 100%);
  --grad-text: linear-gradient(120deg, #FF7BE3 0%, #22D3EE 55%, #FDE047 100%);
}
body[data-arc-theme="synthwave"] .arc-start-inner { box-shadow: var(--shadow-lg), 0 0 60px rgba(255,79,216,0.10); }

/* TERMINAL — green-on-black hacker console */
body[data-arc-theme="matrix"] .arc-shell,
body[data-arc-theme="matrix"] .arc-success-card,
body[data-arc-theme="matrix"] .arc-blitzend-card,
body[data-arc-theme="matrix"] .arc-hof-entry-card,
body[data-arc-theme="matrix"] .arc-toasts {
  --bg: #04120A; --bg-2: #061A0E; --surface: #0A2013; --surface-2: #0D2A19; --surface-3: #123723;
  --glass: rgba(10,32,19,0.55); --glass-strong: rgba(4,18,10,0.82);
  --border: rgba(74,222,128,0.16); --border-strong: rgba(74,222,128,0.32); --border-blue: rgba(34,197,94,0.48);
  --blue: #22C55E; --blue-bright: #4ADE80; --blue-deep: #16A34A;
  --amber: #86EFAC; --amber-bright: #BBF7D0; --cyan: #4ADE80; --green: #22C55E;
  --text: #CFF7DA; --text-dim: #8FD3A6; --text-faint: #84C79B;
  --grad-primary: linear-gradient(135deg, #16A34A 0%, #4ADE80 100%);
  --grad-accent: linear-gradient(135deg, #4ADE80 0%, #86EFAC 100%);
  --grad-surface: linear-gradient(160deg, rgba(13,42,25,0.72) 0%, rgba(4,18,10,0.55) 100%);
  --grad-text: linear-gradient(120deg, #4ADE80 0%, #86EFAC 60%, #DCFCE7 100%);
}
body[data-arc-theme="matrix"] .arc-runline,
body[data-arc-theme="matrix"] .arc-code { text-shadow: 0 0 8px rgba(74,222,128,0.35); }

/* AMBER CRT — warm retro monochrome glow */
body[data-arc-theme="amber"] .arc-shell,
body[data-arc-theme="amber"] .arc-success-card,
body[data-arc-theme="amber"] .arc-blitzend-card,
body[data-arc-theme="amber"] .arc-hof-entry-card,
body[data-arc-theme="amber"] .arc-toasts {
  --bg: #1A0F02; --bg-2: #221505; --surface: #24170A; --surface-2: #2E1E0C; --surface-3: #3B2811;
  --glass: rgba(36,23,10,0.55); --glass-strong: rgba(26,15,2,0.82);
  --border: rgba(255,176,32,0.16); --border-strong: rgba(255,176,32,0.32); --border-blue: rgba(255,176,32,0.44);
  --blue: #FFB020; --blue-bright: #FFCF6B; --blue-deep: #E08A12;
  --amber: #FFB020; --amber-bright: #FFCF6B; --cyan: #FFCF6B; --green: #E7C56A;
  --text: #FFE7BE; --text-dim: #D8AE74; --text-faint: #CBA36B;
  --grad-primary: linear-gradient(135deg, #E08A12 0%, #FFB020 100%);
  --grad-accent: linear-gradient(135deg, #FFB020 0%, #FFCF6B 100%);
  --grad-surface: linear-gradient(160deg, rgba(46,30,12,0.72) 0%, rgba(26,15,2,0.55) 100%);
  --grad-text: linear-gradient(120deg, #FFCF6B 0%, #FFE3B0 60%, #FFF3DC 100%);
}
body[data-arc-theme="amber"] .arc-runline,
body[data-arc-theme="amber"] .arc-code { text-shadow: 0 0 8px rgba(255,176,32,0.3); }

/* ARCHITECT — prestige gold and graphite */
body[data-arc-theme="architect"] .arc-shell,
body[data-arc-theme="architect"] .arc-success-card,
body[data-arc-theme="architect"] .arc-blitzend-card,
body[data-arc-theme="architect"] .arc-hof-entry-card,
body[data-arc-theme="architect"] .arc-toasts {
  --bg: #0B0B0D; --bg-2: #101013; --surface: #17171B; --surface-2: #1E1E23; --surface-3: #28282F;
  --glass: rgba(23,23,27,0.55); --glass-strong: rgba(11,11,13,0.82);
  --border: rgba(233,196,106,0.16); --border-strong: rgba(233,196,106,0.30); --border-blue: rgba(233,196,106,0.42);
  --blue: #E9C46A; --blue-bright: #F4E0A1; --blue-deep: #C9A34E;
  --amber: #E9C46A; --amber-bright: #F4E0A1; --cyan: #CBB26A; --green: #B9C3A0;
  --text: #F4EFE3; --text-dim: #BDB49C; --text-faint: #AEA692;
  --grad-primary: linear-gradient(135deg, #C9A34E 0%, #F4E0A1 100%);
  --grad-accent: linear-gradient(135deg, #F4E0A1 0%, #E9C46A 100%);
  --grad-surface: linear-gradient(160deg, rgba(30,30,35,0.72) 0%, rgba(11,11,13,0.55) 100%);
  --grad-text: linear-gradient(120deg, #F4E0A1 0%, #E9C46A 55%, #FFF6E0 100%);
}
body[data-arc-theme="architect"] .arc-start-inner { box-shadow: var(--shadow-lg), 0 0 50px rgba(233,196,106,0.08); }

@media (prefers-reduced-motion: reduce) {
  .arc-theme-chip.shake, .arc-theme-flash .arc-shell { animation: none !important; }
  .arc-shell, .arc-success-card, .arc-blitzend-card { transition: none !important; }
}

/* =====================================================================
   THE CODEX — start-screen card + full library modal.
   ===================================================================== */
.arc-codex { margin: 1.5rem 0 0; text-align: left; border-top: 1px solid var(--border); padding-top: 1.35rem; }
.arc-codex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.arc-codex-title { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text); font-weight: 600; }
.arc-codex-ic { font-size: 1rem; }
.arc-codex-note { font-size: 0.7rem; color: var(--text-faint); font-family: var(--font-mono); }
.arc-codex-open {
  display: flex; align-items: center; gap: 1rem; width: 100%; cursor: pointer; text-align: left;
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.85rem 1rem; color: var(--text);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.arc-codex-open:hover { border-color: var(--border-blue); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,0.26); }
.arc-codex-open:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.arc-codex-spines { display: inline-flex; align-items: flex-end; gap: 3px; flex: none; height: 40px; }
.arc-codex-spine {
  width: 12px; height: 30px; border-radius: 2px 2px 1px 1px; position: relative;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  display: grid; place-items: start center; transition: height 0.2s var(--ease), background 0.2s var(--ease);
}
.arc-codex-spine i { font-style: normal; font-family: var(--font-mono); font-size: 0.46rem; color: var(--text-faint); margin-top: 2px; }
.arc-codex-spine.on { height: 40px; background: linear-gradient(180deg, var(--blue-bright), #2563eb); border-color: var(--border-blue); box-shadow: 0 0 8px rgba(59,130,246,0.35); }
.arc-codex-spine.on i { color: #fff; }
.arc-codex-spine.on.mastered { background: linear-gradient(180deg, var(--amber-bright), #d97706); border-color: rgba(245,158,11,0.5); box-shadow: 0 0 9px rgba(245,158,11,0.42); }
.arc-codex-meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.arc-codex-count { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text); }
.arc-codex-count b { color: #fff; font-weight: 700; }
.arc-codex-cta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--blue-bright); }

/* ---- library modal ---- */
.arc-codexmodal {
  position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  padding: 1.2rem; background: rgba(4,7,14,0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: arcFade .3s var(--ease);
}
.arc-codexmodal-card {
  width: min(880px, 96vw); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--grad-surface); border: 1px solid var(--border-blue); border-radius: var(--r-lg);
  padding: clamp(1.2rem, 3vw, 1.8rem); box-shadow: var(--shadow-lg);
}
.arc-codexmodal-head { display: flex; align-items: center; gap: 0.8rem; }
.arc-codexmodal-title { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; color: #fff; display: inline-flex; align-items: center; gap: 0.45rem; }
.arc-codexmodal-prog { font-family: var(--font-mono); font-size: 0.74rem; color: var(--amber-bright); background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); border-radius: var(--r-full); padding: 0.2rem 0.7rem; }
.arc-codexmodal-close {
  margin-left: auto; width: 34px; height: 34px; flex: none; border-radius: 9px; cursor: pointer;
  background: var(--glass-strong); border: 1px solid var(--border); color: var(--text-dim); font-size: 1.4rem; line-height: 1;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.arc-codexmodal-close:hover { color: #fff; border-color: var(--border-strong); }
.arc-codexmodal-close:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.arc-codexmodal-sub { color: var(--text-dim); font-size: 0.82rem; line-height: 1.55; margin: 0.6rem 0 1rem; max-width: 62ch; }
.arc-codexmodal-body { display: grid; grid-template-columns: 250px 1fr; gap: 1rem; min-height: 0; overflow: hidden; }

.arc-codex-list { display: flex; flex-direction: column; gap: 0.4rem; overflow-y: auto; padding-right: 0.3rem; max-height: 62vh; }
.arc-codex-li {
  display: flex; align-items: center; gap: 0.6rem; cursor: pointer; text-align: left; width: 100%;
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--r); padding: 0.5rem 0.6rem; color: var(--text);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.arc-codex-li:hover { border-color: var(--border-strong); }
.arc-codex-li.sel { border-color: var(--border-blue); background: rgba(59,130,246,0.10); box-shadow: 0 0 0 1px var(--border-blue); }
.arc-codex-li.locked { opacity: 0.62; }
.arc-codex-li-n { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--grad-primary); }
.arc-codex-li.locked .arc-codex-li-n { background: rgba(255,255,255,0.08); color: var(--text-faint); }
.arc-codex-li-body { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.arc-codex-li-name { font-size: 0.82rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-codex-li-stars { font-size: 0.66rem; letter-spacing: 0.04em; color: var(--amber-bright); font-family: var(--font-mono); }
.arc-codex-li.locked .arc-codex-li-stars { color: var(--text-faint); }
.arc-codex-li-medal { margin-left: auto; font-size: 0.95rem; line-height: 1; }
.arc-codex-li-lock { margin-left: auto; font-size: 0.8rem; opacity: 0.7; }

.arc-codex-detail { overflow-y: auto; max-height: 62vh; padding-right: 0.2rem; }
.arc-codex-detail-head { margin-bottom: 0.8rem; }
.arc-codex-detail-k { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); }
.arc-codex-detail-title { font-size: 1.15rem; margin: 0.25rem 0 0.2rem; color: #fff; }
.arc-codex-detail-task { color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; margin: 0; }
.arc-codex-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.arc-codex-stat { display: inline-flex; flex-direction: column; gap: 0.1rem; background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--r); padding: 0.4rem 0.7rem; }
.arc-codex-stat b { font-family: var(--font-mono); font-size: 0.85rem; color: #fff; }
.arc-codex-stat span { font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.arc-codex-detail .arc-code { max-height: 340px; }

.arc-codex-empty { text-align: center; padding: 2.4rem 1rem; }
.arc-codex-empty-ic { font-size: 2.4rem; display: block; margin-bottom: 0.6rem; opacity: 0.8; }
.arc-codex-empty h4 { font-size: 1.05rem; margin: 0 0 0.5rem; color: #fff; }
.arc-codex-empty-task { font-family: var(--font-mono); font-size: 0.9rem; color: var(--amber-bright); margin: 0 0 0.5rem; }
.arc-codex-empty-sub { color: var(--text-dim); font-size: 0.85rem; line-height: 1.55; max-width: 42ch; margin: 0 auto; }

@media (max-width: 640px) {
  .arc-codexmodal-body { grid-template-columns: 1fr; }
  .arc-codex-list { flex-direction: row; overflow-x: auto; overflow-y: visible; max-height: none; padding-bottom: 0.3rem; }
  .arc-codex-li { flex: none; width: 165px; }
  .arc-codex-detail { max-height: 48vh; }
}

@media (prefers-reduced-motion: reduce) {
  .arc-codexmodal { animation: none; }
  .arc-codex-open, .arc-codex-spine, .arc-codex-li { transition: none !important; }
}

/* =====================================================================
   PLAYER'S GUIDE — welcome tour + wayfinding. Three cooperating pieces:
   (1) a "New here?" hero button, (2) an always-on "Where to?" mode
   navigator strip on the start screen, (3) the full guide overlay.
   All built on the existing design tokens so it reads as one system.
   ===================================================================== */

/* ---- (1) hero "take the tour" button ---- */
.arc-guide-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; margin: 1.4rem auto 0;
  padding: 0.6rem 1.15rem; cursor: pointer;
  font-family: var(--font-body); font-size: 0.92rem; color: var(--text);
  background: var(--glass-strong); border: 1px solid var(--border-strong);
  border-radius: var(--r-full); box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.arc-guide-btn b { color: var(--blue-bright); font-weight: 700; }
.arc-guide-btn:hover { border-color: var(--border-blue); transform: translateY(-1px); box-shadow: var(--shadow-sm), var(--glow-blue); }
.arc-guide-btn-ic {
  display: grid; place-items: center; width: 24px; height: 24px; flex: none;
  font-size: 0.9rem; border-radius: 50%; background: var(--grad-primary); color: #fff;
}

/* ---- (2) "Where to?" modes navigator strip ---- */
.arc-modenav {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  text-align: left; margin: 0 0 1.4rem;
  padding: 0.7rem 0.85rem; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--glass);
}
.arc-modenav-lbl {
  flex: none; display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint);
}
.arc-modenav-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.arc-modenav-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  padding: 0.34rem 0.7rem; font-size: 0.82rem; font-weight: 600; color: var(--text-dim);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-strong);
  border-radius: var(--r-full); transition: .18s var(--ease); white-space: nowrap;
}
.arc-modenav-chip:hover { color: var(--text); border-color: var(--border-blue); background: rgba(59,130,246,0.10); transform: translateY(-1px); }
.arc-modenav-chip-ic { font-size: 0.95rem; line-height: 1; }
/* live status pips — NEW on a mode you've never opened, ✓ on one you've beaten */
.arc-modenav-pip {
  font-family: var(--font-mono); font-size: 0.52rem; letter-spacing: 0.06em; font-weight: 700;
  line-height: 1; padding: 0.16rem 0.32rem; border-radius: var(--r-full);
}
.arc-modenav-pip.is-new { color: #0A0E17; background: var(--amber-bright); }
.arc-modenav-pip.is-done { color: var(--green); background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4); }

/* ---- Arcade Coach — the adaptive "your next move" panel ---- */
.arc-coach {
  position: relative; display: flex; align-items: center; gap: 0.9rem;
  text-align: left; margin: 0 0 1.4rem; padding: 0.9rem 1rem; cursor: pointer;
  background: linear-gradient(135deg, rgba(59,130,246,0.13), rgba(59,130,246,0.03));
  border: 1px solid var(--border-blue); border-radius: var(--r); box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
  animation: arcCoachIn .4s var(--ease);
}
.arc-coach:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm), var(--glow-blue); }
.arc-coach:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; }
.arc-coach-ic {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.5rem;
  border-radius: var(--r-sm); background: var(--glass-strong); border: 1px solid var(--border-blue);
}
.arc-coach-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.14rem; }
.arc-coach-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--blue-bright); }
.arc-coach-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 600; font-size: 1.06rem; color: #fff; line-height: 1.22; }
.arc-coach-title b { color: var(--blue-bright); font-weight: 700; }
.arc-coach-sub { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.arc-coach-go {
  flex: none; cursor: pointer; white-space: nowrap; align-self: center;
  padding: 0.55rem 1rem; font-size: 0.86rem; font-weight: 600; color: #fff;
  background: var(--grad-primary); border: none; border-radius: var(--r-full);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.arc-coach-go:hover { transform: translateY(-1px); box-shadow: var(--glow-blue); }
/* warm (amber) variant — everything that isn't "continue the campaign" */
.arc-coach.is-warm { background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(245,158,11,0.03)); border-color: rgba(245,158,11,0.42); }
.arc-coach.is-warm:hover { box-shadow: var(--shadow-sm), 0 12px 34px rgba(245,158,11,0.20); }
.arc-coach.is-warm .arc-coach-ic { border-color: rgba(245,158,11,0.5); }
.arc-coach.is-warm .arc-coach-k { color: var(--amber-bright); }
.arc-coach.is-warm .arc-coach-title b { color: var(--amber-bright); }
@keyframes arcCoachIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .arc-coach { flex-wrap: wrap; }
  .arc-coach-go { width: 100%; margin-top: 0.2rem; }
}

/* the brief pulse a card gets when you jump to it from the navigator */
@keyframes arcJumpPulse {
  0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.0); }
  18%  { box-shadow: 0 0 0 3px rgba(59,130,246,0.55), var(--glow-blue); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.0); }
}
.arc-jumped { animation: arcJumpPulse 1.5s var(--ease); border-radius: var(--r); }

/* ---- (3) the guide overlay ---- */
.arc-guide {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  padding: clamp(0.8rem, 3vw, 2rem); overflow-y: auto;
  background: rgba(5, 8, 15, 0.78); backdrop-filter: blur(6px);
  animation: arcFade .3s var(--ease);
}
.arc-guide-card {
  position: relative; width: 100%; max-width: 680px; margin: auto;
  background: var(--grad-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 4vw, 2.6rem);
}
.arc-guide-close {
  position: absolute; top: 0.8rem; right: 0.9rem; width: 36px; height: 36px; cursor: pointer;
  display: grid; place-items: center; font-size: 1.5rem; line-height: 1; color: var(--text-dim);
  background: transparent; border: 1px solid var(--border); border-radius: 50%; transition: .2s var(--ease);
}
.arc-guide-close:hover { color: #fff; border-color: var(--border-strong); background: rgba(255,255,255,0.06); }
.arc-guide-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  color: var(--amber-bright); background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35); border-radius: var(--r-full); padding: 0.3rem 0.8rem;
}
.arc-guide-h { margin: 0.9rem 0 0.5rem; font-size: clamp(1.5rem, 4vw, 2rem); }
.arc-guide-lede { color: var(--text-dim); line-height: 1.6; margin: 0 0 1.5rem; max-width: 56ch; }
.arc-guide-lede b { color: var(--text); }

.arc-guide-sec { margin-top: 1.5rem; }
.arc-guide-sec-k {
  display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--blue-bright); margin-bottom: 0.7rem;
}
.arc-guide-sec-note { color: var(--text-dim); font-size: 0.86rem; margin: -0.3rem 0 0.7rem; }

.arc-guide-loop { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; }
.arc-guide-loop li { display: flex; align-items: flex-start; gap: 0.75rem; color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; }
.arc-guide-loop li b { color: var(--text); }
.arc-guide-loop-n {
  flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #fff; background: var(--grad-primary);
}

.arc-guide-modes { display: grid; gap: 0.6rem; }
.arc-guide-mode {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; text-align: left; cursor: pointer;
  padding: 0.85rem 1rem; background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-strong); border-radius: var(--r); transition: .2s var(--ease);
}
.arc-guide-mode:hover { border-color: var(--border-blue); background: rgba(59,130,246,0.08); transform: translateY(-1px); }
.arc-guide-mode.is-rec { border-color: rgba(245,158,11,0.42); background: rgba(245,158,11,0.06); }
.arc-guide-mode.is-rec:hover { border-color: var(--amber-bright); background: rgba(245,158,11,0.11); }
.arc-guide-mode-ic { flex: none; font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--r-sm); }
.arc-guide-mode-txt { flex: 1; min-width: 0; }
.arc-guide-mode-name { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: #fff; }
.arc-guide-rec { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: #0A0E17; background: var(--amber-bright); padding: 0.14rem 0.44rem; border-radius: var(--r-full); }
.arc-guide-mode-sub { display: block; margin-top: 0.2rem; font-size: 0.85rem; color: var(--text-dim); line-height: 1.45; }
.arc-guide-mode-go { flex: none; color: var(--text-faint); font-size: 1.2rem; transition: transform .2s var(--ease), color .2s var(--ease); }
.arc-guide-mode:hover .arc-guide-mode-go { color: var(--blue-bright); transform: translateX(3px); }

.arc-guide-feats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.arc-guide-feat { font-size: 0.82rem; color: var(--text-dim); background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--r-full); padding: 0.32rem 0.72rem; }
.arc-guide-feat b { color: var(--text); font-weight: 600; }

.arc-guide-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.7rem; }
.arc-guide-actions .btn-lg { flex: 1; min-width: 220px; }
.arc-guide-fine { font-size: 0.78rem; color: var(--text-faint); margin: 1rem 0 0; }
.arc-guide-fine b { color: var(--green); }

@media (max-width: 560px) {
  .arc-guide-mode-ic { font-size: 1.35rem; width: 38px; height: 38px; }
  .arc-guide-actions .btn { width: 100%; flex: none; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .arc-guide, .arc-jumped, .arc-coach { animation: none; }
  .arc-guide-btn:hover, .arc-guide-mode:hover, .arc-modenav-chip:hover, .arc-coach:hover { transform: none; }
}

/* =====================================================================
   UI / UX REFINEMENT LAYER  (2026-07)
   Loaded last so it refines the base rules above without touching them.
   Goals: (1) tame the long, look-alike start-screen stack into scannable
   shelves, (2) make every code surface genuinely readable, (3) make the
   "try it in the lab" reward read as the clear call-to-action it is.
   ===================================================================== */

/* ---- roomier start screen: the feature-dense console needs breathing room ---- */
.arc-start-inner { max-width: 720px; }

/* ---- section header — a light divider that turns a pile of cards into shelves ---- */
.arc-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 0.4rem 0.9rem; text-align: left; margin: 1.9rem 0 0.9rem;
  padding-bottom: 0.55rem; border-bottom: 1px solid var(--border);
}
.arc-sec-h {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text);
}
.arc-sec-h-ic { font-size: 1rem; }
.arc-sec-sub { font-size: 0.8rem; color: var(--text-faint); font-family: var(--font-mono); }

/* ---- mode launchers as a tidy responsive grid instead of 3 stacked banners ---- */
.arc-modes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem; align-items: stretch;
}
/* re-flow each launcher into a compact vertical card that reads well in a column */
.arc-modes-grid .arc-blitzcard,
.arc-modes-grid .arc-srcard,
.arc-modes-grid .arc-dbgcard {
  flex-direction: column; align-items: flex-start; gap: 0.6rem;
  margin: 0; height: 100%; padding: 1.05rem 1.05rem 1.1rem;
}
.arc-modes-grid .arc-blitzcard-txt,
.arc-modes-grid .arc-srcard-txt,
.arc-modes-grid .arc-dbgcard-txt { flex: 1 1 auto; gap: 0.2rem; }
.arc-modes-grid .arc-blitzcard-sub,
.arc-modes-grid .arc-srcard-sub,
.arc-modes-grid .arc-dbgcard-sub { font-size: 0.8rem; }
/* the play button anchors the bottom of every card, full-width and obviously clickable */
.arc-modes-grid .arc-blitz-play,
.arc-modes-grid .arc-sr-play,
.arc-modes-grid .arc-dbg-play {
  align-self: stretch; text-align: center; width: 100%; margin-top: auto; padding: 0.6rem 1rem;
}
@media (max-width: 460px) {
  .arc-modes-grid { grid-template-columns: 1fr; }
}

/* ---- the "New here?" tour button: make it a proper, inviting pill ---- */
.arc-guide-btn { border-radius: var(--r-full); }

/* =====================================================================
   CODE SURFACES — the reveal (.arc-code), the live trace, and the Codex.
   Readability first: a touch larger, more line height, real tab stops,
   a calmer window chrome, quiet custom scrollbars, and a legible selection.
   ===================================================================== */
.arc-codewrap {
  border-color: #2c2c34;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.02);
}
.arc-code-bar { background: #16161b; border-bottom-color: #2a2a30; padding: 0.55rem 0.85rem; }
.arc-code {
  font-size: 0.87rem; line-height: 1.72; color: #dbe2ea;
  tab-size: 4; -moz-tab-size: 4; letter-spacing: 0.1px;
  font-variant-ligatures: none;
  background: linear-gradient(180deg, #1f1f24, #1b1b20);
  padding: 1rem 1.15rem; scrollbar-width: thin; scrollbar-color: #3a3a44 transparent;
}
.arc-code::selection, .arc-code *::selection { background: rgba(88,166,255,0.32); }
.arc-code::-webkit-scrollbar, .arc-trace-code::-webkit-scrollbar { height: 9px; width: 9px; }
.arc-code::-webkit-scrollbar-thumb, .arc-trace-code::-webkit-scrollbar-thumb {
  background: #3a3a44; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box;
}
.arc-code::-webkit-scrollbar-thumb:hover, .arc-trace-code::-webkit-scrollbar-thumb:hover { background: #4c4c58; background-clip: padding-box; }
.arc-code::-webkit-scrollbar-track, .arc-trace-code::-webkit-scrollbar-track { background: transparent; }

/* brighter, higher-contrast token palette (over the darker code bg) */
.arc-code .c-kw, .arc-trace-code .c-kw { color: #6cb6ff; }
.arc-code .c-ty, .arc-trace-code .c-ty { color: #56d4bc; }
.arc-code .c-str, .arc-trace-code .c-str { color: #e6a06b; }
.arc-code .c-cmt, .arc-trace-code .c-cmt { color: #7ca66b; font-style: italic; }
.arc-code .c-num, .arc-trace-code .c-num { color: #b5cea8; }

/* the live trace's code column gets the same legibility bump */
.arc-trace-code { font-size: 0.79rem; line-height: 1.62; scrollbar-width: thin; scrollbar-color: #3a3a44 transparent; }

/* =====================================================================
   LAB LINK — the reward CTA under a cleared plugin / in the Codex.
   Was a bare text link; now a clear outlined pill that invites the click
   and, for members-only lessons a non-member can't yet open, still reads
   as an invitation (the click pops the sign-in, handled in arcade.js).
   ===================================================================== */
.arc-lesson-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
  color: var(--blue-bright); text-decoration: none;
  padding: 0.5rem 0.95rem; border-radius: var(--r-full);
  border: 1px solid var(--border-blue); background: rgba(59,130,246,0.08);
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), color .18s var(--ease);
}
.arc-lesson-link:hover {
  text-decoration: none; color: #fff; transform: translateY(-1px);
  background: rgba(59,130,246,0.18); border-color: var(--blue-bright);
}
.arc-lesson-link:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .arc-lesson-link:hover { transform: none; }
}

/* =====================================================================
   START-SCREEN WAYFINDING & HIERARCHY  (2026-07 · b)
   The console packs a lot in, and first-time players told us they didn't
   know where to click or where their scores/badges lived. This layer adds
   ONE obvious reading order without touching any behaviour or id:
     1 · a dominant, glowing "Start the arcade" action
     2 · your next move (Coach) right beneath it
     3 · your SCORES & BADGES dashboard (Career), pulled up + spotlit
     4 · more ways to play
     5 · trophies & collections
   ===================================================================== */

/* ---- 1 · the primary action: make "Start the arcade" unmissable ---- */
.arc-how-lbl {
  display: flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap;
  max-width: 460px; margin: 0 auto 0.7rem; text-align: left;
  font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700;
  font-size: 0.9rem; letter-spacing: 0.02em; color: var(--text);
}
.arc-how-lbl-ic { font-size: 1rem; }
.arc-how-lbl-sub { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; color: var(--text-faint); letter-spacing: 0.02em; }

/* give the numbered steps a touch more presence + a clear card so the
   "read → click → order → run" path is the first thing the eye lands on */
.arc-how {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.9rem 1rem; gap: 0.7rem;
}
.arc-how li { font-size: 0.98rem; }

/* the Start button — big, rounded, softly pulsing so there is never a
   question of "where do I click?" */
#arc-begin {
  font-size: 1.06rem; padding: 0.95rem 2.3rem; margin-top: 0.4rem;
  border-radius: var(--r-full);
  box-shadow: 0 12px 34px -10px rgba(59,130,246,0.65);
  animation: arcBeginPulse 2.8s ease-in-out infinite;
}
#arc-begin:hover { transform: translateY(-2px); box-shadow: 0 16px 42px -8px rgba(59,130,246,0.85); }
@keyframes arcBeginPulse {
  0%, 100% { box-shadow: 0 12px 30px -12px rgba(59,130,246,0.55); }
  50%      { box-shadow: 0 14px 44px -6px rgba(59,130,246,0.90); }
}

/* a hairline that separates the "start cluster" from everything below it,
   so the primary action reads as its own zone */
.arc-modenav { margin-top: 0.4rem; }

/* keep every shelf flush to the shell edges instead of floating at 520px
   inside a 720px console — aligned columns read as "organised", not "piled" */
.arc-career, .arc-hof-card { max-width: none; width: 100%; }

/* ---- 3 · the scores & badges dashboard: pull the eye to it ---- */
.arc-career {
  border-color: var(--border-blue);
  background:
    linear-gradient(180deg, rgba(59,130,246,0.06), rgba(59,130,246,0)) ,
    var(--glass-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(59,130,246,0.08);
}
/* the panel title is the answer to "where are my scores & badges?" — make
   it a real heading instead of a whispered mono label */
.arc-career-title {
  font-family: var(--font-display, 'Space Grotesk'), sans-serif;
  font-size: 0.98rem; font-weight: 700; letter-spacing: 0.01em;
  text-transform: none; color: #fff;
}
.arc-career-ic { font-size: 1.15rem; }
/* bolder stat numbers so a score reads at a glance */
.arc-stat b { font-size: 1.35rem; }
.arc-stat span { font-size: 0.64rem; }
/* the badges tile gets an amber accent so "badges" is obviously findable */
.arc-stat-badges {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.07);
}
.arc-stat-badges b {
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* the modes grid + collections shelf get a little more air between them */
.arc-modes-wrap { margin-top: 0.4rem; }

@media (max-width: 480px) {
  .arc-how-lbl, .arc-how { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #arc-begin { animation: none; }
}

/* =====================================================================
   SIMPLE-BY-DEFAULT START SCREEN  (2026-07 · c)
   Feedback: "I don't know where to click, and I can't find my scores &
   badges." The console had grown into a wall of look-alike cards. This
   layer keeps only what a new player needs in view — how to play → ONE
   Start button → an always-present scoreboard — and folds every advanced
   feature behind a single, clearly-labelled toggle. No ids/behaviour
   changed; the game engine is untouched.
   ===================================================================== */

/* the Start button says exactly what it does, and is the loudest thing here */
#arc-begin { font-weight: 700; letter-spacing: 0.01em; }
.arc-begin-hint {
  margin: 0.55rem 0 0; font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.02em; color: var(--text-faint);
}

/* ---- the scoreboard is always visible now; give the empty state warmth ---- */
.arc-career-empty {
  text-align: center; padding: 0.5rem 0.4rem 0.3rem;
  animation: arcFade .4s var(--ease);
}
.arc-career-empty-ic {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  margin-bottom: 0.5rem; font-size: 1.3rem; border-radius: 50%;
  background: rgba(59,130,246,0.12); border: 1px solid var(--border-blue);
}
.arc-career-empty-t {
  margin: 0 0 0.25rem; font-family: var(--font-display, 'Space Grotesk'), sans-serif;
  font-weight: 700; font-size: 1.02rem; color: #fff;
}
.arc-career-empty-s {
  margin: 0 auto; max-width: 40ch; font-size: 0.86rem;
  line-height: 1.55; color: var(--text-dim);
}
.arc-career-empty-s b { color: var(--amber-bright); font-weight: 600; }

/* ---- the single "everything else" toggle ---- */
.arc-more-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  width: 100%; margin: 1.5rem 0 0; text-align: left; cursor: pointer;
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.85rem 1.05rem; color: var(--text);
  font-family: inherit; font-size: 0.94rem;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.arc-more-toggle:hover {
  border-color: var(--border-blue); background: rgba(59,130,246,0.06);
  transform: translateY(-1px);
}
.arc-more-toggle:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; }
.arc-more-toggle-main {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-weight: 700;
}
.arc-more-toggle-ic { font-size: 1.15rem; }
.arc-more-toggle-side { display: inline-flex; align-items: center; gap: 0.7rem; flex: none; }
.arc-more-toggle-hint {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.02em;
  color: var(--text-faint); white-space: nowrap;
}
.arc-more-caret {
  font-size: 0.8rem; color: var(--blue-bright); line-height: 1;
  transition: transform .22s var(--ease);
}
.arc-more-toggle.is-open { border-color: var(--border-blue); background: rgba(59,130,246,0.05); }
.arc-more-toggle.is-open .arc-more-caret { transform: rotate(180deg); }

.arc-more { animation: arcFade .35s var(--ease); }
.arc-more .arc-modenav { margin-top: 1.2rem; }

@media (max-width: 560px) {
  .arc-more-toggle { flex-wrap: wrap; gap: 0.35rem; }
  .arc-more-toggle-hint { display: none; }
}
