/* 流浪婴儿计划 — 宇宙航行 · 赛博朋克科幻 UI */
:root {
  --bg-deep: #000000;
  --aurora: #00f0ff;
  --holo: #9d4edd;
  --text: #e8f4ff;
  --text-dim: #6b7d9a;
  --panel-bg: rgba(5, 5, 16, 0.88);
  --border-glow: rgba(0, 240, 255, 0.5);
  --font-mono: "Share Tech Mono", "Courier New", Consolas, monospace;
  --font-sci: "Orbitron", var(--font-mono);
  --font-cn: "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

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

html,
body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-cn);
  overflow-x: hidden;
}

/* 背景：深空星云 */
.nebula-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 120%, rgba(5, 5, 16, 0.4), transparent 55%),
    radial-gradient(ellipse 90% 60% at 75% 15%, rgba(157, 78, 221, 0.28), transparent 58%),
    radial-gradient(ellipse 70% 55% at 15% 75%, rgba(0, 240, 255, 0.14), transparent 52%),
    radial-gradient(ellipse 50% 40% at 55% 42%, rgba(157, 78, 221, 0.12), transparent 62%),
    radial-gradient(ellipse 35% 25% at 88% 68%, rgba(0, 240, 255, 0.08), transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #0a0820 0%, var(--bg-deep) 72%);
  transform: translate(var(--parallax-x), var(--parallax-y));
  transition: transform 0.15s ease-out;
  pointer-events: none;
  animation: nebula-breathe 18s ease-in-out infinite;
}

@keyframes nebula-breathe {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.08) saturate(1.12); }
}

/* 极光流光层 */
.aurora-sheen {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background:
    linear-gradient(
      105deg,
      transparent 38%,
      rgba(0, 240, 255, 0.06) 44%,
      rgba(157, 78, 221, 0.1) 50%,
      rgba(0, 240, 255, 0.05) 56%,
      transparent 62%
    );
  animation: aurora-sweep 14s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes aurora-sweep {
  0%, 100% { transform: translateX(-6%) rotate(-2deg); opacity: 0.25; }
  50% { transform: translateX(6%) rotate(2deg); opacity: 0.45; }
}

/* 缓慢移动的透视网格 */
.space-grid {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(420px) rotateX(58deg) translateY(-8%);
  animation: grid-drift 90s linear infinite;
}

@keyframes grid-drift {
  0% { background-position: 0 0; }
  100% { background-position: 48px 96px; }
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 8% 18%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 22% 72%, rgba(0, 240, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 38% 34%, rgba(157, 78, 221, 0.5), transparent),
    radial-gradient(1px 1px at 55% 88%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 68% 22%, rgba(0, 240, 255, 0.4), transparent),
    radial-gradient(1.2px 1.2px at 82% 58%, rgba(157, 78, 221, 0.45), transparent),
    radial-gradient(1px 1px at 91% 12%, rgba(255, 255, 255, 0.4), transparent);
  background-size: 220% 220%;
  animation: drift 75s linear infinite;
}

.particles.disabled {
  display: none;
}

@keyframes drift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* 科技电路线条 */
.circuit-lines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.circuit {
  position: absolute;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 240, 255, 0.08) 15%,
    rgba(0, 240, 255, 0.45) 50%,
    rgba(157, 78, 221, 0.35) 70%,
    transparent 95%
  );
  opacity: 0.35;
  animation: circuit-glow 4s ease-in-out infinite;
}

.circuit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 48px;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, #00f0ff, #9d4edd, transparent);
  box-shadow: 0 0 12px #00f0ff, 0 0 20px rgba(157, 78, 221, 0.5);
  animation: circuit-travel 5s linear infinite;
}

.circuit-h-top {
  top: 12%;
  left: 5%;
  width: 42%;
  height: 1px;
  transform: rotate(-1.5deg);
  animation-delay: 0s;
}

.circuit-h-mid {
  top: 58%;
  right: 4%;
  width: 38%;
  height: 1px;
  transform: rotate(2deg);
  animation-delay: 1.2s;
}

.circuit-h-mid::after {
  animation-duration: 6.5s;
  animation-delay: 0.8s;
}

.circuit-h-low {
  bottom: 18%;
  left: 8%;
  width: 35%;
  height: 1px;
  animation-delay: 2.4s;
}

