/* =========================================================
   Blood Odyssey — Journey Within
   实时 3D 微观血液科普体验 · 界面样式
   所有视觉素材均由 CSS / Canvas / WebGL 程序生成
   ========================================================= */

:root {
  --ink: #130208;
  --wine: #2a0714;
  --wine-deep: #1a030c;
  --wine-light: #5c1526;
  --coral: #ff8e83;
  --coral-hot: #ff6f70;
  --coral-soft: #f6b7ad;
  --pearl: #fff3e9;
  --pearl-muted: #ddc4c0;
  --pearl-dim: #b99a99;
  --cyan: #8be4e7;
  --cyan-dim: #64c7d0;
  --line: rgba(255, 223, 214, 0.18);
  --line-strong: rgba(255, 223, 214, 0.32);
  --panel: rgba(28, 4, 14, 0.9);
  --panel-deep: rgba(17, 2, 9, 0.94);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.8, 0.28, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--wine-deep);
}

body {
  color: var(--pearl);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

button,
input,
a { font: inherit; color: inherit; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

a { color: var(--pearl); text-decoration: none; }

p, h1, h2, h3, h4 { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { color: var(--wine-deep); background: var(--coral-soft); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#experience {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #1a030d;
}

/* ---------------- 3D stage ---------------- */

#sceneCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: grab;
}

#sceneCanvas.is-dragging { cursor: grabbing; }
#sceneCanvas:focus-visible { outline: 1px solid rgba(139, 228, 231, 0.42); outline-offset: -4px; }
#sceneCanvas.can-pick { cursor: pointer; }
#sceneCanvas.can-pick.is-dragging { cursor: grabbing; }

.scene-tint,
.scene-vignette,
.scene-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.scene-tint {
  background:
    radial-gradient(ellipse at 78% 18%, rgba(100, 210, 218, 0.065) 0%, transparent 31%),
    radial-gradient(ellipse at 18% 74%, rgba(255, 133, 117, 0.05) 0%, transparent 36%),
    radial-gradient(ellipse at 58% 44%, transparent 0%, transparent 45%, rgba(45, 3, 17, 0.16) 100%),
    linear-gradient(180deg, rgba(12, 0, 5, 0.38) 0%, transparent 23%, transparent 72%, rgba(10, 0, 5, 0.55) 100%);
}

.scene-vignette {
  z-index: 3;
  opacity: 0.9;
  background: radial-gradient(ellipse at 50% 48%, transparent 24%, rgba(13, 1, 6, 0.18) 54%, rgba(8, 0, 4, 0.62) 100%);
  transition: background 700ms var(--ease-soft), opacity 700ms var(--ease-soft);
}

#experience.focus-mode .scene-vignette {
  opacity: 1;
  background: radial-gradient(circle at 45% 45%, transparent 20%, rgba(12, 1, 6, 0.2) 50%, rgba(6, 0, 3, 0.72) 100%);
}

.scene-grain {
  z-index: 4;
  opacity: 0.055;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------------- shared chrome ---------------- */

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 3vw, 40px);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 800ms var(--ease-out) 250ms, transform 800ms var(--ease-out) 250ms, visibility 0s linear 1050ms;
}

body[data-phase="explore"] .topbar {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 800ms var(--ease-out) 250ms, transform 800ms var(--ease-out) 250ms, visibility 0s;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 195, 185, 0.32);
  border-radius: 50%;
}

.brand-orbit::before,
.brand-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 195, 185, 0.12);
  border-radius: 50%;
  transform: rotate(-26deg) scaleY(0.52);
}

.brand-orbit::before { inset: 6px -1px; }
.brand-orbit::after { inset: 1px 8px; transform: rotate(32deg) scaleY(0.55); }

.brand-orbit i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 14px rgba(255, 112, 112, 0.55);
}

.brand-copy { min-width: 0; }

.brand-kicker {
  color: var(--coral-soft);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
  color: var(--pearl);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-title span {
  color: rgba(255, 232, 225, 0.58);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.control-chip,
.quality-control,
.icon-button {
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(29, 4, 14, 0.54);
  box-shadow: 0 8px 28px rgba(8, 0, 4, 0.16);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}

.control-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--pearl-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease;
}

.control-chip:hover {
  color: var(--pearl);
  border-color: var(--line-strong);
  background: rgba(50, 9, 23, 0.66);
}

.control-chip[aria-pressed="true"] {
  color: var(--cyan);
  border-color: rgba(139, 228, 231, 0.34);
}

.control-chip .icon { width: 17px; height: 17px; flex: 0 0 17px; }
.control-chip .sound-slash { opacity: 1; transition: opacity 200ms ease; }
.control-chip[aria-pressed="true"] .sound-slash { opacity: 0; }
.control-chip[aria-pressed="true"] .sound-wave { opacity: 1; }
.control-chip .sound-wave { opacity: 0.4; transition: opacity 200ms ease; }

.quality-control {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 4px 3px 12px;
  border-radius: 999px;
}

.quality-caption {
  margin-right: 4px;
  color: rgba(255, 232, 225, 0.55);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.quality-option {
  min-width: 31px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pearl-dim);
  font-size: 11px;
  transition: color 180ms ease, background 180ms ease;
}

.quality-option:hover { color: var(--pearl); background: rgba(255, 255, 255, 0.06); }

.quality-option.is-active {
  color: var(--wine-deep);
  background: var(--coral-soft);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 0;
  border-radius: 50%;
  color: var(--pearl-muted);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.icon-button:hover {
  color: var(--pearl);
  border-color: var(--line-strong);
  background: rgba(50, 9, 23, 0.66);
}

/* ---------------- intro skip ---------------- */

.intro-skip {
  position: absolute;
  z-index: 34;
  right: clamp(18px, 3vw, 40px);
  bottom: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease, visibility 0s linear 500ms;
}

body[data-phase="intro"] .intro-skip {
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms ease, visibility 0s;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 236, 229, 0.62);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: color 200ms ease;
}

.text-button:hover { color: var(--pearl); }
.text-button span { color: var(--coral); font-size: 15px; }

/* ---------------- title screen ---------------- */

.title-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 67% 45%, rgba(58, 8, 25, 0.06) 0%, rgba(17, 2, 9, 0.42) 49%, rgba(10, 1, 5, 0.76) 100%),
    linear-gradient(90deg, rgba(10, 1, 5, 0.66) 0%, rgba(13, 1, 6, 0.34) 43%, transparent 76%);
  transition: opacity 1200ms var(--ease-soft), visibility 1200ms;
}

