:root {
  color-scheme: dark;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", "Yu Gothic UI", serif;
  --ink: #f6f0e5;
  --muted: #b8c2cf;
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(11, 14, 19, 0.76);
  --panel-strong: rgba(8, 10, 14, 0.92);
  --accent: #d6a354;
  --accent-soft: rgba(214, 163, 84, 0.28);
  --accent-2: #79b6c9;
  --danger: #d67562;
  --shadow: rgba(0, 0, 0, 0.48);
  --ui-sans: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --app-vh: 100svh;
  --pwa-bottom-ui: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: grid;
  min-height: var(--app-vh);
  height: var(--app-vh);
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(121, 182, 201, 0.18), transparent 36%),
    linear-gradient(135deg, #080a0f, #111724 48%, #0a0c11);
  color: var(--ink);
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-frame {
  width: min(100vw, calc(var(--app-vh) * 0.5625), 460px);
  aspect-ratio: 9 / 16;
  position: relative;
}

html.is-pwa,
html.is-pwa body {
  height: 100vh;
  min-height: 100vh;
}

html.is-pwa body {
  place-items: stretch;
  background: #050609;
}

html.is-pwa .app-frame {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  max-width: none;
  aspect-ratio: auto;
}

.game {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow: clip;
  background: #0c1017;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px var(--shadow);
  isolation: isolate;
}

html.is-pwa .game {
  border: 0;
  box-shadow: none;
}

html.is-pwa .quick-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  z-index: 4;
  align-items: end;
  align-content: end;
  padding: 6px max(14px, env(safe-area-inset-right)) max(6px, calc(env(safe-area-inset-bottom) - 24px)) max(14px, env(safe-area-inset-left));
  box-sizing: border-box;
  transform: none;
}

html.is-pwa .text-panel {
  bottom: calc(48px + max(6px, calc(env(safe-area-inset-bottom) - 24px)));
}

html.is-pwa .update-notice {
  bottom: calc(54px + max(6px, calc(env(safe-area-inset-bottom) - 24px)));
}

.scene-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: 50% 50%;
  cursor: zoom-in;
  transform: scale(1.002);
}

.scene-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 8, 12, 0.18), rgba(6, 8, 12, 0) 28%),
    linear-gradient(0deg, rgba(5, 6, 9, 0.94), rgba(5, 6, 9, 0.58) 36%, rgba(5, 6, 9, 0) 66%);
}

.character-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.character-sprite {
  position: absolute;
  display: block;
  width: auto;
  max-width: none;
  opacity: 0.96;
  filter:
    drop-shadow(0 0 1px rgba(255, 232, 184, 0.72))
    drop-shadow(0 0 9px rgba(247, 214, 159, 0.22))
    drop-shadow(0 18px 30px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 18px rgba(8, 12, 18, 0.38));
  transform-origin: 50% 100%;
  user-select: none;
}

.character-sprite--aoi-remote {
  left: 50%;
  top: 7%;
  height: min(66%, 575px);
  transform: translateX(-50%) scale(var(--character-scale, 1));
  transform-origin: 50% 0;
  filter:
    drop-shadow(0 0 1px rgba(255, 232, 184, 0.78))
    drop-shadow(0 0 10px rgba(247, 214, 159, 0.24))
    drop-shadow(0 18px 30px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 18px rgba(8, 12, 18, 0.38));
}

.character-sprite--mio-okami {
  left: 52%;
  top: 6%;
  height: min(74%, 640px);
  transform: translateX(-50%) scale(var(--character-scale, 1));
  transform-origin: 50% 0;
  filter:
    drop-shadow(0 0 1px rgba(255, 238, 204, 0.78))
    drop-shadow(0 0 12px rgba(247, 214, 159, 0.24))
    drop-shadow(18px 34px 28px rgba(0, 0, 0, 0.58))
    drop-shadow(0 22px 40px rgba(0, 0, 0, 0.48));
}

.character-sprite--aoi-campus {
  position: fixed;
  left: 55%;
  top: max(72px, calc(env(safe-area-inset-top) + 58px));
  height: min(46vh, 390px);
  transform: translateX(-4%) scale(var(--character-scale, 1));
  transform-origin: 50% 0;
  filter:
    drop-shadow(0 0 1px rgba(245, 248, 255, 0.82))
    drop-shadow(0 0 10px rgba(121, 182, 201, 0.28))
    drop-shadow(-18px 30px 34px rgba(0, 0, 0, 0.52))
    drop-shadow(0 22px 38px rgba(0, 0, 0, 0.38));
}

