/* ═══════════════════════════════════════════════════════════════
   ROOT & RESET
═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:root {
  --void: #000005;
  --deep: #06060f;
  --surface: #0d0d1e;
  --TOMA: #00c8ff;
  --TOMA-d: #006688;
  --pulse: #ff2244;
  --pulse-d: #880022;
  --gold: #c8a84b;
  --gold-d: #6a5520;
  --ash: #8888aa;
  --text: #d0d0e8;
  --lb: 0px;
  --cam-scale: 1;
  --cam-x: 0px;
  --cam-y: 0px;
  --cam-rotate: 0deg;
  --large-text: 1;
}
html,
body {
  width: 100%;
  height: 100%;
  background: var(--void);
  overflow: hidden;
  font-family: "IM Fell English", serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
@media (pointer: fine) {
  body {
    cursor: none;
  }
  .cursor {
    display: block;
  }
}
@media (pointer: coarse) {
  .cursor {
    display: none !important;
  }
}

/* ── CURSOR ── */
.cursor {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 7px;
  height: 7px;
  background: var(--TOMA);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 14px var(--TOMA),
    0 0 36px rgba(0, 200, 255, 0.35);
  transition: transform 0.08s;
}

/* ── STARFIELD ── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── NOISE ── */
#noise-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.75;
}

/* ── LETTERBOX ── */
.letterbox {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 800;
  background: #000;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#lb-top {
  top: 0;
  height: var(--lb);
}
#lb-bottom {
  bottom: 0;
  height: var(--lb);
}

/* ── MASTER SCENE ── */
#scene {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   BOOT — ASSET PRELOADER
═══════════════════════════════════════════════════════════════ */
#boot-preloader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.8s;
}
.boot-glyph {
  width: 80px;
  height: 80px;
  border: 1px solid rgba(0, 200, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--TOMA);
  animation:
    bootSpin 3s linear infinite,
    glowPulse 2s ease-in-out infinite;
}
@keyframes bootSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes glowPulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 200, 255, 0.25);
  }
}
.boot-title {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 6px;
  color: rgba(0, 200, 255, 0.55);
}
.boot-bar-wrap {
  width: min(280px, 70vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
}
.boot-bar {
  height: 100%;
  background: var(--TOMA);
  box-shadow: 0 0 8px var(--TOMA);
  width: 0%;
  transition: width 0.15s linear;
}
.boot-pct {
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(0, 200, 255, 0.5);
  text-align: center;
}
.boot-msg {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   BOOT — LANGUAGE SELECTION
═══════════════════════════════════════════════════════════════ */
#boot-lang {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--void);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  transition: opacity 0.6s;
}
#boot-lang.visible {
  display: flex;
}
#boot-lang.fadein {
  opacity: 1;
}
.bl-glyph {
  font-size: 28px;
  color: var(--TOMA);
  opacity: 0.6;
  margin-bottom: 8px;
  animation: glowPulse 2s ease-in-out infinite;
}
.bl-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(24px, 6vw, 52px);
  letter-spacing: 4px;
  color: #fff;
  text-align: center;
}
.bl-subtitle {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--ash);
  opacity: 0.6;
}
.bl-choices {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bl-btn {
  font-family: "Cinzel", serif;
  font-size: clamp(12px, 2vw, 16px);
  letter-spacing: 4px;
  padding: clamp(16px, 3vh, 22px) clamp(32px, 6vw, 56px);
  background: transparent;
  border: 1px solid rgba(0, 200, 255, 0.3);
  color: rgba(0, 200, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s;
  min-width: 44px;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}
.bl-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--TOMA);
  transform: translateX(-100%);
  transition: transform 0.3s;
}
.bl-btn:hover {
  border-color: var(--TOMA);
  color: var(--void);
}
.bl-btn:hover::before {
  transform: translateX(0);
}
.bl-btn span {
  position: relative;
  z-index: 1;
}
.bl-indicator {
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.2);
  animation: blinkAnim 1.8s ease-in-out infinite;
}
@keyframes blinkAnim {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.7;
  }
}

