:root {
  --bg: #111528;
  --bg-2: #171d31;
  --ink: #eef0df;
  --muted: #a8adbd;
  --line: rgba(228, 211, 153, 0.2);
  --gold: #f0c35a;
  --jade: #62b887;
  --cinnabar: #d85a4a;
  --violet: #b29cff;
  --panel: rgba(18, 22, 38, 0.82);
  --panel-strong: rgba(18, 22, 38, 0.94);
  --ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: var(--serif);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(17, 21, 40, 0.68), rgba(17, 21, 40, 0.86)),
    url("../assets/celestial-pilgrimage-map.png") center / cover fixed,
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#cosmosCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.54;
  pointer-events: none;
}

#app,
#stage,
#graphSvg {
  position: fixed;
  inset: 0;
}

#app {
  z-index: 1;
}

#stage {
  z-index: 1;
}

#graphSvg {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#graphSvg.panning {
  cursor: grabbing;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: min(680px, calc(100vw - 24px));
  padding: 18px 22px 28px;
  background: linear-gradient(135deg, rgba(10, 13, 24, 0.86), rgba(10, 13, 24, 0.32) 72%, transparent);
  pointer-events: none;
}

.cornerActions,
.seriesLink,
.brand,
.viewnav,
.controls {
  pointer-events: auto;
}

