/* ============================================================================
   «ЭТАЖ 13» — Стили (Советский постапокалипсис, адаптив ПК + Мобильные)
   Без внешних зависимостей (локальные системные технические шрифты)
   ============================================================================ */

:root {
  --bg-void: #080b09;
  --panel-dark: #151a17;
  --panel-metal: #222924;
  --panel-border: #3a443c;
  --rust: #6b3b23;
  --rust-light: #8f4e2e;
  --paint-green: #4c6252;
  --paint-yellow: #8c8252;
  --concrete: #4b524d;
  --nixie-amber: #ff9d3b;
  --nixie-glow: rgba(255, 145, 40, 0.55);
  --alert-red: #d93829;
  --alert-glow: rgba(217, 56, 41, 0.65);
  --safe-green: #58b368;
  --safe-glow: rgba(88, 179, 104, 0.55);
  --paper-bg: #d8cfa8;
  --paper-ink: #242119;
  --text-main: #d8dfd6;
  --text-dim: #8a968b;

  /* Шрифтовые стеки (100% автономные под модерацию Яндекс Игр) */
  --font-display: 'DIN Condensed', 'Arial Narrow', 'Impact', 'Helvetica Neue', Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;

  /* Безопасная зона под Sticky Banner Яндекс Игр */
  --sticky-banner-height: 0px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-body);
  overscroll-behavior: none;
}

/* ============================================================================
   1. ОСНОВНОЙ КОНТЕЙНЕР
   ============================================================================ */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
  background: radial-gradient(circle at center, #121814 0%, #070a08 100%);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.92);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: calc(var(--sticky-banner-height) + env(safe-area-inset-bottom, 0px));
}

/* ============================================================================
   2. ВЕРХНИЙ HUD (Табло этажа, Энергия, Архив, Звук)
   ============================================================================ */
.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 6px 12px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #242b26 0%, #141916 100%);
  border-bottom: 2px solid #0b0e0c;
  box-shadow:
    inset 0 1px 0 rgba(232, 198, 134, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 4px 14px rgba(0, 0, 0, 0.65);
  z-index: 25;
  flex-shrink: 0;
  position: relative;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.hud-group-left {
  flex: 1 1 auto;
  min-width: 0;
}

.hud-group-right {
  flex: 0 0 auto;
}

.floor-display {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  background: #0c0f0d;
  border: 1.5px solid #3c463e;
  border-radius: 6px;
  padding: 4px 10px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}

.floor-name-inline {
  font-family: var(--font-display);
  font-size: 13.5px;
  letter-spacing: 0.9px;
  color: #dbe3d7;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.floor-display:hover,
.floor-display:focus-visible {
  border-color: var(--nixie-amber);
  background: #131914;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 179, 71, 0.25);
  outline: none;
}

.floor-display:active {
  transform: scale(0.96);
}

.floor-map-caret {
  font-size: 11px;
  line-height: 1;
  color: var(--nixie-amber);
  opacity: 0.78;
  margin-left: -2px;
}

.floor-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.floor-number {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--nixie-amber);
  text-shadow: 0 0 8px var(--nixie-glow), 0 0 2px #fff;
  min-width: 28px;
  text-align: center;
}

.energy-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #0f1310;
  border: 1px solid #303a32;
  border-radius: 6px;
  padding: 5px 10px;
}

.energy-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.energy-bulbs {
  display: flex;
  gap: 5px;
}

.bulb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #222923;
  border: 2px solid #414d43;
  transition: all 0.3s ease;
}

.bulb.active {
  background: radial-gradient(circle at 35% 35%, #b9ffc4, #41a856 65%, #1e572a 100%);
  border-color: #77d487;
  box-shadow: 0 0 9px var(--safe-glow);
}

.bulb.low {
  background: radial-gradient(circle at 35% 35%, #ffb2a8, #d93829 65%, #66120b 100%);
  border-color: #f06d60;
  box-shadow: 0 0 10px var(--alert-glow);
  animation: pulseRed 1.2s infinite;
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

.hud-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  background: linear-gradient(180deg, #2d3630 0%, #1d231f 100%);
  border: 1px solid #48544b;
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  padding: 6px 11px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}

.hud-btn:hover {
  border-color: var(--nixie-amber);
  background: linear-gradient(180deg, #36413a 0%, #232b26 100%);
}

.hud-btn:active {
  transform: scale(0.96);
}

.hud-btn.muted {
  color: var(--text-dim);
  border-color: #323a34;
}

.hud-icon-svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ============================================================================
   3. ЦЕНТРАЛЬНАЯ 2.5D-СЦЕНА (Реалистичный фон + SVG + FX Canvas в одном блоке)
   ============================================================================ */
.stage-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090c0a;
  border-bottom: 2px solid #4c5848;
  touch-action: pan-y;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s ease;
}

.stage-wrapper.stage-zoomed {
  transform: scale(1.07);
  filter: blur(2.2px) brightness(0.76);
}

.stage-banner {
  display: none !important;
}

.stage-banner-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1.8px;
  color: #dce4d8;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Атмосферное Ambilight-свечение комнаты позади 16:9 кадра */
.scene-ambilight {
  position: absolute;
  inset: -16%;
  width: 132%;
  height: 132%;
  object-fit: cover;
  filter: blur(36px) saturate(1.18) brightness(0.34);
  opacity: 0.92;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

/* Контейнер 2.5D параллакса */
.parallax-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

.parallax-container.dragging {
  transition: none;
}

/* Единый 16:9 (1280x720) контейнер: фон + SVG-оверлей + FX-canvas всегда 1:1 */
.scene-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100%, calc(100% * 1.7778));
  max-height: 100%;
  max-width: 100%;
  background: #0d120f;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);
}

/* На широких экранах — вписываем по высоте/ширине */
@supports (aspect-ratio: 16 / 9) {
  .scene-stage {
    width: auto;
    height: 100%;
    max-width: 100%;
  }
}

.scene-stage.is-unlocking {
  transform: scale(1.045);
  filter: brightness(1.12);
  transition: transform 0.92s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
}

.scene-stage.fit-width {
  width: 100%;
  height: auto;
  max-height: 100%;
}

.scene-stage.portrait-pan {
  height: 100%;
  width: auto;
  max-width: none;
  max-height: none;
  flex-shrink: 0;
}

.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  filter: contrast(1.04) saturate(0.95);
  transition: opacity 0.25s ease;
}

.scene-bg.hidden {
  opacity: 0;
}

/* Лёгкий градиент глубины поверх реалистичного фона */
.scene-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 45%, rgba(6, 9, 7, 0.52) 100%);
  z-index: 2;
}

.scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 4;
}

.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: radial-gradient(ellipse at center, transparent 54%, rgba(4, 7, 5, 0.72) 100%);
}

/* Оверлей снятия засова при прохождении этажа */
.unlock-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.unlock-overlay.active {
  opacity: 1;
}

.unlock-beacon {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(102, 224, 130, 0.62);
  box-shadow:
    inset 0 0 44px rgba(88, 199, 108, 0.34),
    inset 0 0 14px rgba(255, 208, 118, 0.18);
  opacity: 0;
}

.unlock-overlay.active .unlock-beacon {
  animation: unlockBeaconPulse 0.96s ease-out forwards;
}

@keyframes unlockBeaconPulse {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0.48; }
}

.unlock-stamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 26px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(24, 31, 25, 0.94) 0%, rgba(12, 17, 13, 0.97) 100%);
  border: 2px solid #8c7640;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.82),
    inset 0 1px 0 rgba(255, 226, 158, 0.22),
    0 0 24px rgba(88, 199, 108, 0.28);
  text-align: center;
  transform: scale(1.12);
  opacity: 0;
}

.unlock-overlay.active .unlock-stamp {
  animation: unlockStampSnap 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes unlockStampSnap {
  0% {
    opacity: 0;
    transform: scale(1.18);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.unlock-stamp-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: #8af59d;
  text-shadow: 0 0 12px rgba(88, 224, 114, 0.55);
}

.unlock-stamp-title::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6ef587;
  box-shadow: 0 0 10px rgba(110, 245, 135, 0.95);
  flex-shrink: 0;
}

.unlock-stamp-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #e6d7ad;
  opacity: 0.92;
}

.shock-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 70, 45, 0.48);
  pointer-events: none;
  z-index: 16;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.shock-flash.active {
  opacity: 1;
  transition: none;
}

/* Индикаторы свайпа на узких портретных экранах (внизу, чтобы не перекрывать объекты) */
.pan-hint {
  position: absolute;
  bottom: 18px;
  z-index: 13;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(14, 18, 15, 0.82);
  border: 1px solid rgba(255, 157, 59, 0.5);
  color: var(--nixie-amber);
  font-size: 24px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  transition: opacity 0.2s, background 0.15s;
}

.pan-hint:active {
  background: rgba(32, 40, 34, 0.95);
}

.pan-hint.left { left: 12px; }
.pan-hint.right { right: 12px; }
.pan-hint.visible { display: flex; }
.pan-hint.disabled { opacity: 0.2; pointer-events: none; }

/* Диегетические фотореалистичные зоны клика (без контуров и рамок — только оптическая точка внимания) */
.diegetic-hotspot {
  cursor: pointer;
}

.diegetic-rim {
  display: none !important;
  opacity: 0 !important;
  stroke: none !important;
}

.diegetic-hotspot:hover .diegetic-hit,
.diegetic-hotspot:active .diegetic-hit,
.scene-svg.spotlight-active .diegetic-hit {
  fill: rgba(255, 255, 255, 0.001) !important;
}

/* Оптическая метка-маячок в центре интерактивного объекта (не ломает 3D-перспективу) */
.optic-beacon {
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.optic-beacon .optic-ring {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(0.76);
}

.optic-beacon .optic-pulse {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.diegetic-hotspot:hover .optic-beacon,
.diegetic-hotspot:active .optic-beacon {
  opacity: 0.96;
}

.diegetic-hotspot:hover .optic-beacon .optic-ring,
.diegetic-hotspot:active .optic-beacon .optic-ring {
  transform: scale(1);
}

.diegetic-hotspot:hover .optic-beacon .optic-pulse,
.diegetic-hotspot:active .optic-beacon .optic-pulse {
  animation: opticSonar 1.5s ease-out infinite;
}

@keyframes opticSonar {
  0% {
    opacity: 0.72;
    transform: scale(0.72);
  }
  100% {
    opacity: 0;
    transform: scale(1.68);
  }
}

.diegetic-glint {
  animation: diegeticPulse 3.4s ease-in-out infinite;
}

.item-glint {
  transform-box: fill-box;
  transform-origin: center;
  animation: itemGlintSpark 3.5s ease-in-out infinite;
}

@keyframes itemGlintSpark {
  0%, 62%, 100% {
    opacity: 0.08;
    transform: scale(0.55) rotate(0deg);
  }
  76% {
    opacity: 0.96;
    transform: scale(1.14) rotate(18deg);
  }
  88% {
    opacity: 0.18;
    transform: scale(0.72) rotate(32deg);
  }
}

.diegetic-led {
  animation: ledBreath 2.6s ease-in-out infinite;
}

@keyframes diegeticPulse {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.42; }
}

@keyframes ledBreath {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.92; }
}

/* Интерактивные зоны SVG */
.hotspot {
  cursor: pointer;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.hotspot:hover {
  filter: brightness(1.09) contrast(1.03);
}

.hotspot-pulse {
  animation: subtleGlow 2.8s ease-in-out infinite;
}

@keyframes subtleGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
}

.stage-toast {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(10, 14, 12, 0.88) 0%, rgba(7, 10, 8, 0.94) 100%);
  border: 1px solid rgba(130, 162, 134, 0.32);
  color: #eef3ea;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 14px;
  border-radius: 7px;
  z-index: 18;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  text-align: left;
  width: max-content;
  max-width: min(92%, 480px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.stage-toast::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58d672;
  box-shadow: 0 0 8px rgba(88, 214, 114, 0.9);
  flex-shrink: 0;
}

.stage-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Кнопки панорамирования и мини-карта на узком экране */
.pan-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 14;
  width: 34px;
  height: 52px;
  border-radius: 8px;
  background: rgba(12, 16, 13, 0.68);
  border: 1px solid rgba(224, 180, 96, 0.42);
  color: #f3cd78;
  font-size: 24px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  transition: opacity 0.2s, background 0.15s, transform 0.1s;
}

.pan-nav-btn.left { left: 8px; }
.pan-nav-btn.right { right: 8px; }
.pan-nav-btn.visible { display: flex; }
.pan-nav-btn.disabled { opacity: 0.2; pointer-events: none; }
.pan-nav-btn:active { transform: translateY(-50%) scale(0.94); background: rgba(28, 36, 30, 0.9); }

.pan-minimap {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 4px;
  border-radius: 999px;
  background: rgba(12, 16, 13, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 14;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.pan-minimap.visible {
  display: block;
}

.pan-thumb {
  height: 100%;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 174, 72, 0.72), rgba(255, 214, 130, 0.9));
  transition: transform 0.12s ease-out;
}

/* Тактильный отклик касания по сцене */
.tap-ripple {
  position: absolute;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  border: 1.5px solid rgba(236, 206, 146, 0.52);
  background: radial-gradient(circle, rgba(255, 215, 140, 0.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 17;
  animation: tapRippleFade 0.38s ease-out forwards;
}

@keyframes tapRippleFade {
  0% {
    transform: scale(0.35);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

/* Вводный экран 3.5с (Этаж 01) */
.opening-intro {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at center, #0e0607 0%, #040605 100%);
  cursor: pointer;
}

.opening-intro.open {
  display: flex;
  animation: fadeIn 0.28s ease-out;
}

.opening-intro-pulse {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 28%, rgba(217, 56, 41, 0.28), transparent 64%);
  animation: emergencyPulse 1.6s ease-in-out infinite;
}

@keyframes emergencyPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.88; }
}

.opening-intro-card {
  position: relative;
  max-width: 440px;
  text-align: center;
  padding: 20px 22px;
  border-radius: 8px;
  background: rgba(10, 12, 11, 0.88);
  border: 1px solid rgba(217, 56, 41, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.9), inset 0 0 24px rgba(217, 56, 41, 0.12);
}

.opening-intro-date {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: #ff9d66;
  margin-bottom: 10px;
  animation: fadeIn 0.6s ease-out;
}

.opening-intro-text {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: #e4ebe1;
  animation: fadeIn 1.1s ease-out;
}

.opening-intro-skip {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8a968b;
}

/* ============================================================================
   4. СТВОРКИ ЛИФТА (Массивные полноэкранные двери от потолка до пола)
   ============================================================================ */
.elevator-doors {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 65;
  pointer-events: none;
  display: flex;
  overflow: hidden;
  background: transparent;
}

.elevator-doors.active {
  pointer-events: all;
}

/* Верхняя массивная стальная балка-портал лифтовой шахты */
.elevator-doors::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(46px, 9dvh, 78px);
  z-index: 67;
  background:
    linear-gradient(180deg, #1b201c 0%, #101411 65%, #070907 100%);
  border-bottom: 3px solid #2b322c;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.88),
    inset 0 -2px 0 rgba(210, 178, 114, 0.16);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.3, 0.8, 0.2, 1);
  pointer-events: none;
}

.elevator-doors.active::before,
.elevator-doors.closed::before {
  opacity: 1;
  transform: translateY(0%);
}

.door-leaf {
  width: 50%;
  height: 100%;
  transition: transform 0.72s cubic-bezier(0.55, 0.04, 0.18, 1);
  position: relative;
  will-change: transform;
}

.door-leaf.left {
  transform: translateX(-104%);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.06) 24%, rgba(0, 0, 0, 0.08) 84%, rgba(0, 0, 0, 0.62) 100%),
    url('../assets/ui/elevator_door_left.webp?v=48') right center / auto 100% no-repeat,
    #1c221d;
  box-shadow:
    inset -10px 0 26px rgba(0, 0, 0, 0.9),
    inset 18px 0 36px rgba(0, 0, 0, 0.72);
  border-right: 4px solid #090b09;
}

.door-leaf.right {
  transform: translateX(104%);
  background:
    linear-gradient(270deg, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.06) 24%, rgba(0, 0, 0, 0.08) 84%, rgba(0, 0, 0, 0.62) 100%),
    url('../assets/ui/elevator_door_right.webp?v=48') left center / auto 100% no-repeat,
    #1c221d;
  box-shadow:
    inset 10px 0 26px rgba(0, 0, 0, 0.9),
    inset -18px 0 36px rgba(0, 0, 0, 0.72);
  border-left: 4px solid #090b09;
}

@media (min-width: 900px) {
  .door-leaf.left {
    background-size: 100% 100%, cover;
    background-position: center, right center;
  }
  .door-leaf.right {
    background-size: 100% 100%, cover;
    background-position: center, left center;
  }
}

.elevator-doors.closed .door-leaf.left,
.elevator-doors.closed .door-leaf.right {
  transform: translateX(0%);
}

.door-leaf::after {
  content: none;
}

/* Наддверное советское приборное табло этажа */
.elevator-status {
  position: absolute;
  top: clamp(64px, 12.5dvh, 112px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 68;
  min-width: 228px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #212420 0%, #111310 55%, #0a0c0a 100%);
  border: 2px solid rgba(196, 178, 134, 0.48);
  border-radius: 5px;
  padding: 10px 28px 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.28s ease;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.94),
    inset 0 0 0 2px rgba(8, 10, 8, 0.92),
    inset 0 1px 0 rgba(232, 198, 134, 0.18);
}

.elevator-doors.closed .elevator-status {
  opacity: 1;
}

.elevator-status-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  color: #cfc6ae;
  margin-bottom: 4px;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.9);
}

.elevator-status-num {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  color: #ffae42;
  text-shadow: 0 0 16px rgba(255, 162, 52, 0.68), 0 0 4px rgba(255, 210, 120, 0.8);
}

.shake-elevator {
  animation: elevatorShake 0.14s infinite;
}

@keyframes elevatorShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5px, 1px); }
  50% { transform: translate(1.5px, -1px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(1px, 1.5px); }
}

/* ============================================================================
   5. НИЖНИЙ ПУЛЬТ ЛИФТА (Подсказка + Пропустить + Безопасная зона Sticky Banner)
   ============================================================================ */
.hud-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 14px 12px;
  background:
    linear-gradient(180deg, rgba(16, 20, 17, 0.82) 0%, rgba(9, 12, 10, 0.96) 100%),
    url('../assets/ui/soviet_steel.webp') center / cover no-repeat;
  border-top: 2px solid #2b352d;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.86), 0 -2px 0 #070a08;
  z-index: 25;
  flex-shrink: 0;
  position: relative;
}

.hud-bottom::before,
.hud-bottom::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6d7870, #232824);
  border: 1px solid #0e110f;
  transform: translateY(-50%);
}
.hud-bottom::before { left: 12px; }
.hud-bottom::after { right: 12px; }

.console-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid #1e1810;
  color: #f4f1e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.88);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 0.08s, filter 0.18s, box-shadow 0.18s;
}

.console-btn:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.92);
}

.console-btn.hint-btn {
  background: linear-gradient(rgba(168, 126, 36, 0.52), rgba(110, 78, 18, 0.66)), url('../assets/ui/btn_metal_texture.webp?v=48') center / 100% 100% no-repeat;
  color: #fff6dc;
}

.console-btn.hint-btn:hover {
  filter: brightness(1.1);
}

.console-btn.skip-btn {
  background: linear-gradient(rgba(132, 34, 26, 0.58), rgba(84, 18, 14, 0.72)), url('../assets/ui/btn_metal_texture.webp?v=48') center / 100% 100% no-repeat;
  color: #fae6e3;
}

.console-btn.skip-btn:hover {
  filter: brightness(1.1);
}