/* ═══════════════════════════════════════════════════════════════
   INTRO PHASES
═══════════════════════════════════════════════════════════════ */
.intro-phase {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#ph-studio {
  opacity: 0;
  animation:
    fadeIn 0.9s 0.3s forwards,
    fadeOut 0.7s 2.6s forwards;
}
.studio-glyph {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(200, 168, 75, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 22px;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold);
  animation: glowPulse 2s ease-in-out infinite;
}
.studio-name {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 6px;
  color: rgba(200, 168, 75, 0.5);
}
#ph-void {
  opacity: 0;
  animation: fadeIn 0.1s 3.4s forwards;
}
.hb-ring {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--TOMA);
  box-shadow: 0 0 18px var(--TOMA);
  animation:
    heartbeat 1.6s 3.6s ease-in-out 2,
    ringBlast 0.9s 6.8s cubic-bezier(0.15, 0, 0.35, 1) forwards;
}
@keyframes heartbeat {
  0%,
  70%,
  100% {
    transform: scale(1);
  }
  20% {
    transform: scale(3);
    box-shadow:
      0 0 60px var(--TOMA),
      0 0 120px rgba(0, 200, 255, 0.3);
  }
  50% {
    transform: scale(1.8);
  }
}
@keyframes ringBlast {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(500);
    opacity: 0;
  }
}
.shockring {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid rgba(0, 200, 255, 0.5);
  animation: shockExpand 1.1s var(--d, 0.1s) cubic-bezier(0, 0.6, 0.4, 1)
    forwards;
  opacity: 0;
}
@keyframes shockExpand {
  0% {
    width: 5px;
    height: 5px;
    opacity: 0.8;
  }
  100% {
    width: 280vmax;
    height: 280vmax;
    opacity: 0;
  }
}
#ph-scripture {
  opacity: 0;
  text-align: center;
  padding: 0 clamp(20px, 6vw, 80px);
  animation:
    fadeIn 1.1s 7.8s forwards,
    fadeOut 0.8s 18.4s forwards;
}
.scrip-rule {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.7s 8.2s forwards;
}
.scrip-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 168, 75, 0.35));
}
.scrip-line.r {
  background: linear-gradient(270deg, transparent, rgba(200, 168, 75, 0.35));
}
.scrip-glyph {
  color: var(--gold);
  font-size: 16px;
  opacity: 0.55;
}
.verse {
  font-size: clamp(14px, 2.5vw, 20px);
  line-height: 1.95;
  opacity: 0;
  transform: translateY(10px);
  margin-bottom: 2px;
}
.verse em {
  color: var(--TOMA);
  font-style: italic;
}
.verse strong {
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 0.85em;
  letter-spacing: 2px;
  font-style: normal;
}
.verse .r {
  color: var(--pulse);
}
.v1 {
  animation: verseIn 1s 8.5s forwards;
}
.v2 {
  animation: verseIn 1s 9.8s forwards;
}
.v3 {
  animation: verseIn 1s 11s forwards;
}
.vsep {
  animation: verseIn 0.8s 12s forwards;
  margin: 24px 0;
  font-size: 22px;
  color: var(--gold) !important;
}
.v4 {
  animation: verseIn 1s 12.6s forwards;
}
.v5 {
  animation: verseIn 1s 13.9s forwards;
}
.v6 {
  animation: verseIn 1s 15.2s forwards;
}
@keyframes verseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.scrip-title {
  margin-top: 44px;
  opacity: 0;
  animation: titleBurst 1.3s 16.8s cubic-bezier(0.2, 0, 0, 1) forwards;
}
.scrip-top {
  font-family: "Cinzel", serif;
  font-size: clamp(8px, 1.3vw, 12px);
  letter-spacing: 7px;
  color: var(--gold);
  margin-bottom: 10px;
}
.scrip-main {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(36px, 9vw, 100px);
  line-height: 0.93;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 0 0 50px rgba(0, 200, 255, 0.25);
}
.scrip-main .outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(0, 200, 255, 0.55);
}
@keyframes titleBurst {
  0% {
    opacity: 0;
    transform: scale(0.93);
    filter: blur(8px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
#ph-chars {
  opacity: 0;
  animation: fadeIn 0.5s 19s forwards;
}
.char-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 clamp(24px, 8vw, 120px) clamp(60px, 8vh, 100px);
  opacity: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.cf1 {
  animation:
    flashIn 0.5s 19.2s forwards,
    flashOut 0.5s 29.2s forwards;
}
.cf2 {
  animation:
    flashIn 0.5s 29.5s forwards,
    flashOut 0.5s 39.5s forwards;
}
.cf3 {
  animation:
    flashIn 0.5s 40s forwards,
    flashOut 0.5s 50s forwards;
}
@keyframes flashIn {
  to {
    opacity: 1;
  }
}
@keyframes flashOut {
  to {
    opacity: 0;
  }
}
.cf-glow {
  position: absolute;
  right: clamp(20px, 8vw, 160px);
  top: 50%;
  transform: translateY(-55%);
  width: min(300px, 38vw);
  aspect-ratio: 0.5;
}
.cf-glow-blob {
  position: absolute;
  inset: -30%;
  background: radial-gradient(
    ellipse 50% 80% at 50% 60%,
    var(--ac, var(--TOMA)),
    transparent 70%
  );
  opacity: 0.12;
  filter: blur(24px);
  animation: blobPulse 2s ease-in-out infinite;
}
@keyframes blobPulse {
  0%,
  100% {
    opacity: 0.08;
  }
  50% {
    opacity: 0.18;
  }
}
.cf-scan {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.cf-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ac, var(--TOMA)),
    transparent
  );
  animation: scanY 2s ease-in-out infinite;
  opacity: 0.5;
}
@keyframes scanY {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}
.cf-info {
  position: relative;
  z-index: 2;
  max-width: clamp(220px, 45vw, 440px);
  background: linear-gradient(
    90deg,
    rgba(0, 0, 5, 0.95) 0%,
    rgba(0, 0, 5, 0.8) 60%,
    transparent 100%
  );
  padding: 20px;
  border-radius: 4px;
}
.cf-faction {
  font-family: "Cinzel", serif;
  font-size: clamp(8px, 1.2vw, 11px);
  letter-spacing: 4px;
  color: var(--ac, var(--TOMA));
  margin-bottom: 12px;
  opacity: 0.7;
}
.cf-code {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(28px, 7vw, 72px);
  line-height: 1;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 30px var(--ac, var(--TOMA));
  margin-bottom: 6px;
}
.cf-realname {
  font-family: "IM Fell English", serif;
  font-size: clamp(12px, 1.6vw, 16px);
  font-style: italic;
  color: var(--ash);
  margin-bottom: 20px;
}
.cf-quote {
  font-size: clamp(12px, 1.7vw, 16px);
  font-style: italic;
  color: rgba(180, 180, 200, 0.7);
  line-height: 1.75;
  border-left: 2px solid var(--ac, var(--TOMA));
  padding-left: 18px;
  margin-bottom: 24px;
}
.cf-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cf-pill {
  font-family: "Cinzel", serif;
  font-size: clamp(8px, 1vw, 10px);
  letter-spacing: 2px;
  color: var(--ac, var(--TOMA));
  border: 1px solid currentColor;
  padding: 4px 10px;
  opacity: 0.7;
}
.cut-white {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}
.cut1 {
  animation: cutFlash 0.15s 21.6s;
}
.cut2 {
  animation: cutFlash 0.15s 24.2s;
}
@keyframes cutFlash {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MAIN MENU
═══════════════════════════════════════════════════════════════ */
#ph-menu {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
#ph-menu.visible {
  opacity: 1;
  pointer-events: all;
}
.menu-bg-grad {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 50% 60% at 10% 50%,
      rgba(0, 200, 255, 0.05),
      transparent
    ),
    radial-gradient(
      ellipse 40% 50% at 90% 40%,
      rgba(255, 34, 68, 0.04),
      transparent
    );
}
.menu-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 200, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
}
.menu-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: clamp(20px, 5vw, 80px) clamp(20px, 8vw, 120px);
  gap: clamp(20px, 4vw, 60px);
}
@media (max-width: 640px) {
  .menu-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
}
.menu-left {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vh, 24px);
}
.menu-eyebrow {
  font-family: "Cinzel", serif;
  font-size: clamp(8px, 1.2vw, 10px);
  letter-spacing: 6px;
  color: var(--gold);
  opacity: 0.65;
}
.menu-logo {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(28px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 200, 255, 0.2);
}
.menu-logo .outline {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0, 200, 255, 0.45);
}
.menu-tagline {
  font-size: clamp(12px, 1.6vw, 15px);
  font-style: italic;
  color: var(--ash);
  line-height: 1.7;
  max-width: 340px;
}
.lang-switcher-menu {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.lang-btn {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang-btn.active {
  border-color: var(--TOMA);
  color: var(--TOMA);
}
.menu-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: clamp(14px, 2vh, 20px) clamp(18px, 2.5vw, 28px);
  background: none;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.22s;
  min-height: 44px;
}
.menu-btn:hover,
.menu-btn.selected {
  border-left-color: var(--TOMA);
  background: rgba(0, 200, 255, 0.05);
}
.menu-btn-num {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ash);
  width: 22px;
  flex-shrink: 0;
}
.menu-btn.selected .menu-btn-num,
.menu-btn:hover .menu-btn-num {
  color: var(--TOMA);
}
.menu-btn-label {
  font-family: "Cinzel", serif;
  font-size: clamp(14px, 2.5vw, 22px);
  letter-spacing: 3px;
  color: rgba(200, 200, 220, 0.5);
  transition: color 0.22s;
}
.menu-btn.selected .menu-btn-label,
.menu-btn:hover .menu-btn-label {
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 200, 255, 0.35);
}
.menu-btn-arrow {
  margin-left: auto;
  color: var(--TOMA);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.22s;
}
.menu-btn.selected .menu-btn-arrow,
.menu-btn:hover .menu-btn-arrow {
  opacity: 1;
  transform: translateX(0);
}
.menu-footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 12px;
}
.menu-footer-l {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--ash);
  opacity: 0.35;
}
.menu-pulse {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--TOMA);
  opacity: 0.55;
}
.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--TOMA);
  animation: blinkAnim 2s ease-in-out infinite;
}
#skip-btn {
  position: fixed;
  bottom: clamp(16px, 3vh, 30px);
  right: clamp(16px, 4vw, 40px);
  z-index: 200;
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.25);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  opacity: 0;
  animation: fadeIn 1s 4s forwards;
}
#skip-btn:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* ═══════════════════════════════════════════════════════════════
   SAVE/LOAD SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-saves {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0, 0, 5, 0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#screen-saves.open {
  opacity: 1;
  pointer-events: all;
}
.saves-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.5vh, 24px) clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.saves-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(14px, 3vw, 28px);
  letter-spacing: 3px;
  color: #fff;
}
.saves-title span {
  color: var(--TOMA);
}
.saves-back {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--ash);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.saves-back:hover {
  color: #fff;
  border-color: var(--TOMA);
}
.saves-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(24px, 5vh, 48px) clamp(16px, 5vw, 60px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.save-slot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: clamp(16px, 3vh, 24px) clamp(20px, 3vw, 32px);
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 2px solid transparent;
  min-height: 44px;
}
.save-slot:hover {
  background: rgba(0, 200, 255, 0.05);
  border-left-color: var(--TOMA);
}
.save-slot.empty {
  opacity: 0.4;
}
.save-slot-num {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(24px, 4vw, 40px);
  color: var(--TOMA);
  opacity: 0.5;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}
