@font-face {
  font-family: "Designosaur";
  src:
    url("/wp-content/themes/lucasandboo/quest-data/fonts/designosaur/Designosaur-Regular.woff2")
      format("woff2"),
    url("/wp-content/themes/lucasandboo/quest-data/fonts/designosaur/Designosaur-Regular.woff")
      format("woff"),
    url("/wp-content/themes/lucasandboo/quest-data/fonts/designosaur/Designosaur-Regular.ttf")
      format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Designosaur";
  src:
    url("/wp-content/themes/lucasandboo/quest-data/fonts/designosaur/Designosaur-Italic.woff2")
      format("woff2"),
    url("/wp-content/themes/lucasandboo/quest-data/fonts/designosaur/Designosaur-Italic.woff")
      format("woff"),
    url("/wp-content/themes/lucasandboo/quest-data/fonts/designosaur/Designosaur-Italic.ttf")
      format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Lumos";
  src:
    url("/wp-content/themes/lucasandboo/quest-data/fonts/lumos/AA-Lumos-Caps.woff2")
      format("woff2"),
    url("/wp-content/themes/lucasandboo/quest-data/fonts/lumos/AA-Lumos-Caps.woff")
      format("woff"),
    url("/wp-content/themes/lucasandboo/quest-data/fonts/lumos/AA-Lumos-Caps.ttf")
      format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Шрифты */
  /* Основной шрифт */
  --font-family: "Designosaur", sans-serif;
  /* Шрифт на лого */
  --second-family: "Lumos", sans-serif;

  /* Цвета */
  --color-auth-text: #532e2c;
  /* основной текст со страниц регистрации и входа */
  --color-auth-hint: #c81c12;
  --background-primary: #251709;
  --color-button-background: #5e1200;
  --color-button-text: #f2a207;
  --color-header-accent: #ffb70c;
  --color-audio-text: #e8e5dc;

  /* Размер шрифта */
  --primary-font-size: clamp(14px, 1.23vw, 18px);
  --choice-font-size: clamp(14px, 1.36vw, 20px);

  /* Адаптивная высота обрезанного края блоков */
  --tear-height: clamp(46px, min(4.37vw, 8.75vh), 68px);
}

/* Базовые стили */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.quest-app {
  font-family: var(--font-family);
  font-size: var(--primary-font-size);
  line-height: 135%;
  color: var(--color-auth-text);
  /*background: #fff8e7;*/
  /* min-height: 100vh; */
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  /* overflow-x: hidden; */
  height: 100vh;
  overflow: hidden;
}

.quest-app::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #ffd76b33 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}

/* ХЕДЕР */
.quest-header {
  width: 100%;
  background: var(--background-primary);
  color: var(--color-header-accent);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.header-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 20px;
}

.quest-topbar {
  width: 100%;
  max-width: 1440px;
  padding: 10px 20px 3px;
  color: var(--color-header-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 2;
}

.quest-topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(20px, 25.62vw, 369px);
}

.quest-topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 80px);
}

.quest-contact-btn {
  border: 1px solid var(--color-header-accent) !important;
  font-size: clamp(14px, 1.25vw, 18px) !important;
  border-radius: 48px;
  padding: 5px 20px;
  transition: all 0.1s;
}

.quest-contact-btn,
.quest-map-btn,
.quest-agent-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  text-align: center;
  background-color: transparent;
  cursor: pointer;
  border: none;
}

.quest-agent-btn {
  cursor: default;
  text-transform: uppercase;
}

.progress-wrap {
  width: 100%;
  max-width: 1440px;
  padding: 0 20px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-badge {
  text-align: center;
  font-size: 14px;
  color: #f0a304;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border: 1px solid var(--color-header-accent);
  border-radius: 12px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--color-header-accent);
  transition: width 0.4s ease;
}

.quest-logo {
  font-family: var(--second-family);
  font-size: clamp(20px, 1.8vw, 26px);
  letter-spacing: -0.03em;
  margin-top: 9px;
  flex-shrink: 0;
}

.section-decorates-dark::before {
  content: "";
  position: absolute;
  bottom: calc(var(--tear-height) * -1 + 4px);
  left: 0;
  width: 100%;
  height: var(--tear-height);
  background: url("./quest-data/images/border-header-dark.png") center bottom /
    cover no-repeat;
  pointer-events: none;
  z-index: 1;
}

.quest-header--simple .quest-topbar-left .quest-agent-btn {
  display: none;
}

.quest-header--simple .quest-topbar-right .quest-map-btn {
  display: none;
}

.quest-header--simple .quest-topbar-left {
  width: 100%;
  justify-content: start;
  flex: 1;
}

/* ФУТЕР */
.quest-mobile-footer {
  display: none;
  width: 100%;
  background: var(--background-primary);
  color: var(--color-header-accent);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.quest-app:has(#viewQuest.active) .section-decorates-dark::before,
.quest-app:has(#viewQuest.active) .section-decorates-dark-footer::after {
  content: none;
}

/* VIEWS (экраны) */
.view {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.view.active {
  display: flex;
}

.wrap {
  width: 100%;
  max-width: 360px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.5vh, 14px);
  position: relative;
  z-index: 1;
  /* margin-top: 20px; */
}

/* КАРТОЧКИ */
.comic-card {
  background: white;
  border: 3px solid #1a1a2e;
  border-radius: 16px;
  box-shadow: 5px 5px 0 #1a1a2e;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  font-family: "Bangers", cursive;
  font-size: 18px;
  letter-spacing: 1px;
  color: #1a1a2e;
}

/* ФОРМА */
.form-label {
  font-size: 11px;
  font-weight: 900;
  color: #1a1a2e;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
}

.comic-input {
  border: 3px solid #1a1a2e;
  border-radius: 12px;
  padding: 11px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  font-weight: 700;
  background: white;
  color: #1a1a2e;
  width: 100%;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.comic-input:focus {
  border-color: #e85d04;
  box-shadow: 3px 3px 0 #e85d04;
}

.prefixed-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-prefix {
  font-weight: 900;
  white-space: nowrap;
}

.prefixed-input .comic-input {
  width: 80px;
  text-align: center;
  font-family: monospace;
  letter-spacing: 4px;
}

.code-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.code-entry-input {
  width: clamp(72px, 6.25vw, 120px);
  height: clamp(36px, 3.073vw, 59px);
  background: url("./quest-data/images/registration/input-bg.webp") center
    center / cover no-repeat;
  border: none;
  outline: none;
  text-align: center;
  font-family: var(--font-family);
  font-size: clamp(20px, 1.354vw, 26px);
  letter-spacing: 0.25em;
  color: var(--color-auth-text);
  caret-color: var(--color-auth-text);
}

.code-entry-input::placeholder {
  letter-spacing: 0.2em;
  font-size: clamp(20px, 1.354vw, 26px);
  color: var(--color-auth-text);
  opacity: 0.55;
}

.code-entry-input:disabled {
  opacity: 0.55;
}

.code-entry--shake {
  animation: shake 0.4s;
}

.history-view-mode .code-entry-input,
.history-view-mode .code-entry-btn {
  opacity: 0.5;
  pointer-events: none;
}

/* КНОПКИ */
.quest-btn {
  font-family: "Bangers", cursive;
  font-size: 20px;
  letter-spacing: 2px;
  background: #e85d04;
  color: white;
  border: 3px solid #1a1a2e;
  border-radius: 12px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1a1a2e;
  transition: all 0.1s;
  width: 100%;
  text-transform: uppercase;
  text-align: center;
}

.quest-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #1a1a2e;
}

.quest-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quest-btn.dark {
  background: #1a1a2e;
  color: #ffd76b;
}

.quest-btn.yellow {
  background: #ffd76b;
  color: #1a1a2e;
}

.quest-btn.green {
  background: #52b788;
  color: white;
}

.quest-btn.sm {
  font-size: 15px;
  padding: 9px 20px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .quest-btn {
  flex: 1;
}

/* Кнопки внутри комикса */
.comic-btn {
  font-family: "Bangers", cursive;
  font-size: 18px;
  letter-spacing: 2px;
  background: #e85d04;
  color: white;
  border: 3px solid #1a1a2e;
  border-radius: 12px;
  padding: 10px 28px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1a1a2e;
  transition: all 0.1s;
  width: auto;
  align-self: center;
  text-transform: uppercase;
}

.comic-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #1a1a2e;
}

/* ОШИБКИ */
.error-msg {
  color: #e85d04;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  min-height: 18px;
}

/* Баббл */
.speech-bubble {
  background: white;
  border: 3px solid #1a1a2e;
  border-radius: 16px;
  padding: 12px 18px;
  position: relative;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a2e;
  font-weight: 700;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #1a1a2e;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: white;
  z-index: 1;
}

/* ПЕРСОНАЖ */
.fox-hero {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.fox-img {
  width: 90px;
  height: 90px;
  background: #1a1a2e;
  border-radius: 50%;
  border: 3px solid #ffd76b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* ДОСЬЕ АГЕНТА */
#viewDossier {
  position: relative;
  overflow: hidden;
  background: url("./quest-data/images/dossier/background-dossier.webp") center
    center / cover no-repeat;
}

.dossier-scene {
  position: relative;
  width: 100%;
  min-height: 100%;
  height: max-content;
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: flex-end;
  max-width: 1440px;
  padding-top: 40px;
  margin: 0 auto;
}

/* ЛУ И БАБЛ */
.dossier-char {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 10px;
  z-index: 3;
}

.dossier-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  position: relative;
  background: var(--color-audio-text);
  text-align: center;
  transform: translateX(40px);
}

.dossier-bubble-name {
  font-size: 14px;
  color: var(--color-button-background);
}

.dossier-bubble-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(203px, min(39.72vw, 79.44vh), 572px);
  padding: clamp(6px, 0.5vw, 8px) clamp(6px, 1.66vw, 24px);
  text-align: center;
}

.dossier-bubble-text > p:nth-of-type(2) {
  color: var(--color-auth-hint);
  margin-top: 23px;
}

.dossier-bubble-text p {
  margin: 0;
}

.dossier-bubble::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: var(--color-audio-text);
}