.console-btn.confirm-armed {
  border-color: #f0a848;
  background: linear-gradient(180deg, #8b5a1e 0%, #57340d 100%);
  color: #fff3d4;
  box-shadow: 0 0 14px rgba(240, 168, 72, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation: confirmPulse 0.9s ease-in-out infinite;
}

@keyframes confirmPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

.ad-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(8, 11, 9, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f1e6;
  text-shadow: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ============================================================================
   6. МОДАЛЬНЫЕ ОКНА
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 7, 0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px 16px calc(16px + var(--sticky-banner-height) + env(safe-area-inset-bottom, 0px));
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.18s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: calc(90dvh - var(--sticky-banner-height));
  overflow-y: auto;
  background: linear-gradient(180deg, #212823 0%, #141916 100%);
  border: 1px solid rgba(196, 156, 86, 0.34);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(232, 198, 134, 0.12);
  position: relative;
}

.modal-card:not(.paper):not(.rust-plate) {
  background:
    linear-gradient(rgba(18, 22, 18, 0.88), rgba(12, 15, 12, 0.94)),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  border: 1px solid rgba(196, 156, 86, 0.34);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.92),
    inset 0 1px 0 rgba(232, 198, 134, 0.14),
    inset 0 0 28px rgba(0, 0, 0, 0.48);
}

.modal-card.paper {
  background-color: #d6c39c;
  background-image: linear-gradient(rgba(238, 224, 186, 0.30), rgba(224, 205, 162, 0.36)), url('../assets/ui/paper_texture.webp?v=49');
  background-position: center;
  background-size: 106% 106%;
  background-repeat: no-repeat;
  color: #1f170d;
  text-shadow: 0 1px 0 rgba(255, 246, 224, 0.35);
  border: 1px solid #6b5636;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.78), inset 0 0 28px rgba(74, 46, 14, 0.38);
  font-family: var(--font-mono);
}

.modal-card.paper .modal-text {
  color: #1f170d;
  text-shadow: 0 1px 0 rgba(255, 246, 224, 0.35);
}

.modal-card.rust-plate {
  background: linear-gradient(rgba(12, 16, 12, 0.34), rgba(10, 12, 10, 0.44)), url('../assets/ui/rust_plate_texture.webp?v=48') center / 100% 100% no-repeat;
  border: 1px solid #3a2b1c;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), inset 0 0 24px rgba(0, 0, 0, 0.48);
  color: #efe7d0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(138, 150, 139, 0.3);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.modal-card.paper .modal-header {
  border-bottom: 2px dashed rgba(37, 34, 26, 0.35);
}

.modal-card.rust-plate .modal-header {
  border-bottom: 1px solid rgba(240, 200, 130, 0.28);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--nixie-amber);
}

.modal-card.paper .modal-title {
  color: #3b2218;
  font-size: 20px;
}

.modal-card.rust-plate .modal-title {
  color: #f6be68;
  font-size: 20px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.88);
}

.modal-close {
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: inherit;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-close::after {
  content: '';
  position: absolute;
  inset: -7px;
}

.modal-close:hover {
  background: rgba(217, 56, 41, 0.35);
}

.modal-card.rust-plate .modal-close {
  background: rgba(15, 18, 15, 0.72);
  color: #efe7d0;
  border-color: rgba(240, 200, 130, 0.35);
}

.modal-card.rust-plate .modal-close:hover {
  background: rgba(217, 56, 41, 0.45);
}

.modal-card.rust-plate .modal-text {
  color: #f2e8cf;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.modal-card.rust-plate .plaque-digit {
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  color: #f6c46a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.92), 0 0 14px rgba(246, 196, 106, 0.35);
}

.modal-card.rust-plate .stamp {
  border-color: #ff7a59;
  color: #ff7a59;
  background: rgba(12, 16, 12, 0.48);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.modal-card.rust-plate .drawer-file-card {
  background: rgba(12, 16, 12, 0.56);
  border: 1px dashed rgba(246, 196, 106, 0.5);
  color: #f6c46a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.modal-text {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.stamp {
  display: inline-block;
  border: 2px solid #8f2d24;
  color: #8f2d24;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  padding: 2px 9px;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
  margin-bottom: 12px;
  opacity: 0.88;
}

.btn-primary {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #1e1810;
  background: linear-gradient(rgba(10, 20, 12, 0.16), rgba(8, 16, 10, 0.28)), url('../assets/ui/btn_metal_texture.webp?v=48') center / 100% 100% no-repeat;
  color: #f4f1e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.88);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: filter 0.15s, transform 0.08s;
}

.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px) scale(0.99); filter: brightness(0.92); }

.btn-secondary {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #48544b;
  background: #1b221d;
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-secondary:hover { background: #263029; }

/* ============================================================================
   7. КОДОВЫЙ ЗАМОК И СПЕЦ-ВИДЖЕТЫ
   ============================================================================ */
#modal-keypad .modal-card {
  background: linear-gradient(rgba(10, 14, 10, 0.14), rgba(8, 12, 8, 0.24)), url('../assets/ui/ui_keypad_panel.webp?v=48') center / 100% 100% no-repeat;
  border: none;
  border-radius: 10px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.9);
  padding: 54px 34px 56px;
}

#modal-keypad .modal-header,
#modal-bookshelf .modal-header,
#modal-scale .modal-header,
#modal-dials .modal-header,
#modal-workshop .modal-header,
#modal-hub .modal-header,
#modal-radio .modal-header,
#modal-settings .modal-header,
#modal-privacy .modal-header {
  border-bottom: none;
  padding-bottom: 4px;
  margin-bottom: 10px;
  gap: 10px;
  align-items: center;
}

#modal-keypad .modal-header {
  padding: 0;
  margin-bottom: 12px;
}

/* Советский приклёпанный алюминиевый шильдик ГОСТ 1986 для стальных приборов */
#modal-keypad .modal-title,
#modal-ch3 .modal-title,
#modal-clock .modal-title,
#modal-rings .modal-title,
#modal-bookshelf .modal-title,
#modal-scale .modal-title,
#modal-dials .modal-title,
#modal-workshop .modal-title,
#modal-hub .modal-title,
#modal-radio .modal-title,
#modal-settings .modal-title,
#modal-privacy .modal-title {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px 5px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(180deg, #272926 0%, #171916 52%, #111311 100%);
  border: 1px solid rgba(198, 194, 174, 0.45);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px rgba(14, 16, 14, 0.9),
    inset 0 0 0 3px rgba(196, 192, 172, 0.24),
    0 2px 6px rgba(0, 0, 0, 0.78),
    0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  text-transform: uppercase;
  color: #d6d0b8;
  text-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.95),
    0 1px 0 rgba(255, 250, 232, 0.14);
}

#modal-keypad .modal-title::before,
#modal-keypad .modal-title::after,
#modal-ch3 .modal-title::before,
#modal-ch3 .modal-title::after,
#modal-clock .modal-title::before,
#modal-clock .modal-title::after,
#modal-rings .modal-title::before,
#modal-rings .modal-title::after,
#modal-bookshelf .modal-title::before,
#modal-bookshelf .modal-title::after,
#modal-scale .modal-title::before,
#modal-scale .modal-title::after,
#modal-dials .modal-title::before,
#modal-dials .modal-title::after,
#modal-workshop .modal-title::before,
#modal-workshop .modal-title::after,
#modal-hub .modal-title::before,
#modal-hub .modal-title::after,
#modal-radio .modal-title::before,
#modal-radio .modal-title::after,
#modal-settings .modal-title::before,
#modal-settings .modal-title::after,
#modal-privacy .modal-title::before,
#modal-privacy .modal-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c8c1a8 0%, #6f6a59 55%, #2a2821 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
#modal-keypad .modal-title::before,
#modal-ch3 .modal-title::before,
#modal-clock .modal-title::before,
#modal-rings .modal-title::before,
#modal-bookshelf .modal-title::before,
#modal-scale .modal-title::before,
#modal-dials .modal-title::before,
#modal-workshop .modal-title::before,
#modal-hub .modal-title::before,
#modal-radio .modal-title::before,
#modal-settings .modal-title::before,
#modal-privacy .modal-title::before { left: 7px; }
#modal-keypad .modal-title::after,
#modal-ch3 .modal-title::after,
#modal-clock .modal-title::after,
#modal-rings .modal-title::after,
#modal-bookshelf .modal-title::after,
#modal-scale .modal-title::after,
#modal-dials .modal-title::after,
#modal-workshop .modal-title::after,
#modal-hub .modal-title::after,
#modal-radio .modal-title::after,
#modal-settings .modal-title::after,
#modal-privacy .modal-title::after  { right: 7px; }

#modal-keypad .modal-close,
#modal-ch3 .modal-close,
#modal-clock .modal-close,
#modal-rings .modal-close,
#modal-bookshelf .modal-close,
#modal-scale .modal-close,
#modal-dials .modal-close,
#modal-workshop .modal-close,
#modal-hub .modal-close,
#modal-radio .modal-close,
#modal-settings .modal-close,
#modal-privacy .modal-close {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(180deg, #3c3a32 0%, #22231e 65%, #161714 100%);
  border: 1px solid rgba(186, 178, 150, 0.42);
  color: #d6d0b8;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.9);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 2px rgba(0, 0, 0, 0.6);
}

#modal-keypad .modal-close:hover,
#modal-ch3 .modal-close:hover,
#modal-clock .modal-close:hover,
#modal-rings .modal-close:hover,
#modal-bookshelf .modal-close:hover,
#modal-scale .modal-close:hover,
#modal-dials .modal-close:hover,
#modal-workshop .modal-close:hover,
#modal-settings .modal-close:hover,
#modal-privacy .modal-close:hover {
  background: linear-gradient(180deg, #5c2a24 0%, #3b1915 100%);
  border-color: rgba(214, 150, 132, 0.55);
  color: #f4e6d8;
}

.keypad-screen {
  background: radial-gradient(ellipse at 50% 42%, #17120b 0%, #070806 100%);
  border: 2px solid #2b2419;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 32px;
  letter-spacing: 10px;
  color: var(--nixie-amber);
  text-shadow: 0 0 12px var(--nixie-glow), 0 0 22px rgba(255, 162, 48, 0.45);
  box-shadow:
    inset 0 4px 14px rgba(0, 0, 0, 0.96),
    inset 0 0 20px rgba(255, 168, 56, 0.14),
    0 1px 0 rgba(212, 178, 112, 0.22);
  margin-bottom: 14px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keypad-screen.error {
  color: var(--alert-red);
  text-shadow: 0 0 12px var(--alert-glow);
  border-color: var(--alert-red);
}

.keypad-screen.ok {
  color: var(--safe-green);
  text-shadow: 0 0 12px var(--safe-glow);
  border-color: var(--safe-green);
}

.keypad-hint-bar {
  background: rgba(10, 14, 11, 0.88);
  border: 1px solid rgba(176, 144, 84, 0.34);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #dcd6c2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.72);
}

.stencil-seq-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stencil-seq-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.key-btn {
  min-height: 50px;
  padding: 11px 8px;
  background: linear-gradient(180deg, #373d35 0%, #20251f 62%, #151915 100%);
  border: 1px solid rgba(188, 152, 86, 0.48);
  border-top-color: rgba(232, 198, 128, 0.6);
  border-radius: 6px;
  color: #f4e2b8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.88);
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 4px 0 #090b09,
    0 6px 10px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 234, 184, 0.16);
  transition: transform 0.06s, background 0.15s, box-shadow 0.06s;
}

.key-btn:hover { background: linear-gradient(180deg, #41483f 0%, #272d26 65%, #191e19 100%); }
.key-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #090b09, inset 0 2px 5px rgba(0, 0, 0, 0.65);
}

.key-btn.clear {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1px;
  color: #f6dcd0;
  background: linear-gradient(180deg, #642c24 0%, #3d1813 65%, #2a100c 100%);
  border-color: rgba(196, 118, 92, 0.56);
  border-top-color: rgba(235, 162, 134, 0.6);
}

.key-btn.enter {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1px;
  color: #dff5df;
  background: linear-gradient(180deg, #355c3d 0%, #1f3925 65%, #152819 100%);
  border-color: rgba(126, 186, 128, 0.55);
  border-top-color: rgba(176, 224, 170, 0.6);
}

.keypad-kbd-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* Дело №13 — Улики */
.archive-dossier-head {
  background: rgba(12, 16, 13, 0.86);
  border: 1px solid #3c483e;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.archive-dossier-stamp {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.1px;
  color: #9ab39d;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.archive-dossier-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #e6ede2;
  margin-bottom: 7px;
}

.archive-dossier-meta span:last-child {
  font-family: var(--font-mono);
  color: var(--nixie-amber);
}

.archive-progress-track {
  width: 100%;
  height: 6px;
  background: #0a0d0b;
  border: 1px solid #333e35;
  border-radius: 999px;
  overflow: hidden;
}

.archive-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4b8f59 0%, #ff9d3b 100%);
  transition: width 0.35s ease;
}

.archive-chapter-group {
  margin-bottom: 14px;
}

.archive-chapter-header {
  border-left: 3px solid var(--nixie-amber);
  padding-left: 10px;
  margin-bottom: 9px;
}

.archive-chapter-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1.2px;
  color: var(--nixie-amber);
  text-transform: uppercase;
}

.archive-chapter-sub {
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 2px;
}

.archive-teaser-card {
  background: rgba(14, 18, 15, 0.72);
  border: 1px dashed #4a594d;
  border-radius: 6px;
  padding: 11px 12px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.archive-teaser-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1.1px;
  color: #a9b8ab;
  margin-bottom: 4px;
}

.archive-teaser-body {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}

.archive-item {
  background: rgba(12, 16, 13, 0.72);
  border: 1px solid #344037;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.archive-item.locked {
  opacity: 0.45;
}

.archive-item-head {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--nixie-amber);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.archive-item-body {
  font-size: 13px;
  line-height: 1.45;
  color: #ccd4ca;
}

/* Симуляция рекламы Yandex Games */
.ad-overlay {
  position: fixed;
  inset: 0;
  background: #070908;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.ad-overlay.open {
  display: flex;
}

.ad-box {
  max-width: 380px;
  width: 100%;
  border: 2px solid #404a42;
  background: #141916;
  border-radius: 10px;
  padding: 24px 20px;
}

.ad-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #2b342d;
  border-top-color: var(--nixie-amber);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.ad-progress-bar {
  width: 100%;
  height: 6px;
  background: #232b26;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
}

.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--nixie-amber);
  transition: width 0.1s linear;
}

/* Тактильные микро-отклики экрана (работают и на ПК, и на iOS, и на Android) */
#app.haptic-shake {
  animation: hapticShake 0.24s ease-out;
}

#app.haptic-thud {
  animation: hapticThud 0.16s ease-out;
}

#app.haptic-success {
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.92), inset 0 0 28px rgba(88, 179, 104, 0.25);
}

@keyframes hapticShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-4px, 1px, 0); }
  45% { transform: translate3d(4px, -1px, 0); }
  70% { transform: translate3d(-2px, 1px, 0); }
}

@keyframes hapticThud {
  0%, 100% { transform: translate3d(0, 0, 0); }
  45% { transform: translate3d(0, 2.5px, 0); }
}

/* Режим «Резервный прожектор / Подсветка улик» (15 сек) — оптические маячки вместо рамок */
.scene-svg.spotlight-active .optic-beacon {
  opacity: 1 !important;
}

.scene-svg.spotlight-active .optic-beacon .optic-ring {
  transform: scale(1.06);
  stroke: rgba(255, 224, 152, 0.95);
}

.scene-svg.spotlight-active .optic-beacon .optic-pulse {
  animation: opticSonar 1.45s ease-out infinite;
}

/* Индикатор активной подсветки улик */
.spotlight-pill {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  background: rgba(26, 22, 12, 0.9);
  border: 1px solid rgba(255, 195, 85, 0.65);
  color: #ffe09e;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  display: none;
  pointer-events: none;
}

.spotlight-pill.active {
  display: block;
}

.dossier-hub-btn {
  position: relative;
  padding-right: 16px;
  border-color: #7d683b;
  background: linear-gradient(180deg, #352e20 0%, #1e1b13 100%);
  color: #f3df9b;
}

.dossier-hub-btn:hover {
  border-color: var(--nixie-amber);
  background: linear-gradient(180deg, #433a27 0%, #262217 100%);
}

.hub-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nixie-amber);
  box-shadow: 0 0 8px var(--nixie-glow);
  display: none;
}

.hub-dot.active {
  display: block;
}

/* Органайзер «ДЕЛО №13» (#modal-hub) и «РАЦИЯ ДИСПЕТЧЕРА» (#modal-radio) */
.hub-card {
  max-width: 430px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hub-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 104px;
  padding: 12px 10px;
  border-radius: 7px;
  border: 1px solid rgba(196, 156, 86, 0.36);
  background: linear-gradient(180deg, #272e29 0%, #161b18 100%);
  color: #edf2eb;
  cursor: pointer;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, 0.1), 0 4px 12px rgba(0, 0, 0, 0.52);
  transition: transform 0.1s, border-color 0.18s, background 0.18s;
}

.hub-tile:hover {
  border-color: var(--nixie-amber);
  background: linear-gradient(180deg, #313a34 0%, #1d241f 100%);
}

.hub-tile:active {
  transform: scale(0.97);
}

.hub-tile .daily-dot,
.hub-tile .archive-dot,
.hub-tile .workshop-dot {
  top: 8px;
  right: 8px;
}

.hub-tile-ico {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: rgba(10, 14, 11, 0.8);
  border: 1px solid rgba(196, 156, 86, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e7c272;
}

.hub-tile-ico .hud-icon-svg {
  width: 20px;
  height: 20px;
}

.hub-tile-ico .skill-prop-img {
  width: 24px;
  height: 24px;
}

.hub-tile-title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.9px;
  line-height: 1.15;
  color: #f3ead4;
  text-transform: uppercase;
}

.hub-tile-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--nixie-amber);
}

.radio-card {
  max-width: 390px;
  border-color: rgba(120, 178, 128, 0.42);
}

.radio-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #b7c6b8;
  margin-bottom: 12px;
  line-height: 1.4;
}

.radio-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.radio-actions .console-btn {
  width: 100%;
  justify-content: space-between;
  padding: 11px 14px;
}

.start-brand-header {
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.start-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.start-emblem {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid rgba(217, 174, 96, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 18px rgba(217, 174, 96, 0.14);
  background: #0b0e0d;
}

.start-brand-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.start-stamp-inline {
  align-self: flex-start;
  margin: 0 !important;
  font-size: 11px;
  padding: 2px 8px;
}

.start-lead {
  font-size: 14.5px;
  color: #eef3ec;
  margin-bottom: 8px;
}

.start-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* Кнопка жетонов и индикатор Смены дня в HUD */
.hud-btn.token-btn {
  border-color: #7d6f39;
  color: #f3df9b;
}

.hud-btn.daily-btn,
.hud-btn.archive-btn {
  position: relative;
}

.daily-dot,
.archive-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nixie-amber);
  box-shadow: 0 0 7px var(--nixie-glow);
  display: none;
}

.daily-dot.active,
.archive-dot.active {
  display: block;
}

/* Кнопка «Улики» на нижнем пульте */
.console-btn.spotlight-btn {
  background: linear-gradient(rgba(28, 62, 36, 0.42), rgba(14, 34, 18, 0.58)), url('../assets/ui/btn_metal_texture.webp?v=48') center / 100% 100% no-repeat;
  color: #eef5ee;
}

.console-btn.spotlight-btn:hover {
  filter: brightness(1.1);
}

.ad-tag.token-tag {
  background: rgba(18, 14, 6, 0.72);
  border: 1px solid rgba(255, 210, 110, 0.55);
  color: #ffd980;
}

/* Карточки в окне «Снабжение» (Магазин за Яны) */
.shop-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1411;
  border: 1px solid #3c473e;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.shop-item {
  background: rgba(14, 18, 15, 0.85);
  border: 1px solid #3c473e;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shop-item-info {
  flex: 1;
  min-width: 0;
}

.shop-item-title {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.8px;
  color: #edf2eb;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #8f2d24;
  color: #fce8e6;
}

.shop-item-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
  margin-top: 3px;
}

.shop-buy-btn {
  flex-shrink: 0;
  min-width: 78px;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #8a7a42;
  background: linear-gradient(180deg, #b5a35e 0%, #7d6f39 100%);
  color: #19170c;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.shop-buy-btn.owned {
  background: #232d25;
  border-color: #46634d;
  color: #7cc989;
  cursor: default;
}

/* Смена дня */
.daily-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px dashed rgba(37, 34, 26, 0.4);
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.25);
}

.daily-clues {
  list-style: none;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.daily-clues li {
  padding: 4px 0;
  border-bottom: 1px dotted rgba(37, 34, 26, 0.25);
}

.daily-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.daily-input {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  border: 2px solid #5e553b;
  border-radius: 5px;
  background: #f2ebd2;
  color: #242119;
}

/* Механический 3-кольцевой сейфовый замок со стетоскопом (Этаж 09) */
.ringlock-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.ringlock-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 6px;
  border-radius: 5px;
  border: 1px solid rgba(164, 146, 108, 0.36);
  background: linear-gradient(180deg, #252d27 0%, #141916 100%);
  color: #cdd6cc;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.7px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}

.ringlock-tab.active {
  border-color: #d9b468;
  background: linear-gradient(180deg, #3c311c 0%, #211b0f 100%);
  color: #f6e7c4;
  box-shadow: 0 0 10px rgba(217, 180, 104, 0.28);
}

.ringlock-tab.locked {
  border-color: rgba(108, 240, 136, 0.58);
  color: #b4f7c2;
}

.ring-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c5830;
  border: 1px solid #101411;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.65);
  flex-shrink: 0;
}

.ring-pin-dot.locked {
  background: #6cf088;
  border-color: #aefcc0;
  box-shadow: 0 0 8px rgba(108, 240, 136, 0.85);
}

.ringlock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ringlock-svg {
  width: 236px;
  height: 236px;
  max-width: 100%;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.72));
}

