:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #b9d5ef;
  --cyan: #76dcff;
  --gold: #f7d46b;
  --violet: #b693ff;
  --mint: #72f0b0;
  --coral: #ff9f7a;
  --panel: rgba(10, 24, 45, 0.72);
  --line: rgba(159, 222, 255, 0.52);
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #091427;
}

button,
input {
  font: inherit;
}

.game-shell {
  min-height: 100vh;
}

.scene {
  position: relative;
  min-height: 100vh;
  padding: 28px clamp(18px, 4vw, 58px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 22%, rgba(255, 255, 255, 0.38), transparent 11%),
    linear-gradient(145deg, rgba(255, 159, 122, 0.28), transparent 28%),
    linear-gradient(225deg, rgba(114, 240, 176, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(89, 166, 236, 0.72), rgba(20, 51, 103, 0.42) 39%, rgba(11, 18, 43, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 800'%3E%3Cpath fill='%23294569' d='M0 386h80v-91h36v91h78V214h48v172h85V318h32v68h92V158h66v228h78V246h48v140h84V188h54v198h89V108h72v278h69V259h37v127h82V202h57v184h147v414H0z'/%3E%3Cpath fill='%235f8ebd' opacity='.7' d='M0 421h104v-58h50v58h124v-93h64v93h134v-64h42v64h175v-99h60v99h132v-69h48v69h122v-115h67v115h278v379H0z'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.scene::before,
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scene::before {
  background:
    linear-gradient(90deg, rgba(5, 12, 30, 0.55), transparent 24%, transparent 72%, rgba(4, 12, 28, 0.38)),
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(118, 220, 255, 0.05) 21px 22px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%2376dcff' stroke-opacity='.16' stroke-width='1.5'%3E%3Cpath d='M24 34h44v26h34v44h42'/%3E%3Cpath d='M18 132h46V94h28V52h52'/%3E%3Cpath d='M112 20v30h30v36'/%3E%3Ccircle cx='24' cy='34' r='4'/%3E%3Ccircle cx='102' cy='60' r='3'/%3E%3Ccircle cx='144' cy='104' r='4'/%3E%3Ccircle cx='64' cy='132' r='3'/%3E%3C/g%3E%3Cg fill='%23f7d46b' fill-opacity='.18'%3E%3Cpath d='M156 30l3 8 8 3-8 3-3 8-3-8-8-3 8-3z'/%3E%3Cpath d='M38 88l2 6 6 2-6 2-2 6-2-6-6-2 6-2z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 180px 180px;
}

.scene::after {
  opacity: 0.78;
  background:
    linear-gradient(180deg, transparent 56%, rgba(2, 9, 20, 0.42)),
    repeating-linear-gradient(120deg, transparent 0 42px, rgba(255, 255, 255, 0.045) 43px 44px),
    repeating-linear-gradient(60deg, transparent 0 58px, rgba(114, 240, 176, 0.055) 59px 60px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0 18%, #000 34% 100%);
  mask-image: linear-gradient(180deg, transparent 0 18%, #000 34% 100%);
}

.skyline,
.holo-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.skyline::before {
  content: "哈尔滨工业大学（深圳）";
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 54px;
  border: 2px solid rgba(233, 246, 255, 0.45);
  background:
    linear-gradient(90deg, rgba(118, 220, 255, 0.16), rgba(247, 212, 107, 0.1), rgba(182, 147, 255, 0.14)),
    rgba(17, 39, 73, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 18px 44px rgba(0, 0, 0, 0.22);
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.42);
}

.holo-grid::after {
  content: "010010  AI  IC  COMM  AUTO  EE  CS";
  position: absolute;
  right: 34px;
  top: 30px;
  width: 320px;
  color: rgba(213, 240, 255, 0.28);
  font-family: Consolas, monospace;
  font-size: 18px;
  line-height: 1.8;
  text-align: right;
}

.holo-grid::before {
  content: "";
  position: absolute;
  right: clamp(24px, 7vw, 110px);
  top: 112px;
  width: min(34vw, 430px);
  aspect-ratio: 1.65;
  border: 1px solid rgba(159, 222, 255, 0.22);
  opacity: 0.68;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(118, 220, 255, 0.16) 18% 19%, transparent 19% 54%, rgba(247, 212, 107, 0.18) 54% 55%, transparent 55%),
    linear-gradient(0deg, transparent 0 28%, rgba(114, 240, 176, 0.14) 28% 29%, transparent 29% 70%, rgba(182, 147, 255, 0.16) 70% 71%, transparent 71%),
    repeating-linear-gradient(90deg, rgba(236, 248, 255, 0.05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(236, 248, 255, 0.05) 0 1px, transparent 1px 28px);
  clip-path: polygon(0 14%, 92% 14%, 100% 28%, 100% 100%, 8% 100%, 0 86%);
}

.topbar,
.lab-table,
.info-stage,
.dialogue-panel {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 36px);
}

.brand-block {
  min-width: min(560px, 48vw);
}

.kicker {
  margin: 0 0 8px;
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.42);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(18px, 2vw, 30px);
  letter-spacing: 0;
}

.tagline {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 24px);
}

.utility {
  width: min(720px, 48vw);
  display: grid;
  gap: 8px;
  justify-content: flex-end;
}

.utility-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-tools {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(159, 222, 255, 0.22);
}

.system-tools {
  gap: 6px;
}

.utility button,
.choice-grid button,
dialog button {
  border: 1px solid var(--line);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(118, 220, 255, 0.14), transparent 46%),
    rgba(18, 40, 76, 0.58);
  cursor: pointer;
}

.utility button {
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  box-shadow: inset 0 0 14px rgba(236, 248, 255, 0.06);
  font-size: 15px;
  font-weight: 800;
}

.system-tools button {
  min-width: 64px;
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(247, 212, 107, 0.1), transparent 46%),
    rgba(18, 40, 76, 0.42);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.lab-table {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  align-items: end;
  gap: clamp(10px, 2vw, 28px);
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 12px;
  transition: grid-template-columns 220ms ease;
}

.hero-card {
  position: relative;
  z-index: 0;
  min-height: 270px;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 8px;
  opacity: 0.98;
  cursor: pointer;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.28));
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  left: 50%;
  z-index: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.hero-card::before {
  bottom: 24px;
  width: min(86%, 230px);
  aspect-ratio: 3.8;
  border: 1px solid rgba(159, 222, 255, 0.34);
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(118, 220, 255, 0.18) 11px 12px),
    radial-gradient(ellipse at center, rgba(118, 220, 255, 0.2), transparent 70%);
  box-shadow: 0 0 28px rgba(118, 220, 255, 0.18);
  transform: translateX(-50%) perspective(240px) rotateX(58deg);
}