.save-slot-info {
  flex: 1;
}
.save-slot-title {
  font-family: "Cinzel", serif;
  font-size: clamp(12px, 2vw, 16px);
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 5px;
}
.save-slot-meta {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  color: var(--ash);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.save-slot-meta span {
  color: var(--TOMA);
  opacity: 0.6;
}
.save-slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.save-action-btn {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.save-action-btn:hover {
  border-color: var(--TOMA);
  color: var(--TOMA);
}
.save-action-btn.danger:hover {
  border-color: var(--pulse);
  color: var(--pulse);
}
.autosave-badge {
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  letter-spacing: 2px;
  padding: 3px 8px;
  background: rgba(0, 200, 255, 0.08);
  border: 1px solid rgba(0, 200, 255, 0.2);
  color: var(--TOMA);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.5s;
}
.autosave-badge.flash {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   GAME SCREENS — SHELL
═══════════════════════════════════════════════════════════════ */
.gscreen {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 5, 0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  font-family: "IM Fell English", serif;
  overflow: hidden;
}
.gscreen.open {
  opacity: 1;
  pointer-events: all;
}
.gs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.5vh, 24px) clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.gs-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(14px, 3vw, 28px);
  letter-spacing: 3px;
  color: #fff;
}
.gs-title span {
  color: var(--TOMA);
}
.gs-back {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--ash);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.gs-back:hover {
  color: #fff;
  border-color: var(--TOMA);
}
.gs-body {
  flex: 1;
  overflow: hidden;
  display: flex;
}

/* STORY SCREEN */
.story-split {
  display: flex;
  width: 100%;
  height: 100%;
}
.story-list {
  width: clamp(200px, 30%, 340px);
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  padding: 8px 0;
}
.story-list::-webkit-scrollbar {
  width: 2px;
}
.story-list::-webkit-scrollbar-thumb {
  background: var(--TOMA-d);
}
.ch-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: clamp(12px, 2vh, 16px) clamp(16px, 3vw, 28px);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  min-height: 44px;
}
.ch-row:hover {
  background: rgba(0, 200, 255, 0.04);
}
.ch-row.active {
  border-left-color: var(--TOMA);
  background: rgba(0, 200, 255, 0.06);
}
.ch-row.locked {
  opacity: 0.3;
  cursor: default;
}
.ch-num {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ash);
  width: 22px;
  flex-shrink: 0;
}
.ch-row.active .ch-num {
  color: var(--TOMA);
}
.ch-info {
  flex: 1;
  min-width: 0;
}
.ch-title-s {
  font-family: "Cinzel", serif;
  font-size: clamp(10px, 1.5vw, 13px);
  letter-spacing: 1px;
  color: rgba(200, 200, 220, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-row.active .ch-title-s {
  color: #fff;
}
.ch-char-s {
  font-size: 11px;
  color: var(--ash);
  font-style: italic;
  margin-top: 2px;
}
.story-detail {
  flex: 1;
  padding: clamp(24px, 5vh, 56px) clamp(20px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}
.sd-num {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--TOMA);
  margin-bottom: 10px;
}
.sd-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(20px, 4vw, 52px);
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 6px;
}
.sd-char {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 28px;
}
.sd-desc {
  font-size: clamp(13px, 1.8vw, 17px);
  font-style: italic;
  color: rgba(180, 180, 200, 0.72);
  line-height: 1.85;
  max-width: 560px;
  border-left: 2px solid rgba(0, 200, 255, 0.28);
  padding-left: 22px;
  margin-bottom: 44px;
}
.sd-play {
  width: fit-content;
  padding: clamp(14px, 2vh, 18px) clamp(28px, 4vw, 48px);
  font-family: "Cinzel", serif;
  font-size: clamp(11px, 1.6vw, 14px);
  letter-spacing: 4px;
  background: transparent;
  border: 1px solid var(--TOMA);
  color: var(--TOMA);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  min-height: 44px;
}
.sd-play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--TOMA);
  transform: translateX(-100%);
  transition: transform 0.3s;
}
.sd-play:hover:not(:disabled)::before {
  transform: translateX(0);
}
.sd-play:hover:not(:disabled) {
  color: var(--void);
}
.sd-play:disabled {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.18);
  cursor: default;
}
.sd-play-inner {
  position: relative;
  z-index: 1;
}

