.movement-toggle { position: fixed; bottom: 4vh; left: 4vw; z-index: 10000; width: min(18vw, 96px); height: min(18vw, 96px); transform: scale(1); pointer-events: auto; }
@media screen and (orientation: landscape) {
  .movement-toggle { bottom: 4vh; left: 4vw; }
}
@media screen and (orientation: portrait) {
  .movement-toggle { bottom: 6vh; left: 6vw; }
}
/* Shared overlay styles for MIFF zones */
.miff-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.72);
  border-radius: 10px;
  padding: 16px 18px;
  color: #e6edf3;
  max-width: 82%;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.miff-overlay h1,
.miff-overlay h2,
.miff-overlay h3 {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  margin: 0 0 8px 0;
}
.miff-overlay.miff-tile-bg {
  background-image: url("../maps/../..//assets/Isometric Blocks/isometric_0075.png");
  background-size: 96px 96px;
  background-repeat: repeat;
  background-blend-mode: multiply;
}
.miff-fade-in {
  animation: miffFadeIn 280ms ease-out;
}
@keyframes miffFadeIn {
  from { opacity: 0; transform: translate(-50%, -44%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.miff-btn {
  display: inline-block;
  padding: 8px 12px;
  background: #1f6feb;
  color: #fff;
  border: 1px solid #275ecf;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  margin-right: 8px;
}
.miff-btn.secondary {
  background: #21262d;
  border-color: #30363d;
}

/* --- Neon Arcade Splash & Start Menu --- */
.splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(180deg, #1a0033 0%, #000 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 3rem;
  color: #ff00cc;
  z-index: 9999;
  text-align: center;
}
.splash-screen .splash-title { text-shadow: 0 0 16px rgba(255,0,204,0.8), 0 0 32px rgba(88,166,255,0.5); letter-spacing: 2px; }
.splash-screen .splash-subtitle { margin-top: 12px; font-size: 1rem; opacity: 0.85; color: #d0d7de; }

.start-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: radial-gradient(100% 100% at 50% 0%, rgba(88, 166, 255, 0.2) 0%, rgba(0,0,0,0.9) 60%),
              linear-gradient(180deg, rgba(26,0,51,0.8) 0%, rgba(0,0,0,0.8) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  z-index: 9980;
  padding: max(3vh, env(safe-area-inset-top)) max(4vw, env(safe-area-inset-right)) max(3vh, env(safe-area-inset-bottom)) max(4vw, env(safe-area-inset-left));
}
.start-menu .start-menu-inner { width: 100%; max-width: min(560px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 3vh; }
.start-menu .start-title { font-size: clamp(28px, 6vw, 56px); color: #ff00cc; text-shadow: 0 0 16px rgba(255,0,204,0.8), 0 0 32px rgba(88,166,255,0.5); letter-spacing: 2px; text-align: center; }
.start-menu .start-subtitle { font-size: clamp(14px, 2.6vw, 20px); color: #d0d7de; opacity: 0.9; text-align: center; }
.start-menu .start-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(88vw, 520px); }
.start-menu .start-btn {
  background: rgba(0,0,0,0.2);
  border: 2px solid #ff00cc;
  color: #fff;
  font-size: clamp(16px, 4.5vw, 24px);
  padding: 14px 28px;
  border-radius: 10px;
  text-shadow: 0 0 6px #ff00cc;
  width: 100%;
  min-height: 48px;
}
.start-menu .start-btn.primary { border-color: #58a6ff; text-shadow: 0 0 6px #58a6ff; }
.start-menu .start-btn.remix { border-color: #00ffff; text-shadow: 0 0 6px #00ffff; }
.start-menu .start-btn:active { transform: translateY(1px); }

@media screen and (orientation: landscape) and (max-height: 440px) {
  .start-menu { padding: 2vh 12px; }
  .start-menu .start-actions { gap: 12px; }
  .start-menu .start-btn { padding: 10px 20px; }
}

/* Theme variants */
.start-menu.theme-sci-fi { background-blend-mode: screen; }
.start-menu.theme-medieval { font-family: 'Cinzel', serif; background: linear-gradient(180deg, #2a1f13 0%, #0b0a09 100%); }
.start-menu.theme-modern { font-family: system-ui, sans-serif; background: linear-gradient(180deg, #0b132b 0%, #000 100%); }

/* Medieval start menu */
.start-menu.medieval { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); z-index: 12000; }
.start-menu.medieval .medieval-card { background: url('../assets/ui/parchment.jpg'), #2a1f13; background-size: cover; font-family: 'Cinzel', serif; color: #3b2f1e; padding: clamp(16px, 4vw, 28px); border: 3px solid #8b5e3c; box-shadow: 0 0 20px #000; border-radius: 12px; width: min(96vw, 780px); box-sizing: border-box; }
.start-menu.medieval h1 { color: #3b2f1e; text-shadow: 0 1px 0 #fff3; margin: 0 0 12px 0; font-size: clamp(1.2rem, 4vw, 2rem); }
.start-menu.medieval .buttons { display: flex; flex-direction: column; gap: 10px; }
.start-menu.medieval button { background: #8b5e3c; color: #fff; border: none; padding: 0.6rem 1.2rem; margin: 0.2rem 0; font-size: clamp(1rem, 2.5vw, 1.5rem); border-radius: 8px; }
@media (max-width: 480px) {
  .start-menu.medieval button { font-size: 0.9rem; padding: 0.4rem 0.8rem; }
}

/* Modern start menu */
.start-menu.modern { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #0b132b 0%, #000 100%); z-index: 12000; padding: 4vh 4vw; }
.start-menu.modern .modern-card { background: #0e1a2a; border: 1px solid #1f2d3c; border-radius: 16px; width: min(92vw, 560px); padding: clamp(18px, 4vw, 28px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); color: #e6edf3; text-align: center; }
.start-menu.modern h1 { margin: 0 0 8px 0; font-size: clamp(22px, 6vw, 36px); }
.start-menu.modern .tag { opacity: 0.8; margin-bottom: 16px; font-size: clamp(12px, 3.2vw, 14px); }
.start-menu.modern .buttons { display: flex; flex-direction: column; gap: 12px; }
.start-menu.modern button { padding: 12px 16px; border-radius: 10px; border: 1px solid #2b3a4a; background: #19283a; color: #fff; font-size: clamp(14px, 4vw, 18px); }

/* Zone page themes on body */
.theme-grove .start-menu { background: linear-gradient(180deg, #1e2a18 0%, #0a0f08 100%); font-family: 'Cinzel', serif; }
.theme-spirit .start-menu { background: radial-gradient(circle at 50% 40%, rgba(0,120,255,0.25), rgba(0,0,0,0.9)); font-family: 'Orbitron', sans-serif; }
.theme-toppler .start-menu { background: linear-gradient(180deg, #1b1b1b 0%, #0a0a0a 100%), repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 6px); font-family: 'Press Start 2P', monospace; }

/* Persistent overlay manager */
.overlay {
  position: fixed;
  top: 10vh; left: 10vw;
  width: 80vw; height: auto;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 16px;
  border: 2px solid #ff00cc;
  border-radius: 10px;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.overlay h2 { margin: 0 0 8px 0; color: #ff86df; }
.overlay .close { position: absolute; top: 8px; right: 10px; background: transparent; border: 1px solid #ff00cc; color: #fff; border-radius: 6px; padding: 4px 8px; }

/* Procedural map debug hooks */
.map-debug { outline: 1px dashed rgba(88,166,255,0.4); }
.map-procedural { filter: saturate(1.1); }
.map-entity { box-shadow: 0 0 8px rgba(255,0,204,0.5); }