.circuit-v-left {
  top: 22%;
  left: 14%;
  width: 1px;
  height: 38%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 240, 255, 0.1) 20%,
    rgba(0, 240, 255, 0.5) 50%,
    rgba(157, 78, 221, 0.3) 80%,
    transparent
  );
  animation-delay: 0.6s;
}

.circuit-v-left::after {
  width: 2px;
  height: 36px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, #00f0ff, transparent);
  animation-name: circuit-travel-v;
  animation-duration: 7s;
}

.circuit-v-right {
  top: 30%;
  right: 18%;
  width: 1px;
  height: 32%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(157, 78, 221, 0.15) 30%,
    rgba(0, 240, 255, 0.45) 55%,
    transparent
  );
  animation-delay: 1.8s;
}

.circuit-v-right::after {
  width: 2px;
  height: 32px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, #9d4edd, transparent);
  animation-name: circuit-travel-v;
  animation-duration: 5.5s;
  animation-delay: 1s;
}

.circuit-diag-l {
  top: 8%;
  left: 28%;
  width: 28%;
  height: 1px;
  transform: rotate(32deg);
  animation-delay: 3s;
}

.circuit-diag-r {
  bottom: 28%;
  right: 22%;
  width: 26%;
  height: 1px;
  transform: rotate(-28deg);
  animation-delay: 2s;
}

.circuit-node {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aurora);
  box-shadow: 0 0 8px var(--aurora);
  animation: node-blink 2.5s ease-in-out infinite;
}

.cn-1 { top: 12%; left: 46%; animation-delay: 0s; }
.cn-2 { top: 58%; right: 41%; animation-delay: 0.7s; background: var(--holo); box-shadow: 0 0 8px var(--holo); }
.cn-3 { bottom: 18%; left: 42%; animation-delay: 1.4s; }
.cn-4 { top: 40%; left: 14%; animation-delay: 2.1s; }
.cn-5 { top: 52%; right: 18%; animation-delay: 0.3s; background: var(--holo); box-shadow: 0 0 8px var(--holo); }

.circuit-pulse {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 50%;
  animation: ring-pulse 6s ease-out infinite;
}

.cp-1 { top: 20%; left: 8%; animation-delay: 0s; }
.cp-2 { bottom: 25%; right: 10%; animation-delay: 2s; border-color: rgba(157, 78, 221, 0.15); }
.cp-3 { top: 45%; right: 35%; width: 60px; height: 60px; animation-delay: 4s; }

@keyframes circuit-glow {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.65; }
}