.ringlock-svg:active {
  cursor: grabbing;
}

.ring-dial-group {
  transition: transform 0.16s cubic-bezier(0.22, 0.9, 0.35, 1.1);
  transform-origin: 130px 130px;
}

.ring-dial-group.locked-ring {
  filter: drop-shadow(0 0 4px rgba(108, 240, 136, 0.35));
}

#ring-active-halo {
  transition: r 0.14s ease, stroke 0.16s ease;
  filter: drop-shadow(0 0 6px rgba(240, 190, 86, 0.5));
}

.ringlock-step-row {
  margin-top: 2px;
  margin-bottom: 2px;
}

/* Стальные панели Этажей 06 и 07 в #modal-ch3 */
.steel-switch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 10px;
  margin-bottom: 12px;
  border-radius: 7px;
  border: 1.5px solid rgba(196, 156, 86, 0.42);
  background:
    linear-gradient(180deg, rgba(22, 27, 23, 0.86) 0%, rgba(12, 15, 13, 0.94) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.78);
}

.steel-switch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  border-radius: 6px;
  border: 1.5px solid #49564b;
  background: linear-gradient(180deg, #272f29 0%, #151a16 100%);
  color: #e4eadf;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.steel-switch-btn:active {
  transform: scale(0.97);
}

.steel-switch-btn.on {
  border-color: #68e080;
  background: linear-gradient(180deg, #223b28 0%, #132317 100%);
  box-shadow: 0 0 12px rgba(104, 224, 128, 0.22);
}

.steel-switch-lamp {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d65548 0%, #7d1d15 65%, #3d0c08 100%);
  border: 1.5px solid #161a17;
  box-shadow: 0 0 6px rgba(214, 85, 72, 0.45);
}

.steel-switch-btn.on .steel-switch-lamp,
.breaker-btn.on .steel-switch-lamp {
  background: radial-gradient(circle at 35% 35%, #c7ffd2 0%, #4de06e 60%, #1d7532 100%);
  box-shadow: 0 0 12px rgba(104, 240, 128, 0.9);
}

.soviet-toggle-wrap {
  width: 42px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.soviet-toggle-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform: scaleY(-1);
  filter: drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.85)) brightness(0.78);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.steel-switch-btn.on .soviet-toggle-img,
.breaker-btn.on .soviet-toggle-img {
  transform: scaleY(1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85)) brightness(1.06);
}

.steel-switch-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #f0d799;
  letter-spacing: 1px;
}

.steel-switch-link {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #9eb0a1;
  text-align: center;
  line-height: 1.2;
}

.steel-switch-lever {
  width: 30px;
  height: 46px;
  border-radius: 4px;
  background: #0b0e0c;
  border: 1px solid #3f4a41;
  position: relative;
}

.steel-switch-lever::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  height: 20px;
  bottom: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #c9a458 0%, #7a5f26 100%);
  border: 1px solid #2d220c;
  transition: bottom 0.14s ease;
}

.steel-switch-btn.on .steel-switch-lever::after {
  bottom: 21px;
}

.f07-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.f07-slot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 6px;
  border: 1.5px solid #49564b;
  background: linear-gradient(180deg, #1b221d 0%, #101511 100%);
}

.f07-slot-socket {
  width: 100%;
  min-height: 62px;
  padding: 6px 4px;
  border-radius: 5px;
  border: 1.5px dashed #637266;
  background: #0b100d;
  color: #d6dfd2;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.f07-slot-socket.filled {
  border-style: solid;
  border-color: #d9b468;
  background: linear-gradient(180deg, #273228 0%, #172018 100%);
  color: #f6e7c4;
}

.f07-probe-btn {
  width: 100%;
  padding: 5px 4px;
  border-radius: 4px;
  border: 1px solid rgba(124, 186, 132, 0.45);
  background: linear-gradient(180deg, #223526 0%, #142117 100%);
  color: #b7ecc0;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.f07-probe-btn.active {
  border-color: #6cf088;
  box-shadow: 0 0 10px rgba(108, 240, 136, 0.35);
}

.f07-tray-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.f07-fuse-chip {
  padding: 8px 4px;
  border-radius: 5px;
  border: 1.5px solid #566358;
  background: linear-gradient(180deg, #242b26 0%, #151916 100%);
  color: #f2e4c2;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.f07-fuse-mini {
  width: 34px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.82));
}

.f07-fuse-chip.selected {
  border-color: #6cf088;
  box-shadow: 0 0 10px rgba(108, 240, 136, 0.42);
}

.f07-fuse-chip.used,
.f07-fuse-chip.missing {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ============================================================================
   7.5 ГЛАВА II — ВИДЖЕТЫ АРХИВА И БИБЛИОТЕКИ (Этажи 11–16)
   ============================================================================ */
/* Этаж 11: Папки в выдвинутом ящике картотеки */
.drawer-folders {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.drawer-folder-btn {
  padding: 10px 8px;
  border-radius: 5px;
  border: 2px solid #7d704c;
  background: linear-gradient(180deg, #e7deb9 0%, #cfc396 100%);
  color: #272216;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}

.drawer-folder-btn:hover {
  border-color: #8f2d24;
  background: #f2ead0;
}

.drawer-folder-btn {
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid #8a774b;
  background: linear-gradient(180deg, #f3e4bd 0%, #dcc68e 100%);
  color: #2f2314;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}

.drawer-folder-thumb {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.drawer-folder-btn.active {
  border-color: #8f2d24;
  background: #fff6d9;
  box-shadow: 0 0 0 2px rgba(143, 45, 36, 0.25);
}

.drawer-file-card {
  background: rgba(255, 250, 232, 0.72);
  border: 1px dashed #6e6445;
  border-radius: 5px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.drawer-dossier-preview {
  padding: 12px;
}

.drawer-dossier-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-dossier-hero {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(45, 25, 10, 0.45));
}

.drawer-dossier-meta {
  flex: 1;
  min-width: 0;
}

.drawer-dossier-tab {
  font-weight: 700;
  color: #3b2218;
  margin-bottom: 4px;
}

.drawer-dossier-code {
  margin-top: 10px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #7a241b;
  border-top: 1px dashed #7a6d4b;
  padding-top: 8px;
}

/* Этаж 22: Световой стол и обрывки пропуска */
.inv-torn-pass-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inv-torn-pass-img {
  clip-path: polygon(0% 4%, 72% 0%, 58% 36%, 88% 50%, 66% 78%, 92% 96%, 0% 100%);
}

.lightbox-stage {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 236, 178, 0.28) 0%, rgba(214, 176, 98, 0.14) 55%, rgba(26, 22, 14, 0.92) 100%),
    linear-gradient(180deg, #3c321d 0%, #1d180f 100%);
  border: 2px solid #8a7340;
  border-radius: 7px;
  padding: 18px 10px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 28px rgba(255, 220, 140, 0.25), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.lightbox-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.torn-corner-piece {
  position: relative;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 16px 4px 10px;
  text-align: center;
  overflow: hidden;
  transform: rotate(var(--piece-rot, 0deg));
  transition: transform 0.2s ease;
}

.torn-corner-piece.found {
  background:
    linear-gradient(135deg, rgba(246, 234, 198, 0.92) 0%, rgba(226, 204, 152, 0.94) 100%),
    url('../assets/ui/paper_texture.webp?v=48') center / cover no-repeat;
  border: 1.5px solid #6e5e3a;
  clip-path: polygon(2% 0%, 96% 4%, 100% 88%, 82% 100%, 48% 93%, 14% 100%, 0% 84%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.55);
}

.torn-corner-piece.missing {
  background: rgba(16, 14, 10, 0.68);
  border: 2px dashed #7c6f52;
}

.torn-corner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  pointer-events: none;
  filter: sepia(0.45);
}

.torn-corner-num {
  position: relative;
  z-index: 1;
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #4a3d22;
}

.torn-corner-piece.missing .torn-corner-num {
  color: #9c9278;
}

.torn-corner-digit {
  position: relative;
  z-index: 1;
  font-size: 32px;
  font-weight: 700;
  color: #7a241b;
  font-family: var(--font-mono);
  text-shadow: 0 1px 0 rgba(255, 250, 230, 0.6);
}

.torn-corner-digit.missing {
  color: #7a725b;
}

/* Этаж 23: Полка с 5 кожаными фолиантами */
.bookshelf-frame {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px 14px;
  background:
    linear-gradient(180deg, #160f09 0%, #261a10 82%, #4a311c 82%, #2c1c10 100%);
  border: 2px solid #5c422a;
  border-radius: 8px;
  box-shadow: inset 0 10px 26px rgba(0, 0, 0, 0.85);
  margin-bottom: 10px;
}

.book-spine {
  flex: 1;
  max-width: 64px;
  min-width: 48px;
  height: 184px;
  overflow: hidden;
  border-radius: 5px 5px 3px 3px;
  border: 2px solid rgba(255, 224, 155, 0.32);
  background: #1c120d;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.1),
    0 8px 14px rgba(0, 0, 0, 0.68);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 14px;
  position: relative;
  color: #f3d589;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.book-spine-img {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: auto;
  min-width: 192px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  transition: filter 0.2s ease;
}

.book-hue-I   { filter: saturate(1.1); }
.book-hue-II  { filter: hue-rotate(215deg) saturate(1.15) brightness(0.92); }
.book-hue-III { filter: hue-rotate(105deg) saturate(0.95) brightness(0.94); }
.book-hue-IV  { filter: hue-rotate(36deg) saturate(1.25) brightness(1.15); }
.book-hue-V   { filter: hue-rotate(-10deg) saturate(1.3) brightness(0.86); }

.book-spine:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 212, 120, 0.78);
}

.book-spine.selected {
  transform: translateY(-13px);
  border-color: #ffbe55;
  box-shadow: 0 0 20px rgba(255, 190, 85, 0.72), 0 12px 18px rgba(0, 0, 0, 0.72);
}

.book-spine.sorted {
  border-color: #6ce884;
  box-shadow: 0 0 16px rgba(88, 199, 108, 0.58);
}

.book-roman {
  position: relative;
  z-index: 1;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f7dc96;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.92), 0 0 8px rgba(0, 0, 0, 0.72);
}

.book-title-vert {
  position: relative;
  z-index: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #f3d589;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.75);
}

.bookshelf-status {
  text-align: center;
  font-size: 12px;
  color: var(--nixie-amber);
  min-height: 18px;
}

/* Этаж 24, 29, 30: Досье цензуры, армиллярная сфера и папки */
.dossier-mini-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dossier-mini-head.compact {
  margin-bottom: 6px;
}

.dossier-mini-thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(45, 25, 10, 0.45));
}

.dossier-mini-thumb.sm {
  width: 38px;
  height: 38px;
}

.redacted-seq-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.redacted-seq-grid.compact {
  margin: 4px 0 0;
  gap: 6px;
}

.redacted-sym-card {
  background: #efe6c4;
  border: 1px solid #6e6445;
  border-radius: 4px;
  padding: 8px 4px;
  text-align: center;
}

.redacted-sym-num {
  font-size: 10px;
  opacity: 0.78;
  margin-bottom: 3px;
}

.redacted-sym-ico {
  margin-bottom: 5px;
}

.redacted-ink-bar {
  height: 12px;
  background: #1c1a16;
  border-radius: 2px;
}

.armillary-pedestal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(196, 158, 88, 0.55);
  background:
    radial-gradient(circle at 50% 38%, rgba(64, 52, 30, 0.45) 0%, rgba(16, 20, 18, 0.96) 72%),
    linear-gradient(180deg, #1b221e 0%, #0e1210 100%);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.82), 0 6px 16px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.armillary-pedestal.compact {
  padding: 12px 12px 10px;
  margin-bottom: 10px;
}

.armillary-glow {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 170px;
  height: 170px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 208, 114, 0.24) 0%, rgba(255, 186, 80, 0) 72%);
  pointer-events: none;
}

.armillary-hero-img {
  position: relative;
  z-index: 1;
  width: 176px;
  height: 176px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.85));
}

.armillary-hero-img.sm {
  width: 142px;
  height: 142px;
}

.armillary-plaque {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid rgba(212, 174, 102, 0.65);
  background: linear-gradient(180deg, #322715 0%, #1c160c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 170, 0.18), 0 3px 8px rgba(0, 0, 0, 0.6);
}

.armillary-plaque-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #cdb37c;
  margin-bottom: 3px;
}

.armillary-cipher-line {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #ffe299;
  text-shadow: 0 0 10px rgba(255, 195, 86, 0.45);
}

.f20-dossier-inspect {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 0;
}

.f20-folder-visual {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.f20-folder-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(36, 22, 10, 0.52));
}

.f20-folder-img.is-draft {
  filter: grayscale(0.45) sepia(0.25) brightness(0.9) drop-shadow(0 8px 14px rgba(36, 22, 10, 0.45));
}

.f20-folder-emblem {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.f20-folder-stamp {
  margin-bottom: 8px;
}

.f20-folder-stamp.valid {
  border-color: #7a241b;
  color: #7a241b;
}

.f20-folder-digit {
  font-size: 46px;
  font-weight: 700;
  color: #7a241b;
  font-family: var(--font-mono);
  line-height: 1.05;
}

/* Этаж 25: Фотореалистичные латунные весы */
.scale-stage {
  position: relative;
  background: radial-gradient(circle at 50% 42%, #242b22 0%, #101511 100%);
  border: 1.5px solid #4c4632;
  border-radius: 8px;
  padding: 10px 8px 12px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.78);
}

.scale-eq-badge {
  width: fit-content;
  margin: 0 auto 4px;
  padding: 3px 12px;
  border-radius: 4px;
  border: 1px solid rgba(212, 174, 96, 0.55);
  background: linear-gradient(180deg, #2b2416 0%, #19150c 100%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f0cf84;
  text-align: center;
}

.scale-eq-badge.tilted {
  border-color: #ffbe55;
  color: #ffe09e;
  box-shadow: 0 0 10px rgba(255, 190, 85, 0.24);
}

.scale-viewport {
  position: relative;
  width: 268px;
  height: 244px;
  margin: 0 auto;
}

.scale-visual-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 24%;
  transition: transform 0.45s cubic-bezier(0.22, 1.28, 0.36, 1);
  pointer-events: none;
}

.scale-brass-img {
  width: 252px;
  height: 252px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.84));
}

.scale-pan-slot {
  position: absolute;
  top: 48%;
  width: 76px;
  min-height: 54px;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #f6e7c2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(0);
  transition: transform 0.45s cubic-bezier(0.22, 1.28, 0.36, 1), border-color 0.15s;
}

.scale-pan-slot.left { left: 4px; }
.scale-pan-slot.right { right: 4px; }
.scale-pan-slot.occupied {
  border-color: transparent;
  background: transparent;
}

.scale-pan-slot:hover {
  border-color: rgba(255, 210, 118, 0.32);
}

.scale-pan-slot.heavier { transform: translateY(12px); }
.scale-pan-slot.lighter { transform: translateY(-10px); }

.scale-pan-empty {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(212, 198, 158, 0.55);
}

.scale-pan-folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.scale-pan-folder-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85));
}

.scale-pan-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffe29e;
  background: rgba(28, 22, 12, 0.9);
  border: 1px solid rgba(216, 178, 98, 0.6);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

.scale-readout {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--nixie-amber);
  background: #101511;
  border: 1px solid #39443b;
  border-radius: 5px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.scale-folders {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.scale-folder-btn {
  padding: 8px 6px;
  border-radius: 6px;
  border: 1px solid #756541;
  background: linear-gradient(180deg, #4b412c 0%, #2c2619 100%);
  color: #f3e6c4;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.scale-folder-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}

.scale-folder-btn span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #ffd57a;
}

.scale-folder-btn.on-pan {
  border-color: #6ce884;
  background: linear-gradient(180deg, #324a36 0%, #1d2c20 100%);
}

/* Этаж 26: Бюро пропусков и 5 деревянных штемпелей */
.stamps-toolbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.stamp-tool-btn {
  padding: 6px 4px 5px;
  border-radius: 6px;
  border: 1.5px solid #6e5a3b;
  background: linear-gradient(180deg, rgba(64, 46, 26, 0.25) 0%, rgba(38, 26, 14, 0.42) 100%);
  color: #f7ebd2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s ease, filter 0.15s, border-color 0.15s;
}

.stamp-tool-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(32, 18, 8, 0.55));
}

.stamp-brass-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #2b1d0c;
  background: linear-gradient(180deg, #e7c97f 0%, #b58d3e 100%);
  border: 1px solid #6a4f1b;
  border-radius: 3px;
  padding: 1px 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.stamp-tool-btn:hover { filter: brightness(1.08); }
.stamp-tool-btn:active { transform: translateY(4px) scale(0.96); }
.stamp-tool-btn.stamp-press {
  animation: stampPress 0.28s cubic-bezier(0.22, 1.35, 0.36, 1);
}

@keyframes stampPress {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(7px) scale(0.93); }
  100% { transform: translateY(0) scale(1); }
}

.stamp-tool-btn.used {
  border-color: #3f6a47;
  background: linear-gradient(180deg, rgba(48, 84, 56, 0.3) 0%, rgba(28, 52, 34, 0.42) 100%);
}

.stamp-tool-btn.used .stamp-brass-tag {
  background: linear-gradient(180deg, #98e6a6 0%, #52a462 100%);
  border-color: #265630;
  color: #0e2412;
}

.stamps-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  background: rgba(255, 251, 236, 0.72);
  border: 1px dashed #6e6445;
  border-radius: 6px;
  padding: 10px;
  min-height: 120px;
}

.stamp-imprint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
  animation: stampPop 0.18s ease-out;
}

@keyframes stampPop {
  from { transform: scale(1.25); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}

/* Этажи 27 и 30: Советские бакелитовые поворотные переключатели */
.dials-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dial-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dial-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.9px;
  color: var(--text-dim);
  text-align: center;
}