.dossier-char-img {
  height: clamp(300px, min(32.64vw, 57.28vh), 470px);
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

/* ДОСЬЕ */
.agent-dossier {
  position: relative;
  justify-self: start;
  align-self: start;
  margin-bottom: clamp(30px, calc((100vh - 700px) * 0.4), 130px);
  margin-right: auto;
  width: clamp(320px, min(30.33vw, 60.17vh), 480px);
  aspect-ratio: 480 / 642;
  height: auto;
  background: url("./quest-data/images/dossier/book-dossier.png") center
    center / cover no-repeat;
  margin-top: -30px;
}

.agent-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18% 16% 12%;
}

.agent-stamp {
  text-align: center;
}

.agent-stamp,
.agent-label,
.agent-callsign-value {
  font-size: clamp(18px, min(1.6vw, 3.61vh), 26px);
}

.agent-callsign {
  margin-top: clamp(32px, min(3.4vw, 6.81vh), 49px);
  font-size: clamp(24px, min(2.5vw, 5vh), 36px);
}

.agent-info {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, min(1.67vw, 3.33vh), 24px);
  margin-top: clamp(60px, min(6.25vw, 12.5vh), 90px);
  width: 100%;
}

.agent-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.11vw, 16px);
}

.agent-label {
  letter-spacing: 0.1em;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  flex-shrink: 0;
}

.agent-callsign-value {
  letter-spacing: 0.1em;
}

/* КНОПКА */
.btn-dossier {
  position: absolute;
  right: 39%;
  bottom: 4%;
  z-index: 3;
  width: clamp(100px, min(23.9vw, 47.92vh), 345px);
  height: clamp(42px, min(8.68vw, 17.36vh), 125px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: url("./quest-data/images/dossier/bg-dossier.png") center / contain
    no-repeat;
  border: none;
  transition: 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  font-size: clamp(10px, min(2.08vw, 4.17vh), 30px);
  line-height: 100%;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--color-button-text);
}

/* КОПИРОВАТЬ */
.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

/* КАРТА ДНЕЙ */
#viewMap {
  position: relative;
  inset: 0;
  overflow: hidden;
  background: url("./quest-data/images/mapDay/map-day-back.webp") center
    center / cover no-repeat;
}

.map-scene {
  position: relative;
  width: 100%;
  min-height: 100%;
  height: auto;
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 50px;
  overflow: hidden;
}

.map-char {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.map-bubbles {
  width: clamp(300px, 31.4vw, 453px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.1vw, 16px);
  align-self: flex-end;
  transform: translateX(29px);
  margin-bottom: 16px;
}

.map-bubble {
  position: relative;
  width: 100%;
  background: var(--color-audio-text);
  border-radius: 12px;
  padding: clamp(6px, 0.5vw, 8px) clamp(6px, 1.6vw, 24px);
  text-align: center;
}

.map-bubble::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: var(--color-audio-text);
}

.map-bubble::before {
  content: "Бу";
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  color: var(--color-button-background);
}

.map-scene.is-lucas .map-bubble::before {
  content: "Лукас";
}

.map-bubble-bottom::before {
  display: none;
}

.map-bubble-top::after {
  display: block;
}

.map-bubbles:has(.map-bubble-bottom:not([style*="display: none"]))
  .map-bubble-top::after {
  display: none;
}

.map-bubble-bottom:not([style*="display: none"])::after {
  display: block;
}

.map-bubble-bottom[style*="display: none"]::after {
  display: none;
}

.map-boo,
.map-scene.is-lucas .map-boo {
  height: clamp(250px, min(30vw, 42vh), 420px);
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Лукас на 9 дне */
.map-scene.is-lucas .map-boo {
  height: clamp(250px, min(30vw, 46vh), 420px);
  margin-left: 60px;
}

.map-days {
  width: fit-content;
  position: absolute;
  left: 50%;
  transform: translateX(-40%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.map-title-img {
  width: clamp(240px, 28vw, 540px);
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: auto;
  position: relative;
  z-index: 1;
}

.day-card {
  aspect-ratio: 1 / 1;
  background: url("./quest-data/images/mapDay/map-button2.png") center / 100%
    100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  transition: transform 0.1s;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.day-card.unlocked,
.day-card.current,
.day-card.completed {
  background-image: url("./quest-data/images/mapDay/map-button1.png");
  cursor: pointer;
  width: clamp(124px, min(12.84vw, 19.3vh), 180px);
  height: auto;
  aspect-ratio: 1 / 1;
}

.day-card.locked {
  background-image: url("./quest-data/images/mapDay/map-button2.png");
  cursor: default;
  pointer-events: none;
}

.day-card.unlocked:active,
.day-card.current:active,
.day-card.completed:active {
  transform: scale(0.96);
}

.day-content {
  position: relative;
  width: 62%;
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  overflow: visible;
  min-width: 0;
}

.day-star {
  position: absolute;
  /*top: 11px;*/
  top: 2px;
  right: 6px;
}

.day-num,
.day-text,
.day-label {
  max-width: 100%;
  min-height: 0;
  overflow: visible;
  text-align: center;
}

.day-num {
  font-size: clamp(20px, min(2.1vw, 3.2vh), 30px);
  line-height: 1;
}

.day-text {
  font-size: clamp(13px, min(1.4vw, 2.1vh), 20px);
  line-height: 1.1;
  letter-spacing: 0.1em;
}

.day-label {
  font-size: clamp(10px, min(1vw, 1.5vh), 14px);
  line-height: 0.9;
  letter-spacing: 0.1em;
  color: var(--color-button-background) !important;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  display: -webkit-box;
}

/* РАЗБЛОКИРОВКА ДНЯ */
#viewUnlock .registration-card {
  min-width: fit-content;
  padding: 8% 12%;
}

.unlock-sub {
  line-height: 135%;
  color: var(--background-primary);
}

.unlock-slots {
  display: flex;
  gap: clamp(8px, 1.042vw, 20px);
  justify-content: center;
  width: 100%;
}

.unlock-slot {
  width: 40px;
  height: 40px;
  background: url("./quest-data/images/registration/letter-table.webp") center
    center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.unlock-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  min-height: 60px;
}

.unlock-letter {
  width: 40px;
  height: 40px;
  background: url("./quest-data/images/registration/letter-table.webp") center
    center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  font-size: 20px;
  line-height: 135%;
  text-align: center;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    opacity 0.3s;
  touch-action: none;
}

.unlock-letter:active {
  cursor: grabbing;
}

.unlock-letter.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.unlock-letter.placed {
  width: 100%;
  height: 100%;
  border: none;
  box-shadow: none;
  background: transparent;
  opacity: 1;
  pointer-events: none;
  cursor: default;
}

#unlockBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.unlock-btns {
  display: flex;
}

.unlock-btn {
  position: relative;
  padding: clamp(10px, 1.563vw, 30px);
  width: clamp(92px, 11.875vw, 228px);
  height: clamp(42px, 5.417vw, 104px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: url(./quest-data/images/registration/red-button.webp) center
    center / contain no-repeat;
  border: none;
  transition: background 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  font-size: clamp(13px, 1.354vw, 26px);
  line-height: 80%;
  letter-spacing: 0.07em;
  text-align: center;
  color: var(--color-button-text);
}

/* КВЕСТ — ПОЛНОЭКРАННЫЙ СЛАЙДЕР */

/* Весь экран квеста — фиксированная высота, без скролла */
#viewQuest {
  /*position: fixed !important;
  inset: 0;*/
  display: none;
  flex-direction: column;
  background: var(--background-primary);
  overflow: hidden;
  /*z-index: 100;*/
  padding: 0 0 10px;
  flex: 1;
  position: relative;
  overflow: hidden;
}

#viewQuest.active {
  display: flex;
}

/* Главная область квеста */
.quest-main {
  width: 100%;
  max-width: 690px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 16px 16px 64px;
  flex: 1;
  overflow-y: hidden;
  position: relative;
  z-index: 1;
}

/* Персонаж + баббл над ним */
.char-scene {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: fadeUp 0.3s ease;
  flex: 1;
  min-height: 0;
}

.char-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--color-audio-text);
  border-radius: 12px;
  padding: clamp(6px, 0.55vw, 8px) clamp(8px, 1.66vw, 24px);
  text-align: center;
  position: relative;
  max-width: 700px;
  white-space: pre-wrap;
}

/*.char-bubble {
  background: white;
  border-radius: 12px;
  padding: 10px 20px;
  color: #1a1a2e;
  line-height: 1.55;
  text-align: center;
  box-shadow: 4px 4px 0 #1a1a2e;
  position: relative;
  width: 100%;
  cursor: pointer;
}*/

/* Для сцены баблов в диалоге */
.char-bubble-dialogue {
  width: clamp(325px, 40.2vw, 580px);
  max-width: 100%;
  z-index: 5;
}

/* Хвостик вниз */
.char-bubble::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: var(--color-audio-text);
}

/* Хвостик вниз в сцене диалога */
.dialogue-bubble-left {
  left: 4px;
}

.dialogue-bubble-left::after,
.dialogue-bubble-right::after {
  bottom: -14px;
  left: 8px;
  transform: none;
  width: 16px;
  height: 15px;
  border-top-color: var(--color-audio-text);
}

.dialogue-bubble-right {
  right: 3px;
}

.dialogue-bubble-right::after {
  left: auto;
  right: 10px;
}

.char-speaker {
  font-size: 14px;
  color: var(--color-button-background);
}

.char-text {
  white-space: pre-wrap;
}

/* Картинка персонажа */
.char-img-wrap {
  width: 100%;
  margin-top: 6px;
  border-radius: 16px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.char-img-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.char-img-placeholder {
  font-size: 80px;
  text-align: center;
  margin-top: 6px;
  line-height: 1;
}

.video-scene {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 0;
  animation: fadeUp 0.3s ease;
}

.video-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #1a120c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.video-player {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  background: #1a120c;
}

.quest-main.no-boo .video-scene {
  flex: 1;
  min-height: 0;
}

