  /* Оверлей — плавное появление затемнения */
  .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.75);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
      backdrop-filter: blur(2px);
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
      transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Состояние загрузки — скелетон вместо картинки */
  .slide-stage .tour-img {
      opacity: 1;
      transition: opacity 0.3s ease;
  }

  .slide-stage.loading .tour-img {
      opacity: 0;
  }

  .slide-stage .img-placeholder {
      position: absolute;
      top: 12px;
      left: 12px;
      right: 12px;
      bottom: 12px;
      background: linear-gradient(135deg, #e8edf2 0%, #f5f7fa 50%, #e8edf2 100%);
      background-size: 200% 200%;
      border-radius: 20px;
      animation: shimmer 1.5s ease-in-out infinite;
      z-index: 1;
      transition: opacity 0.3s ease;
  }

  .slide-stage:not(.loading) .img-placeholder {
      opacity: 0;
      pointer-events: none;
  }

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

  /* Кнопка вызова */
  .launch-btn {
      background: #1e3c72;
      border: none;
      color: white;
      font-size: 1.3rem;
      font-weight: 500;
      padding: 12px 28px;
      border-radius: 48px;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      transition: background 0.2s;
      letter-spacing: 0.5px;
  }

  .launch-btn:hover {
      background: #0f2a4a;
  }

  /* Модальное окно */
  .modal-container {
      background: white;
      max-width: 1082px;
      width: 96%;
      max-height: 94vh;
      max-height: 94dvh;
      display: flex;
      flex-direction: column;
      border-radius: 28px;
      box-shadow: 0 25px 40px rgba(0, 0, 0, 0.25);
      overflow: hidden;
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                  opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      animation: fadeSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
      transform-origin: center center;
  }

  @keyframes fadeSlideUp {
      from {
          opacity: 0;
          transform: translateY(24px) scale(0.96);
      }

      to {
          opacity: 1;
          transform: translateY(0) scale(1);
      }
  }

  /* Заголовок-подпись слайда (текст сверху) */
  .title-bar {
      display: block;
      text-align: center;
      background: #12263a;
      color: #f4d370;
      font-size: 1.15rem;
      font-weight: 700;
      padding: 9px 18px;
      border-radius: 14px;
      margin: 4px auto 2px auto;
      width: max-content;
      max-width: 96%;
      flex-shrink: 0;
      box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  }

  /* Сцена слайда: картинка + наложенные элементы управления */
  .slide-stage {
      position: relative;
      display: inline-block;
      line-height: 0;
  }

  .guide-overlay {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 2;
  }

  /* Кнопка (мобильная версия) */
  .gbtn {
      position: absolute;
      transform: translate(-50%, -50%);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      aspect-ratio: 1;
      background: rgba(18, 20, 40, 0.45);
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
      color: #f6f7f8;
      font-family: monospace;
      font-weight: 700;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  }

  .gbtn-fire { box-shadow: inset 0 0 0 2px #ff6b5e; }
  .gbtn-torp { box-shadow: inset 0 0 0 2px #44ddff; }
  .gbtn-spec { box-shadow: inset 0 0 0 2px #5af57c; }

  .gbtn.lit {
      background: #2ecc71;
      color: #ffffff;
      box-shadow: 0 0 16px rgba(46, 204, 113, 0.95), inset 0 0 0 2px #ffffff;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  /* Клавиша (ПК) */
  .gkey {
      position: absolute;
      transform: translate(-50%, -50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      border-radius: 9px;
      background: rgba(20, 26, 42, 0.8);
      border: 1px solid #3a6a8a;
      color: #ffffff;
      font-family: monospace;
      font-weight: 700;
      line-height: 1;
  }

  .gkey i {
      line-height: 1;
      color: #a9c4e0;
  }

  .gkey.lit {
      background: #2ecc71;
      color: #ffffff;
      border-color: #2ecc71;
      box-shadow: 0 0 14px rgba(46, 204, 113, 0.9);
  }

  .gkey.lit i { color: #d8f0e0; }

  /* Область картинки */
  .image-area {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px;
      text-align: center;
      background: #ffffff;
  }

  .tour-img {
      max-width: 100%;
      max-height: calc(94vh - 220px);
      max-height: calc(94dvh - 220px);
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: 20px;
      display: block;
      margin: 0 auto;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      background: #f5f7fa;
  }

  /* Индикатор шага */
  .step-counter {
      text-align: center;
      font-size: 0.85rem;
      color: #4b5563;
      background: #f9fafb;
      padding: 8px 0 4px 0;
      letter-spacing: 0.3px;
      font-weight: 500;
      flex-shrink: 0;
  }

  /* Группа кнопок «Закрыть» + «Далее» справа */
  .btn-group {
      display: flex;
      align-items: center;
      gap: 12px;
  }

  /* Блок кнопок */
  .button-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 28px 28px 28px;
      background: white;
      border-top: 1px solid #eef2f6;
      flex-shrink: 0;
  }

  .nav-btn {
      font-size: 1rem;
      font-weight: 600;
      padding: 10px 24px;
      border-radius: 60px;
      border: none;
      cursor: pointer;
      transition: all 0.2s;
      background: #f1f3f7;
      color: #1f2a44;
      min-width: 100px;
  }

  .nav-btn.primary-btn {
      background: #1e3c72;
      color: white;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  }

  .nav-btn.primary-btn:hover {
      background: #0f2f54;
      transform: scale(0.97);
  }

  .nav-btn:active {
      transform: scale(0.96);
  }

  .nav-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none;
      background: #e2e8f0;
      color: #5c6b7e;
  }

  @media (max-width: 480px) {
      .modal-container {
          width: 95%;
      }

      .nav-btn {
          padding: 8px 18px;
          min-width: 80px;
          font-size: 0.9rem;
      }

      .image-area {
          padding: 20px 18px 10px 18px;
      }

      .button-bar {
          padding: 16px 20px 24px 20px;
      }
  }

  @media (orientation: landscape) and (max-height: 500px) {
      .modal-container {
          max-height: 96vh;
          max-height: 96dvh;
      }

      .tour-img {
          max-height: calc(96vh - 150px);
          max-height: calc(96dvh - 150px);
      }

      .image-area {
          padding: 8px 14px;
      }

      .step-counter {
          padding: 4px 0 2px 0;
      }

      .button-bar {
          padding: 8px 14px 10px 14px;
      }

      .nav-btn {
          padding: 8px 14px;
          min-width: 70px;
          font-size: 0.9rem;
      }
  }