@keyframes circuit-travel {
  0% { left: -10%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes circuit-travel-v {
  0% { top: -10%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes node-blink {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes ring-pulse {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* 开始页星际尘埃 canvas（位于彩色层之上） */
.particle-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.start-layer-dust {
  z-index: 5;
  pointer-events: none;
}

.start-layer-dust .particle-canvas {
  position: absolute;
  inset: 0;
  mix-blend-mode: soft-light;
  opacity: 0.92;
}

.start-layer-dust.disabled,
.particle-canvas.disabled {
  opacity: 0 !important;
  visibility: hidden;
}

/* 开始页：纯黑底层，避免与参考图黑底冲突 */
body.start-screen-active {
  background: #000 !important;
}

body.start-screen-active .nebula-bg {
  background: #000 !important;
  animation: none !important;
  filter: none !important;
}

body.start-screen-active .aurora-sheen {
  opacity: 0 !important;
  animation: none !important;
  display: none;
}

body.start-screen-active .space-grid {
  opacity: 0 !important;
}

body.start-screen-active #particles,
body.start-screen-active .circuit-lines {
  opacity: 0 !important;
}

body.start-screen-active.start-intro-active #particles,
body.start-screen-active.start-intro-active .circuit-lines,
body.start-screen-active.start-intro-active.intro-ui #particles,
body.start-screen-active.start-intro-active.intro-ui .circuit-lines {
  opacity: 0 !important;
}

body.start-screen-active.start-intro-active .nebula-bg,
body.start-screen-active.start-intro-active.intro-bg .nebula-bg,
body.start-screen-active.start-intro-active.intro-circuits .nebula-bg,
body.start-screen-active.start-intro-active.intro-scene .nebula-bg,
body.start-screen-active.start-intro-active.intro-ui .nebula-bg {
  background: #000 !important;
}

/* 参考图精灵层（旧版入场，新开始页已停用） */
.start-scene-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

body.start-screen-active .start-scene-layer {
  display: none !important;
}

body:not(.start-screen-active) .start-scene-layer {
  visibility: hidden;
  opacity: 0 !important;
}

.start-sprite-wrap {
  position: absolute;
  line-height: 0;
}

.start-sprite {
  display: block;
  max-width: none;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-user-select: none;
  user-select: none;
}

.start-sprite-wrap-ship {
  left: 0;
  bottom: 0;
  opacity: var(--start-ship-alpha, 0);
}

.start-sprite-ship {
  width: min(47vw, 820px);
  filter: brightness(1.04) contrast(1.06);
  animation: sprite-ship-float 8s ease-in-out infinite;
}

.start-sprite-wrap-planets {
  right: 0;
  top: 0;
  opacity: var(--start-planets-alpha, 0);
  -webkit-mask-image: radial-gradient(
    ellipse 98% 98% at 50% 45%,
    #000 0%,
    #000 92%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 98% 98% at 50% 45%,
    #000 0%,
    #000 92%,
    transparent 100%
  );
}

.start-sprite-planets {
  display: block;
  width: min(56vw, 900px);
  max-height: min(48vh, 520px);
  height: auto;
  object-fit: contain;
  object-position: 100% 0%;
  filter: brightness(1.04) contrast(1.06);
  animation: sprite-planets-float 12s ease-in-out infinite;
}

@keyframes sprite-ship-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(11px, -14px); }
}

@keyframes sprite-planets-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 3px); }
}

@media (max-width: 900px) {
  .start-sprite-planets {
    width: min(52vw, 640px);
    max-height: min(42vh, 400px);
  }
}

@media (max-height: 700px) {
  .start-sprite-planets {
    max-height: 38vh;
    width: min(50vw, 720px);
  }
}

/* 开始页入场黑幕 */
.start-intro-curtain {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: #000;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.start-unlock-hint {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
  animation: unlock-fade 2.5s ease-in-out infinite;
}

.start-unlock-hint p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
  margin: 0;
}

.unlock-ring {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
  animation: unlock-pulse 2s ease-in-out infinite;
}

@keyframes unlock-fade {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

@keyframes unlock-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

body.start-intro-active .nebula-bg,
body.start-intro-active .aurora-sheen {
  opacity: 0;
  transition: opacity 0.55s ease;
}

body.start-intro-active .space-grid,
body.start-intro-active .circuit-lines,
body.start-intro-active #particles {
  opacity: 0;
  transition: opacity 0.45s ease;
}

body.start-intro-active.intro-bg .nebula-bg,
body.start-intro-active.intro-bg .aurora-sheen,
body.start-intro-active.intro-circuits .nebula-bg,
body.start-intro-active.intro-circuits .aurora-sheen,
body.start-intro-active.intro-scene .nebula-bg,
body.start-intro-active.intro-scene .aurora-sheen,
body.start-intro-active.intro-ui .nebula-bg,
body.start-intro-active.intro-ui .aurora-sheen {
  opacity: 1;
}

body.start-intro-active.intro-bg .space-grid,
body.start-intro-active.intro-circuits .space-grid,
body.start-intro-active.intro-scene .space-grid,
body.start-intro-active.intro-ui .space-grid {
  opacity: 0.07;
}

body.start-intro-active.intro-circuits .circuit-lines,
body.start-intro-active.intro-circuits #particles,
body.start-intro-active.intro-scene .circuit-lines,
body.start-intro-active.intro-scene #particles,
body.start-intro-active.intro-ui .circuit-lines,
body.start-intro-active.intro-ui #particles {
  opacity: 1;
}

#screen-start .start-reveal-item {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.4s;
}

#screen-start .start-reveal-item.start-revealed {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}

#title-main .title-char {
  display: inline-block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    visibility 0s linear 0.35s;
}

#title-main .title-char.title-char-revealed {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    visibility 0s;
}

.subtitle .sub-part.start-reveal-item {
  display: inline;
}