/* Кнопки выбора */
.choices-wrap {
  display: flex;
  gap: 8px;
  margin: 20px 0 6px;
  flex-shrink: 0;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInOnly {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.scene-slide-right {
  animation: slideInRight 0.25s ease;
}

.scene-slide-left {
  animation: slideInLeft 0.25s ease;
}

/* msg-block для ответов игрока (внутри scene-bottom) */
.msg-block {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #1a1a2e;
  flex-shrink: 0;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.msg-bubble {
  background: white;
  border: 2px solid #1a1a2e;
  border-radius: 12px 12px 12px 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.4;
}

.msg-bubble.reply {
  border-radius: 12px 12px 0 12px;
  background: #ffd76b;
  border-color: #e85d04;
  margin-left: auto;
}

.choice-btn,
.quiz-btn,
.ddp-hint-btn {
  width: fit-content;
  border: 1px solid var(--color-button-text);
  background: var(--color-button-background);
  color: var(--color-button-text);
  border-radius: 12px;
  padding: 4px 32px;
  font-size: var(--choice-font-size);
  transition: all 0.1s;
  text-align: center;
  cursor: pointer;
}

.quiz-btn {
  padding: 4px clamp(15px, 1.66vw, 32px) !important;
}

.choice-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 #1a1a2e;
}

.choice-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.choice-btn--selected {
  background: var(--color-button-text);
  color: var(--color-button-background);
  box-shadow: inset 0 0 0 1px var(--color-button-background);
}

.choice-btn--selected:hover {
  background: var(--color-button-text);
  color: var(--color-button-background);
}

.choice-btn--selected:disabled {
  opacity: 1;
  cursor: default;
}

.choices-wrap--multi-select {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-height: 0;
}

.multi-select-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.choice-btn--multi {
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice-btn--check {
  align-self: center;
  margin-top: 4px;
  min-width: 160px;
  flex-shrink: 0;
}

.choice-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.6em;
  height: 1.6em;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.9em;
  line-height: 1;
  color: #fff;
  background: rgb(237, 79, 79);
}

.choice-btn--multi:nth-child(2) .choice-num {
  background: #f4a261;
}

.choice-btn--multi:nth-child(3) .choice-num {
  background: #ffd76b;
}

.choice-btn--multi:nth-child(4) .choice-num {
  background: #7ec8a3;
}

.choice-btn--multi:nth-child(5) .choice-num {
  background: #90caf9;
}

.choice-btn--multi:nth-child(6) .choice-num {
  background: #ce93d8;
}

.choice-btn--multi:nth-child(7) .choice-num {
  background: #000000;
}

.choice-btn--multi:nth-child(8) .choice-num {
  background: #fff;
  color: #000000;
}

.choice-btn--multi:nth-child(9) .choice-num {
  background: #d8964b6f;
}

/* Картинка в квесте */
.quest-image-wrap {
  width: 100%;
  border: 3px solid #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 #1a1a2e;
  position: relative;
  cursor: pointer;
  animation: fadeUp 0.3s ease;
}

.quest-image-wrap img {
  width: 100%;
  display: block;
}

/* Лампа-хотспот */
.quest-hotspot {
  position: absolute;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

/* Подсказка */
/* .hint-box {
  background: #1A1A2E;
  color: #FFD76B;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  display: none;
  animation: fadeUp 0.3s ease;
} */

/* Варианты ответа (загадка) */
.riddle-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.riddle-btn {
  background: white;
  border: 3px solid #1a1a2e;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: #1a1a2e;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1a2e;
  transition: all 0.1s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.riddle-btn.wrong {
  background: #ffeeee;
  border-color: #e85d04;
  animation: shake 0.4s;
}

.riddle-btn.correct {
  background: #d8f3dc;
  border-color: #52b788;
  box-shadow: 3px 3px 0 #52b788;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

/* Расчёт дозы */
.quiz-options {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 1.424vw + 12.66px, 40px);
}

/* Успех */
.success-block {
  background: linear-gradient(135deg, #1a472a, #2d6a4f);
  color: #d8f3dc;
  border-left: 4px solid #52b788;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  animation: fadeUp 0.4s ease;
}

.char-bubbles-group {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.071vw + 0.23px, 40px);
}

.boo-right-col .char-bubble::after,
.boo-right-col .char-bubble::before {
  display: none;
}

/* НАВИГАЦИЯ ПО ИСТОРИИ */
.history-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  position: absolute;
  bottom: 0;
  /*left: 20px;*/
  z-index: 2;
  pointer-events: none;
  order: 99;
}

.hnav-btn {
  width: 40px;
  height: 45px;
  background: url("./quest-data/images/hnav-btn.png") center/contain no-repeat;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #2f1838;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  pointer-events: auto;
}

.hnav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.hnav-label {
  display: none;
}

.history-view-mode .choice-btn,
.history-view-mode .quiz-btn {
  opacity: 0.5;
  pointer-events: none;
}

.history-view-mode .comic-btns-row .choice-btn:not(:disabled),
.history-view-mode .dialogue-controls .choice-btn:not(:disabled),
.history-view-mode .interrogation-controls .choice-btn:not(:disabled) {
  opacity: 1;
  pointer-events: auto;
}

.history-view-mode .comic-btns-row .choice-btn:disabled,
.history-view-mode .dialogue-controls .choice-btn:disabled,
.history-view-mode .interrogation-controls .choice-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #e85d04;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* КОМИКС-ПАНЕЛИ */
.comic-viewer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.4s ease;
}

.comic-grid {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(
    3,
    minmax(0, min(335px, calc((100vh - 210px) / 2 * 335 / 300)))
  );
  gap: 8px;
  min-height: 0;
  align-content: start;
}

.comic-panel {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--color-header-accent);
  min-height: 0;
  aspect-ratio: 335 / 300;
}

.comic-panel img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.comic-panel-caption {
  display: none;
}

/* Слайдер (мобайл/планшет <1024px) */
.comic-slider-wrap {
  width: 100%;
  border-radius: 12px;
  position: relative;
}

.comic-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-left: 16px;
  padding-right: 16px;
  scroll-padding-left: 16px;
  box-sizing: content-box;
  flex: 1;
  min-height: 0;
}

.comic-track::-webkit-scrollbar {
  display: none;
}

.comic-slide {
  flex: 0 0 calc(100% - 28px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Кнопки Назад/Дальше под слайдером (мобайл) */
.comic-btns-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 0 4px;
}

.comic-dots {
  display: flex;
  gap: 6px;
}

.comic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-button-text);
  transition: background 0.2s;
}

.comic-dot.active {
  background: var(--color-button-text);
}

.comic-viewer > .comic-dots {
  justify-content: center;
  padding: 8px 0 4px;
}

/* KIT-PICKER (слайдер с выбором варианта, напр. "выбери аптечку") */
.kp-left-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.kp-slide-box {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.kp-slide-track {
  display: flex;
  transition: transform 0.35s ease;
}

.kp-slide-track img {
  width: 100%;
  flex-shrink: 0;
  display: block;
}

.kp-slide-box img {
  width: 100%;
  display: block;
}

.kp-dots-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.kp-dots-row .comic-dot {
  cursor: pointer;
}

.choices-wrap.kp-numbers-row {
  width: 100% !important;
  max-width: unset;
}

.kp-numbers-row {
  justify-content: flex-start;
}

/* HOTSPOT-RIDDLE (комната с предметами) */
.hr-scene {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.4s ease;
}

.hr-image-wrap {
  position: relative;
  user-select: none;
}

.hr-image-wrap img {
  width: 100%;
  display: block;
}

/* Тёмный оверлей */
.hr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  transition: opacity 0.8s;
  pointer-events: none;
}

/* ===== Динамит с кодом (dynamite-code) ===== */
.dyn-image-wrap {
  position: relative;
  user-select: none;
}

.dyn-image-wrap img {
  width: 100%;
  display: block;
}

.dyn-bw-img {
  filter: grayscale(1);
  transition: filter 0.5s ease;
}

.dyn-bw-img.dyn-img--solved {
  filter: grayscale(0);
}

/* "Глазок" с цветной версией картинки, обрезанный кругом вокруг цифры */
.dyn-reveal {
  position: absolute;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 2;
}

.dyn-reveal--on {
  opacity: 1;
}

/* Кликабельный хотспот поверх цифры */
.dyn-hotspot {
  position: absolute;
  cursor: pointer;
  border-radius: 50%;
  z-index: 3;
}

.dyn-hotspot--active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.dyn-hotspot.dyn-locked {
  cursor: default;
  pointer-events: none;
}

/* Статичный список вопросов справа — визуально choice-btn--multi,
   но без наведения/нажатия/курсора (не кнопки, просто легенда) */
.choice-btn--static {
  cursor: default;
  pointer-events: none;
  transition: none;
}

.choice-btn--multi.choice-btn--static:hover,
.choice-btn--multi.choice-btn--static:active {
  background: var(--color-button-background);
  color: var(--color-button-text);
  transform: none;
  box-shadow: none;
}

/* Зона клика */
.hr-zone {
  position: absolute;
  cursor: pointer;
  border-radius: 0;
  z-index: 3;
}

.hr-zone.lamp-zone {
  border-radius: 0;
}

/* Подсказка */
.hr-hint {
  border: 1px solid #251709;
  border-radius: 12px;
  padding: 4px 16px;
  background: #e8e5dc;
  font-weight: 400;
  font-size: clamp(10px, 0.729vw, 14px);
  line-height: 135%;
  text-align: center;
  animation: fadeUp 0.3s ease;
  position: absolute;
  bottom: 8px;
  right: 8px;
}

/* Реакция Бу внизу */
.hr-boo-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeUp 0.3s ease;
}

/* БУ-КОММЕНТАРИЙ (картинка + аватар Бу) */
.boo-comment-scene {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.4s ease;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  transform-origin: center;
  transition: transform 0.1s;
  cursor: zoom-in;
  touch-action: none;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 3px solid #1a1a2e;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  box-shadow: 2px 2px 0 #1a1a2e;
}

.zoomable-hint {
  position: absolute;
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #251709;
  border-radius: 12px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8e5dc;
  font-weight: 400;
  font-size: clamp(10px, 0.729vw, 14px);
  line-height: 135%;
  color: #251709;
  pointer-events: none;
}

.img-zoomable {
  cursor: zoom-in !important;
}

.lightbox-zoom-controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10000;
}

.lightbox-zoom-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition:
    background 0.15s,
    transform 0.1s;
}