/* VERSUS SCREEN */
.vs-layout {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  width: 100%;
  height: 100%;
}
@media (max-width: 600px) {
  .vs-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}
.vs-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3vh, 32px) clamp(14px, 3vw, 40px);
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.vs-panel:last-child {
  border-right: none;
}
.vs-plabel {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--ash);
  text-align: center;
  margin-bottom: 12px;
}
.vs-name {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(18px, 3.5vw, 38px);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 3px;
}
.vs-sub {
  font-size: 12px;
  font-style: italic;
  color: var(--ash);
  text-align: center;
  margin-bottom: 14px;
}
.vs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 18px;
}
.vs-card {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  min-height: 44px;
  background-size: cover;
  background-position: center;
}
.vs-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
  transition: background 0.2s;
}
.vs-card:hover::before {
  background: rgba(0, 0, 0, 0.4);
}
.vs-card:hover {
  border-color: var(--ac, var(--TOMA));
  background: rgba(0, 200, 255, 0.06);
}
.vs-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--ac, #00c8ff), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}
.vs-card:hover .vs-card-glow {
  opacity: 0.14;
}
.vs-card-code {
  font-family: "Cinzel", serif;
  font-size: 7px;
  letter-spacing: 1px;
  color: rgba(200, 200, 220, 0.5);
  position: relative;
  z-index: 1;
}
.vs-div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel Decorative", serif;
  font-size: 26px;
  color: rgba(200, 168, 75, 0.35);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.vs-stage-item {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  color: rgba(200, 200, 220, 0.35);
  transition: all 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.vs-stage-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 0;
  transition: background 0.2s;
}
.vs-stage-item > span {
  position: relative;
  z-index: 1;
}
.vs-stage-item:hover::before {
  background: rgba(0, 0, 0, 0.6);
}
.vs-stage-item.active::before {
  background: rgba(0, 0, 0, 0.5);
}
.vs-stage-item:hover {
  color: #fff;
  background: rgba(0, 200, 255, 0.04);
}
.vs-stage-item.active {
  border-left-color: var(--gold);
  color: var(--gold);
}
.vs-fight {
  margin-top: 14px;
  padding: 16px;
  width: 100%;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 4px;
  background: transparent;
  border: 1px solid var(--pulse);
  color: var(--pulse);
  cursor: pointer;
  transition: all 0.3s;
  min-height: 44px;
}
.vs-fight:hover {
  background: var(--pulse);
  color: var(--void);
}

/* ROSTER */
.roster-layout {
  display: grid;
  grid-template-columns: 1fr clamp(260px, 32%, 380px);
  width: 100%;
  height: 100%;
}
@media (max-width: 700px) {
  .roster-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}