.hero-card::after {
  bottom: 18px;
  width: min(68%, 172px);
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.72;
  box-shadow: 0 0 18px currentColor;
}

.hero-card.cs {
  color: var(--cyan);
}

.hero-card.ee {
  color: var(--gold);
}

.hero-card.auto {
  color: var(--mint);
}

.hero-card.ic {
  color: var(--violet);
}

.hero-card.comm {
  color: var(--coral);
}

.character-img {
  position: relative;
  z-index: 1;
  width: min(18vw, 230px);
  min-width: 128px;
  max-height: 54vh;
  object-fit: contain;
  transition: transform 180ms ease, filter 180ms ease;
}

.hero-card:hover .character-img,
.hero-card:focus-within .character-img {
  transform: translateY(-6px);
  filter: drop-shadow(0 0 22px rgba(118, 220, 255, 0.46));
}

.hero-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-weight: 800;
  font-size: 22px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

.hero-card small {
  position: relative;
  z-index: 1;
  color: var(--muted);
}

.lab-table.has-focus {
  grid-template-columns: minmax(260px, 2.15fr) repeat(4, minmax(96px, 0.72fr));
}

.lab-table.has-focus .hero-card {
  min-height: 230px;
  opacity: 0.42;
  transform: scale(0.86);
  filter: grayscale(0.22) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.26));
}

.lab-table.has-focus .hero-card.active {
  order: -1;
  min-height: 390px;
  opacity: 1;
  transform: translateY(-18px) scale(1.08);
  z-index: 2;
  filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 28px rgba(118, 220, 255, 0.32));
}

.lab-table.has-focus .hero-card.active .character-img {
  width: min(34vw, 390px);
  min-width: 260px;
  max-height: 62vh;
}

.lab-table.has-focus .hero-card.active p {
  font-size: clamp(26px, 3vw, 40px);
}

.info-stage {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.35fr);
  gap: 14px;
}

.profile-panel,
.mini-game {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(159, 222, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(118, 220, 255, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(247, 212, 107, 0.08), transparent 38%),
    rgba(8, 22, 43, 0.68);
  box-shadow: 0 16px 36px rgba(3, 12, 28, 0.28);
  backdrop-filter: blur(12px);
}

.profile-panel::before,
.mini-game::before,
.dialogue-panel::before,
.atlas-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--line), var(--line)) left 12px top 12px / 34px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) left 12px top 12px / 1px 34px no-repeat,
    linear-gradient(var(--line), var(--line)) right 12px top 12px / 34px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) right 12px top 12px / 1px 34px no-repeat,
    linear-gradient(var(--line), var(--line)) left 12px bottom 12px / 34px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) left 12px bottom 12px / 1px 34px no-repeat,
    linear-gradient(var(--line), var(--line)) right 12px bottom 12px / 34px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) right 12px bottom 12px / 1px 34px no-repeat;
  opacity: 0.62;
}

.profile-panel[hidden],
.mini-game[hidden] {
  display: none;
}

.profile-panel {
  padding: 16px;
}

.profile-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.profile-head span,
.profile-head strong,
.mini-game header span {
  padding: 4px 8px;
  border: 1px solid rgba(159, 222, 255, 0.38);
  background: rgba(118, 220, 255, 0.12);
}

.profile-panel h2,
.mini-game h2 {
  margin: 10px 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.profile-panel p,
.mini-game p {
  margin: 0;
  color: #dcefff;
  line-height: 1.65;
}

.profile-facts {
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  align-items: start;
}

.profile-facts dt {
  color: var(--gold);
  font-weight: 800;
}

.profile-facts dd {
  margin: 0;
  color: var(--muted);
}

.mini-game {
  padding: 16px;
}

.mini-game header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mini-game header span {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.mini-game h2 {
  margin: 0;
}

.mini-game-board {
  min-height: 76px;
  margin: 14px 0;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(159, 222, 255, 0.35);
  background:
    linear-gradient(90deg, transparent 49%, rgba(118, 220, 255, 0.14) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(118, 220, 255, 0.14) 50%, transparent 51%),
    rgba(236, 248, 255, 0.08);
  background-size: 34px 34px, 34px 34px, auto;
}

.mini-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-game-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(159, 222, 255, 0.52);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.14);
  cursor: pointer;
}