.lightbox-zoom-btn:active {
  transform: scale(0.92);
}

.lightbox-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.hr-word-board {
  position: relative;
  overflow: hidden;
  background: url("./quest-data/images/day-2/lb.webp") center / 100% 100%
    no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  gap: 6px;
  font-size: clamp(13px, 1.73vw, 25px);
  width: clamp(160px, 20.2vw, 300px);
  height: clamp(40px, 4.3vw, 70px);
}

.hr-zone-label {
  font-size: clamp(16px, 1.38vw, 20px);
  text-align: center;
  color: var(--color-audio-text);
  border: 1px solid var(--color-audio-text);
  border-radius: 12px;
  padding: 10px;
  background: var(--background-primary);
}

/* КОНФЕТТИ */
@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ДИАЛОГ ПЕРСОНАЖЕЙ */
.dialogue-scene {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  border-radius: 16px;
  min-height: 350px;
}

.dialogue-scene > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.characters-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1;
  pointer-events: none;
  --char-height: min(650px, 33.85vw, 50vh);
}

.dialogue-scene-character {
  flex-shrink: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  align-self: flex-end;
}

.character-main .characters-image {
  height: calc(var(--char-height) * 0.75);
  max-height: 60vh;
}

.character-secondary {
  align-self: flex-end;
}

.character-secondary .characters-image {
  height: var(--char-height);
  max-height: 80vh;
}

.character-left {
  order: 0;
  align-items: flex-start;
}

.character-right {
  order: 1;
  align-items: flex-end;
}

.characters-image {
  display: block;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
}

.dialogue-bubble-left {
  left: 4px;
  transform: none;
}

.dialogue-bubble-left::after {
  left: 8px;
  transform: none;
}

.dialogue-bubble-right {
  right: 3px;
  transform: none;
}

.dialogue-bubble-right::after {
  left: auto;
  right: 10px;
  transform: none;
}

.dialogue-bubble-left {
  animation: bubbleAppearLeft 0.3s ease-out;
}

.dialogue-bubble-right {
  animation: bubbleAppearRight 0.3s ease-out;
}

@keyframes bubbleAppearLeft {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubbleAppearRight {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ДОПРОС */
.interrogation {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1;
  gap: clamp(16px, 2vw, 32px);
  width: 100%;
}

.interrogation-row {
  align-items: flex-start;
  animation: fadeInOnly 0.3s ease;
}

.interrogation-row.avatar-left {
  justify-content: flex-start;
}

.interrogation-row.avatar-right {
  justify-content: flex-end;
}

.interrogation-row.avatar-right .boo-avatar-container {
  order: 2;
}

.interrogation-row.avatar-right .interrogation-bubble {
  order: 1;
  border-radius: 12px 0 12px 12px;
}

.interrogation-row.avatar-left .interrogation-bubble {
  border-radius: 0 12px 12px 12px;
}

.interrogation-speaker {
  font-size: clamp(10px, 0.833vw, 14px);
  margin-bottom: 4px;
  opacity: 0.75;
}

.interrogation-text {
  white-space: pre-wrap;
  text-align: start;
}

.interrogation-typing {
  display: flex;
  align-items: center;
}

.interrogation-typing-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
}

.interrogation-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a1a2e;
  opacity: 0.4;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.interrogation-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.interrogation-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.interrogation-continue,
.interrogation-next {
  align-self: center;
  margin-top: auto;
}

/* ЭКРАН ЗАГРУЗКИ */
#viewLoading,
#viewRegister,
#viewLogin,
#viewUnlock {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: url("./quest-data/images/loading/loading-bg.webp") center center /
    cover no-repeat;
}

.loading-scene {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  margin-top: 100px;
  overflow: hidden;

  --lucas-h: min(650px, 33.85vw, 55vh);
}

.loading-chars-row {
  width: 100%;
  display: contents;
}

.loading-char--lucas {
  max-width: clamp(150px, min(20.833vw, 60vh), 400px);
}

.loading-char--bu {
  max-width: clamp(150px, min(22.396vw, 72vh), 430px);
}

.loading-char--lucas img {
  aspect-ratio: 400/ 689;
  height: var(--lucas-h);
  width: auto;
  flex-shrink: 0;
  align-self: flex-start;
}

.loading-char--bu img {
  aspect-ratio: 429/ 498;
  height: calc(var(--lucas-h) * 0.7228);
  width: auto;
  flex-shrink: 0;
}

.loading-char {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  min-height: 0;
}

.loading-char-img {
  width: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

.loading-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  max-width: 90vw;
  padding: clamp(6px, 0.417vw, 8px) clamp(6px, 1.25vw, 24px);
  background: var(--color-audio-text);
  border-radius: 12px;
}

.loading-bubble-name {
  font-size: 14px;
  color: var(--color-button-background);
}

.loading-bubble-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-bubble-text svg {
  position: absolute;
  bottom: -10px;
  right: 50%;
  transform: translateX(50%);
}

.loading-center {
  position: absolute;
  right: 50%;
  transform: translateX(50%);
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0px, 1.042vw, 20px);
}

.loading-title {
  font-family: var(--second-family);
  font-weight: 400;
  font-size: clamp(40px, 3.646vw, 70px);
  line-height: 135%;
  text-align: center;
  color: var(--background-primary);
}

.loading-gear {
  width: clamp(200px, 27.396vw, 526px);
  height: clamp(196px, 26.823vw, 515px);
}

.loading-gear-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: loading-gear-spin 7s linear infinite;
}

@keyframes loading-gear-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ЭКРАН РЕГИСТРАЦИИ */
#viewRegister .loading-center,
#viewLogin .loading-center,
#viewUnlock .loading-center {
  justify-content: flex-start;
}

#viewRegister .loading-bubble--lucas .loading-bubble-text,
#viewLogin .loading-bubble--lucas .loading-bubble-text,
#viewUnlock .loading-bubble--lucas .loading-bubble-text {
  gap: 20px;
}

#viewRegister .loading-bubble-text span,
#viewLogin .loading-bubble-text span,
#viewUnlock .loading-bubble-text span {
  color: var(--color-auth-hint);
}

.registration-title {
  width: clamp(212px, 28.229vw, 542px);
  height: clamp(44px, 5.781vw, 111px);
}

.registration-title img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.registration-card {
  position: relative;
  isolation: isolate;
  width: clamp(324px, 35.625vw, 684px);
  height: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.302vw, 25px);
  padding: 12% 14%;
  font-size: clamp(14px, 1.042vw, 20px);
  line-height: 135%;
  text-align: center;
  background: none;
}

.registration-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("./quest-data/images/registration/main-board.webp") center /
    100% 100% no-repeat;
  pointer-events: none;
}

.registration-card > * {
  position: relative;
  z-index: 1;
  max-width: 88%;
}

#viewLogin .registration-card {
  gap: clamp(2px, 0.521vw, 10px);
}

.register-btn {
  position: relative;
  padding: clamp(10px, 1.563vw, 30px);
  width: clamp(92px, 11.875vw, 228px);
  height: clamp(42px, 5.417vw, 104px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: url("./quest-data/images/registration/red-button.webp") center
    center / contain no-repeat;
  border: none;
  transition: background 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  font-size: clamp(13px, 1.354vw, 26px);
  line-height: 80%;
  letter-spacing: 0.07em;
  text-align: center;
  color: var(--color-button-text);
}

.register-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #f2a207;
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: color;
  pointer-events: none;
}

.error-msg {
  min-height: 1.2em;
  color: var(--color-auth-hint);
}

.error-msg:empty {
  display: none;
}

.auth-switch {
  display: flex;
  gap: clamp(8px, 0.833vw, 16px);
  font-size: clamp(14px, 0.833vw, 16px);
  line-height: 135%;
}

.auth-switch a {
  cursor: pointer;
  text-decoration: underline;
  color: var(--color-auth-hint);
}

/* ЭКРАН ВХОДА */
.registration-fields {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.042vw, 20px);
}

.registration-group {
  display: flex;
  align-items: center;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
}

.registration-label {
  font-size: clamp(20px, 1.615vw, 31px);
  line-height: 135%;
  text-align: left;
}

.registration-wrap {
  display: flex;
  flex-direction: column;
}

.registration-text {
  font-size: clamp(8px, 0.625vw, 12px);
  line-height: 135%;
}

.registration-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.registration-field-label {
  font-size: clamp(20px, 1.354vw, 26px);
  white-space: nowrap;
}

.registration-input {
  width: clamp(58px, 4.948vw, 95px);
  height: clamp(36px, 3.073vw, 59px);
  background: url("./quest-data/images/registration/input-bg.webp") center
    center / cover no-repeat;
  border: none;
  outline: none;
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: clamp(20px, 1.354vw, 26px);
}

.registration-input::placeholder {
  letter-spacing: 0.2em;
  font-size: clamp(20px, 1.354vw, 26px);
  color: var(--color-auth-text);
}

.registration-copy {
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  width: clamp(24px, 2.083vw, 40px);
  height: clamp(24px, 2.083vw, 40px);
}

.registration-copy svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.boo-right-col-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}

/* Подсказка "картинку можно приблизить" — маленькая лупа в углу
   картинки. Отдельная фича от .scroll-hint (см. makZoomable в JS) —
   специально свой класс, не путать с подсказкой "скролли вниз". */
.img-zoom-hint {
  position: absolute;
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #251709;
  border-radius: 12px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8e5dc;
  font-weight: 400;
  font-size: clamp(10px, 0.729vw, 14px);
  line-height: 135%;
  color: #251709;
  pointer-events: none;
}

/* Подсказка "скролли вниз" — два уголка, поочерёдно подсвечивающиеся
   сверху вниз (имитация направления свайпа). position:absolute
   относительно #viewQuest (не fixed!) — намеренно: нижняя мобильная
   панель (КАРТА КВЕСТА/АГЕНТ) физически СОСЕД #viewQuest, а не
   вложена внутрь него, и у обоих тёмный фон одного тона — при
   position:fixed подсказка заезжала прямо на эту панель и сливалась с
   ней. #viewQuest уже сам position:relative, поэтому absolute здесь
   останавливается ровно на границе сцены, не касаясь футера. Фон
   прозрачный (без круга) — не перекрывает контент под собой, вместо
   заливки — drop-shadow для читаемости на любом фоне. Пропадает по
   первому скроллу пользователя. */
