/* ==========================================================================
   Панорамы Великих Лук — оформление
   Тёмная тема, «стеклянные» панели, без внешних шрифтов и зависимостей.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg-0: #07090d;
  --panel: rgba(17, 22, 31, 0.72);
  --panel-2: rgba(30, 38, 51, 0.62);
  --panel-3: rgba(255, 255, 255, 0.055);
  --stroke: rgba(255, 255, 255, 0.085);
  --stroke-strong: rgba(255, 255, 255, 0.18);

  --text: #e9eef6;
  --muted: #97a3b6;
  --muted-2: #74808f;
  --accent: #7cc0ff;
  --accent-2: #b18cff;
  --danger: #ff9a86;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(1100px 720px at 12% -10%, rgba(52, 92, 148, 0.42), transparent 62%),
    radial-gradient(900px 640px at 96% 0%, rgba(108, 72, 158, 0.32), transparent 58%),
    radial-gradient(900px 640px at 50% 118%, rgba(28, 74, 92, 0.3), transparent 62%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: 0.01em;
}

kbd {
  display: inline-block;
  min-width: 1.35em;
  padding: 0 5px;
  border: 1px solid var(--stroke-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
  font-size: 0.86em;
  line-height: 1.5;
  text-align: center;
  color: #dbe6f5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: fixed;
  inset: 50% 0 auto 0;
  transform: translateY(-50%);
  margin: 0;
  text-align: center;
  color: var(--text);
}

/* ------------------------------------------------------------- каркас ---- */

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  height: 100vh;
  height: 100dvh;
  padding: 14px 16px;
}

/* ------------------------------------------------------------ шапка ------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #7cc0ff, #b18cff, #6fe3c8, #7cc0ff);
  box-shadow: 0 8px 20px rgba(124, 192, 255, 0.22);
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #0b1017;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand__text {
  min-width: 0;
}

.brand__title {
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__subtitle {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* ----------------------------------------------------------- кнопки ------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, color 0.18s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--stroke-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn[aria-pressed="true"] {
  border-color: rgba(124, 192, 255, 0.55);
  background: linear-gradient(135deg, rgba(124, 192, 255, 0.28), rgba(177, 140, 255, 0.26));
  color: #fff;
}

.btn--primary {
  border-color: rgba(124, 192, 255, 0.55);
  background: linear-gradient(135deg, rgba(124, 192, 255, 0.32), rgba(177, 140, 255, 0.3));
  color: #fff;
}

.btn svg {
  flex: 0 0 auto;
  opacity: 0.9;
}

/* ----------------------------------------------------------- раскладка --- */

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

/* ------------------------------------------------------------ сайдбар ---- */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 10px 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
  margin-bottom: 10px;
}

.sidebar__title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 2px 6px 2px 2px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.gallery::-webkit-scrollbar {
  width: 8px;
}

.gallery::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.gallery::-webkit-scrollbar-track {
  background: transparent;
}

.gallery__item {
  flex: 0 0 auto;
}

.sidebar__note {
  margin: 6px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--stroke-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
}

.sidebar__hint {
  margin: 10px 6px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-2);
}

/* ------------------------------------------------------- карточка --------- */

.card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.032);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--stroke);
  transform: translateY(-1px);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card.is-active {
  border-color: rgba(124, 192, 255, 0.45);
  background: linear-gradient(135deg, rgba(124, 192, 255, 0.19), rgba(177, 140, 255, 0.12));
  box-shadow: inset 3px 0 0 var(--accent);
}

.card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 9px;
  background:
    linear-gradient(135deg, #1b2533, #0d131b);
}

.card__thumb img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.34);
  letter-spacing: 0.04em;
}

.card__body {
  min-width: 0;
}

.card__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card__desc {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------ сцена ------ */

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: #05070b;
  box-shadow: var(--shadow);
  outline: none;
}

.stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.stage__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.stage.is-dragging .stage__canvas {
  cursor: grabbing;
}

.stage__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(115% 88% at 50% 48%, transparent 52%, rgba(0, 0, 0, 0.46) 100%);
}

/* ------------------------------------------------------- загрузка -------- */

