:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071019;
  color: #eef7ff;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

body {
  position: fixed;
  inset: 0;
  margin: 0;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: radial-gradient(circle at 18% 5%, rgba(57, 118, 144, 0.28), transparent 32%), #071019;
}

button {
  border: 1px solid rgba(177, 214, 224, 0.28);
  background: rgba(9, 22, 32, 0.84);
  color: #f2fbff;
  min-height: 42px;
  border-radius: 6px;
  padding: 0.58rem 0.74rem;
  cursor: pointer;
  touch-action: manipulation;
}

button:hover,
button:focus-visible {
  border-color: #94d7e8;
  outline: none;
  background: rgba(33, 70, 86, 0.9);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.menu-screen {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  background: #071019;
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow: hidden;
  background: #071019;
}

.menu-screen::before,
.menu-screen::after,
.loading-screen::before,
.loading-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.menu-screen::before,
.loading-screen::before {
  background-image: url("../assets/backgrounds/odyssey-arrival-clean-v1.png");
  background-position: center;
  background-size: cover;
  filter: saturate(1.05) contrast(1.04);
  transform: scale(1.015);
}

.menu-screen::after,
.loading-screen::after {
  background:
    linear-gradient(90deg, rgba(2, 7, 12, 0.96) 0%, rgba(2, 7, 12, 0.74) 38%, rgba(2, 7, 12, 0.18) 72%, rgba(2, 7, 12, 0.52) 100%),
    linear-gradient(180deg, rgba(2, 7, 12, 0.24) 0%, rgba(2, 7, 12, 0.12) 46%, rgba(2, 7, 12, 0.86) 100%);
}

.menu-stars,
.loading-stars,
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(120,202,225,0.55) 0 1px, transparent 1.5px);
  background-position: 0 0, 70px 40px;
  background-size: 170px 100px, 240px 150px;
  opacity: 0.24;
  animation: drift 28s linear infinite;
}

.loading-panel {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100vw - 36px));
  padding: 1.05rem;
  border: 1px solid rgba(159, 206, 222, 0.2);
  border-radius: 8px;
  background: rgba(2, 8, 13, 0.72);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42), inset 0 0 36px rgba(81, 178, 210, 0.06);
  backdrop-filter: blur(12px);
}

.loading-panel h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 0.95;
}

.loading-readout {
  display: grid;
  gap: 0.24rem;
  min-height: 4rem;
  margin-bottom: 0.85rem;
}

.loading-readout strong {
  color: #f2fbff;
  font-size: 1rem;
}

.loading-readout span,
.loading-percent {
  color: #b9d3dc;
  font-size: 0.82rem;
}

.loading-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(159, 206, 222, 0.26);
  border-radius: 999px;
  background: rgba(2, 8, 13, 0.88);
}

.loading-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(102, 207, 231, 0.82), rgba(229, 184, 105, 0.9)),
    #60c8e6;
  box-shadow: 0 0 24px rgba(102, 207, 231, 0.42);
  transition: width 180ms ease;
}

.loading-percent {
  display: block;
  margin-top: 0.48rem;
  text-align: right;
  letter-spacing: 0.06em;
}

.menu-content {
  position: relative;
  z-index: 2;
  width: min(920px, 74vw);
  padding: 0 0 clamp(12px, 2.4vh, 28px);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.78);
}

.menu-logo {
  display: block;
  width: min(720px, 58vw);
  max-width: 100%;
  height: auto;
  max-height: min(28vh, 240px);
  object-fit: contain;
  object-position: left center;
  margin: 0 0 0.7rem -0.55rem;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 24px rgba(73, 190, 236, 0.18));
}