.scroll-hint {
  position: absolute;
  right: 16px;
  bottom: 44px;
  width: 26px;
  height: 20px;
  background: none;
  color: var(--color-header-accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 500;
}

.scroll-hint--visible {
  opacity: 1;
}

.scroll-hint__chevrons {
  width: 100%;
  height: 100%;
}

.scroll-hint__chevron {
  opacity: 0.35;
  animation: scrollHintChevron 1.6s ease-in-out infinite;
}

.scroll-hint__chevron--1 {
  animation-delay: 0s;
}

.scroll-hint__chevron--2 {
  animation-delay: 0.25s;
}

@keyframes scrollHintChevron {
  0%,
  100% {
    opacity: 0.35;
  }
  40% {
    opacity: 1;
  }
}

/* 404 PAGE */
#errorPage {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: url("./quest-data/images/error/back-error.webp") center center /
    cover no-repeat;
}

#errorPage::before {
  display: none;
}

.error-scene {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 1440px;
  min-height: 0;
  overflow: hidden;
}

/* ПЕРСОНАЖИ */
.error-chars-row {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0px, 34.72vw, 485px);
  margin-bottom: clamp(7px, 1.38vw, 20px);
}

.error-char--lucas {
  width: clamp(220px, min(31vw, 52vh), 453px);
}

.error-char--bu {
  width: clamp(190px, min(29vw, 46vh), 421px);
}

.error-char--lucas img,
.error-char--bu img {
  width: 100%;
  height: auto;
}

/* КНОПКА */
.error-center {
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
}

.error-title {
  font-family: var(--second-family);
  font-size: clamp(26px, 4.861vw, 67px);
  line-height: 135%;
  text-align: center;
  color: var(--color-button-text);
}

.btn-error {
  width: clamp(180px, 23.9vw, 345px);
  aspect-ratio: 345 / 130;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: url("./quest-data/images/dossier/bg-dossier.png") center / contain
    no-repeat;
  border: none;
  transition: 0.3s ease;
  cursor: pointer;
  font-size: clamp(16px, 2.08vw, 30px);
  line-height: 100%;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--color-button-text);
  text-decoration: none;
}

#errorPage .quest-header .quest-agent-btn,
#errorPage .quest-header .quest-map-btn {
  display: none;
}

/* ── Десктоп + планшет landscape: ≤ 1024px ── */
@media (max-width: 1024px) {
  /* Аудио */
  .audio-controls-center {
    gap: 16px;
  }

  .audio-ctrl-btn {
    gap: 4px;
  }

  /* Аудио-сцена: плеер - кнопки - картинка */
  .audio-right-col .choices-wrap,
  .audio-right-col .choice-btn,
  .audio-right-col .quest-btn {
    order: 2;
  }

  .boo-main-image:has(+ .boo-right-col.audio-right-col),
  .boo-dual-images:has(+ .boo-right-col.audio-right-col) {
    order: 3;
  }

  /* zoomable-hint */
  .zoomable-hint-text {
    display: none;
  }

  /* Экран загрузки */
  .loading-center {
    justify-content: start;
  }

  .loading-chars-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
  }

  /* Раскладка */
  .quest-main.has-boo .history-nav {
    width: 100%;
    position: relative;
  }

  .quest-main.has-boo {
    padding-bottom: unset;
    overflow-y: auto;
    max-width: 790px;
  }

  .quest-main.no-boo {
    max-width: 790px;
    align-items: center;
    overflow-y: auto;
  }

  .quest-main.no-boo .char-img-wrap {
    aspect-ratio: 690 / 715;
  }

  .quest-main.no-boo .char-scene {
    flex: unset;
  }

  .boo-main-image img {
    width: 100%;
  }

  .quest-main {
    max-width: unset;
    gap: 5px;
    padding-bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .boo-dual-images .boo-dual-img img {
    width: 100%;
    height: auto;
  }

  .choices-wrap {
    flex-direction: column;
    width: 100%;
    /* max-width: 790px; */
  }

  .choice-btn {
    width: 100%;
    padding: 4px 10px;
  }

  .quest-main.no-boo .history-nav {
    width: 100%;
    position: relative;
  }

  .hr-image-wrap {
    overflow: hidden;
  }

  .boo-right-col {
    display: contents;
  }

  /* .boo-right-col-scroll — обёртка из finalizeRightColScroll. На чистом
     мобильном портрете раскладка держится на order у прямых flex-детей
     сцены, поэтому эту обёртку тоже "разворачиваем" — иначе она
     схлопывает свой контент в один кусок с order:0 и он целиком уезжает
     перед картинкой. */
  .boo-right-col-scroll {
    display: contents;
  }

  .boo-comment-row,
  .char-bubbles-group,
  .audio-player,
  .audio-transcript-container {
    order: 0;
  }

  .boo-main-image,
  .boo-dual-images {
    order: 2;
  }

  .choices-wrap,
  .choice-btn,
  .quest-btn {
    order: 3;
  }

  .choices-wrap .boo-comment-row {
    order: -1;
  }

  /* Drag-drop (аптечка) */
  .ddp-feedback-bubble {
    order: 2;
  }

  .ddp-left-col,
  .kp-left-col {
    order: 3;
  }

  .ddp-controls {
    order: 4;
  }

  /* Кроссворд */
  .crossword-scene .boo-main-image {
    order: 2;
  }

  .crossword-scene .ddp-feedback-bubble {
    order: 3;
  }

  .crossword-scene .crossword-btn-area {
    order: 4;
  }

  /* Допрос */
  .boo-right-col:has(.interrogation) {
    display: flex;
    flex-direction: column;
    order: 2;
    gap: 8px;
  }

  .boo-main-image:has(+ .boo-right-col .interrogation),
  .boo-dual-images:has(+ .boo-right-col .interrogation) {
    order: 1;
  }

  .boo-right-col:has(.interrogation) > .char-bubbles-group,
  .boo-right-col:has(.interrogation) > .boo-comment-row {
    order: 0;
  }

  .boo-right-col:has(.interrogation) > .interrogation {
    order: 1;
  }

  .boo-right-col:has(.interrogation) > .interrogation-controls {
    order: 2;
  }

  /* Комикс */
  .quest-main.has-comic {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Хотспот с леттер-бордом */
  .hr-word-scene .hr-task-spacer {
    display: none;
  }

  .hr-word-scene .hr-task-row {
    order: 1;
  }

  .hr-word-scene .boo-main-image {
    order: 2;
  }

  .hr-word-scene .hr-word-board {
    order: 3;
  }

  .hr-word-scene .hr-reaction-row {
    order: 4;
  }

  .hr-word-scene .choices-wrap {
    order: 5;
  }

  /* ДОСЬЕ АГЕНТА */
  #viewDossier {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .dossier-scene {
    flex-direction: column;
    align-items: center;
    gap: 70px;
  }

  /* ЛУ И БАБЛ */
  .dossier-char {
    flex-direction: row-reverse;
    align-items: flex-start;
    margin-left: -10%;
    gap: 0;
  }

  .dossier-bubble {
    transform: translateX(-70px);
  }

  .dossier-bubble::after {
    display: none;
  }

  .dossier-char-img {
    height: 470px;
    width: auto;
  }

  /* ДОСЬЕ */
  .dossier-block {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .agent-dossier {
    margin-bottom: 0;
    width: 480px;
    height: 642px;
  }

  .agent-stamp,
  .agent-label,
  .agent-callsign-value {
    font-size: 26px;
  }

  .agent-callsign {
    margin-top: 49px;
    font-size: 36px;
  }

  .agent-info {
    gap: 24px;
    margin-top: 90px;
  }

  /* КНОПКА */
  .btn-dossier {
    position: static;
    margin-top: -28%;
    width: 165px;
    height: 103px;
  }
}

@media (min-width: 1025px),
  (max-width: 1024px) and (orientation: landscape) and (min-height: 500px) {
  /* quest-main — 1400px, не скроллится */
  .quest-main {
    max-width: 1440px;
    padding: 24px 20px 0px;
  }

  /* history-nav — по ширине контейнера, стрелки по краям */
  .history-nav {
    max-width: 1440px;
  }

  .quest-main.has-boo .history-nav {
    position: static;
    flex-shrink: 0;
    margin-top: 10px;
    width: 100%;
    left: auto;
  }

  .quest-main.no-boo .history-nav {
    position: absolute;
    width: calc(100% - 40px);
  }

  /* ---- СЦЕНЫ БЕЗ БУ-КОММЕНТАРИЯ — центрированная колонка ---- */

  .quest-main.no-boo {
    align-items: center;
    justify-content: center;
  }

  .quest-main.no-boo .char-scene {
    width: 100%;
  }

  .quest-main.no-boo .char-img-wrap {
    max-width: 100%;
  }

  .quest-main.no-boo .choices-wrap {
    width: 100%;
    justify-content: center;
  }

  /* ---- СЦЕНЫ С БУ-КОММЕНТАРИЕМ — картинка слева, текст справа ---- */

  .quest-main.has-boo {
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    /*padding: 20px 20px 12px;*/
    max-width: 1440px;
  }

  .boo-comment-scene {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    gap: 0;
  }

  /* Сбрасываем order от мобильной раскладки — на десктопе расположение
     управляется обычным DOM-порядком (картинка слева, .boo-right-col справа) */
  .boo-comment-scene > * {
    order: 0;
  }

  .boo-main-image {
    flex-shrink: 0;
    max-width: min(691px, 50%);
    border-radius: 12px;
    overflow: hidden;
    align-self: stretch;
    display: flex;
    align-items: stretch;
  }

  .boo-main-image img {
    width: auto;
    height: 100%;
    max-height: 715px;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 12px;
  }

  .boo-dual-images {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;
    padding: 0;
    flex-shrink: 0;
    align-self: stretch;
    max-width: min(691px, 50%);
    aspect-ratio: 690 / 715;
  }

  .boo-dual-images .boo-dual-img {
    min-height: 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
  }

  .boo-dual-images .boo-dual-img img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
  }

  /* Правая колонка — единственное что скроллится */
  .boo-right-col {
    flex: 1;
    min-height: 0;
    max-width: 691px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 0 20px 4px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Если контент разбит на .boo-right-col-scroll + кнопки — скролл
     переезжает внутрь .boo-right-col-scroll, а сама .boo-right-col
     просто пропускает контент насквозь без своего скролла, чтобы
     кнопки не оказывались "внутри" scroll-области. */
  .boo-right-col:has(> .boo-right-col-scroll) {
    overflow-y: visible;
    justify-content: flex-start;
  }

  .boo-right-col-scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Кнопки/контролы вне скролла */
  .boo-right-col:has(> .boo-right-col-scroll) > :not(.boo-right-col-scroll) {
    flex-shrink: 0;
    margin-top: auto;
  }

  /* multi_select: вопрос и «Проверить» фиксированы, скроллятся только варианты */
  .boo-right-col:has(> .choices-wrap--multi-select) > .boo-right-col-scroll {
    flex: 0 0 auto;
    overflow: visible;
    min-height: unset;
  }

  .boo-right-col:has(> .boo-right-col-scroll) > .choices-wrap--multi-select {
    flex: 1 1 auto;
    flex-shrink: 1;
    min-height: 0;
    margin-top: 0;
    overflow: hidden;
  }

  .boo-right-col .choices-wrap--multi-select .multi-select-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .boo-right-col:has(> .choices-wrap--multi-select) > .choice-btn--check {
    margin-top: 0;
    width: fit-content;
    align-self: center;
  }

  .boo-right-col .choices-wrap {
    margin-top: 0;
    flex-direction: column;
  }

  .boo-right-col .choice-btn {
    width: 100%;
  }

  .boo-right-col .quest-btn {
    max-width: 320px;
  }

  .boo-right-col.audio-right-col {
    overflow: hidden;
  }

  /*.char-bubble {
    line-height: 1.6;
  }*/
}

/* Левая колонка с двумя картинками (boo-comment-quiz) */
.boo-dual-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* width: 100%; */
  width: fit-content;
}