.mini-game-actions button:hover,
.mini-game-actions button:focus-visible,
.mini-game-actions button.selected {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 16px rgba(118, 220, 255, 0.35);
}

.mini-game-feedback {
  min-height: 28px;
  margin-top: 12px;
  color: var(--gold);
}

.tradeoff-board {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px;
}

.tradeoff-board span {
  min-height: 72px;
  padding: 10px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(159, 222, 255, 0.28);
  background: rgba(1, 7, 16, 0.22);
}

.tradeoff-board span.ok {
  border-color: rgba(114, 240, 176, 0.52);
  background: rgba(114, 240, 176, 0.08);
}

.tradeoff-board b {
  color: var(--muted);
  font-size: 12px;
}

.tradeoff-board strong {
  color: var(--gold);
  font-size: 24px;
}

.tradeoff-board small {
  color: var(--muted);
}

.mini-game-actions .tradeoff-card {
  width: min(260px, 100%);
  min-height: 118px;
  padding: 10px;
  display: grid;
  gap: 6px;
  text-align: left;
}

.tradeoff-card strong {
  color: var(--ink);
}

.tradeoff-card small {
  color: var(--muted);
  line-height: 1.45;
}

.tradeoff-card span {
  color: var(--gold);
  font-size: 12px;
  line-height: 1.45;
}

.sequence-track,
.link-status,
.binary-console {
  padding: 12px;
  color: var(--cyan);
  font-weight: 800;
  text-align: center;
}

.binary-console {
  width: min(460px, 100%);
  display: grid;
  gap: 8px;
}

.binary-console span {
  color: var(--muted);
  font-size: 13px;
}

.binary-console strong {
  color: var(--gold);
  font-size: 28px;
}

.binary-console code {
  min-height: 32px;
  padding: 8px;
  border: 1px solid rgba(159, 222, 255, 0.3);
  color: #f7fbff;
  background: rgba(1, 7, 16, 0.45);
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.meter-grid {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  padding: 12px;
}

.meter-grid strong {
  color: var(--gold);
}

.stepper-row,
.option-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(159, 222, 255, 0.24);
  background: rgba(4, 13, 28, 0.24);
}

.stepper-row span,
.option-row span {
  min-width: 72px;
  color: var(--muted);
  font-weight: 800;
}

.stepper-row strong {
  min-width: 58px;
  color: var(--gold);
}

.robot-grid {
  width: 220px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
}

.robot-grid span {
  display: grid;
  place-items: center;
  border: 1px solid rgba(159, 222, 255, 0.42);
  background: rgba(118, 220, 255, 0.14);
  color: var(--gold);
  font-weight: 900;
}

.robot-grid .blocked {
  background: rgba(5, 10, 20, 0.68);
  border-color: rgba(255, 255, 255, 0.18);
}

.layout-grid {
  width: min(330px, 100%);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding: 10px;
}

.layout-grid button {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(159, 222, 255, 0.3);
  color: rgba(247, 251, 255, 0.68);
  background:
    linear-gradient(90deg, transparent 47%, rgba(118, 220, 255, 0.1) 48% 52%, transparent 53%),
    linear-gradient(0deg, transparent 47%, rgba(118, 220, 255, 0.1) 48% 52%, transparent 53%),
    rgba(5, 15, 32, 0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.layout-grid button:hover,
.layout-grid button:focus-visible {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(118, 220, 255, 0.38);
}

.layout-grid .source,
.layout-grid .sink {
  color: #061326;
  background: var(--gold);
  border-color: #fff4bc;
}

.layout-grid .sink {
  background: var(--cyan);
}

.layout-grid .macro {
  color: rgba(255, 255, 255, 0.42);
  background: repeating-linear-gradient(135deg, rgba(3, 9, 19, 0.92) 0 7px, rgba(25, 39, 61, 0.92) 8px 14px);
  border-color: rgba(255, 255, 255, 0.18);
  cursor: not-allowed;
}

.layout-grid .wire {
  color: #061326;
  background: linear-gradient(90deg, transparent 28%, #72f0b0 29% 71%, transparent 72%), rgba(114, 240, 176, 0.22);
  border-color: rgba(114, 240, 176, 0.9);
  box-shadow: inset 0 0 18px rgba(114, 240, 176, 0.28);
}

.layout-grid .current {
  box-shadow: 0 0 18px rgba(114, 240, 176, 0.72), inset 0 0 18px rgba(114, 240, 176, 0.32);
}

.dialogue-panel {
  position: relative;
  overflow: hidden;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(118, 220, 255, 0.14), transparent 30%),
    linear-gradient(315deg, rgba(255, 159, 122, 0.1), transparent 32%),
    var(--panel);
  box-shadow: 0 0 38px rgba(65, 190, 255, 0.22), inset 0 0 28px rgba(236, 248, 255, 0.05);
  backdrop-filter: blur(14px);
}

.dialogue-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='64' viewBox='0 0 128 64'%3E%3Cg fill='none' stroke='%23f7d46b' stroke-opacity='.55' stroke-width='1'%3E%3Cpath d='M8 8h22l8 8h28l8-8h46'/%3E%3Cpath d='M14 48h28l8-8h24l8 8h32'/%3E%3Ccircle cx='30' cy='8' r='2'/%3E%3Ccircle cx='66' cy='16' r='2'/%3E%3Ccircle cx='82' cy='48' r='2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 128px 64px;
}

.speaker-row,
#dialogueText,
.ending-insights,
.choice-grid {
  position: relative;
  z-index: 1;
}

.speaker-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

#speaker {
  color: var(--cyan);
  font-size: 22px;
}