.dial-knob.rotary-knob-btn {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid #2b302b;
  background: radial-gradient(circle at 50% 50%, #101411 0%, #1d231e 72%, #2a312c 100%);
  box-shadow:
    inset 0 3px 10px rgba(0, 0, 0, 0.9),
    0 6px 14px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(196, 176, 128, 0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dial-knob.rotary-knob-btn:hover {
  border-color: rgba(235, 192, 108, 0.65);
}

.rotary-collar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.rotary-tick {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 2px;
  height: 7px;
  margin-left: -1px;
  border-radius: 1px;
  background: rgba(226, 206, 152, 0.72);
  transform-origin: 50% 42px;
}

.rotary-knob-img {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  object-fit: contain;
  pointer-events: none;
  transform-origin: 50% 56%;
  transition: transform 0.2s cubic-bezier(0.22, 1.3, 0.36, 1);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.85));
}

.rotary-readout-plate {
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid #8a7038;
  background: linear-gradient(180deg, #3a2e18 0%, #211a0d 100%);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #ffd77a;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 232, 172, 0.2), 0 2px 5px rgba(0, 0, 0, 0.5);
}

.dial-arrows {
  display: flex;
  gap: 6px;
}

.dial-arrow {
  width: 36px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid #536156;
  background: linear-gradient(180deg, #323c35 0%, #1e2520 100%);
  color: #e6ede4;
  cursor: pointer;
  font-size: 12px;
}

/* Этаж 28: Сетка эвакуационного чертежа 7x7 (Советская синька) */
.maze-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background-color: #0e2c4d;
  background-image:
    linear-gradient(rgba(145, 205, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 205, 255, 0.14) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 8px;
  border: 2px solid #5da2dd;
  border-radius: 6px;
  box-shadow: inset 0 0 22px rgba(4, 16, 36, 0.85), 0 6px 16px rgba(0, 0, 0, 0.45);
  margin-bottom: 8px;
}

.maze-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(216, 238, 255, 0.62);
  border-radius: 3px;
  background: rgba(24, 68, 114, 0.82);
  color: #eef6ff;
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.05;
  padding: 1px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s;
}

.maze-cell.rubble {
  background: repeating-linear-gradient(45deg, #16375c 0 4px, rgba(214, 234, 255, 0.72) 4px 6px);
  border-color: rgba(214, 234, 255, 0.42);
  cursor: not-allowed;
}

.maze-cell.trail {
  background: rgba(42, 118, 92, 0.88);
  border-color: #82f0b8;
}
.maze-cell.start { background: #36566e; }
.maze-cell.kpp {
  background: #145b72;
  border-color: #70ebff;
  color: #ccf8ff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(112, 235, 255, 0.45);
}
.maze-cell.kpp.visited {
  background: #226c47;
  border-color: #79f59d;
  color: #cbffd9;
  box-shadow: 0 0 10px rgba(121, 245, 157, 0.55);
}
.maze-cell.exit {
  background: #962f26;
  border-color: #ff9c8a;
  font-weight: 700;
}
.maze-cell.current {
  background: radial-gradient(circle at 38% 32%, #ffe39e 0%, #e0a338 72%, #8b5b10 100%);
  border-color: #fff2c4;
  color: #2a1a08;
  font-size: 16px;
  box-shadow: 0 0 14px rgba(255, 200, 95, 0.92);
}

/* ============================================================================
   8. МОБИЛЬНАЯ КАБИНА ЛИФТА И АДАПТИВНОСТЬ (Всё в едином окне, без скролла!)
   ============================================================================ */
.mobile-cabin-header,
.mobile-cabin-deck {
  display: none !important;
}

/* Быстрый отклик на тач-устройствах: исключаем зум по двойному тапу и подсвечиваем касания */
button,
.diegetic-hotspot {
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .diegetic-glint {
    animation: diegeticPulseMobile 2.6s ease-in-out infinite;
  }
}

@keyframes diegeticPulseMobile {
  0%, 100% { opacity: 0.22; }
  50% { opacity: 0.56; }
}

/* Портретный режим на смартфонах: кристально чёткий 16:9 кадр в живом Ambilight-пространстве */
@media (max-width: 820px) and (orientation: portrait) {
  #app {
    background:
      linear-gradient(180deg, #0c100d 0%, #070a08 100%);
  }

  .stage-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    aspect-ratio: auto;
    overflow: hidden;
    background: #070a08;
    border-bottom: 1px solid rgba(130, 146, 126, 0.28);
    touch-action: manipulation;
  }

  .scene-stage {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    max-height: 100%;
    border-top: 1px solid rgba(226, 198, 140, 0.22);
    border-bottom: 1px solid rgba(226, 198, 140, 0.22);
    box-shadow:
      0 20px 64px rgba(0, 0, 0, 0.88),
      0 -12px 44px rgba(0, 0, 0, 0.65);
  }

  .pan-nav-btn,
  .pan-minimap {
    display: none !important;
  }

  .stage-toast {
    bottom: 20px;
    font-size: 12.5px;
    padding: 7px 14px;
    max-width: 92%;
  }

  .spotlight-pill {
    top: 12px;
    font-size: 10px;
    padding: 3px 10px;
  }
}

@media (max-width: 640px) {
  .hud-top {
    min-height: 46px;
    padding: 5px 8px;
    padding-top: calc(5px + env(safe-area-inset-top, 0px));
    gap: 5px;
  }

  .floor-display { padding: 4px 8px; gap: 5px; }
  .floor-label, .energy-label { display: none; }
  .floor-number { font-size: 17px; min-width: 22px; }
  .floor-name-inline { font-size: 12px; max-width: 112px; letter-spacing: 0.5px; }
  .energy-box { padding: 4px 7px; }
  .bulb { width: 10px; height: 10px; }
  .hud-btn { padding: 5px 8px; font-size: 12px; gap: 4px; min-height: 34px; }
  .hud-btn .hud-text-hide-sm { display: none; }
  .hud-bottom::before, .hud-bottom::after { display: none; }

  .console-btn {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    gap: 6px;
    white-space: nowrap;
  }
  .ad-tag {
    font-size: 9.5px;
    padding: 2px 5px;
  }

  .modal-card {
    padding: 16px;
    max-height: 92dvh;
  }

  #modal-keypad .modal-card {
    padding: 52px 32px 54px;
  }
  #modal-keypad .modal-title,
#modal-workshop .modal-title,
#modal-settings .modal-title,
#modal-privacy .modal-title {
  font-size: 12px;
  letter-spacing: 1.4px;
  padding: 5px 18px 4px;
}
  #modal-keypad .key-btn {
    min-height: 50px;
    font-size: 22px;
  }

  .stage-banner-title { font-size: 13px; }
  .keypad-kbd-hint { display: none; }

  .unlock-stamp {
    padding: 8px 16px;
  }
  .unlock-stamp-title {
    font-size: 18px;
    letter-spacing: 1.6px;
  }
  .unlock-stamp-sub {
    font-size: 10px;
    letter-spacing: 1px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .mobile-cabin-header,
  .mobile-cabin-deck {
    display: none !important;
  }
  .hud-top { padding: 4px 10px; }
  .hud-bottom { padding: 6px 12px; }
  .console-btn { min-height: 36px; padding: 6px 14px; font-size: 14px; }
  .stage-banner { top: 6px; padding: 2px 10px; }
  .stage-banner-title { font-size: 12px; }
  .studio-splash {
    gap: 12px;
    padding: 14px;
  }
  .studio-splash-logo {
    max-height: 54dvh;
    width: auto;
  }
}

/* ============================================================================
   11. СТАРТОВАЯ ЗАСТАВКА СТУДИИ (REWINDRA STUDIO)
   ============================================================================ */
.studio-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0f000c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.48s ease, visibility 0.48s ease;
  cursor: pointer;
}

.studio-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.studio-splash-logo {
  width: min(72vw, 320px);
  max-height: 58dvh;
  height: auto;
  object-fit: contain;
  animation: splashLogoIn 0.65s ease-out both;
}

@keyframes splashLogoIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.studio-splash-loader {
  width: min(56vw, 200px);
  height: 2px;
  background: rgba(255, 205, 130, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.studio-splash-bar {
  height: 100%;
  width: 12%;
  background: linear-gradient(90deg, #c97a63 0%, #ffd588 100%);
  box-shadow: 0 0 10px rgba(255, 200, 120, 0.7);
  transition: width 0.35s ease;
}

.studio-splash-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: rgba(244, 214, 172, 0.65);
}

.studio-credit {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 12px;
  opacity: 0.55;
  letter-spacing: 2.5px;
}

/* ============================================================================
   12. НАСТРОЙКИ КАБИНЫ (Тумблеры в советском приборном стиле)
   ============================================================================ */
.modal-settings-btn {
  color: var(--text-main);
  border-color: #48544b;
  background: linear-gradient(180deg, #2b342e 0%, #1a201c 100%);
}

.modal-settings-btn:hover {
  border-color: var(--nixie-amber);
  color: var(--nixie-amber);
  background: linear-gradient(180deg, #354039 0%, #222924 100%);
}

.settings-card {
  max-width: 430px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #191f1b 0%, #121714 100%);
  border: 1px solid #354038;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.settings-row-col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.settings-info {
  min-width: 0;
  flex: 1;
}

.settings-label {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-main);
  line-height: 1.2;
}

.settings-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.soviet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 86px;
  min-height: 44px;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid #445047;
  background: linear-gradient(180deg, #242b26 0%, #161b17 100%);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.soviet-toggle:active {
  transform: scale(0.97);
}

.soviet-toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 4px;
  background: #0b0e0c;
  border: 1px solid #3a443c;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.soviet-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #8b968c 0%, #505851 100%);
  border: 1px solid #1b201c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s, box-shadow 0.18s;
}

.soviet-toggle-state {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  min-width: 30px;
  text-align: center;
}

.soviet-toggle.active {
  border-color: #5b8264;
  color: #d9f2dd;
  background: linear-gradient(180deg, #27362b 0%, #18221a 100%);
}

.soviet-toggle.active .soviet-toggle-track {
  border-color: #4f7d58;
  background: #102014;
}

.soviet-toggle.active .soviet-toggle-knob {
  transform: translateX(14px);
  background: linear-gradient(180deg, #ffbe6b 0%, #d97c24 100%);
  box-shadow: 0 0 8px rgba(255, 157, 59, 0.75);
}

.settings-test-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #6b5835;
  background: linear-gradient(180deg, #4b3f27 0%, #2d2617 100%);
  color: #f7dfb0;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s;
}

.settings-test-btn:hover {
  filter: brightness(1.12);
}

.settings-test-btn:active {
  transform: scale(0.96);
}

.settings-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-volume-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--nixie-amber);
  text-shadow: 0 0 6px rgba(255, 145, 40, 0.35);
}

.soviet-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  background: transparent;
  cursor: pointer;
}

.soviet-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #d97c24 0%, #ff9d3b var(--slider-pct, 72%), #0c100d var(--slider-pct, 72%), #0c100d 100%);
  border: 1px solid #3c463e;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
}

.soviet-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d9e0d7 0%, #7d897e 100%);
  border: 2px solid #161b17;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

.soviet-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #0c100d;
  border: 1px solid #3c463e;
}

.soviet-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d9e0d7 0%, #7d897e 100%);
  border: 2px solid #161b17;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

.settings-feedback {
  min-height: 18px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #9ce0a9;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.settings-feedback.show {
  opacity: 1;
}

.settings-divider {
  height: 1px;
  background: rgba(138, 150, 139, 0.25);
  margin: 10px 0 12px;
}

.settings-reset-btn {
  margin-top: 0;
  min-height: 44px;
  border-color: #5a342e;
  background: linear-gradient(180deg, #2d1b18 0%, #1d1210 100%);
  color: #f0cbc4;
}

.settings-reset-btn:hover {
  background: linear-gradient(180deg, #3c231f 0%, #271714 100%);
}

.settings-reset-btn.confirm-armed {
  border-color: #d93829;
  background: linear-gradient(180deg, #9c3328 0%, #6b1e16 100%);
  color: #fff2ef;
  box-shadow: 0 0 14px rgba(217, 56, 41, 0.4);
}

.settings-version {
  margin-top: 12px;
  opacity: 0.72;
}

.settings-support {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(11, 15, 12, 0.88);
  border: 1px solid #354038;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}

.settings-support-title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.4px;
  color: var(--nixie-amber);
}

.settings-support-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #dbe3d7;
  user-select: text;
  -webkit-user-select: text;
}

.settings-support-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.settings-support-btn,
.settings-support-mailto {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid #48544b;
  background: linear-gradient(180deg, #27302a 0%, #181f1a 100%);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.7px;
  text-decoration: none;
  cursor: pointer;
}

.settings-support-btn:hover,
.settings-support-mailto:hover {
  border-color: var(--nixie-amber);
}

.settings-cloud-btn {
  margin-bottom: 8px;
  min-height: 44px;
  border-color: #4f7858;
  background: linear-gradient(180deg, #213726 0%, #152418 100%);
  color: #c7f0cf;
}

.settings-cloud-btn:hover {
  background: linear-gradient(180deg, #2a4731 0%, #1b2f1f 100%);
}

.settings-privacy-btn {
  margin-top: 8px;
  min-height: 40px;
  font-size: 13px;
  opacity: 0.88;
}

.shop-restore-btn {
  margin-top: 4px;
  min-height: 42px;
  border-color: #546657;
  background: linear-gradient(180deg, #232d26 0%, #171e19 100%);
  color: #dce6dc;
}

/* Быстрый переход по главам в настройках (скрыт по умолчанию, доступен с ?debug=1) */
.settings-chapters {
  display: none;
  margin-bottom: 12px;
}

.settings-chapters-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 7px;
  text-align: center;
}

.settings-chapters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.settings-chapter-btn {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid #48544b;
  background: linear-gradient(180deg, #27302a 0%, #19201b 100%);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.settings-chapter-btn:hover {
  border-color: var(--nixie-amber);
  background: linear-gradient(180deg, #323e36 0%, #202922 100%);
}

.settings-chapter-btn:active {
  transform: scale(0.97);
}

/* ============================================================================
   13. ПОСТОЯННАЯ ДОСКА ПРЕДМЕТОВ (#inventory-dock) И ОКНО ПРИБОРОВ (#modal-ch3)
   ============================================================================ */
.inventory-dock {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 5px 14px;
  background:
    linear-gradient(180deg, rgba(28, 35, 30, 0.96) 0%, rgba(17, 22, 18, 0.98) 100%),
    url('../assets/ui/soviet_steel.webp') center / cover no-repeat;
  border-bottom: 1px solid #090c0a;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  z-index: 24;
}

.inventory-dock-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 184px;
  flex-shrink: 0;
}

.inventory-dock-title {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #ffb84d;
  background: rgba(10, 14, 11, 0.85);
  border: 1px solid rgba(255, 179, 71, 0.38);
  border-radius: 4px;
  padding: 1px 7px;
  line-height: 1.2;
}

.dock-title-full { display: inline; }
.dock-title-short { display: none; }

.inventory-dock-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #96a898;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-dock.has-items .inventory-dock-hint {
  color: #9ae8aa;
}

/* Скрываем пустые слоты на этажах, где подбираемых предметов нет */
.inventory-dock.dock-unused {
  display: none !important;
}

@media (min-width: 960px) and (min-height: 520px) {
  .inventory-dock.dock-unused {
    display: flex !important;
  }
  .inventory-dock.dock-unused .inventory-dock-head,
  .inventory-dock.dock-unused .inventory-slots {
    display: none !important;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .inventory-dock.dock-unused {
    display: flex !important;
  }
  .inventory-dock.dock-unused .inventory-dock-head,
  .inventory-dock.dock-unused .inventory-slots {
    display: none !important;
  }
}

.inventory-slots {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  height: 40px;
}

.inv-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 100%;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  transition: transform 0.12s, border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.inv-slot.empty {
  background: linear-gradient(180deg, #0d120f 0%, #121814 100%);
  border: 1.5px dashed rgba(138, 152, 140, 0.28);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.78);
}

.inv-slot-empty-dot {
  font-size: 18px;
  line-height: 1;
  color: rgba(168, 184, 170, 0.28);
}

.inv-slot.filled {
  background: linear-gradient(180deg, #213226 0%, #142018 100%);
  border: 1.5px solid rgba(232, 190, 88, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 145, 0.24),
    0 0 12px rgba(108, 220, 140, 0.16),
    0 2px 8px rgba(0, 0, 0, 0.58);
  color: #f4e6be;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  text-align: left;
}

.inv-slot.filled:hover {
  border-color: #ffd36e;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 170, 0.34),
    0 0 14px rgba(255, 196, 88, 0.34);
}

.inv-slot.filled:active {
  cursor: grabbing;
  transform: scale(0.97);
}

.inv-slot.selected {
  border-color: #6cf088;
  background: linear-gradient(180deg, #284b31 0%, #172f1e 100%);
  box-shadow:
    0 0 14px rgba(108, 240, 136, 0.5),
    inset 0 1px 0 rgba(216, 255, 224, 0.32);
  color: #e2ffe8;
}

.inv-slot-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.inv-prop-img,
.skill-prop-img,
.workshop-prop-img {
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.82)) contrast(1.06) saturate(0.92) sepia(0.08);
}

.inv-prop-img {
  width: 28px;
  height: 28px;
}

.inv-svg-ico {
  width: 26px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.78));
}

.skill-prop-img {
  width: 22px;
  height: 22px;
}

.workshop-prop-img {
  width: 26px;
  height: 26px;
}

.workshop-svg-ico {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.78));
}

.mini-gear-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -3px;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.78)) contrast(1.06) saturate(0.92) sepia(0.08);
}

.mini-bat-svg {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  flex-shrink: 0;
}

.brass-ui-svg {
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.anomaly-bolt-svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.inv-slot-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 820px) and (orientation: portrait) {
  .inventory-dock {
    flex: 0 0 auto;
    height: 42px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 4px 10px;
    background:
      linear-gradient(180deg, rgba(20, 26, 22, 0.94) 0%, rgba(13, 17, 14, 0.98) 100%),
      url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.72);
  }

  .inventory-dock.has-items {
    height: 46px;
  }

  .inventory-dock-head {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    width: auto;
    gap: 0;
  }

  .inventory-dock-title {
    font-size: 10.5px;
    letter-spacing: 0.9px;
    padding: 2px 6px;
  }

  .dock-title-full { display: none; }
  .dock-title-short { display: inline; }

  .inventory-dock-hint {
    display: none;
  }

  .inventory-slots {
    flex: 1;
    height: 32px;
    gap: 6px;
  }

  .inventory-dock.has-items .inventory-slots {
    height: 36px;
  }

  .inv-slot {
    flex-direction: row;
    justify-content: center;
    gap: 4px;
    min-height: 0;
    max-height: none;
    height: 100%;
    padding: 2px 5px;
    text-align: left;
  }

  .inv-slot-ico {
    min-height: 0;
  }

  .inv-prop-img {
    width: 22px;
    height: 22px;
  }

  .inv-svg-ico {
    width: 20px;
    height: 20px;
  }

  .inv-slot-name {
    font-size: 9.5px;
    line-height: 1.1;
    -webkit-line-clamp: 1;
    text-align: left;
  }
}

.ch3-card {
  max-width: 450px;
}

.ch3-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 12px;
  text-align: center;
}

/* 21: Картотека (советские оливково-стальные ящики с латунными ручками) */
.ch3-drawers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.soviet-drawers-grid {
  padding: 10px;
  border-radius: 7px;
  border: 1.5px solid rgba(178, 146, 84, 0.4);
  background:
    linear-gradient(180deg, rgba(24, 30, 24, 0.88) 0%, rgba(12, 16, 13, 0.95) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.82);
}