.menu-content h1 {
  max-width: 10ch;
  margin: 0 0 0.7rem;
  font-size: clamp(3.8rem, 8.4vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.menu-copy {
  max-width: 39rem;
  color: #c7dbe2;
  font-size: clamp(1rem, 1.55vw, 1.25rem);
  line-height: 1.42;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  width: fit-content;
  margin: 0 0 0.82rem;
  padding: 0.4rem 0.62rem;
  border: 1px solid rgba(229, 184, 105, 0.38);
  border-radius: 6px;
  background: rgba(5, 15, 22, 0.68);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.beta-badge strong {
  color: #f7d48b;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.beta-badge span {
  color: #d8e8ee;
  font-size: 0.78rem;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.4rem 0 0.85rem;
}

.menu-actions button {
  min-width: 132px;
  border-color: rgba(229, 184, 105, 0.38);
  background: rgba(5, 15, 22, 0.72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.menu-note {
  margin: 0;
  color: #e5b869;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.menu-copyright {
  max-width: 36rem;
  margin: 0.38rem 0 0;
  color: rgba(206, 225, 232, 0.66);
  font-size: 0.68rem;
  line-height: 1.32;
}

.stage-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  display: block;
  overflow: hidden;
}

.stage-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
}

.effect-denied::after {
  background: rgba(190, 56, 46, 0.2);
  animation: deniedFlash 700ms ease-out;
}

.effect-success::after {
  box-shadow: inset 0 0 150px rgba(120, 229, 204, 0.3);
  animation: successFlash 780ms ease-out;
}

.effect-scan::after {
  background: linear-gradient(180deg, transparent 0%, rgba(120, 215, 240, 0.2) 48%, rgba(120, 215, 240, 0.34) 50%, rgba(120, 215, 240, 0.16) 52%, transparent 100%);
  animation: scanSweep 920ms ease-out;
}

.effect-alert::after {
  background: rgba(229, 129, 54, 0.16);
  animation: alertFlash 860ms ease-out;
}

.effect-transition::after {
  background: radial-gradient(circle at 50% 50%, rgba(183, 231, 244, 0.24), transparent 34%);
  animation: transitionPulse 820ms ease-out;
}

.topbar,
.game-frame,
.dialogue,
.inventory {
  border: 1px solid rgba(159, 206, 222, 0.18);
}

.topbar {
  position: absolute;
  z-index: 60;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: auto;
  max-width: min(460px, calc(100vw - 120px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.48rem 0.64rem;
  border-radius: 6px;
  pointer-events: none;
  background: rgba(2, 8, 13, 0.64);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  color: #92c7d5;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 2rem);
}

.status {
  position: fixed;
  z-index: 76;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  pointer-events: none;
}

.status span:first-child {
  display: none;
}

.status span,
.inventory > span,
.inventory button,
.objective-box span {
  border: 1px solid rgba(170, 215, 226, 0.2);
  background: rgba(113, 156, 166, 0.12);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
}

.game-frame {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 0;
  background: #071019;
}

.sound-caption {
  position: absolute;
  z-index: 82;
  top: max(96px, calc(env(safe-area-inset-top) + 92px));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(460px, calc(100vw - 48px));
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(159, 206, 222, 0.24);
  border-radius: 6px;
  background: rgba(2, 8, 13, 0.76);
  color: #dff8ff;
  font-size: 0.78rem;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(8px);
  animation: captionLift 1050ms ease-out forwards;
}

.scene {
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(10, 25, 38, 0.36), rgba(8, 15, 22, 0.72)),
    #09131d;
}

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

.scene::before {
  z-index: 0;
  background-image: var(--scene-bg);
  background-position: center;
  background-size: cover;
  transform: scale(1.012);
  filter: saturate(1.08) contrast(1.04);
}

.scene::after {
  z-index: 2;
  background:
    radial-gradient(circle at 52% 46%, transparent 0 28%, rgba(2, 7, 12, 0.22) 61%, rgba(0, 0, 0, 0.52) 100%),
    linear-gradient(180deg, rgba(3, 9, 15, 0.08), rgba(3, 9, 15, 0.36) 72%, rgba(2, 5, 8, 0.58));
}

.scene-observation::before {
  background-position: center 45%;
}

.scene-residential::before {
  background-position: 42% center;
  filter: saturate(0.92) contrast(1.02) brightness(0.92);
}

.scene-market::before {
  background-position: 58% 50%;
  filter: saturate(1.2) contrast(1.06) brightness(0.9);
}

.scene-bar::before {
  background-position: 54% 54%;
  filter: saturate(1.1) contrast(1.12) brightness(0.78);
}

.scene-descent::before {
  background-position: center 48%;
  filter: saturate(1.08) contrast(1.08) brightness(0.9);
}

.scene-warehouse::before {
  background-position: center 52%;
  filter: saturate(0.98) contrast(1.06) brightness(0.86);
}

.scene-surfaceAlley::before {
  background-position: center 52%;
  filter: saturate(1.02) contrast(1.06) brightness(0.9);
}

.scene-zuoodMarket::before {
  background-position: center 50%;
  filter: saturate(0.98) contrast(1.08) brightness(0.84);
}

.scene-harborYard::before,
.scene-contactPoint::before {
  background-position: center 48%;
  filter: saturate(1.04) contrast(1.08) brightness(0.86);
}

.scene-kioSquare::before {
  background-position: center 52%;
  filter: saturate(1.04) contrast(1.06) brightness(0.88);
}

.scene-satisfiedNakamoto::before {
  background-position: center 52%;
  filter: saturate(1.02) contrast(1.06) brightness(0.9);
}

.scene-madreakiSafehouse::before {
  background-position: center 52%;
  filter: saturate(0.98) contrast(1.08) brightness(0.84);
}

.scene-madreakiMindRoom::before {
  background-position: center 51%;
  filter: saturate(0.72) contrast(1.04) brightness(0.9);
}

.scene-madreakiWildlands::before {
  background-position: center 52%;
  filter: saturate(1.08) contrast(1.14) brightness(0.78) hue-rotate(12deg);
}

.scene-madreakiEclipseCorridor::before,
.scene-madreakiEngineAirlock::before {
  background-position: center 52%;
  filter: saturate(1.14) contrast(1.12) brightness(0.78);
}

.window,
.floor,
.station-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stars,
.window,
.floor,
.station-lines {
  z-index: 1;
}

.window {
  top: 8%;
  left: 6%;
  right: 7%;
  bottom: 44%;
  border: 0;
  background: linear-gradient(90deg, rgba(12, 35, 54, 0.05), rgba(50, 97, 118, 0.04));
  box-shadow: inset 0 0 50px rgba(122, 210, 237, 0.03);
}

.station-lines {
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(140, 195, 209, 0.035) 14.2% 14.4%, transparent 14.6%),
    linear-gradient(90deg, transparent 0 63%, rgba(226, 180, 99, 0.045) 63.1% 63.5%, transparent 63.7%),
    linear-gradient(180deg, transparent 0 66%, rgba(178, 222, 232, 0.045) 66.2%, transparent 66.7%);
}

.floor {
  top: 55%;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(116, 160, 172, 0.04) 42.5% 43.2%, transparent 44%),
    linear-gradient(180deg, transparent 0 28%, rgba(180, 216, 225, 0.045) 29%, transparent 31%);
}

.scene-observation .window {
  left: 3%;
  right: 3%;
  bottom: 39%;
}

.scene-security .window {
  left: 24%;
  right: 24%;
  bottom: 48%;
  background: linear-gradient(180deg, rgba(110, 27, 18, 0.23), rgba(20, 32, 38, 0.2));
}

.scene-residential .window {
  top: 10%;
  left: 10%;
  right: 48%;
  bottom: 34%;
  background:
    linear-gradient(90deg, rgba(137, 199, 203, 0.1), transparent),
    repeating-linear-gradient(180deg, rgba(213, 237, 235, 0.08) 0 2px, transparent 2px 18px);
}

.scene-market .window {
  top: 7%;
  left: 12%;
  right: 12%;
  bottom: 40%;
  background:
    radial-gradient(circle at 34% 44%, rgba(229, 184, 105, 0.16), transparent 18%),
    radial-gradient(circle at 64% 38%, rgba(96, 193, 221, 0.16), transparent 20%),
    linear-gradient(90deg, rgba(20, 48, 58, 0.18), rgba(87, 62, 28, 0.12));
}

.scene-bar .window {
  top: 12%;
  left: 18%;
  right: 18%;
  bottom: 50%;
  background:
    radial-gradient(circle at 52% 50%, rgba(229, 184, 105, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(114, 45, 34, 0.22), rgba(10, 18, 26, 0.18));
}

.scene-descent .window {
  top: 6%;
  left: 7%;
  right: 7%;
  bottom: 37%;
  background:
    radial-gradient(circle at 55% 50%, rgba(229, 184, 105, 0.16), transparent 28%),
    linear-gradient(90deg, rgba(28, 72, 94, 0.08), rgba(137, 78, 35, 0.08));
}

.scene-warehouse .window {
  top: 6%;
  left: 9%;
  right: 12%;
  bottom: 47%;
  background:
    radial-gradient(circle at 28% 24%, rgba(229, 184, 105, 0.18), transparent 22%),
    radial-gradient(circle at 48% 53%, rgba(102, 207, 231, 0.11), transparent 18%);
}

.scene-surfaceAlley .window,
.scene-zuoodMarket .window,
.scene-harborYard .window,
.scene-contactPoint .window,
.scene-kioSquare .window,
.scene-satisfiedNakamoto .window,
.scene-madreakiSafehouse .window,
.scene-madreakiMindRoom .window,
.scene-madreakiWildlands .window,
.scene-madreakiEclipseCorridor .window,
.scene-madreakiEngineAirlock .window {
  top: 4%;
  left: 4%;
  right: 4%;
  bottom: 42%;
  background:
    radial-gradient(circle at 54% 28%, rgba(229, 184, 105, 0.16), transparent 24%),
    radial-gradient(circle at 22% 54%, rgba(102, 207, 231, 0.08), transparent 19%);
}

.scene-residential .station-lines {
  background:
    linear-gradient(90deg, transparent 0 20%, rgba(214, 232, 228, 0.06) 20.2% 20.5%, transparent 20.7%),
    linear-gradient(90deg, transparent 0 48%, rgba(214, 232, 228, 0.06) 48.2% 48.5%, transparent 48.7%),
    linear-gradient(180deg, transparent 0 61%, rgba(229, 184, 105, 0.055) 61.2%, transparent 62%);
}

.scene-market .station-lines {
  background:
    repeating-linear-gradient(90deg, transparent 0 11%, rgba(229, 184, 105, 0.055) 11.2% 11.4%, transparent 11.8% 19%),
    linear-gradient(180deg, transparent 0 58%, rgba(94, 207, 230, 0.07) 58.5%, transparent 59.2%);
}

.scene-bar .station-lines {
  background:
    linear-gradient(90deg, transparent 0 34%, rgba(229, 184, 105, 0.08) 34.2% 34.8%, transparent 35%),
    linear-gradient(180deg, transparent 0 42%, rgba(205, 73, 59, 0.07) 42.5%, transparent 43.2%),
    repeating-linear-gradient(180deg, transparent 0 20px, rgba(229, 184, 105, 0.035) 21px 22px);
}

.scene-descent .station-lines {
  background:
    linear-gradient(90deg, transparent 0 19%, rgba(224, 95, 76, 0.07) 19.2% 19.6%, transparent 20%),
    linear-gradient(90deg, transparent 0 79%, rgba(102, 207, 231, 0.07) 79.2% 79.6%, transparent 80%),
    linear-gradient(180deg, transparent 0 60%, rgba(229, 184, 105, 0.06) 60.4%, transparent 61%);
}

.scene-warehouse .station-lines {
  background:
    linear-gradient(90deg, transparent 0 28%, rgba(102, 207, 231, 0.045) 28.2% 28.5%, transparent 28.7%),
    linear-gradient(90deg, transparent 0 70%, rgba(229, 184, 105, 0.05) 70.2% 70.5%, transparent 70.7%),
    linear-gradient(180deg, transparent 0 64%, rgba(214, 232, 228, 0.04) 64.3%, transparent 65%);
}

.scene-surfaceAlley .station-lines,
.scene-zuoodMarket .station-lines,
.scene-harborYard .station-lines,
.scene-contactPoint .station-lines,
.scene-kioSquare .station-lines,
.scene-satisfiedNakamoto .station-lines {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(102, 207, 231, 0.05) 18.2% 18.5%, transparent 18.8%),
    linear-gradient(90deg, transparent 0 78%, rgba(229, 184, 105, 0.05) 78.2% 78.5%, transparent 78.8%),
    linear-gradient(180deg, transparent 0 62%, rgba(214, 232, 228, 0.04) 62.3%, transparent 63%);
}

.scene-madreakiSafehouse .station-lines,
.scene-madreakiMindRoom .station-lines,
.scene-madreakiWildlands .station-lines,
.scene-madreakiEclipseCorridor .station-lines,
.scene-madreakiEngineAirlock .station-lines {
  background:
    linear-gradient(90deg, transparent 0 20%, rgba(105, 255, 160, 0.05) 20.2% 20.5%, transparent 20.8%),
    linear-gradient(90deg, transparent 0 77%, rgba(102, 207, 231, 0.045) 77.2% 77.5%, transparent 77.8%),
    linear-gradient(180deg, transparent 0 61%, rgba(105, 255, 160, 0.04) 61.2%, transparent 62%);
}

.ambient-motion {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.ambient-motion i {
  position: absolute;
  display: block;
  opacity: 0;
  animation-delay: var(--delay, 0s);
}

.light-sweep,
.security-sweep,
.screen-scan,
.ticker-light,
.bar-neon {
  height: 2px;
  border-radius: 999px;
  transform-origin: center;
}

.light-sweep {
  background: linear-gradient(90deg, transparent, rgba(113, 204, 232, 0.58), transparent);
  box-shadow: 0 0 18px rgba(83, 178, 215, 0.24);
  animation: ambientSweep 9s ease-in-out infinite;
}

.security-sweep {
  background: linear-gradient(90deg, transparent, rgba(224, 95, 76, 0.66), transparent);
  box-shadow: 0 0 20px rgba(224, 95, 76, 0.28);
  animation: securitySweep 5.8s ease-in-out infinite;
}

.screen-scan {
  height: 34px;
  border: 1px solid rgba(116, 214, 238, 0.12);
  background: linear-gradient(180deg, transparent, rgba(116, 214, 238, 0.18), transparent);
  animation: screenScan 6.8s linear infinite;
}

.tactical-pulse,
.habitat-flicker {
  border: 1px solid rgba(111, 204, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(102, 207, 231, 0.05), transparent),
    repeating-linear-gradient(180deg, rgba(102, 207, 231, 0.04) 0 1px, transparent 1px 10px);
}

.tactical-pulse {
  animation: tacticalPulse 7.2s ease-in-out infinite;
}

.habitat-flicker {
  background:
    linear-gradient(90deg, rgba(214, 232, 228, 0.08), transparent),
    repeating-linear-gradient(180deg, rgba(214, 232, 228, 0.05) 0 2px, transparent 2px 20px);
  animation: habitatFlicker 8.6s steps(1, end) infinite;
}

.terminal-blink,
.market-glow,
.music-note-light,
.alert-pin,
.soft-dust {
  width: 11px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(113, 204, 232, 0.7);
  box-shadow: 0 0 18px rgba(113, 204, 232, 0.38);
  animation: ambientBlink 6.4s ease-in-out infinite;
}

.terminal-blink.small,
.market-glow.small,
.music-note-light.small,
.soft-dust.small {
  width: 7px;
}

.terminal-blink.warning,
.alert-pin {
  background: rgba(229, 184, 105, 0.78);
  box-shadow: 0 0 20px rgba(229, 184, 105, 0.38);
}

.market-glow {
  background: rgba(229, 184, 105, 0.72);
  box-shadow: 0 0 24px rgba(229, 184, 105, 0.35);
  animation-duration: 7.8s;
}

.music-note-light {
  background: rgba(205, 73, 59, 0.66);
  box-shadow: 0 0 22px rgba(205, 73, 59, 0.3);
  animation-duration: 5.4s;
}

.soft-dust {
  background: rgba(214, 232, 228, 0.38);
  box-shadow: 0 0 14px rgba(214, 232, 228, 0.2);
  animation: softDust 8.4s ease-in-out infinite;
}

.ticker-light {
  background: linear-gradient(90deg, transparent, rgba(229, 184, 105, 0.52), rgba(102, 207, 231, 0.42), transparent);
  animation: tickerLight 7.2s ease-in-out infinite;
}

.bar-neon {
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(229, 184, 105, 0.46), rgba(205, 73, 59, 0.42), transparent);
  box-shadow: 0 0 18px rgba(229, 184, 105, 0.2);
  animation: barNeon 4.6s ease-in-out infinite;
}

.descent-glow,
.base-table-pulse,
.warehouse-dust,
.surface-dust,
.alley-canopy-drift,
.canopy-shadow,
.kio-window-glow,
.pod-gyro,
.bistro-lamp-glow,
.steam-thread,
.memory-grid,
.render-spark,
.green-moon-pulse,
.wildland-mist,
.slime-glint,
.engine-breathe,
.airlock-countdown {
  border-radius: 10px;
  pointer-events: none;
}

.descent-glow {
  background: radial-gradient(ellipse at 50% 48%, rgba(229, 184, 105, 0.16), transparent 62%);
  animation: descentGlow 5.8s ease-in-out infinite;
}

.base-table-pulse {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(102, 207, 231, 0.22), transparent 58%),
    linear-gradient(90deg, transparent, rgba(102, 207, 231, 0.13), transparent);
  box-shadow: 0 0 30px rgba(102, 207, 231, 0.1);
  animation: baseTablePulse 4.8s ease-in-out infinite;
}

.warehouse-dust {
  background:
    linear-gradient(110deg, transparent, rgba(229, 184, 105, 0.12), transparent),
    radial-gradient(circle at 42% 34%, rgba(255, 228, 173, 0.12), transparent 24%);
  animation: warehouseDust 9.4s ease-in-out infinite;
}

.surface-dust {
  background:
    linear-gradient(110deg, transparent, rgba(229, 184, 105, 0.12), transparent),
    radial-gradient(circle at 55% 45%, rgba(102, 207, 231, 0.08), transparent 28%);
  animation: surfaceDust 10.5s ease-in-out infinite;
}

.alley-canopy-drift,
.canopy-shadow {
  background: linear-gradient(90deg, rgba(84, 42, 36, 0.1), rgba(229, 184, 105, 0.14), rgba(30, 65, 78, 0.08));
  animation: canopyDrift 8.8s ease-in-out infinite;
}

.harbor-sweep {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(102, 207, 231, 0.62), rgba(224, 95, 76, 0.38), transparent);
  box-shadow: 0 0 22px rgba(102, 207, 231, 0.22);
  animation: harborSweep 5.5s ease-in-out infinite;
}

.kio-window-glow {
  background: radial-gradient(ellipse at 62% 45%, rgba(229, 184, 105, 0.18), transparent 56%);
  animation: kioWindowGlow 6.8s ease-in-out infinite;
}