.status {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

#dialogueText {
  min-height: 64px;
  margin: 14px 0 16px;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.6;
}

.ending-insights {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1fr);
  gap: 12px;
}

.ending-insights[hidden] {
  display: none;
}

.radar-card,
.cross-progress {
  padding: 12px;
  border: 1px solid rgba(159, 222, 255, 0.28);
  background: rgba(236, 248, 255, 0.07);
}

.radar-card {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 12px;
  align-items: center;
}

.radar-plot {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, transparent 0 34%, rgba(159, 222, 255, 0.12) 35% 36%, transparent 37% 60%, rgba(159, 222, 255, 0.12) 61% 62%, transparent 63%),
    conic-gradient(from 30deg, rgba(118, 220, 255, 0.18), rgba(247, 212, 107, 0.18), rgba(114, 240, 176, 0.18), rgba(118, 220, 255, 0.18));
  border: 1px solid rgba(159, 222, 255, 0.28);
}

.radar-plot::after {
  content: "";
  position: absolute;
  inset: 18px;
  background: rgba(118, 220, 255, 0.22);
  border: 1px solid rgba(118, 220, 255, 0.68);
  clip-path: polygon(var(--radar-points));
}

.radar-plot span {
  position: absolute;
  z-index: 1;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.radar-plot span:nth-child(1) {
  top: 6px;
}

.radar-plot span:nth-child(2) {
  right: 4px;
  bottom: 18px;
}

.radar-plot span:nth-child(3) {
  left: 4px;
  bottom: 18px;
}

.radar-card strong,
.cross-progress strong {
  color: var(--gold);
}

.radar-card p,
.cross-progress p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.radar-card dl {
  margin: 8px 0 0;
  display: flex;
  gap: 8px;
}

.radar-card dl div,
.cross-progress span {
  padding: 5px 8px;
  border: 1px solid rgba(159, 222, 255, 0.22);
  background: rgba(1, 7, 16, 0.2);
}

.radar-card dt {
  color: var(--muted);
  font-size: 12px;
}

.radar-card dd {
  margin: 0;
  color: var(--cyan);
  font-weight: 900;
}

.cross-progress div {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cross-progress span {
  color: var(--muted);
  font-size: 13px;
}

.cross-progress b {
  margin-left: 6px;
  color: var(--gold);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.choice-grid button {
  min-height: 86px;
  padding: 10px;
  display: grid;
  gap: 4px;
  place-items: center;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(236, 248, 255, 0.18), transparent 42%),
    linear-gradient(315deg, rgba(247, 212, 107, 0.08), transparent 44%),
    rgba(236, 248, 255, 0.15);
  box-shadow: inset 0 0 18px rgba(118, 220, 255, 0.2), 0 8px 18px rgba(0, 0, 0, 0.12);
}

.open-icon,
.inline-open-icon,
.major-entry-icon,
.filter-icon,
.major-choice-icon,
.choice-icon {
  width: 1.2em;
  height: 1.2em;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: middle;
}

.open-icon svg,
.inline-open-icon svg,
.major-entry-icon svg,
.filter-icon svg,
.major-choice-icon svg,
.choice-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inline-open-icon + span {
  margin-left: 6px;
}

.choice-grid button:hover,
.choice-grid button:focus-visible,
.utility button:hover,
.utility button:focus-visible {
  outline: none;
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(118, 220, 255, 0.45);
}

.choice-icon {
  width: 28px;
  height: 28px;
}

.choice-title {
  font-weight: 800;
}

.choice-subtitle {
  color: var(--muted);
  font-size: 13px;
}

dialog {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(118, 220, 255, 0.12), transparent 42%),
    #101d35;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

dialog::backdrop {
  background: rgba(2, 8, 18, 0.58);
}

dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

dialog h2 {
  margin: 0;
}

dialog label {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.config-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border-color: rgba(159, 222, 255, 0.42);
  background:
    radial-gradient(circle at 88% 12%, rgba(247, 212, 107, 0.16), transparent 18%),
    radial-gradient(circle at 12% 18%, rgba(118, 220, 255, 0.14), transparent 20%),
    linear-gradient(160deg, rgba(11, 28, 54, 0.98), rgba(9, 18, 38, 0.98));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.config-panel {
  position: relative;
  margin: 0;
  padding: 18px 18px 16px;
}

.config-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(118, 220, 255, 0.1), transparent 24%, transparent 76%, rgba(247, 212, 107, 0.08)),
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(255, 255, 255, 0.03) 26px 27px);
  opacity: 0.85;
}

.config-header,
.config-body,
.config-actions {
  position: relative;
  z-index: 1;
}

.config-header {
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(159, 222, 255, 0.18);
}

.config-header p {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.config-header h2 {
  margin: 0;
  font-size: 22px;
}

.config-header button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.config-body {
  display: grid;
  gap: 14px;
  padding: 16px 0 18px;
}

.config-field {
  gap: 10px;
  margin: 0;
}

.config-field span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.config-field input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.config-toggle {
  margin: 0;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(159, 222, 255, 0.18);
  background: rgba(236, 248, 255, 0.06);
}

.config-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--mint);
}

.config-toggle strong,
.config-toggle small {
  display: block;
}

.config-toggle strong {
  color: var(--ink);
  font-size: 14px;
}

.config-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.config-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

#resetBtn {
  min-width: 148px;
  height: 40px;
  border-color: rgba(255, 159, 122, 0.42);
  color: #ffd8cc;
  background: rgba(255, 159, 122, 0.12);
}