.soviet-drawer-btn {
  position: relative;
  min-height: 76px;
  padding: 9px 10px 8px;
  border-radius: 5px;
  border: 1.5px solid #596352;
  background:
    linear-gradient(180deg, #4b5644 0%, #363f31 52%, #242b21 100%);
  box-shadow:
    inset 0 1px 0 rgba(220, 228, 198, 0.18),
    inset 0 -3px 6px rgba(0, 0, 0, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.52);
  color: #ece9d8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: border-color 0.15s, transform 0.08s, filter 0.15s;
}

.soviet-drawer-btn:hover { border-color: #d6ac5a; filter: brightness(1.06); }
.soviet-drawer-btn:active { transform: scale(0.97); }
.soviet-drawer-btn.checked { opacity: 0.58; border-color: #394035; filter: saturate(0.75); }
.soviet-drawer-btn.found {
  border-color: #6ce884;
  background: linear-gradient(180deg, #35543a 0%, #213726 100%);
  box-shadow: 0 0 14px rgba(108, 232, 132, 0.25), inset 0 1px 0 rgba(200, 255, 210, 0.2);
}

.soviet-drawer-plate {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 96px;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid #91763d;
  background: linear-gradient(180deg, #d7b774 0%, #a58442 54%, #7b602b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 204, 0.45), 0 1px 3px rgba(0, 0, 0, 0.65);
}

.soviet-drawer-rivet {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f5e2ae 0%, #523e18 100%);
}

.soviet-drawer-code {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #1e1609;
  text-shadow: 0 1px 0 rgba(255, 242, 200, 0.4);
}

.soviet-drawer-handle {
  width: 56px;
  height: 8px;
  border-radius: 4px;
  border: 1px solid #4d3a18;
  background: linear-gradient(180deg, #e0bd70 0%, #9b7a38 55%, #5c451b 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.72), inset 0 1px 1px rgba(255, 245, 210, 0.45);
}

.soviet-drawer-state {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.7px;
  color: #cdd6c3;
}

.soviet-drawer-btn.found .soviet-drawer-state { color: #a7f5b4; font-weight: 700; }

.ch3-drawer-btn {
  min-height: 58px;
  padding: 10px;
  border-radius: 6px;
  border: 2px solid #48544b;
  background: linear-gradient(180deg, #2a332d 0%, #19201b 100%);
  color: #e6ede2;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s, transform 0.08s;
}

.ch3-drawer-btn:hover { border-color: var(--nixie-amber); }
.ch3-drawer-btn:active { transform: scale(0.97); }
.ch3-drawer-btn.checked { opacity: 0.55; border-color: #353f37; }
.ch3-drawer-btn.found { border-color: var(--safe-green); background: linear-gradient(180deg, #2b4531 0%, #1a2d1e 100%); color: #a7f5b4; }

.ch3-status-box {
  background: #0d120e;
  border: 1px solid #344037;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #d6dfd2;
  text-align: center;
}

/* 22: Таблица Сивцева и фотореалистичный рубиновый окуляр */
.eye-chart-frame {
  position: relative;
  background: #f2f4ee;
  border: 4px solid #353c37;
  border-radius: 6px;
  padding: 16px 14px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.14);
}

.eye-chart-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.25;
  margin: 4px 0;
}

.eye-char-black {
  color: #161816;
  transition: color 0.25s, text-shadow 0.25s;
}

.eye-char-red {
  color: #cc2820;
  transition: opacity 0.25s, color 0.25s;
}

.eye-chart-filter {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(212, 24, 24, 0.82) 0%, rgba(162, 12, 14, 0.92) 72%, rgba(92, 6, 8, 0.96) 100%);
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.eye-chart-ruby-lens {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  background: rgba(34, 8, 10, 0.84);
  border: 1px solid rgba(218, 168, 86, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: scale(0.85) translateY(6px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.eye-chart-ruby-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(220, 42, 42, 0.7));
}

.eye-chart-ruby-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #ffd5c2;
}

.eye-chart-frame.filtered .eye-chart-filter {
  opacity: 1;
}

.eye-chart-frame.filtered .eye-chart-ruby-lens {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.eye-chart-frame.filtered .eye-char-red {
  opacity: 0.04;
}

.eye-chart-frame.filtered .eye-char-black {
  color: #060303;
  text-shadow: 0 0 8px rgba(255, 224, 210, 0.35);
}

/* 23: Негатоскоп с реальными рентген-снимками и 3 тумблера */
.negatoscope-screen {
  position: relative;
  height: 214px;
  background:
    radial-gradient(circle at 50% 45%, rgba(224, 248, 255, 0.96) 0%, rgba(146, 206, 232, 0.94) 68%, rgba(74, 132, 164, 0.96) 100%);
  border: 4px solid #3c4a46;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: inset 0 0 28px rgba(10, 56, 84, 0.42), 0 0 20px rgba(135, 220, 255, 0.24);
}

.xray-plate {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 66%;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(130, 215, 248, 0.55);
  box-shadow: 0 4px 16px rgba(4, 24, 40, 0.45);
  transition: left 0.48s cubic-bezier(0.22, 1, 0.36, 1), right 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.xray-plate.left { left: 4%; opacity: 0.94; }
.xray-plate.right { right: 4%; opacity: 0.86; mix-blend-mode: normal; }
.negatoscope-screen.aligned .xray-plate.left { left: 17%; }
.negatoscope-screen.aligned .xray-plate.right { right: 17%; opacity: 0.78; }

.xray-film-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.86;
  filter: contrast(1.08) brightness(1.06);
  pointer-events: none;
  display: block;
}

.xray-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.xray-legend {
  background: #0d161b;
  border: 1px solid #355264;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #bce4fa;
  text-align: center;
}

.breakers-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.breaker-btn {
  padding: 12px 8px;
  border-radius: 6px;
  border: 2px solid #48544b;
  background: linear-gradient(180deg, #272f29 0%, #151a16 100%);
  color: #d6dfd2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  transition: border-color 0.15s, background 0.15s;
}

.breaker-btn.on {
  border-color: var(--safe-green);
  background: linear-gradient(180deg, #263f2c 0%, #162619 100%);
}

/* 24: Аптечный шкаф и анализатор с фотореалистичными ампулами */
.ampoule-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.ampoule-grid.analyzer-tray {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ampoule-btn {
  padding: 9px 10px;
  border-radius: 6px;
  border: 2px solid #455148;
  background: linear-gradient(180deg, #1b221d 0%, #111612 100%);
  color: #e4ebe2;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: border-color 0.15s, transform 0.08s;
}

.ampoule-btn.analyzer-pick {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 8px 4px;
  gap: 5px;
}

.ampoule-btn.picked {
  border-color: var(--safe-green);
  background: linear-gradient(180deg, #213726 0%, #142217 100%);
}

.ampoule-prop-img {
  width: 34px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
  clip-path: inset(2% 10%);
  transition: transform 0.15s ease;
}

.ampoule-prop-img.sm {
  width: 28px;
  height: 44px;
}

.amp-orange { filter: saturate(1.38) brightness(1.04) drop-shadow(0 0 8px rgba(235, 148, 42, 0.55)); }
.amp-green  { filter: hue-rotate(84deg) saturate(1.65) brightness(0.96) drop-shadow(0 0 8px rgba(72, 202, 102, 0.55)); }
.amp-blue   { filter: hue-rotate(178deg) saturate(1.8) brightness(0.96) drop-shadow(0 0 8px rgba(68, 148, 255, 0.55)); }
.amp-clear  { filter: saturate(0.1) brightness(1.18) drop-shadow(0 0 5px rgba(210, 225, 230, 0.35)); }
.amp-ruby   { filter: hue-rotate(-32deg) saturate(1.85) brightness(0.96) drop-shadow(0 0 8px rgba(225, 62, 54, 0.58)); }

.analyzer-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.analyzer-slot {
  min-height: 86px;
  padding: 8px 4px;
  border-radius: 6px;
  border: 2px dashed #4a574d;
  background: #0e1310;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.analyzer-slot.filled {
  border-style: solid;
  border-color: #7c8d7f;
  color: #eef5ee;
  background: linear-gradient(180deg, #1a241d 0%, #101612 100%);
}

/* 25 & 30: Реальный чугунный штурвал с круговым вращением */
.uv-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.real-valve-stage {
  position: relative;
  width: 192px;
  height: 192px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  user-select: none;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(16, 22, 18, 0.85) 0%, rgba(8, 11, 9, 0.25) 68%, transparent 100%);
}

.real-valve-stage:active { cursor: grabbing; }

.real-valve-stage.airlock-wheel {
  width: 210px;
  height: 210px;
}

.real-valve-rotator {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.34s cubic-bezier(0.22, 1.18, 0.36, 1);
  will-change: transform;
}

.real-valve-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  clip-path: circle(48% at 50% 50%);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.82));
}

.real-valve-marker {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, #74faff 0%, #24b6cc 100%);
  border: 1.5px solid #e6c675;
  box-shadow: 0 0 10px rgba(74, 240, 255, 0.85);
  pointer-events: none;
}

.uv-wheel-drag-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9bb8ad;
  text-align: center;
}

.uv-steps-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.uv-step-pill {
  padding: 8px 4px;
  border-radius: 5px;
  border: 1px solid #3c483e;
  background: #0e1310;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.uv-step-pill.filled {
  border-color: #3dc7d9;
  color: #a6f4ff;
}

.uv-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

/* 26: Кардиомонитор (CRT ЭКГ + индикатор синхронизации ритма) */
.ecg-sync-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #334538;
  background: #0a100c;
}

.ecg-sync-lamp {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid #1b221c;
  background: radial-gradient(circle at 35% 35%, #ef7363 0%, #8f2218 65%, #410d08 100%);
  box-shadow: 0 0 8px rgba(239, 115, 99, 0.55);
}

.ecg-sync-bar.near .ecg-sync-lamp {
  background: radial-gradient(circle at 35% 35%, #ffe699 0%, #e0962a 65%, #6b4109 100%);
  box-shadow: 0 0 10px rgba(240, 174, 58, 0.78);
}

.ecg-sync-bar.match .ecg-sync-lamp {
  background: radial-gradient(circle at 35% 35%, #d6ffdd 0%, #52eb74 60%, #1c7832 100%);
  box-shadow: 0 0 14px rgba(82, 235, 116, 0.95);
}

.ecg-sync-body {
  flex: 1;
  min-width: 0;
}

.ecg-sync-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #cfe0d2;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ecg-sync-bar.near .ecg-sync-label { color: #ffd47d; }
.ecg-sync-bar.match .ecg-sync-label { color: #84ff9e; }

.ecg-sync-track {
  height: 6px;
  border-radius: 999px;
  background: #17211a;
  overflow: hidden;
}

.ecg-sync-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b83a2c 0%, #e39f3b 100%);
  transition: width 0.22s ease, background 0.22s ease;
}

.ecg-sync-bar.near .ecg-sync-fill {
  background: linear-gradient(90deg, #d6852a 0%, #ffd25a 100%);
}

.ecg-sync-bar.match .ecg-sync-fill {
  background: linear-gradient(90deg, #39a853 0%, #75ff96 100%);
}

.ecg-screen {
  background: radial-gradient(circle at 50% 50%, #091e10 0%, #040d07 100%);
  border: 3px solid #334a39;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 24px rgba(32, 160, 72, 0.25);
}

.ecg-svg {
  width: 100%;
  height: auto;
  display: block;
}

.ecg-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.ecg-ctrl-box {
  background: #111713;
  border: 1px solid #37443a;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

.ecg-ctrl-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.ecg-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ecg-step-btn {
  width: 38px;
  height: 36px;
  border-radius: 5px;
  border: 1px solid #4e5e51;
  background: linear-gradient(180deg, #323c35 0%, #1e2520 100%);
  color: #eef5ee;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.ecg-step-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: #70f58c;
}

/* 27: Коллектор автоклава (реальный манометр + 3 чугунных вентиля) */
.manifold-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #3b483e;
  background: radial-gradient(circle at 50% 42%, #19211b 0%, #0d120e 100%);
}

.manifold-pressure-readout {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #f3ce7b;
}

.manifold-valves-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.manifold-valve-btn {
  padding: 9px 6px;
  border-radius: 7px;
  border: 2px solid #48544b;
  background: linear-gradient(180deg, #212923 0%, #131814 100%);
  color: #e6ede2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.16s, background 0.16s, transform 0.08s;
}

.manifold-valve-btn:active { transform: scale(0.97); }
.manifold-valve-btn.closed {
  border-color: #62e07c;
  background: linear-gradient(180deg, #213826 0%, #132216 100%);
}

.manifold-wheel-rotator {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(0.22, 1.25, 0.36, 1);
}

.manifold-valve-img {
  width: 100%;
  height: 100%;
}

.valve-tone-red    { filter: saturate(1.2) drop-shadow(0 4px 10px rgba(190, 42, 32, 0.45)); }
.valve-tone-blue   { filter: hue-rotate(205deg) saturate(1.45) brightness(0.98) drop-shadow(0 4px 10px rgba(48, 130, 230, 0.45)); }
.valve-tone-yellow { filter: hue-rotate(46deg) saturate(1.65) brightness(1.22) drop-shadow(0 4px 10px rgba(235, 188, 52, 0.45)); }

.manifold-valve-name {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.7px;
}

.manifold-valve-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
}

.manifold-valve-btn.closed .manifold-valve-sub {
  color: #8cf5a0;
  font-weight: 700;
}

/* 28: Физиотерапия (бакелитовые штекеры с цветными термоусадками и гнёзда) */
.physio-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.physio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.physio-row.sockets-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.physio-plug-btn,
.physio-socket-btn {
  padding: 8px 6px;
  border-radius: 6px;
  border: 2px solid #465249;
  background: linear-gradient(180deg, #1d241f 0%, #121714 100%);
  color: #e4ebe2;
  font-family: var(--font-display);
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}

.physio-plug-btn.selected {
  border-color: var(--nixie-amber);
  box-shadow: 0 0 12px rgba(255, 157, 59, 0.42);
  background: linear-gradient(180deg, #2d261a 0%, #191610 100%);
}

.physio-plug-btn.used {
  opacity: 0.56;
}

.physio-plug-visual {
  position: relative;
  width: 44px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.physio-plug-visual.in-socket {
  width: 34px;
  height: 44px;
}

.physio-plug-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: inset(2% 14%);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.physio-collar {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 6px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

.physio-plug-visual.in-socket .physio-collar {
  bottom: 7px;
  width: 11px;
  height: 5px;
}

.collar-red    { background: linear-gradient(180deg, #ff5444 0%, #b82114 100%); }
.collar-yellow { background: linear-gradient(180deg, #ffd857 0%, #c99218 100%); }
.collar-blue   { background: linear-gradient(180deg, #5ea5ff 0%, #205bb5 100%); }

.physio-plug-label { font-weight: 700; }
.physio-plug-state {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
}

.physio-row.sockets-4 .physio-socket-btn {
  padding: 7px 3px;
  font-size: 11px;
}

.physio-socket-btn.plugged {
  border-color: #768a7a;
}

.physio-socket-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}

.physio-jack-lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #232a25;
  border: 1px solid #0e120f;
}

.physio-jack-lamp.lit-red    { background: #ff5545; box-shadow: 0 0 8px #ff5545; }
.physio-jack-lamp.lit-yellow { background: #ffd44d; box-shadow: 0 0 8px #ffd44d; }
.physio-jack-lamp.lit-blue   { background: #5aa3ff; box-shadow: 0 0 8px #5aa3ff; }

.physio-jack-recess {
  width: 44px;
  height: 48px;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 45%, #070a08 0%, #141a16 70%, #2a332d 100%);
  border: 2px solid #59665c;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.92), 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.physio-jack-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #020302 0%, #0b0e0c 60%, #665836 100%);
  border: 2px solid #8a733f;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.95);
}

.physio-socket-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
}

/* 29: Перфокарты из архивного картона */
.punchcards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.punchcard-choice-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1.5px solid #967f52;
  background:
    linear-gradient(90deg, rgba(242, 224, 182, 0.14) 0%, rgba(226, 202, 152, 0.2) 100%),
    url('../assets/ui/item_punchcard.webp?v=48') center / 102% 222% no-repeat;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(96, 72, 32, 0.22);
  color: #24190c;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.15s, box-shadow 0.15s;
}

.punchcard-choice-btn:hover {
  border-color: #f3c669;
  box-shadow: 0 6px 18px rgba(243, 198, 105, 0.28);
}

.punchcard-choice-btn:active { transform: scale(0.98); }

.punchcard-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(246, 232, 198, 0.84);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(110, 82, 38, 0.35);
}

.punchcard-name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.7px;
  color: #2a1b0a;
}

.punchcard-serial {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #5d4524;
}

.punchcard-holes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(242, 228, 192, 0.86);
  border: 1px solid rgba(110, 82, 38, 0.4);
}

.punch-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.punch-hole.punched {
  background: radial-gradient(circle at 45% 45%, #16110a 0%, #2c2215 100%);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 250, 230, 0.7);
}

.punch-hole.solid {
  background: transparent;
  border: 2px solid #594426;
}

/* 30: Пропуска на столе и реальные советские латунные манометры */
.pass-choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  border: 2px solid #48544b;
  background: linear-gradient(180deg, #242d26 0%, #151b16 100%);
  color: #e6ede2;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.08s;
}

.pass-choice-btn:hover { border-color: var(--nixie-amber); }
.pass-choice-btn:active { transform: scale(0.98); }
.pass-choice-btn.found {
  border-color: var(--safe-green);
  background: linear-gradient(180deg, #29432f 0%, #18291c 100%);
}

.pass-thumb-img {
  width: 68px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.75));
}

.pass-choice-btn.expired .pass-thumb-img {
  filter: grayscale(0.75) sepia(0.38) brightness(0.84);
  opacity: 0.78;
}

.pass-choice-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.pass-choice-info strong {
  font-family: var(--font-mono);
  font-size: 14px;
}

.pass-choice-info span {
  font-size: 11px;
  color: var(--text-dim);
}

.pass-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.pass-badge.expired {
  color: #ff9c92;
  background: rgba(145, 32, 24, 0.35);
  border: 1px solid rgba(220, 74, 62, 0.65);
}

.pass-badge.valid {
  color: #9ff7b0;
  background: rgba(34, 108, 52, 0.38);
  border: 1px solid rgba(92, 224, 118, 0.65);
}

.gauges-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.gauge-card {
  background: linear-gradient(180deg, #161d18 0%, #0d120e 100%);
  border: 1px solid #3a473d;
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.real-gauge-box {
  position: relative;
  width: 140px;
  max-width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
}

.real-gauge-face {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  clip-path: circle(48% at 50% 50%);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85));
}

.real-gauge-needle-wrap {
  position: absolute;
  left: 50%;
  top: 52.5%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  transition: transform 0.28s cubic-bezier(0.22, 1.28, 0.36, 1);
  pointer-events: none;
  z-index: 2;
}

.real-gauge-needle-svg {
  position: absolute;
  left: -10px;
  bottom: -10px;
  width: 20px;
  height: 54px;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.72));
}

.real-gauge-cap {
  position: absolute;
  left: 50%;
  top: 52.5%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #a88848 0%, #4d3c1c 65%, #1e1609 100%);
  border: 1.5px solid #221a0b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 3;
}

.gauge-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--nixie-amber);
}

@media (max-width: 420px) {
  .real-gauge-box {
    width: 128px;
  }
  .real-gauge-needle-svg {
    left: -9px;
    bottom: -9px;
    width: 18px;
    height: 49px;
  }
}

/* ============================================================================
   14. ГЛАВА IV — ГИДРОУЗЕЛ И НЕОНОВЫЙ РЕЗЕРВУАР (#modal-ch3)
   ============================================================================ */
.hydro-water-tank {
  position: relative;
  background: radial-gradient(circle at 50% 25%, #0e3842 0%, #05161c 75%, #020b0f 100%);
  border: 3px solid #2b6572;
  border-radius: 8px;
  padding: 24px 14px 20px;
  margin-bottom: 12px;
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 0 32px rgba(42, 232, 224, 0.25), 0 8px 20px rgba(0, 0, 0, 0.72);
}

.hydro-water-caustics {
  position: absolute;
  inset: -12px;
  background:
    radial-gradient(ellipse at 25% 40%, rgba(92, 248, 240, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 65%, rgba(64, 210, 220, 0.14) 0%, transparent 52%);
  animation: hydroCausticDrift 4.6s ease-in-out infinite alternate;
  pointer-events: none;
}

.hydro-water-ripples {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(130, 255, 248, 0.05) 0px,
    rgba(130, 255, 248, 0.05) 2px,
    transparent 2px,
    transparent 9px
  );
  animation: hydroRippleScroll 3.2s linear infinite;
  pointer-events: none;
}

@keyframes hydroCausticDrift {
  0%   { transform: translate(-6px, -3px) scale(1); opacity: 0.75; }
  100% { transform: translate(6px, 4px) scale(1.06); opacity: 1; }
}

@keyframes hydroRippleScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(9px); }
}

.hydro-water-surface {
  position: relative;
  z-index: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(132, 255, 248, 0.92), transparent);
  margin-bottom: 14px;
  box-shadow: 0 0 10px rgba(96, 252, 244, 0.75);
}

.hydro-mirror-digits {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 14px;
  padding-left: 14px;
  color: #84fff8;
  text-shadow: 0 0 14px rgba(72, 255, 244, 0.92), 0 0 30px rgba(32, 210, 220, 0.65);
  transform: scaleY(-1);
  user-select: none;
  animation: hydroNeonShimmer 2.8s ease-in-out infinite alternate;
}

.hydro-water-reflection-glint {
  position: relative;
  z-index: 1;
  height: 10px;
  width: 68%;
  margin: 10px auto 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(110, 255, 248, 0.28) 0%, transparent 72%);
}

@keyframes hydroNeonShimmer {
  0%   { opacity: 0.86; filter: blur(0px); }
  100% { opacity: 1; filter: blur(0.35px); }
}

.hydro-mirror-digits.upright {
  transform: none;
  font-size: 28px;
  letter-spacing: 8px;
  padding-left: 8px;
  margin-top: 8px;
  color: #b4fff9;
  opacity: 0.92;
}

/* Компактная 3-колоночная поворотная бакелитовая ручка (F32, F35, F38, F40) */
.hydro-knob-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.dial-knob.rotary-knob-btn.hydro-knob-btn {
  width: 74px;
  height: 74px;
}

.dial-knob.rotary-knob-btn.hydro-knob-btn .rotary-tick {
  top: 3px;
  height: 6px;
  transform-origin: 50% 34px;
}

.dial-knob.rotary-knob-btn.hydro-knob-btn .rotary-knob-img {
  width: 60px;
  height: 60px;
  transform-origin: 50% 56%;
}

.hydro-knob-steps {
  width: 100%;
  max-width: 84px;
  gap: 4px;
}

.hydro-knob-steps .ecg-step-btn {
  width: 34px;
  height: 30px;
  font-size: 16px;
}

.rotary-dial-card {
  padding: 8px 4px;
}

/* F32: Оптическая скамья и 3 цветных луча */
.prism-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, #121c22 0%, #070b0e 100%);
  border: 2px solid #35474e;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85);
}

.optical-bench-svg {
  display: block;
  max-width: 280px;
}

.optical-readout-tag {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #b8e6e8;
}

.prism-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.prism-col {
  background: #101614;
  border: 1px solid #36453e;
  border-radius: 7px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.prism-col-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.8px;
  color: #dce7df;
}

.prism-bars {
  width: 34px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.prism-bars.prism-bars-row {
  width: 58px;
  flex-direction: row;
  gap: 4px;
}

.prism-bars.prism-bars-row .prism-seg {
  flex: 1;
  height: 8px;
}

.prism-seg {
  height: 14px;
  border-radius: 3px;
  background: #1a2320;
  border: 1px solid #2f3d37;
  transition: background 0.18s, box-shadow 0.18s;
}

.prism-seg.on-cyan {
  background: #3be8e0;
  border-color: #9bfcf7;
  box-shadow: 0 0 10px rgba(59, 232, 224, 0.72);
}

.prism-seg.on-amber {
  background: #ffad3b;
  border-color: #ffe09a;
  box-shadow: 0 0 10px rgba(255, 173, 59, 0.72);
}

.prism-seg.on-ruby {
  background: #f04646;
  border-color: #ff9e9e;
  box-shadow: 0 0 10px rgba(240, 70, 70, 0.72);
}

/* F33: Шахты противовесов + мини-колесо лебёдки */
.winch-visual {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(16, 24, 24, 0.92) 0%, rgba(8, 13, 14, 0.96) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  border: 2px solid #354d52;
  border-radius: 8px;
  padding: 10px 8px;
  margin-bottom: 12px;
}

.winch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.winch-col-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #9bd8d4;
}

.winch-shaft {
  width: 100%;
  height: 88px;
  background: linear-gradient(180deg, #050a0c 0%, #0a1417 100%);
  border: 1.5px solid #33494e;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.85);
}

.winch-ticks {
  position: absolute;
  inset: 6px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}

.winch-ticks span {
  display: block;
  width: 34%;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(212, 186, 128, 0.7), transparent);
}

.winch-gate-bar {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  background: linear-gradient(180deg, #5ec9c2 0%, #1d575b 100%);
  border-top: 3px solid #b5fff9;
  border-radius: 3px 3px 0 0;
  transition: height 0.24s ease;
  box-shadow: 0 -2px 10px rgba(94, 201, 194, 0.4);
}

.winch-mini-wheel-btn {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid #4a5952;
  background: radial-gradient(circle at 50% 50%, #161d1c 0%, #090d0c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85), 0 4px 10px rgba(0, 0, 0, 0.65);
}

.winch-mini-wheel-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  clip-path: circle(48% at 50% 50%);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1.2, 0.36, 1);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.winch-depth-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #ffe09c;
  white-space: nowrap;
}

/* F34: Живой латунный манометр кВт + тумблеры */
.turbine-telemetry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1.5px solid #455449;
  background: radial-gradient(circle at 30% 45%, #161e19 0%, #0b100d 100%);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
}

.turbine-gauge-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.turbine-gauge-slot .real-gauge-box {
  width: 108px;
}

.turbine-gauge-slot .real-gauge-needle-svg {
  left: -8px;
  bottom: -8px;
  width: 16px;
  height: 42px;
}

.turbine-gauge-scale {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #ccb379;
}

.turbine-readout-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.turbine-readout-kicker {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.9px;
  color: var(--text-dim);
  text-align: center;
}

.turbine-readout {
  background: #091112;
  border: 2px solid #384a45;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--nixie-amber);
}

.turbine-readout.exact {
  border-color: var(--safe-green);
  color: #7bf795;
  box-shadow: 0 0 14px rgba(90, 235, 118, 0.25);
}

.turbine-readout-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  color: #9cb2a2;
}

.turbine-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.turbine-grid .breaker-btn {
  flex: 1 1 29%;
  min-width: 92px;
  max-width: 132px;
}

/* F35: Латунные стеклянные барометры + пузырьки + ручки */
.cylinders-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.cylinder-card {
  background: #0d1516;
  border: 1px solid #304749;
  border-radius: 7px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cylinder-barometer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cylinder-brass-cap {
  width: 52px;
  height: 8px;
  border-radius: 3px;
  border: 1px solid #4e3b17;
  background: linear-gradient(90deg, #6b5221 0%, #dfb866 38%, #a67f35 72%, #594318 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.72);
}

.cylinder-flask {
  width: 44px;
  height: 102px;
  border-left: 2.5px solid #6b9da1;
  border-right: 2.5px solid #6b9da1;
  background: linear-gradient(90deg, rgba(16, 40, 46, 0.92) 0%, rgba(7, 18, 22, 0.96) 58%, rgba(16, 40, 46, 0.9) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 14px rgba(45, 210, 210, 0.2);
}

.cylinder-glass-glint {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 5px;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(220, 255, 255, 0.28), rgba(220, 255, 255, 0.05));
  pointer-events: none;
  z-index: 2;
}

.cylinder-water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(102, 250, 240, 0.92) 0%, rgba(22, 146, 156, 0.95) 100%);
  border-top: 2px solid #d4fffe;
  box-shadow: 0 -2px 10px rgba(72, 244, 236, 0.6);
  transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.cylinder-bubble {
  position: absolute;
  bottom: -6px;
  border-radius: 50%;
  background: rgba(224, 255, 255, 0.72);
  animation: cylinderBubbleRise 2.6s linear infinite;
}

.cylinder-bubble.b1 { left: 22%; width: 5px; height: 5px; animation-duration: 2.3s; }
.cylinder-bubble.b2 { left: 56%; width: 4px; height: 4px; animation-duration: 3.1s; animation-delay: 0.7s; }
.cylinder-bubble.b3 { left: 74%; width: 3px; height: 3px; animation-duration: 2.7s; animation-delay: 1.4s; }

@keyframes cylinderBubbleRise {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 0.85; }
  100% { transform: translateY(-96px); opacity: 0; }
}

.cylinder-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  pointer-events: none;
  z-index: 3;
}

.cylinder-ticks span {
  display: block;
  width: 48%;
  height: 1.5px;
  background: rgba(215, 248, 248, 0.45);
}

/* F36: 3 сцеплённые реальные латунные шестерни */
.gears-drive-box.gears-train-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1.5px solid #594b31;
  background:
    linear-gradient(180deg, rgba(20, 24, 20, 0.9) 0%, rgba(10, 13, 11, 0.95) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.85);
}

.gear-shaft-btn,
.gear-idler-row {
  min-height: 70px;
  padding: 7px 12px;
  border-radius: 7px;
  border: 2px dashed #63705c;
  background: rgba(15, 21, 18, 0.88);
  color: #d7e2d5;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}

.gear-shaft-btn {
  cursor: pointer;
}

.gear-idler-row {
  border-style: solid;
  border-color: #6b5834;
  background: linear-gradient(90deg, rgba(32, 34, 24, 0.92) 0%, rgba(18, 22, 16, 0.94) 100%);
}

.gear-shaft-btn.mounted {
  border-style: solid;
  border-color: #d8a74a;
  background: linear-gradient(90deg, #21271c 0%, #131812 100%);
  color: #ffe39e;
}

.gear-shaft-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gear-shaft-meta strong {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.7px;
}

.gear-shaft-meta span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #b8c6b9;
}

.gear-wheel-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #090c0a 0%, #1a211c 75%, #2f3830 100%);
  border: 1.5px solid #4d5949;
}

.gear-wheel-slot.lg { width: 66px; height: 66px; }
.gear-wheel-slot.md { width: 56px; height: 56px; }
.gear-wheel-slot.sm { width: 48px; height: 48px; }

.gear-empty-axle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #aebaa8;
  text-align: center;
  padding: 4px;
}

.real-gear-img {
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.85));
}

.real-gear-img.gear-lg { width: 62px; height: 62px; }
.real-gear-img.gear-md { width: 52px; height: 52px; }
.real-gear-img.gear-sm { width: 44px; height: 44px; }

.real-gear-img.spin-cw  { animation: gearSpinCW 4.2s linear infinite; }
.real-gear-img.spin-ccw { animation: gearSpinCCW 4.2s linear infinite; }

@keyframes gearSpinCW {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gearSpinCCW {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

.f36-chain-hint {
  background: #0d1310;
  border: 1px solid #354339;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #cfd9cd;
  text-align: center;
  line-height: 1.4;
}

.f36-dir-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.f36-dir-btn {
  padding: 10px 8px;
  border-radius: 6px;
  border: 2px solid #48544b;
  background: #131915;
  color: #dce6dc;
  font-family: var(--font-display);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.f36-dir-btn.selected {
  border-color: var(--nixie-amber);
  background: #2b2314;
  color: #ffe2a6;
  box-shadow: 0 0 10px rgba(255, 157, 59, 0.3);
}

/* F37: Магистраль труб 4x4 на заклёпанной стали */
.pipes-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pipes-board-wrap.steel-plate-bg {
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #3d5156;
  background:
    linear-gradient(180deg, rgba(16, 24, 26, 0.88) 0%, rgba(8, 14, 16, 0.94) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.85);
}

.pipes-io-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.pipes-io-tag {
  padding: 4px 8px;
  border-radius: 4px;
  background: #0b2429;
  border: 1px solid #35b4c2;
  color: #8cf8ff;
}

.pipes-io-tag.done {
  background: #143620;
  border-color: #5ee67c;
  color: #a9ffba;
}

.pipes-grid {
  display: grid;
  grid-template-columns: repeat(5, 56px);
  gap: 4px;
  background: #081012;
  border: 2px solid #2b454b;
  border-radius: 8px;
  padding: 6px;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

.pipe-tile {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 6px;
  border: 2px solid #35474b;
  background: linear-gradient(180deg, #162226 0%, #0d1518 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.pipe-tile.block {
  cursor: not-allowed;
  border-color: #463c32;
  background: repeating-linear-gradient(45deg, #1b1d1e 0 5px, #2b2722 5px 10px);
  opacity: 0.92;
}

.pipe-tile.valve {
  border-color: #c99c4a;
}

.pipe-tile.valve.lit {
  border-color: #6dfaf2;
  box-shadow: inset 0 0 14px rgba(82, 255, 245, 0.42), 0 0 10px rgba(82, 255, 245, 0.35);
}

.pipe-tile:hover {
  border-color: #66dfe8;
}

.pipe-tile:active {
  transform: scale(0.95);
}

.pipe-tile.lit {
  border-color: #46f0e8;
  background: linear-gradient(180deg, #12363e 0%, #091e23 100%);
  box-shadow: inset 0 0 12px rgba(64, 240, 232, 0.28);
}

.pipe-flow-pulse .pipe-water-core.lit {
  stroke: #b5fffb;
  stroke-width: 4;
  stroke-dasharray: 8 10;
  animation: pipeFlowPulse 0.85s linear infinite;
}

@keyframes pipeFlowPulse {
  from { stroke-dashoffset: 18; }
  to   { stroke-dashoffset: 0; }
}

/* F38: Измеритель акустического подавления */
.acoustic-meter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #334538;
  background: #0a100c;
}

.acoustic-meter-bar.near .ecg-sync-lamp {
  background: radial-gradient(circle at 35% 35%, #ffe699 0%, #e0962a 65%, #6b4109 100%);
  box-shadow: 0 0 10px rgba(240, 174, 58, 0.78);
}

.acoustic-meter-bar.match .ecg-sync-lamp {
  background: radial-gradient(circle at 35% 35%, #d6ffdd 0%, #52eb74 60%, #1c7832 100%);
  box-shadow: 0 0 14px rgba(82, 235, 116, 0.95);
}

.acoustic-meter-bar.near .ecg-sync-label { color: #ffd47d; }
.acoustic-meter-bar.match .ecg-sync-label { color: #84ff9e; }
.acoustic-meter-bar.near .ecg-sync-fill { background: linear-gradient(90deg, #d6852a 0%, #ffd25a 100%); }
.acoustic-meter-bar.match .ecg-sync-fill { background: linear-gradient(90deg, #39a853 0%, #75ff96 100%); }

/* F39: Советские стеклянные кнопочные реле со стальной рамкой и заклёпками */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 82px);
  gap: 10px;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1.5px solid #455249;
  background:
    linear-gradient(180deg, rgba(20, 26, 22, 0.88) 0%, rgba(10, 14, 12, 0.95) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
}

.matrix-cell.relay-glass-btn {
  position: relative;
  width: 82px;
  height: 82px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 2px solid #4c574f;
  background: linear-gradient(180deg, #272d29 0%, #141815 100%);
  color: #dfd0a8;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 10px rgba(0, 0, 0, 0.68);
  transition: all 0.16s ease;
}

.matrix-cell.relay-glass-btn:active {
  transform: scale(0.95);
}

.relay-rivets i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c8c1a8 0%, #5c5749 70%, #24211b 100%);
}

.relay-rivets i:nth-child(1) { top: 4px; left: 4px; }
.relay-rivets i:nth-child(2) { top: 4px; right: 4px; }
.relay-rivets i:nth-child(3) { bottom: 4px; left: 4px; }
.relay-rivets i:nth-child(4) { bottom: 4px; right: 4px; }

.relay-dome {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #5a4218;
  background: radial-gradient(circle at 36% 32%, #ffe29a 0%, #e08d22 58%, #703906 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.4), 0 0 10px rgba(224, 141, 34, 0.52);
}

.matrix-cell.relay-glass-btn.on {
  border-color: #6dfaf2;
  background: linear-gradient(180deg, #1b4348 0%, #0d2326 100%);
  color: #c8fffc;
  box-shadow: 0 0 14px rgba(64, 240, 232, 0.42);
}

.matrix-cell.relay-glass-btn.on .relay-dome {
  border-color: #9ffcf7;
  background: radial-gradient(circle at 36% 32%, #e6ffff 0%, #52fff5 55%, #128388 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.65), 0 0 14px rgba(82, 255, 245, 0.92);
}

.relay-coord {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.relay-state {
  font-size: 9px;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* F40: Лампы терминала и 3-колоночная сетка ручек */
.f40-lamps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
  padding: 8px;
  background: #0c120e;
  border: 1px solid #3c483e;
  border-radius: 6px;
}

.f40-amber-lamp {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff5cc 0%, #ffb338 55%, #b8620a 100%);
  border: 2px solid #593b14;
  box-shadow: 0 0 12px rgba(255, 179, 56, 0.88);
}

.sync-dials-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.sync-dial-box {
  background: #101613;
  border: 1px solid #48574a;
  border-radius: 7px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sync-dial-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--nixie-amber);
}

@media (max-width: 420px) {
  .pipes-grid {
    grid-template-columns: repeat(5, 48px);
  }
  .pipe-tile {
    width: 48px;
    height: 48px;
  }
  .matrix-grid {
    grid-template-columns: repeat(3, 74px);
    gap: 8px;
    padding: 10px;
  }
  .matrix-cell.relay-glass-btn {
    width: 74px;
    height: 74px;
  }
  .turbine-gauge-slot .real-gauge-box {
    width: 96px;
  }
  .turbine-gauge-slot .real-gauge-needle-svg {
    left: -7px;
    bottom: -7px;
    width: 14px;
    height: 38px;
  }
}

/* ============================================================================
   ПАКЕТ УДЕРЖАНИЯ: СХЕМА БАШНИ, СЕРИЯ ЧИСТОТЫ, ДОСТИЖЕНИЯ, ПЕРЕБИВКИ ГЛАВ
   ============================================================================ */
.tower-card {
  max-width: 480px;
}

.tower-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #0d120f;
  border: 1px solid #354238;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cfe0d2;
}

.tower-summary strong {
  color: var(--nixie-amber);
}

.tower-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tower-tab-btn {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #3c4a3f;
  background: #141a16;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tower-tab-btn.active {
  border-color: var(--nixie-amber);
  background: linear-gradient(180deg, #2d2618 0%, #1b1810 100%);
  color: #ffe2a8;
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.18);
}

.tower-panel {
  display: none;
}

.tower-panel.active {
  display: block;
}

.tower-chapter-block {
  margin-bottom: 12px;
}

.tower-chapter-title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.1px;
  color: #c8d6c9;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 3px solid var(--nixie-amber);
}

.tower-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tower-floor-btn {
  position: relative;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid #354137;
  background: #121714;
  color: #cfd9cf;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}

.tower-floor-btn:hover:not(:disabled) {
  border-color: var(--nixie-amber);
  background: #1b241d;
}

.tower-floor-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.tower-floor-btn.is-passed {
  border-color: #49a15a;
  background: linear-gradient(180deg, #172b1b 0%, #101d13 100%);
  color: #c4f7cd;
}

.tower-floor-btn.is-current {
  border-color: #ffb347;
  background: linear-gradient(180deg, #3b2a12 0%, #241a0b 100%);
  color: #ffe4ae;
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.45);
}

.tower-floor-btn.is-locked {
  opacity: 0.42;
  cursor: not-allowed;
  background: #0d100e;
  color: #6b766d;
}

.tower-floor-star {
  position: absolute;
  top: 3px;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #ffd35c;
  filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.75));
}

.tower-floor-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  opacity: 0.78;
}

.tower-sealed-card {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px dashed #4a594d;
  background: rgba(12, 16, 13, 0.75);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
  color: #9eb0a0;
  text-align: center;
}

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #354138;
  background: #121714;
}

.ach-item.unlocked {
  border-color: #a67c2e;
  background: linear-gradient(180deg, #252014 0%, #17150e 100%);
}

.ach-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #0c100d;
  border: 1px solid #3d4a40;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ach-item.unlocked .ach-icon {
  border-color: #d99f38;
  background: #2b220f;
  color: #ffd97d;
}

.ach-info {
  flex: 1;
  min-width: 0;
}

.ach-title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.8px;
  color: #e6ede2;
}

.ach-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.ach-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9cb09f;
}

.ach-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.ach-reward-pill {
  padding: 2px 7px;
  border-radius: 4px;
  background: #292111;
  border: 1px solid #8a6420;
  color: #ffd275;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.ach-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  color: #829285;
}

.ach-item.unlocked .ach-status {
  color: #7ee890;
  font-weight: 700;
}

.win-clean-badge {
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.win-clean-badge.is-clean {
  background: rgba(180, 122, 22, 0.18);
  border: 1px solid #9e6b14;
  color: #543500;
  font-weight: 700;
}

.win-clean-badge.streak-hit {
  background: linear-gradient(135deg, rgba(226, 165, 42, 0.36), rgba(190, 122, 18, 0.24));
  border: 1.5px solid #a66a08;
  color: #3d2400;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(212, 148, 28, 0.35);
}

.win-clean-badge.is-broken {
  background: rgba(31, 23, 13, 0.06);
  border: 1px dashed rgba(31, 23, 13, 0.32);
  color: #564732;
}

.achievement-banner {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  opacity: 0;
  z-index: 95;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(92vw, 390px);
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #282214 0%, #15140e 100%);
  border: 1.5px solid #d49c36;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85), 0 0 18px rgba(255, 186, 66, 0.25);
  transition: transform 0.34s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.28s ease;
}

.achievement-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.ach-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #362911;
  border: 1px solid #d49c36;
  color: #ffd97d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ach-banner-body {
  flex: 1;
  min-width: 0;
}

.ach-banner-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #e5b75a;
}

.ach-banner-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.8px;
  color: #fff2d1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-banner-desc {
  font-size: 11px;
  color: #c4bba3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-banner-reward {
  padding: 4px 8px;
  border-radius: 5px;
  background: #3d2c0e;
  border: 1px solid #e5b75a;
  color: #ffe29a;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.chapter-intro {
  position: absolute;
  inset: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 50%, rgba(10, 14, 12, 0.86) 0%, rgba(4, 6, 5, 0.96) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  cursor: pointer;
}

.chapter-intro.open {
  opacity: 1;
  pointer-events: auto;
}

.chapter-intro-card {
  width: 100%;
  max-width: 540px;
  padding: 18px 22px;
  border-radius: 8px;
  background: rgba(12, 16, 14, 0.92);
  border: 1px solid rgba(255, 185, 75, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.88), inset 0 0 22px rgba(255, 185, 75, 0.08);
  text-align: center;
}

.chapter-intro-card.theme-teal {
  border-color: rgba(70, 240, 232, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.88), inset 0 0 22px rgba(70, 240, 232, 0.09);
}

.chapter-intro-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2.2px;
  color: var(--nixie-amber);
  text-transform: uppercase;
}

.chapter-intro-card.theme-teal .chapter-intro-num {
  color: #6dfaf2;
}

.chapter-intro-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1.8px;
  color: #f3f7f0;
  margin: 4px 0 8px;
  text-transform: uppercase;
}

.chapter-intro-quote {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  font-style: italic;
  color: #cdd8ce;
}

.chapter-intro-skip {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: #8b9a8e;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .tower-summary {
    font-size: 11px;
    padding: 7px 8px;
  }
  .tower-floor-btn {
    min-height: 40px;
    font-size: 13px;
  }
  .chapter-intro {
    padding: 8px 12px;
  }
  .chapter-intro-card {
    padding: 10px 12px;
  }
  .chapter-intro-num {
    font-size: 10px;
  }
  .chapter-intro-title {
    font-size: 15px;
    margin: 2px 0 4px;
  }
  .chapter-intro-quote {
    font-size: 11px;
    line-height: 1.3;
  }
  .chapter-intro-skip {
    margin-top: 5px;
    font-size: 9px;
  }
}

/* ============================================================================
   14. ТАКТИЛЬНЫЙ ВАУ-ДВИЖОК v29 (Пояс скиллов, УФ-фонарь, Щуп, Аномалии,
       Стирание пыли/ржавчины, Часы-сейф, Мастерская и Выбор маршрута)
   ============================================================================ */
.uv-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.uv-canvas.active {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  opacity: 1;
}

.scene-stage.anomaly-dim .scene-bg {
  filter: brightness(0.42) contrast(1.16) saturate(0.75);
  transition: filter 0.6s ease;
}

/* Полоса аномалии напряжения */
.anomaly-bar {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 16;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 5px;
  background: rgba(24, 12, 12, 0.88);
  border: 1px solid rgba(255, 118, 72, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.72), 0 0 12px rgba(255, 86, 56, 0.25);
  pointer-events: none;
}

.anomaly-bar.active {
  display: flex;
}

.anomaly-bar.critical {
  border-color: #ff4536;
  animation: anomalyPulse 0.75s ease-in-out infinite;
}

@keyframes anomalyPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 69, 54, 0.35); }
  50% { box-shadow: 0 0 20px rgba(255, 69, 54, 0.85); }
}

.anomaly-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #ffb299;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.anomaly-track {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: #2b1311;
  border: 1px solid rgba(255, 130, 90, 0.35);
  overflow: hidden;
}

.anomaly-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff4536 0%, #ffad42 100%);
  transition: width 0.12s linear;
}

.anomaly-time-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffd399;
  min-width: 26px;
  text-align: right;
}

/* Живая осциллограмма стетоскопа на сцене */
.stetho-hud {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 18;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(9, 14, 11, 0.92);
  border: 1px solid #486350;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.82);
}

.stetho-hud.active {
  display: flex;
}

.stetho-hud.mode-safe {
  border-color: #58b368;
  box-shadow: 0 0 14px rgba(88, 179, 104, 0.35);
}

.stetho-hud.mode-danger {
  border-color: #ff4f42;
  box-shadow: 0 0 16px rgba(255, 79, 66, 0.45);
}

#stetho-wave {
  width: 120px;
  height: 28px;
  background: #060a07;
  border: 1px solid #2b3a2f;
  border-radius: 4px;
  flex-shrink: 0;
}

.stetho-info {
  min-width: 0;
}

.stetho-readout {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #d6e4d8;
  line-height: 1.25;
}

.stetho-hud.mode-danger .stetho-readout { color: #ff8e85; }
.stetho-hud.mode-safe .stetho-readout { color: #84f599; }

.stetho-open-btn {
  padding: 5px 9px;
  border-radius: 4px;
  border: 1px solid #75e088;
  background: linear-gradient(180deg, #2e6b3b 0%, #1d4726 100%);
  color: #edfff0;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.8px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Единый нижний пульт инженера (.engineer-console) + Рация диспетчера */
.engineer-console {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background:
    linear-gradient(180deg, rgba(22, 27, 23, 0.95) 0%, rgba(11, 14, 12, 0.99) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  border-top: 1px solid rgba(196, 156, 86, 0.34);
  border-bottom: 2px solid #060807;
  box-shadow: inset 0 1px 0 rgba(232, 198, 134, 0.12), 0 -4px 14px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  z-index: 25;
  position: relative;
}

.engineer-console::before,
.engineer-console::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7d887f, #202521);
  border: 1px solid #0b0e0c;
  transform: translateY(-50%);
  pointer-events: none;
}

.engineer-console::before { left: 4px; }
.engineer-console::after { right: 4px; }

/* Пояс скиллов (#skill-belt) внутри .engineer-console */
.skill-belt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 1;
}

.skill-belt .skill-btn {
  flex: 1 1 0;
}

.radio-help-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(214, 170, 92, 0.65);
  background: linear-gradient(180deg, #43341b 0%, #261d0e 100%);
  color: #f8ebc8;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.9px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 224, 160, 0.2), 0 2px 8px rgba(0, 0, 0, 0.55);
  transition: transform 0.08s, border-color 0.14s, filter 0.14s;
}

.radio-help-btn:hover {
  border-color: #f4c668;
  filter: brightness(1.08);
}

.radio-help-btn:active {
  transform: scale(0.97);
}

.radio-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffaa3b;
  box-shadow: 0 0 8px rgba(255, 170, 59, 0.9);
  animation: ledBreath 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

.radio-svg-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.radio-tok-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(8, 11, 9, 0.88);
  border: 1px solid rgba(255, 200, 96, 0.5);
  color: #ffd980;
}

.skill-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 40px;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid rgba(164, 146, 108, 0.34);
  background: linear-gradient(180deg, #272f29 0%, #161b18 100%);
  color: #e6dfd0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.9px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 238, 198, 0.08), inset 0 -2px 5px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.52);
  transition: border-color 0.14s, background 0.14s, transform 0.08s, box-shadow 0.14s;
}

.skill-btn:active { transform: scale(0.97); }

.skill-btn.active {
  border-color: rgba(214, 172, 96, 0.82);
  background: linear-gradient(180deg, #3c301b 0%, #221b0f 100%);
  color: #f6e7c4;
  box-shadow:
    0 0 12px rgba(214, 172, 96, 0.32),
    inset 0 1px 0 rgba(255, 228, 172, 0.28),
    inset 0 -2px 6px rgba(0, 0, 0, 0.62);
}

#tool-uv.active {
  border-color: rgba(210, 170, 98, 0.78);
  background: linear-gradient(180deg, #2d2536 0%, #191521 100%);
  color: #ede1f7;
  box-shadow:
    0 0 14px rgba(176, 138, 214, 0.55),
    inset 0 1px 0 rgba(235, 214, 172, 0.24),
    inset 0 -2px 6px rgba(0, 0, 0, 0.68);
}

#tool-uv.low-bat .skill-badge {
  color: #ff8a7a;
  border-color: rgba(217, 94, 78, 0.5);
}

#tool-stetho.active {
  border-color: rgba(196, 166, 98, 0.78);
  background: linear-gradient(180deg, #243828 0%, #142117 100%);
  color: #e4efe2;
  box-shadow:
    0 0 12px rgba(124, 186, 132, 0.36),
    inset 0 1px 0 rgba(232, 216, 172, 0.24),
    inset 0 -2px 6px rgba(0, 0, 0, 0.65);
}

.skill-btn.skill-locked {
  opacity: 0.52;
  filter: saturate(0.55);
  border-style: dashed;
  border-color: rgba(146, 136, 112, 0.32);
  color: #aeb6ad;
}

.skill-lock-badge {
  display: none;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(10, 13, 11, 0.85);
  border: 1px solid rgba(196, 156, 86, 0.35);
  color: #d6b66f;
  flex-shrink: 0;
}

.skill-lock-badge svg {
  width: 10px;
  height: 10px;
  display: block;
}

.skill-btn.skill-locked .skill-lock-badge {
  display: inline-flex;
}

.skill-btn.skill-unlock-pulse {
  animation: skillUnlockPulse 1.1s ease-in-out 3;
}

@keyframes skillUnlockPulse {
  0%, 100% {
    box-shadow:
      0 0 0 rgba(232, 182, 86, 0),
      inset 0 1px 0 rgba(255, 238, 198, 0.14);
  }
  50% {
    border-color: #f4c668;
    box-shadow:
      0 0 18px rgba(244, 198, 104, 0.85),
      inset 0 0 10px rgba(244, 198, 104, 0.28);
  }
}

.skill-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.skill-svg-ico {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.78));
}
.skill-txt { overflow: hidden; text-overflow: ellipsis; }

.skill-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(8, 11, 9, 0.88);
  border: 1px solid rgba(196, 156, 86, 0.34);
  color: #e9c983;
  flex-shrink: 0;
}

.workshop-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5b254;
  box-shadow: 0 0 8px rgba(229, 178, 84, 0.85);
  display: none;
}

.workshop-dot.active { display: block; }

/* Drag-and-drop призрак и подсветка цели */
.drag-ghost {
  position: fixed;
  z-index: 120;
  transform: translate(-50%, -120%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 6px;
  background: rgba(16, 22, 18, 0.96);
  border: 1.5px solid rgba(206, 168, 96, 0.85);
  color: #f3ead4;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.86), 0 0 14px rgba(206, 168, 96, 0.32);
  pointer-events: none;
  white-space: nowrap;
}

.drag-ghost-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drag-ghost-ico .inv-prop-img,
.drag-ghost-ico .inv-svg-ico {
  width: 24px;
  height: 24px;
}

.drop-target-glow .optic-beacon {
  opacity: 1 !important;
}

.drop-target-glow .optic-beacon .optic-ring {
  transform: scale(1.12);
}

.drop-target-glow .diegetic-glint {
  opacity: 0.72 !important;
}

/* Отпечатки на кодовом замке при УФ-оптике Ур.2+ */
.key-btn.uv-fingerprint {
  border-color: #4ee8df;
  box-shadow: 0 0 12px rgba(78, 232, 223, 0.45), inset 0 0 10px rgba(152, 92, 255, 0.35);
  color: #aefcf7;
}

/* Стирание пыли и ржавчины пальцем (#modal-scratch) */
.scratch-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  border: 1px solid rgba(95, 80, 52, 0.55);
  background: rgba(38, 32, 22, 0.12);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #463a24;
}

.modal-card.rust-plate .scratch-tool-badge {
  border-color: rgba(246, 196, 106, 0.42);
  background: rgba(24, 15, 10, 0.6);
  color: #f6c46a;
}

.scratch-stage,
.scratch-box {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 210px;
  margin: 0 auto;
  border-radius: 6px;
  overflow: visible;
  border: 2px solid #594b34;
  background: rgba(0, 0, 0, 0.14);
  user-select: none;
  -webkit-user-select: none;
}

.scratch-underlay {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  touch-action: none;
  cursor: none;
  z-index: 2;
  transition: opacity 0.38s ease;
}

.scratch-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  pointer-events: none;
  z-index: 4;
}

.scratch-tool-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 118px;
  height: 68px;
  margin-left: -18px;
  margin-top: -12px;
  transform-origin: 18px 12px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.16s ease;
  will-change: transform, opacity;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.68));
}

.scratch-tool-cursor.type-dust {
  width: 116px;
  margin-left: -16px;
  margin-top: -12px;
  transform-origin: 16px 12px;
}

.scratch-tool-cursor.visible {
  opacity: 1;
}

.scratch-tool-cursor.is-idle {
  opacity: 0.96;
  animation: scratchIdleSweep 2.1s ease-in-out infinite;
}

@keyframes scratchIdleSweep {
  0%, 100% {
    transform: translate3d(118px, 98px, 0) rotate(-10deg);
  }
  50% {
    transform: translate3d(186px, 84px, 0) rotate(9deg);
  }
}

.scratch-tool-img {
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.scratch-tool-img.rust-scraper {
  width: 118px;
}

.scratch-tool-img.dust-brush {
  width: 116px;
}

.scratch-progress {
  margin-top: 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

/* Круговой циферблат часов-сейфа (#modal-clock) */
.clock-stetho-box {
  background: #0b110d;
  border: 1px solid #35473a;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
  text-align: center;
}

.clock-wave-svg {
  width: 100%;
  height: 36px;
  display: block;
}

.clock-resonance-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #9ec0a4;
  margin-top: 2px;
}

.clock-resonance-badge.hit {
  color: #79f592;
  text-shadow: 0 0 8px rgba(121, 245, 146, 0.65);
}

.clock-safe-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clock-dial-svg {
  width: 224px;
  height: 224px;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.72));
}

.clock-dial-svg:active { cursor: grabbing; }

.clock-time-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}

.clock-time-row .ecg-step-btn {
  width: auto;
  min-width: 56px;
  padding: 0 10px;
  font-size: 14px;
}

.clock-time-readout {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--nixie-amber);
  min-width: 146px;
  text-align: center;
  letter-spacing: 0.6px;
}