.boo-dual-images:has(.boo-dual-img:nth-child(4)) {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(4px, 1.042vw, 20px);
}

.boo-dual-images .boo-dual-img {
  border-radius: 12px;
  overflow: hidden;
}

.boo-dual-images .boo-dual-img img {
  /* width: 100%; */
  height: 100%;
  display: block;
  /* object-fit: contain; */
}

/* Строка: аватар Бу + пузырь */
.boo-comment-row {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.042vw, 20px);
}

.boo-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.417vw, 8px);
  flex-shrink: 0;
}

.boo-avatar-circle {
  width: clamp(72px, 5.104vw, 98px);
  height: clamp(72px, 5.104vw, 98px);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--color-audio-text);
}

.boo-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.boo-avatar-name {
  border: 1px solid var(--color-audio-text);
  color: var(--color-button-background);
  border-radius: 12px;
  padding: 2px 8px;
  background: var(--color-audio-text);
}

.boo-comment-bubble {
  border-radius: 12px;
  padding: clamp(6px, 0.55vw, 8px) clamp(8px, 1.66vw, 24px);
  background-color: var(--color-audio-text);
  width: fit-content;
  max-width: 100%;
}

.boo-comment-row:has(.boo-avatar-circle)
  .boo-comment-bubble:not(.interrogation-bubble) {
  border-radius: 0 12px 12px 12px;
}

.boo-comment-bubble.has-text {
  width: 100%;
}

/* Аудио */
.audio-transcript-container {
  padding: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-button-background);
  border-radius: 12px;
  position: relative;
}

.audio-transcript-container::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 10px;
  border: 1px solid var(--color-audio-text);
  border-radius: 12px;
  pointer-events: none;
}

.audio-transcript {
  height: 100%;
  padding-right: 8px;
  overflow-y: scroll;
  color: var(--color-audio-text);
  white-space: pre-wrap;
  animation: fadeUp 0.2s ease;
}

.audio-transcript,
.boo-right-col,
.ddp-left-col {
  scrollbar-width: thin;
  scrollbar-color: var(--color-audio-text) transparent;
}

.audio-transcript::-webkit-scrollbar {
  margin: 16px 16px 16px 0;
  width: 8px;
  height: 100%;
  border-radius: 12px;
  border: none;
  background: transparent;
}

.boo-right-col::-webkit-scrollbar,
.ddp-left-col::-webkit-scrollbar {
  margin: 16px 16px 16px 0;
  width: 8px;
  height: 100%;
  border-radius: 12px;
  border: 1px solid var(--color-audio-text);
}

.audio-transcript::-webkit-scrollbar-track,
.boo-right-col::-webkit-scrollbar-track,
.ddp-left-col::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 12px;
}

.audio-transcript::-webkit-scrollbar-thumb,
.boo-right-col::-webkit-scrollbar-thumb,
.ddp-left-col::-webkit-scrollbar-thumb {
  background: var(--color-audio-text);
  border-radius: 12px;
  width: 8px;
}

.audio-player {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.25vw, 24px);
}

.audio-title {
  margin-bottom: clamp(8px, 1.302vw, 25px);
  border-radius: 12px;
  padding: 24px 40px;
  width: 100%;
  background: var(--color-audio-text);
}

.audio-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.417vw, 8px);
}

.audio-progress-bar {
  width: 100%;
  height: 10px;
  padding: 2px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-audio-text);
  border-radius: 12px;
}

.audio-progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border: 1px solid var(--color-audio-text);
  border-radius: 12px;
  background: var(--color-audio-text);
  transition: width 0.1s linear;
  pointer-events: none;
}

.audio-time-wrap {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: clamp(12px, 0.729vw, 14px);
  color: #fff;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audio-controls-center {
  display: flex;
  align-items: end;
  gap: 56px;
}

.audio-ctrl-btn {
  background: none;
  border: none;
  font-size: clamp(12px, 0.729vw, 14px);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition:
    background 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}

.audio-ctrl-btn svg {
  width: clamp(24px, 2.083vw, 40px);
  height: clamp(24px, 2.083vw, 40px);
}