#resetBtn:hover,
#resetBtn:focus-visible {
  border-color: #ffbca8;
  background: rgba(255, 159, 122, 0.2);
  box-shadow: 0 0 18px rgba(255, 159, 122, 0.24);
}

.reset-dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 159, 122, 0.35);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 159, 122, 0.18), transparent 22%),
    radial-gradient(circle at 82% 12%, rgba(247, 212, 107, 0.12), transparent 18%),
    linear-gradient(160deg, rgba(16, 27, 48, 0.98), rgba(10, 18, 32, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.reset-panel {
  position: relative;
  margin: 0;
  padding: 18px;
}

.reset-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 159, 122, 0.12), transparent 28%, transparent 72%, rgba(247, 212, 107, 0.08)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(255, 255, 255, 0.03) 29px 30px);
  opacity: 0.85;
}

.reset-header,
.reset-copy,
.reset-summary,
.reset-actions {
  position: relative;
  z-index: 1;
}

.reset-header {
  display: grid;
  grid-template-columns: 46px 1fr 36px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 159, 122, 0.16);
}

.reset-header p {
  margin: 0 0 4px;
  color: #ffbca8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reset-header h2 {
  margin: 0;
  font-size: 22px;
}

.reset-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 159, 122, 0.42);
  border-radius: 14px;
  color: #ffd8cc;
  background:
    linear-gradient(135deg, rgba(255, 159, 122, 0.18), rgba(255, 159, 122, 0.06)),
    rgba(255, 255, 255, 0.02);
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 0 16px rgba(255, 159, 122, 0.12);
}

.reset-header button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.reset-copy {
  margin: 0 0 14px;
  color: var(--ink);
  line-height: 1.7;
}

.reset-summary {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reset-summary span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  background: rgba(236, 248, 255, 0.05);
  font-size: 13px;
  font-weight: 800;
}

.reset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.reset-actions button {
  min-width: 108px;
  height: 40px;
}

#cancelResetBtn {
  border-color: rgba(159, 222, 255, 0.28);
  background: rgba(236, 248, 255, 0.08);
}

#confirmResetBtn {
  border-color: rgba(255, 159, 122, 0.5);
  color: #ffe0d4;
  background: linear-gradient(135deg, rgba(255, 159, 122, 0.22), rgba(255, 159, 122, 0.12));
}

#confirmResetBtn:hover,
#confirmResetBtn:focus-visible {
  border-color: #ffbca8;
  background: linear-gradient(135deg, rgba(255, 159, 122, 0.28), rgba(255, 159, 122, 0.18));
  box-shadow: 0 0 18px rgba(255, 159, 122, 0.24);
}

.atlas-dialog {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%2376dcff' stroke-opacity='.14'%3E%3Cpath d='M0 24h24V0M96 72H72v24M22 72h18l8-8h26M22 24h22l8 8h22'/%3E%3C/g%3E%3Cg fill='%23f7d46b' fill-opacity='.12'%3E%3Cpath d='M79 19l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(12, 33, 58, 0.96), rgba(14, 23, 45, 0.98)),
    #101d35;
  background-size: 96px 96px, auto, auto;
}

.atlas-dialog form {
  margin: 0;
}

.atlas-dialog header {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(159, 222, 255, 0.24);
  background: rgba(236, 248, 255, 0.06);
}

.atlas-dialog header p {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.atlas-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 14px 20px 0;
}

.atlas-tabs button,
.major-entry button,
.knowledge-filter button {
  min-height: 38px;
  border: 1px solid rgba(159, 222, 255, 0.42);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.1);
  cursor: pointer;
}

.atlas-tabs button.active,
.knowledge-filter button.active,
.major-entry button:hover,
.major-entry button:focus-visible,
.knowledge-filter button:hover,
.knowledge-filter button:focus-visible {
  outline: none;
  border-color: #fff;
  background: rgba(118, 220, 255, 0.2);
  box-shadow: 0 0 18px rgba(118, 220, 255, 0.26);
}

.atlas-content {
  max-height: calc(100vh - 210px);
  padding: 18px 20px 22px;
  overflow: auto;
}

.atlas-content[hidden] {
  display: none;
}

.major-entry {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(159, 222, 255, 0.34);
  background: rgba(5, 15, 32, 0.58);
  box-shadow: inset 0 0 22px rgba(118, 220, 255, 0.08);
}

.major-entry.cs {
  border-left: 4px solid #76dcff;
}

.major-entry.ee {
  border-left: 4px solid #f7d46b;
}

.major-entry.auto {
  border-left: 4px solid #72f0b0;
}

.major-entry.ic {
  border-left: 4px solid #b693ff;
}

.major-entry.comm {
  border-left: 4px solid #ff9f7a;
}

.major-entry-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
}

.major-entry-head > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(159, 222, 255, 0.36);
  background: rgba(236, 248, 255, 0.1);
  color: var(--gold);
  font-size: 28px;
  font-weight: 900;
}

.major-entry h3,
.knowledge-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.major-entry p {
  margin: 6px 0 0;
  color: #dcefff;
  line-height: 1.6;
}

.archive-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.archive-grid section {
  padding: 12px;
  border: 1px solid rgba(159, 222, 255, 0.22);
  background: rgba(236, 248, 255, 0.06);
}

.archive-grid strong {
  color: var(--gold);
}

.archive-grid ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.fit-note {
  padding: 10px 12px;
  border: 1px dashed rgba(247, 212, 107, 0.38);
  background: rgba(247, 212, 107, 0.08);
}