.cornerActions {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seriesLink,
.rewardBtn,
.detectiveBtn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(240, 195, 90, 0.24);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(14, 18, 32, 0.62);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  backdrop-filter: blur(10px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.rewardBtn {
  color: #17130a;
  border-color: rgba(240, 195, 90, 0.7);
  background: linear-gradient(180deg, #f0c35a, #dca646);
  cursor: pointer;
  font-weight: 700;
}

.detectiveBtn {
  color: #0d1914;
  border-color: rgba(98, 184, 135, 0.68);
  background: linear-gradient(180deg, #95e0b6, #62b887);
  cursor: pointer;
  font-weight: 700;
}

.primaryLearningCta {
  min-height: 38px;
  padding: 0 19px;
  border-color: rgba(98, 184, 135, 0.92);
  font-size: 13px;
  box-shadow: 0 0 0 1px rgba(98, 184, 135, 0.18), 0 18px 36px rgba(98, 184, 135, 0.18);
}

.prominentReward {
  color: #17130a;
  border-color: rgba(255, 218, 113, 0.92);
  background: linear-gradient(180deg, #ffda71, #e4aa3f);
  font-weight: 800;
  box-shadow:
    0 0 0 1px rgba(255, 218, 113, 0.24),
    0 14px 30px rgba(240, 195, 90, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.seriesLink:hover,
.rewardBtn:hover,
.detectiveBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 195, 90, 0.54);
  background: rgba(28, 31, 50, 0.82);
}

.rewardBtn:hover {
  background: linear-gradient(180deg, #ffd574, #e6af4d);
}

.prominentReward:hover {
  color: #120f07;
  border-color: rgba(255, 226, 139, 1);
  background: linear-gradient(180deg, #ffe18a, #efba4d);
  box-shadow:
    0 0 0 1px rgba(255, 218, 113, 0.32),
    0 18px 36px rgba(240, 195, 90, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.detectiveBtn:hover {
  border-color: rgba(98, 184, 135, 0.86);
  background: linear-gradient(180deg, #a8efc7, #6bc992);
}

.rewardOverlay {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(6, 8, 14, 0.66);
  backdrop-filter: blur(10px) saturate(1.1);
}

.rewardOverlay[hidden] {
  display: none;
}

.rewardModal {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 20px 20px;
  border: 1px solid rgba(240, 195, 90, 0.48);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 16%, rgba(240, 195, 90, 0.18), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(98, 184, 135, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(36, 35, 30, 0.96), rgba(18, 21, 27, 0.98));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rewardClose {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(238, 240, 223, 0.18);
  border-radius: 8px;
  background: rgba(238, 240, 223, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.rewardEyebrow {
  margin: 0 42px 10px 0;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.rewardModal h2 {
  margin: 0;
  max-width: calc(100% - 48px);
  font-size: clamp(30px, 4.3vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}

.rewardCopy,
.rewardFoot {
  margin: 12px 0 0;
  color: rgba(238, 240, 223, 0.86);
  font-size: 14px;
  line-height: 1.74;
}

.rewardQrWrap {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-top: 18px;
  border: 1px dashed rgba(240, 195, 90, 0.46);
  border-radius: 8px;
  padding: 17px 14px 16px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.035);
}

.rewardQr {
  width: min(300px, 76vw);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.rewardQrWrap strong {
  color: var(--ink);
  font-family: var(--ui);
  font-size: 13px;
}

.rewardFoot {
  margin-top: 13px;
  color: rgba(238, 240, 223, 0.72);
}

.detectiveOverlay {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 14, 0.72);
  backdrop-filter: blur(11px) saturate(1.08);
}

.detectiveOverlay[hidden] {
  display: none;
}

.detectiveModal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 36px));
  height: min(830px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(98, 184, 135, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(24, 32, 48, 0.98), rgba(9, 12, 23, 0.98)),
    rgba(18, 22, 38, 0.98);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.detectiveModalHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  border-bottom: 1px solid rgba(238, 240, 223, 0.09);
  padding: 14px 18px 13px;
  background: rgba(10, 13, 24, 0.5);
}

.detectiveModalKicker {
  margin: 0 0 3px;
  color: var(--jade);
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.detectiveModalHead h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0.04em;
}

.detectiveModalClose {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(238, 240, 223, 0.14);
  border-radius: 8px;
  background: rgba(238, 240, 223, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.detectiveFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(27px, 4vw, 43px);
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1;
}

h1 span {
  color: var(--gold);
}

.brand p,
.readerHead p,
.detailTitle p,
.detailTitle span {
  margin: 0;
  font-family: var(--ui);
  color: var(--muted);
}

.brand p {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.viewnav,
.controls,
#legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewnav {
  margin-top: 16px;
}

.viewnav button,
.ghostBtn,
.factionChip,
.searchBox {
  min-height: 34px;
  border: 1px solid rgba(238, 240, 223, 0.12);
  background: rgba(14, 18, 32, 0.62);
  color: var(--muted);
  border-radius: 999px;
  backdrop-filter: blur(8px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.18);
}

.viewnav button,
.ghostBtn {
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.viewnav button:hover,
.ghostBtn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: rgba(240, 195, 90, 0.45);
}

.viewnav button.active {
  background: var(--gold);
  color: #19170e;
  border-color: var(--gold);
}

.controls {
  margin-top: 10px;
  align-items: center;
}

.searchBox {
  position: relative;
  width: min(300px, 54vw);
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.searchBox span {
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(240, 195, 90, 0.8);
}

.searchBox input {
  width: 100%;
  height: 34px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--ui);
  font-size: 13px;
}

.searchBox input::placeholder {
  color: rgba(238, 240, 223, 0.48);
}

.returnBtn {
  display: none;
}

body.can-return .returnBtn {
  display: inline-flex;
  align-items: center;
}

.studentMissionDock {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 21;
  width: min(380px, calc(100vw - 44px));
  padding: 16px;
  border: 1px solid rgba(240, 195, 90, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(240, 195, 90, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(18, 22, 38, 0.88), rgba(10, 13, 24, 0.82));
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.25);
  pointer-events: auto;
  transition: opacity 0.22s, transform 0.22s;
}

body.detail-open .studentMissionDock,
body[data-view="timeline"] .studentMissionDock,
body[data-view="artifacts"] .studentMissionDock {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.studentMissionKicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.studentMissionDock h2 {
  margin: 0 0 13px;
  font-size: 24px;
  letter-spacing: 0.05em;
  line-height: 1.18;
}

.dailyPathDock {
  width: min(430px, calc(100vw - 44px));
}

.dailyPathValue {
  margin: -2px 0 13px;
  color: rgba(238, 240, 223, 0.73);
  font-family: var(--ui);
  font-size: 12px;
  line-height: 1.62;
}

.missionCardGrid {
  display: grid;
  gap: 8px;
}

.missionCard {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  column-gap: 11px;
  row-gap: 2px;
  border: 1px solid rgba(238, 240, 223, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}

.missionCard:hover,
.missionCard:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(240, 195, 90, 0.34);
  background: rgba(255, 255, 255, 0.065);
}

.missionCard.primary {
  border-color: rgba(98, 184, 135, 0.34);
  background: rgba(98, 184, 135, 0.12);
}

.missionCard span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(240, 195, 90, 0.16);
  color: var(--gold);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 800;
}

.missionCard strong,
.missionCard small {
  min-width: 0;
  font-family: var(--ui);
}

.missionCard strong {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.missionCard small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#legend {
  position: fixed;
  left: 22px;
  bottom: 18px;
  z-index: 20;
  max-width: min(760px, calc(100vw - 150px));
  pointer-events: auto;
}

.factionChip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 8px;
  cursor: pointer;
  user-select: none;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: opacity 0.18s, border-color 0.18s, transform 0.18s;
}

.factionChip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 0 18px var(--chip);
}

.factionChip:hover,
.factionChip.active {
  border-color: var(--chip);
  transform: translateY(-1px);
  color: var(--ink);
}

body.has-filter .factionChip:not(.active) {
  opacity: 0.42;
}

.edge {
  stroke-width: 1.15;
  stroke-opacity: 0.31;
  transition: stroke-opacity 0.22s, stroke-width 0.22s;
}

.routePath {
  fill: none;
  stroke: rgba(240, 195, 90, 0.55);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: 8 12;
  filter: drop-shadow(0 0 8px rgba(240, 195, 90, 0.45));
  animation: routeFlow 18s linear infinite;
}

.routeHalo {
  fill: none;
  stroke: rgba(98, 184, 135, 0.16);
  stroke-width: 10;
  stroke-linecap: round;
}

@keyframes routeFlow {
  to {
    stroke-dashoffset: -220;
  }
}

.node {
  cursor: pointer;
  transition: opacity 0.22s;
}

.node circle.core {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.2;
  transition: stroke 0.2s, stroke-width 0.2s, filter 0.2s;
}

.node circle.aura {
  fill: none;
  stroke: currentColor;
  stroke-opacity: 0.22;
  stroke-width: 1.1;
  animation: nodePulse 4.8s ease-in-out infinite;
}

@keyframes nodePulse {
  50% {
    transform: scale(1.22);
    stroke-opacity: 0.05;
  }
}

.node text {
  font-family: var(--ui);
  font-size: 11px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: rgba(9, 11, 20, 0.92);
  stroke-width: 5px;
  stroke-linejoin: round;
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.node.hub text,
.node.kind-place text {
  opacity: 0.82;
}

.node:hover text,
.node.hovered text,
#graphSvg.labels-on .node text,
#graphSvg.focused .node.sel text,
#graphSvg.focused .node.adj text {
  opacity: 1;
}

#graphSvg.focused .node,
body.has-filter .node {
  opacity: 0.14;
}

#graphSvg.focused .node.sel,
#graphSvg.focused .node.adj,
body.has-filter .node.in-filter {
  opacity: 1;
}

#graphSvg.focused .edge,
body.has-filter .edge {
  stroke-opacity: 0.04;
}

#graphSvg.focused .edge.lit,
#graphSvg.hovering .edge.lit {
  stroke-opacity: 0.96;
  stroke-width: 2.1;
}

.node.sel circle.core {
  filter: url(#nodeGlow);
  stroke: var(--gold);
  stroke-width: 2.5;
}

.node.hovered circle.core {
  stroke: var(--gold);
  stroke-width: 2;
}

#focusVeil {
  position: fixed;
  inset: 0;
  z-index: 28;
  opacity: 0;
  pointer-events: none;
  background: rgba(5, 7, 14, 0.12);
  backdrop-filter: blur(0);
  transition: opacity 0.28s, backdrop-filter 0.28s;
}

body.detail-open #focusVeil {
  opacity: 1;
  backdrop-filter: blur(3px);
}

.detectivePanel {
  position: fixed;
  left: 22px;
  bottom: 70px;
  z-index: 34;
  width: min(380px, calc(100vw - 44px));
  max-height: calc(100vh - 148px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(98, 184, 135, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(24, 32, 48, 0.96), rgba(12, 16, 29, 0.96)),
    rgba(18, 22, 38, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.2);
  transform: translateY(0);
  opacity: 1;
}

.detectivePanel[hidden] {
  display: none;
}

.detectiveClose {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.detectiveEyebrow,
.detectiveIntro,
.detectiveMeta,
.detectiveOption,
.detectiveFeedback {
  font-family: var(--ui);
}

.detectiveEyebrow {
  margin: 0 34px 8px 0;
  color: var(--jade);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.detectivePanel h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0.05em;
}

.detectiveIntro {
  margin: 8px 0 16px;
  color: rgba(238, 240, 223, 0.68);
  font-size: 12px;
  line-height: 1.6;
}

.detectiveMeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}

.detectiveMeta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(238, 240, 223, 0.09);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.035);
}

.detectiveClue {
  margin: 0 0 14px;
  color: rgba(238, 240, 223, 0.9);
  font-size: 15px;
  line-height: 1.78;
}

.detectiveOptions {
  display: grid;
  gap: 8px;
}

.detectiveOption {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  border: 1px solid rgba(238, 240, 223, 0.1);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}

.detectiveOption:hover,
.detectiveOption:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(98, 184, 135, 0.46);
  background: rgba(98, 184, 135, 0.1);
  outline: 0;
}

.detectiveOption:disabled {
  cursor: default;
  transform: none;
}

.detectiveOptionMark {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--option-color);
  color: #0e1018;
  font-weight: 800;
  box-shadow: 0 0 18px color-mix(in srgb, var(--option-color) 55%, transparent);
}

.detectiveOptionText {
  font-size: 14px;
  font-weight: 700;
}

.detectiveOption small {
  grid-column: 2;
  color: rgba(238, 240, 223, 0.54);
  font-size: 11px;
  line-height: 1.35;
}

.detectiveOption.is-correct {
  border-color: rgba(98, 184, 135, 0.72);
  background: rgba(98, 184, 135, 0.16);
}

.detectiveOption.is-wrong {
  border-color: rgba(216, 90, 74, 0.72);
  background: rgba(216, 90, 74, 0.13);
}

.detectiveFeedback {
  margin-top: 13px;
  border: 1px solid rgba(238, 240, 223, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(238, 240, 223, 0.82);
  font-size: 12px;
  line-height: 1.7;
}

.detectiveFeedback[hidden] {
  display: none;
}

.detectiveFeedback strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 14px;
}

.detectiveFeedback p {
  margin: 0;
}

.detectiveFeedback p + p {
  margin-top: 8px;
}

.detectiveFeedback.is-correct {
  border-color: rgba(98, 184, 135, 0.44);
}

.detectiveFeedback.is-wrong {
  border-color: rgba(216, 90, 74, 0.42);
}

.detectiveFeedback.is-complete {
  border-color: rgba(240, 195, 90, 0.38);
}

.detectiveReflection {
  color: rgba(240, 195, 90, 0.88);
}

.detectiveActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.reviewMapBtn {
  align-items: center;
  text-decoration: none;
}

.detectiveActions .ghostBtn[hidden] {
  display: none;
}

body.detectiveGamePage {
  min-height: 100vh;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(17, 21, 40, 0.72), rgba(17, 21, 40, 0.94)),
    url("../assets/celestial-pilgrimage-map.png") center / cover fixed,
    var(--bg);
}

.detectiveGameShell {
  width: min(1180px, calc(100vw - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 42px;
}

.isEmbeddedGame {
  background:
    linear-gradient(180deg, rgba(17, 21, 40, 0.48), rgba(17, 21, 40, 0.82)),
    url("../assets/celestial-pilgrimage-map.png") center / cover fixed,
    var(--bg);
}

.isEmbeddedGame .detectiveGameShell {
  width: min(1080px, calc(100vw - 28px));
  min-height: auto;
  padding: 22px 0 28px;
}

.isEmbeddedGame .gameTopActions {
  display: none;
}

.isEmbeddedGame .detectiveGameHeader {
  margin-bottom: 16px;
}

.isEmbeddedGame .detectiveGameHeader h1 {
  font-size: clamp(38px, 5vw, 62px);
}

.isEmbeddedGame .detectiveQuestionCard,
.isEmbeddedGame .relationMapCard {
  min-height: 500px;
}

.isEmbeddedGame .resultPanel {
  margin-top: 18px;
}

.gameTopActions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.gameBack {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(238, 240, 223, 0.14);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(14, 18, 32, 0.66);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  backdrop-filter: blur(10px) saturate(1.3);
}

.detectiveGameHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.gameKicker {
  margin: 0 0 10px;
  color: var(--jade);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.detectiveGameHeader h1 {
  font-size: clamp(42px, 7vw, 76px);
  letter-spacing: 0.04em;
}

.detectiveGameHeader p:last-child {
  max-width: 620px;
  margin: 12px 0 0;
  color: rgba(238, 240, 223, 0.72);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.75;
}

.leaderboardPreview {
  border: 1px solid rgba(240, 195, 90, 0.26);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(36, 34, 28, 0.9), rgba(15, 19, 32, 0.88)),
    rgba(18, 22, 38, 0.9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.leaderboardPreview span {
  color: var(--gold);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.leaderboardPreview strong {
  display: block;
  margin-top: 8px;
  font-size: 23px;
}

.leaderboardPreview p {
  margin: 8px 0 0;
  color: rgba(238, 240, 223, 0.68);
  font-family: var(--ui);
  font-size: 12px;
  line-height: 1.65;
}

.leaderboardPreview.is-ready {
  border-color: rgba(98, 184, 135, 0.42);
}

.detectiveGameLayout {
  display: grid;
  grid-template-columns: minmax(340px, 500px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.detectiveGameLayout[hidden] {
  display: none;
}

.detectiveQuestionCard,
.relationMapCard,
.resultPanel {
  border: 1px solid rgba(98, 184, 135, 0.23);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(24, 32, 48, 0.96), rgba(12, 16, 29, 0.96)),
    rgba(18, 22, 38, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.2);
}

.detectiveQuestionCard {
  min-height: 560px;
  padding: 22px;
}

.detectiveQuestionCard[hidden],
.resultPanel[hidden] {
  display: none;
}

.detectiveGamePage .detectiveClue {
  margin-top: 18px;
  font-size: 16px;
}

.detectiveGamePage .detectiveOption {
  min-height: 64px;
  grid-template-columns: 32px 1fr;
  padding: 12px 13px;
}

.detectiveGamePage .detectiveOptionMark {
  width: 31px;
  height: 31px;
}

.detectiveGamePage .detectiveOptionText {
  font-size: 16px;
}

.detectiveGamePage .detectiveOption small {
  font-size: 12px;
}

.detectiveGamePage .detectiveFeedback {
  font-size: 13px;
}

.relationMapCard {
  min-height: 560px;
  padding: 22px;
}

.relationMapHead {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.relationMapHead p,
.relationMapHead span {
  margin: 0;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 12px;
  line-height: 1.55;
}

.relationMapHead p {
  color: var(--jade);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.relationMapHead h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0.04em;
}

.detectiveRelationMap {
  display: block;
  width: 100%;
  height: 320px;
  margin-top: 8px;
  border: 1px solid rgba(238, 240, 223, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(98, 184, 135, 0.1), transparent 38%),
    rgba(255, 255, 255, 0.025);
}

.mapEdge {
  stroke-opacity: 0.7;
  stroke-width: 1.5;
}

.mapAura {
  fill: none;
  stroke-opacity: 0.18;
  stroke-width: 1.2;
}

.mapCore {
  filter: drop-shadow(0 0 12px rgba(240, 195, 90, 0.26));
}

.mapNodeFocus .mapCore {
  stroke: var(--gold);
  stroke-width: 2.4;
}

.mapLabel,
.mapHint {
  fill: rgba(238, 240, 223, 0.78);
  font-family: var(--ui);
  font-size: 11px;
  paint-order: stroke;
  stroke: rgba(9, 11, 20, 0.82);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.mapHint {
  fill: rgba(238, 240, 223, 0.48);
  font-size: 14px;
}

.relationList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.relationListItem {
  min-height: 62px;
  border: 1px solid rgba(238, 240, 223, 0.08);
  border-left-color: var(--rel);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.032);
  font-family: var(--ui);
}

.relationListItem span,
.relationListItem em {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.45;
}

.relationListItem strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 14px;
}

.resultPanel {
  width: min(720px, 100%);
  margin: 24px auto 0;
  padding: 30px;
  text-align: center;
}

.resultPanel h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0.04em;
}

.resultPanel strong {
  display: block;
  margin-top: 12px;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 42px;
}

.resultPanel > p {
  max-width: 540px;
  margin: 14px auto 0;
  color: rgba(238, 240, 223, 0.74);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.8;
}

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

.resultInsight,
.resultWeakness,
.reviewSuggestionList {
  border: 1px solid rgba(238, 240, 223, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--ui);
}

.resultInsight {
  padding: 12px 10px;
}

.resultInsight span,
.resultWeakness span,
.reviewSuggestionTitle {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.resultInsight strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
}

.resultWeakness {
  margin-top: 12px;
  padding: 14px;
  text-align: left;
}

.resultWeakness strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 18px;
}

.resultWeakness p,
.resultRankHint {
  margin: 8px 0 0;
  color: rgba(238, 240, 223, 0.68);
  font-size: 12px;
  line-height: 1.65;
}

.reviewSuggestionList {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  text-align: left;
}

.reviewSuggestion {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(98, 184, 135, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(98, 184, 135, 0.07);
}

.reviewSuggestion:hover {
  border-color: rgba(98, 184, 135, 0.45);
  background: rgba(98, 184, 135, 0.12);
}

.reviewSuggestion strong {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.reviewSuggestion small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.resultRankHint {
  max-width: none !important;
  border: 1px dashed rgba(240, 195, 90, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  background: rgba(240, 195, 90, 0.055);
}

.resultActions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

#detailPanel {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 30;
  width: min(410px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px 24px 22px;
  border: 1px solid rgba(240, 195, 90, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(27, 31, 52, 0.96), rgba(14, 17, 30, 0.96)),
    rgba(18, 22, 38, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateX(calc(100% + 48px)) scale(0.98);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s;
}

body.detail-open #detailPanel {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.closeBtn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.detailHero {
  position: relative;
  min-height: 0;
}

.detailIdentity {
  position: relative;
  z-index: 2;
  transition: padding-right 0.22s;
}

.detailHero.hasPortrait {
  min-height: 224px;
}

.detailHero.hasPortrait .detailIdentity {
  padding-right: 160px;
}

.detailSigil {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #15120b;
  background: var(--gold);
  font-family: var(--ui);
  font-weight: 700;
  box-shadow: 0 0 34px rgba(240, 195, 90, 0.35);
}

.detailPortraitStage {
  --portrait-stage-size: 154px;
  --portrait-stage-top: 62px;
  --portrait-frame-stroke: rgba(240, 195, 90, 0.58);

  position: absolute;
  top: var(--portrait-stage-top);
  right: 2px;
  z-index: 1;
  width: var(--portrait-stage-size);
  height: var(--portrait-stage-size);
  overflow: hidden;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0.98;
}

.detailPortraitStage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid var(--portrait-frame-stroke);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 238, 174, 0.1);
  opacity: 0.82;
  pointer-events: none;
}

.detailPortrait {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
  opacity: 0.9;
  filter: contrast(1.16) sepia(0.18) saturate(0.9);
  mix-blend-mode: screen;
  -webkit-mask-image: none;
  mask-image: none;
}

.detailPortrait[hidden] {
  display: none;
}

.detailTitle {
  margin-top: 16px;
}

.detailTitle h2 {
  margin: 4px 0 5px;
  font-family: var(--serif);
  font-size: 31px;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.detailTitle p {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.detailTitle span {
  font-size: 12px;
}

.detailBio {
  margin: 18px 0 22px;
  color: rgba(238, 240, 223, 0.86);
  font-size: 14.5px;
  line-height: 1.76;
}

.detailStudy {
  margin: 0 0 22px;
  border: 1px solid rgba(98, 184, 135, 0.18);
  border-radius: 8px;
  padding: 13px;
  background: rgba(98, 184, 135, 0.055);
}

.learningPathCard {
  border-color: rgba(240, 195, 90, 0.26);
  background:
    linear-gradient(145deg, rgba(240, 195, 90, 0.075), rgba(98, 184, 135, 0.04)),
    rgba(98, 184, 135, 0.045);
}

.detailStudy[hidden] {
  display: none;
}

.studyHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--ui);
}

.studyHead span {
  color: var(--jade);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.studyHead strong {
  color: rgba(238, 240, 223, 0.72);
  font-size: 11px;
  font-weight: 600;
}

.learningPathLead {
  margin: -2px 0 12px;
  color: rgba(238, 240, 223, 0.74);
  font-family: var(--ui);
  font-size: 12px;
  line-height: 1.6;
}

.studyGrid {
  display: grid;
  gap: 8px;
}

.studyGrid section {
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(10, 13, 24, 0.34);
}

.studyGrid span,
.missionBrief span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.studyGrid p {
  margin: 0;
  color: rgba(238, 240, 223, 0.86);
  font-size: 13px;
  line-height: 1.62;
}

.relationJumpBtn {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid rgba(240, 195, 90, 0.24);
  border-radius: 999px;
  background: rgba(240, 195, 90, 0.1);
  color: var(--gold);
  cursor: pointer;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.relationJumpBtn:hover {
  border-color: rgba(240, 195, 90, 0.42);
  background: rgba(240, 195, 90, 0.16);
}

.detailRelationsHint {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  border: 1px solid rgba(240, 195, 90, 0.14);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(240, 195, 90, 0.045);
  font-family: var(--ui);
}

.detailRelationsHint strong {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.detailRelationsHint span {
  color: rgba(238, 240, 223, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.relGroup {
  margin-top: 18px;
}

.relTitle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.relGroupSummary {
  cursor: pointer;
  list-style: none;
  justify-content: space-between;
  border: 1px solid rgba(238, 240, 223, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.16s, background 0.16s;
}

.relGroupSummary::-webkit-details-marker {
  display: none;
}

.relGroupSummary::after {
  content: "展开";
  color: rgba(238, 240, 223, 0.48);
  font-size: 10px;
}

.relGroup[open] .relGroupSummary::after {
  content: "收起";
}

.relGroupSummary:hover {
  border-color: rgba(240, 195, 90, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.relGroupSummary em {
  margin-left: auto;
  color: rgba(238, 240, 223, 0.5);
  font-style: normal;
  letter-spacing: 0.04em;
}

.relTitle::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--rel);
}

.relItem {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  transition: background 0.16s, border-color 0.16s;
}

.relItem:hover {
  border-color: rgba(240, 195, 90, 0.22);
  background: rgba(255, 255, 255, 0.055);
}

.relDot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 14px var(--dot);
}

.relName {
  font-size: 14px;
}

.relLabel {
  max-width: 150px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 11px;
  text-align: right;
}

.readerView {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  overflow-y: auto;
  padding: 230px 0 68px;
  scroll-padding-top: 230px;
  background:
    linear-gradient(180deg, rgba(10, 13, 24, 0.64), rgba(10, 13, 24, 0.91)),
    rgba(10, 13, 24, 0.72);
  backdrop-filter: blur(7px);
}

body[data-view="timeline"] #timelineView,
body[data-view="artifacts"] #artifactView {
  display: block;
}

body[data-view="timeline"] #stage,
body[data-view="artifacts"] #stage,
body[data-view="timeline"] #legend,
body[data-view="artifacts"] #legend {
  display: none;
}

.readerInner {
  width: min(980px, calc(100vw - 36px));
  margin: 0 auto;
}

.readerHead {
  max-width: 720px;
  margin-bottom: 26px;
}

.eyebrow {
  color: var(--gold) !important;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.readerHead h2 {
  margin: 4px 0 10px;
  font-size: clamp(30px, 5vw, 54px);
  letter-spacing: 0.08em;
}

.readerHead p:last-child {
  font-size: 14px;
  line-height: 1.7;
}

.timelineList {
  position: relative;
  display: grid;
  gap: 12px;
}

.timelineCard,
.artifactCard {
  position: relative;
  border: 1px solid rgba(238, 240, 223, 0.11);
  border-radius: 8px;
  background: rgba(18, 22, 38, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 44px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px) saturate(1.25);
  overflow: hidden;
}

.timelineCard {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  padding: 18px;
}

.timelineCard::before,
.artifactCard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(240, 195, 90, 0.08), transparent 42%, rgba(98, 184, 135, 0.06));
  opacity: 0.8;
}

.timelineEra {
  color: var(--gold);
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.timelineCard h3,
.artifactCard h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: 0.04em;
}

.timelineCard p,
.artifactCard p {
  margin: 0;
  color: rgba(238, 240, 223, 0.82);
  font-size: 14px;
  line-height: 1.65;
}

.missionBrief {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.missionBrief div {
  border: 1px solid rgba(238, 240, 223, 0.08);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(10, 13, 24, 0.32);
}

.missionBrief strong {
  display: block;
  color: rgba(238, 240, 223, 0.86);
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.62;
}

.chipRow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.miniChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid rgba(238, 240, 223, 0.12);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(10, 13, 24, 0.48);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--ui);
  font-size: 11px;
  backdrop-filter: blur(8px) saturate(1.4);
}

.miniChip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip);
}

.artifactGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.artifactCard {
  min-height: 210px;
  padding: 18px;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
}

.artifactCard:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 195, 90, 0.34);
}

.artifactType {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin-bottom: 26px;
  border: 1px solid rgba(240, 195, 90, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.artifactOwner {
  margin-top: 16px;
}

@media (max-width: 720px) {
  .cornerActions {
    top: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
    justify-content: flex-end;
  }

  .seriesLink,
  .rewardBtn,
  .detectiveBtn {
    min-height: 30px;
    padding: 0 11px;
    font-size: 11px;
  }

  .primaryLearningCta {
    min-height: 32px;
    padding: 0 13px;
  }

  .prominentReward {
    opacity: 1;
  }

  .seriesLink {
    max-width: 98px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rewardModal h2 {
    max-width: 100%;
    font-size: clamp(30px, 8vw, 38px);
    white-space: normal;
  }

  .detectiveOverlay {
    padding: 8px;
  }

  .detectiveModal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .detectiveModalHead {
    min-height: 62px;
    padding: 10px 12px;
  }

  .detectiveModalHead h2 {
    font-size: 22px;
  }

  .detectiveModalClose {
    width: 34px;
    height: 34px;
  }

  .topbar {
    width: 100%;
    padding: 14px 14px 22px;
  }

  .brand p {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .viewnav {
    margin-top: 12px;
  }

  .searchBox {
    width: calc(100vw - 116px);
  }

  .studentMissionDock {
    top: auto;
    right: 10px;
    bottom: 88px;
    left: 10px;
    width: auto;
    padding: 10px;
  }

  .studentMissionDock h2 {
    margin-bottom: 8px;
    font-size: 18px;
  }

  .dailyPathValue {
    display: none;
  }

  .missionCardGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .missionCard {
    min-height: 68px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    padding: 8px 6px;
    text-align: center;
  }

  .missionCard span {
    grid-row: auto;
    width: 26px;
    height: 26px;
  }

  .missionCard strong {
    font-size: 11px;
  }

  .missionCard small {
    font-size: 10px;
    line-height: 1.25;
  }

  #legend {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
    max-height: 30vh;
    overflow-y: auto;
  }

  #detailPanel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 72vh;
    transform: translateY(calc(100% + 28px)) scale(0.98);
  }

  .detectivePanel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 68vh;
    padding: 17px;
  }

  body.detective-open.detail-open #detailPanel {
    max-height: 44vh;
  }

  .detectivePanel h2 {
    font-size: 24px;
  }

  .detectiveClue {
    font-size: 14px;
  }

  .detectiveGameShell {
    width: calc(100vw - 24px);
    padding: 14px 0 28px;
  }

  .isEmbeddedGame .detectiveGameShell {
    width: calc(100vw - 20px);
    padding: 12px 0 20px;
  }

  .gameTopActions {
    gap: 8px;
    margin-bottom: 28px;
  }

  .gameBack {
    min-height: 30px;
    padding: 0 11px;
    font-size: 11px;
  }

  .detectiveGameHeader {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 16px;
  }

  .detectiveGameHeader h1 {
    font-size: 43px;
  }

  .isEmbeddedGame .detectiveGameHeader h1 {
    font-size: 36px;
  }

  .detectiveGameHeader p:last-child {
    font-size: 13px;
  }

  .leaderboardPreview {
    padding: 14px;
  }

  .leaderboardPreview strong {
    font-size: 20px;
  }

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

  .detectiveQuestionCard,
  .relationMapCard {
    min-height: 0;
    padding: 16px;
  }

  .detectiveGamePage .detectiveClue {
    font-size: 15px;
  }

  .detectiveGamePage .detectiveOption {
    min-height: 58px;
  }

  .relationMapHead h2 {
    font-size: 27px;
  }

  .detectiveRelationMap {
    height: 270px;
  }

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

  .resultPanel {
    padding: 22px 16px;
  }

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

  .resultActions {
    flex-wrap: wrap;
  }

  .detailHero.hasPortrait {
    min-height: 218px;
  }

  .detailHero.hasPortrait .detailIdentity {
    padding-right: 152px;
  }

  .detailPortraitStage {
    --portrait-stage-size: 152px;
    --portrait-stage-top: 62px;

    right: -12px;
  }

  body.detail-open #detailPanel {
    transform: translateY(0) scale(1);
  }

  .readerView {
    padding-top: 194px;
    scroll-padding-top: 194px;
  }

  .timelineCard {
    grid-template-columns: 1fr;
    gap: 9px;
  }
}