body[data-phase="title"] .title-screen {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.title-content {
  position: relative;
  width: min(760px, 88vw);
  margin-left: clamp(28px, 9vw, 148px);
  padding-bottom: 2vh;
  transform: translateY(19px);
  transition: transform 1200ms var(--ease-out);
}

body[data-phase="title"] .title-content { transform: translateY(0); }

.title-overline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--coral-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.title-overline span {
  display: block;
  width: 34px;
  height: 1px;
  background: var(--coral);
}

.title-display {
  margin-top: 24px;
  color: var(--pearl);
  font-family: var(--serif);
  font-weight: 400;
  text-shadow: 0 8px 40px rgba(20, 1, 8, 0.35);
}

.title-display .title-cn {
  display: block;
  font-size: clamp(58px, 8.4vw, 112px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0.08em;
}

.title-display .title-en {
  display: block;
  margin-top: 8px;
  color: var(--coral-soft);
  font-size: clamp(35px, 5vw, 64px);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.015em;
}

.title-display .title-en em {
  color: var(--pearl);
  font-weight: 400;
}

.title-journey {
  margin-top: 18px;
  color: rgba(255, 235, 228, 0.52);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.12em;
}

.title-deck {
  margin-top: 2px;
  color: var(--pearl-muted);
  font-size: 15px;
  letter-spacing: 0.38em;
}

.title-copy {
  max-width: 580px;
  margin-top: 25px;
  color: rgba(255, 235, 228, 0.68);
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: 0.03em;
}

.start-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  min-height: 54px;
  margin-top: 34px;
  padding: 0 22px 0 27px;
  overflow: hidden;
  border: 1px solid rgba(255, 195, 185, 0.44);
  border-radius: 2px;
  background: rgba(52, 8, 22, 0.36);
  color: var(--pearl);
  font-size: 13px;
  letter-spacing: 0.16em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  transition: color 300ms ease, background 300ms ease, border-color 300ms ease;
}

.start-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pearl);
  transform: translateX(-102%);
  transition: transform 500ms var(--ease-out);
}

.start-button > * { position: relative; z-index: 1; }
.start-button svg { width: 22px; height: 22px; transition: transform 300ms var(--ease-out); }

.start-button:hover {
  color: var(--wine-deep);
  border-color: var(--pearl);
  background: transparent;
}

.start-button:hover::before { transform: translateX(0); }
.start-button:hover svg { transform: translateX(4px); }

.title-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 22px;
  margin-top: 28px;
  color: rgba(255, 235, 228, 0.4);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.title-foot span {
  position: relative;
  padding-left: 11px;
}

.title-foot span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--coral);
  transform: translateY(-50%);
}

.title-orbit {
  position: absolute;
  top: 50%;
  right: clamp(-100px, 4vw, 80px);
  width: min(42vw, 560px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 202, 192, 0.1);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-50%) scale(0.93) rotate(-8deg);
  transition: opacity 1800ms ease 250ms, transform 2200ms var(--ease-out) 250ms;
  pointer-events: none;
}

body[data-phase="title"] .title-orbit {
  opacity: 0.8;
  transform: translateY(-50%) scale(1) rotate(0);
}

.title-orbit::before,
.title-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 191, 181, 0.12);
}

.title-orbit::before { inset: 11%; transform: scaleY(0.58) rotate(27deg); }
.title-orbit::after { inset: 22%; transform: scaleY(0.72) rotate(-36deg); border-color: rgba(139, 228, 231, 0.11); }

.orbit-line {
  position: absolute;
  inset: 29%;
  border: 1px solid rgba(255, 192, 183, 0.16);
  border-radius: 50%;
}

.orbit-line-a { transform: rotate(25deg) scaleY(0.6); }
.orbit-line-b { transform: rotate(-41deg) scaleY(0.35); border-color: rgba(139, 228, 231, 0.18); }

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 22px rgba(255, 111, 112, 0.6);
  transform: translate(-50%, -50%);
}