@media (prefers-reduced-motion: reduce) {
  .circuit::after,
  .circuit-pulse,
  .aurora-sheen,
  .nebula-bg,
  .start-intro-curtain,
  .start-sprite-ship,
  .start-sprite-planets,
  #screen-start .start-reveal-item {
    animation: none;
    transition: none;
  }

  body.start-intro-active .nebula-bg,
  body.start-intro-active .aurora-sheen,
  body.start-intro-active .circuit-lines,
  body.start-intro-active #particles {
    opacity: 1;
  }
}

/* 屏幕切换 */
.screen {
  display: none;
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* 开始页 */
#screen-start {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  text-align: center;
  overflow: hidden;
}

.start-composite {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.start-layer {
  position: absolute;
  inset: 0;
}

.start-layer-black {
  z-index: 1;
  background: #000;
}

.start-layer-ui {
  z-index: 2;
  pointer-events: none;
}

.start-click-gate {
  z-index: 3;
  pointer-events: none;
  background: transparent;
}

body.start-scan-active .start-click-gate:not(.hidden) {
  pointer-events: auto;
}

body.start-scan-active .start-layer-color {
  pointer-events: none;
}

.start-layer-color {
  z-index: 4;
  pointer-events: auto;
  transition: opacity 1.4s ease;
}

.start-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

body.start-intro-active:not(.start-reveal-ready) .start-layer-color {
  opacity: 0;
}

body.start-reveal-ready .start-layer-color,
body.start-intro-active.start-reveal-ready .start-layer-color {
  opacity: 1;
}

/* 主菜单：叠在黑白底图上 */
.start-layer-ui .start-menu {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: min(280px, 72vw);
}

.start-layer-ui .start-menu button {
  pointer-events: none;
}

body.start-scan-active .start-layer-ui .start-menu button,
body.start-scan-active .start-layer-ui .btn-llm-fab {
  pointer-events: auto;
}

.start-layer-ui .btn-llm-fab {
  pointer-events: none;
}

.start-scan-hint {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  z-index: 26;
  margin: 0;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(200, 230, 255, 0.55);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(4px);
  pointer-events: none;
  transition: color 0.25s, border-color 0.25s, opacity 0.35s;
}

.start-scan-hint-key {
  color: rgba(0, 240, 255, 0.85);
}

body.start-scan-active .start-scan-hint {
  color: rgba(0, 240, 255, 0.88);
  border-color: rgba(0, 240, 255, 0.45);
}

body.start-scan-active {
  cursor: crosshair;
}

body.start-scan-active::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 22;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 8, 18, 0.12) 100%
  );
}

body:not(.start-screen-active) .start-scan-hint {
  opacity: 0;
}

.start-deco {
  position: fixed;
  pointer-events: none;
  z-index: 6;
  opacity: 0.1;
  transition: opacity 1.2s ease;
}

body.start-intro-active .start-deco {
  opacity: 0;
}

body.start-intro-active.intro-scene .start-deco,
body.start-intro-active.intro-ui .start-deco {
  opacity: 0.1;
}

.start-deco-binary {
  left: 0;
  bottom: 0;
  width: min(280px, 40vw);
  padding: 1.5rem;
  mask-image: linear-gradient(135deg, black 20%, transparent 85%);
}

.binary-stream {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.55;
  color: var(--aurora);
  white-space: pre;
  margin: 0;
  animation: binary-scroll 28s linear infinite;
}

@keyframes binary-scroll {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { opacity: 1; }
  100% { transform: translateY(-12px); opacity: 0.6; }
}

.start-deco-evolution {
  right: 1.5rem;
  bottom: 1.5rem;
  width: 140px;
  height: 120px;
}

.evo-tree {
  position: relative;
  width: 100%;
  height: 100%;
}

.evo-node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--holo);
  background: rgba(157, 78, 221, 0.25);
  box-shadow: 0 0 6px rgba(157, 78, 221, 0.4);
}

.evo-root { left: 50%; top: 0; transform: translateX(-50%); }
.evo-n1 { left: 18%; top: 38%; }
.evo-n2 { right: 12%; top: 42%; }
.evo-n3 { left: 32%; bottom: 8%; }
.evo-n4 { right: 22%; bottom: 0; }

.evo-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--holo), transparent);
  height: 1px;
  transform-origin: left center;
  opacity: 0.7;
}