.pod-gyro {
  width: 5rem;
  height: 1.4rem;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 50%, rgba(102, 207, 231, 0.24), transparent 62%);
  animation: podGyro 1.8s ease-in-out infinite;
}

.bistro-lamp-glow {
  background: radial-gradient(ellipse at 50% 20%, rgba(229, 184, 105, 0.24), rgba(229, 184, 105, 0.08) 34%, transparent 64%);
  animation: bistroLampGlow 5.2s ease-in-out infinite;
}

.steam-thread {
  width: 4rem;
  height: 8rem;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(214, 232, 228, 0.13), transparent);
  filter: blur(3px);
  animation: steamThread 7.4s ease-in-out infinite;
}

.memory-grid {
  border: 1px solid rgba(188, 233, 239, 0.09);
  background:
    repeating-linear-gradient(90deg, rgba(210, 236, 239, 0.05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(180deg, rgba(210, 236, 239, 0.045) 0 1px, transparent 1px 36px);
  animation: memoryGrid 6.8s ease-in-out infinite;
}

.render-spark {
  width: 13px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(196, 249, 255, 0.72);
  box-shadow: 0 0 18px rgba(196, 249, 255, 0.36);
  animation: renderSpark 4.4s ease-in-out infinite;
}

.render-spark.small,
.green-moon-pulse.small {
  width: 8px;
}

.green-moon-pulse {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 255, 150, 0.22), rgba(111, 255, 150, 0.08) 42%, transparent 68%);
  box-shadow: 0 0 36px rgba(111, 255, 150, 0.2);
  animation: greenMoonPulse 5.4s ease-in-out infinite;
}

.wildland-mist {
  background: linear-gradient(90deg, transparent, rgba(111, 255, 150, 0.1), rgba(214, 232, 228, 0.05), transparent);
  filter: blur(7px);
  animation: wildlandMist 9.6s ease-in-out infinite;
}

.security-sweep.green {
  background: linear-gradient(90deg, transparent, rgba(111, 255, 150, 0.58), transparent);
  box-shadow: 0 0 20px rgba(111, 255, 150, 0.22);
}

.slime-glint {
  width: 4rem;
  height: 1rem;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 50%, rgba(111, 255, 150, 0.26), transparent 64%);
  filter: blur(2px);
  animation: slimeGlint 3.8s ease-in-out infinite;
}

.engine-breathe {
  background:
    radial-gradient(ellipse at 35% 50%, rgba(111, 255, 150, 0.16), transparent 50%),
    linear-gradient(90deg, rgba(111, 255, 150, 0.05), transparent);
  animation: engineBreathe 4.2s ease-in-out infinite;
}

.airlock-countdown {
  width: 2.2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(229, 184, 105, 0.45) 0 10%, transparent 11%),
    conic-gradient(from 0deg, rgba(229, 184, 105, 0.38), transparent 58%, rgba(111, 255, 150, 0.28));
  box-shadow: 0 0 20px rgba(229, 184, 105, 0.34);
  animation: airlockCountdown 2.4s steps(8, end) infinite;
}

.hotspot,
.exit {
  position: absolute;
  z-index: 22;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  color: #d9f8ff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(96, 193, 221, 0.16);
  backdrop-filter: blur(8px);
  opacity: 0.88;
  background: rgba(8, 22, 31, 0.5);
}

.hotspot {
  z-index: 28;
}

.exit {
  z-index: 21;
}

.hotspot::before,
.exit::before {
  content: "";
  display: block;
  width: 0.8rem;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(121, 213, 240, 0.72);
}

.hotspot.secret-hotspot::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff6c9;
  box-shadow: 0 0 12px rgba(255, 231, 147, 0.8);
  opacity: 0;
  animation: secretTwinkle 7.5s ease-in-out infinite;
}

.hotspot.evidence-hotspot::before {
  animation: evidencePulse 4.8s ease-in-out infinite;
}

.hotspot.important-hotspot::before {
  box-shadow: 0 0 16px rgba(229, 184, 105, 0.46), 0 0 26px rgba(121, 213, 240, 0.28);
}

.hotspot.discovered::before {
  animation: none;
  box-shadow: 0 0 10px rgba(121, 213, 240, 0.34);
  opacity: 0.68;
}

.hotspot.discovered::after {
  display: none;
}

.hotspot span,
.exit span {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  min-width: max-content;
  max-width: 190px;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.42rem 0.58rem;
  border: 1px solid rgba(159, 206, 222, 0.22);
  border-radius: 6px;
  background: rgba(2, 8, 13, 0.86);
  color: #f0fbff;
  font-size: 0.78rem;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: normal;
  backdrop-filter: blur(8px);
}

.hotspot:hover span,
.hotspot:focus-visible span,
.exit:hover span,
.exit:focus-visible span {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.exit {
  border-color: rgba(229, 184, 105, 0.54);
  color: #ffe0a0;
}

.exit.locked {
  border-color: rgba(224, 95, 76, 0.48);
  z-index: 20;
}

.cast {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.destination {
  position: absolute;
  z-index: 24;
  width: 34px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(229, 184, 105, 0.8);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(229, 184, 105, 0.65) 0 9%, transparent 10%),
    radial-gradient(circle, rgba(229, 184, 105, 0.18) 0 46%, transparent 48%);
  box-shadow: 0 0 18px rgba(229, 184, 105, 0.48);
  animation: destinationPulse 760ms ease-out infinite;
  pointer-events: none;
}

.game-character {
  position: absolute;
  width: calc(230px * var(--char-scale));
  height: calc(360px * var(--char-scale));
  transform: translate(-50%, -100%);
  pointer-events: auto;
  border: 0;
  padding: 0;
  background: transparent;
  isolation: isolate;
  transition:
    left var(--walk-duration, 740ms) cubic-bezier(0.22, 0.72, 0.18, 1),
    top var(--walk-duration, 740ms) cubic-bezier(0.22, 0.72, 0.18, 1),
    width var(--walk-duration, 740ms) cubic-bezier(0.22, 0.72, 0.18, 1),
    height var(--walk-duration, 740ms) cubic-bezier(0.22, 0.72, 0.18, 1);
}

.game-character img,
.android-body,
.sprite-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.42));
  animation: breathe 3.8s ease-in-out infinite;
}

.character-art {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
}

.character-shadow {
  position: absolute;
  z-index: -2;
  left: 50%;
  bottom: -0.4%;
  width: 52%;
  height: 4.4%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.2) 52%, transparent 72%);
  filter: blur(2px);
  opacity: 0.78;
  transform: translateX(-50%);
  pointer-events: none;
}

.performance-rig {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}

.motion-slice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: none;
  animation: none;
  transform-origin: 50% 100%;
}

.player.walking .motion-slice,
.game-character.speaking .motion-slice {
  will-change: transform, opacity;
}

.motion-head {
  clip-path: inset(0 32% 68% 32%);
  transform-origin: 50% 18%;
}

.motion-arm-left {
  clip-path: inset(24% 62% 29% 8%);
  transform-origin: 38% 32%;
}

.motion-arm-right {
  clip-path: inset(24% 8% 29% 62%);
  transform-origin: 62% 32%;
}

.motion-lower {
  clip-path: inset(54% 25% 0 25%);
  transform-origin: 50% 58%;
}

.stance-line {
  position: absolute;
  left: 28%;
  bottom: 2.4%;
  width: 44%;
  height: 1.4%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(102, 207, 231, 0.22), transparent);
  opacity: 0;
  transform: translateY(0);
}

.idle-life .character-art {
  animation: characterIdleCore 5.8s ease-in-out infinite;
  animation-delay: var(--idle-delay, 0s);
}

.idle-life .motion-head {
  opacity: 0.1;
  animation: characterHeadIdle 6.4s ease-in-out infinite;
  animation-delay: var(--idle-delay, 0s);
}

.idle-life .motion-arm-left {
  opacity: 0.09;
  animation: characterArmIdleLeft 7.1s ease-in-out infinite;
  animation-delay: calc(var(--idle-delay, 0s) - 0.9s);
}

.idle-life .motion-arm-right {
  opacity: 0.09;
  animation: characterArmIdleRight 7.6s ease-in-out infinite;
  animation-delay: calc(var(--idle-delay, 0s) - 1.6s);
}

.idle-life .motion-lower {
  opacity: 0.05;
  animation: characterLowerIdle 8.2s ease-in-out infinite;
  animation-delay: calc(var(--idle-delay, 0s) - 0.3s);
}

.speaking .character-art,
.game-character.active .character-art {
  animation: characterSpeakingCore 2.6s ease-in-out infinite;
}

.speaking .motion-head,
.game-character.active .motion-head {
  opacity: 0.18;
  animation: characterHeadSpeaking 2.8s ease-in-out infinite;
}

.speaking .motion-arm-left,
.game-character.active .motion-arm-left,
.speaking .motion-arm-right,
.game-character.active .motion-arm-right {
  opacity: 0.14;
  animation-duration: 3.1s;
}

.speaking .stance-line,
.game-character.active .stance-line {
  opacity: 0.5;
  animation: stanceLinePulse 2.8s ease-in-out infinite;
}

.sprite-fallback {
  display: none;
  place-items: center;
  border: 1px solid rgba(148, 215, 232, 0.36);
  border-radius: 42% 42% 12% 12%;
  background:
    radial-gradient(circle at 50% 18%, rgba(160, 221, 231, 0.9) 0 13%, transparent 13.5%),
    linear-gradient(180deg, rgba(78, 134, 150, 0.95), rgba(14, 36, 48, 0.95));
  color: #071019;
}

.sprite-fallback strong {
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(232, 250, 255, 0.8);
  font-size: 3rem;
}

.game-character.image-failed img {
  display: none;
}

.game-character.image-failed .sprite-fallback {
  display: grid;
}

.player::before,
.player::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 1.6%;
  width: calc(42px * var(--char-scale));
  height: calc(10px * var(--char-scale));
  border-radius: 999px;
  background: rgba(2, 8, 13, 0.42);
  filter: blur(1px);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.player.walking {
  animation: walkSettle var(--walk-duration, 760ms) linear;
}

.player.walking::before {
  animation: leftFoot var(--walk-cycle, 520ms) steps(2, end) infinite;
}

.player.walking::after {
  animation: rightFoot var(--walk-cycle, 520ms) steps(2, end) infinite;
}