.clock-unlock-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.clock-unlock-btn.ready {
  box-shadow: 0 0 18px rgba(108, 240, 136, 0.55);
  border-color: #6cf088;
}

/* Выбор маршрута и статус в #modal-win */
.win-scrap-earned {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #2c4f31;
  text-align: center;
  margin-bottom: 8px;
}

.win-tactile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: rgba(28, 22, 13, 0.12);
  border: 1px solid rgba(59, 44, 24, 0.35);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #2b2112;
}

.win-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.win-workshop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid rgba(196, 156, 86, 0.52);
  background: linear-gradient(180deg, #2d352e 0%, #1c221d 100%);
  color: #f3e0b2;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.win-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.route-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 9px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  border: 1.5px solid #35543b;
  background: linear-gradient(180deg, #203424 0%, #142117 100%);
  color: #e6efe6;
  transition: transform 0.08s, filter 0.15s;
}

.route-card.risk {
  border-color: #7c3528;
  background: linear-gradient(180deg, #3d211b 0%, #26130f 100%);
  color: #f7e4df;
}

.route-card:active { transform: scale(0.98); }
.route-card:hover { filter: brightness(1.08); }

.route-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.8px;
}

/* Советские стеклянные приборные лампочки маршрута */
.route-lamp {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid #8a7343;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.35), inset 0 -2px 3px rgba(0, 0, 0, 0.65);
}

.route-lamp.safe {
  background: radial-gradient(circle at 35% 32%, #a2dfb0 0%, #4e8f5a 55%, #23472b 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.42), 0 0 8px rgba(78, 143, 90, 0.55);
}

.route-lamp.risk {
  background: radial-gradient(circle at 35% 32%, #ffb680 0%, #c94d2c 55%, #5c190d 100%);
  box-shadow: inset 0 1px 2px rgba(255, 232, 198, 0.42), 0 0 8px rgba(201, 77, 44, 0.6);
}

.route-desc {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.3;
  opacity: 0.88;
}

/* Мастерская кабины (#modal-workshop) */
.workshop-guide {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(196, 156, 86, 0.32);
  background: rgba(10, 14, 11, 0.88);
  box-shadow: inset 0 1px 0 rgba(232, 198, 134, 0.08);
}

.workshop-guide-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--nixie-amber);
  margin-bottom: 6px;
}

.workshop-guide-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.workshop-guide-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  line-height: 1.3;
  color: #d0dad1;
}

