:root {
  --bg: #061527;
  --paper: #ffffff;
  --ink: #102033;
  --muted: #617089;
  --line: #d7e3f2;
  --blue: #1478ff;
  --cyan: #16d3e6;
  --green: #17b884;
  --yellow: #f7bd21;
  --coral: #ef6a4c;
  --navy: #15244a;
  --shadow: 0 10px 28px rgba(28, 54, 92, .12);
  --r: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(22,211,230,.18), transparent 34rem),
    linear-gradient(180deg, #071527 0%, #0a1d35 46%, #eef7ff 47%, #f7fbff 100%);
  min-height: 100vh;
}

button, input, textarea, select {
  font: inherit;
}

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .62rem clamp(.9rem, 2vw, 1.35rem);
  background: rgba(3, 15, 30, .94);
  border-bottom: 1px solid rgba(22,211,230,.26);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
}

.brand {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 900;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: #f8fbff;
}

.bolt {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  background: rgba(247,189,33,.14);
  color: var(--yellow);
  box-shadow: inset 0 0 0 1px rgba(247,189,33,.35);
}

.nav-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.nav-status span, .teacher-link {
  border: 1px solid rgba(118,183,255,.32);
  background: rgba(9, 30, 55, .92);
  color: #dbeafe;
  border-radius: 8px;
  padding: .48rem .8rem;
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}

.submit, .smallbtn, .big-action {
  border: 0;
  border-radius: 8px;
  padding: .72rem 1rem;
  font-weight: 900;
  color: white;
  background: #0a7ea4;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 10px 20px rgba(22,211,230,.16);
}