.scene-meta {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 20px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  opacity: 0.94;
  transition: opacity 180ms ease, transform 180ms ease;
}

.scene-heading {
  min-width: 0;
  flex: 1;
}

.scene-title {
  margin: 0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.scene-title {
  color: #fff8e9;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.scene-rail {
  position: relative;
  width: min(190px, 58vw);
  height: 12px;
  margin-top: 3px;
}

.scene-rail::before,
.scene-rail::after {
  content: "";
  position: absolute;
  top: 5px;
  height: 1px;
  background: linear-gradient(90deg, rgba(214, 163, 84, 0.75), rgba(246, 240, 229, 0.2));
}

.scene-rail::before {
  left: 0;
  right: 20px;
}

.scene-rail::after {
  right: 0;
  width: 8px;
  transform: rotate(45deg);
  border: 1px solid rgba(214, 163, 84, 0.82);
  background: transparent;
  height: 8px;
  top: 1px;
}

.scene-rail span {
  display: block;
  width: 3px;
  height: 3px;
  margin-top: 4px;
  border-radius: 999px;
  background: #f6f0e5;
  box-shadow: 48px 0 0 rgba(246, 240, 229, 0.35), 96px 0 0 rgba(246, 240, 229, 0.2);
}

.scene-place {
  max-width: min(260px, 70vw);
  margin: 0;
  color: var(--muted);
  font-family: var(--ui-sans);
  font-size: 10px;
  line-height: 1.45;
  text-align: left;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.menu-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  grid-auto-rows: 5px;
  gap: 0;
  padding: 12px;
  border: 1px solid rgba(214, 163, 84, 0.66);
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.5);
  box-shadow: inset 0 0 0 1px rgba(246, 240, 229, 0.08), 0 6px 18px rgba(0, 0, 0, 0.32);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 1px;
  background: #f6d6a0;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.52);
}

.language-toggle {
  font-family: var(--ui-sans);
  min-width: 44px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.58);
  color: #fff8e9;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.text-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 76px;
  z-index: 3;
  min-height: 38%;
  padding: 18px 22px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  touch-action: pan-y;
  background:
    linear-gradient(180deg, rgba(8, 9, 12, 0), rgba(8, 9, 12, 0.45) 12%, rgba(8, 9, 12, 0.9) 100%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.speaker-row {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.speaker {
  color: #ffe1aa;
  font-family: var(--ui-sans);
  font-size: 14px;
  font-weight: 700;
}

.beat-counter {
  font-family: var(--ui-sans);
  color: rgba(246, 240, 229, 0.62);
  font-size: 11px;
}

.body-text {
  min-height: 104px;
  color: var(--ink);
  font-size: clamp(16px, 4.1vw, 19px);
  line-height: 1.9;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.88);
  white-space: pre-wrap;
}

rt {
  color: rgba(255, 225, 170, 0.92);
  font-size: 0.58em;
  font-weight: 500;
  text-shadow: none;
}

.body-text.is-record {
  color: #dcecf2;
}

.choice-list {
  display: grid;
  gap: 9px;
}

.choice-button,
.continue-button,
.history-button,
.nav-button,
.drawer-tab {
  border: 1px solid var(--line);
  background: rgba(12, 15, 22, 0.72);
  color: var(--ink);
  cursor: pointer;
}

.choice-button {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 9px 18px 9px 28px;
  text-align: center;
  border-color: rgba(214, 163, 84, 0.72);
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(214, 163, 84, 0.1), rgba(8, 10, 14, 0.78) 20%, rgba(8, 10, 14, 0.82) 80%, rgba(214, 163, 84, 0.1));
  box-shadow: inset 0 0 0 1px rgba(246, 240, 229, 0.06), 0 3px 12px rgba(0, 0, 0, 0.26);
}

.choice-button::before,
.choice-button::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(214, 163, 84, 0.86);
  transform: translateY(-50%) rotate(45deg);
}

.choice-button::before {
  left: 12px;
}

.choice-button::after {
  right: 12px;
}