.workshop-guide-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.workshop-guide-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.75));
}

.workshop-guide-svg {
  width: 16px;
  height: 16px;
  display: block;
}

.workshop-guide-txt strong {
  color: #f3e0b2;
  font-weight: 700;
}

.workshop-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: rgba(11, 15, 12, 0.9);
  border: 1px solid rgba(196, 156, 86, 0.32);
  font-family: var(--font-mono);
  font-size: 13px;
}

.workshop-stat-val {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.workshop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.workshop-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(164, 146, 108, 0.28);
  background: linear-gradient(180deg, rgba(28, 34, 29, 0.92) 0%, rgba(16, 20, 17, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(232, 198, 134, 0.08);
}

.workshop-card.maxed {
  border-color: rgba(102, 178, 114, 0.65);
}

.workshop-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.workshop-card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 14px;
  color: #efe9d8;
}

.workshop-lv-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--nixie-amber);
  background: #0c100d;
  border: 1px solid rgba(196, 156, 86, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
}

.workshop-card-cur {
  font-size: 11px;
  color: #cdd8ce;
  line-height: 1.3;
}

.workshop-card-next {
  font-size: 10.5px;
  color: #9aa79b;
  line-height: 1.25;
}

.workshop-upgrade-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px;
  border-radius: 5px;
  border: 1px solid rgba(164, 146, 108, 0.32);
  background: #1f2721;
  color: #9ca79d;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.7px;
  cursor: pointer;
}

.workshop-upgrade-btn.can-afford {
  border-color: rgba(214, 170, 92, 0.8);
  background: linear-gradient(180deg, #5c4318 0%, #3a2a0e 100%);
  color: #f9eccb;
  box-shadow: inset 0 1px 0 rgba(255, 224, 160, 0.24);
}

.workshop-upgrade-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.workshop-ad-box {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid rgba(196, 156, 86, 0.34);
  background: rgba(11, 15, 12, 0.88);
  box-shadow: inset 0 1px 0 rgba(232, 198, 134, 0.08);
}

.workshop-ad-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--nixie-amber);
  margin-bottom: 7px;
  text-align: center;
}

.workshop-ad-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.workshop-ad-btn {
  padding: 8px 6px;
  border-radius: 5px;
  border: 1px solid rgba(214, 170, 92, 0.72);
  background: linear-gradient(180deg, #323c33 0%, #1c221d 100%);
  color: #f4ebd0;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 224, 160, 0.16);
}

.workshop-ad-btn:hover {
  border-color: #f0c975;
  background: linear-gradient(180deg, #3f4c40 0%, #242c25 100%);
}

@media (max-width: 640px) {
  .engineer-console {
    padding: 5px 8px;
    gap: 6px;
  }
  .engineer-console::before,
  .engineer-console::after {
    display: none;
  }
  .skill-belt {
    height: auto;
    gap: 5px;
    padding: 0;
    align-items: center;
  }
  .skill-btn {
    min-height: 36px;
    height: 36px;
    padding: 3px 4px;
    font-size: 12px;
    gap: 3px;
  }
  #tool-uv {
    flex: 1.32 1 0;
  }
  .skill-txt {
    flex-shrink: 0;
  }
  .radio-help-btn {
    min-height: 36px;
    height: 36px;
    padding: 4px 8px;
    font-size: 12px;
    gap: 4px;
  }
  .radio-svg-ico { width: 15px; height: 15px; }
  .radio-tok-badge { font-size: 9.5px; padding: 1px 4px; }
  .skill-prop-img { width: 18px; height: 18px; }
  .skill-svg-ico { width: 16px; height: 16px; }
  .skill-badge { font-size: 9px; padding: 1px 4px; }
  .workshop-grid { grid-template-columns: 1fr; }
  .workshop-ad-actions { grid-template-columns: 1fr; }
  .win-route-grid { grid-template-columns: 1fr; }
  #stetho-wave { width: 88px; height: 24px; }
  .stetho-readout { font-size: 9.5px; }
}

/* Десктоп (>= 960x520): крупная 16:9 сцена слева + заклёпанная советская стойка приборов справа */
@media (min-width: 960px) and (min-height: 520px) {
  #app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 184px;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .hud-top {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 6px 12px;
  }
  .mobile-cabin-header,
  .mobile-cabin-deck {
    display: none !important;
  }
  .stage-wrapper {
    grid-column: 1;
    grid-row: 2 / 4;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-bottom: none;
    border-right: 2px solid #2b352d;
  }
  .engineer-console {
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 10px 10px;
    border-top: none;
    border-left: 1px solid #354037;
    border-bottom: 2px solid #090c0a;
    background:
      linear-gradient(180deg, rgba(24, 30, 26, 0.96) 0%, rgba(14, 18, 15, 0.98) 100%),
      url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
    box-shadow: inset 1px 0 0 rgba(232, 198, 134, 0.08), inset 0 -2px 8px rgba(0, 0, 0, 0.55);
  }
  .engineer-console::before,
  .engineer-console::after {
    top: 6px;
    transform: none;
  }
  .engineer-console::before { left: 6px; }
  .engineer-console::after { right: 6px; }
  .skill-belt {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .skill-belt .skill-btn {
    flex: none;
    width: 100%;
    min-height: 38px;
    padding: 6px 9px;
    justify-content: flex-start;
    gap: 7px;
    font-size: 13.5px;
  }
  .skill-belt .skill-badge {
    margin-left: auto;
  }
  .radio-help-btn {
    width: 100%;
    min-height: 40px;
    padding: 6px 10px;
    justify-content: flex-start;
  }
  .radio-tok-badge {
    margin-left: auto;
  }
  .inventory-dock {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
    min-height: 0;
    gap: 8px;
    padding: 10px 10px 12px;
    border-left: 1px solid #354037;
    border-bottom: none;
    background:
      linear-gradient(180deg, rgba(20, 25, 21, 0.96) 0%, rgba(11, 14, 12, 0.99) 100%),
      url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
    box-shadow: inset 1px 0 0 rgba(232, 198, 134, 0.06), inset 0 2px 10px rgba(0, 0, 0, 0.65);
    position: relative;
  }
  .inventory-dock::before,
  .inventory-dock::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #869188, #232824);
    border: 1px solid #0e110f;
    pointer-events: none;
  }
  .inventory-dock::before { left: 6px; }
  .inventory-dock::after { right: 6px; }
  .inventory-dock-head {
    min-width: 0;
    gap: 3px;
  }
  .inventory-dock-hint {
    font-size: 9.5px;
    white-space: normal;
    line-height: 1.25;
  }
  .inventory-slots {
    flex: 0 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 68px;
    gap: 7px;
    height: auto;
  }
  .inv-slot {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 5px 4px;
    text-align: center;
  }
  .inv-prop-img {
    width: 28px;
    height: 28px;
  }
  .inv-slot-name {
    font-size: 9.5px;
    line-height: 1.15;
    text-align: center;
  }
}