.orbit-caption {
  position: absolute;
  bottom: 7.4%;
  left: 50%;
  color: rgba(255, 235, 228, 0.34);
  font-family: var(--serif);
  font-size: 9px;
  font-style: italic;
  letter-spacing: 0.13em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.title-side-note {
  position: absolute;
  right: 28px;
  bottom: 35px;
  color: rgba(255, 235, 228, 0.3);
  font-size: 8px;
  line-height: 1.9;
  letter-spacing: 0.2em;
  text-align: right;
}

.title-rules {
  position: absolute;
  top: 13vh;
  right: 3vw;
  display: flex;
  gap: 5px;
  transform: rotate(90deg);
  transform-origin: right top;
  opacity: 0.45;
}

.title-rules span { display: block; width: 1px; height: 22px; background: rgba(255, 225, 216, 0.25); }
.title-rules span:nth-child(2) { height: 46px; background: var(--coral); }
.title-rules span:nth-child(3) { height: 12px; }

/* ---------------- bottom exploration ---------------- */

.scale-marker {
  position: absolute;
  z-index: 24;
  left: clamp(18px, 3vw, 40px);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 233, 225, 0.36);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease 900ms;
}

body[data-phase="explore"] .scale-marker { opacity: 1; }

.scale-marker-line {
  display: block;
  width: 24px;
  height: 1px;
  background: rgba(255, 142, 131, 0.55);
}

.explore-bar {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 28px);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(25, 3, 12, 0.72);
  box-shadow: 0 18px 50px rgba(5, 0, 3, 0.3);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 700ms var(--ease-out) 500ms, transform 700ms var(--ease-out) 500ms, visibility 700ms;
}

body[data-phase="explore"] .explore-bar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.bar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 237, 231, 0.7);
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease;
}

.bar-button:hover,
.bar-button:focus-visible {
  color: var(--pearl);
  background: rgba(255, 229, 221, 0.075);
}

.bar-button.is-current {
  color: var(--cyan);
  background: rgba(139, 228, 231, 0.055);
}

.bar-button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.bar-button.bar-arrow { padding: 0 9px; color: rgba(255, 237, 231, 0.52); }
.bar-button.bar-arrow .bar-label-optional { font-size: 10px; letter-spacing: 0.06em; }

.bar-divider {
  display: block;
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line);
}

.task-launch {
  position: absolute;
  z-index: 31;
  right: clamp(18px, 2.5vw, 36px);
  bottom: calc(22px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(27, 3, 13, 0.74);
  color: var(--pearl-muted);
  box-shadow: 0 16px 40px rgba(6, 0, 3, 0.24);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 650ms var(--ease-out) 650ms, transform 650ms var(--ease-out) 650ms, visibility 650ms, border-color 200ms ease, background 200ms ease;
}

body[data-phase="explore"] .task-launch {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.task-launch:hover {
  border-color: rgba(139, 228, 231, 0.32);
  background: rgba(36, 7, 18, 0.82);
}

.task-launch.is-complete { border-color: rgba(139, 228, 231, 0.32); }

.task-launch-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(139, 228, 231, 0.21);
  border-radius: 9px;
  color: var(--cyan);
  background: rgba(41, 83, 87, 0.11);
}

.task-launch-icon svg { width: 21px; height: 21px; }

.task-launch-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.task-launch-copy > span { font-size: 11px; letter-spacing: 0.08em; color: var(--pearl); }
.task-launch-copy small { margin-top: 4px; color: rgba(255, 235, 228, 0.42); font-size: 9px; letter-spacing: 0.1em; }

.interaction-hint {
  position: absolute;
  z-index: 23;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 235, 228, 0.1);
  border-radius: 999px;
  background: rgba(24, 3, 12, 0.42);
  color: rgba(255, 235, 228, 0.56);
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 700ms ease, transform 700ms ease, visibility 700ms;
}

.interaction-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.hint-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 8px rgba(255, 111, 112, 0.55);
}

.hover-label {
  position: fixed;
  z-index: 33;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 228, 220, 0.18);
  border-radius: 6px;
  background: rgba(20, 2, 10, 0.82);
  color: var(--pearl);
  font-size: 10px;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translate(14px, 14px);
  transition: opacity 130ms ease, visibility 130ms ease;
  white-space: nowrap;
}

.hover-label.is-visible { opacity: 1; visibility: visible; }
.hover-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  z-index: 70;
  top: calc(82px + env(safe-area-inset-top, 0px));
  left: 50%;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px 12px 13px;
  border: 1px solid rgba(139, 228, 231, 0.24);
  border-radius: 8px;
  background: rgba(23, 3, 12, 0.9);
  box-shadow: 0 18px 48px rgba(4, 0, 2, 0.35);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 300ms ease, transform 300ms var(--ease-out), visibility 0s linear 300ms;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 300ms ease, transform 300ms var(--ease-out), visibility 0s;
}

.toast.is-notice { border-color: rgba(255, 181, 156, 0.25); }

.toast-mark {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(139, 228, 231, 0.6);
}

.toast.is-notice .toast-mark { background: var(--coral); box-shadow: 0 0 10px rgba(255, 142, 131, 0.55); }

.toast-copy { display: flex; flex-direction: column; gap: 2px; }
.toast-copy strong { color: var(--pearl); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; }
.toast-copy span { color: rgba(255, 235, 228, 0.58); font-size: 10px; line-height: 1.55; }

/* ---------------- panels ---------------- */