.choice-button:active,
.continue-button:active,
.history-button:active,
.nav-button:active,
.drawer-handle-button:active,
.drawer-tab:active {
  transform: translateY(1px);
}

.choice-kicker {
  display: none;
  margin-bottom: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.choice-label {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.text-actions {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-button,
.continue-button {
  position: relative;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  color: #fff8e9;
  font-family: var(--ui-sans);
  background: transparent;
  box-shadow: none;
}

.history-button {
  min-width: 74px;
  padding: 5px 14px 5px 24px;
  color: rgba(246, 240, 229, 0.86);
  font-size: 12px;
}

.continue-button {
  margin-left: auto;
  min-width: 108px;
  min-height: 34px;
  padding: 5px 30px 5px 18px;
  font-size: 14px;
  font-weight: 700;
}

.history-button::before {
  content: "‹";
  position: absolute;
  top: 50%;
  left: 8px;
  color: #f6d6a0;
  font-size: 22px;
  line-height: 1;
  transform: translateY(-54%);
}

.continue-button::before {
  content: none;
}

.continue-button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 8px;
  height: 8px;
  border-top: 1px solid #f6d6a0;
  border-right: 1px solid #f6d6a0;
  transform: translateY(-50%) rotate(45deg);
}

.history-button:hover,
.continue-button:hover,
.history-button:focus-visible,
.continue-button:focus-visible {
  color: #ffe1aa;
}

.quick-nav {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 3;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-bottom: 0;
  background: transparent;
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-button {
  min-width: 0;
  min-height: 42px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(246, 240, 229, 0.82);
  font-family: var(--ui-sans);
  font-size: 10px;
}

.nav-button::before,
.drawer-tab::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.96;
}

.nav-button[data-icon="log"]::before,
.drawer-tab[data-icon="log"]::before {
  background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23f1cf9b%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M4%205.5A2.5%202.5%200%200%201%206.5%203H20v16H6.5A2.5%202.5%200%200%200%204%2021.5V5.5Z%27/%3E%3Cpath%20d%3D%27M8%207h8M8%2011h8M8%2015h6%27/%3E%3C/svg%3E");
}

.nav-button[data-icon="progress"]::before,
.drawer-tab[data-icon="progress"]::before {
  background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23f1cf9b%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M6%2021V4%27/%3E%3Cpath%20d%3D%27M6%204h10l-1.5%204L16%2012H6%27/%3E%3Cpath%20d%3D%27M6%2021h12%27/%3E%3C/svg%3E");
}

.nav-button[data-icon="evidence"]::before,
.drawer-tab[data-icon="evidence"]::before {
  background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23f1cf9b%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Ccircle%20cx%3D%2710.5%27%20cy%3D%2710.5%27%20r%3D%276.5%27/%3E%3Cpath%20d%3D%27m15.5%2015.5%204%204%27/%3E%3Cpath%20d%3D%27M8%2010.5h5%27/%3E%3C/svg%3E");
}

.nav-button[data-icon="people"]::before,
.drawer-tab[data-icon="people"]::before {
  background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23f1cf9b%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%278%27%20r%3D%274%27/%3E%3Cpath%20d%3D%27M5%2021a7%207%200%200%201%2014%200%27/%3E%3C/svg%3E");
}

.nav-button:nth-child(3),
.drawer-tab.is-active {
  color: #f1cf9b;
}

.drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  display: flex;
  flex-direction: column;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(38, 39, 38, 0.94), rgba(7, 9, 13, 0.97) 18%, rgba(5, 6, 9, 0.98));
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.48);
  transform: translateY(104%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 220ms ease, visibility 0ms linear 220ms;
  z-index: 9;
}

.drawer.is-open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0ms;
}

.game.is-drawer-open .quick-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.drawer-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  margin-bottom: 12px;
}

.drawer-handle-button {
  width: 100%;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
}

.drawer-handle {
  display: block;
  width: 52px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  pointer-events: none;
}

.drawer-top .language-toggle {
  justify-self: end;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.drawer-tab {
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--ui-sans);
  font-size: 12px;
}

.drawer-tab.is-active {
  position: relative;
  border-color: rgba(214, 163, 84, 0.66);
  color: #ffe1aa;
  background: rgba(214, 163, 84, 0.14);
}

