:root {
  color-scheme: dark;
  --bg: #141414;
  --panel: #202020;
  --panel-2: #292722;
  --ink: #f2f0e8;
  --muted: #b9b4a8;
  --green: #a7db65;
  --teal: #52c7b8;
  --amber: #f2b84b;
  --coral: #f26f63;
  --violet: #b99cff;
  --line: #3f3a32;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(82, 199, 184, 0.12), transparent 42%),
    linear-gradient(210deg, rgba(242, 184, 75, 0.1), transparent 48%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 0;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.86);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.back-home:hover,
.back-home:focus-visible,
.game-footer a:hover,
.game-footer a:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.site-bar-label,
.game-footer {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
}

.game-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.game-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 6px 0 30px;
  border-top: 1px solid var(--line);
}

.game-footer a {
  color: inherit;
  text-decoration: none;
}

.hud {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 3.8rem;
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 10px;
  min-width: min(380px, 100%);
}

.meter {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.86);
  box-shadow: var(--shadow);
}

.meter span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.meter strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.course-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.course-map article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.78);
}

.course-map article:last-child {
  border-color: rgba(185, 156, 255, 0.55);
  background: rgba(185, 156, 255, 0.07);
}

.course-map span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 900;
}

.course-map strong {
  font-size: 0.9rem;
}

.course-map p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.progress-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 0 0 7px;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.level-chip {
  flex: 0 0 132px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.74);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.level-chip:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.level-chip.current {
  border-color: var(--green);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--green);
}

.level-chip.done {
  border-color: rgba(82, 199, 184, 0.7);
  color: var(--teal);
}

.level-chip.wrong {
  border-color: rgba(242, 111, 99, 0.72);
  color: #ffaaa2;
}

.level-chip.answered::after {
  margin-left: 6px;
  content: "✓";
}

.level-chip.wrong::after {
  content: "×";
}

.arena {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: stretch;
}

.scene,
.challenge {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.9);
  box-shadow: var(--shadow);
}