#roster-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(clamp(80px, 15vw, 130px), 1fr)
  );
  gap: 2px;
  padding: 12px;
  align-content: start;
  overflow-y: auto;
}
.r-card {
  background: rgba(255, 255, 255, 0.03);
  padding: clamp(12px, 2vh, 20px) clamp(10px, 1.5vw, 16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-left: 2px solid transparent;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  min-height: 44px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.r-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 0;
  transition: background 0.3s;
}
.r-card:hover::before,
.r-card.active::before {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.45) 50%,
    rgba(0, 0, 0, 0.25) 100%
  );
}
.r-card:hover,
.r-card.active {
  border-left-color: var(--ac, var(--TOMA));
  background: rgba(0, 200, 255, 0.05);
}
.r-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 100%,
    var(--ac, #00c8ff),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s;
}
.r-card:hover .r-glow,
.r-card.active .r-glow {
  opacity: 0.09;
}
.r-arch {
  font-family: "Cinzel", serif;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--ash);
  margin-bottom: 5px;
  position: relative;
  z-index: 1;
}
.r-code {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(12px, 2vw, 16px);
  color: #fff;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}
.r-name {
  font-size: 10px;
  font-style: italic;
  color: var(--ash);
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.roster-det {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: clamp(24px, 4vh, 44px) clamp(20px, 3vw, 36px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.roster-det::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.75) 100%
  );
  z-index: 0;
}
.roster-det > * {
  position: relative;
  z-index: 1;
}
#rd-code {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(24px, 4vw, 46px);
  letter-spacing: 2px;
  line-height: 1;
}
#rd-name {
  font-size: 14px;
  font-style: italic;
  color: var(--ash);
}
.rd-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.rd-pill {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(200, 200, 220, 0.45);
}
.rd-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 6px 0;
}
#rd-bio {
  font-size: clamp(12px, 1.6vw, 14px);
  font-style: italic;
  color: rgba(180, 180, 200, 0.68);
  line-height: 1.9;
}

/* TRAINING */
.training-layout {
  display: grid;
  grid-template-columns: 1fr clamp(260px, 35%, 420px);
  width: 100%;
  height: 100%;
}
@media (max-width: 700px) {
  .training-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}
.training-main {
  padding: clamp(20px, 4vh, 36px) clamp(16px, 4vw, 48px);
  overflow-y: auto;
}
.tr-label {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--TOMA);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.tr-select {
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 14px;
  width: 100%;
  max-width: 360px;
  cursor: pointer;
  outline: none;
  margin-bottom: 28px;
  appearance: none;
  min-height: 44px;
}
.tr-select option {
  background: #000;
}
.move-tbl {
  width: 100%;
  border-collapse: collapse;
}
.move-tbl th {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--ash);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.move-tbl tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.move-tbl tr:hover td {
  background: rgba(0, 200, 255, 0.04);
}
.move-nm {
  font-family: "Cinzel", serif;
  font-size: clamp(11px, 1.5vw, 13px);
  color: #fff;
  padding: 13px 14px;
  letter-spacing: 1px;
}
.move-in {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: var(--TOMA);
  padding: 13px 14px;
  white-space: nowrap;
}
.move-ds {
  font-size: 12px;
  font-style: italic;
  color: var(--ash);
  padding: 13px 14px;
}
.tr-tips {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: clamp(20px, 4vh, 36px) clamp(16px, 3vw, 36px);
  overflow-y: auto;
}
.tip-h {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 16px;
}
.tip-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 18px;
  margin-bottom: 6px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.tip-card:hover {
  border-left-color: var(--gold);
  background: rgba(200, 168, 75, 0.04);
}
.tip-head {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 5px;
}
.tip-body {
  font-size: 12px;
  font-style: italic;
  color: var(--ash);
  line-height: 1.7;
}

/* CODEX */
.codex-layout {
  display: grid;
  grid-template-columns: clamp(200px, 26%, 300px) 1fr;
  width: 100%;
  height: 100%;
}
@media (max-width: 640px) {
  .codex-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}
.codex-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}
.codex-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cf-btn {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 7px 11px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.cf-btn:hover,
.cf-btn.active {
  border-color: var(--TOMA);
  color: var(--TOMA);
}
#codex-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
#codex-list::-webkit-scrollbar {
  width: 2px;
}
#codex-list::-webkit-scrollbar-thumb {
  background: var(--TOMA);
}
.codex-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 18px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  min-height: 44px;
}
.codex-row:hover {
  background: rgba(0, 200, 255, 0.04);
  border-left-color: rgba(0, 200, 255, 0.25);
}
.cx-id {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--ash);
  flex-shrink: 0;
}
.cx-cat {
  font-family: "Cinzel", serif;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--gold);
  flex-shrink: 0;
  opacity: 0.65;
}
.cx-title {
  font-size: 11px;
  color: rgba(200, 200, 220, 0.55);
}
.codex-det {
  padding: clamp(28px, 5vh, 48px) clamp(20px, 5vw, 56px);
  overflow-y: auto;
}

/* OPTIONS */
.options-wrap {
  padding: clamp(20px, 4vh, 40px) clamp(16px, 6vw, 60px);
  overflow-y: auto;
  width: 100%;
}
.opt-section {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--TOMA);
  margin-bottom: 14px;
  margin-top: 32px;
}
.opt-section:first-child {
  margin-top: 0;
}
.opt-div {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 18px;
}
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 16px;
  flex-wrap: wrap;
  min-height: 44px;
}
.opt-lbl {
  font-family: "Cinzel", serif;
  font-size: clamp(10px, 1.5vw, 12px);
  letter-spacing: 2px;
  color: rgba(200, 200, 220, 0.55);
  flex: 1;
}
.opt-ctl {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.opt-slider {
  appearance: none;
  width: clamp(120px, 20vw, 200px);
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}
.opt-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--TOMA);
  box-shadow: 0 0 8px var(--TOMA);
  cursor: pointer;
}
.opt-val {
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--TOMA);
  width: 30px;
  text-align: right;
}
.opt-toggle {
  position: relative;
  width: 44px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  cursor: pointer;
  appearance: none;
  border: none;
  outline: none;
  transition: background 0.3s;
  flex-shrink: 0;
}
.opt-toggle:checked {
  background: var(--TOMA);
}
.opt-toggle::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.opt-toggle:checked::after {
  transform: translateX(22px);
}
.btn-grp {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.opt-choice {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.opt-choice:hover,
.opt-choice.active {
  border-color: var(--TOMA);
  color: var(--TOMA);
  background: rgba(0, 200, 255, 0.06);
}
.opt-text-val {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
}
#opt-save {
  margin-top: 36px;
  padding: 16px 52px;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 4px;
  background: transparent;
  border: 1px solid var(--TOMA);
  color: var(--TOMA);
  cursor: pointer;
  transition: all 0.3s;
  min-height: 44px;
}
#opt-save:hover {
  background: var(--TOMA);
  color: var(--void);
}
.opt-lang-btn {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.opt-lang-btn.active {
  border-color: var(--TOMA);
  color: var(--TOMA);
}

/* ═══════════════════════════════════════════════════════════════
   NARRATIVE ENGINE
═══════════════════════════════════════════════════════════════ */
#narrative-engine {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--void);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  touch-action: none;
}
#narrative-engine.open {
  opacity: 1;
  pointer-events: all;
}