.drawer-tab.is-active::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: -8px;
  height: 2px;
  background: var(--accent);
}

.drawer-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 20px;
}

.timeline-list,
.evidence-list,
.people-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.save-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(121, 182, 201, 0.26);
  border-left: 2px solid rgba(121, 182, 201, 0.74);
  border-radius: 6px;
  background: rgba(10, 14, 20, 0.58);
}

.save-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.save-panel strong,
.save-slot strong {
  color: #ffe1aa;
}

.save-panel p,
.save-slot p {
  margin: 3px 0 0;
  color: rgba(246, 240, 229, 0.74);
  font-size: 12px;
  line-height: 1.5;
}

.save-slots {
  display: grid;
  gap: 8px;
}

.save-slot {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(214, 163, 84, 0.22);
  border-radius: 5px;
  background: rgba(4, 6, 10, 0.42);
}

.save-slot.is-active {
  border-color: rgba(214, 163, 84, 0.62);
  box-shadow: inset 0 0 0 1px rgba(214, 163, 84, 0.18);
}

.save-slot-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.save-slot-head span {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-family: var(--ui-sans);
  font-size: 11px;
}

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

.save-button {
  min-height: 32px;
  border: 1px solid rgba(214, 163, 84, 0.48);
  border-radius: 5px;
  background: rgba(9, 11, 16, 0.62);
  color: #fff8e9;
  font-family: var(--ui-sans);
  font-size: 11px;
  line-height: 1.2;
}

.save-button--new {
  min-width: 92px;
  border-color: rgba(121, 182, 201, 0.52);
  background: rgba(12, 22, 31, 0.68);
  color: #e5f6ff;
}

.save-button:disabled {
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(246, 240, 229, 0.32);
  background: rgba(9, 11, 16, 0.32);
}

.log-entry,
.timeline-entry,
.evidence-entry,
.person-entry {
  position: relative;
  border: 1px solid rgba(214, 163, 84, 0.28);
  border-left: 2px solid rgba(214, 163, 84, 0.72);
  border-radius: 6px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.038));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.log-entry {
  padding: 8px 10px 8px 8px;
}

.log-card-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.log-thumb {
  width: 100%;
  height: 74px;
  align-self: start;
  border-radius: 4px;
  border: 1px solid rgba(214, 163, 84, 0.26);
  background-color: #11151c;
  background-size: cover;
  background-position: center;
}

.log-body {
  min-width: 0;
}

.log-lines {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.log-line {
  display: grid;
  gap: 2px;
}

.log-speaker {
  color: #ffe1aa;
  font-family: var(--ui-sans);
  font-size: 12px;
  font-weight: 700;
}

.log-entry strong,
.evidence-entry strong,
.person-entry strong {
  color: #ffe1aa;
}

.log-entry p,
.timeline-entry p,
.evidence-entry p,
.person-entry p {
  margin: 4px 0 0;
  color: rgba(246, 240, 229, 0.82);
  font-size: 13px;
  line-height: 1.65;
}

.log-line p {
  margin-top: 0;
}

.entry-meta {
  display: block;
  font-family: var(--ui-sans);
  color: var(--accent-2);
  font-size: 11px;
}

.empty-state {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.hotspot-layer,
.inspect-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hotspot-button {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 214, 160, 0.82);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(246, 214, 160, 0.18), rgba(214, 163, 84, 0.04) 52%, transparent 72%);
  color: #fff8e9;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.22), 0 0 24px rgba(246, 214, 160, 0.38);
  pointer-events: auto;
  cursor: pointer;
}

.hotspot-button::before,
.hotspot-button::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(246, 214, 160, 0.42);
  border-radius: 999px;
}

.hotspot-button::after {
  inset: 8px;
  border-color: rgba(255, 255, 255, 0.2);
}

.hotspot-label {
  transform: translateY(-160%);
  padding: 5px 9px;
  border: 1px solid rgba(214, 163, 84, 0.56);
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.72);
  color: #fff8e9;
  font-family: var(--ui-sans);
  font-size: 11px;
  white-space: nowrap;
}

.inspect-overlay {
  z-index: 4;
  display: grid;
  align-items: end;
  padding: 0 22px max(34px, calc(env(safe-area-inset-bottom) + 24px));
  background:
    radial-gradient(ellipse at 52% 64%, rgba(246, 214, 160, 0.26), rgba(246, 214, 160, 0.06) 16%, transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.62));
  pointer-events: auto;
}