.player.walking .character-art {
  animation: walkBody var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .character-shadow {
  animation: walkingShadow var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking img {
  animation: henrikWalk var(--walk-cycle, 560ms) steps(4, end) infinite;
  transform-origin: 50% 100%;
}

.player.walking.facing-left img {
  animation-name: henrikWalkLeft;
}

.player.walking .face-rig {
  animation: faceWalk var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .motion-head {
  opacity: 0.16;
  animation: playerHeadWalk var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .motion-arm-left {
  opacity: 0.18;
  animation: playerArmLeftWalk var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .motion-arm-right {
  opacity: 0.18;
  animation: playerArmRightWalk var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .motion-lower {
  opacity: 0.12;
  animation: playerLowerWalk var(--walk-cycle, 560ms) ease-in-out infinite;
}

.walk-rig {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 3.5%;
  width: 33%;
  height: 36%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.walk-rig::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 28%;
  right: 28%;
  top: 4%;
  bottom: 4%;
  border-radius: 45% 45% 24% 24%;
  background:
    linear-gradient(90deg, rgba(5, 18, 30, 0.24), rgba(20, 114, 156, 0.44), rgba(5, 18, 30, 0.28)),
    linear-gradient(180deg, rgba(28, 125, 174, 0.28), rgba(3, 9, 16, 0.78));
  filter: blur(0.4px);
}

.player.walking .walk-rig {
  opacity: 0.9;
}

.walk-hip,
.walk-leg,
.walk-leg b {
  position: absolute;
  display: block;
}

.walk-hip {
  z-index: 4;
  left: 32%;
  top: 0;
  width: 36%;
  height: 14%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(3, 10, 17, 0.5), rgba(33, 137, 182, 0.72), rgba(3, 10, 17, 0.5));
  box-shadow: 0 0 10px rgba(67, 181, 223, 0.16);
}

.walk-leg {
  top: 7%;
  left: 44%;
  width: 13%;
  height: 74%;
  border-radius: 999px 999px 42% 42%;
  transform-origin: 50% 6%;
  background:
    linear-gradient(90deg, rgba(4, 14, 24, 0.7), rgba(22, 125, 174, 0.9) 48%, rgba(2, 9, 16, 0.82)),
    linear-gradient(180deg, rgba(54, 176, 220, 0.55), rgba(4, 11, 18, 0.95));
  box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.38), 0 4px 8px rgba(0, 0, 0, 0.22);
}

.walk-leg b {
  left: -55%;
  bottom: -6%;
  width: 210%;
  height: 18%;
  border-radius: 35% 58% 40% 38%;
  transform-origin: 30% 50%;
  background: linear-gradient(90deg, #041018, #0a2231 58%, #04080d);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.48);
}

.walk-leg-front {
  z-index: 3;
}

.walk-leg-back {
  z-index: 1;
  opacity: 0.78;
}

.player.walking .walk-leg-front {
  animation: legFrontRight var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .walk-leg-back {
  animation: legBackRight var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .walk-leg-front b {
  animation: bootFrontRight var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking .walk-leg-back b {
  animation: bootBackRight var(--walk-cycle, 560ms) ease-in-out infinite;
}

.player.walking.facing-left .walk-leg-front {
  animation-name: legFrontLeft;
}

.player.walking.facing-left .walk-leg-back {
  animation-name: legBackLeft;
}

.player.walking.facing-left .walk-leg-front b {
  animation-name: bootFrontLeft;
}

.player.walking.facing-left .walk-leg-back b {
  animation-name: bootBackLeft;
}

.facing-left img,
.facing-left .sprite-fallback {
  transform: scaleX(-1);
}

.game-character.facing-left img {
  animation-name: breatheLeft;
}

.game-character.active {
  filter: drop-shadow(0 0 16px rgba(129, 222, 245, 0.5));
}

.game-character span {
  position: absolute;
  left: 50%;
  bottom: -1.75rem;
  transform: translateX(-50%);
  width: max-content;
  max-width: 150px;
  color: #d8f7ff;
  font-size: 0.78rem;
  text-shadow: 0 1px 4px #000;
}

.android-body {
  position: relative;
  background: linear-gradient(180deg, #9bd3dd, #315460);
  clip-path: polygon(42% 8%, 58% 8%, 66% 22%, 76% 58%, 62% 92%, 38% 92%, 24% 58%, 34% 22%);
  border: 1px solid rgba(212, 255, 255, 0.28);
}

.android-head,
.android-core,
.android-arm,
.android-leg {
  position: absolute;
  background: rgba(5, 14, 18, 0.62);
  border: 1px solid rgba(174, 238, 250, 0.4);
}

.android-head {
  left: 34%;
  top: 7%;
  width: 32%;
  height: 16%;
  border-radius: 44% 44% 32% 32%;
}

.android-core {
  left: 37%;
  top: 34%;
  width: 26%;
  height: 20%;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(126, 229, 246, 0.7);
}

.android-arm.left { left: 18%; top: 33%; width: 14%; height: 42%; }
.android-arm.right { right: 18%; top: 33%; width: 14%; height: 42%; }
.android-leg.left { left: 36%; bottom: 2%; width: 12%; height: 28%; }
.android-leg.right { right: 36%; bottom: 2%; width: 12%; height: 28%; }

.face-rig {
  position: absolute;
  left: calc(var(--face-x) - var(--face-w) / 2);
  top: calc(var(--face-y) - var(--face-h) / 2);
  width: var(--face-w);
  height: var(--face-h);
  z-index: 2;
  overflow: visible;
  pointer-events: none;
  color: #071116;
  opacity: 0.82;
}

.rig-android,
.rig-youllian {
  color: #031114;
  filter: drop-shadow(0 0 2px rgba(151, 244, 250, 0.5));
}

.brow,
.mouth,
.glasses path,
.glasses circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye {
  fill: rgba(236, 255, 255, 0.74);
  stroke: currentColor;
  stroke-width: 2.5;
  transform-origin: center;
  animation: blink 5.3s infinite;
}

.pupil {
  fill: currentColor;
}

.eyes-soft .eye {
  fill: rgba(236, 255, 255, 0.56);
}

.emotion-talking .mouth {
  animation: talk 0.34s ease-in-out infinite alternate;
}

.emotion-surprised .mouth {
  fill: rgba(5, 12, 15, 0.66);
}

.panel {
  position: absolute;
  z-index: 70;
  right: max(12px, env(safe-area-inset-right));
  top: calc(max(12px, env(safe-area-inset-top)) + 78px);
  width: min(300px, 28vw);
  max-height: calc(100dvh - 116px - env(safe-area-inset-bottom));
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(159, 206, 222, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  background:
    linear-gradient(180deg, rgba(7, 16, 24, 0.92), rgba(2, 7, 11, 0.96)),
    radial-gradient(circle at 15% 0, rgba(63, 136, 164, 0.2), transparent 38%);
}

.panel-body {
  padding: 1rem;
}

.overlay-toggle {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0.32rem 0.54rem;
  border: 0;
  border-bottom: 1px solid rgba(159, 206, 222, 0.18);
  border-radius: 0;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel.collapsed {
  width: auto;
}

.panel.collapsed .panel-body {
  display: none;
}

.panel-copy {
  color: #c4d7dd;
  line-height: 1.45;
  min-height: 4.2rem;
}

.verbs,
.action-dock,
.choices,
.inventory,
.objective-box,
.settings-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.verbs {
  margin: 0 0 1rem;
}

.intent-line {
  position: absolute;
  z-index: 73;
  left: 50%;
  top: max(56px, calc(env(safe-area-inset-top) + 52px));
  width: min(560px, calc(100vw - 360px));
  min-height: 34px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(159, 206, 222, 0.2);
  border-radius: 8px;
  background: rgba(2, 8, 13, 0.68);
  color: #f7d48b;
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.tutorial-coach {
  position: absolute;
  z-index: 76;
  left: max(12px, env(safe-area-inset-left));
  top: max(70px, calc(env(safe-area-inset-top) + 70px));
  width: min(390px, calc(100vw - 460px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(229, 184, 105, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(19, 44, 59, 0.92), rgba(4, 10, 16, 0.9)),
    rgba(4, 10, 16, 0.88);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32), 0 0 24px rgba(229, 184, 105, 0.08);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.tutorial-coach span,
.tutorial-coach strong,
.tutorial-coach p {
  display: block;
}

.tutorial-coach span {
  color: #f7d48b;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-coach strong {
  margin-top: 0.12rem;
  color: #f2fbff;
  font-size: 1rem;
}

.tutorial-coach p {
  margin: 0.24rem 0 0;
  color: #c8dfe6;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tutorial-coach-actions {
  display: flex;
  gap: 0.42rem;
  pointer-events: auto;
}

.tutorial-coach-actions button {
  min-height: 34px;
  padding: 0.34rem 0.55rem;
}

.tutorial-target {
  border-color: rgba(247, 212, 139, 0.95) !important;
  box-shadow: 0 0 0 2px rgba(247, 212, 139, 0.2), 0 0 24px rgba(247, 212, 139, 0.28) !important;
}

.game-character.tutorial-target {
  filter: drop-shadow(0 0 16px rgba(247, 212, 139, 0.58));
}

.action-dock {
  display: none;
}

.objective-box,
.settings-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(159, 206, 222, 0.16);
}

.objective-box strong,
.settings-box label {
  width: 100%;
}

.objective-box button {
  min-height: 34px;
  padding: 0.32rem 0.54rem;
}

.settings-box label {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.5rem;
  align-items: center;
  color: #c8dfe6;
}

.face-preview {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.75rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(159, 206, 222, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(37, 81, 96, 0.32), rgba(7, 16, 25, 0.72));
}

.face-preview .preview-orbit {
  position: relative;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(148, 215, 232, 0.36);
  background: radial-gradient(circle at 50% 35%, rgba(149, 220, 230, 0.78), rgba(65, 113, 126, 0.8) 55%, rgba(5, 13, 18, 0.9));
  overflow: hidden;
}

.face-preview .face-rig {
  left: 11%;
  top: 7%;
  width: 78%;
  height: 78%;
  color: #061014;
  opacity: 0.95;
}

.face-preview strong,
.face-preview span {
  display: block;
}

.face-preview span {
  margin-top: 0.25rem;
  color: #f7d48b;
}

button.active {
  border-color: #e5b869;
  background: rgba(164, 114, 37, 0.44);
}

.game-character.active,
.game-character.active:hover,
.game-character.active:focus-visible {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dialogue {
  position: absolute;
  z-index: 65;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(64px + max(12px, env(safe-area-inset-bottom)));
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  min-height: 84px;
  max-height: 22dvh;
  overflow: hidden;
  backdrop-filter: blur(8px);
  background: rgba(2, 8, 13, 0.84);
  border-radius: 8px;
  pointer-events: none;
}

.topbar,
.inventory {
  backdrop-filter: blur(8px);
}

.dialogue strong {
  display: block;
  color: #f7d48b;
}

.dialogue span {
  color: #9dbcc8;
}

.dialogue p {
  margin: 0.35rem 0 0;
  max-width: 62rem;
  line-height: 1.45;
}

.info-toast {
  left: max(12px, env(safe-area-inset-left));
  right: auto;
  bottom: calc(86px + max(12px, env(safe-area-inset-bottom)));
  width: min(660px, calc(100vw - 390px));
  min-height: 0;
  max-height: 18dvh;
  padding: 0.72rem 0.86rem;
  overflow: hidden;
  border: 1px solid rgba(159, 206, 222, 0.2);
  border-radius: 8px;
  background: rgba(2, 8, 13, 0.8);
  backdrop-filter: blur(10px);
  pointer-events: none;
  animation: infoMessageFade var(--message-duration, 5200ms) linear var(--message-delay, 0ms) both;
  will-change: opacity;
}

.info-toast strong {
  display: block;
  color: #f7d48b;
}

.info-toast p {
  max-width: none;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.active-dialogue {
  z-index: 78;
  max-height: 44dvh;
  align-items: stretch;
  border-color: rgba(159, 206, 222, 0.28);
  background:
    linear-gradient(135deg, rgba(13, 31, 43, 0.96), rgba(4, 10, 16, 0.96)),
    rgba(4, 10, 16, 0.94);
  font-size: 1rem;
  pointer-events: auto;
}

.active-dialogue:not(.dialogue-response) > div:first-child {
  flex: 1 1 auto;
  min-width: min(420px, 46vw);
}

.active-dialogue strong {
  font-size: 1rem;
  line-height: 1.25;
}

.active-dialogue > div > span {
  font-size: 0.86rem;
  line-height: 1.25;
}

.active-dialogue p,
.dialogue-response p,
.dialogue-response .npc-response {
  color: #f2fbff;
  font-size: 1rem;
  line-height: 1.45;
}

.dialogue-response {
  max-height: 44dvh;
}

.dialogue-response > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.dialogue-response .choices {
  flex: 0 0 auto;
  min-width: 112px;
}

.active-dialogue .choices button,
.dialogue-response .choices button {
  border-color: rgba(159, 206, 222, 0.32);
  background: rgba(8, 19, 29, 0.78);
  font-size: 1rem;
  line-height: 1.45;
}

.active-dialogue .choices button:hover,
.active-dialogue .choices button:focus-visible,
.dialogue-response .choices button:hover,
.dialogue-response .choices button:focus-visible {
  border-color: rgba(247, 212, 139, 0.72);
  background: rgba(164, 114, 37, 0.34);
}

.player-choice {
  display: block;
  max-width: min(46rem, 100%);
  margin-top: 0.3rem;
  overflow: hidden;
  color: #dfeaf0;
  font-size: 1rem;
  line-height: 1.45;
  font-style: normal;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-choice::before {
  content: "Henrik: ";
  color: #9dbcc8;
}

.typed-word {
  opacity: 0;
  animation: typedWordIn 0.18s ease-out var(--word-delay, 0ms) forwards;
}

.dialogue-response .npc-response {
  margin-top: 0.38rem;
  min-height: 1.35em;
}

.choices {
  align-content: center;
  justify-content: flex-end;
  min-width: min(430px, 100%);
  pointer-events: auto;
}

.inventory {
  position: absolute;
  z-index: 66;
  left: max(12px, env(safe-area-inset-left));
  right: calc(370px + max(12px, env(safe-area-inset-right)));
  bottom: max(12px, env(safe-area-inset-bottom));
  align-items: center;
  min-height: 48px;
  max-height: 56px;
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  white-space: nowrap;
  pointer-events: auto;
  scrollbar-width: thin;
}

.inventory button {
  pointer-events: auto;
}

.inventory-entry {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(220px, 22vw);
}

.inventory strong {
  flex: 0 0 auto;
}

.inventory button,
.inventory > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-entry button:first-child {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.inventory-entry .item-info {
  min-width: 34px;
  width: 34px;
  padding: 0;
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: #f7d48b;
  font-weight: 700;
  font-family: Georgia, serif;
}

.modal-layer {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(1, 5, 8, 0.58);
  backdrop-filter: blur(6px);
}

.station-map,
.case-log,
.save-load,
.item-detail,
.about-dialog,
.tutorial-dialog {
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid rgba(159, 206, 222, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 39, 55, 0.96), rgba(3, 9, 14, 0.96)),
    rgba(3, 9, 14, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.station-map header,
.case-log header,
.save-load header,
.item-detail header,
.about-dialog header,
.tutorial-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(159, 206, 222, 0.18);
}

.station-map h2,
.case-log h2,
.save-load h2,
.item-detail h2,
.about-dialog h2,
.tutorial-dialog h2,
.map-readout h3 {
  margin: 0;
  letter-spacing: 0;
}

.about-dialog {
  width: min(720px, calc(100vw - 32px));
}

.about-body {
  display: grid;
  gap: 0.85rem;
  max-height: calc(100dvh - 126px);
  overflow: auto;
  padding: 1rem;
}

.about-body section,
.about-body footer {
  padding: 0.84rem;
  border: 1px solid rgba(159, 206, 222, 0.16);
  border-radius: 8px;
  background: rgba(5, 16, 24, 0.68);
}

.about-body h3 {
  margin: 0 0 0.38rem;
  color: #f7d48b;
  font-size: 0.98rem;
}

.about-body p,
.about-body span {
  margin: 0;
  color: #c9dde4;
  line-height: 1.44;
}

.about-body footer {
  display: grid;
  gap: 0.34rem;
  border-color: rgba(229, 184, 105, 0.28);
  background: linear-gradient(135deg, rgba(101, 70, 28, 0.28), rgba(5, 16, 24, 0.7));
}

.tutorial-dialog {
  width: min(760px, calc(100vw - 32px));
}

.tutorial-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  max-height: calc(100dvh - 156px);
  overflow: auto;
  padding: 0.9rem;
}

.tutorial-body section {
  min-height: 118px;
  padding: 0.82rem;
  border: 1px solid rgba(159, 206, 222, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(30, 71, 88, 0.42), rgba(4, 13, 20, 0.76)),
    rgba(5, 16, 24, 0.7);
}

.tutorial-body section:first-child {
  border-color: rgba(229, 184, 105, 0.34);
  background:
    linear-gradient(135deg, rgba(101, 70, 28, 0.32), rgba(5, 16, 24, 0.74)),
    rgba(5, 16, 24, 0.7);
}

.tutorial-body strong {
  display: block;
  margin-bottom: 0.4rem;
  color: #f7d48b;
  font-size: 0.98rem;
}

.tutorial-body p {
  margin: 0;
  color: #c9dde4;
  line-height: 1.42;
}

.tutorial-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid rgba(159, 206, 222, 0.18);
}

.tutorial-dialog label {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  color: #a9bec8;
  font-size: 0.82rem;
}

.tutorial-dialog input {
  width: 18px;
  height: 18px;
  accent-color: #f7d48b;
}

.map-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 1rem;
  padding: 1rem;
  overflow: auto;
  max-height: calc(100dvh - 126px);
}

.map-spine {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.map-node {
  position: relative;
  min-height: 126px;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.76rem;
  border: 1px solid rgba(159, 206, 222, 0.2);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 21, 31, 0.92), rgba(14, 35, 47, 0.72));
}

.map-node::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  top: 0.55rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(128, 218, 240, 0.85), transparent);
  opacity: 0.45;
}

.map-node.current {
  border-color: rgba(229, 184, 105, 0.76);
  box-shadow: inset 0 0 28px rgba(229, 184, 105, 0.12);
}

.map-node.locked {
  border-color: rgba(224, 95, 76, 0.38);
}

.map-node span,
.route-list span,
.map-node em,
.map-readout span {
  color: #9ec5d0;
  font-size: 0.74rem;
}

.map-node strong {
  display: block;
  margin: 0.22rem 0;
  color: #f2fbff;
}

.map-node p,
.map-readout p,
.item-detail p,
.item-detail dd {
  margin: 0;
  color: #c9dde4;
  line-height: 1.38;
}

.map-node button,
.map-node em {
  align-self: flex-end;
  flex: 0 0 auto;
}

.map-readout {
  padding: 0.9rem;
  border: 1px solid rgba(159, 206, 222, 0.18);
  border-radius: 8px;
  background: rgba(2, 8, 13, 0.5);
}

.map-readout h3 {
  margin: 0.2rem 0 0.5rem;
  color: #f7d48b;
}

.map-readout > span {
  display: block;
  margin-top: 0.65rem;
}

.route-list {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.95rem;
}

.route-list span {
  display: block;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(159, 206, 222, 0.16);
  border-radius: 6px;
  background: rgba(5, 16, 24, 0.72);
}

.route-list span.open {
  color: #bff7e5;
}

.route-list span.locked {
  color: #ffc1ad;
}

.case-log {
  width: min(900px, calc(100vw - 32px));
}

.case-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-height: calc(100dvh - 126px);
  overflow: auto;
  padding: 1rem;
}

.case-column {
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.case-column h3 {
  margin: 0 0 0.3rem;
  color: #f7d48b;
  font-size: 0.96rem;
}

.case-column article {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.48rem;
  align-items: start;
  min-height: 38px;
  padding: 0.48rem 0.55rem;
  border: 1px solid rgba(159, 206, 222, 0.16);
  border-radius: 6px;
  background: rgba(5, 16, 24, 0.68);
}

.case-column article i {
  width: 14px;
  aspect-ratio: 1;
  margin-top: 0.12rem;
  border: 1px solid rgba(159, 206, 222, 0.5);
  border-radius: 50%;
}

.case-column article.done {
  border-color: rgba(121, 229, 204, 0.28);
}

.case-column article.done i {
  border-color: rgba(121, 229, 204, 0.9);
  background:
    radial-gradient(circle, rgba(121, 229, 204, 0.95) 0 34%, transparent 38%),
    rgba(121, 229, 204, 0.14);
  box-shadow: 0 0 14px rgba(121, 229, 204, 0.32);
}

.case-column article.todo {
  color: #abc8d0;
}

.case-column article span,
.case-summary span {
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.32;
}

.case-summary {
  margin-top: 0.4rem;
  padding: 0.75rem;
  border: 1px solid rgba(229, 184, 105, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(101, 70, 28, 0.34), rgba(5, 16, 24, 0.7));
}

.case-summary strong,
.case-summary span {
  display: block;
}

.case-summary strong {
  margin-bottom: 0.24rem;
  color: #f7d48b;
}

.lore-column {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
}

.lore-column h3 {
  margin: 0;
  color: #f7d48b;
  font-size: 0.96rem;
}

.lore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.lore-grid article {
  min-height: 98px;
  padding: 0.65rem;
  border: 1px solid rgba(159, 206, 222, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 31, 43, 0.78), rgba(4, 13, 20, 0.84)),
    rgba(4, 13, 20, 0.74);
}

.lore-grid article.unlocked {
  border-color: rgba(121, 229, 204, 0.24);
  box-shadow: inset 0 0 28px rgba(84, 201, 195, 0.06);
}

.lore-grid article.locked {
  color: #8fb2bd;
  background: rgba(4, 13, 20, 0.58);
}

.lore-grid strong,
.lore-grid span {
  display: block;
}

.lore-grid strong {
  margin-bottom: 0.28rem;
  color: #dff8ff;
  font-size: 0.82rem;
}

.lore-grid article.locked strong {
  color: #9fb9c2;
}

.lore-grid span {
  color: inherit;
  font-size: 0.74rem;
  line-height: 1.32;
}

.save-load {
  width: min(760px, calc(100vw - 32px));
}

.save-body {
  display: grid;
  gap: 0.72rem;
  max-height: calc(100dvh - 126px);
  overflow: auto;
  padding: 1rem;
}

.autosave-card,
.save-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 74px;
  padding: 0.72rem;
  border: 1px solid rgba(159, 206, 222, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(6, 18, 27, 0.9), rgba(15, 35, 47, 0.72));
}

.autosave-card {
  border-color: rgba(229, 184, 105, 0.28);
}

.save-slot.empty {
  background: rgba(4, 13, 20, 0.62);
}

.autosave-card strong,
.save-slot strong,
.autosave-card span,
.save-slot span,
.save-slot small {
  display: block;
}

.autosave-card strong,
.save-slot strong {
  color: #f7d48b;
}

.autosave-card span,
.save-slot span {
  margin-top: 0.14rem;
  color: #d7edf4;
  line-height: 1.32;
}

.save-slot small {
  margin-top: 0.18rem;
  color: #8fb2bd;
  font-size: 0.74rem;
  line-height: 1.28;
}

.save-actions {
  display: flex;
  gap: 0.45rem;
}

.item-detail {
  width: min(620px, calc(100vw - 32px));
}

.item-detail > p,
.item-detail dl,
.item-actions {
  margin: 0;
  padding: 1rem;
}

.item-detail dl {
  display: grid;
  gap: 0.65rem;
  padding-top: 0;
}

.item-detail div {
  min-width: 0;
}

.item-detail dt {
  margin-bottom: 0.16rem;
  color: #f7d48b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid rgba(159, 206, 222, 0.16);
}

.chapter-complete {
  position: absolute;
  z-index: 74;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  padding: 1rem;
  border: 1px solid rgba(229, 184, 105, 0.38);
  border-radius: 8px;
  background: rgba(2, 8, 13, 0.9);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
}

.chapter-complete strong,
.chapter-complete span {
  display: block;
}

.chapter-complete strong {
  margin-bottom: 0.35rem;
  color: #f7d48b;
  font-size: 1.25rem;
}

.chapter-complete span {
  color: #c7dbe2;
  line-height: 1.4;
}

.chapter-complete button {
  margin-top: 0.85rem;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-2px) scaleY(1.006); }
}

@keyframes breatheLeft {
  0%, 100% { transform: translateY(0) scaleX(-1) scaleY(1); }
  50% { transform: translateY(-2px) scaleX(-1) scaleY(1.006); }
}

@keyframes henrikWalk {
  0%, 100% { transform: translateY(0) rotate(-0.2deg) scaleX(1) scaleY(1); }
  25% { transform: translateY(calc(-2px * var(--step-scale))) rotate(0.35deg) scaleX(0.996) scaleY(1.002); }
  50% { transform: translateY(0) rotate(-0.25deg) scaleX(1.003) scaleY(0.998); }
  75% { transform: translateY(calc(-2.4px * var(--step-scale))) rotate(0.3deg) scaleX(0.997) scaleY(1.002); }
}

@keyframes henrikWalkLeft {
  0%, 100% { transform: translateY(0) rotate(0.2deg) scaleX(-1) scaleY(1); }
  25% { transform: translateY(calc(-2px * var(--step-scale))) rotate(-0.35deg) scaleX(-0.996) scaleY(1.002); }
  50% { transform: translateY(0) rotate(0.25deg) scaleX(-1.003) scaleY(0.998); }
  75% { transform: translateY(calc(-2.4px * var(--step-scale))) rotate(-0.3deg) scaleX(-0.997) scaleY(1.002); }
}

@keyframes leftFoot {
  0%, 44% { opacity: 0.42; transform: translateX(calc(-70% * var(--step-scale))) scaleX(1.16); }
  45%, 100% { opacity: 0.1; transform: translateX(calc(-42% * var(--step-scale))) scaleX(0.76); }
}

@keyframes rightFoot {
  0%, 44% { opacity: 0.1; transform: translateX(calc(-2% * var(--step-scale))) scaleX(0.76); }
  45%, 100% { opacity: 0.42; transform: translateX(calc(-28% + 36% * var(--step-scale))) scaleX(1.16); }
}

@keyframes walkBody {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(calc(0.9px * var(--step-scale))) rotate(-0.18deg); }
  50% { transform: translateX(0) rotate(0.08deg); }
  75% { transform: translateX(calc(-0.9px * var(--step-scale))) rotate(0.18deg); }
}

@keyframes faceWalk {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(calc(-0.35px * var(--step-scale))) rotate(-0.06deg); }
  50% { transform: translateY(0) rotate(0.04deg); }
  75% { transform: translateY(calc(-0.4px * var(--step-scale))) rotate(0.06deg); }
}

@keyframes characterIdleCore {
  0%, 100% { transform: translateY(0) rotate(0deg) scaleY(1); }
  34% { transform: translateY(-0.7px) rotate(-0.08deg) scaleY(1.002); }
  68% { transform: translateY(0.3px) rotate(0.07deg) scaleY(0.999); }
}

@keyframes characterHeadIdle {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  32% { transform: translate(0.4px, -0.6px) rotate(-0.18deg); }
  64% { transform: translate(-0.35px, -0.2px) rotate(0.14deg); }
}

@keyframes characterArmIdleLeft {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  38% { transform: translate(-0.8px, 0.6px) rotate(-0.7deg); }
  72% { transform: translate(0.3px, 0.2px) rotate(0.28deg); }
}

@keyframes characterArmIdleRight {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  42% { transform: translate(0.8px, 0.5px) rotate(0.7deg); }
  76% { transform: translate(-0.25px, 0.2px) rotate(-0.24deg); }
}

@keyframes characterLowerIdle {
  0%, 100% { transform: translateX(0) scaleX(1); }
  44% { transform: translateX(0.4px) scaleX(0.998); }
  78% { transform: translateX(-0.35px) scaleX(1.001); }
}

@keyframes characterSpeakingCore {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(-0.8px) rotate(-0.12deg); }
  56% { transform: translateY(-0.2px) rotate(0.1deg); }
}

@keyframes characterHeadSpeaking {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  24% { transform: translate(0.8px, -0.8px) rotate(-0.34deg); }
  52% { transform: translate(-0.5px, -0.25px) rotate(0.22deg); }
  78% { transform: translate(0.25px, -0.5px) rotate(-0.12deg); }
}

@keyframes stanceLinePulse {
  0%, 100% { transform: translateY(0) scaleX(0.72); opacity: 0.14; }
  44% { transform: translateY(-1px) scaleX(1); opacity: 0.5; }
}

@keyframes walkingShadow {
  0%, 100% { transform: translateX(-50%) scaleX(1.08); opacity: 0.72; }
  50% { transform: translateX(-50%) scaleX(0.88); opacity: 0.52; }
}

@keyframes playerHeadWalk {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(calc(-0.8px * var(--step-scale))) rotate(-0.12deg); }
  50% { transform: translateY(0) rotate(0.05deg); }
  75% { transform: translateY(calc(-0.9px * var(--step-scale))) rotate(0.12deg); }
}

@keyframes playerArmLeftWalk {
  0%, 100% { transform: translateX(calc(-1.1px * var(--step-scale))) rotate(-1.4deg); }
  50% { transform: translateX(calc(1.1px * var(--step-scale))) rotate(1.1deg); }
}

@keyframes playerArmRightWalk {
  0%, 100% { transform: translateX(calc(1.1px * var(--step-scale))) rotate(1.3deg); }
  50% { transform: translateX(calc(-1.1px * var(--step-scale))) rotate(-1.1deg); }
}

@keyframes playerLowerWalk {
  0%, 100% { transform: translateX(calc(0.7px * var(--step-scale))) skewX(-0.4deg); }
  50% { transform: translateX(calc(-0.7px * var(--step-scale))) skewX(0.4deg); }
}

@keyframes legFrontRight {
  0%, 100% { transform: translateX(-18%) rotate(13deg) scaleY(0.98); }
  25% { transform: translateX(18%) rotate(-16deg) scaleY(1.01); }
  50% { transform: translateX(24%) rotate(-20deg) scaleY(1.02); }
  75% { transform: translateX(-12%) rotate(12deg) scaleY(0.99); }
}

@keyframes legBackRight {
  0%, 100% { transform: translateX(20%) rotate(-17deg) scaleY(1.02); }
  25% { transform: translateX(-15%) rotate(12deg) scaleY(0.99); }
  50% { transform: translateX(-22%) rotate(16deg) scaleY(0.98); }
  75% { transform: translateX(14%) rotate(-14deg) scaleY(1.01); }
}

@keyframes bootFrontRight {
  0%, 100% { transform: translateX(12%) rotate(7deg) scaleX(1.08); }
  25% { transform: translateX(-10%) rotate(-8deg) scaleX(0.94); }
  50% { transform: translateX(-18%) rotate(-13deg) scaleX(0.9); }
  75% { transform: translateX(8%) rotate(5deg) scaleX(1.04); }
}

@keyframes bootBackRight {
  0%, 100% { transform: translateX(-14%) rotate(-10deg) scaleX(0.92); }
  25% { transform: translateX(8%) rotate(5deg) scaleX(1.05); }
  50% { transform: translateX(16%) rotate(10deg) scaleX(1.12); }
  75% { transform: translateX(-8%) rotate(-6deg) scaleX(0.96); }
}

@keyframes legFrontLeft {
  0%, 100% { transform: translateX(18%) rotate(-13deg) scaleY(0.98); }
  25% { transform: translateX(-18%) rotate(16deg) scaleY(1.01); }
  50% { transform: translateX(-24%) rotate(20deg) scaleY(1.02); }
  75% { transform: translateX(12%) rotate(-12deg) scaleY(0.99); }
}

@keyframes legBackLeft {
  0%, 100% { transform: translateX(-20%) rotate(17deg) scaleY(1.02); }
  25% { transform: translateX(15%) rotate(-12deg) scaleY(0.99); }
  50% { transform: translateX(22%) rotate(-16deg) scaleY(0.98); }
  75% { transform: translateX(-14%) rotate(14deg) scaleY(1.01); }
}

@keyframes bootFrontLeft {
  0%, 100% { transform: translateX(-12%) rotate(-7deg) scaleX(1.08); }
  25% { transform: translateX(10%) rotate(8deg) scaleX(0.94); }
  50% { transform: translateX(18%) rotate(13deg) scaleX(0.9); }
  75% { transform: translateX(-8%) rotate(-5deg) scaleX(1.04); }
}

@keyframes bootBackLeft {
  0%, 100% { transform: translateX(14%) rotate(10deg) scaleX(0.92); }
  25% { transform: translateX(-8%) rotate(-5deg) scaleX(1.05); }
  50% { transform: translateX(-16%) rotate(-10deg) scaleX(1.12); }
  75% { transform: translateX(8%) rotate(6deg) scaleX(0.96); }
}

@keyframes walkSettle {
  0% { filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
  88% { filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
  100% { filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.16)); }
}

@keyframes blink {
  0%, 94%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.12); }
}

@keyframes talk {
  from { transform: translateY(0) scaleY(0.82); }
  to { transform: translateY(2px) scaleY(1.18); }
}

@keyframes drift {
  to { background-position: 170px 0, 310px 40px; }
}

@keyframes destinationPulse {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.76); }
  to { opacity: 0.28; transform: translate(-50%, -50%) scale(1.18); }
}