/* Camera system */
#ne-scene-bg {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse 80% 70% at 50% 40%,
    rgba(0, 30, 50, 0.9),
    var(--void)
  );
}
#ne-camera-wrap {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transform: scale(var(--cam-scale)) translate(var(--cam-x), var(--cam-y))
    rotate(var(--cam-rotate));
  transition: transform 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.ne-cam-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 70% at 50% 40%,
    rgba(0, 30, 50, 0.9),
    var(--void)
  );
}

/* Emotion tint */
#ne-emotion-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.8s ease;
}

/* Scene labels */
.ne-scene-label {
  position: absolute;
  top: clamp(12px, 2vh, 20px);
  left: clamp(16px, 3vw, 32px);
  font-family: "Cinzel", serif;
  font-size: clamp(8px, 1.2vw, 10px);
  letter-spacing: 4px;
  color: rgba(200, 168, 75, 0.5);
}
.ne-char-display {
  position: absolute;
  bottom: 0;
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(80px, 20vw, 240px);
  line-height: 1;
  opacity: 0.04;
  color: var(--TOMA);
  letter-spacing: -2px;
  user-select: none;
  pointer-events: none;
}
.ne-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    transparent,
    rgba(0, 0, 5, 0.7)
  );
  pointer-events: none;
}

/* Heartrate display */
#ne-heartrate {
  position: absolute;
  top: clamp(50px, 8vh, 80px);
  right: clamp(16px, 3vw, 32px);
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  z-index: 20;
}
@media (max-width: 768px) {
  #ne-heartrate {
    top: clamp(60px, 10vh, 100px);
    right: 10px;
    z-index: 25;
  }
  .hr-label {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .hr-value {
    font-size: 18px;
  }
}
.hr-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(255, 34, 68, 0.6);
}
.hr-value {
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(20px, 4vw, 32px);
  color: var(--pulse);
  text-shadow: 0 0 14px var(--pulse);
}
.hr-bar {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 32px;
}
.hr-spike {
  width: 3px;
  background: var(--pulse);
  border-radius: 1px;
  opacity: 0.7;
}

/* Memory log */
#ne-memory-log {
  position: absolute;
  top: clamp(12px, 2vh, 20px);
  right: clamp(16px, 3vw, 32px);
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(200, 168, 75, 0.5);
  text-align: right;
  pointer-events: none;
}
.mem-entry {
  margin-bottom: 2px;
}

/* Nav bar */
.ne-nav {
  position: absolute;
  top: clamp(32px, 5vh, 48px);
  left: clamp(16px, 3vw, 32px);
  display: flex;
  gap: 8px;
  z-index: 10;
}
@media (max-width: 768px) {
  .ne-nav {
    position: fixed;
    top: unset;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 16px;
    width: 90vw;
    justify-content: center;
    z-index: 100;
  }
  .ne-nav-btn {
    font-size: 15px;
    padding: 14px 0;
    min-width: 44vw;
    min-height: 48px;
    border-radius: 8px;
    background: linear-gradient(90deg, #0af 0%, #0ff 100%);
    color: #fff;
    border: 2px solid #0ff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    font-weight: bold;
    margin-bottom: 0;
  }
}
.ne-nav-btn {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 8px 14px;
  background: rgba(0, 0, 8, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.ne-nav-btn:hover {
  color: #fff;
  border-color: var(--TOMA);
}

/* TOMA sight */
#ne-scene-bg.TOMA-sight {
  animation: TOMASight 0.08s linear infinite;
}
@keyframes TOMASight {
  0% {
    filter: hue-rotate(0deg) saturate(2);
  }
  33% {
    filter: hue-rotate(90deg) saturate(2.5) brightness(1.4);
  }
  66% {
    filter: hue-rotate(-60deg) saturate(1.8) brightness(0.9);
  }
  100% {
    filter: hue-rotate(0deg) saturate(2);
  }
}
.TOMA-code-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}
.TOMA-code-text {
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(28px, 8vw, 80px);
  letter-spacing: 12px;
  color: var(--TOMA);
  text-shadow:
    0 0 30px var(--TOMA),
    0 0 60px rgba(0, 200, 255, 0.5);
  opacity: 0;
  animation: codeReveal 1s 0.5s forwards;
}
@keyframes codeReveal {
  to {
    opacity: 1;
  }
}

/* Dialogue panel */
#ne-dialogue {
  flex-shrink: 0;
  background: rgba(0, 0, 8, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: clamp(14px, 3vh, 24px) clamp(16px, 4vw, 48px);
  min-height: clamp(120px, 22vh, 180px);
  position: relative;
  transition: min-height 0.3s;
}
.ne-speaker {
  font-family: "Cinzel", serif;
  font-size: clamp(9px, 1.4vw, 12px);
  letter-spacing: 4px;
  color: var(--TOMA);
  margin-bottom: 10px;
  opacity: 0.8;
}
.ne-text {
  font-size: calc(clamp(14px, 2.2vw, 18px) * var(--large-text));
  line-height: 1.8;
  color: rgba(220, 220, 240, 0.9);
  font-style: italic;
  min-height: clamp(48px, 8vh, 72px);
}
.ne-continue {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 36px auto 0 auto;
  width: fit-content;
  min-width: 160px;
  font-size: 18px;
  font-family: "Cinzel", serif;
  font-weight: bold;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #0af 0%, #0ff 100%);
  color: #fff;
  border: 2px solid #0ff;
  border-radius: 8px;
  padding: 14px 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  z-index: 20;
  animation: blinkAnim 1.4s ease-in-out infinite;
  min-width: 160px;
  min-height: 44px;
}
.ne-continue:hover {
  background: linear-gradient(90deg, #0ff 0%, #0af 100%);
  color: #fff;
}
@media (max-width: 768px) {
  .ne-continue {
    margin: 28px auto 0 auto;
    font-size: 16px;
    min-width: 120px;
    padding: 12px 18px;
  }
}

/* Choices */
#ne-choices {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 8, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: clamp(12px, 2vh, 20px) clamp(16px, 4vw, 48px);
  display: none;
  flex-direction: column;
  gap: 6px;
}
#ne-choices.visible {
  display: flex;
}
.ne-choice-timer {
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
  border-radius: 1px;
  overflow: hidden;
}
.ne-choice-timer-bar {
  height: 100%;
  background: var(--pulse);
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--pulse);
}
.ne-choice-btn {
  display: flex;
  align-items: center;
  padding: clamp(12px, 1.8vh, 16px) clamp(14px, 2.5vw, 22px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "IM Fell English", serif;
  font-size: calc(clamp(13px, 1.9vw, 16px) * var(--large-text));
  font-style: italic;
  color: rgba(200, 200, 220, 0.75);
  min-height: 44px;
  text-align: left;
  width: 100%;
}
.ne-choice-btn:hover,
.ne-choice-btn:focus {
  border-left-color: var(--TOMA);
  background: rgba(0, 200, 255, 0.06);
  color: #fff;
}
.ne-choice-num {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--TOMA);
  width: 20px;
  flex-shrink: 0;
  margin-right: 12px;
}