.advice-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.advice-grid section {
  padding: 12px;
  border: 1px solid rgba(114, 240, 176, 0.26);
  background: rgba(114, 240, 176, 0.07);
}

.advice-grid strong {
  color: #72f0b0;
}

.advice-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.major-entry button {
  margin-top: 12px;
  padding: 8px 14px;
}

.knowledge-filter {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
  background: rgba(12, 25, 48, 0.96);
}

.knowledge-filter button {
  min-width: 54px;
  padding: 6px 12px;
}

.collection-stats {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collection-stats span {
  padding: 6px 10px;
  border: 1px solid rgba(159, 222, 255, 0.26);
  color: var(--muted);
  background: rgba(236, 248, 255, 0.07);
  font-size: 13px;
  font-weight: 800;
}

.reward-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(247, 212, 107, 0.32);
  background:
    linear-gradient(135deg, rgba(247, 212, 107, 0.12), transparent 42%),
    rgba(5, 15, 32, 0.58);
}

.reward-panel header {
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
}

.reward-panel header span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reward-panel h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.reward-panel header p {
  margin: 0;
  padding: 6px 10px;
  align-self: start;
  border: 1px solid rgba(247, 212, 107, 0.36);
  color: var(--gold);
  background: rgba(247, 212, 107, 0.08);
  font-weight: 900;
}

.title-reward {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(159, 222, 255, 0.22);
  background: rgba(236, 248, 255, 0.06);
}

.review-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(114, 240, 176, 0.28);
  background: rgba(114, 240, 176, 0.07);
}

.review-panel strong {
  color: #72f0b0;
}

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

.review-panel div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-panel span {
  padding: 4px 8px;
  border: 1px solid rgba(114, 240, 176, 0.25);
  color: var(--ink);
  background: rgba(1, 7, 16, 0.18);
  font-size: 12px;
}

.title-reward strong {
  color: var(--gold);
}