.submit.partial { background: #087f9e; }
.submit.final { background: var(--yellow); color: #102033; }
.smallbtn { padding: .58rem .85rem; border-radius: 10px; }
.smallbtn.ghost {
  background: rgba(238,244,251,.95);
  color: var(--navy);
  box-shadow: none;
  border: 1px solid var(--line);
}

main {
  width: min(1680px, calc(100% - 1.2rem));
  margin: 0 auto;
  padding: .85rem 0 4rem;
}

.board {
  display: flex;
  flex-direction: column;
}
.board > * { order: 10; }
.board > .control-room { order: 1; }
.board > .quest-header { order: 2; }
.board > .recommend-box { order: 3; }
.board > .core-section { order: 4; }
.board > .deep-section { order: 5; }
.board > .final-section { order: 6; }

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(16, 32, 51, .35);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.overlay.gone { display: none; }

.start-card {
  width: min(900px, calc(100vw - 2rem));
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.4rem;
  align-items: center;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 1.5rem;
  max-height: min(92vh, 760px);
  overflow-y: auto;
  overflow-x: hidden;
}
.start-card > div { min-width: 0; }

.guide { width: 100%; max-height: 420px; object-fit: contain; }
.guide.mini {
  width: 150px;
  height: 150px;
  object-fit: contain;
  align-self: end;
}

.start-card h1, .quest-header h1, .mission-title h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.start-card p, .intro p, .mission-title p {
  color: var(--muted);
  line-height: 1.55;
  font-weight: 650;
  overflow-wrap: anywhere;
}

label {
  display: grid;
  gap: .35rem;
  margin: .7rem 0;
  font-weight: 900;
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: .8rem .9rem;
  background: #f8fbff;
  color: var(--ink);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
}

.err { min-height: 1.2rem; color: #d23b46; font-weight: 800; }
.privacy { font-size: .9rem; }

.diagnosis {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .9rem;
  margin: .8rem 0;
  background: #f7fbff;
}
.diagnosis label { margin: .5rem 0; }
.diagnosis legend {
  padding: 0 .35rem;
  color: var(--navy);
  font-weight: 900;
}
.diagnosis-hint {
  margin: .1rem 0 .55rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.35;
}

.quest-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.2rem;
  align-items: stretch;
}

.intro {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1rem;
  background: rgba(255,255,255,.74);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.quest-panel, .recommend-box, .badges, .sources-note, .info-panel, .tasks-panel {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.quest-panel {
  display: grid;
  gap: .75rem;
  padding: 1rem;
}

.quest-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem .8rem;
  align-items: center;
}

.quest-stat span { color: var(--muted); font-weight: 800; }
.quest-stat b { color: var(--navy); }
.quest-stat i {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 12px;
  background: #e8eef7;
  overflow: hidden;
}
.quest-stat em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  width: 0%;
  transition: width .3s ease;
}

.recommend-box {
  margin: 1rem 0;
  padding: .95rem 1.1rem;
  display: flex;
  gap: .7rem;
  align-items: center;
  flex-wrap: wrap;
}

.recommend-box strong {
  color: var(--blue);
}

.control-room {
  display: grid;
  grid-template-columns: 340px minmax(420px, 1fr) 360px;
  gap: .75rem;
  align-items: stretch;
  min-height: min(860px, calc(100vh - 5.1rem));
  margin: .15rem 0 1.2rem;
  padding: .75rem;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(22,211,230,.2), transparent 35%),
    linear-gradient(135deg, #07182c 0%, #0a2540 50%, #061221 100%);
  border: 1px solid rgba(22,211,230,.18);
  box-shadow: 0 24px 54px rgba(0,0,0,.35);
  color: #f7fafc;
}
.cockpit, .mission-log {
  border: 1px solid rgba(76,156,204,.28);
  background: linear-gradient(180deg, rgba(4,18,34,.92), rgba(4,16,30,.86));
  border-radius: 8px;
  padding: .9rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 24px rgba(0,0,0,.25);
}
.cockpit h2, .mission-log h2 {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: baseline;
  margin: 0 0 .85rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #f7fafc;
}
.cockpit h2 span, .mission-log h2 span {
  color: #b8c8dc;
  font-size: .78rem;
  font-weight: 800;
  text-transform: none;
}
.cockpit-focus {
  margin: 0 0 .75rem;
  color: #d9e7f3;
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.45;
}
.cockpit-action {
  width: 100%;
  margin: .75rem 0 .8rem;
  background: #0995ad;
}
.cockpit-metric {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: .28rem .65rem;
  align-items: center;
  padding: .72rem .55rem;
  border: 1px solid rgba(76,156,204,.18);
  border-radius: 8px;
  margin: .5rem 0;
  background: rgba(0, 31, 58, .48);
}
.cockpit-metric::before {
  content: "";
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: radial-gradient(circle, currentColor 0 5px, transparent 6px);
  opacity: .92;
}
.cockpit-metric span { color: #e7f3ff; font-weight: 900; text-transform: uppercase; font-size: .86rem; }
.cockpit-metric b { color: #39bfc3; font-size: 1.15rem; }
.cockpit-metric.co2 b { color: #6baa5b; }
.cockpit-metric.cost b { color: #f6c945; }
.cockpit-metric.acceptance b { color: #7ab7ff; }
.cockpit-metric i {
  grid-column: 2 / 4;
  height: 9px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(220,236,242,.18) 0 22px, transparent 22px 25px),
    rgba(220,236,242,.08);
  overflow: hidden;
}
.cockpit-metric em {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
}
.mix-donut-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid rgba(76,156,204,.18);
  border-radius: 8px;
  background: rgba(0,31,58,.4);
}
.mix-donut-card h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: #f7fafc;
  font-size: .9rem;
  text-transform: uppercase;
}
.mix-donut {
  width: 122px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#16d3e6 0 26.4%, #f7bd21 26.4% 44.5%, #ef6a4c 44.5% 61.5%, #7c5b42 61.5% 82%, #93a4b8 82% 100%);
  position: relative;
  box-shadow: 0 0 18px rgba(22,211,230,.18);
}
.mix-donut::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: #04182d;
}
.mix-donut-card ul {
  display: grid;
  gap: .28rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mix-donut-card li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: .45rem;
  align-items: center;
  color: #cbd9e8;
  font-size: .86rem;
  font-weight: 800;
}
.mix-donut-card li span { width: 10px; height: 10px; border-radius: 2px; }
.mix-donut-card .wind { background: #16d3e6; }
.mix-donut-card .solar { background: #f7bd21; }
.mix-donut-card .gas { background: #ef6a4c; }
.mix-donut-card .coal { background: #7c5b42; }
.mix-donut-card b { color: #f7fafc; }
.fact-ticker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .42rem;
  margin-top: .7rem;
}
.fact-ticker p {
  display: grid;
  gap: .15rem;
  margin: 0;
  padding: .48rem;
  border-radius: 8px;
  background: rgba(220,236,242,.08);
}
.fact-ticker b { color: #f6c945; }
.fact-ticker span { color: #c7d6e3; font-size: .75rem; font-weight: 750; line-height: 1.25; }
.energy-map {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(300px, 445px) auto auto;
  gap: .55rem;
  align-content: start;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 40%, rgba(65,174,218,.18), transparent 34%),
    linear-gradient(180deg, rgba(7,33,57,.5), rgba(3,15,28,.1));
}
.map-toolbar {
  display: flex;
  justify-content: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.map-toolbar button {
  border: 1px solid rgba(220,236,242,.25);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #d9e7f3;
  padding: .45rem .7rem;
  font-size: .82rem;
  font-weight: 900;
}
.map-toolbar button.active {
  background: #f7fafc;
  color: var(--navy);
  border-color: transparent;
}
.map-shape {
  position: relative;
  justify-self: center;
  align-self: center;
  width: min(100%, 710px);
  aspect-ratio: 1.55 / 1;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, rgba(57,191,195,.18), transparent 62%),
    radial-gradient(circle at 50% 45%, rgba(167,219,255,.12), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.map-shape::before {
  content: "";
  position: absolute;
  inset: 3%;
  border: 1px solid rgba(220,236,242,.13);
  border-radius: 16px;
}
.map-base {
  position: absolute;
  inset: -18% 0 -14% 0;
  width: 100%;
  height: 132%;
  object-fit: contain;
  filter: drop-shadow(0 26px 24px rgba(0,0,0,.45));
  pointer-events: none;
}
.flow {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #39bfc3, transparent);
  opacity: .8;
  animation: pulseFlow 2.8s linear infinite;
}
.flow.f1 { width: 54%; left: 23%; top: 37%; transform: rotate(21deg); }
.flow.f2 { width: 45%; left: 31%; top: 58%; transform: rotate(-21deg); animation-delay: .6s; }
.flow.f3 { width: 32%; left: 43%; top: 73%; transform: rotate(28deg); animation-delay: 1.1s; }
@keyframes pulseFlow { 0%,100% { opacity: .35; } 50% { opacity: .95; } }
.map-marker {
  position: absolute;
  display: grid;
  place-items: center;
  gap: .15rem;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(16,32,51,.18);
  border-radius: 8px;
  background: rgba(4,22,39,.88);
  color: #f5fbff;
  font-size: .67rem;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(22,211,230,.22);
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.map-marker:hover, .map-marker.active {
  transform: translateY(-4px);
  box-shadow: 0 0 0 4px rgba(247,189,33,.34), 0 16px 26px rgba(16,32,51,.28);
}
.map-marker img { max-width: 46px; max-height: 38px; object-fit: contain; }
.map-marker span {
  max-width: 6.8em;
  line-height: 1.1;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.energy-map[data-layer="generation"] .map-marker:not([data-layer="generation"]),
.energy-map[data-layer="grid"] .map-marker:not([data-layer="grid"]),
.energy-map[data-layer="conflict"] .map-marker:not([data-layer="conflict"]),
.energy-map[data-layer="system"] .map-marker:not([data-layer="system"]) {
  opacity: .38;
}
.map-marker.north { left: 14%; top: 10%; }
.map-marker.corridor { left: 48%; top: 31%; }
.map-marker.west { left: 9%; top: 43%; }
.map-marker.east { right: 18%; top: 28%; }
.map-marker.south { right: 17%; bottom: 10%; }
.map-marker.center { left: 48%; top: 57%; }
.map-marker.storm { right: 6%; top: 8%; }
.map-readout {
  align-self: end;
  display: grid;
  gap: .35rem;
  padding: .55rem .72rem;
  border: 1px solid rgba(76,156,204,.28);
  border-radius: 8px;
  background: rgba(4,18,34,.88);
  box-shadow: 0 12px 22px rgba(0,0,0,.22);
}
.map-readout b { color: #f6c945; }
.map-readout p {
  margin: 0;
  color: #d9e7f3;
  font-weight: 750;
  line-height: 1.32;
  font-size: .88rem;
}
.map-readout .source-row { margin-top: .25rem; }
.map-readout .source-row a {
  background: rgba(255,255,255,.12);
  color: #e8f4ff;
  border: 1px solid rgba(220,236,242,.18);
}
.mission-toolbelt {
  border: 1px solid rgba(76,156,204,.28);
  border-radius: 8px;
  background: rgba(4,18,34,.88);
  padding: .62rem;
  box-shadow: 0 12px 22px rgba(0,0,0,.22);
}
.mission-toolbelt h3 {
  margin: 0 0 .45rem;
  color: #f7fafc;
  font-size: .98rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.mission-toolbelt > div {
  display: grid;
  grid-template-columns: repeat(8, minmax(92px, 1fr));
  gap: .5rem;
}
.mission-toolbelt button {
  display: grid;
  gap: .28rem;
  justify-items: center;
  min-height: 76px;
  border: 1px solid rgba(76,156,204,.28);
  border-radius: 8px;
  background: rgba(10,42,72,.78);
  color: #eaf6ff;
  padding: .42rem;
  text-align: center;
}
.mission-toolbelt button.recommended {
  border-color: rgba(247,189,33,.8);
  box-shadow: 0 0 0 2px rgba(247,189,33,.14);
}
.mission-toolbelt button.done {
  border-color: rgba(23,184,132,.75);
}
.mission-toolbelt img {
  width: 30px;
  height: 27px;
  object-fit: contain;
}
.mission-toolbelt b {
  color: #f7fafc;
  font-size: .72rem;
  line-height: 1.1;
}
.mission-toolbelt span {
  display: none;
}
.mission-toolbelt em {
  color: var(--yellow);
  font-style: normal;
  font-size: .68rem;
  font-weight: 950;
}
.log-row {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: .65rem;
  align-items: center;
  border: 1px solid rgba(76,156,204,.18);
  border-radius: 8px;
  background: rgba(10,42,72,.5);
  color: #f7fafc;
  padding: .65rem;
  margin: .45rem 0;
  text-align: left;
}
.log-row.hot { border-color: rgba(246,201,69,.7); background: rgba(49,48,23,.4); }
.log-row img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(22,211,230,.08);
  border: 1px solid rgba(22,211,230,.22);
}
.log-row span { display: grid; gap: .12rem; }
.log-row b { color: #f7fafc; }
.log-row em { color: #b9c9d9; font-style: normal; font-size: .82rem; }
.log-row strong { color: #f6c945; }
.log-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid rgba(118,183,255,.22);
}
.log-tabs span {
  color: #b9c9d9;
  text-align: center;
  padding: .5rem .3rem;
  font-weight: 950;
  text-transform: uppercase;
  font-size: .82rem;
}
.log-tabs span:first-child {
  color: var(--cyan);
  border-bottom: 2px solid var(--cyan);
}

.map-section, .badges, .sources-note {
  margin: 1.2rem 0;
  padding: 1rem;
}

.map-section h2, .badges h2, .sources-note h2, .tasks-panel h2 {
  margin: 0 0 .9rem;
  color: var(--navy);
}
.map-section h2 span {
  color: var(--muted);
  font-size: .9rem;
  margin-left: .5rem;
}

.mission-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 1rem;
}
.deep-map { grid-template-columns: repeat(3, minmax(190px, 1fr)); }
.final-map { grid-template-columns: minmax(220px, 380px); }

.mission-node {
  --c: var(--blue);
  position: relative;
  min-height: 260px;
  border: 0;
  border-radius: 12px;
  text-align: left;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  overflow: hidden;
  display: grid;
  grid-template-rows: 100px 1fr;
  transition: transform .18s ease, border-color .18s ease;
}
.mission-node:hover { transform: translateY(-5px); border-color: var(--c); }
.mission-node.done { border-color: var(--yellow); }
.mission-node.recommended { box-shadow: 0 0 0 4px rgba(247,189,33,.28), var(--shadow); }
.mission-node.locked { filter: grayscale(.45); }

.node-photo {
  background-image: var(--img);
  background-size: cover;
  background-position: center;
}
.node-asset {
  position: absolute;
  top: 42px;
  right: .65rem;
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(16,32,51,.22));
}
.node-body {
  display: grid;
  gap: .45rem;
  padding: .85rem;
}
.node-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
}
.node-nr, .node-state {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, white);
  color: var(--c);
  font-weight: 1000;
  padding: .25rem .55rem;
}
.node-state {
  font-size: .78rem;
  color: var(--navy);
  background: #eef4fb;
}
.node-body b { font-size: 1.05rem; color: var(--navy); }
.node-body span { color: var(--muted); font-weight: 650; line-height: 1.35; }
.node-meta, .node-score { font-size: .82rem; }

#badgeList {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
#badgeList span {
  border-radius: 999px;
  padding: .55rem .8rem;
  background: #fff7db;
  color: #7c5b00;
  font-weight: 900;
}

.sources-note p { color: var(--muted); font-weight: 650; line-height: 1.55; }
.source-fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .9rem;
}
.source-fact-grid a {
  display: grid;
  gap: .25rem;
  min-height: 112px;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  text-decoration: none;
}
.source-fact-grid b { color: var(--navy); font-size: 1.15rem; }
.source-fact-grid span { color: var(--ink); font-weight: 800; line-height: 1.3; }
.source-fact-grid em { color: var(--muted); font-style: normal; font-size: .8rem; font-weight: 750; }
.inline-action {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  text-decoration: none;
  margin-top: .65rem;
}

.media-shelf {
  margin: 1.2rem 0;
  padding: 1rem;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.media-shelf h2 { margin: 0 0 .9rem; color: var(--navy); }
#mediaShelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}
.media-card {
  display: grid;
  gap: .55rem;
  align-content: start;
  min-height: 250px;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
}
.media-card h3 { margin: 0; color: var(--navy); }
.media-card p, .media-card small { margin: 0; color: var(--muted); font-weight: 700; line-height: 1.4; }
.media-meta, .media-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
}
.media-meta span {
  border-radius: 999px;
  background: #eef4fb;
  color: var(--navy);
  padding: .28rem .48rem;
  font-size: .76rem;
  font-weight: 900;
}
.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  background: #102033;
}
.external-note {
  margin: -.25rem 0 .9rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}
.mission-media {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.mission-media h3 {
  margin: 0;
  color: var(--navy);
}
.mission-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.asset-credits, .bonus-game {
  margin: 1.2rem 0;
  padding: 1rem;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.asset-credits h2, .bonus-game h2 { margin: 0 0 .75rem; color: var(--navy); }
.asset-credits p, .bonus-game p { color: var(--muted); font-weight: 700; line-height: 1.45; }
.credits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}
.credit-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  padding: .7rem;
}
.credit-card summary { cursor: pointer; color: var(--navy); font-weight: 900; }
.credit-card p, .credit-card small, .credit-card li {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}
.credit-card a { color: var(--blue); font-weight: 850; }

.sources-page {
  display: grid;
  gap: 1rem;
}
.sources-hero, .sources-block {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.sources-hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.04;
}
.sources-hero p, .sources-block p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}
.sources-block h2 {
  margin: 0 0 .8rem;
  color: var(--navy);
}
.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.source-card {
  display: grid;
  gap: .45rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
}
.source-card h3 {
  margin: 0;
  color: var(--navy);
}
.source-card p, .source-card small {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}
.source-card a {
  color: var(--blue);
  font-weight: 900;
  width: fit-content;
}

.runner-game {
  position: relative;
  height: 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #dff4ff 0%, #f7fbff 62%, #dff5df 63%);
}
.runner-game:focus { outline: 3px solid rgba(20,120,255,.25); }
.runner-game.hit { box-shadow: inset 0 0 0 4px rgba(239,106,76,.35); }
.runner-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 28%, rgba(247,189,33,.38) 0 34px, transparent 35px),
    linear-gradient(90deg, rgba(57,191,195,.12), rgba(23,184,132,.10));
}
.runner-pilot {
  position: absolute;
  left: 28px;
  bottom: 26px;
  width: 72px;
  height: 92px;
  object-fit: contain;
  z-index: 2;
  transition: transform .04s linear;
}
.runner-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  height: 68px;
  border-top: 3px solid rgba(21,36,74,.2);
}
.runner-item {
  position: absolute;
  left: 0;
  bottom: 4px;
  white-space: nowrap;
  border-radius: 999px;
  padding: .38rem .62rem;
  font-weight: 950;
  box-shadow: var(--shadow);
}
.runner-item.fact { background: #e9fbf3; color: #0f6f4e; border: 1px solid rgba(23,184,132,.35); }
.runner-item.hazard { background: #fff0ef; color: #9f2c1e; border: 1px solid rgba(239,106,76,.35); }
.runner-controls {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.runner-controls span {
  color: var(--navy);
  font-weight: 950;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .48rem .75rem;
  background: #f7fbff;
}
.runner-debrief {
  display: grid;
  gap: .65rem;
  margin-top: .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  padding: .8rem;
}
.runner-debrief h3 {
  margin: 0;
  color: var(--navy);
}
.runner-debrief p {
  margin: 0;
}
.runner-debrief article {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(0, 1.4fr) auto;
  gap: .65rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: .65rem;
}
.runner-debrief b { color: var(--navy); }
.runner-debrief span { color: var(--muted); font-weight: 750; line-height: 1.35; }

.mission-head {
  display: grid;
  gap: 1rem;
}

.mission-hero {
  min-height: 190px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.mission-title {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.mission-score {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}
.mission-score span {
  border-radius: 12px;
  background: #eef4fb;
  padding: .5rem .8rem;
  font-weight: 900;
}

.mission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 1rem;
  margin-top: 1rem;
}

.mission-main, .tasks-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.tasks-panel {
  padding: 1rem;
}

.source-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .7rem;
}
.source-row a, .small-link {
  color: var(--blue);
  background: #eef6ff;
  border-radius: 12px;
  padding: .42rem .65rem;
  font-weight: 800;
  font-size: .82rem;
  text-decoration: none;
}

.mission-guide, .task-help, .phet-fallback {
  border: 1px solid rgba(20,120,255,.2);
  border-radius: 10px;
  background: #f2f8ff;
  padding: .75rem;
}
.mission-guide summary, .task-help summary, .phet-fallback summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 950;
}
.mission-guide {
  display: grid;
  gap: .55rem;
  margin: .7rem 0;
}
.mission-guide div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: .55rem;
}
.mission-guide b { color: var(--blue); }
.mission-guide span, .task-help p, .phet-fallback p, .phet-fallback li {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}
.task-help {
  margin: .3rem 0;
}
.task-help p { margin: .5rem 0 0; }
.phet-fallback {
  margin-top: .65rem;
}
.phet-fallback ol {
  margin: .55rem 0;
  padding-left: 1.2rem;
}

.info-panel {
  padding: 1rem;
}
.info-panel h3 { margin-top: 0; color: var(--navy); }
.info-panel p { color: var(--muted); font-weight: 650; line-height: 1.55; }

.lab-grid, .sim {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 1rem;
}

.mix-lab, .sim-chart, .sim-controls, .phet-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.mix-budget {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .45rem .65rem;
  align-items: center;
  padding: .7rem;
  border: 1px solid rgba(23,184,132,.28);
  border-radius: 10px;
  background: #effdf6;
  margin-bottom: .75rem;
}
.mix-budget.warn {
  border-color: rgba(239,106,76,.35);
  background: #fff5f2;
}
.mix-budget b, .mix-budget span { color: var(--navy); font-weight: 950; }
.mix-budget i {
  height: 10px;
  border-radius: 999px;
  background: #dce7f2;
  overflow: hidden;
}
.mix-budget em {
  display: block;
  height: 100%;
  background: var(--green);
}
.mix-budget.warn em { background: var(--coral); }
.mix-budget small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 750;
}
.mix-justify {
  margin-top: .9rem;
}

.mix-row, .slider {
  display: grid;
  grid-template-columns: 110px 1fr 54px;
  gap: .7rem;
  align-items: center;
  margin: .65rem 0;
}
.mix-row b {
  grid-column: 2 / 4;
  height: 10px;
  width: 20%;
  background: var(--bar);
  border-radius: 999px;
}

.compare-line {
  display: grid;
  grid-template-columns: 100px 1fr 70px;
  gap: .6rem;
  align-items: center;
  margin: .35rem 0;
}
.compare-line i {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.phet-card {
  display: grid;
  gap: .8rem;
}
.privacy, .muted {
  color: var(--muted);
  font-size: .92rem;
}
.phet-frame {
  width: 100%;
  aspect-ratio: 834 / 504;
  border: 0;
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.stacked-labs {
  display: grid;
  gap: 1rem;
}

.corridor-lab, .argument-lab {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.corridor-head {
  display: grid;
  gap: .7rem;
}
.corridor-head h3, .corridor-head p { margin: 0 0 .35rem; }
.corridor-map {
  position: relative;
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(57,191,195,.14), rgba(23,184,132,.08)),
    radial-gradient(circle at 28% 40%, rgba(239,106,76,.12), transparent 70px),
    radial-gradient(circle at 68% 54%, rgba(23,184,132,.16), transparent 86px),
    #f7fbff;
}
.corridor-map .hub, .corridor-map .zone {
  position: absolute;
  border-radius: 999px;
  padding: .42rem .62rem;
  font-weight: 950;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  z-index: 2;
}
.corridor-map .north { left: 1rem; top: 1rem; }
.corridor-map .south { right: 1rem; bottom: 1rem; }
.corridor-map .city { left: 32%; top: 34%; background: #fff0ef; }
.corridor-map .forest { right: 20%; top: 26%; background: #e9fbf3; }
.corridor-map .road { left: 18%; bottom: 24%; background: #eef4fb; }
.corridor-map .line {
  position: absolute;
  inset: 40px 54px 42px 54px;
  border-radius: 44% 56% 52% 48%;
  opacity: .18;
  border: 8px solid var(--blue);
}
.corridor-map .direct { transform: rotate(-27deg) scale(.7, 1.3); border-color: var(--coral); }
.corridor-map .bundled { transform: rotate(-18deg) scale(.95, 1.08); border-color: var(--blue); }
.corridor-map .detour { transform: rotate(-9deg) scale(1.18, 1.18); border-color: var(--green); }
.corridor-map.route-direct .direct,
.corridor-map.route-bundled .bundled,
.corridor-map.route-detour .detour {
  opacity: .95;
  box-shadow: 0 0 0 4px rgba(255,255,255,.78);
}
.planner-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.planner-controls .big-action { grid-column: 1 / -1; }
.planner-choice {
  display: grid;
  gap: .45rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem;
  background: #f7fbff;
}
.planner-choice legend {
  padding: 0 .3rem;
  color: var(--navy);
  font-weight: 950;
}
.planner-choice label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .45rem;
  align-items: start;
  margin: 0;
  font-weight: 800;
}
.planner-choice input { width: auto; margin-top: .24rem; }
.planner-choice b { display: block; color: var(--navy); }
.planner-choice small { display: block; color: var(--muted); font-weight: 700; line-height: 1.35; }
.planner-result {
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  padding: .75rem;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}
.metric-grid p {
  display: grid;
  gap: .2rem;
  margin: 0;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--line);
  padding: .65rem;
}
.metric-grid span { color: var(--muted); font-weight: 850; }
.metric-grid b { color: var(--navy); font-size: 1.15rem; }

.argument-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.argument-card {
  display: grid;
  gap: .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  padding: .8rem;
}
.argument-card > b { color: var(--navy); line-height: 1.35; }
.argument-card.right { border-color: rgba(23,184,132,.45); background: #f2fff9; }
.argument-card.wrong { border-color: rgba(239,106,76,.45); background: #fff8f7; }
.argument-evidence, .argument-rewrite {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
}
.argument-evidence select, .argument-rewrite textarea {
  margin-top: .35rem;
}
.argument-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.argument-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  padding: .45rem .65rem;
  font-weight: 900;
}
.argument-feedback {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.formula-wall, .option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.energy-compass {
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
}
.energy-compass .system-facts {
  grid-column: 1 / -1;
}
.energy-share {
  display: grid;
  grid-template-columns: 130px 1fr 64px;
  gap: .55rem;
  align-items: center;
  margin: .55rem 0;
}
.energy-share span { font-weight: 900; color: var(--navy); }
.energy-share i {
  height: 12px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}
.energy-share em {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.energy-share b { color: var(--navy); text-align: right; }
.energy-share small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}
.system-facts ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.system-facts li {
  display: grid;
  gap: .25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem;
  background: #f7fbff;
}
.system-facts b { color: var(--blue); }
.system-facts span { color: var(--muted); font-weight: 700; }
.formula-wall div, .option-grid div {
  border: 1px solid var(--line);
  background: #f7fbff;
  border-radius: 10px;
  padding: .8rem;
}
.formula-wall b { display: block; color: var(--blue); font-size: 1.25rem; }
.formula-wall span { color: var(--muted); font-weight: 700; }

.sim { grid-template-columns: minmax(0, 1fr) 280px; }
.sim canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.sim-challenge {
  display: grid;
  gap: .2rem;
  margin: .2rem 0 .75rem;
  padding: .7rem;
  border: 1px solid rgba(20,120,255,.18);
  border-radius: 10px;
  background: #eef6ff;
}
.sim-challenge b { color: var(--navy); }
.sim-challenge span { color: var(--muted); font-weight: 750; line-height: 1.35; }
.sim-controls { display: grid; gap: .65rem; align-content: start; }
.slider {
  grid-template-columns: 1fr 120px 36px;
  margin: 0;
}
#simResult div {
  display: grid;
  gap: .3rem;
  margin-top: .7rem;
  padding: .8rem;
  border-radius: 10px;
}
#simResult .good { background: #e9fbf3; color: #0f6f4e; }
#simResult .bad { background: #fff0ef; color: #9f2c1e; }

.fake-chart {
  height: 180px;
  display: flex;
  align-items: end;
  gap: 1rem;
  border-left: 4px solid var(--navy);
  border-bottom: 4px solid var(--navy);
  padding: 0 1rem;
}
.fake-chart span {
  width: 70px;
  background: linear-gradient(var(--blue), var(--green));
  color: white;
  border-radius: 8px 8px 0 0;
  display: grid;
  place-items: end center;
  padding: .4rem;
  font-weight: 900;
}

.task {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: .9rem;
}
.task.done { border-color: rgba(23,184,132,.45); background: #f2fff9; }
.task.optional { border-style: dashed; }
.task-head {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  font-weight: 900;
  color: var(--muted);
}
.task p { color: var(--ink); font-weight: 750; line-height: 1.45; }
.task-body { display: grid; gap: .55rem; }
.answer {
  border: 2px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: .72rem .8rem;
  text-align: left;
  font-weight: 800;
  color: var(--ink);
}
.answer:hover { border-color: var(--blue); }
.answer.right { border-color: var(--green); background: #e9fbf3; }
.answer.wrong { border-color: var(--coral); background: #fff0ef; }
.task-feedback {
  min-height: 1.4rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
  margin-top: .5rem;
}
.precheck-note {
  margin: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.4;
}
.correction-note {
  display: grid;
  gap: .25rem;
  margin: 0;
  padding: .75rem;
  border: 1px solid rgba(20,120,255,.22);
  border-radius: 10px;
  background: #eef6ff;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}
.correction-note b { color: var(--navy); }
.correction-note small { color: var(--muted); font-weight: 700; }
.ok { color: #0b835a; font-weight: 1000; }
.warn { color: #b33b2c; font-weight: 1000; }

.numrow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .5rem;
  align-items: center;
}
.matchrow {
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem;
}
.checkrow {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-weight: 800;
}
.checkrow input { width: auto; margin-top: .15rem; }
.cloze {
  line-height: 2.45;
  font-weight: 850;
}
.cloze select {
  display: inline-block;
  width: auto;
  min-width: 150px;
  margin: 0 .25rem;
  padding: .45rem .6rem;
}
.order-list {
  display: grid;
  gap: .5rem;
  padding-left: 1.2rem;
}
.order-list li {
  display: grid;
  grid-template-columns: 1fr 42px 42px;
  gap: .4rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem;
  background: white;
  font-weight: 850;
}
.order-list button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4fb;
  color: var(--navy);
  font-weight: 900;
}
.classify {
  display: grid;
  gap: .8rem;
}
.chip-tray, .drop-bins {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}
.drag-chip {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  padding: .55rem .75rem;
  font-weight: 900;
}
.drag-chip.picked { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(247,189,33,.25); }
.drop-bin {
  flex: 1 1 220px;
  min-height: 130px;
  display: flex;
  gap: .5rem;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  border: 2px dashed #b8c6d6;
  border-radius: 10px;
  padding: .65rem;
  background: #f7fbff;
}
.drop-bin strong {
  width: 100%;
  color: var(--navy);
}
.classify-fallback {
  display: grid;
  gap: .45rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.classify-fallback > strong { color: var(--navy); }
.classify-fallback label {
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1fr);
  gap: .55rem;
  align-items: center;
  margin: 0;
}
textarea { width: 100%; resize: vertical; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(150%);
  background: var(--navy);
  color: white;
  padding: .9rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 70;
  transition: transform .2s ease;
  max-width: min(560px, calc(100% - 2rem));
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 1180px) {
  .topbar, .nav-status { align-items: stretch; }
  .topbar { flex-direction: column; }
  .quest-header, .mission-layout, .lab-grid, .sim, .start-card, .control-room {
    grid-template-columns: 1fr;
  }
  .energy-map { min-height: 620px; }
  .source-fact-grid, #mediaShelf, .mission-media-grid, .source-list, .system-facts ul, .credits-grid, .planner-controls, .metric-grid, .argument-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mission-toolbelt > div {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mission-map, .deep-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .runner-debrief article {
    grid-template-columns: 1fr;
  }
  .guide.mini { width: 110px; height: 110px; }
}

@media (max-width: 980px) {
  .energy-map { min-height: 580px; }
}

@media (max-width: 640px) {
  main { width: min(100% - 1rem, 1240px); }
  .board > .quest-header { order: 1; }
  .board > .recommend-box { order: 2; }
  .board > .core-section { order: 3; }
  .board > .deep-section { order: 4; }
  .board > .final-section { order: 5; }
  .board > .badges { order: 6; }
  .board > .control-room { order: 7; }
  .overlay { padding: .5rem; }
  .start-card {
    width: calc(100vw - 1rem);
    padding: 1rem;
    gap: .7rem;
  }
  .start-card > .guide {
    width: min(210px, 68%);
    max-height: 230px;
    justify-self: center;
  }
  .intro { grid-template-columns: 1fr; }
  .guide.mini { display: none; }
  .mission-map, .deep-map, .final-map, .formula-wall, .option-grid, .source-fact-grid, #mediaShelf, .mission-media-grid, .source-list, .system-facts ul, .credits-grid, .planner-controls, .metric-grid, .argument-cards {
    grid-template-columns: 1fr;
  }
  .control-room { padding: .7rem; }
  .energy-map { min-height: 500px; }
  .map-shape { width: min(100%, 390px); }
  .mission-toolbelt > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mission-guide div { grid-template-columns: 1fr; }
  .map-marker {
    width: 66px;
    height: 66px;
    font-size: .58rem;
  }
  .map-marker img { max-width: 42px; max-height: 36px; }
  .map-marker.north { left: 8%; top: 8%; }
  .map-marker.west { left: 3%; top: 43%; }
  .map-marker.corridor { left: 42%; top: 33%; }
  .map-marker.east { right: 6%; top: 29%; }
  .map-marker.center { left: 41%; top: 58%; }
  .map-marker.south { right: 8%; bottom: 8%; }
  .map-marker.storm { right: 2%; top: 8%; }
  .mission-node { min-height: 230px; }
  .mix-row, .slider, .compare-line, .numrow, .energy-share {
    grid-template-columns: 1fr;
  }
  .mix-budget { grid-template-columns: 1fr; }
  .start-card h1, .quest-header h1, .mission-title h1 {
    font-size: 2.15rem;
  }
}