/* Мобильный альбом (max-height: 520px и landscape): точное 16:9 без обрезки + плавающий HUD + тонкая стойка 96px */
@media (max-height: 520px) and (orientation: landscape) {
  #app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) calc(96px + env(safe-area-inset-right, 0px));
    grid-template-rows: auto minmax(0, 1fr);
    position: relative;
    height: 100dvh;
    overflow: hidden;
  }
  .hud-top {
    position: fixed;
    top: 0;
    left: 0;
    right: calc(96px + env(safe-area-inset-right, 0px));
    z-index: 26;
    min-height: 34px;
    padding: 4px 8px;
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, rgba(6, 9, 7, 0.72) 0%, rgba(6, 9, 7, 0.24) 65%, transparent 100%);
    border-bottom: none;
    box-shadow: none;
    pointer-events: none;
  }
  .hud-top .hud-group {
    pointer-events: auto;
    gap: 5px;
  }
  .hud-top .floor-display,
  .hud-top .energy-box,
  .hud-top .hud-btn {
    background: rgba(14, 19, 16, 0.78);
    backdrop-filter: blur(5px);
    min-height: 30px;
    padding: 3px 7px;
  }
  .hud-top .floor-label,
  .hud-top .energy-label {
    display: none;
  }
  .hud-top .floor-number {
    font-size: 15px;
    min-width: 20px;
  }
  .hud-top .floor-name-inline {
    font-size: 11.5px;
    max-width: 140px;
  }
  .hud-top .bulb {
    width: 9px;
    height: 9px;
  }
  .mobile-cabin-header,
  .mobile-cabin-deck {
    display: none !important;
  }
  .stage-wrapper {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-bottom: none;
    border-right: 1px solid #2b352d;
  }
  .stage-wrapper .scene-stage {
    max-width: 100%;
    max-height: 100%;
  }
  .engineer-console {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 6px 6px 5px;
    padding-right: max(6px, env(safe-area-inset-right, 0px));
    border-top: none;
    border-left: 1px solid #354037;
    border-bottom: 1px solid #090c0a;
  }
  .engineer-console::before,
  .engineer-console::after {
    display: none;
  }
  .skill-belt {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0;
    height: auto;
  }
  .skill-belt .skill-btn {
    flex: none;
    width: 100%;
    min-height: 29px;
    height: 29px;
    padding: 2px 5px;
    justify-content: flex-start;
    gap: 4px;
    font-size: 11px;
  }
  .skill-belt .skill-prop-img,
  .skill-belt .skill-svg-ico {
    width: 14px;
    height: 14px;
  }
  .skill-belt .skill-badge {
    margin-left: auto;
    font-size: 8.5px;
    padding: 0 3px;
  }
  .inventory-dock {
    grid-column: 2;
    grid-row: 2;
    padding-right: max(6px, env(safe-area-inset-right, 0px));
  }
  .modal-card {
    max-height: calc(92dvh - var(--sticky-banner-height));
    overflow-y: auto;
    padding: 10px 14px;
  }
  #modal-start .modal-card {
    padding: 12px 16px;
  }
  #modal-start .start-brand-header {
    margin-bottom: 8px;
  }
  #modal-start .start-emblem {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 10px;
  }
  #modal-start .modal-title {
    font-size: 19px;
  }
  #modal-start .modal-text {
    font-size: 13px;
    margin-bottom: 8px;
  }
  #modal-keypad .modal-card {
    padding: 36px 24px 36px;
  }
  #modal-keypad .key-btn {
    min-height: 38px;
    font-size: 18px;
  }
  .tutorial-card {
    padding: 11px 14px;
  }
  .tutorial-title {
    font-size: 17px;
  }
  .tutorial-body {
    font-size: 12.5px;
    margin-bottom: 8px;
  }
  .stage-toast {
    bottom: 10px;
    font-size: 12px;
    padding: 5px 12px;
  }
  .radio-help-btn {
    width: 100%;
    min-height: 28px;
    height: 28px;
    padding: 2px 4px;
    justify-content: flex-start;
    gap: 3px;
    font-size: 10.2px;
  }
  .radio-svg-ico { width: 12px; height: 12px; }
  .radio-tok-badge { margin-left: auto; font-size: 8.5px; padding: 0 3px; }
  .inventory-dock,
  .inventory-dock.has-items {
    grid-column: 2;
    grid-row: 2;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    padding: 5px 6px;
    gap: 4px;
    border: none;
    border-left: 1px solid #354037;
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(20, 25, 21, 0.96) 0%, rgba(11, 14, 12, 0.99) 100%),
      url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.65);
  }
  .inventory-dock-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    gap: 0;
  }
  .inventory-dock-hint {
    display: none;
  }
  .dock-title-full { display: none; }
  .dock-title-short { display: inline; }
  .inventory-dock-title {
    font-size: 9.5px;
    padding: 1px 5px;
  }
  .inventory-slots,
  .inventory-dock.has-items .inventory-slots {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 42px;
    gap: 4px;
    height: auto;
  }
  .inv-slot,
  .inventory-dock.has-items .inv-slot.filled {
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 0;
    padding: 2px;
    gap: 1px;
    text-align: center;
  }
  .inv-slot.empty,
  .inventory-dock.has-items .inv-slot.empty {
    display: flex;
  }
  .inv-prop-img,
  .inventory-dock.has-items .inv-prop-img,
  .inventory-dock.has-items .inv-svg-ico {
    width: 19px;
    height: 19px;
  }
  .inv-slot-name,
  .inventory-dock.has-items .inv-slot-name {
    font-size: 8.5px;
    line-height: 1.05;
    -webkit-line-clamp: 1;
    text-align: center;
  }
}

/* ============================================================================
   16. ГЛАВА V (ЭТАЖИ 41–50) И КИНЕМАТОГРАФИЧНЫЙ ФИНАЛ НА КРЫШЕ (#ending-cinema)
   ============================================================================ */
.ch5-nixie-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #101613 0%, #090d0b 100%);
  border: 1.5px solid #3c4d42;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffb84d;
  text-shadow: 0 0 10px rgba(255, 176, 62, 0.55);
}

.ch5-nixie-readout.ready {
  color: #7df796;
  border-color: #4f8c5e;
  text-shadow: 0 0 12px rgba(125, 247, 150, 0.58);
}

.ch5-toggles-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ch5-toggles-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.ch5-toggles-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.ch5-lever-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 7px;
  border: 2px solid #9c3128;
  background: linear-gradient(180deg, #a62b22 0%, #631610 100%);
  color: #fff3df;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1.3px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(166, 43, 34, 0.42), inset 0 1px 0 rgba(255, 200, 175, 0.32);
  transition: transform 0.1s ease, filter 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.ch5-lever-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  border-color: #f0b95b;
}

.ch5-lever-btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.985);
}

.ch5-lever-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.ch5-lever-btn.armed {
  background: linear-gradient(180deg, #c9392b 0%, #861c12 100%);
  border-color: #f4c86a;
  box-shadow: 0 0 22px rgba(244, 180, 74, 0.45), inset 0 1px 0 rgba(255, 224, 170, 0.42);
}

/* Золотая вспышка рассвета перед финалом */
.shock-flash.sunrise {
  background: radial-gradient(circle at 50% 45%, rgba(255, 244, 200, 0.96) 0%, rgba(255, 198, 98, 0.84) 55%, rgba(255, 162, 66, 0.65) 100%);
}

/* Полноэкранный кинематографичный финал на крыше */
.ending-cinema {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(max(22px, env(safe-area-inset-bottom)) + var(--sticky-banner-height)) max(16px, env(safe-area-inset-left));
  background: #0a0c0e;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.ending-cinema.open {
  display: flex;
  opacity: 1;
}

.ending-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  pointer-events: none;
  transform-origin: center center;
}

.ending-cinema.open .ending-bg {
  animation: endingKenBurns 18s ease-out forwards;
}

@keyframes endingKenBurns {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.09) translate3d(-1.2%, -1.5%, 0);
  }
}

.ending-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(255, 214, 138, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, rgba(8, 10, 12, 0.16) 0%, rgba(8, 10, 12, 0.52) 38%, rgba(7, 9, 11, 0.92) 72%, rgba(6, 7, 9, 0.97) 100%);
}

.ending-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  margin-top: auto;
  padding: 20px 22px 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(14, 17, 15, 0.72) 0%, rgba(10, 12, 11, 0.90) 100%);
  border: 1px solid rgba(236, 193, 112, 0.34);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.76), inset 0 1px 0 rgba(255, 224, 156, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}

.ending-badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid rgba(244, 198, 114, 0.55);
  background: rgba(34, 27, 15, 0.65);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: #ffd78a;
}

.ending-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(24px, 4.2vw, 34px);
  letter-spacing: 1.8px;
  color: #fff4da;
  text-shadow: 0 2px 14px rgba(255, 195, 96, 0.35);
}

.ending-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  text-align: left;
}

.ending-p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.54;
  color: #ede6d6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(8px);
}

.ending-cinema.open .ending-p.p1 {
  animation: endingTextIn 0.75s ease-out 0.3s forwards;
}

.ending-cinema.open .ending-p.p2 {
  animation: endingTextIn 0.75s ease-out 0.9s forwards;
}

.ending-cinema.open .ending-p.p3 {
  animation: endingTextIn 0.75s ease-out 1.5s forwards;
}

@keyframes endingTextIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ending-stats {
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 6px;
  background: rgba(24, 30, 26, 0.72);
  border: 1px solid rgba(162, 186, 156, 0.24);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #cfe4be;
}

.ending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.ending-actions > button {
  flex: 1 1 220px;
  max-width: 320px;
  min-height: 44px;
}

.ending-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

.ending-btn-vk {
  background: #2b4c6f;
  color: #eef5ff;
  border-color: #4f7bab;
}

.ending-btn-replay {
  background: #3b3526;
  color: #f3ead0;
}

.ending-credits {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  color: #e6be6c;
  opacity: 0.92;
}

.f49-celestial-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #16140f 0%, #0d0c09 100%);
  border: 1.5px solid #594927;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #f0cf84;
  text-align: center;
}

.f49-celestial-readout.ready {
  color: #88f59d;
  border-color: #4f8c5e;
}

.f49-sphere-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.f49-celestial-hint {
  font-size: 11.5px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .ending-panel {
    padding: 15px 14px 14px;
  }
  .ending-p {
    font-size: 13.5px;
    line-height: 1.46;
  }
  .ending-stats {
    font-size: 11.5px;
  }
  .ch5-toggles-5 {
    gap: 4px;
  }
  .ch5-toggles-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   WAVE 2: ТАБЛИЦЫ ВЫВОДОВ, МАТРИЦА СУММ 4x4, КЛАПАНЫ И ШЕСТЕРНИ
   ========================================================================== */
.f06-wiring-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 6px;
  background: #0c130e;
  border: 1px solid #3c4d40;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #e6dcc2;
}

.f06-wiring-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.f06-wiring-row strong {
  color: #f4cc72;
}

.stamps-rules {
  background: rgba(45, 32, 18, 0.1);
  border: 1px solid #8a7852;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #2f2012;
}

.stamps-rules div + div {
  margin-top: 2px;
}

.maze-status-bar {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #bfe4ff;
  background: #0c233d;
  border: 1px solid #488bc4;
  border-radius: 5px;
  padding: 5px 8px;
  margin-bottom: 8px;
}

.maze-cell.kpp2 {
  border-color: #ffd36a;
  background: rgba(98, 72, 22, 0.88);
  color: #ffe9ad;
  font-weight: 700;
}

.maze-cell.kpp2.visited {
  border-color: #70f088;
  background: rgba(26, 84, 42, 0.9);
  color: #baffc7;
}

.f29-tab-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 10px;
  background: #0d1410;
  border: 1px solid #435749;
  border-radius: 6px;
  overflow: hidden;
}

.f29-tab-table th,
.f29-tab-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid rgba(95, 120, 102, 0.25);
}

.f29-tab-table th {
  background: #17231c;
  color: #f4cc72;
  font-size: 11.5px;
}

.f29-tab-table td.card-name {
  text-align: left;
  padding-left: 8px;
  color: #d6e4da;
  font-weight: 700;
}

.f29-tab-table tr.sum-row td {
  background: #15241b;
  color: #84ff9e;
  font-weight: 700;
  border-bottom: none;
}

.f30-valves-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.f30-valve-btn {
  padding: 8px 6px;
  border-radius: 7px;
  border: 1.5px solid #8a6e37;
  background: linear-gradient(180deg, #322817 0%, #1c160c 100%);
  color: #f6e7c4;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
}

.f30-valve-btn:hover {
  border-color: #f0c469;
}

.f30-valve-btn:active {
  transform: scale(0.96);
}

.f30-valve-btn strong {
  font-size: 12.5px;
  color: #ffd678;
}

.f30-valve-btn span {
  font-size: 10.5px;
  color: #cfd9cd;
}

.f36-slots-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.f36-slot-btn {
  padding: 8px 5px;
  border-radius: 7px;
  border: 1.5px solid #594b30;
  background: #141915;
  color: #e6dcc2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
}

.f36-slot-btn.active {
  border-color: #f0c469;
  box-shadow: 0 0 10px rgba(240, 196, 105, 0.35);
}

.f36-slot-btn.filled {
  border-color: #65cb7c;
  background: #132118;
}

.f36-gear-tray {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.f36-gear-chip {
  padding: 7px 4px;
  border-radius: 6px;
  border: 1.5px solid #6e5a33;
  background: linear-gradient(180deg, #2d2515 0%, #1a150b 100%);
  color: #f6dc9e;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.f36-gear-chip.used {
  opacity: 0.42;
}

.matrix-grid-4x4 {
  display: grid;
  grid-template-columns: repeat(3, 72px) 52px;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid #455249;
  background:
    linear-gradient(180deg, rgba(20, 26, 22, 0.9) 0%, rgba(10, 14, 12, 0.96) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
}

.matrix-grid-4x4 .matrix-cell.relay-glass-btn {
  width: 72px;
  height: 72px;
}

.matrix-target-cell {
  height: 44px;
  border-radius: 6px;
  border: 1.5px solid #6c5933;
  background: #18140d;
  color: #ffd37a;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}

.matrix-target-cell.ok {
  border-color: #5ee67c;
  background: #122a19;
  color: #9cffb2;
  box-shadow: 0 0 10px rgba(94, 230, 124, 0.3);
}

.matrix-corner-cell {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8fb8a2;
}

@media (max-width: 420px) {
  .matrix-grid-4x4 {
    grid-template-columns: repeat(3, 64px) 46px;
    gap: 6px;
    padding: 8px;
  }
  .matrix-grid-4x4 .matrix-cell.relay-glass-btn {
    width: 64px;
    height: 64px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .ending-cinema {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 14px;
  }
  .ending-panel {
    margin-top: 0;
    padding: 14px 16px;
  }
  .ending-paragraphs {
    gap: 6px;
    margin-bottom: 10px;
  }
  .ending-p {
    font-size: 13px;
    line-height: 1.4;
  }
}

/* ==========================================================================
   ИНТЕРАКТИВНЫЙ МИНИ-ИНСТРУКТАЖ (4 ШАГА С ПОДСВЕТКОЙ ЭЛЕМЕНТОВ)
   ========================================================================== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: none;
  pointer-events: auto;
}

.tutorial-overlay.open {
  display: block;
}

.tutorial-spotlight {
  position: fixed;
  pointer-events: none;
  border: 2px solid rgba(255, 208, 114, 0.92);
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(4, 7, 5, 0.78),
    0 0 24px rgba(255, 198, 92, 0.52),
    inset 0 0 18px rgba(255, 212, 128, 0.16);
  transition:
    top 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(372px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(25, 31, 26, 0.97) 0%, rgba(13, 17, 14, 0.98) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  border: 1.5px solid rgba(232, 194, 116, 0.62);
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 226, 160, 0.18);
  color: #eef3ea;
  z-index: 94;
}

.tutorial-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--nixie-amber);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tutorial-title {
  margin: 0 0 7px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.9px;
  color: #fff2d4;
}

.tutorial-body {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.48;
  color: #d7e2d5;
}

.tutorial-body strong {
  color: #ffe3a3;
}

.tutorial-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 12px;
}

.tutorial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(180, 196, 178, 0.28);
  transition: background 0.2s ease, transform 0.2s ease;
}

.tutorial-dot.active {
  background: var(--nixie-amber);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.75);
}

.tutorial-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutorial-skip-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid rgba(154, 172, 152, 0.34);
  background: rgba(24, 30, 26, 0.85);
  color: #b7c4b5;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.9px;
  cursor: pointer;
}

.tutorial-skip-btn:hover {
  border-color: rgba(226, 194, 126, 0.65);
  color: #f3e4c2;
}

.tutorial-next-btn {
  flex: 1 1 auto;
  min-height: 42px;
  margin: 0;
  font-size: 14.5px;
}

/* ==========================================================================
   ЭКРАН ПОВОРОТА ТЕЛЕФОНА В АЛЬБОМНЫЙ РЕЖИМ (LANDSCAPE-FIRST)
   ========================================================================== */
.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 98;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 42%, rgba(20, 26, 21, 0.94) 0%, rgba(6, 9, 7, 0.98) 100%);
  backdrop-filter: blur(10px);
}

@media (max-width: 760px) and (orientation: portrait) {
  body:not(.portrait-allowed) .rotate-overlay {
    display: flex;
  }
}

.rotate-card {
  width: min(336px, 100%);
  padding: 26px 22px 20px;
  border-radius: 12px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(25, 31, 26, 0.96) 0%, rgba(12, 16, 13, 0.98) 100%),
    url('../assets/ui/soviet_steel.webp?v=48') center / cover no-repeat;
  border: 1.5px solid rgba(232, 194, 116, 0.45);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 224, 156, 0.14);
}

.rotate-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--nixie-amber);
  margin-bottom: 14px;
}

.rotate-phone-anim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
}

.rotate-phone-svg {
  width: 68px;
  height: 68px;
  animation: rotatePhoneHint 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255, 196, 90, 0.35));
}

@keyframes rotatePhoneHint {
  0%, 18%   { transform: rotate(0deg); }
  48%, 72%  { transform: rotate(-90deg); }
  92%, 100% { transform: rotate(0deg); }
}

.rotate-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 1px;
  color: #fff2d4;
}

.rotate-desc {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #c5d1c3;
}

.rotate-dismiss-btn {
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid rgba(154, 172, 152, 0.28);
  background: rgba(20, 26, 22, 0.72);
  color: #9eb09c;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.rotate-dismiss-btn:hover {
  border-color: rgba(232, 194, 116, 0.55);
  color: #f0dfb4;
}

/* ==========================================================================
   ФОРМА ОБРАЩЕНИЯ В ПОДДЕРЖКУ (#modal-support — без открытого email в UI)
   ========================================================================== */
.settings-support-open-btn {
  border-color: rgba(212, 174, 96, 0.55);
  color: #f2dfb1;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.support-field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #c8d6c4;
  text-transform: uppercase;
}

.support-input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid rgba(154, 174, 152, 0.34);
  background: rgba(11, 15, 12, 0.92);
  color: #eef4ec;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

.support-input:focus {
  border-color: var(--nixie-amber);
  box-shadow: 0 0 0 2px rgba(255, 184, 77, 0.18);
}

.support-textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.4;
}

.support-auto-note {
  font-size: 11.5px;
  line-height: 1.35;
  color: #96a894;
}

.support-form-status {
  min-height: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
  color: #f4d286;
}

.support-form-status.ok {
  color: #7ee890;
}

.support-form-status.err {
  color: #ff9c8a;
}
