:root {
  --tour-bg: #081018;
  --tour-panel: rgba(8, 16, 24, 0.78);
  --tour-panel-strong: rgba(8, 16, 24, 0.94);
  --tour-border: rgba(255, 255, 255, 0.12);
  --tour-text: #f4f7fb;
  --tour-muted: rgba(244, 247, 251, 0.72);
  --tour-accent: #4dd2c5;
  --tour-accent-2: #f59e0b;
  --tour-danger: #ef4444;
  --tour-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(77, 210, 197, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 30%),
    linear-gradient(180deg, #061018 0%, #03070d 100%);
  color: var(--tour-text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#tour {
  position: absolute;
  inset: 0;
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(0, 2fr) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 7, 13, 0) 0%, rgba(3, 7, 13, 0.42) 30%, rgba(3, 7, 13, 0.88) 100%);
}

.hud__left,
.hud__thumbs,
.hud__right {
  pointer-events: auto;
}

.hud__left {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--tour-border);
  border-radius: 18px;
  background: var(--tour-panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--tour-shadow);
}

.hud__title {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud__subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--tour-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud__thumbs {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding: 10px 6px;
  scrollbar-width: thin;
}

.scene-thumb {
  flex: 0 0 auto;
  width: 132px;
  height: 72px;
  border: 1px solid var(--tour-border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  position: relative;
  background: var(--tour-panel);
  box-shadow: var(--tour-shadow);
  cursor: pointer;
  color: var(--tour-text);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.scene-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 210, 197, 0.46);
}

.scene-thumb.is-active {
  border-color: rgba(77, 210, 197, 0.9);
  box-shadow: 0 0 0 1px rgba(77, 210, 197, 0.25), var(--tour-shadow);
}

.scene-thumb__image {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(1.02) contrast(1.03);
}

.scene-thumb__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(3, 7, 13, 0.22) 42%, rgba(3, 7, 13, 0.88) 100%);
}

.scene-thumb__label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hud__right {
  display: flex;
  align-items: stretch;
}

.hud__button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 0 18px;
  min-height: 48px;
  color: var(--tour-text);
  background: linear-gradient(180deg, rgba(77, 210, 197, 0.18), rgba(77, 210, 197, 0.06));
  box-shadow: var(--tour-shadow);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hud__button:hover {
  border-color: rgba(77, 210, 197, 0.6);
}

.boot {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 13, 0.82);
  color: var(--tour-text);
  font-size: 15px;
  letter-spacing: 0.03em;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(12px);
}

.modal__panel {
  position: relative;
  width: min(1100px, 100%);
  max-height: min(88vh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tour-border);
  border-radius: 24px;
  background: var(--tour-panel-strong);
  box-shadow: var(--tour-shadow);
}

.modal__header {
  padding: 16px 56px 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--tour-text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal__content {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 14px;
}

.modal__content img,
.modal__content video {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 120px);
  border-radius: 16px;
  background: #000;
}

.modal__content video {
  width: 100%;
}

.tour-marker {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
  user-select: none;
}

.tour-marker--navigation {
  background: linear-gradient(180deg, rgba(77, 210, 197, 0.98), rgba(14, 116, 144, 0.98));
}

.tour-marker--image {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.98), rgba(180, 83, 9, 0.98));
}

.tour-marker--video {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.98), rgba(153, 27, 27, 0.98));
}

.tour-marker__icon {
  display: inline-block;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .hud {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hud__left {
    order: 1;
  }

  .hud__thumbs {
    order: 2;
  }

  .hud__right {
    order: 3;
    justify-content: flex-end;
  }

  .scene-thumb {
    width: 116px;
    height: 66px;
  }
}