.stage__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
  background: radial-gradient(60% 60% at 50% 50%, rgba(6, 9, 14, 0.55), transparent 70%);
  animation: fade-in 0.25s ease both;
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--accent);
  border-right-color: rgba(177, 140, 255, 0.8);
  animation: spin 0.9s linear infinite;
}

.stage__loading-text {
  margin: 0;
  padding: 7px 14px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------------------------------------------------------- ошибка ------- */

.stage__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(6, 9, 14, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.25s ease both;
}

.error-card {
  max-width: 430px;
  padding: 22px 22px 18px;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  background: rgba(18, 23, 32, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-card__title {
  font-size: 16px;
  color: #fff;
}

.error-card__text {
  margin: 8px 0 0;
  font-size: 12.8px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.error-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

/* --------------------------------------------------------- подпись ------- */

.stage__caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(560px, calc(100% - 96px));
  padding: 11px 15px 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(10, 14, 20, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

.stage__caption-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stage__title {
  font-size: 16.5px;
  line-height: 1.25;
  color: #fff;
  overflow-wrap: anywhere;
}

.stage__counter {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted-2);
}

.stage__desc {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------- подсказка --- */

.stage__hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(92%, 640px);
  margin: 0;
  padding: 7px 15px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 11.8px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

/* -------------------------------------------------------------- зум ----- */

.stage__zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: rgba(10, 14, 20, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--stroke-strong);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------- полоса ------- */

.strip {
  display: none;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.strip__list {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 9px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.strip__list::-webkit-scrollbar {
  height: 6px;
}

.strip__list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.strip .gallery__item {
  flex: 0 0 auto;
  width: 138px;
  scroll-snap-align: start;
}

.strip .card {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 5px;
}

.strip .card__desc {
  display: none;
}

.strip .card__title {
  font-size: 11.5px;
  -webkit-line-clamp: 1;
}

/* ------------------------------------------------------------ подвал ----- */

.footer {
  padding: 0 2px 2px;
  font-size: 11.5px;
  text-align: center;
  color: var(--muted-2);
}

/* -------------------------------------------------- полноэкранный режим -- */

.stage:fullscreen,
.stage:-webkit-full-screen {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.stage:fullscreen .stage__caption,
.stage:-webkit-full-screen .stage__caption {
  max-width: min(620px, calc(100% - 96px));
}

.stage::backdrop {
  background: #000;
}

/* --------------------------------------------------------- адаптивность - */

@media (max-width: 900px) {
  .app {
    gap: 9px;
    padding: 9px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .strip {
    display: block;
  }

  .brand__subtitle {
    display: none;
  }

  .stage__hint {
    font-size: 10.8px;
    padding: 6px 12px;
    max-width: 94%;
  }

  .stage__caption {
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 78px);
    padding: 9px 12px 10px;
  }

  .stage__title {
    font-size: 14.5px;
  }

  .stage__desc {
    font-size: 11.5px;
  }

  .stage__zoom {
    right: 10px;
    bottom: 10px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 7px 10px;
    gap: 8px;
  }

  .brand__mark {
    width: 28px;
    height: 28px;
  }

  .brand__mark::after {
    inset: 7px;
  }

  .brand__title {
    font-size: 13px;
  }

  .btn {
    padding: 7px 11px;
    font-size: 11.5px;
  }

  /* на узких экранах подписи кнопок скрываем — остаются иконки */
  .btn span {
    display: none;
  }

  .footer {
    font-size: 10.5px;
  }
}

@media (max-width: 380px) {
  .stage__hint {
    top: 8px;
    padding: 5px 10px;
    font-size: 10px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------- режим встраивания --- */
/* ?embed=1 — просмотрщик стоит внутри страницы сайта: шапка сайта уже есть
   снаружи, поэтому убираем дублирующее название и подвал, оставляя только
   панель управления. */

.is-embed .brand {
  display: none;
}

.is-embed .footer {
  display: none;
}

.is-embed .app {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 10px;
  gap: 10px;
}

.is-embed .topbar {
  justify-content: flex-end;
  padding: 6px 10px;
}