/* QTE */
#ne-qte {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 5, 0.82);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
#ne-qte.visible {
  display: flex;
}
.qte-label {
  font-family: "Cinzel", serif;
  font-size: clamp(10px, 1.5vw, 14px);
  letter-spacing: 5px;
  color: var(--gold);
  margin-bottom: 28px;
  opacity: 0.7;
}
.qte-ring-wrap {
  position: relative;
  width: clamp(100px, 20vw, 160px);
  height: clamp(100px, 20vw, 160px);
  margin-bottom: 28px;
}
.qte-ring-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.qte-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
}
.qte-ring-prog {
  fill: none;
  stroke: var(--TOMA);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--TOMA));
}
.qte-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}
.qte-key {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(22px, 5vw, 42px);
  color: #fff;
  text-shadow: 0 0 20px var(--TOMA);
}
.qte-hint {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--ash);
}
.qte-arrows {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}
.qte-arrow-btn {
  width: clamp(52px, 10vw, 68px);
  height: clamp(52px, 10vw, 68px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 4vw, 28px);
  cursor: pointer;
  color: var(--TOMA);
  transition: all 0.2s;
}
.qte-arrow-btn:hover,
.qte-arrow-btn:active {
  background: rgba(0, 200, 255, 0.12);
  border-color: var(--TOMA);
}
.qte-result {
  margin-top: 20px;
  font-family: "Cinzel", serif;
  font-size: clamp(16px, 3vw, 24px);
  letter-spacing: 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ── PULSE FREQUENCY HACK minigame ── */
#ne-pulse-hack {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 8, 0.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  gap: clamp(12px, 2.5vh, 24px);
}
#ne-pulse-hack.visible {
  display: flex;
}
.hack-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(16px, 3vw, 28px);
  letter-spacing: 4px;
  color: var(--TOMA);
  text-shadow: 0 0 20px var(--TOMA);
}
.hack-subtitle {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--ash);
  opacity: 0.7;
}
.hack-canvas-wrap {
  position: relative;
  width: min(580px, 90vw);
  height: clamp(80px, 15vh, 120px);
  border: 1px solid rgba(0, 200, 255, 0.15);
  background: rgba(0, 10, 20, 0.6);
}
#hack-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hack-timer-wrap {
  width: min(580px, 90vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.hack-timer-bar {
  height: 100%;
  background: var(--pulse);
  box-shadow: 0 0 8px var(--pulse);
  transition: width 0.1s linear;
}
.hack-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(580px, 90vw);
}
.hack-slider-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.hack-slider-lbl {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--ash);
  width: 80px;
  flex-shrink: 0;
}
.hack-slider {
  appearance: none;
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}
.hack-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--TOMA);
  box-shadow: 0 0 10px var(--TOMA);
  cursor: pointer;
}
.hack-match {
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(12px, 2vw, 16px);
  letter-spacing: 3px;
  color: var(--gold);
}
.hack-result {
  font-family: "Cinzel", serif;
  font-size: clamp(18px, 3.5vw, 28px);
  letter-spacing: 4px;
  opacity: 0;
  transition: opacity 0.4s;
}