.panel {
  position: absolute;
  z-index: 40;
  top: 90px;
  right: clamp(18px, 2.5vw, 36px);
  width: min(370px, calc(100vw - 36px));
  max-height: calc(100vh - 190px);
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 212, 202, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(148deg, rgba(57, 10, 25, 0.93) 0%, rgba(27, 4, 14, 0.95) 54%, rgba(20, 2, 10, 0.97) 100%);
  box-shadow: 0 28px 80px rgba(4, 0, 2, 0.44), inset 0 1px 0 rgba(255, 239, 234, 0.055);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  backdrop-filter: blur(24px) saturate(120%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity 360ms var(--ease-out), transform 420ms var(--ease-out), visibility 0s linear 420ms;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 188, 175, 0.25) transparent;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  width: 52px;
  height: 1px;
  background: var(--coral);
  opacity: 0.7;
}

.panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: opacity 360ms var(--ease-out), transform 420ms var(--ease-out), visibility 0s;
}

.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { border-radius: 9px; background: rgba(255, 188, 175, 0.2); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}

.panel-index {
  color: rgba(255, 201, 192, 0.52);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.panel-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -9px -9px -9px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 234, 227, 0.48);
  transition: color 180ms ease, background 180ms ease;
}

.panel-close svg { width: 18px; height: 18px; }
.panel-close:hover { color: var(--pearl); background: rgba(255, 255, 255, 0.065); }

.cell-latin {
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.25em;
}

.panel h2 {
  color: var(--pearl);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.06em;
}

.cell-english {
  margin-top: 3px;
  color: rgba(255, 228, 220, 0.48);
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.cell-summary {
  margin-top: 18px;
  color: rgba(255, 239, 233, 0.82);
  font-size: 12px;
  line-height: 1.8;
}

.cell-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 20px 0 4px;
  border: 1px solid rgba(255, 222, 214, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 222, 214, 0.1);
}

.cell-meta > div {
  padding: 11px 12px;
  background: rgba(26, 3, 12, 0.8);
}

.cell-meta span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 226, 217, 0.4);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.cell-meta strong {
  color: var(--pearl-muted);
  font-size: 10px;
  font-weight: 400;
}

.cell-detail {
  padding: 16px 0 3px;
  border-top: 1px solid rgba(255, 222, 214, 0.09);
  margin-top: 15px;
}

.cell-detail:first-of-type { margin-top: 20px; }

.cell-detail h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--pearl);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.cell-detail h3 span {
  color: var(--coral);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.cell-detail p {
  color: rgba(255, 235, 228, 0.61);
  font-size: 11px;
  line-height: 1.8;
}

.source-block {
  margin-top: 19px;
  padding: 11px 12px;
  border-left: 1px solid rgba(139, 228, 231, 0.34);
  background: rgba(139, 228, 231, 0.035);
}

.source-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(139, 228, 231, 0.6);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.source-block a {
  color: rgba(224, 248, 247, 0.82);
  font-size: 10px;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-color: rgba(139, 228, 231, 0.28);
  text-underline-offset: 3px;
  transition: color 180ms ease;
}

.source-block a:hover { color: var(--cyan); }

.art-note {
  margin-top: 13px;
  color: rgba(255, 231, 224, 0.37);
  font-size: 9px;
  line-height: 1.7;
}

.panel-actions {
  display: flex;
  gap: 7px;
  margin-top: 19px;
}

.button-primary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}

.button-primary {
  border: 1px solid var(--coral-soft);
  background: var(--coral-soft);
  color: var(--wine-deep);
}

.button-primary:hover { border-color: var(--pearl); background: var(--pearl); color: var(--wine-deep); }

.button-ghost {
  border: 1px solid rgba(255, 220, 212, 0.18);
  background: transparent;
  color: var(--pearl-muted);
}

.button-ghost:hover { border-color: rgba(255, 220, 212, 0.4); background: rgba(255, 255, 255, 0.045); color: var(--pearl); }

.knowledge-panel .button-primary { flex: 1; }
.knowledge-panel .button-ghost { flex: 0 0 auto; }

/* ---------------- task panel ---------------- */

.task-panel { width: min(390px, calc(100vw - 36px)); }
.task-panel h2 { font-size: 30px; }

.panel-intro {
  margin-top: 9px;
  color: rgba(255, 235, 228, 0.55);
  font-size: 10px;
  line-height: 1.75;
}

.task-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 19px 0 11px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 222, 214, 0.1);
  color: rgba(255, 235, 228, 0.44);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.task-progress-row strong {
  color: var(--cyan);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.task-list { display: flex; flex-direction: column; gap: 7px; }

.task-item {
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  padding: 12px 12px 12px 11px;
  border: 1px solid rgba(255, 222, 214, 0.11);
  border-radius: 8px;
  background: rgba(255, 248, 245, 0.018);
  color: var(--pearl-muted);
  text-align: left;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.task-item:hover {
  border-color: rgba(255, 222, 214, 0.25);
  background: rgba(255, 248, 245, 0.045);
  color: var(--pearl);
}

.task-item.is-active {
  border-color: rgba(139, 228, 231, 0.35);
  background: rgba(139, 228, 231, 0.055);
}

.task-item.is-done { border-color: rgba(139, 228, 231, 0.17); background: rgba(139, 228, 231, 0.025); }
.task-item.is-done .task-title { color: rgba(212, 241, 240, 0.55); text-decoration: line-through; text-decoration-color: rgba(139, 228, 231, 0.3); }

.task-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 222, 214, 0.16);
  border-radius: 50%;
  color: rgba(255, 226, 217, 0.52);
  font-family: var(--serif);
  font-size: 10px;
}