.audio-play-btn {
  width: clamp(56px, 5.104vw, 98px);
  height: clamp(56px, 5.104vw, 98px);
  border-radius: 50%;
  border: 2px solid var(--color-audio-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-play-btn svg {
  width: clamp(30px, 2.344vw, 45px);
  height: clamp(30px, 2.708vw, 52px);
}

.audio-transcript-btn {
  flex-direction: row;
  gap: 4px;
  line-height: 135%;
}

/* Спиннер загрузки */
.loading-spin {
  width: 40px;
  height: 40px;
  border: 4px solid #ffd76b33;
  border-top-color: #ffd76b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* DRAG & DROP АПТЕЧКА */
/* Левая колонка: зона дропа сверху, предметы сразу под ней */
.ddp-left-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  width: 100%;
}

/* @media (min-width: 1025px) {
  .ddp-left-col {
    max-width: 50%;
    align-self: flex-start;
  }
} */

@media (min-width: 1025px) {
  .ddp-left-col {
    max-width: 50%;
    align-self: stretch;
    max-height: 100%;
    overflow-y: auto;
  }

  .kp-left-col {
    max-width: 50%;
    align-self: stretch;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .kp-slide-box img {
    max-height: 80vh;
    object-fit: contain;
  }
}

.ddp-sector-wrap {
  position: relative;
  width: fit-content;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  align-self: center;
  flex-shrink: 0;
}

.ddp-sector-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 56vh;
}

/* Фоллбэк без картинки — старое поведение с цветной заливкой */
.ddp-sector-fallback {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 3px solid #1a1a2e;
  box-shadow: 3px 3px 0 #1a1a2e;
}

.ddp-slots-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ddp-slot-ph {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(61px, min(14vw, 13vh), 106px);
  height: clamp(61px, min(14vw, 13vh), 106px);
  border: 2px dashed #ffd76b;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddp-kit-wrap {
  position: relative;
  width: 100%;
  max-width: min(420px, 54vh);
  margin: 0 auto;
  border-radius: 14px;
  flex-shrink: 0;
}

/* Общая картинка-рамка/корпус аптечки (необязательна, stepData.kit_image) */
.ddp-kit-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Картинка конкретного отсека — заполняет всю зону */
.ddp-zone-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Слой подсветки поверх картинки отсека: наведение / правильно / неправильно */
.ddp-zone-flash {
  position: absolute;
  inset: 0;
  transition: background 0.15s;
  pointer-events: none;
}

/* Гибкий контур зоны дропа — по умолчанию видимая пунктирная рамка,
   можно скрыть через zone.outline:false в данных шага */
.ddp-zone-outline {
  border: 2px dashed #ffd76b;
}

.ddp-zone-label {
  position: absolute;
  top: -14px;
  left: 6px;
  background: #1a1a2e;
  color: #ffd76b;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.ddp-items-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ddp-feedback-bubble {
  border-radius: 12px;
  padding: clamp(6px, 0.55vw, 8px) clamp(8px, 1.66vw, 24px);
  background-color: var(--color-audio-text);
  width: 100%;
  white-space: pre-wrap;
  animation: fadeUp 0.3s ease;
  margin: 16px 0;
}

/* DRAG & DROP mode === dress */
.ddp-dress-zone {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
}

.ddp-dress-wrap {
  position: relative;
  width: fit-content;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  align-self: center;
  flex-shrink: 0;
}

.ddp-sector-dress {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: contain;
}

.ddp-item-image--dress {
  width: clamp(82px, min(12.9vw, 12.1vh), 100px);
  height: clamp(82px, min(15vw, 14vh), 130px);
  object-fit: contain;
  max-width: 100%;
  display: block;
  cursor: grab;
}

.ddp-item-image--dress:active {
  cursor: grabbing;
}

.ddp-item-image--dress.dragging {
  opacity: 0.5;
  transform: scale(0.96);
}

.ddp-item-image--dress .ddp-item-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

@media (min-width: 1025px),
  (max-width: 1024px) and (orientation: landscape) and (min-height: 500px) {
  .ddp-feedback-bubble {
    margin: 0;
  }
}

.ddp-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crossword-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.crossword-btn-grid .choice-btn {
  width: 100%;
  padding: 4px 20px !important;
}

@media (max-width: 1024px) {
  .crossword-btn-grid {
    grid-template-columns: 1fr;
  }

  .crossword-num-row {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.crossword-num-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.crossword-num-row .choice-btn {
  width: auto;
  min-width: 56px;
  flex: 0 0 auto;
}

.ddp-hint-btn-used {
  opacity: 0.5;
  cursor: default;
}

.ddp-item {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  border: 3px solid #1a1a2e;
  background: #fff8e7;
  box-shadow: 3px 3px 0 #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: grab;
  user-select: none;
  font-size: 32px;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    opacity 0.3s;
  touch-action: none;
}

.ddp-item:active {
  cursor: grabbing;
}

.ddp-item.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  box-shadow: 1px 1px 0 #1a1a2e;
}

.ddp-item.placed {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* Предмет с готовой картинкой */
.ddp-item-img {
  width: clamp(71px, min(14vw, 13vh), 106px);
  height: clamp(71px, min(14vw, 13vh), 106px);
  object-fit: contain;
  display: block;
}

.ddp-item-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition:
    transform 0.15s,
    opacity 0.3s;
}

.ddp-item-image:active {
  cursor: grabbing;
}

.ddp-item-image.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  box-shadow: none;
}

.ddp-item-image.placed {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.ddp-item span.ddp-label {
  font-size: 10px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  line-height: 1.2;
}

/* Boo-реакция — теперь использует общие .boo-comment-row/.boo-comment-bubble,
   этот класс оставлен только для точечных переопределений при необходимости */
.ddp-boo-row {
  min-height: 48px;
}

.ddp-boo-bubble {
  background: white;
  border: 3px solid #1a1a2e;
  border-radius: 0 16px 16px 16px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.5;
  box-shadow: 3px 3px 0 #1a1a2e;
  flex: 1;
}

/* ЛАЙТБОКС (зум картинки) */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  touch-action: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (min-width: 600px) and (max-width: 1024px) {
  .comic-slide {
    flex: 0 0 100%;
  }

  .comic-grid {
    grid-template-columns: repeat(
      2,
      minmax(0, min(335px, calc((100vh - 260px) / 3 * 335 / 300)))
    );
    overflow-y: auto;
    max-height: calc(100vh - 200px);
  }

  /* КАРТА ДНЕЙ */
  .map-scene {
    padding-top: 30px;
  }
}

/* ── Мобайл + планшет: ≤ 1023px ── */
@media (max-width: 1023px) {
  /* header */
  .quest-topbar-left {
    display: flex;
    align-items: center;
  }

  .quest-topbar-left .quest-agent-btn {
    display: none;
  }

  .quest-topbar-right {
    display: flex;
    align-items: center;
  }

  .quest-header .quest-topbar-right .quest-map-btn {
    display: none;
  }

  /* footer */
  .quest-mobile-footer .quest-topbar-right .quest-map-btn {
    display: flex;
  }

  .quest-mobile-footer.is-visible {
    display: flex;
  }

  .quest-mobile-footer .quest-topbar-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .section-decorates-dark-footer::after {
    content: "";
    position: absolute;
    top: calc(var(--tear-height) * -1 + 4px);
    left: 0;
    width: 100%;
    height: var(--tear-height);
    background: url(./quest-data/images/border-header-dark.png) center bottom /
      cover no-repeat;
    pointer-events: none;
    z-index: 1;
    transform: scaleY(-1);
  }

  .quest-map-btn,
  .quest-agent-btn {
    gap: 4px;
  }

  .comic-slide .comic-panel {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 335 / 300;
  }

  .comic-slider-wrap .comic-dots {
    flex-shrink: 0;
    justify-content: center;
    padding: 10px 0;
  }

  .comic-viewer {
    gap: 0;
  }

  .comic-slider-wrap {
    display: flex;
    flex-direction: column;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    overflow: hidden;
  }

  .comic-track {
    flex: none;
  }
}

/* ── Мобайл: ≤ 768px ── */
@media (max-width: 768px) {
  /* Header */
  .header-container {
    padding: 8px 20px;
  }

  .quest-contact-btn {
    padding: 4px 8px;
  }

  /* zoomable-hint */
  .zoomable-hint {
    transform: none;
    right: 0;
    left: unset;
  }

  .quest-main.no-boo,
  .quest-main.has-boo,
  .choices-wrap {
    max-width: 690px;
  }

  /* КАРТА ДНЕЙ */
  #viewMap {
    background-position: center top;
  }

  .map-days {
    max-width: 700px;
    transform: translateX(-50%);
  }

  .days-grid {
    width: 100%;
  }

  .day-star {
    top: 8px;
    right: 4px;
  }

  .map-bubbles {
    transform: translateX(90px);
  }

  .map-bubble::after {
    left: 37%;
  }

  /* ЭКРАН РЕГИСТРАЦИИ */
  #viewRegister .loading-bubble,
  #viewLogin .loading-bubble {
    max-width: 156px;
  }

  .registration-card {
    padding: 10% 5%;
  }

  .loading-scene {
    margin-top: 70px;
    align-items: center;
    flex-direction: column;
    overflow-y: auto;
  }

  .loading-center {
    position: static;
    transform: none;
  }

  .loading-char--lucas img {
    min-height: 200px;
  }

  .loading-char--bu img {
    min-height: 150px;
  }

  /* РАЗБЛОКИРОВКА ДНЯ */
  .unlock-slots {
    flex-wrap: wrap;
  }

  .unlock-slot,
  .unlock-letter {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}

/* ── Маленький мобайл: ≤ 575px ── */
@media (max-width: 575px) {
  :root {
    --tear-height: 31px;
  }

  .quest-map-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 44%;
    border: 1px solid var(--color-header-accent);
    width: 16px;
    height: 0px;
    transform: rotate(-90deg);
  }

  /* Аудио */
  .audio-transcript {
    margin-bottom: 8px;
    max-height: 134px;
  }

  .audio-title {
    padding: 8px;
  }

  /* Адаптируем view */
  .choices-wrap {
    margin-top: 3px;
  }

  .char-bubble {
    padding: 8px;
    line-height: 135%;
  }

  .char-speaker {
    margin-bottom: 0;
  }

  /* Баббл из сцены диалога */
  .dialogue-bubble-left {
    left: 0%;
  }

  .dialogue-bubble-right {
    right: 0%;
  }

  /* Комикс */
  .comic-slide {
    gap: 8px;
  }

  /* ДОСЬЕ АГЕНТА */
  .dossier-scene {
    gap: 45px;
  }

  /* ДОСЬЕ */
  .agent-dossier {
    width: 290px;
    height: 386px;
  }

  .agent-stamp,
  .agent-label,
  .agent-callsign-value {
    font-size: 15px;
  }

  .agent-callsign {
    margin-top: 29px;
    font-size: 26px;
  }

  .agent-info {
    gap: 17px;
    margin-top: 38px;
  }

  .btn-dossier {
    width: clamp(100px, 23.9vw, 345px);
    height: clamp(42px, 8.68vw, 125px);
    margin-top: -25%;
  }

  /* ЛУ И БАБЛ */
  .dossier-char {
    flex-direction: row;
  }

  .dossier-bubble {
    transform: translateX(20%);
    bottom: 8%;
  }

  .dossier-bubble-text > p:nth-of-type(2) {
    margin-top: 15px;
  }

  .dossier-char-img {
    height: 300px;
    transform: scaleX(-1) translateX(-10px);
  }

  /* КАРТА ДНЕЙ */
  #viewMap {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .map-scene {
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    margin-top: auto;
    position: relative;
    min-height: 100%;
    height: auto;
    align-items: center;
  }

  .map-char {
    position: static;
    order: 2;
    width: 100%;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
  }

  .map-boo,
  .map-scene.is-lucas .map-boo {
    display: block;
    width: auto;
    height: 200px;
    flex-shrink: 0;
  }

  .map-scene.is-lucas .map-boo {
    margin-left: -9px;
    height: 260px;
  }

  .map-days {
    position: static;
    transform: none;
    order: 1;
    flex-shrink: 0;
  }

  .day-star {
    top: 0px;
    right: 1px;
  }

  .map-bubbles {
    align-self: flex-end;
    transform: translateX(50px);
    margin-bottom: 0;
  }

  .map-bubble {
    width: 220px;
  }

  .day-card {
    width: 100%;
  }

  .day-card.unlocked,
  .day-card.current,
  .day-card.completed {
    width: 100%;
  }

  .day-content {
    gap: 3px;
  }

  .map-bubble::after {
    left: 9%;
  }
}

@media (max-width: 480px) {
  .character-main .characters-image {
    min-height: 150px;
  }

  .character-secondary .characters-image {
    min-height: 190px;
  }

  .dialogue-bubble-right,
  .dialogue-bubble-left {
    position: absolute;
    top: -5vh;
    right: 0;
    left: 0;
    margin: auto;
  }
}