/* ── TOMA OVERLOAD (button mash) ── */
#ne-overload {
  position: absolute;
  inset: 0;
  background: rgba(8, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 26;
  gap: clamp(12px, 2.5vh, 20px);
  animation: screenShake 0s ease-in-out infinite;
}
#ne-overload.visible {
  display: flex;
}
#ne-overload.shaking {
  animation: screenShake 0.1s ease-in-out infinite;
}
@keyframes screenShake {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-3px, 2px);
  }
  50% {
    transform: translate(3px, -2px);
  }
  75% {
    transform: translate(-2px, -3px);
  }
  100% {
    transform: translate(2px, 3px);
  }
}
.overload-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(16px, 3.5vw, 32px);
  letter-spacing: 3px;
  color: var(--pulse);
  text-shadow: 0 0 20px var(--pulse);
}
.overload-sub {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(255, 100, 100, 0.6);
}
.overload-meter-wrap {
  width: min(400px, 80vw);
  height: clamp(14px, 2.5vh, 20px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 34, 68, 0.2);
  border-radius: 2px;
  overflow: hidden;
}
.overload-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pulse-d), var(--pulse));
  box-shadow: 0 0 12px var(--pulse);
  width: 0%;
  transition: width 0.05s linear;
}
.overload-btn {
  width: clamp(120px, 25vw, 200px);
  height: clamp(120px, 25vw, 200px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 34, 68, 0.12), transparent);
  border: 2px solid var(--pulse);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(40px, 10vw, 80px);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  user-select: none;
  -webkit-user-select: none;
}
.overload-btn:active {
  transform: scale(0.93);
  box-shadow:
    0 0 40px var(--pulse),
    inset 0 0 20px rgba(255, 34, 68, 0.2);
}
.overload-count {
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(255, 100, 100, 0.4);
}
.overload-result {
  font-family: "Cinzel", serif;
  font-size: clamp(18px, 3.5vw, 28px);
  letter-spacing: 4px;
  opacity: 0;
  transition: opacity 0.4s;
}

/* Toast */
#ne-toast {
  position: fixed;
  top: clamp(60px, 10vh, 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  font-family: "Cinzel", serif;
  font-size: clamp(10px, 1.6vw, 13px);
  letter-spacing: 3px;
  color: rgba(200, 200, 220, 0.85);
  background: rgba(0, 0, 10, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 2px solid var(--gold);
  padding: clamp(10px, 2vh, 14px) clamp(16px, 3vw, 24px);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
#ne-toast.show {
  opacity: 1;
}

/* Autosave indicator */
#autosave-indicator {
  position: fixed;
  bottom: clamp(60px, 8vh, 80px);
  right: clamp(16px, 3vw, 32px);
  z-index: 900;
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--TOMA);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
#autosave-indicator.show {
  opacity: 0.6;
}

/* Shared animations */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    pointer-events: none;
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ═══════════════════════════════════════════════════════════════
       CONVERSATION WINDOW + RELATIONS + NEW MINIGAMES (Mobile optimiert)
    ═══════════════════════════════════════════════════════════════ */
#ne-dialogue {
  display: flex;
  min-height: clamp(140px, 22vh, 220px);
  flex-direction: column;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
#ne-dialogue-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}
#ne-portrait {
  height: clamp(100px, 15vh, 140px);
  background: var(--surface);
  border-bottom: 1px solid rgba(0, 200, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
#ne-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    filter 0.4s,
    transform 0.6s;
}
#ne-history {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 95vw;
  height: 100%;
  background: rgba(0, 0, 8, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  overflow-y: auto;
  padding: 16px;
  z-index: 10;
}
#ne-history.open {
  transform: translateX(0);
}
.history-entry {
  margin-bottom: 14px;
  font-size: 13px;
  opacity: 0.85;
}
.history-speaker {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
}
@media (max-width: 768px) {
  #ne-history-btn {
    top: 75px !important;
    right: 10px !important;
    font-size: 9px !important;
    padding: 8px 12px !important;
    letter-spacing: 1px !important;
    background: rgba(0, 200, 255, 0.25) !important;
    border: 2px solid rgba(0, 200, 255, 0.6) !important;
  }
}
#ne-relations {
  display: flex;
  flex-direction: row;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 8, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-width: 768px) {
  #ne-relations {
    gap: 12px;
    padding: 10px;
    flex-direction: column;
  }
  .rel-label {
    font-size: 8px;
  }
  .rel-bar {
    width: 100%;
    max-width: 150px;
  }
}
.rel-bar {
  width: 120px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}
.rel-fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.rel-label {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--ash);
  margin-bottom: 2px;
}
/* Neue Minigames */
.minigame-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 5, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.minigame-overlay.visible {
  display: flex;
}
.echo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 95vw;
  max-width: 320px;
}
.echo-node {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(0, 200, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s;
}
.echo-node.active {
  border-color: var(--TOMA);
  box-shadow: 0 0 30px var(--TOMA);
  transform: scale(1.2);
}

@media (max-width: 700px) {
  #ne-dialogue {
    flex-direction: column;
    min-height: 120px;
    max-width: 100vw;
    margin: 0 auto;
    width: 100vw;
    box-sizing: border-box;
  }
  #ne-portrait {
    width: 100%;
    min-width: 0;
    height: 80px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 200, 255, 0.2);
    box-sizing: border-box;
  }
  #ne-text-area {
    padding: 12px 4vw 12px 4vw !important;
    max-width: 100vw;
    box-sizing: border-box;
    word-break: break-word;
  }
  #ne-relations {
    flex-direction: row;
    top: 50px;
    left: 6px;
    gap: 6px;
  }
  .rel-bar {
    width: 70px;
  }
  #ne-history {
    width: 98vw;
    padding: 8px;
    font-size: 12px;
  }
  .echo-grid {
    width: 98vw;
  }
  .echo-node {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}
/* ═══════════════════════════════════════════════════════════════
       WACKEL-EMOJIS ALS PORTRAIT-ERSATZ (Platzhalter-Bilder)
    ═══════════════════════════════════════════════════════════════ */
#ne-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0; /* entfernt alten img-Abstand */
  min-height: 220px;
  height: 120px;
  overflow: visible;
}

.portrait-emoji {
  font-size: 92px;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 0 25px var(--ac, var(--TOMA)));
  animation: emojiWobble 2.8s infinite ease-in-out;
  transition: transform 0.2s;
}

@keyframes emojiWobble {
  0%,
  100% {
    transform: rotate(-8deg) scale(0.95);
  }
  25% {
    transform: rotate(6deg) scale(1.03);
  }
  50% {
    transform: rotate(-5deg) scale(0.98);
  }
  75% {
    transform: rotate(7deg) scale(1.02);
  }
}

/* leichte Pause-Variante („ab und zu“ wackeln) */
.portrait-emoji.slow {
  animation-duration: 4.2s;
}