.title-reward p,
.title-reward small {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.title-reward button {
  margin-top: 10px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(247, 212, 107, 0.42);
  color: var(--gold);
  background: rgba(247, 212, 107, 0.08);
  cursor: pointer;
}

.title-reward button:not(:disabled):hover,
.title-reward button:not(:disabled):focus-visible {
  outline: none;
  border-color: #fff4bc;
  box-shadow: 0 0 14px rgba(247, 212, 107, 0.24);
}

.title-reward button:disabled {
  cursor: default;
  opacity: 0.58;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.reward-card {
  position: relative;
  overflow: hidden;
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid rgba(159, 222, 255, 0.24);
  background: rgba(1, 7, 16, 0.22);
  color: var(--gold);
}

.reward-card.locked {
  opacity: 0.72;
}

.reward-card.ready {
  border-color: rgba(114, 240, 176, 0.42);
  box-shadow: inset 0 0 18px rgba(114, 240, 176, 0.08);
}

.reward-card > span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.reward-card h3 {
  margin: 0;
  font-size: 16px;
}

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

.reward-card button {
  min-height: 34px;
  border: 1px solid rgba(159, 222, 255, 0.42);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.1);
  cursor: pointer;
}

.reward-card button:not(:disabled):hover,
.reward-card button:not(:disabled):focus-visible {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(118, 220, 255, 0.28);
}

.reward-card button:disabled {
  cursor: default;
  opacity: 0.56;
}

.report-box {
  padding: 9px;
  border: 1px dashed rgba(247, 212, 107, 0.26);
  background: rgba(247, 212, 107, 0.06);
}

.report-box.ready {
  border-style: solid;
  border-color: rgba(247, 212, 107, 0.42);
}

.report-box strong {
  color: var(--gold);
}

.score-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.score-list span {
  display: grid;
  grid-template-columns: 78px 1fr 32px;
  gap: 8px;
  align-items: center;
}

.score-list b {
  color: var(--muted);
  font-size: 12px;
}

.score-list i {
  height: 8px;
  border: 1px solid rgba(159, 222, 255, 0.24);
  background: linear-gradient(90deg, var(--gold) var(--score), rgba(236, 248, 255, 0.1) var(--score));
}

.score-list em {
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.knowledge-card {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 15px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid rgba(159, 222, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(236, 248, 255, 0.1), transparent 42%),
    repeating-linear-gradient(120deg, transparent 0 26px, rgba(255, 255, 255, 0.035) 27px 28px),
    rgba(5, 15, 32, 0.62);
}

.knowledge-card::after,
.joint-card::after,
.reward-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 108px;
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.34;
  background:
    conic-gradient(from 45deg, transparent 0 12%, currentColor 12% 14%, transparent 14% 36%, currentColor 36% 38%, transparent 38% 62%, currentColor 62% 64%, transparent 64% 86%, currentColor 86% 88%, transparent 88%),
    radial-gradient(circle, transparent 0 48%, currentColor 49% 50%, transparent 51%);
}

.knowledge-card.locked {
  min-height: 210px;
  opacity: 0.68;
  filter: grayscale(0.34);
}

.knowledge-card.cs {
  color: var(--cyan);
  box-shadow: inset 0 3px 0 #76dcff;
}

.knowledge-card.ee {
  color: var(--gold);
  box-shadow: inset 0 3px 0 #f7d46b;
}

.knowledge-card.auto {
  color: var(--mint);
  box-shadow: inset 0 3px 0 #72f0b0;
}

.knowledge-card.ic {
  color: var(--violet);
  box-shadow: inset 0 3px 0 #b693ff;
}

.knowledge-card.comm {
  color: var(--coral);
  box-shadow: inset 0 3px 0 #ff9f7a;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.knowledge-card > span,
.card-head span {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(159, 222, 255, 0.3);
  color: var(--cyan);
  background: rgba(118, 220, 255, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.card-head button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(247, 212, 107, 0.36);
  color: var(--gold);
  background: rgba(247, 212, 107, 0.08);
  cursor: pointer;
  font-size: 12px;
}

.card-head button[aria-pressed="true"] {
  color: #061326;
  background: var(--gold);
  border-color: #fff4bc;
}

.knowledge-card p {
  margin: 0;
  color: #dcefff;
  line-height: 1.65;
}

.term-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-card b {
  padding: 4px 8px;
  border: 1px solid rgba(247, 212, 107, 0.32);
  color: var(--gold);
  background: rgba(247, 212, 107, 0.08);
  font-size: 12px;
}

.quiz-box {
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(159, 222, 255, 0.24);
  background: rgba(1, 7, 16, 0.24);
}

.quiz-box strong {
  color: var(--gold);
}

.quiz-box p {
  color: var(--muted);
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-options button {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(159, 222, 255, 0.32);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.08);
  cursor: pointer;
  text-align: left;
}

.quiz-options button:hover,
.quiz-options button:focus-visible {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(118, 220, 255, 0.26);
}

.quiz-options button:disabled {
  cursor: default;
  opacity: 0.58;
}

.quiz-box small {
  min-height: 18px;
  color: var(--gold);
}

.joint-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.joint-card {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  padding: 15px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid rgba(159, 222, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(114, 240, 176, 0.12), transparent 46%),
    repeating-linear-gradient(60deg, transparent 0 24px, rgba(114, 240, 176, 0.035) 25px 26px),
    rgba(5, 15, 32, 0.66);
  color: var(--mint);
}

.joint-card.locked {
  opacity: 0.66;
  filter: grayscale(0.28);
}

.joint-card.completed {
  border-color: rgba(247, 212, 107, 0.58);
  background:
    linear-gradient(135deg, rgba(247, 212, 107, 0.16), transparent 46%),
    rgba(5, 15, 32, 0.72);
  box-shadow: inset 0 0 24px rgba(247, 212, 107, 0.08);
}

.joint-card > span {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(114, 240, 176, 0.32);
  color: #72f0b0;
  background: rgba(114, 240, 176, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.joint-card.locked > span {
  border-color: rgba(247, 212, 107, 0.32);
  color: var(--gold);
  background: rgba(247, 212, 107, 0.08);
}

.joint-card.completed > span {
  border-color: #fff4bc;
  color: #061326;
  background: var(--gold);
}

.joint-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.joint-card strong {
  color: var(--cyan);
  line-height: 1.45;
}

.joint-card p {
  margin: 0;
  color: #dcefff;
  line-height: 1.65;
}

.joint-card small {
  min-height: 40px;
  color: var(--gold);
  line-height: 1.55;
}

.joint-card button {
  align-self: end;
  min-height: 38px;
  border: 1px solid rgba(159, 222, 255, 0.42);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.1);
  cursor: pointer;
}

.joint-card button:not(:disabled):hover,
.joint-card button:not(:disabled):focus-visible {
  outline: none;
  border-color: #fff;
  background: rgba(118, 220, 255, 0.2);
  box-shadow: 0 0 18px rgba(118, 220, 255, 0.26);
}

.joint-card button:disabled {
  cursor: default;
  opacity: 0.56;
}

.progress-section,
.explore-section,
.report-card {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(159, 222, 255, 0.28);
  background: rgba(5, 15, 32, 0.58);
}

.progress-section header,
.explore-section header,
.report-card header {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.progress-section header span,
.explore-section header span,
.report-card header span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-section h3,
.explore-section h3,
.report-card h3 {
  margin: 4px 0 0;
}

.report-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.style-snapshot {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(247, 212, 107, 0.26);
  background: rgba(247, 212, 107, 0.07);
}

.style-snapshot strong {
  color: var(--gold);
}

.style-snapshot p,
.style-snapshot small {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-ranks,
.mode-list,
.achievement-grid,
.trust-grid,
.gap-grid,
.debate-grid,
.calendar-grid,
.map-grid,
.project-grid {
  display: grid;
  gap: 10px;
}

.report-ranks {
  margin-top: 12px;
}

.report-ranks span,
.mode-list span,
.trust-grid span,
.week-pressure span {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 1.4fr 42px;
  gap: 8px;
  align-items: center;
}

.report-ranks b,
.mode-list b,
.week-pressure b,
.trust-grid strong {
  color: var(--ink);
}

.report-ranks i,
.mode-list i,
.week-pressure i,
.trust-grid i {
  height: 8px;
  border: 1px solid rgba(159, 222, 255, 0.24);
  background: linear-gradient(90deg, var(--cyan) var(--score), rgba(236, 248, 255, 0.1) var(--score));
}

.report-ranks em,
.mode-list em,
.week-pressure em,
.trust-grid b {
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.mode-list,
.week-pressure {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(114, 240, 176, 0.24);
  background: rgba(114, 240, 176, 0.06);
}

.mode-chip-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(159, 222, 255, 0.24);
  color: var(--muted);
  background: rgba(1, 7, 16, 0.2);
  font-size: 12px;
  font-weight: 800;
}

.mode-chip-row b {
  color: var(--gold);
}

.week-pressure p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.achievement-grid,
.trust-grid,
.gap-grid,
.debate-grid,
.map-grid,
.project-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.calendar-grid {
  grid-template-columns: repeat(2, minmax(250px, 1fr));
}

.achievement-grid article,
.trust-grid article,
.gap-grid article,
.debate-card,
.calendar-grid article,
.map-grid article,
.project-grid article {
  padding: 12px;
  border: 1px solid rgba(159, 222, 255, 0.22);
  background: rgba(236, 248, 255, 0.06);
}

.achievement-grid article.done,
.gap-grid article.done,
.debate-card.done,
.calendar-grid article.done,
.map-grid article.done {
  border-color: rgba(114, 240, 176, 0.42);
  background: rgba(114, 240, 176, 0.08);
}

.achievement-grid strong,
.gap-grid strong,
.gap-grid span,
.calendar-grid span,
.project-grid > article > span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.achievement-grid h4,
.calendar-grid h4,
.project-grid h4 {
  margin: 6px 0;
}

.achievement-grid p,
.trust-grid p,
.gap-grid p,
.calendar-grid p,
.map-grid p,
.project-grid p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.trust-grid small {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.trust-grid button,
.gap-grid button,
.calendar-grid button,
.map-grid button,
.project-grid button {
  min-height: 34px;
  margin: 4px 6px 4px 0;
  padding: 7px 10px;
  border: 1px solid rgba(159, 222, 255, 0.38);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.1);
  cursor: pointer;
}

.trust-grid button:not(:disabled):hover,
.trust-grid button:not(:disabled):focus-visible,
.gap-grid button:not(:disabled):hover,
.gap-grid button:not(:disabled):focus-visible,
.calendar-grid button:not(:disabled):hover,
.calendar-grid button:not(:disabled):focus-visible,
.map-grid button:not(:disabled):hover,
.map-grid button:not(:disabled):focus-visible,
.project-grid button:not(:disabled):hover,
.project-grid button:not(:disabled):focus-visible {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(118, 220, 255, 0.26);
}

.trust-grid button:disabled,
.gap-grid button:disabled,
.calendar-grid button:disabled,
.map-grid button:disabled,
.project-grid button:disabled {
  cursor: default;
  opacity: 0.55;
}

.debate-card header {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.debate-card header span,
.debate-result {
  color: var(--gold);
  font-weight: 900;
}

.debate-card p,
.ng-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.debate-views,
.debate-options {
  display: grid;
  gap: 8px;
}

.debate-views span {
  padding: 8px;
  border: 1px solid rgba(159, 222, 255, 0.22);
  background: rgba(1, 7, 16, 0.18);
}

.debate-views small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.debate-options {
  margin-top: 10px;
}

.debate-options button,
.ng-panel button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(159, 222, 255, 0.38);
  color: var(--ink);
  background: rgba(236, 248, 255, 0.1);
  cursor: pointer;
  text-align: left;
}

.debate-options button strong,
.debate-options button small {
  display: block;
}

.debate-options button small,
.ng-panel small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.debate-options button:not(:disabled):hover,
.debate-options button:not(:disabled):focus-visible,
.ng-panel button:not(:disabled):hover,
.ng-panel button:not(:disabled):focus-visible {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(118, 220, 255, 0.26);
}

.ng-panel {
  padding: 12px;
  border: 1px solid rgba(247, 212, 107, 0.28);
  background: rgba(247, 212, 107, 0.07);
}

.ng-panel strong {
  color: var(--gold);
}

.ng-panel button {
  margin-top: 10px;
}

.ng-panel button:disabled,
.debate-options button:disabled {
  cursor: default;
  opacity: 0.56;
}

.paused .holo-grid::after,
.paused .holo-grid::before,
.paused .scene::before,
.paused .scene::after,
.paused .dialogue-panel::after {
  display: none;
}

@media (max-width: 900px) {
  .scene {
    min-height: 100svh;
    grid-template-rows: auto auto auto;
  }

  .topbar {
    flex-direction: column;
  }

  .brand-block,
  .utility {
    width: 100%;
    min-width: 0;
  }

  .utility {
    justify-content: stretch;
  }

  .utility-group {
    justify-content: flex-start;
  }

  .primary-tools {
    display: grid;
    grid-template-columns: repeat(5, minmax(58px, 1fr));
  }

  .system-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .utility button,
  .system-tools button {
    width: 100%;
    min-width: 0;
  }

  .lab-table {
    grid-template-columns: repeat(5, 120px);
    overflow-x: auto;
    padding: 10px 0 18px;
  }

  .lab-table.has-focus {
    grid-template-columns: 220px repeat(4, 112px);
  }

  .hero-card {
    min-height: 205px;
  }

  .lab-table.has-focus .hero-card.active {
    min-height: 305px;
    transform: translateY(-8px) scale(1);
  }

  .lab-table.has-focus .hero-card.active .character-img {
    width: 220px;
    min-width: 220px;
  }

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

  .ending-insights,
  .radar-card {
    grid-template-columns: 1fr;
  }

  .info-stage {
    grid-template-columns: 1fr;
  }

  .profile-facts div {
    grid-template-columns: 1fr;
  }

  .mini-game-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stepper-row,
  .option-row {
    align-items: stretch;
  }

  .status {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .atlas-dialog header {
    align-items: flex-start;
  }

  .archive-grid,
    .advice-grid,
    .joint-grid,
    .reward-grid,
    .achievement-grid,
    .trust-grid,
    .debate-grid,
    .gap-grid,
    .calendar-grid,
    .map-grid,
    .project-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .major-entry-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .primary-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .system-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .utility button {
    padding: 0 8px;
    font-size: 14px;
  }

  .system-tools button {
    font-size: 12px;
  }
}