/* Планшеты в горизонтальной ориентации (десктопная раскладка) */
@media (min-width: 769px) and (max-width: 1024px) and (min-height: 600px) and (orientation: landscape) {
  /* ДОСЬЕ АГЕНТА */
  #viewDossier {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .dossier-scene {
    flex-direction: row-reverse;
    align-items: flex-end;
  }

  /* ЛУ И БАБЛ */
  .dossier-char {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .dossier-bubble {
    transform: translateX(40px);
  }

  .dossier-bubble::after {
    display: block;
  }

  .dossier-char-img {
    height: clamp(300px, 33.5vw, 470px);
  }

  /* ДОСЬЕ */
  .agent-dossier {
    width: clamp(324px, 33.3vw, 480px);
    height: clamp(441px, 44.5vw, 642px);
    margin-bottom: 22%;
  }

  .agent-stamp,
  .agent-label,
  .agent-callsign-value {
    font-size: clamp(16px, 1.8vw, 26px);
  }

  .agent-callsign {
    margin-top: clamp(40px, 3.4vw, 49px);
    font-size: clamp(26px, 2.5vw, 36px);
  }

  .agent-info {
    gap: clamp(17px, 1.66vw, 24px);
    margin-top: clamp(66px, 6.25vw, 90px);
  }

  /* КНОПКА */
  .btn-dossier {
    position: absolute;
    width: clamp(100px, 23.9vw, 345px);
    height: clamp(42px, 8.68vw, 125px);
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  /* no-boo: history-nav в потоке */
  .quest-main.no-boo .history-nav {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .quest-main.no-boo .char-scene {
    flex-shrink: 0;
  }

  .quest-main.no-boo .char-img-wrap {
    flex: unset;
    min-height: auto;
    height: auto;
    aspect-ratio: auto;
  }

  .quest-main.no-boo .char-img-wrap img {
    height: auto;
    object-fit: contain;
  }

  .quest-main.no-boo .video-scene {
    flex-shrink: 0;
  }

  .quest-main.no-boo .video-wrap {
    flex: unset;
    min-height: auto;
    height: auto;
  }

  .quest-main.no-boo .video-player {
    height: auto;
    max-height: min(70vh, 690px);
  }

  /* Комикс — сетка как на десктопе */
  .comic-grid {
    grid-template-columns: repeat(
      3,
      minmax(0, min(335px, calc((100vh - 210px) / 2 * 335 / 300)))
    );
    max-height: none;
    overflow-y: visible;
  }

  /* КАРТА ДНЕЙ */
  #viewMap {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .map-scene {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    padding-bottom: 40px;
    overflow: visible;
  }

  .map-days {
    position: static;
    order: 1;
    max-width: 100%;
    transform: none;
    flex-shrink: 0;
  }

  .map-char {
    position: static;
    order: 2;
    width: 100%;
    margin-top: 40px;
    flex-shrink: 0;
  }

  .map-bubbles {
    align-self: flex-start;
  }

  /* 404 PAGE */
  .error-center {
    left: 53%;
  }

  .error-chars-row {
    margin-bottom: 0;
  }

  .error-char--lucas {
    width: clamp(180px, min(35vw, 60vh), 380px);
  }

  .error-char--bu {
    width: clamp(180px, min(31vw, 53vh), 340px);
  }
}

@media (max-width: 375px) {
  /* ДОСЬЕ АГЕНТА */
  .dossier-bubble {
    bottom: -6%;
  }

  .dossier-char-img {
    width: 152px;
  }

  /* 404 PAGE */
  .btn-error {
    width: 169px;
  }

  .error-chars-row {
    gap: 0;
  }

  .error-char--lucas {
    width: min(49vw, 52vh);
  }

  .error-char--bu {
    width: min(47vw, 48vh);
  }
}

@media (min-width: 375px) and (orientation: portrait) {
  .loading-char--lucas img {
    min-height: 300px;
  }

  .loading-char--bu img {
    min-height: 200px;
  }

  .characters-container {
    --char-height: 35vh;
  }

  /* 404 PAGE */
  .error-chars-row {
    gap: 0;
    margin-bottom: 60px;
  }

  .error-char--lucas {
    width: clamp(250px, min(46vw, 52vh), 460px);
    max-width: none;
  }

  .error-char--bu {
    width: clamp(231px, min(43vw, 44vh), 450px);
    max-width: none;
  }
}

@media (min-width: 769px) and (orientation: portrait) {
  .loading-center {
    top: 15%;
  }

  .loading-char--lucas img {
    min-height: 550px;
  }

  .loading-char--bu img {
    min-height: 350px;
  }

  /* КАРТА ДНЕЙ */
  .map-days {
    top: 30%;
    transform: translate(-50%, -50%);
  }
}

.hr-zone:hover {
  background: url("./quest-data/images/hotspot-frame.png") center / contain
    no-repeat;
}

@media (hover: hover) and (pointer: fine) {
  .quest-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #1a1a2e;
  }

  .comic-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #1a1a2e;
  }

  .copy-btn:hover {
    background: #ffd76b22;
  }

  .day-card.unlocked:hover,
  .day-card.current:hover,
  .day-card.completed:hover {
    filter: brightness(1.04);
  }

  .quest-contact-btn:hover,
  .choice-btn:hover,
  .quiz-btn:hover {
    transform: translate(2px, 2px);
    background: var(--color-button-text);
    color: var(--color-button-background);
  }

  .choice-btn.choice-btn--multi:hover {
    transform: none;
  }

  .choice-btn--selected:hover {
    background: var(--color-button-text);
    color: var(--color-button-background);
  }

  .quest-hotspot:hover {
    background: rgba(255, 215, 107, 0.3);
  }

  .riddle-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #1a1a2e;
  }

  .register-btn:hover::before {
    opacity: 0.3;
  }

  .auth-switch a:hover {
    color: var(--color-button-background);
  }

  .audio-ctrl-btn:hover svg path,
  .audio-ctrl-btn:hover svg line {
    stroke: var(--color-button-text);
    fill: var(--color-button-text);
  }

  .audio-play-btn:hover {
    border: 2px solid var(--color-button-text);
  }
}

/* Большие планшеты (портрет) */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: portrait) {
  /* ДОСЬЕ АГЕНТА */
  #viewDossier {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .dossier-scene {
    flex-direction: column;
    align-items: center;
    gap: 70px;
  }

  /* ЛУ И БАБЛ */
  .dossier-char {
    flex-direction: row-reverse;
    align-items: flex-start;
    margin-left: -22%;
    gap: 0;
  }

  .dossier-bubble {
    transform: translateX(-70px);
  }

  .dossier-bubble::after {
    left: 7%;
  }

  .dossier-char-img {
    height: 530px;
  }

  /* ДОСЬЕ */
  .dossier-block {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .agent-dossier {
    margin-bottom: 0;
    width: 540px;
    height: 755px;
  }

  .agent-stamp,
  .agent-label,
  .agent-callsign-value {
    font-size: 26px;
  }

  .agent-callsign {
    margin-top: 49px;
    font-size: 36px;
  }

  .agent-info {
    gap: 24px;
    margin-top: 90px;
  }

  /* КНОПКА */
  .btn-dossier {
    position: static;
    margin-top: -28%;
    width: 232px;
    height: 92px;
  }

  /* 404 PAGE */
  .error-char--lucas {
    width: clamp(220px, min(40vw, 52vh), 453px);
  }

  .error-char--bu {
    width: clamp(190px, min(37vw, 43vh), 421px);
  }
}

/* ПЛАНШЕТЫ В АЛЬБОМНОЙ ОРИЕНТАЦИИ */
@media (max-width: 1024px) and (orientation: landscape) and (min-height: 500px) {
  .quest-main.has-boo:has(.ddp-scene),
  .quest-main.has-boo:has(.kp-scene) {
    overflow-y: auto;
  }

  .ddp-scene,
  .kp-scene {
    flex-direction: column !important;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    flex: unset;
    min-height: auto;
  }

  .ddp-scene > *,
  .kp-scene > * {
    order: initial;
  }

  .ddp-scene .boo-right-col,
  .kp-scene .boo-right-col {
    display: contents;
  }

  .ddp-scene .boo-comment-row,
  .kp-scene .boo-comment-row {
    order: 1;
    width: fit-content;
  }

  .ddp-scene .ddp-feedback-bubble {
    order: 2;
    margin: 0;
  }

  .ddp-scene .ddp-left-col,
  .kp-scene .kp-left-col {
    order: 3;
    max-width: 100%;
    align-self: auto;
    max-height: none;
    overflow-y: visible;
  }

  .ddp-scene .ddp-controls {
    order: 4;
    width: fit-content;
    align-self: center;
  }
}

/* Дисклеймеры / cookie / поддержка */
.disclaimer-modal--contact {
  display: flex;
  flex-direction: column;
  width: min(598px, 100%);
  max-height: min(80vh, 520px);
}

.disclaimer-modal--contact .disclaimer-modal__body {
  flex: 1;
  overflow: visible;
}

.disclaimer-modal--contact .disclaimer-modal__actions {
  margin-top: 20px;
  justify-content: center;
}

.disclaimer-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1440px;
  padding: 0 20px;
  box-sizing: border-box;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  pointer-events: none;
}

.disclaimer-bar[hidden] {
  display: none !important;
}

.disclaimer-bar__btn {
  border: none;
  border-radius: 12px;
  background: #e8e5dc;
  color: #532e2c;
  cursor: pointer;
  transition: background 0.12s ease;
  padding: 5px;
  font: inherit;
  pointer-events: auto;
}

.disclaimer-bar__btn:hover {
  background: #e8dbb6;
}

.disclaimer-bar__icon {
  width: 50px;
  height: 50px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.disclaimer-modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.disclaimer-modal-root[hidden] {
  display: none !important;
}

.disclaimer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 23, 9, 0.55);
  cursor: pointer;
}

.disclaimer-modal {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(80vh, 560px);
  overflow-y: auto;
  border-radius: 12px;
  padding: 16px 56px 16px 40px;
  background: #e8e5dc;
}

.disclaimer-modal[hidden] {
  display: none !important;
}

.disclaimer-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #532e2c;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.disclaimer-modal__title {
  margin: 0 0 12px;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 400;
  padding-right: 12px;
}

.disclaimer-modal__body p {
  margin: 0;
}

.disclaimer-modal__body a {
  color: #5e1200;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.disclaimer-modal__body a:hover {
  color: #c81c12;
}

.disclaimer-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.disclaimer-modal--cookies {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disclaimer-modal__cookie-intro {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.disclaimer-modal__cookie-intro[hidden],
.disclaimer-modal__cookie-detail[hidden] {
  display: none !important;
}

.disclaimer-modal__cookie-main {
  flex: 1;
  min-width: 0;
}

.disclaimer-modal--cookies .disclaimer-bar__icon {
  width: 100px;
  height: 100px;
}

.disclaimer-modal__cookie-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 1024px) {
  .quest-app:has(#viewMap.active) .disclaimer-bar {
    bottom: 110px;
  }
}

@media (max-width: 768px) {
  .disclaimer-bar {
    gap: 8px;
  }

  .quest-app:has(#viewMap.active) .disclaimer-bar {
    bottom: 75px;
  }

  .disclaimer-bar__icon {
    width: 27px;
    height: 27px;
  }

  .disclaimer-modal {
    padding: 16px 44px 16px 16px;
  }

  .disclaimer-modal--cookies {
    padding: 16px;
  }

  .disclaimer-modal--cookies .disclaimer-bar__icon {
    display: none;
  }
}