.phone-card {
  width: min(100%, 330px);
  margin: 0 auto;
  padding: 18px 18px 16px;
  border: 1px solid rgba(214, 163, 84, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(19, 24, 32, 0.96), rgba(5, 7, 11, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(121, 182, 201, 0.24), transparent 34%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone-status {
  display: block;
  color: var(--accent-2);
  font-family: var(--ui-sans);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.phone-caller {
  margin: 8px 0 4px;
  color: #fff8e9;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.phone-prompt {
  margin: 0 0 16px;
  color: rgba(246, 240, 229, 0.82);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.phone-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.phone-choice {
  min-height: 44px;
  border: 1px solid rgba(214, 163, 84, 0.52);
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.74);
  color: #fff8e9;
  font-family: var(--ui-sans);
  font-size: 13px;
  font-weight: 700;
}

.phone-choice.is-primary {
  border-color: rgba(121, 201, 145, 0.72);
  background: rgba(34, 96, 55, 0.72);
}

.game.is-route-mode .inspect-overlay {
  z-index: 2;
  display: block;
  padding: 0;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(121, 182, 201, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.04), rgba(5, 7, 11, 0.2) 54%, rgba(5, 7, 11, 0.66));
  pointer-events: none;
}

.route-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.route-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.66), transparent 24%, transparent 74%, rgba(5, 7, 11, 0.38)),
    linear-gradient(180deg, rgba(5, 7, 11, 0.36), transparent 22%, transparent 68%, rgba(5, 7, 11, 0.42));
  pointer-events: none;
}

.route-title {
  position: absolute;
  top: max(86px, calc(env(safe-area-inset-top) + 72px));
  left: 20px;
  right: 20px;
  z-index: 3;
  display: grid;
  gap: 4px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.86);
}