.evo-line-a {
  width: 52px;
  left: 46%;
  top: 12%;
  transform: rotate(125deg);
}

.evo-line-b {
  width: 58px;
  left: 48%;
  top: 14%;
  transform: rotate(48deg);
}

.evo-line-c {
  width: 44px;
  left: 24%;
  top: 48%;
  transform: rotate(68deg);
}

.evo-line-d {
  width: 50px;
  right: 28%;
  top: 52%;
  transform: rotate(-55deg);
}

.start-header {
  position: relative;
  z-index: 12;
  margin-bottom: 3rem;
}

.start-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: rgba(0, 240, 255, 0.45);
  margin-bottom: 1.25rem;
}

.title-glow {
  font-family: var(--font-sci);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
  margin: 0;
}

.title-inner {
  position: relative;
  display: inline-block;
  padding: 0.15em 0.35em;
}

.title-inner #title-main {
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 8px rgba(0, 240, 255, 0.9),
    0 0 20px rgba(0, 240, 255, 0.7),
    0 0 40px rgba(0, 240, 255, 0.45),
    0 0 60px rgba(157, 78, 221, 0.35),
    0 0 90px rgba(157, 78, 221, 0.2);
}

.title-scanlines {
  position: absolute;
  inset: -4px -8px;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.55;
  animation: title-flicker 6s steps(1) infinite;
}

@keyframes title-flicker {
  0%, 92%, 100% { opacity: 0.5; }
  93% { opacity: 0.65; }
  95% { opacity: 0.4; }
}

.subtitle {
  margin-top: 1.15rem;
  font-family: var(--font-cn);
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.38em;
  color: rgba(200, 230, 255, 0.88);
  text-shadow:
    0 0 10px rgba(0, 240, 255, 0.35),
    0 0 24px rgba(157, 78, 221, 0.2);
}

.subtitle::before,
.subtitle::after {
  content: "—";
  margin: 0 0.6em;
  font-size: 0.55em;
  letter-spacing: 0;
  color: rgba(157, 78, 221, 0.45);
  vertical-align: middle;
}

.start-menu {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 280px;
}

.start-menu button {
  background: transparent;
  border: 1px solid rgba(0, 240, 255, 0.5);
  font-family: var(--font-sci);
  letter-spacing: 0.16em;
  padding: 0.85rem 1.5rem;
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    color 0.25s;
}

.start-menu .btn-primary {
  background: transparent;
  color: var(--aurora);
}

.start-menu .btn-secondary {
  color: var(--text-dim);
}

.start-menu button:hover {
  border-color: var(--aurora);
  color: var(--text);
  box-shadow: inset 0 0 10px #00f0ff;
}

.start-menu .btn-breathe {
  animation: btn-breathe 3.5s ease-in-out infinite;
}

@keyframes btn-breathe {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

.start-footer {
  position: relative;
  z-index: 12;
  margin-top: 4rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.12em;
}

.dim { opacity: 0.55; }

/* 按钮 */
button {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-glow);
  background: var(--panel-bg);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

button:hover {
  border-color: var(--aurora);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(157, 78, 221, 0.15));
  font-family: var(--font-sci);
  letter-spacing: 0.2em;
}

.btn-primary.pulse {
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 240, 255, 0.3); }
  50% { box-shadow: 0 0 24px rgba(0, 240, 255, 0.6); }
}

/* 开始页主按钮不使用外发光脉冲，由 .btn-breathe 控制 */
#screen-start .btn-primary.pulse {
  animation: btn-breathe 3.5s ease-in-out infinite;
}

.btn-secondary { color: var(--text-dim); }
.btn-secondary:hover { color: var(--text); }

.btn-danger {
  border-color: rgba(255, 80, 80, 0.5);
  margin-top: 1rem;
}

.btn-icon {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.hidden { display: none !important; }

/* 面板（日志/设置） */
#screen-log,
#screen-settings {
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.panel {
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  border: 1px solid var(--border-glow);
  background: var(--panel-bg);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.08);
}

.panel h2 {
  font-family: var(--font-sci);
  margin-bottom: 1rem;
  color: var(--aurora);
}

