/* ═══════════════════════════════════════════════════
   HAVEN — прототип мини-игры
═══════════════════════════════════════════════════ */

.haven-tab-screen {
  padding: 0 !important;
  overflow: hidden !important;
  background: #0b0714;
}

/* Скрываем нижнюю панель навигации на время игры — больше места под сцену */
body.haven-active .nav-wrap {
  display: none !important;
}

.haven-game-wrap {
  position: absolute;
  inset: 0;
  background: #0b0714;
  overflow: hidden;
}

#haven-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.haven-exit-btn {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 5;
  background: rgba(11,7,20,.7);
  border: 1px solid rgba(111,233,255,.35);
  color: #eaf6ff;
  font-family: var(--ld-font-ui);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--ld-r-pill);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── HUD экономики ── */
.haven-hud {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11,7,20,.7);
  border: 1px solid rgba(111,233,255,.35);
  border-radius: var(--ld-r-pill);
  padding: 8px 10px;
  font-family: var(--ld-font-ui);
  font-size: 12px;
  font-weight: 700;
  color: #eaf6ff;
}
.haven-hud-row { white-space: nowrap; }
.haven-hud-collect {
  background: rgba(95,242,255,.15);
  border: 1px solid rgba(95,242,255,.5);
  color: #5ff2ff;
  font-family: var(--ld-font-ui);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--ld-r-pill);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.haven-hint {
  position: absolute;
  left: 0; right: 0; bottom: 148px;
  z-index: 4;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.haven-hint {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: #5ff2ff;
  background: rgba(11, 7, 20, 0.65);
  border: 1px solid rgba(95, 242, 255, 0.35);
  border-radius: 999px;
  padding: 9px 18px;
  text-shadow: 0 0 8px rgba(95, 242, 255, 0.8);
  text-align: center;
  animation: havenHintPulse 2.4s ease-in-out infinite;
  transition: opacity 1s ease;
}
@keyframes havenHintPulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.4; } }

/* ── Плашка "Расчистить завал" ── */
.haven-clear-prompt {
  position: absolute;
  left: 50%; bottom: 190px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.haven-clear-prompt-name {
  font-family: var(--ld-font-ui);
  font-weight: 800;
  font-size: 12px;
  color: #FFD2A0;
  text-shadow: 0 0 8px rgba(255, 154, 61, 0.6);
  white-space: nowrap;
}
.haven-clear-prompt-btn {
  animation: havenClearPillPulse 1.4s ease-in-out infinite;
  background: linear-gradient(135deg, #FF9A3D, #FF6A1A);
  color: #2a1400;
  font-family: var(--ld-font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.03em;
  padding: 11px 22px;
  border: none;
  border-radius: var(--ld-r-pill);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
@keyframes havenClearPillPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 153, 60, 0.35); }
  50%      { box-shadow: 0 0 26px rgba(255, 153, 60, 0.6); }
}

/* ── Виртуальный джойстик ── */
.haven-joystick {
  position: absolute;
  left: 50%; right: auto;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  transform: translateX(-50%);
  z-index: 6;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(11, 7, 20, 0.55);
  border: 1px solid rgba(95, 242, 255, 0.35);
  box-shadow: 0 0 24px rgba(95, 242, 255, 0.12), inset 0 0 20px rgba(95, 242, 255, 0.06);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.haven-joystick-knob {
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(95, 242, 255, 0.18);
  border: 1px solid rgba(95, 242, 255, 0.6);
  box-shadow: 0 0 14px rgba(95, 242, 255, 0.4);
  pointer-events: none;
  transition: transform .05s linear;
}

/* ── Диалог ── */
.haven-dialogue-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 9;
  padding: 14px;
  display: flex;
  justify-content: center;
}
.haven-dialogue-box {
  width: 100%;
  max-width: 480px;
  background: rgba(11, 7, 20, 0.92);
  border: 1px solid rgba(95, 242, 255, 0.4);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(95, 242, 255, 0.15), 0 8px 30px rgba(0,0,0,.5);
  padding: 16px 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.haven-dialogue-name {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #5ff2ff;
  text-shadow: 0 0 8px rgba(95, 242, 255, 0.7);
  margin-bottom: 8px;
}
.haven-dialogue-text {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #eaf6ff;
  min-height: 42px;
}
.haven-dialogue-next {
  margin-top: 10px;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(95, 242, 255, 0.55);
  animation: havenHintPulse 1.6s ease-in-out infinite;
}

/* ── Терминал (заглушка) ── */
.haven-terminal-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 3, 12, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.haven-terminal-box {
  width: 340px;
  max-width: calc(100vw - 48px);
  background: #0e0b1e;
  border: 1px solid rgba(95, 242, 255, 0.5);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(95, 242, 255, 0.25), inset 0 0 60px rgba(95, 242, 255, 0.05);
  padding: 22px;
  font-family: 'Courier New', monospace;
  color: #5ff2ff;
}
.haven-terminal-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  font-size: 14px; letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(95, 242, 255, 0.8);
}
.haven-terminal-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff3b30; box-shadow: 0 0 10px #ff3b30;
  display: inline-block;
}
.haven-terminal-body {
  border-top: 1px solid rgba(95, 242, 255, 0.25);
  padding: 16px 0;
  font-size: 12px; line-height: 1.8;
  color: rgba(95, 242, 255, 0.75);
}
.haven-terminal-close {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border: none;
  border-top: 1px solid rgba(95, 242, 255, 0.25);
  background: none;
  font-family: 'Courier New', monospace;
  font-size: 13px; letter-spacing: 1.5px;
  color: #5ff2ff;
  cursor: pointer;
}
.haven-terminal-close::before {
  content: '';
}

/* ── Предупреждение при входе ── */
.haven-warning-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4,3,10,.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity .2s ease, visibility .2s ease;
}
.haven-warning-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.haven-warning-box {
  width: 100%;
  max-width: 320px;
  background: #12101c;
  border: 1px solid rgba(111,233,255,.28);
  border-radius: var(--ld-r-card);
  box-shadow: var(--ld-shadow-soft);
  padding: 24px 20px 20px;
  text-align: center;
}
.haven-warning-icon { font-size: 40px; margin-bottom: 10px; }
.haven-warning-title {
  font-family: var(--ld-font-display);
  font-size: 17px;
  color: #fff;
  margin-bottom: 8px;
}
.haven-warning-text {
  font-family: var(--ld-font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ld-text-2);
  margin-bottom: 16px;
}