.route-title span {
  color: var(--accent-2);
  font-family: var(--ui-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.route-title strong {
  color: #fff8e9;
  font-size: clamp(18px, 5.4vw, 26px);
  line-height: 1.08;
}

.route-title p {
  margin: 0;
  color: rgba(246, 240, 229, 0.76);
  font-family: var(--ui-sans);
  font-size: 11px;
  line-height: 1.45;
}

.route-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.route-grid-line {
  fill: none;
  stroke: rgba(246, 240, 229, 0.13);
  stroke-width: 0.25;
}

.route-pref-line {
  fill: none;
  stroke: rgba(121, 182, 201, 0.28);
  stroke-width: 0.9;
  stroke-dasharray: 2 3;
}

.route-track,
.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-track {
  stroke: rgba(246, 240, 229, 0.26);
  stroke-width: 4.6;
}

.route-line {
  stroke: #4f82ff;
  stroke-width: 2.9;
  filter: drop-shadow(0 0 7px rgba(79, 130, 255, 0.78)) drop-shadow(0 0 18px rgba(79, 130, 255, 0.36));
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: route-draw 2.8s cubic-bezier(0.18, 0.72, 0.22, 1) 0.35s forwards;
}

.route-point {
  opacity: 0;
  animation: route-point-in 420ms ease forwards;
  animation-delay: calc(0.72s + var(--route-point-index) * 0.46s);
}

.route-point circle {
  fill: #0f1823;
  stroke: #77d7ff;
  stroke-width: 1.3;
}

.route-point.is-last circle {
  fill: #f1cf9b;
  stroke: rgba(255, 248, 233, 0.94);
}

.route-point text {
  fill: rgba(246, 240, 229, 0.78);
  font-family: var(--ui-sans);
  font-size: 3.2px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(5, 7, 11, 0.9);
  stroke-width: 0.7px;
}

.route-point-label {
  fill: #fff8e9;
  font-size: 3.6px;
}

.route-region-label {
  fill: rgba(121, 182, 201, 0.42);
  font-family: var(--ui-sans);
  font-size: 4px;
  font-weight: 700;
  letter-spacing: 0;
}

.route-schedule {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(46% + 8px);
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82);
}

.route-schedule li {
  display: grid;
  gap: 2px;
  min-height: 36px;
  padding: 6px 7px;
  border: 1px solid rgba(214, 163, 84, 0.26);
  border-radius: 4px;
  background: rgba(5, 7, 11, 0.34);
  backdrop-filter: blur(3px);
}

.route-schedule span {
  color: var(--accent-2);
  font-family: var(--ui-sans);
  font-size: 10px;
  font-weight: 700;
}

.route-schedule strong {
  color: rgba(246, 240, 229, 0.84);
  font-family: var(--ui-sans);
  font-size: 10px;
  line-height: 1.25;
}

@keyframes route-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes route-point-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game.is-image-mode .scene-meta,
.game.is-image-mode .text-panel,
.game.is-image-mode .quick-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.game.is-image-mode .scene-bg::after {
  opacity: 0;
}

.game.is-hotspot-mode .scene-bg::after,
.game.is-phone-overlay .scene-bg::after {
  opacity: 1;
  background: rgba(0, 0, 0, 0.42);
}

.game.is-hotspot-mode .hotspot-layer {
  pointer-events: auto;
}

@media (max-aspect-ratio: 9 / 16) {
  html.is-pwa .scene-bg {
    background-size: 100% auto !important;
    background-position: 50% 0 !important;
  }

  html.is-pwa .hotspot-layer {
    inset: 0 0 auto;
    height: min(100%, calc(100vw * 16 / 9));
  }

  html.is-pwa .quick-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 4;
    --pwa-footer-pad: max(6px, calc(env(safe-area-inset-bottom) - 24px));
    height: calc(42px + var(--pwa-footer-pad));
    align-items: end;
    align-content: end;
    padding: 6px max(14px, env(safe-area-inset-right)) var(--pwa-footer-pad) max(14px, env(safe-area-inset-left));
    box-sizing: border-box;
  }

  html.is-pwa .text-panel {
    bottom: calc(48px + max(6px, calc(env(safe-area-inset-bottom) - 24px)));
  }

  html.is-pwa .update-notice {
    bottom: calc(54px + max(6px, calc(env(safe-area-inset-bottom) - 24px)));
  }

  html.is-pwa .nav-button {
    min-height: 42px;
    align-content: end;
    grid-auto-rows: min-content;
    padding-bottom: 0;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  html.is-pwa .quick-nav {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    bottom: 0 !important;
    height: auto !important;
    padding: 6px max(14px, env(safe-area-inset-right)) max(6px, calc(env(safe-area-inset-bottom) - 24px)) max(14px, env(safe-area-inset-left)) !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  html.is-pwa .text-panel {
    bottom: calc(48px + max(6px, calc(env(safe-area-inset-bottom) - 24px))) !important;
  }

  html.is-pwa .update-notice {
    bottom: calc(54px + max(6px, calc(env(safe-area-inset-bottom) - 24px))) !important;
  }

  html.is-pwa .nav-button {
    align-content: end;
    min-height: 42px;
    padding-bottom: 0;
  }
}

.update-notice {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 64px));
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 10px 13px;
  border: 1px solid rgba(214, 163, 84, 0.54);
  border-left: 2px solid rgba(214, 163, 84, 0.92);
  border-radius: 6px;
  background: rgba(7, 9, 13, 0.92);
  color: #fff8e9;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.update-notice span {
  font-family: var(--ui-sans);
  font-size: 12px;
  line-height: 1.45;
}

.update-actions {
  display: flex;
  gap: 7px;
}

.update-button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(9, 11, 16, 0.74);
  color: rgba(246, 240, 229, 0.82);
  font-family: var(--ui-sans);
  font-size: 11px;
}

.update-button.is-primary {
  border-color: rgba(214, 163, 84, 0.72);
  background: rgba(214, 163, 84, 0.18);
  color: #ffe1aa;
}

@media (max-aspect-ratio: 9 / 16) {
  body {
    place-items: start center;
  }

  .app-frame {
    width: 100vw;
    height: var(--app-vh);
    aspect-ratio: auto;
  }

  .game {
    border: 0;
  }
}

@media (max-width: 600px) {
  body {
    place-items: start center;
  }

  .app-frame {
    width: 100vw;
    height: var(--app-vh);
    aspect-ratio: auto;
  }

  .game {
    border: 0;
  }

  .scene-bg {
    background-size: cover;
  }
}

@media (min-width: 900px) {
  .app-frame {
    height: min(94vh, 860px);
  }
}