.task-item.is-active .task-number { border-color: rgba(139, 228, 231, 0.44); color: var(--cyan); }
.task-item.is-done .task-number { border-color: rgba(139, 228, 231, 0.32); color: var(--cyan); }

.task-copy { display: block; min-width: 0; }
.task-title { display: block; color: var(--pearl); font-size: 11px; font-weight: 500; letter-spacing: 0.03em; }
.task-desc { display: block; margin-top: 3px; color: rgba(255, 235, 228, 0.4); font-size: 9px; line-height: 1.55; }
.task-state { align-self: center; color: rgba(255, 235, 228, 0.3); font-size: 8px; letter-spacing: 0.06em; white-space: nowrap; }
.task-item.is-active .task-state { color: var(--cyan); }
.task-item.is-done .task-state { color: var(--cyan-dim); }

.future-task {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed rgba(255, 222, 214, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
}

.future-lock {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  color: rgba(255, 235, 228, 0.32);
}

.future-lock svg { width: 18px; height: 18px; }
.future-task p { color: rgba(255, 235, 228, 0.38); font-size: 9px; line-height: 1.6; }
.future-task p:first-child { margin-bottom: 2px; color: rgba(255, 235, 228, 0.66); font-size: 10px; }

.future-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 150, 140, 0.22);
  border-radius: 3px;
  color: rgba(255, 168, 155, 0.68);
  font-size: 7px;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.task-note {
  margin-top: 13px;
  color: rgba(255, 235, 228, 0.32);
  font-size: 8.5px;
  line-height: 1.65;
}

/* ---------------- single-cell inspection ---------------- */

.inspect-layer {
  position: absolute;
  inset: 0;
  z-index: 36;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 700ms var(--ease-soft), visibility 700ms;
}

#experience.inspect-mode .inspect-layer {
  opacity: 1;
  visibility: visible;
}