@keyframes captionLift {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  16%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

@keyframes deniedFlash {
  0%, 100% { opacity: 0; }
  16%, 42% { opacity: 1; }
}

@keyframes successFlash {
  0% { opacity: 0; }
  24% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes scanSweep {
  0% { opacity: 0; transform: translateY(-70%); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translateY(70%); }
}

@keyframes alertFlash {
  0%, 100% { opacity: 0; }
  18%, 44%, 70% { opacity: 0.95; }
  32%, 58% { opacity: 0.2; }
}

@keyframes transitionPulse {
  0% { opacity: 0; transform: scale(0.9); }
  26% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}

@keyframes infoMessageFade {
  0% { opacity: 0; visibility: visible; }
  8%, 78% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes ambientSweep {
  0%, 100% { opacity: 0; transform: translateX(-8%) scaleX(0.8); }
  18%, 42% { opacity: 0.5; }
  62% { opacity: 0; transform: translateX(12%) scaleX(1); }
}

@keyframes securitySweep {
  0%, 100% { opacity: 0; transform: translateX(-12%) rotate(-1deg); }
  18%, 48% { opacity: 0.62; }
  70% { opacity: 0; transform: translateX(14%) rotate(1deg); }
}

@keyframes screenScan {
  0%, 100% { opacity: 0; transform: translateY(-26px); }
  20%, 58% { opacity: 0.34; }
  76% { opacity: 0; transform: translateY(42px); }
}

@keyframes tacticalPulse {
  0%, 100% { opacity: 0.08; filter: brightness(0.9); }
  38%, 55% { opacity: 0.32; filter: brightness(1.3); }
}

@keyframes habitatFlicker {
  0%, 71%, 100% { opacity: 0.1; }
  72% { opacity: 0.32; }
  73% { opacity: 0.14; }
  77% { opacity: 0.24; }
}

@keyframes ambientBlink {
  0%, 68%, 100% { opacity: 0; transform: scale(0.72); }
  72%, 79% { opacity: 0.75; transform: scale(1); }
  84% { opacity: 0.18; transform: scale(0.86); }
}

@keyframes softDust {
  0%, 100% { opacity: 0; transform: translateY(16px) scale(0.75); }
  32%, 68% { opacity: 0.42; transform: translateY(-8px) scale(1); }
}

@keyframes tickerLight {
  0%, 100% { opacity: 0; transform: translateX(-16%) scaleX(0.7); }
  25%, 58% { opacity: 0.44; }
  76% { opacity: 0; transform: translateX(16%) scaleX(1); }
}

@keyframes barNeon {
  0%, 100% { opacity: 0.12; filter: brightness(0.8); }
  44% { opacity: 0.46; filter: brightness(1.25); }
  48% { opacity: 0.2; filter: brightness(0.9); }
  52% { opacity: 0.54; filter: brightness(1.35); }
}

@keyframes secretTwinkle {
  0%, 72%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  76% { opacity: 0.95; transform: scale(1.05) rotate(45deg); }
  80% { opacity: 0.2; transform: scale(0.72) rotate(90deg); }
  83% { opacity: 0.75; transform: scale(0.95) rotate(135deg); }
}

@keyframes evidencePulse {
  0%, 100% { box-shadow: 0 0 14px rgba(121, 213, 240, 0.54); }
  48% { box-shadow: 0 0 20px rgba(121, 213, 240, 0.82), 0 0 34px rgba(121, 213, 240, 0.18); }
}

@keyframes descentGlow {
  0%, 100% { opacity: 0.18; transform: translateY(0) scale(0.98); }
  50% { opacity: 0.42; transform: translateY(2px) scale(1.02); }
}

@keyframes baseTablePulse {
  0%, 100% { opacity: 0.18; filter: brightness(0.9); }
  45%, 60% { opacity: 0.48; filter: brightness(1.25); }
}

@keyframes warehouseDust {
  0%, 100% { opacity: 0.12; transform: translateX(-2%) translateY(2%); }
  50% { opacity: 0.36; transform: translateX(4%) translateY(-2%); }
}

@keyframes surfaceDust {
  0%, 100% { opacity: 0.1; transform: translateX(-3%) translateY(2%) scale(0.98); }
  45% { opacity: 0.32; transform: translateX(3%) translateY(-2%) scale(1.02); }
}

@keyframes canopyDrift {
  0%, 100% { opacity: 0.1; transform: translateX(-1%) skewX(-1deg); }
  50% { opacity: 0.28; transform: translateX(2%) skewX(1deg); }
}

@keyframes harborSweep {
  0%, 100% { opacity: 0; transform: translateX(-10%) scaleX(0.82); }
  20%, 48% { opacity: 0.56; }
  70% { opacity: 0; transform: translateX(14%) scaleX(1.08); }
}

@keyframes kioWindowGlow {
  0%, 100% { opacity: 0.16; filter: brightness(0.92); }
  50% { opacity: 0.42; filter: brightness(1.18); }
}

@keyframes podGyro {
  0%, 100% { opacity: 0.14; transform: translateY(1px) scaleX(0.94); }
  50% { opacity: 0.48; transform: translateY(-1px) scaleX(1.08); }
}

@keyframes bistroLampGlow {
  0%, 100% { opacity: 0.18; transform: scale(0.98); }
  50% { opacity: 0.45; transform: scale(1.03); }
}

@keyframes typedWordIn {
  from {
    opacity: 0;
    filter: blur(2px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes steamThread {
  0%, 100% { opacity: 0; transform: translateY(12px) translateX(-4px) scaleY(0.9); }
  35%, 65% { opacity: 0.32; }
  80% { opacity: 0; transform: translateY(-18px) translateX(8px) scaleY(1.08); }
}

@keyframes memoryGrid {
  0%, 100% { opacity: 0.08; transform: scale(1); }
  50% { opacity: 0.28; transform: scale(1.015); }
}

@keyframes renderSpark {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  22% { opacity: 0.76; transform: scale(1.2); }
  46% { opacity: 0.16; transform: scale(0.82); }
}

@keyframes greenMoonPulse {
  0%, 100% { opacity: 0.22; transform: scale(0.96); }
  50% { opacity: 0.56; transform: scale(1.08); }
}

@keyframes wildlandMist {
  0%, 100% { opacity: 0.08; transform: translateX(-18px); }
  50% { opacity: 0.28; transform: translateX(18px); }
}

@keyframes slimeGlint {
  0%, 100% { opacity: 0.05; transform: scaleX(0.75); }
  45% { opacity: 0.42; transform: scaleX(1.18); }
}

@keyframes engineBreathe {
  0%, 100% { opacity: 0.12; filter: brightness(0.9); }
  50% { opacity: 0.34; filter: brightness(1.24); }
}

@keyframes airlockCountdown {
  0% { opacity: 0.25; transform: rotate(0deg) scale(0.94); }
  50% { opacity: 0.62; transform: rotate(180deg) scale(1.06); }
  100% { opacity: 0.25; transform: rotate(360deg) scale(0.94); }
}

@media (max-width: 980px) {
  .menu-screen {
    align-items: flex-end;
    padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }

  .menu-screen::after {
    background:
      linear-gradient(90deg, rgba(2, 7, 12, 0.94) 0%, rgba(2, 7, 12, 0.68) 48%, rgba(2, 7, 12, 0.2) 100%),
      linear-gradient(180deg, rgba(2, 7, 12, 0.18) 0%, rgba(2, 7, 12, 0.8) 100%);
  }

  .menu-content {
    width: min(620px, 72vw);
    padding-bottom: 0;
  }

  .menu-logo {
    width: min(440px, 48vw);
    max-height: min(22dvh, 128px);
    margin: 0 0 0.42rem -0.28rem;
  }

  .menu-content h1 {
    font-size: clamp(2.7rem, 8.6vw, 4.8rem);
  }

  .menu-copy {
    max-width: 30rem;
    margin-bottom: 0;
    font-size: 0.95rem;
  }

  .beta-badge {
    margin-bottom: 0.5rem;
    padding: 0.32rem 0.5rem;
  }

  .beta-badge strong,
  .beta-badge span {
    font-size: 0.68rem;
  }

  .menu-actions {
    gap: 0.5rem;
    margin: 1rem 0 0.55rem;
  }

  .menu-actions button {
    min-width: 0;
    min-height: 38px;
    padding: 0.46rem 0.62rem;
    font-size: 0.82rem;
  }

  .menu-note {
    font-size: 0.66rem;
  }

  .menu-copyright {
    max-width: 27rem;
    margin-top: 0.28rem;
    font-size: 0.6rem;
  }

  .stage-shell {
    padding: 0;
  }

  .topbar {
    top: max(6px, env(safe-area-inset-top));
    left: max(6px, env(safe-area-inset-left));
    right: auto;
    max-width: calc(100vw - 98px);
    padding: 0.28rem 0.42rem;
    border-color: rgba(159, 206, 222, 0.12);
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 0.9rem;
  }

  .status span:first-child {
    display: none;
  }

  .status span {
    padding: 0.18rem 0.4rem;
    font-size: 0.72rem;
  }

  .game-frame {
    position: relative;
    display: block;
  }

  .panel {
    position: absolute;
    z-index: 30;
    top: calc(max(6px, env(safe-area-inset-top)) + 38px);
    right: max(6px, env(safe-area-inset-right));
    width: auto;
    max-height: calc(100dvh - 98px);
    overflow: hidden;
    padding: 0;
    border-radius: 8px;
    background: rgba(3, 9, 13, 0.88);
  }

  .panel-body {
    padding: 0.52rem;
  }

  .overlay-toggle {
    display: block;
    width: 100%;
    min-height: 30px;
    padding: 0.22rem 0.42rem;
    border: 0;
    border-bottom: 1px solid rgba(159, 206, 222, 0.18);
    border-radius: 0;
    font-size: 0.72rem;
    text-align: left;
  }

  .panel.collapsed {
    width: auto;
  }

  .panel .panel-body,
  .panel.collapsed .panel-body {
    display: none;
  }

  .panel:not(.collapsed) {
    width: min(224px, 44vw);
  }

  .panel:not(.collapsed) .panel-body {
    display: block;
  }

  .panel:not(.collapsed) .verbs {
    display: none;
  }

  .action-dock {
    position: absolute;
    z-index: 72;
    right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: nowrap;
    gap: 0.22rem;
    padding: 0.28rem;
    border: 1px solid rgba(159, 206, 222, 0.18);
    border-radius: 8px;
    background: rgba(3, 9, 13, 0.86);
    backdrop-filter: blur(8px);
  }

  .intent-line {
    top: max(38px, calc(env(safe-area-inset-top) + 34px));
    left: 50%;
    width: min(340px, 44vw);
    min-height: 28px;
    padding: 0.28rem 0.48rem;
    font-size: 0.66rem;
  }

  .sound-caption {
    top: max(68px, calc(env(safe-area-inset-top) + 64px));
    max-width: min(340px, 54vw);
    padding: 0.3rem 0.46rem;
    font-size: 0.62rem;
  }

  .action-dock button {
    min-height: 32px;
    padding: 0.28rem 0.38rem;
    font-size: 0.68rem;
  }

  .panel h2 {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
  }

  .panel-copy {
    min-height: 0;
    max-height: 3.4rem;
    margin-bottom: 0.45rem;
    overflow: hidden;
    font-size: 0.76rem;
  }

  .face-preview {
    grid-template-columns: 42px 1fr;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    padding: 0.4rem;
  }

  .face-preview .preview-orbit {
    width: 42px;
  }

  .face-preview strong,
  .face-preview span {
    font-size: 0.76rem;
  }

  .verbs {
    margin-bottom: 0;
  }

  .verbs button,
  .choices button,
  .inventory button,
  .inventory > span {
    min-height: 34px;
    padding: 0.32rem 0.42rem;
    font-size: 0.72rem;
  }

  .objective-box,
  .settings-box {
    display: none;
  }

  .chapter-complete {
    width: min(340px, calc(100vw - 24px));
    padding: 0.7rem;
    font-size: 0.82rem;
  }

  .chapter-complete strong {
    font-size: 1rem;
  }

  .chapter-complete button {
    min-height: 34px;
    margin-top: 0.55rem;
    padding: 0.32rem 0.52rem;
  }

  .hotspot,
  .exit {
    width: 30px;
    min-height: 30px;
    padding: 0;
  }

  .hotspot::before,
  .exit::before {
    width: 0.66rem;
    border-width: 2px;
  }

  .hotspot span,
  .exit span {
    top: auto;
    bottom: calc(100% + 8px);
    max-width: 132px;
    font-size: 0.68rem;
  }

  .game-character {
    width: calc(170px * var(--char-scale));
    height: calc(270px * var(--char-scale));
  }

  .game-character span {
    display: none;
  }

  .dialogue {
    left: max(6px, env(safe-area-inset-left));
    right: min(310px, calc(38vw + max(6px, env(safe-area-inset-right))));
    bottom: calc(78px + max(6px, env(safe-area-inset-bottom)));
    min-height: 0;
    max-height: none;
    padding: 0.44rem 0.56rem;
    overflow: hidden;
  }

  .active-dialogue {
    font-size: 1rem;
  }

  .active-dialogue:not(.dialogue-response) {
    right: max(6px, env(safe-area-inset-right));
    max-width: none;
    max-height: 44dvh;
  }

  .active-dialogue:not(.dialogue-response) > div:first-child {
    min-width: min(360px, 48vw);
  }

  .has-inventory .dialogue {
    bottom: calc(78px + max(6px, env(safe-area-inset-bottom)));
  }

  .dialogue p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .active-dialogue p,
  .dialogue-response p,
  .dialogue-response .npc-response {
    font-size: 1rem;
    line-height: 1.45;
  }

  .dialogue-response {
    right: max(6px, env(safe-area-inset-right));
    max-height: 44dvh;
    padding: 0.5rem 0.58rem;
  }

  .dialogue-response .choices {
    flex: 0 0 auto;
    min-width: 88px;
  }

  .dialogue-response .player-choice {
    max-width: 100%;
    margin-top: 0.18rem;
  }

  .dialogue-response .npc-response {
    margin-top: 0.22rem;
    -webkit-line-clamp: 4;
  }

  .info-toast {
    top: auto;
    left: max(6px, env(safe-area-inset-left));
    right: min(310px, calc(38vw + max(6px, env(safe-area-inset-right))));
    bottom: calc(78px + max(6px, env(safe-area-inset-bottom)));
    width: auto;
    max-width: 58vw;
    max-height: 24dvh;
    padding: 0.44rem 0.56rem;
  }

  .info-toast strong,
  .info-toast p {
    font-size: 0.72rem;
  }

  .info-toast p {
    margin-top: 0.2rem;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .choices {
    min-width: min(360px, 48vw);
    gap: 0.35rem;
  }

  .active-dialogue:not(.dialogue-response) .choices {
    min-width: min(430px, 42vw);
  }

  .active-dialogue:not(.dialogue-response) p {
    -webkit-line-clamp: 5;
  }

  .tutorial-coach {
    left: max(6px, env(safe-area-inset-left));
    top: max(54px, calc(env(safe-area-inset-top) + 54px));
    width: min(380px, calc(100vw - 520px));
    min-width: 280px;
    padding: 0.5rem 0.58rem;
  }

  .tutorial-coach strong {
    font-size: 0.84rem;
  }

  .tutorial-coach p {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .tutorial-coach-actions button {
    min-height: 30px;
    padding: 0.24rem 0.42rem;
    font-size: 0.72rem;
  }

  .inventory {
    left: max(6px, env(safe-area-inset-left));
    right: min(390px, calc(48vw + max(6px, env(safe-area-inset-right))));
    bottom: max(6px, env(safe-area-inset-bottom));
    min-height: 42px;
    padding: 0.34rem 0.46rem;
    gap: 0.28rem;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .inventory-entry {
    flex: 0 0 auto;
    max-width: min(150px, 20vw);
  }

  .inventory-empty {
    display: none;
  }

  .inventory strong {
    flex: 0 0 auto;
  }

  .inventory button,
  .inventory > span {
    flex: 0 0 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .inventory-entry button:first-child {
    flex: 0 1 auto;
    min-width: 74px;
  }

  .inventory-entry .item-info {
    flex: 0 0 26px;
    width: 26px;
    min-height: 32px;
  }

  .modal-layer {
    place-items: stretch;
    padding: max(7px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  }

  .station-map,
  .case-log,
  .save-load,
  .item-detail,
  .tutorial-dialog {
    width: auto;
    max-height: calc(100dvh - 14px);
  }

  .station-map header,
  .case-log header,
  .save-load header,
  .item-detail header,
  .tutorial-dialog header {
    padding: 0.5rem 0.6rem;
  }

  .station-map h2,
  .case-log h2,
  .save-load h2,
  .item-detail h2,
  .tutorial-dialog h2 {
    font-size: 1rem;
  }

  .tutorial-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.46rem;
    max-height: calc(100dvh - 102px);
    padding: 0.55rem;
  }

  .tutorial-body section {
    min-height: 0;
    padding: 0.52rem;
  }

  .tutorial-body strong {
    margin-bottom: 0.22rem;
    font-size: 0.72rem;
  }

  .tutorial-body p {
    font-size: 0.62rem;
    line-height: 1.2;
  }

  .tutorial-dialog footer {
    padding: 0.45rem 0.58rem;
  }

  .tutorial-dialog label {
    font-size: 0.66rem;
  }

  .map-body {
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.8fr);
    gap: 0.5rem;
    padding: 0.55rem;
    max-height: calc(100dvh - 82px);
  }

  .map-spine {
    gap: 0.4rem;
  }

  .map-node {
    min-height: 90px;
    padding: 0.52rem;
    gap: 0.42rem;
  }

  .map-node p,
  .map-readout p,
  .map-readout > span {
    font-size: 0.68rem;
    line-height: 1.24;
  }

  .map-node button {
    min-height: 30px;
    padding: 0.22rem 0.42rem;
    font-size: 0.68rem;
  }

  .map-readout {
    padding: 0.56rem;
  }

  .route-list {
    gap: 0.28rem;
    margin-top: 0.55rem;
  }

  .route-list span {
    padding: 0.3rem 0.36rem;
    font-size: 0.62rem;
  }

  .case-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    max-height: calc(100dvh - 82px);
    padding: 0.55rem;
  }

  .case-column {
    gap: 0.32rem;
  }

  .case-column h3 {
    margin-bottom: 0.12rem;
    font-size: 0.78rem;
  }

  .case-column article {
    grid-template-columns: 14px 1fr;
    min-height: 0;
    padding: 0.34rem 0.4rem;
    gap: 0.34rem;
  }

  .case-column article i {
    width: 11px;
  }

  .case-column article span,
  .case-summary span {
    font-size: 0.64rem;
    line-height: 1.22;
  }

  .case-summary {
    margin-top: 0.2rem;
    padding: 0.45rem;
  }

  .case-summary strong {
    margin-bottom: 0.12rem;
    font-size: 0.72rem;
  }

  .lore-column {
    gap: 0.32rem;
  }

  .lore-column h3 {
    font-size: 0.78rem;
  }

  .lore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .lore-grid article {
    min-height: 0;
    padding: 0.42rem;
  }

  .lore-grid strong {
    margin-bottom: 0.12rem;
    font-size: 0.68rem;
  }

  .lore-grid span {
    font-size: 0.6rem;
    line-height: 1.18;
  }

  .save-body {
    gap: 0.42rem;
    max-height: calc(100dvh - 82px);
    padding: 0.55rem;
  }

  .autosave-card,
  .save-slot {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 0.46rem;
    gap: 0.45rem;
  }

  .autosave-card span,
  .save-slot span,
  .save-slot small {
    font-size: 0.66rem;
    line-height: 1.2;
  }

  .autosave-card strong,
  .save-slot strong {
    font-size: 0.76rem;
  }

  .save-actions {
    gap: 0.25rem;
  }

  .save-actions button,
  .autosave-card button {
    min-height: 30px;
    padding: 0.24rem 0.42rem;
    font-size: 0.66rem;
  }

  .item-detail > p,
  .item-detail dl,
  .item-actions {
    padding: 0.6rem;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .menu-screen {
    align-items: center;
    padding: max(10px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  }

  .menu-content {
    width: min(460px, 48vw);
    padding: 0;
  }

  .menu-logo {
    width: min(360px, 38vw);
    max-height: min(18dvh, 92px);
    margin: 0 0 0.24rem -0.2rem;
  }

  .menu-content h1 {
    max-width: 11ch;
    margin-bottom: 0.45rem;
    font-size: clamp(2.2rem, 7vw, 4.15rem);
    line-height: 0.9;
  }

  .menu-copy {
    max-width: 24rem;
    font-size: 0.8rem;
    line-height: 1.32;
  }

  .beta-badge {
    margin-bottom: 0.42rem;
  }

  .menu-actions {
    margin: 0.58rem 0 0.28rem;
  }

  .menu-actions button {
    min-height: 34px;
    padding: 0.36rem 0.52rem;
    font-size: 0.76rem;
  }

  .menu-note {
    display: none;
  }

  .menu-copyright {
    display: none;
  }

  .about-dialog {
    width: min(680px, calc(100vw - 48px));
  }

  .tutorial-dialog {
    width: min(780px, calc(100vw - 42px));
  }

  .about-dialog header {
    padding: 0.52rem 0.68rem;
  }

  .tutorial-dialog header {
    padding: 0.48rem 0.62rem;
  }

  .about-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    max-height: calc(100dvh - 88px);
    padding: 0.62rem;
  }

  .about-body section,
  .about-body footer {
    padding: 0.58rem;
  }

  .about-body footer {
    grid-column: 1 / -1;
  }

  .about-body h3 {
    margin-bottom: 0.24rem;
    font-size: 0.82rem;
  }

  .tutorial-body {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.38rem;
    max-height: calc(100dvh - 92px);
    padding: 0.48rem;
  }

  .tutorial-body section {
    padding: 0.46rem;
  }

  .tutorial-body strong {
    font-size: 0.68rem;
  }

  .tutorial-body p {
    font-size: 0.58rem;
  }

  .tutorial-dialog footer {
    padding: 0.38rem 0.56rem;
  }

  .about-body p,
  .about-body span {
    font-size: 0.72rem;
    line-height: 1.32;
  }

  .dialogue {
    right: min(290px, calc(36vw + max(6px, env(safe-area-inset-right))));
    bottom: max(6px, env(safe-area-inset-bottom));
    max-width: 58vw;
  }

  .active-dialogue:not(.dialogue-response) {
    right: max(6px, env(safe-area-inset-right));
    bottom: calc(74px + max(6px, env(safe-area-inset-bottom)));
    max-width: none;
    max-height: 44dvh;
  }

  .dialogue-response {
    right: max(6px, env(safe-area-inset-right));
    bottom: calc(74px + max(6px, env(safe-area-inset-bottom)));
    max-width: none;
    max-height: 44dvh;
  }

  .active-dialogue,
  .active-dialogue p,
  .dialogue-response p,
  .dialogue-response .npc-response,
  .player-choice {
    font-size: 1rem;
    line-height: 1.45;
  }

  .active-dialogue:not(.dialogue-response) > div:first-child {
    min-width: min(420px, 48vw);
  }

  .active-dialogue:not(.dialogue-response) .choices {
    min-width: min(430px, 42vw);
  }

  .active-dialogue:not(.dialogue-response) p {
    -webkit-line-clamp: 5;
  }

  .tutorial-coach {
    top: max(54px, calc(env(safe-area-inset-top) + 54px));
    width: min(360px, 34vw);
    padding: 0.5rem 0.58rem;
  }

  .tutorial-coach span {
    font-size: 0.58rem;
  }

  .tutorial-coach strong {
    font-size: 0.78rem;
  }

  .tutorial-coach p {
    font-size: 0.64rem;
    line-height: 1.22;
  }

  .has-inventory .dialogue {
    bottom: calc(74px + max(6px, env(safe-area-inset-bottom)));
  }

  .dialogue > div > span {
    display: none;
  }

}

@media (max-height: 920px) {
  .settings-box {
    display: none;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .menu-screen {
    display: none;
  }

  .stage-shell > * {
    visibility: hidden;
  }

  .stage-shell::before {
    content: "Rotate your device sideways to play Echoes of Odyssey.";
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    background: #071019;
    color: #f2fbff;
    font-size: 1.25rem;
    visibility: visible;
  }

  #app::before {
    content: "Rotate your device sideways to play Echoes of Odyssey.";
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    background: #071019;
    color: #f2fbff;
    font-size: 1.25rem;
  }
}

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

  .typed-word {
    opacity: 1;
    filter: none;
  }
}