.panel-desc {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.setting-row.checkbox {
  justify-content: flex-start;
}

.settings-block {
  margin: 1.25rem 0 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
}

.settings-subtitle {
  font-family: var(--font-sci);
  font-size: 0.95rem;
  color: var(--aurora);
  margin-bottom: 0.5rem;
}

.settings-hint {
  margin-bottom: 0.75rem !important;
  line-height: 1.5;
}

.setting-row-col {
  flex-direction: column;
  align-items: stretch;
}

.llm-proxy-input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.llm-proxy-input:focus {
  outline: none;
  border-color: var(--aurora);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.settings-btn-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.llm-proxy-status {
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-all;
}

.settings-advanced {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(0, 240, 255, 0.2);
}

.settings-advanced summary {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.settings-advanced[open] summary {
  color: var(--aurora);
}

.ending-list {
  list-style: none;
  margin-bottom: 1.5rem;
  max-height: 50vh;
  overflow-y: auto;
}

.ending-list li {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--text-dim);
}

.ending-list li.unlocked {
  border-left-color: var(--holo);
}

.ending-list li.locked {
  opacity: 0.45;
}

.ending-list strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-sci);
  font-size: 0.95rem;
}

.ending-list p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* HUD */
.hud-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border-glow);
  background: rgba(10, 14, 23, 0.92);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hud-brand {
  color: var(--aurora);
  font-family: var(--font-sci);
}

/* 游戏布局：左-右-下 */
.game-layout {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  grid-template-rows: 1fr auto;
  flex: 1;
  gap: 0;
  min-height: calc(100vh - 48px);
}

.sidebar-left {
  grid-row: 1 / 3;
  padding: 1rem;
  border-right: 1px solid var(--border-glow);
  background: rgba(10, 14, 23, 0.6);
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-sci);
  font-size: 0.75rem;
  color: var(--aurora);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.sidebar-hint {
  margin-top: auto;
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.star-map {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
}

.star-node {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(157, 78, 221, 0.4);
  background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.2), transparent);
}

.star-node.on-path {
  border-color: var(--aurora);
}

.star-node.current {
  box-shadow: 0 0 12px var(--aurora);
  transform: scale(1.08);
}

.star-node.is-ending {
  border-color: var(--holo);
  background: radial-gradient(circle at 30% 30%, rgba(157, 78, 221, 0.35), transparent);
}

.main-stage {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  min-width: 0;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 55vh;
  background: #000;
  border: 1px solid var(--border-glow);
  overflow: hidden;
}

.main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.scanline-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 240, 255, 0.03) 2px,
    rgba(0, 240, 255, 0.03) 4px
  );
  animation: scan 8s linear infinite;
}

.scanline-overlay.hidden {
  display: none;
}

@keyframes scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

.video-controls {
  display: flex;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.dialogue-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 140px;
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
  .sidebar-left {
    grid-row: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-glow);
  }
  .dialogue-row {
    grid-template-columns: 1fr;
  }
}

.log-panel {
  padding: 1rem;
  border: 1px solid rgba(157, 78, 221, 0.3);
  background: var(--panel-bg);
}

.log-panel h4 {
  font-family: var(--font-sci);
  font-size: 0.8rem;
  color: var(--holo);
  margin-bottom: 0.5rem;
}

.log-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.choices-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-btn {
  text-align: left;
  padding: 1rem;
  border-color: rgba(0, 240, 255, 0.25);
}

.choice-btn:hover {
  border-color: var(--aurora);
}

.choice-label {
  display: block;
  font-family: var(--font-sci);
  font-size: 0.7rem;
  color: var(--aurora);
  margin-bottom: 0.35rem;
}

.choice-text {
  font-size: 0.95rem;
}

/* 曲速转场 */
.warp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.warp-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.warp-streaks {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    rgba(0, 240, 255, 0.08) 40px,
    transparent 80px
  );
  animation: warp-streak 0.4s linear infinite;
}

@keyframes warp-streak {
  0% { transform: translateX(-80px); }
  100% { transform: translateX(80px); }
}

.warp-text {
  position: relative;
  font-family: var(--font-sci);
  letter-spacing: 0.3em;
  color: var(--aurora);
  text-shadow: 0 0 20px var(--aurora);
  animation: warp-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes warp-pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* 结局浮层 */
.ending-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 14, 23, 0.88);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.ending-overlay.active {
  display: flex;
}