#experience.inspect-mode .topbar,
#experience.inspect-mode .explore-bar,
#experience.inspect-mode .task-launch,
#experience.inspect-mode .scale-marker,
#experience.inspect-mode .interaction-hint {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.inspect-top {
  position: absolute;
  top: max(22px, env(safe-area-inset-top, 0px));
  left: clamp(20px, 3vw, 42px);
  right: clamp(20px, 3vw, 42px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.inspect-kicker {
  color: var(--coral-soft);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.inspect-top h2 {
  margin-top: 6px;
  color: var(--pearl);
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.inspect-top h2 + p {
  margin-top: 2px;
  color: rgba(255, 233, 225, 0.42);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.inspect-close {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(27, 3, 13, 0.58);
  color: var(--pearl-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  transition: color 200ms ease, border-color 200ms ease;
}

.inspect-close:hover { color: var(--pearl); border-color: var(--line-strong); }
.inspect-close svg { width: 17px; height: 17px; }

.annotation-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.annotation-svg line {
  stroke: rgba(139, 228, 231, 0.3);
  stroke-width: 0.8;
  stroke-dasharray: 2 4;
}

.annotation-svg circle { fill: rgba(139, 228, 231, 0.7); }

.annotation-labels { position: absolute; inset: 0; pointer-events: none; }

.annotation-label {
  position: absolute;
  width: 164px;
  padding: 8px 10px;
  border-left: 1px solid rgba(139, 228, 231, 0.55);
  background: linear-gradient(90deg, rgba(21, 6, 15, 0.84), rgba(21, 6, 15, 0.12));
  color: var(--pearl);
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 600ms ease 300ms;
}

#experience.inspect-mode .annotation-label { opacity: 1; }

.annotation-label strong {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.annotation-label span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 235, 228, 0.48);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.inspect-bottom {
  position: absolute;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 7px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(24, 3, 12, 0.64);
  color: rgba(255, 235, 228, 0.45);
  font-size: 9px;
  letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  pointer-events: auto;
}

.inspect-bottom p { display: flex; align-items: center; gap: 7px; white-space: nowrap; }

.inspect-reset {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 222, 214, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--pearl-muted);
  font-size: 9px;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.inspect-reset:hover { color: var(--pearl); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }

/* ---------------- about modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 0, 3, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 400ms ease, visibility 0s;
}

.about-panel {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  width: min(680px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  padding: clamp(24px, 4vw, 42px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 214, 204, 0.2);
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(98, 17, 39, 0.28), transparent 43%),
    linear-gradient(145deg, rgba(40, 7, 19, 0.98), rgba(15, 2, 8, 0.99));
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 243, 237, 0.07);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -47%);
  transition: opacity 430ms var(--ease-out), transform 500ms var(--ease-out), visibility 0s linear 430ms;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 188, 175, 0.25) transparent;
}

.about-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity 430ms var(--ease-out), transform 500ms var(--ease-out), visibility 0s;
}

.about-panel h2 {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: clamp(31px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.about-close {
  position: absolute;
  top: 20px;
  right: 20px;
}

.about-lede {
  max-width: 560px;
  margin-top: 15px;
  color: rgba(255, 235, 228, 0.72);
  font-size: 12px;
  line-height: 1.85;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 25px 0 30px;
  border: 1px solid rgba(255, 222, 214, 0.1);
  background: rgba(255, 222, 214, 0.09);
  border-radius: 9px;
  overflow: hidden;
}

.about-grid > div { padding: 15px; background: rgba(21, 3, 11, 0.82); }

.about-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--coral-soft);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.about-grid p { color: rgba(255, 235, 228, 0.48); font-size: 10px; line-height: 1.7; }

.about-panel h3 {
  margin: 25px 0 9px;
  color: var(--pearl);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.about-panel > p {
  color: rgba(255, 235, 228, 0.57);
  font-size: 10.5px;
  line-height: 1.8;
}

.about-sources { display: flex; flex-direction: column; margin-top: 12px; }

.about-sources li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 222, 214, 0.075);
}

.about-sources a {
  color: rgba(225, 246, 245, 0.78);
  font-size: 10.5px;
  text-decoration: underline;
  text-decoration-color: rgba(139, 228, 231, 0.23);
  text-underline-offset: 3px;
  transition: color 180ms ease;
}

.about-sources a:hover { color: var(--cyan); }
.about-sources span { flex: 0 0 auto; color: rgba(255, 235, 228, 0.27); font-size: 8px; letter-spacing: 0.04em; }

.technical-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 222, 214, 0.075);
  color: rgba(255, 235, 228, 0.35) !important;
  font-size: 9px !important;
}

.about-done { margin-top: 24px; min-width: 140px; }

/* ---------------- loader ---------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(80, 14, 34, 0.68) 0%, rgba(25, 3, 12, 0.95) 46%, #100107 100%);
  transition: opacity 1000ms var(--ease-soft), visibility 1000ms;
}

.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner { width: min(360px, 80vw); text-align: center; }

.loader-brand {
  color: var(--coral-soft);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.38em;
}

.loader-orbit {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 27px auto 24px;
  border: 1px solid rgba(255, 203, 191, 0.15);
  border-radius: 50%;
}

.loader-orbit::before,
.loader-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 203, 191, 0.17);
}

.loader-orbit::before { inset: 9px; transform: scaleY(0.43) rotate(25deg); }
.loader-orbit::after { inset: 21px; transform: scaleY(0.62) rotate(-35deg); border-color: rgba(139, 228, 231, 0.19); }

.loader-orbit span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 20px rgba(255, 112, 112, 0.55);
  transform: translate(-50%, -50%);
}

.loader-orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 176, 163, 0.5), transparent);
  transform-origin: left center;
  animation: loaderRevolve 3.2s linear infinite;
}

@keyframes loaderRevolve {
  from { transform: rotate(0deg) translateX(4px); }
  to { transform: rotate(360deg) translateX(4px); }
}

.loader-status {
  min-height: 22px;
  color: rgba(255, 240, 234, 0.7);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.loader-track {
  width: 100%;
  height: 1px;
  margin-top: 15px;
  overflow: hidden;
  background: rgba(255, 218, 210, 0.12);
}

.loader-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--pearl));
  box-shadow: 0 0 12px rgba(255, 158, 146, 0.4);
  transition: width 500ms var(--ease-out);
}

.loader-note {
  margin-top: 14px;
  color: rgba(255, 235, 228, 0.28);
  font-size: 8px;
  letter-spacing: 0.16em;
}

/* ---------------- fatal / fallback ---------------- */

.fatal-error {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  padding: clamp(24px, 5vw, 64px) clamp(18px, 4vw, 48px);
  background:
    radial-gradient(ellipse at 75% 10%, rgba(105, 21, 43, 0.27), transparent 45%),
    #130208;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 188, 175, 0.25) transparent;
}

.fatal-inner { width: min(940px, 100%); margin: 0 auto; }

.fatal-error h2 {
  max-width: 700px;
  margin-top: 16px;
  color: var(--pearl);
  font-family: var(--serif);
  font-size: clamp(31px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.fatal-message {
  max-width: 680px;
  margin-top: 17px;
  color: rgba(255, 235, 228, 0.61);
  font-size: 12px;
  line-height: 1.85;
}

.fatal-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }

.fallback-guide {
  margin-top: 48px;
  padding-top: 27px;
  border-top: 1px solid rgba(255, 222, 214, 0.13);
}

.fallback-head h3 {
  color: var(--pearl);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.fallback-head p { margin-top: 6px; color: rgba(255, 235, 228, 0.4); font-size: 10px; }

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

.fallback-grid article {
  display: flex;
  flex-direction: column;
  min-height: 285px;
  padding: 18px;
  border: 1px solid rgba(255, 222, 214, 0.11);
  border-radius: 11px;
  background: linear-gradient(155deg, rgba(54, 9, 25, 0.55), rgba(23, 3, 12, 0.55));
}

.fallback-cell {
  position: relative;
  width: 64px;
  height: 56px;
  margin: 3px 0 17px;
}

.fallback-rbc {
  width: 64px;
  height: 44px;
  margin-top: 9px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, #711221 0%, #a92737 22%, #e46565 44%, #b32b3d 70%, #6a0c1d 100%);
  box-shadow: 0 0 28px rgba(194, 46, 64, 0.18), inset 0 1px 4px rgba(255, 190, 177, 0.24);
}

.fallback-wbc {
  border-radius: 44% 56% 48% 52% / 55% 43% 57% 45%;
  background: radial-gradient(circle at 38% 33%, #fff4e9, #f0d4c8 57%, #c99d9a 100%);
  box-shadow: 0 0 30px rgba(255, 230, 220, 0.12);
}

.fallback-wbc i {
  position: absolute;
  display: block;
  width: 20px;
  height: 22px;
  border-radius: 50%;
  background: #8f668f;
  opacity: 0.7;
}

.fallback-wbc i:nth-child(1) { top: 17px; left: 16px; }
.fallback-wbc i:nth-child(2) { top: 19px; left: 31px; transform: scale(0.84); }
.fallback-wbc i:nth-child(3) { top: 28px; left: 24px; transform: scale(0.72); }

.fallback-platelet {
  width: 52px;
  height: 36px;
  margin-top: 12px;
  border-radius: 52% 44% 51% 42% / 58% 47% 54% 45%;
  background: radial-gradient(ellipse at 40% 35%, #fbf1f5, #d9c7da 60%, #a78fb0 100%);
  box-shadow: 0 0 22px rgba(186, 204, 225, 0.15);
  transform: rotate(-19deg);
}

.fallback-type {
  color: var(--coral-soft);
  font-size: 7px;
  letter-spacing: 0.2em;
}

.fallback-grid h4 {
  margin-top: 3px;
  color: var(--pearl);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.fallback-grid article > p:not(.fallback-type) {
  margin-top: 9px;
  color: rgba(255, 235, 228, 0.5);
  font-size: 10px;
  line-height: 1.8;
}

.fallback-grid a {
  margin-top: auto;
  padding-top: 14px;
  color: rgba(139, 228, 231, 0.65);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: rgba(139, 228, 231, 0.2);
  text-underline-offset: 3px;
}

.fallback-foot {
  margin-top: 18px;
  color: rgba(255, 235, 228, 0.27);
  font-size: 9px;
  line-height: 1.7;
}

.noscript-note {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 30px;
  background: #130208;
  text-align: center;
}

.noscript-note h2 { font-family: var(--serif); font-size: 34px; font-weight: 500; }
.noscript-note p { color: var(--pearl-muted); font-size: 12px; }

body[data-phase="fatal"] > #experience > :not(#fatalError) { pointer-events: none; }
body[data-phase="fatal"] .topbar,
body[data-phase="fatal"] .explore-bar,
body[data-phase="fatal"] .task-launch,
body[data-phase="fatal"] .scale-marker,
body[data-phase="fatal"] .interaction-hint,
body[data-phase="fatal"] .loader { display: none !important; }

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .title-orbit { right: -8vw; opacity: 0.45; width: 43vw; }
  .task-launch { bottom: calc(82px + var(--safe-bottom)); }
  .scale-marker { display: none; }
}

@media (max-width: 900px) {
  .title-content { margin-left: clamp(26px, 7vw, 70px); }
  .title-orbit { right: -18vw; width: 52vw; }
  .explore-bar { gap: 1px; }
  .bar-button { padding: 0 9px; font-size: 10.5px; }
  .task-launch { right: 16px; bottom: calc(82px + var(--safe-bottom)); min-height: 46px; padding-right: 11px; }
  .task-launch-icon { width: 33px; height: 33px; flex-basis: 33px; }
  .task-launch-copy > span { font-size: 10px; }
  .task-launch-copy small { font-size: 8px; }
  .interaction-hint { bottom: calc(84px + var(--safe-bottom)); }
}

@media (max-width: 760px) {
  .topbar { padding: 14px 14px; gap: 8px; }
  .brand-orbit { width: 30px; height: 30px; flex-basis: 30px; }
  .brand-orbit i { width: 5px; height: 5px; }
  .brand-kicker { font-size: 7px; letter-spacing: 0.16em; }
  .brand-title { font-size: 16px; letter-spacing: 0.07em; gap: 6px; }
  .brand-title span { font-size: 8px; letter-spacing: 0.08em; }
  .top-controls { gap: 5px; }
  .control-chip { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .control-chip > span { display: none; }
  .control-chip .icon { width: 17px; height: 17px; }
  .quality-control { height: 40px; padding: 3px; gap: 1px; }
  .quality-caption { display: none; }
  .quality-option { min-width: 29px; height: 32px; padding: 0 6px; font-size: 10px; }
  .icon-button { width: 40px; height: 40px; font-size: 14px; }

  .title-screen {
    align-items: flex-start;
    padding-top: max(12vh, 82px);
    overflow-y: auto;
    background:
      radial-gradient(ellipse at 55% 25%, rgba(58, 8, 25, 0.08) 0%, rgba(17, 2, 9, 0.55) 65%, rgba(10, 1, 5, 0.9) 100%),
      linear-gradient(180deg, rgba(11, 1, 5, 0.35), rgba(13, 1, 6, 0.68));
  }
  .title-content { width: auto; margin: 0 22px; padding-bottom: 15vh; }
  .title-overline { font-size: 8px; letter-spacing: 0.18em; }
  .title-overline span { width: 23px; }
  .title-display { margin-top: 19px; }
  .title-display .title-cn { font-size: clamp(52px, 15vw, 76px); letter-spacing: 0.05em; }
  .title-display .title-en { font-size: clamp(33px, 10vw, 49px); }
  .title-journey { margin-top: 14px; font-size: 12px; }
  .title-deck { font-size: 12px; letter-spacing: 0.28em; }
  .title-copy { margin-top: 19px; font-size: 11.5px; line-height: 1.85; }
  .title-copy br { display: none; }
  .start-button { min-height: 52px; margin-top: 27px; padding: 0 20px 0 23px; font-size: 12px; }
  .title-foot { gap: 6px 14px; margin-top: 20px; font-size: 8px; }
  .title-orbit, .title-side-note, .title-rules { display: none; }
  .intro-skip { right: 16px; bottom: max(15px, env(safe-area-inset-bottom)); }
  .text-button { padding: 12px 0; font-size: 10px; }

  .explore-bar {
    width: calc(100vw - 24px);
    bottom: calc(12px + var(--safe-bottom));
    justify-content: space-between;
    gap: 0;
    padding: 4px;
    border-radius: 12px;
  }
  .bar-button { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 5px; font-size: 9.5px; gap: 4px; }
  .bar-button svg { width: 14px; height: 14px; flex-basis: 14px; }
  .bar-button.bar-arrow { flex: 0 0 58px; padding: 0 3px; gap: 3px; }
  .bar-arrow .bar-label-optional { display: inline; font-size: 8px; letter-spacing: 0; }
  .bar-divider { margin: 0 1px; height: 18px; }
  .task-launch { right: 12px; bottom: calc(73px + var(--safe-bottom)); min-height: 42px; padding: 4px 10px 4px 5px; border-radius: 10px; }
  .task-launch-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 7px; }
  .task-launch-icon svg { width: 18px; height: 18px; }
  .task-launch-copy > span { font-size: 9px; }
  .task-launch-copy small { margin-top: 2px; font-size: 8px; }
  .interaction-hint { bottom: calc(128px + var(--safe-bottom)); font-size: 8px; padding: 6px 10px; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
  .toast { top: calc(70px + env(safe-area-inset-top)); }

  .panel {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(72px + var(--safe-bottom));
    width: auto;
    max-height: min(48vh, 460px);
    padding: 18px;
    border-radius: 13px;
    transform: translateY(24px);
  }
  .panel.is-open { transform: translateY(0); }
  .panel h2 { font-size: 30px; }
  .panel-head { margin-bottom: 18px; }
  .cell-summary { margin-top: 14px; }
  .cell-meta { margin-top: 16px; }
  .cell-detail { padding-top: 13px; margin-top: 12px; }
  .cell-detail:first-of-type { margin-top: 15px; }
  .source-block { margin-top: 15px; }
  .panel-actions { margin-top: 16px; position: sticky; bottom: -18px; padding: 10px 0 0; background: linear-gradient(180deg, transparent, rgba(24, 4, 13, 0.98) 30%); }
  .task-panel { max-height: min(62vh, 560px); }

  .inspect-top { top: max(16px, env(safe-area-inset-top)); left: 16px; right: 16px; }
  .inspect-kicker { font-size: 7px; }
  .inspect-top h2 { font-size: 30px; }
  .inspect-top h2 + p { font-size: 9px; }
  .inspect-close { min-height: 40px; padding: 0 12px; font-size: 9px; gap: 7px; }
  .inspect-close svg { width: 15px; height: 15px; }
  .annotation-label { width: 126px; padding: 6px 8px; }
  .annotation-label strong { font-size: 11px; }
  .annotation-label span { font-size: 7.5px; }
  .inspect-bottom { bottom: calc(14px + var(--safe-bottom)); gap: 8px; padding: 5px 5px 5px 11px; max-width: calc(100vw - 24px); }
  .inspect-bottom p { font-size: 8px; white-space: normal; line-height: 1.4; }
  .inspect-reset { min-height: 32px; padding: 0 9px; font-size: 8px; white-space: nowrap; }

  .about-panel { max-height: 88vh; padding: 23px 18px; }
  .about-panel h2 { font-size: 30px; margin-top: 15px; }
  .about-lede { font-size: 11px; }
  .about-grid { grid-template-columns: 1fr; margin-top: 20px; }
  .about-grid > div { padding: 12px; }
  .about-sources li { flex-direction: column; align-items: flex-start; gap: 3px; }
  .about-sources span { font-size: 7.5px; }
  .about-sources a { font-size: 10px; line-height: 1.5; }

  .fallback-grid { grid-template-columns: 1fr; }
  .fallback-grid article { min-height: 0; }
  .fallback-cell { margin-bottom: 12px; }
  .fatal-error h2 { font-size: 32px; }
}

@media (min-width: 761px) and (max-width: 1040px) {
  .panel {
    top: 164px;
    max-height: calc(100vh - 248px);
  }
}

@media (max-width: 380px) {
  .brand-title span { display: none; }
  .bar-button.bar-arrow { flex-basis: 43px; padding: 0 1px; }
  .bar-arrow .bar-label-optional { display: none; }
  .brand-title { font-size: 15px; }
  .topbar { padding: 12px 10px; }
  .top-controls { gap: 4px; }
  .bar-button { font-size: 9px; }
  .quality-option { min-width: 27px; padding: 0 5px; }
  .inspect-close span { display: none; }
  .inspect-close { width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .topbar { padding-top: 11px; padding-bottom: 11px; }
  .title-screen { align-items: center; padding-top: 50px; }
  .title-content { padding-bottom: 52px; }
  .title-display .title-cn { font-size: 48px; }
  .title-display .title-en { font-size: 30px; }
  .title-copy { display: none; }
  .start-button { margin-top: 17px; min-height: 46px; }
  .title-foot { margin-top: 14px; }
  .explore-bar { bottom: 8px; }
  .task-launch { bottom: auto; top: 64px; right: 12px; }
  .interaction-hint { display: none; }
  .panel { max-height: calc(100vh - 160px); bottom: 62px; }
  .inspect-top h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .title-screen,
  .title-content,
  .topbar,
  .explore-bar,
  .task-launch,
  .panel,
  .about-panel,
  .inspect-layer { transition-duration: 1ms !important; }
}