.scene {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.scene-title {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.challenge {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.challenge-head {
  margin-bottom: 18px;
}

.prompt {
  min-height: 58px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.5;
}

.answer-zone {
  display: grid;
  gap: 10px;
}

.lesson-panel,
.code-panel,
.task-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.lesson-panel h3,
.code-panel h3,
.task-panel h3 {
  margin: 0;
  color: var(--green);
  font-size: 0.95rem;
}

.lesson-panel p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.code-row:first-of-type {
  border-top: 0;
}

.code-row code {
  display: block;
  color: var(--teal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-row span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.answer-button,
.snippet-button,
.slot-button,
.primary-button,
.ghost-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-2);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.answer-button,
.snippet-button,
.slot-button {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  overflow-wrap: anywhere;
}

.answer-button:hover,
.answer-button:focus-visible,
.snippet-button:hover,
.snippet-button:focus-visible,
.slot-button:hover,
.slot-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--green);
  outline: none;
}

.answer-button[disabled],
.snippet-button[disabled] {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.answer-button.correct {
  border-color: var(--teal);
  background: rgba(82, 199, 184, 0.18);
}

.answer-button.wrong {
  border-color: var(--coral);
  background: rgba(242, 111, 99, 0.18);
}

.answer-button.correct[disabled],
.answer-button.wrong[disabled] {
  opacity: 1;
}

.feedback {
  min-height: 70px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.feedback.good {
  color: var(--teal);
}

.feedback.bad {
  color: #ffaaa2;
}

.feedback.coach-note {
  color: var(--amber);
}

.controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  min-width: 116px;
  padding: 0 18px;
  text-align: center;
  font-weight: 900;
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #16200d;
}

.primary-button[disabled] {
  cursor: default;
  opacity: 0.54;
  transform: none;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.ghost-button[disabled] {
  cursor: default;
  opacity: 0.42;
  transform: none;
}

.memory-stack {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 12px;
  height: 420px;
}

.memory-stack.compact {
  height: 250px;
}

.memory-lane {
  position: relative;
  display: grid;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.memory-lane strong {
  font-size: 1.25rem;
}

.memory-lane span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.memory-lane::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px auto;
  width: 84px;
  height: 28px;
  border-radius: 4px;
  opacity: 0.8;
}

.memory-lane.stack {
  background: rgba(167, 219, 101, 0.08);
}

.memory-lane.stack::after {
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, transparent 12px 18px);
}

.memory-lane.heap {
  background: rgba(82, 199, 184, 0.08);
}

.memory-lane.heap::after {
  background: radial-gradient(circle, var(--teal) 35%, transparent 38%) 0 0 / 18px 18px;
}

.memory-lane.static {
  background: rgba(242, 184, 75, 0.08);
}

.memory-lane.static::after {
  background: linear-gradient(90deg, var(--amber), var(--coral));
}

.address-label {
  position: absolute;
  right: 20px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.address-label.high {
  top: 22px;
}

.address-label.low {
  bottom: 20px;
}

.terminal-art {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--green);
}

.toolbelt {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.toolbelt div {
  min-height: 104px;
  display: grid;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(82, 199, 184, 0.08);
}

.toolbelt strong {
  color: var(--teal);
  font-size: 1.15rem;
}

.toolbelt span {
  margin-top: 6px;
  color: var(--muted);
}

.terminal-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

.terminal-line span:last-child {
  color: var(--teal);
}

.array-art {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.array-row {
  display: grid;
  grid-template-columns: 74px repeat(8, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.array-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
}

.cell.used {
  border-color: var(--teal);
  background: rgba(82, 199, 184, 0.16);
  color: var(--ink);
}

.pipeline {
  display: grid;
  gap: 22px;
  margin-top: 30px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pipe-node {
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(242, 184, 75, 0.09);
  color: var(--ink);
  text-align: center;
  font-weight: 900;
}

.pipe-node.hot {
  border-color: var(--amber);
}

.pipe-arrow {
  align-self: center;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.file-art {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 44px;
}

.file-box {
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(82, 199, 184, 0.08);
}

.file-box strong {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
}

.file-box code {
  display: block;
  color: var(--ink);
  line-height: 1.8;
}

.stream-arrow {
  color: var(--amber);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}

.sequence-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.snippet-list,
.slot-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.slot-button {
  min-height: 66px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.slot-button.filled {
  border-color: var(--teal);
  color: var(--ink);
}

.snippet-button code,
.slot-button code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
}

.complete-panel {
  display: grid;
  gap: 14px;
}

.complete-panel h3 {
  margin: 0;
  font-size: 1.45rem;
}

.complete-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.topic-list {
  display: grid;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.topic-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.course-source {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 16px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.6);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.course-source strong {
  color: var(--ink);
}

.course-source div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-source a {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal);
  text-decoration: none;
}

.course-source a:hover,
.course-source a:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.concept-scene {
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 24px;
}

.visual-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}

.trace-array,
.search-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trace-array span {
  display: grid;
  min-height: 110px;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: rgba(82, 199, 184, 0.08);
}

.trace-array small {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.trace-array strong {
  font-size: 2rem;
}

.trace-steps,
.sort-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trace-steps span,
.sort-flow strong {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.trace-steps b,
.sort-flow b {
  color: var(--amber);
}

.recursion-art {
  justify-items: center;
  gap: 10px;
}

.frame {
  display: flex;
  justify-content: space-between;
  width: 88%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(185, 156, 255, 0.08);
}

.frame:nth-child(2) {
  width: 72%;
}

.frame.base {
  width: 56%;
  border-color: var(--green);
  background: rgba(167, 219, 101, 0.12);
}

.frame span,
.return-line {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.return-line {
  margin-top: 16px;
  color: var(--green);
}

.complexity-art {
  gap: 18px;
}

.complexity-row {
  display: grid;
  grid-template-columns: 88px 1fr 76px;
  gap: 12px;
  align-items: center;
}

.complexity-row span {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
}

.complexity-row strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.complexity-row i {
  display: block;
  width: var(--bar-width);
  height: 18px;
  border-radius: 4px;
  background: var(--bar-color);
}

.complexity-row.log {
  --bar-width: 18%;
  --bar-color: var(--green);
}

.complexity-row.linear {
  --bar-width: 52%;
  --bar-color: var(--teal);
}

.complexity-row.square {
  --bar-width: 100%;
  --bar-color: var(--coral);
}

.search-cells {
  grid-template-columns: repeat(7, minmax(36px, 1fr));
}

.search-cells span {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.search-cells .mid {
  border-color: var(--amber);
  background: rgba(242, 184, 75, 0.16);
}

.search-cells .discard {
  opacity: 0.28;
  text-decoration: line-through;
}

.search-caption,
.range-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.search-caption strong {
  color: var(--amber);
}

.range-line {
  flex-direction: column;
  text-align: center;
}

.range-line i {
  height: 4px;
  margin-left: 52%;
  border-radius: 3px;
  background: var(--teal);
}

.sort-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 14px;
  height: 240px;
}

.sort-bars i {
  position: relative;
  display: block;
  width: 58px;
  height: var(--height);
  border: 1px solid var(--teal);
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, rgba(82, 199, 184, 0.62), rgba(82, 199, 184, 0.12));
}

.sort-bars i.picked {
  border-color: var(--amber);
  background: linear-gradient(180deg, rgba(242, 184, 75, 0.72), rgba(242, 184, 75, 0.12));
}

.sort-bars span {
  position: absolute;
  inset: 12px 0 auto;
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.list-art {
  justify-items: center;
}

.head-label {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.list-row > b {
  color: var(--amber);
}

.list-node {
  display: grid;
  min-width: 80px;
  min-height: 86px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.list-node.new {
  border-color: var(--green);
  background: rgba(167, 219, 101, 0.12);
}

.list-node strong {
  font-size: 1.5rem;
}

.list-node small,
.null-node {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.tree-art {
  justify-items: center;
  gap: 28px;
}

.tree-level {
  display: flex;
  justify-content: space-around;
  width: 72%;
}

.tree-level.leaves {
  width: 100%;
}

.tree-node {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: rgba(82, 199, 184, 0.09);
  font-size: 1.15rem;
  font-weight: 900;
}

.tree-node.root {
  border-color: var(--violet);
}

.tree-node.hot {
  border-color: var(--green);
  box-shadow: 0 0 24px rgba(167, 219, 101, 0.18);
}

.tree-rule {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
}

.hash-art {
  gap: 8px;
}

.hash-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.hash-row > span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.hash-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.hash-row b {
  padding: 6px 9px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: var(--teal);
}

.hash-row i {
  color: var(--amber);
  font-style: normal;
}

.hash-row.active {
  border-color: var(--amber);
  background: rgba(242, 184, 75, 0.06);
}

.graph-art {
  justify-items: center;
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(3, 72px);
  place-items: center;
}

.graph-node {
  position: relative;
  z-index: 1;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: var(--panel);
  font-weight: 900;
}

.graph-node.start {
  border-color: var(--green);
  background: rgba(167, 219, 101, 0.15);
}

.graph-grid .graph-node:nth-of-type(1) { grid-area: 1 / 2; }
.graph-grid .graph-node:nth-of-type(2) { grid-area: 2 / 1; }
.graph-grid .graph-node:nth-of-type(3) { grid-area: 2 / 3; }
.graph-grid .graph-node:nth-of-type(4) { grid-area: 3 / 1; }
.graph-grid .graph-node:nth-of-type(5) { grid-area: 3 / 3; }

.edge {
  z-index: 0;
  display: block;
  width: 88px;
  height: 2px;
  background: var(--line);
}

.edge.e1 { grid-area: 1 / 1 / 3 / 3; transform: rotate(-45deg); }
.edge.e2 { grid-area: 1 / 2 / 3 / 4; transform: rotate(45deg); }
.edge.e3 { grid-area: 2 / 1 / 4 / 2; transform: rotate(90deg); }
.edge.e4 { grid-area: 2 / 3 / 4 / 4; transform: rotate(90deg); }

.queue-art {
  display: flex;
  gap: 6px;
  align-items: center;
}

.queue-art strong,
.queue-art span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.queue-art strong {
  color: var(--green);
}

.quiz-code-panel {
  overflow: hidden;
}

.quiz-code {
  overflow-x: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(82, 199, 184, 0.28);
  border-radius: 7px;
  background: #171917;
  color: var(--teal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre;
}

.evaluation-summary {
  display: grid;
  gap: 12px;
}

.weakest-card,
.category-report,
.review-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.weakest-card {
  border-color: rgba(242, 184, 75, 0.65);
  background: rgba(242, 184, 75, 0.08);
}

.weakest-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.weakest-card strong {
  display: block;
  font-size: 1.25rem;
}

.weakest-card p,
.review-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.category-report {
  display: grid;
  gap: 12px;
}

.category-result {
  display: grid;
  grid-template-columns: 150px 1fr 92px;
  gap: 12px;
  align-items: center;
}

.category-result span {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.category-result > div {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.category-result i {
  display: block;
  width: var(--accuracy);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--amber), var(--green));
}

.category-result strong {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
  text-align: right;
}

.review-card h3 {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.95rem;
}

.review-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-card li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.review-card li:first-child {
  border-top: 0;
}

.review-card li strong {
  color: var(--coral);
  font-size: 0.8rem;
}

.review-card li span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .site-bar,
  .game-footer {
    width: min(100% - 20px, 680px);
  }

  .game-shell {
    width: min(100% - 20px, 680px);
    padding: 18px 0;
  }

  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }

  .meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-map,
  .course-source {
    grid-template-columns: 1fr;
  }

  .course-map article {
    grid-template-columns: 1fr;
  }

  .course-map span {
    grid-row: auto;
  }

  .concept-scene {
    min-height: 360px;
  }

  .category-result,
  .review-card li {
    grid-template-columns: 1fr;
  }

  .category-result strong {
    text-align: left;
  }

  .arena {
    grid-template-columns: 1fr;
  }

  .scene,
  .challenge {
    min-height: auto;
  }

  .memory-stack {
    height: auto;
    min-height: 360px;
  }

  .memory-stack.compact {
    min-height: 250px;
  }

  .sequence-board {
    grid-template-columns: 1fr;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .file-art {
    grid-template-columns: 1fr;
  }

  .stream-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 520px) {
  .site-bar-label {
    display: none;
  }

  .game-footer {
    flex-direction: column;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .prompt {
    font-size: 1rem;
  }

  .meters {
    grid-template-columns: 1fr;
  }

  .level-chip {
    flex-basis: 118px;
  }

  .search-cells {
    gap: 4px;
  }

  .list-row {
    gap: 4px;
  }

  .list-node {
    min-width: 58px;
  }

  .toolbelt {
    grid-template-columns: 1fr;
  }

  .pipeline-row {
    grid-template-columns: 1fr;
  }

  .array-row {
    grid-template-columns: 44px repeat(8, minmax(18px, 1fr));
    gap: 4px;
  }

  .controls {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