.ending-card {
  max-width: 480px;
  padding: 2rem;
  border: 1px solid var(--holo);
  box-shadow: 0 0 40px rgba(157, 78, 221, 0.25);
  background: var(--panel-bg);
  text-align: center;
}

.ending-card h2 {
  font-family: var(--font-sci);
  color: var(--aurora);
  margin-bottom: 1rem;
}

.ending-card p {
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.ending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* 完美结局预留 */
.perfect-hooks {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 400;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hook-block {
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border-glow);
  background: var(--panel-bg);
  font-size: 0.8rem;
}

.hook-label {
  color: var(--aurora);
  font-family: var(--font-sci);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.hook-desc {
  color: var(--text-dim);
  line-height: 1.4;
}

/* 与新人类对话 · 浮动按钮 */
.btn-llm-fab {
  position: fixed;
  z-index: 500;
  padding: 0.65rem 1.1rem;
  font-family: var(--font-sci);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  border: 1px solid rgba(0, 240, 255, 0.55);
  background: rgba(0, 0, 0, 0.82);
  color: var(--aurora);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.btn-llm-fab:hover {
  border-color: var(--aurora);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.45);
}

#btn-llm-test {
  right: 1.25rem;
  bottom: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

body.app-booted #btn-llm-test {
  opacity: 1;
  pointer-events: auto;
}

.btn-llm-fab-game {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
}

/* 量子通讯对话框 */
.llm-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.llm-chat-panel {
  width: min(480px, 100%);
  max-height: min(720px, 92vh);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: rgba(0, 0, 0, 0.92);
  box-shadow:
    0 0 40px rgba(0, 240, 255, 0.12),
    inset 0 0 30px rgba(0, 240, 255, 0.04);
}

.llm-chat-header {
  position: relative;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.llm-chat-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: rgba(0, 240, 255, 0.5);
  margin-bottom: 0.35rem;
}

.llm-chat-header h2 {
  font-family: var(--font-sci);
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--text);
  margin: 0;
}

.llm-chat-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(0, 240, 255, 0.55);
  margin-top: 0.35rem;
}

.llm-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
}

.llm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 280px;
}

.llm-msg-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.llm-msg-user {
  justify-content: flex-end;
}

.llm-msg-user .llm-bubble {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.35);
}

.llm-msg-system {
  justify-content: center;
}

.llm-avatar {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--aurora);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 50%;
}

.llm-bubble {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.llm-bubble-system {
  max-width: 95%;
  border-style: dashed;
  border-color: rgba(157, 78, 221, 0.35);
  background: transparent;
}

.llm-sender {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: rgba(0, 240, 255, 0.55);
  margin-bottom: 0.25rem;
}

.llm-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.llm-typing span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--aurora);
  animation: llm-dot 1.2s ease-in-out infinite;
}

.llm-typing span:nth-child(2) { animation-delay: 0.15s; }
.llm-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes llm-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.llm-chat-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
}

.llm-input {
  flex: 1;
  resize: none;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-family: var(--font-cn);
  font-size: 0.88rem;
}

.llm-input:focus {
  outline: none;
  border-color: var(--aurora);
}

.llm-send {
  flex-shrink: 0;
  padding: 0 1.1rem;
  border: 1px solid var(--aurora);
  background: rgba(0, 240, 255, 0.1);
  color: var(--aurora);
  font-family: var(--font-sci);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.llm-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 手势检测 · 浮动测试按钮 */
.btn-gesture-fab {
  right: 1.25rem;
  bottom: 4.35rem;
  border-color: rgba(255, 90, 160, 0.55);
  color: #ff8ec8;
  box-shadow: 0 0 20px rgba(255, 90, 160, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

body.app-booted .btn-gesture-fab {
  opacity: 1;
  pointer-events: auto;
}

.btn-gesture-fab:hover {
  border-color: #ff8ec8;
  box-shadow: 0 0 28px rgba(255, 90, 160, 0.4);
}

/* 手势检测弹窗 */
.gesture-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.gesture-panel {
  width: min(720px, 100%);
  max-height: min(920px, 96vh);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: rgba(0, 0, 0, 0.94);
  box-shadow:
    0 0 50px rgba(0, 240, 255, 0.15),
    inset 0 0 40px rgba(0, 240, 255, 0.03);
  overflow: hidden;
}

.gesture-header {
  position: relative;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.gesture-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: rgba(255, 90, 160, 0.65);
  margin-bottom: 0.35rem;
}

.gesture-header h2 {
  font-family: var(--font-sci);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--aurora);
  margin-bottom: 0.4rem;
}

.gesture-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 36em;
}

.gesture-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: transparent;
  color: var(--aurora);
  cursor: pointer;
  font-size: 0.9rem;
}

.gesture-viewport {
  position: relative;
  margin: 0 1rem;
  aspect-ratio: 16 / 10;
  max-height: 42vh;
  border: 1px solid rgba(0, 240, 255, 0.35);
  overflow: hidden;
  background: #000;
}

.gesture-video,
.gesture-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gesture-video {
  transform: scaleX(-1);
}

.gesture-canvas {
  pointer-events: none;
  transform: scaleX(-1);
}

.gesture-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 240, 255, 0.03) 2px,
    rgba(0, 240, 255, 0.03) 4px
  );
  animation: gesture-scan 6s linear infinite;
}

@keyframes gesture-scan {
  from { background-position: 0 0; }
  to { background-position: 0 120px; }
}

.gesture-frame-corners span {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 240, 255, 0.75);
}

.gesture-frame-corners span:nth-child(1) { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.gesture-frame-corners span:nth-child(2) { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.gesture-frame-corners span:nth-child(3) { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.gesture-frame-corners span:nth-child(4) { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.gesture-live-label {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: rgba(255, 80, 120, 0.9);
  text-shadow: 0 0 8px rgba(255, 80, 120, 0.5);
}

.gesture-info {
  padding: 0.85rem 1.25rem 0.5rem;
}

.gesture-hint {
  font-size: 0.88rem;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.gesture-status-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(0, 240, 255, 0.75);
  margin-bottom: 0.75rem;
}

.gesture-meters {
  display: grid;
  gap: 0.55rem;
}

.gesture-meter-label {
  display: block;
  font-family: var(--font-sci);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  color: var(--text-dim);
}

.gesture-meter-track {
  height: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.2);
  overflow: hidden;
}

.gesture-meter-fill {
  height: 100%;
  width: 0%;
  transition: width 0.08s linear;
}

.gesture-meter-gun .gesture-meter-fill {
  background: linear-gradient(90deg, rgba(255, 80, 120, 0.5), #ff5078);
  box-shadow: 0 0 10px rgba(255, 80, 120, 0.5);
}

.gesture-meter-handshake .gesture-meter-fill {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), var(--aurora));
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.45);
}

.gesture-fallback {
  margin: 0 1rem 0.5rem;
  padding: 0.75rem;
  border: 1px dashed rgba(255, 90, 160, 0.45);
  background: rgba(255, 90, 160, 0.05);
}

.gesture-fallback-title {
  font-family: var(--font-sci);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #ff8ec8;
  margin-bottom: 0.55rem;
}

.gesture-fallback-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn-gesture-choice {
  flex: 1 1 180px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sci);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: rgba(0, 0, 0, 0.65);
  color: var(--aurora);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.btn-gesture-gun {
  border-color: rgba(255, 80, 120, 0.55);
  color: #ff8ec8;
}

.btn-gesture-handshake {
  border-color: rgba(0, 240, 255, 0.55);
}

.btn-gesture-choice:hover {
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.25);
}

.gesture-footer {
  padding: 0.65rem 1.25rem 1rem;
  border-top: 1px solid rgba(0, 240, 255, 0.12);
  display: flex;
  justify-content: center;
}

.gesture-footer .btn-secondary {
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .start-layer-ui .start-menu {
    top: 56%;
    min-width: min(260px, 84vw);
    gap: 0.7rem;
  }

  .start-scan-hint {
    font-size: 0.56rem;
    bottom: 0.75rem;
    max-width: 92vw;
  }

  .btn-gesture-fab {
    bottom: 4.8rem;
    font-size: 0.65rem;
    padding: 0.55rem 0.85rem;
  }

  .gesture-panel {
    max-height: 98vh;
  }

  .gesture-viewport {
    max-height: 36vh;
  }
}
