/* «Ваш день в МИП» — стили игры.
   Красный только из гайдбука: #DD1E26. Заголовки Oswald, текст PT Root UI (пока его нет в проекте, Onest). */

:root {
  --red: #DD1E26;
  --ink: #212121;
  --bg: #0b0b0b;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .74);
  --f1: #E8B04A; --f2: #8CC8F0; --f3: #F29BC0; --f4: #A99CFF; --f5: #6FD3A6;
  --display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --text: 'PT Root UI', 'Onest', 'Helvetica Neue', Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--text); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
/* align-items: normal — как в Chrome: в Safari до 26 у кнопок по умолчанию align-items: flex-start, и всё внутри кнопок-карточек
   сжималось до содержимого (прорезь пропуска ложилась на знак МИП, правка 25.11) */
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; align-items: normal; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
img { display: block; max-width: none; }
h1, h2, p { margin: 0; }

.app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.scene { position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.dip { position: absolute; inset: 0; z-index: 90; background: #000; pointer-events: none; }
/* заставка при открытии и загрузка сцены: знак МИП дышит, под ним бежит красная полоска */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); }
.boot, .loading { display: grid; place-items: center; align-content: center; gap: 20px; pointer-events: none; }
.loading { position: absolute; inset: 0; opacity: 0; animation: kShow .35s ease-out forwards; }
.loading.now { opacity: 1; animation: none; }
.boot img, .loading img { width: 46px; height: auto; animation: kBreath 1.6s ease-in-out infinite; }
.boot i, .loading i { position: relative; width: 120px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .14); }
.boot i::after, .loading i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 40%; background: var(--red); animation: kRun 1.1s ease-in-out infinite; }
@keyframes kShow { to { opacity: 1; } }
@keyframes kBreath { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
@keyframes kRun { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- плоскость сцены ---------- */
.cam { position: absolute; inset: 0; transform-origin: 0 0; }
.walker { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }   /* коридор и дверь: общее покачивание шага */
.bob { position: absolute; inset: 0; }
.plane { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.plane-img, .plane > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.plane > img.op { opacity: 0; }
.ui { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.ui > * { pointer-events: auto; }
.ui > .hint, .ui > .toast, .ui > .chap, .ui > .fly, .ui > .focus { pointer-events: none; }

/* ---------- верхняя панель ---------- */
.hud {
  position: absolute; z-index: 40; left: calc(16px + var(--safe-l)); top: calc(14px + var(--safe-t));
  display: flex; align-items: center; gap: 12px; padding: 7px 16px 7px 9px;
  border-radius: 100px; background: rgba(12, 12, 12, .66);
  /* место справа занимают звук и линза: длинное название места сокращается многоточием, а не уходит под них */
  max-width: calc(100% - 184px - var(--safe-l) - var(--safe-r));
}
.hud > * { flex: none; }
.hud-sign { width: 30px; height: auto; }
.hud-clock { font-family: var(--display); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-bar { width: 1px; height: 22px; background: rgba(255, 255, 255, .4); }
.hud-place { font-size: 16px; white-space: nowrap; color: rgba(255, 255, 255, .94); }
.hud > .hud-place { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-right { position: absolute; z-index: 40; right: calc(16px + var(--safe-r)); top: calc(14px + var(--safe-t)); display: flex; align-items: center; gap: 12px; }
.hud-sound {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .34); background: rgba(15, 15, 15, .62); color: #fff;
}
.hud-sound svg { width: 22px; height: 22px; }
.hud-sound { transition: background-color .15s, border-color .15s; }
@media (hover: hover) { .hud-sound:hover { background: rgba(60, 60, 60, .92); border-color: #fff; } }
.hud-lens { width: 84px; height: 84px; }
.hud-lens svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---------- нижняя панель ----------
   На всю ширину и прижата к низу: сцена стоит над ней, и панель не закрывает людей в кадре. */
.sheet {
  position: absolute; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 30px;
  padding: 20px max(24px, calc(50% - 600px)) calc(22px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background: rgba(17, 17, 17, .97); border-top: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
}
.sheet-act { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tip { display: flex; align-items: center; gap: 10px; font-size: 14.5px; line-height: 1.3; color: rgba(255, 255, 255, .9); }
.tip i { position: relative; width: 14px; height: 14px; flex: none; border-radius: 50%; background: #fff; animation: kTip 1.6s ease-out infinite; }
@keyframes kTip { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
.sheet.locked .tip { opacity: .4; }
.sheet.locked .tip i { animation: none; }
.sheet-head { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.seg { display: flex; gap: 5px; }
.seg i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.seg i.d { background: var(--red); }
.seg i.n { background: #fff; }
.lab { font-family: var(--display); font-size: 15px; line-height: 1.1; color: var(--red); text-transform: uppercase; letter-spacing: .02em; }
.lab b { font-weight: 400; color: #fff; margin-right: 8px; }
/* строка «7/10 АФИША» и справа «‹ Назад» (ответ МИП 23.11): тихая кнопка, при наведении белеет, ничего не сдвигается;
   зона нажатия больше самой надписи за счёт отрицательных полей — строка не становится выше */
.lab-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.lab-row .lab { min-width: 0; }
.sheet-back { display: inline-flex; align-items: center; gap: 3px; flex: none; margin: -10px -6px -10px 0; padding: 10px 6px;
  font-size: 14px; line-height: 1; color: rgba(255, 255, 255, .72); transition: color .2s, opacity .2s; }
.sheet-back svg { width: 16px; height: 16px; flex: none; }
@media (hover: hover) { .sheet-back:not(:disabled):hover { color: #fff; } }
.sheet-back:disabled { opacity: .35; cursor: default; }
.sheet-back:focus-visible { outline: 2px solid #fff; outline-offset: 0; border-radius: 8px; }
.intro { font-size: 14.5px; line-height: 1.45; color: rgba(255, 255, 255, .78); }
.intro-wrap { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.intro.clamp { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { flex: none; font-size: 14px; color: #fff; border-bottom: 1px dashed rgba(255, 255, 255, .55); line-height: 1.2; }
@media (hover: hover) { .more:hover { border-bottom-style: solid; border-bottom-color: #fff; } }
/* вопрос стоит сразу под вступлением, а не у нижнего края окна (замечание МИП 23.11: «тексты падают вниз») */
.ask { margin-top: 4px; font-family: var(--display); font-weight: 400; font-size: 29px; line-height: 1.12; text-transform: uppercase; text-wrap: balance; }
.note { font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .66); }
.sheet-pass .ask { margin-top: 0; }

.opts { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 150px; min-width: 0;
  text-align: left; padding: 14px; border-radius: 12px;
  background: #232323; border: 1.5px solid rgba(255, 255, 255, .14);
  font-size: 15px; line-height: 1.38; color: #fff;
  transition: border-color .2s, background-color .2s, transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.opt .ic { transition: color .2s; }
@media (hover: hover) {
  /* при наведении карточка не двигается: видна по белой рамке, светлому фону и красному значку */
  .opt:not(:disabled):hover { border-color: #fff; background: #2f2f2f; box-shadow: 0 0 0 1px #fff, 0 10px 24px rgba(0, 0, 0, .45); }
  .opt:not(:disabled):hover .ic { color: var(--red); }
  .opt.sel:not(:disabled):hover { border-color: var(--red); background: #3a1a1d; box-shadow: 0 0 0 1px var(--red), 0 10px 24px rgba(0, 0, 0, .45); }
}
.opt.sel { border-color: var(--red); background: #2d1517; }
.opt:disabled { cursor: default; }
.sheet.locked .opt:not(.sel) { opacity: .45; }
.opt .ic { display: block; height: 24px; color: #fff; }
.opt .ic svg { width: 24px; height: 24px; display: block; }
.opt-t { display: block; }

/* пропуск на ресепшене */
.opt-pass { min-height: 150px; padding: 16px 18px 18px; gap: 16px; background: #E9EAEC; color: #1f1f1f; border-color: transparent; font-size: 16px; }
/* прорезь пропуска меряется от всей карточки (.opt — position: relative), а не от строки со знаком: в части версий Safari
   эта строка сжималась до ширины знака, и прорезь ложилась на него (правка 25.11). top = верхнее поле карточки + 2px */
.pass-top { display: flex; align-items: center; height: 28px; }
.pass-top img { width: 30px; height: auto; }
.pass-slot { position: absolute; left: 50%; top: 18px; width: 44px; height: 9px; margin-left: -22px; border-radius: 5px; background: #2a2a2a; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
@media (hover: hover) {
  .opt-pass:not(:disabled):hover { background: #fff; border-color: var(--red); box-shadow: 0 0 0 1.5px var(--red), 0 12px 28px rgba(0, 0, 0, .5); }
  .opt-pass:not(:disabled):hover .pass-slot { background: var(--red); }
}
.pass-slot { transition: background-color .2s; }
.opt-pass.sel { background: #fff; border-color: var(--red); box-shadow: 0 0 0 2px var(--red), 0 14px 30px rgba(0, 0, 0, .45); }

/* ---------- подсказки, цели, тост ---------- */
.hint {
  position: absolute; z-index: 41; left: 50%; transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 10px; max-width: calc(100% - 24px);
  border-radius: 100px; background: #0f0f0f; border: 1px solid rgba(255, 255, 255, .28);
  font-size: 15px; line-height: 1.25; white-space: nowrap; box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}
.hint i { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .2); flex: none; }

.target { position: absolute; z-index: 35; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; }
.target-ring { position: absolute; inset: 0; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .28); animation: kPulse 1.6s ease-out infinite; }
.target-dot { position: relative; width: 30%; height: 30%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .26), 0 2px 10px rgba(0, 0, 0, .45); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) {
  .target:hover .target-dot, .door-hit:hover ~ .target .target-dot { transform: scale(1.45); }
}
.target.red .target-ring { border-color: var(--red); }
.target.red .target-dot { background: var(--red); box-shadow: 0 0 0 6px rgba(221, 30, 38, .3), 0 2px 10px rgba(0, 0, 0, .45); }
@keyframes kPulse { 0% { opacity: .95; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.7); } }

.here {
  position: absolute; z-index: 36; transform: translate(-50%, -100%);
  padding: 7px 16px; border-radius: 100px; background: #fff; color: #111;
  font-weight: 600; font-size: 16px; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); animation: kHere 1.6s ease-in-out infinite;
}
.here::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff; }
@keyframes kHere { 0%, 100% { margin-top: 0; } 50% { margin-top: -5px; } }
.here, .here::after { transition: background-color .15s, color .15s, border-color .15s; }
@media (hover: hover) {
  .here:hover { background: var(--red); color: #fff; }
  .here:hover::after { border-top-color: var(--red); }
}

.toast {
  position: absolute; z-index: 45; left: 50%; top: calc(22px + var(--safe-t)); transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; max-width: calc(100% - 32px);
  border-radius: 100px; background: rgba(12, 12, 12, .92); border: 1px solid rgba(255, 255, 255, .2);
  font-size: 17px; line-height: 1.3; box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
}
.toast i { width: 22px; height: 20px; flex: none; background: var(--c); clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 0 6px var(--c)); }

.chap { position: absolute; z-index: 42; left: calc(clamp(16px, 5vw, 72px) + var(--safe-l)); bottom: max(9%, 64px); display: grid; justify-items: start; gap: 12px; }
.chap small { font-family: var(--display); font-size: 22px; text-transform: uppercase; display: flex; align-items: center; gap: 12px; letter-spacing: .02em;
  padding: 6px 16px 7px 18px; background: rgba(10, 10, 10, .55); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.chap small::before { content: ""; width: 40px; height: 3px; background: var(--red); }
.chap b { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 1.06; font-size: clamp(52px, 8vw, 116px); padding: 10px 18px 14px; background: rgba(10, 10, 10, .5); text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }

.fly { position: absolute; left: 0; top: 0; z-index: 56; width: 30px; height: 30px; margin: -15px 0 0 -15px; filter: drop-shadow(0 0 10px var(--c)) drop-shadow(0 0 3px var(--c)); }
.fly::before { content: ""; position: absolute; inset: 0; background: var(--c); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* стрелка на полу, как в панорамах улиц */
.arrow { position: absolute; z-index: 34; transform: translate(-50%, -50%); }
.arrow svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }
.arrow .core { animation: kArrow 1.3s ease-in-out infinite; }
.arrow svg { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.arrow .chev { transition: fill .15s; }
@media (hover: hover) { .arrow:hover .chev { fill: var(--red); } .arrow:hover svg { transform: scale(1.08); } }
.arrow:active .chev { fill: var(--red); }
@keyframes kArrow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ресепшен: пропуск лёг на стойку */
.say {
  position: absolute; z-index: 37; transform: translate(-50%, -100%);
  padding: 9px 16px 10px; border-radius: 14px; background: #fff; color: #151515;
  font-size: 16px; font-weight: 600; line-height: 1.25; white-space: nowrap; box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
}
.say::after { content: ""; position: absolute; left: calc(50% + var(--tail, 0px)); bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff; }
.stamp { position: absolute; z-index: 36; width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--red); pointer-events: none; }
.opt.ghost { transition: none; }

/* ---------- дверь ---------- */
.leaf { position: absolute; transform-origin: 0 50%; background-repeat: no-repeat; }
.leaf .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .6)); opacity: 0; }
.leaf .sg { position: absolute; }
.light { position: absolute; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(255, 236, 200, .3), rgba(255, 220, 170, 0) 70%); }
.nob { position: absolute; display: grid; place-items: center; background: #E9EAEC; color: #202020; border-radius: 3px; font-family: var(--display); font-weight: 500; line-height: 1; }
.door-hit { position: absolute; z-index: 33; cursor: pointer; }

/* ---------- ситуация 1: слова клиента на экране аудитории ---------- */
.slide { position: absolute; display: grid; align-items: center; }
.slide p { font-family: var(--display); font-weight: 400; text-transform: uppercase; color: #1f1f1f; }
.frg { background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0% 3px; transition: opacity .35s, background-size .45s cubic-bezier(.2, .8, .2, 1); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.slide.picked .frg { opacity: .32; }
.slide.picked .frg.on { opacity: 1; background-size: 100% 3px; }
.frg.peek { background-size: 100% 3px; }
.slide.picked .frg.peek:not(.on) { opacity: .75; background-image: linear-gradient(rgba(221, 30, 38, .5), rgba(221, 30, 38, .5)); }

.focus { position: absolute; left: 0; top: 0; z-index: 35; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; }
.focus svg { width: 100%; height: 100%; display: block; overflow: visible; }
.focus .halo { fill: rgba(255, 255, 255, .1); stroke: rgba(0, 0, 0, .5); stroke-width: 7; }
.focus .rg { fill: none; stroke: #fff; stroke-width: 3; }
/* тёмная подложка под рисками вместо drop-shadow: Safari не применяет CSS filter к фигурам внутри SVG */
.focus .tk-b { stroke: rgba(0, 0, 0, .6); stroke-width: 6; }
.focus .tk { stroke: #fff; stroke-width: 3; }
.focus .pr { fill: none; stroke: var(--red); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* ---------- ситуации 2–10: предметы, метки, отклик ---------- */
/* вырез предмета точно по контуру (clip-path из sit-config.js) и обводка по тому же контуру.
   Толщина линии и свечения (--lw, --gl) пересчитываются под масштаб фото — на экране всегда одинаковые */
.cut { position: absolute; z-index: 2; transform-origin: 50% 100%; pointer-events: none; transition: opacity .3s, filter .38s; }
.cut.tear { transform-origin: 50% 0; }   /* отрывной билет: качается от линии отрыва */
/* чистое место под взятым предметом (стол без карточки, стена без билета) — под затемнением сцены */
.patch { position: absolute; z-index: 0; display: block; pointer-events: none; background-repeat: no-repeat; }
.cut-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; background-repeat: no-repeat; transition: filter .25s; }
.cut-o { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; transition: opacity .2s;
  -webkit-filter: drop-shadow(0 0 var(--gl, 5px) rgba(255, 255, 255, .85)); filter: drop-shadow(0 0 var(--gl, 5px) rgba(255, 255, 255, .85)); }
.cut-o svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cut-o polygon { fill: none; stroke-linejoin: round; }
.cut-o .b { stroke: rgba(12, 12, 12, .45); stroke-width: var(--lb, 5px); }
.cut-o .l { stroke: #fff; stroke-width: var(--lw, 2.4px); }
.cut.hot .cut-img { filter: brightness(1.12); }
.cut.hot .cut-o { opacity: 1; }
/* выбранная дверь: светится и обведена красным */
.cut.glow .cut-img { filter: brightness(1.2) saturate(1.06); }
.cut.glow .cut-o { opacity: 1; -webkit-filter: drop-shadow(0 0 var(--gl, 5px) rgba(221, 30, 38, .9)); filter: drop-shadow(0 0 var(--gl, 5px) rgba(221, 30, 38, .9)); }
.cut.glow .cut-o .l { stroke: var(--red); }
.sit .nob { z-index: 3; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: filter .38s; }
.sit .nob.shade { filter: brightness(.38); }   /* номер кабинета поверх выреза двери; нажатие проходит к двери */
.cut.up { z-index: 4; }
.cut.dim { opacity: 0; }
.cut.shade { filter: brightness(.38); }   /* как затемнение сцены (.spot) */
.slot-hl { position: absolute; z-index: 2; border: 3px dashed #fff; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 0 18px rgba(255, 255, 255, .35); }
.slot-hl.hot { opacity: 1; }
.spot { position: absolute; left: 0; top: 0; z-index: 1; background: rgba(6, 6, 6, .62); opacity: 0; pointer-events: none; }
.obj-hit { position: absolute; z-index: 3; border-radius: 8px; }
.floor-ring { position: absolute; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .25s; }
.floor-ring svg { width: 100%; height: 100%; display: block; overflow: visible; }
.floor-ring ellipse { fill: rgba(255, 255, 255, .1); stroke: #fff; stroke-width: 5; stroke-dasharray: .025 .015; stroke-dashoffset: 0; }
.floor-ring.hot { opacity: .9; }
.floor-ring.on { opacity: 1; }
.floor-ring.on ellipse { stroke: var(--red); fill: rgba(221, 30, 38, .16); stroke-dasharray: 1; }
.tag { position: absolute; z-index: 33; left: 0; top: 0; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #151515; font-weight: 700; font-size: 15px; line-height: 1; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .28), 0 4px 12px rgba(0, 0, 0, .45); transition: background-color .2s, color .2s, box-shadow .2s, opacity .3s; }
.tag.hot, .tag.on { background: var(--red); color: #fff; box-shadow: 0 0 0 5px rgba(221, 30, 38, .32), 0 4px 12px rgba(0, 0, 0, .45); }
.tag.off { opacity: 0 !important; }   /* после появления у метки остаётся встроенная непрозрачность */
.opt .tg { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; color: #151515;
  font-weight: 700; font-size: 14px; line-height: 1; transition: background-color .2s, color .2s; }
.opt.hot .tg, .opt.sel .tg { background: var(--red); color: #fff; }
@media (hover: hover) { .opt:not(:disabled):hover .tg { background: var(--red); color: #fff; } }
.opt.hot:not(:disabled) { border-color: #fff; background: #2f2f2f; box-shadow: 0 0 0 1px #fff, 0 10px 24px rgba(0, 0, 0, .45); }
.opt .no { font-family: var(--display); font-size: 24px; line-height: 1; color: #fff; }
.opt.hot .no, .opt.sel .no { color: var(--red); }
.slot-card { position: absolute; z-index: 3; display: grid; place-items: center; align-content: center; gap: 4%; background: var(--red); border-radius: 6px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .45); color: #fff; }
.slot-card img { width: 30%; height: auto; filter: brightness(0) invert(1); }
.slot-card b { font-family: var(--display); font-weight: 400; line-height: 1; }
.poster-t { position: absolute; display: flex; align-items: flex-start; overflow: hidden; color: #fff; font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 1.12; letter-spacing: .01em; }
.poster-t span { display: block; }
.sit .office .plane-img { opacity: 1; }
.sit .cam.office { opacity: 0; z-index: 5; }

/* блокнот (ситуация 10): панель — страница блокнота, вариант подчёркивается красной линией */
.sheet-note .opts { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 20px 8px; border-radius: 12px; background: #F3EEE4; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.opt-note { min-height: 0; padding: 12px 2px 11px; gap: 0; border: 0; border-bottom: 1px solid rgba(40, 40, 40, .16); border-radius: 0; background: transparent; color: #202020; font-size: 16px; line-height: 1.35; }
.opt-note:last-child { border-bottom: 0; }
.opt-note .opt-t { display: inline; background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0% 3px; transition: background-size .65s cubic-bezier(.3, .7, .2, 1); padding-bottom: 2px; }
.opt-note.struck .opt-t, .opt-note.sel .opt-t { background-size: 100% 3px; }
@media (hover: hover) { .opt-note:not(:disabled):hover { background: rgba(221, 30, 38, .07); border-color: rgba(40, 40, 40, .16); transform: none; box-shadow: none; } }
.opt-note.hot:not(:disabled) { background: rgba(221, 30, 38, .07); border-color: rgba(40, 40, 40, .16); transform: none; box-shadow: none; }
.opt-note.sel { background: transparent; border-color: rgba(40, 40, 40, .16); }
.sheet.locked .opt-note:not(.sel) { opacity: .4; }

/* ---------- кнопка ---------- */
.btn-red {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: var(--red); color: #fff; border-radius: 100px; font-weight: 700;
  transition: transform .2s, background-color .2s, box-shadow .2s;
}
@media (hover: hover) { .btn-red:hover { background: #b8131a; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(221, 30, 38, .38); } }
.btn-red:active { transform: scale(.97); }

/* ---------- ПК: крупный текст (правка МИП 24.11: «для людей с плохим зрением шрифт мелкий и не читается на пк») ----------
   Основной текст панели — варианты, вступление, пропуска, строки блокнота — не мельче 18 px; подсказка, «6/10 …»,
   «Назад», примечание — не мельче 16 px. Строка «6/10 …» белая: красный #DD1E26 на тёмной панели — 3,8:1, а для
   мелкого текста нужно 4,5:1; красными остаются полоски прогресса. Панель шире (содержимое до 1320 px), левая колонка
   уже: варианты занимают меньше строк, и панель почти не выросла. Телефон и планшет вертикально — без изменений */
@media (min-width: 760px) and (min-aspect-ratio: 9/10) {
  .hud { background: rgba(12, 12, 12, .8); }
  /* левая колонка 340 px, но не уже самого длинного неразрывного куска вопроса: «На чём Вы сосредоточитесь?»
     типограф связывает целиком, и на большом мониторе вопрос иначе заходил бы на карточки */
  .sheet { grid-template-columns: minmax(340px, min-content) minmax(0, 1fr); gap: 28px;
    padding-left: max(24px, calc(50% - 660px)); padding-right: max(24px, calc(50% - 660px)); }
  .lab { font-size: 17px; line-height: 1.15; color: #fff; }
  .lab b { margin-right: 10px; }
  .sheet-back { font-size: 16px; color: rgba(255, 255, 255, .82); }
  .sheet-back svg { width: 18px; height: 18px; }
  .intro { font-size: 18px; line-height: 1.45; color: rgba(255, 255, 255, .88); text-wrap: pretty; }
  .note { font-size: 17px; line-height: 1.45; color: rgba(255, 255, 255, .8); text-wrap: pretty; }
  .tip { font-size: 16px; line-height: 1.35; color: #fff; }
  .opt { font-size: 18px; line-height: 1.38; }
  .opt .tg { width: 30px; height: 30px; font-size: 16px; }
  .opt-pass { font-size: 19px; }
  .opt-note { font-size: 18px; line-height: 1.4; }
  .tag { width: 32px; height: 32px; font-size: 16px; }
  .hint { font-size: 17px; }
}

/* невысокий десктоп: панель компактнее, сцене остаётся больше места (кегль — как выше, не меньше) */
@media (max-height: 820px) and (min-width: 760px) and (min-aspect-ratio: 9/10) {
  .sheet { padding-top: 14px; padding-bottom: calc(14px + var(--safe-b)); gap: 24px; }
  .sheet-head { gap: 7px; }
  .intro { line-height: 1.4; }
  .ask { font-size: 25px; }
  .opt { min-height: 0; padding: 11px 12px 12px; gap: 7px; line-height: 1.35; }
  .opt-pass { min-height: 0; padding: 13px 16px 15px; gap: 12px; }
  .pass-slot { top: 15px; }
  .sheet-act { gap: 9px; }
}

/* большой монитор (ответ МИП 23.11: «на большом экране ПК тексты ситуаций и варианты не видны, падают вниз»):
   панель растёт вместе с окном. Кегль, карточки и отступы умножаются на --u: 1 при окне 1440×760, до 1,6 на 2560×1440;
   ширина панели растёт так же. Сцена над панелью подстраивается сама (sit.js берёт верх панели из вёрстки) */
@media (min-width: 1200px) and (min-height: 821px) and (min-aspect-ratio: 9/10) {
  /* правка 24.11: те же множители, но от крупного кегля (варианты 18 вместо 15, вступление 18 вместо 14,5) */
  .sheet { --u: clamp(1px, min(100vw / 1440, 100vh / 760), 1.6px);
    grid-template-columns: minmax(calc(340 * var(--u)), min-content) minmax(0, 1fr); gap: calc(28 * var(--u));
    padding: calc(20 * var(--u)) max(24px, calc(50% - 660 * var(--u))) calc(22 * var(--u) + var(--safe-b));
    border-radius: calc(22 * var(--u)) calc(22 * var(--u)) 0 0; }
  .sheet-act { gap: calc(12 * var(--u, 1px)); }
  .sheet-head { gap: calc(10 * var(--u, 1px)); }
  .seg { gap: calc(5 * var(--u, 1px)); }
  .seg i { height: calc(4 * var(--u, 1px)); }
  .lab { font-size: calc(17 * var(--u, 1px)); }
  .sheet-back { font-size: calc(16 * var(--u, 1px)); }
  .sheet-back svg { width: calc(18 * var(--u, 1px)); height: calc(18 * var(--u, 1px)); }
  .intro { font-size: calc(18 * var(--u, 1px)); }
  .more { font-size: calc(14 * var(--u, 1px)); }
  .ask { font-size: calc(29 * var(--u, 1px)); margin-top: calc(4 * var(--u, 1px)); }
  .note { font-size: calc(17 * var(--u, 1px)); }
  .tip { font-size: calc(16 * var(--u, 1px)); gap: calc(10 * var(--u, 1px)); }
  .tip i { width: calc(14 * var(--u, 1px)); height: calc(14 * var(--u, 1px)); }
  .opts { gap: calc(10 * var(--u, 1px)); }
  .opt { min-height: calc(150 * var(--u, 1px)); padding: calc(14 * var(--u, 1px)); gap: calc(10 * var(--u, 1px)); font-size: calc(18 * var(--u, 1px)); border-radius: calc(12 * var(--u, 1px)); }
  .opt .ic { height: calc(24 * var(--u, 1px)); }
  .opt .ic svg { width: calc(24 * var(--u, 1px)); height: calc(24 * var(--u, 1px)); }
  .opt .tg { width: calc(30 * var(--u, 1px)); height: calc(30 * var(--u, 1px)); font-size: calc(16 * var(--u, 1px)); }
  .opt .no { font-size: calc(24 * var(--u, 1px)); }
  .opt-pass { min-height: calc(150 * var(--u, 1px)); padding: calc(16 * var(--u, 1px)) calc(18 * var(--u, 1px)) calc(18 * var(--u, 1px)); gap: calc(16 * var(--u, 1px)); font-size: calc(19 * var(--u, 1px)); }
  .pass-top { height: calc(28 * var(--u, 1px)); }
  .pass-top img { width: calc(30 * var(--u, 1px)); }
  .pass-slot { top: calc(18 * var(--u, 1px)); width: calc(44 * var(--u, 1px)); height: calc(9 * var(--u, 1px)); margin-left: calc(-22 * var(--u, 1px)); }
  .sheet-note .opts { padding: calc(4 * var(--u, 1px)) calc(20 * var(--u, 1px)) calc(8 * var(--u, 1px)); border-radius: calc(12 * var(--u, 1px)); }
  /* строки блокнота (ситуация 10) — не карточки: без высоты карточки, скругления и промежутка */
  .opt-note { min-height: 0; gap: 0; border-radius: 0; padding: calc(12 * var(--u, 1px)) calc(2 * var(--u, 1px)) calc(11 * var(--u, 1px)); font-size: calc(18 * var(--u, 1px)); }
  .opt:not(.opt-note):not(.opt-pass) { padding-left: calc(13 * var(--u, 1px)); padding-right: calc(13 * var(--u, 1px)); }
}

/* ПК уже 1280 px (небольшой ноутбук, планшет лёжа): при 18 px четыре карточки в ряд стали бы уже самого длинного
   неразрывного куска варианта («в его переживаниях.» — 179 px), поэтому варианты встают сеткой 2×2,
   буква (значок, номер кабинета) — слева от текста: панель не выше, чем с карточками в ряд */
@media (min-width: 760px) and (max-width: 1279px) and (min-aspect-ratio: 9/10) {
  .sheet { grid-template-columns: minmax(clamp(240px, 30vw, 330px), min-content) minmax(0, 1fr); gap: 22px; }
  .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt:not(.opt-pass):not(.opt-note) { flex-direction: row; align-items: flex-start; gap: 10px; min-height: 0; }
  .opt .tg { margin-top: -3px; }
}

/* ---------- финал демо ---------- */
.end { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #1d1d1d, #0b0b0b 70%); overflow-y: auto; user-select: text; -webkit-user-select: text; }
.end-in { width: min(560px, calc(100% - 32px)); padding: 48px 0 56px; display: grid; justify-items: center; text-align: center; gap: 18px; }
.end-small { font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .9); }
.end-small::before, .end-small::after { content: ""; width: 32px; height: 3px; background: var(--red); }
.end-lens { width: 220px; height: 220px; margin: 6px 0 4px; }
.end-lens svg { width: 100%; height: 100%; display: block; overflow: visible; }
.end-line { display: flex; align-items: center; gap: 10px; font-size: 16px; color: rgba(255, 255, 255, .9); }
.end-line i { width: 18px; height: 16px; flex: none; background: var(--c); clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 0 5px var(--c)); }
.end h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 7vw, 64px); line-height: 1.06; text-transform: uppercase; text-wrap: balance; }
.end p.end-text { font-size: 16px; line-height: 1.5; color: var(--muted); }
.end .btn-red { margin-top: 10px; padding: 18px 40px 20px; font-size: 20px; }

/* ---------- телефон и узкие экраны ---------- */
@media (max-width: 759px), (max-aspect-ratio: 9/10) {
  .hud { gap: 8px; padding: 5px 12px 5px 7px; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t));
    max-width: calc(100% - 128px - var(--safe-l) - var(--safe-r)); }
  .hud-sign { width: 22px; }
  .hud-clock { font-size: 21px; }
  .hud-bar { height: 16px; }
  .hud-place { font-size: 14px; }
  .hud-right { gap: 8px; right: calc(12px + var(--safe-r)); top: calc(10px + var(--safe-t)); }
  .hud-sound { width: 38px; height: 38px; }
  .hud-sound svg { width: 18px; height: 18px; }
  .hud-lens { width: 50px; height: 50px; }

  .sheet { bottom: 0; width: 100%; border-radius: 22px 22px 0 0; grid-template-columns: minmax(0, 1fr); gap: 12px;
    padding: 14px 16px calc(16px + var(--safe-b)); border-left: 0; border-right: 0; border-bottom: 0; }
  .sheet-head { gap: 7px; }
  /* панель выше своего текста (планшет вертикально, sit.js): лишняя высота уходит в карточки */
  .sheet.grow { grid-template-rows: auto minmax(0, 1fr); }
  .sheet.grow .opts { flex: 1; grid-auto-rows: 1fr; }
  .ask { font-size: 23px; margin-top: 2px; }
  .intro, .note { font-size: 14px; }
  .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .opt { min-height: 0; padding: 10px 11px 12px; gap: 6px; font-size: 14px; line-height: 1.34; border-radius: 11px; }
  .opt .ic { height: 20px; }
  .opt .ic svg { width: 20px; height: 20px; }
  .opt-pass { padding: 12px 13px 14px; gap: 10px; font-size: 14.5px; min-height: 0; }
  .sheet-act { gap: 9px; }
  .tip { font-size: 13.5px; gap: 9px; }
  .sheet-back { font-size: 13.5px; margin: -12px -8px -12px 0; padding: 12px 8px; }
  .tip i { width: 12px; height: 12px; }
  .pass-top { height: 24px; }
  .pass-top img { width: 24px; }
  .pass-slot { top: 14px; width: 34px; height: 8px; margin-left: -17px; }

  .hint { font-size: 14px; padding: 8px 14px 8px 8px; gap: 8px; }
  .hint i { width: 16px; height: 16px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .2); }
  .here { font-size: 15px; padding: 6px 14px; }
  .toast { top: calc(66px + var(--safe-t)); font-size: 14px; padding: 9px 14px 9px 10px; gap: 10px; border-radius: 16px; width: max-content; }
  .toast i { width: 18px; height: 16px; }
  .chap small { font-size: 16px; }
  .chap b { font-size: clamp(44px, 13vw, 60px); padding: 8px 14px 12px; }
  .focus { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .tag { width: 26px; height: 26px; font-size: 13px; }
  .opt .tg { width: 24px; height: 24px; font-size: 12.5px; }
  .opt .no { font-size: 20px; }
  .sheet-note .opts { padding: 2px 14px 6px; grid-template-columns: minmax(0, 1fr); }
  .opt-note { padding: 9px 0 8px; font-size: 14px; }

  .end-lens { width: 170px; height: 170px; }
}

/* планшет вертикально: та же раскладка, что на телефоне, но текст панели крупнее (старт — в start.css) */
@media (min-width: 600px) and (max-aspect-ratio: 9/10) {
  .sheet { padding: 18px 28px calc(20px + var(--safe-b)); gap: 14px; }
  .intro, .note { font-size: 15px; }
  .ask { font-size: 28px; }
  .tip { font-size: 14.5px; }
  .opts { gap: 10px; }
  .opt { padding: 13px 14px 15px; gap: 8px; font-size: 15.5px; line-height: 1.38; }
  .opt .tg { width: 28px; height: 28px; font-size: 14px; }
  .opt .no { font-size: 24px; }
}

/* телефон лёжа: игра сделана для вертикального экрана — просим повернуть */
.rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .rotate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; align-content: center; gap: 14px;
    padding: 24px calc(24px + var(--safe-r)) 24px calc(24px + var(--safe-l)); background: var(--bg); text-align: center; }
  .rotate img { width: 40px; height: auto; margin-bottom: 6px; }
  .rotate i { width: 32px; height: 54px; border: 3px solid #fff; border-radius: 8px; animation: kTurn 2.4s ease-in-out infinite; }
  .rotate b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; text-transform: uppercase; }
  .rotate span { font-size: 15px; color: var(--muted); }
}
@keyframes kTurn { 0%, 25% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }

@media (max-width: 379px) {
  .hud-bar, .hud-place { display: none; }
  /* узкий телефон: значок прицела у вариантов в зале декоративный — без него панель ниже и сцена видна больше */
  .opt-focus .ic { display: none; }
}

/* невысокие экраны телефонов: панель компактнее, чтобы сцена не пряталась */
@media (max-height: 700px) and ((max-width: 759px) or (max-aspect-ratio: 9/10)) {
  .opt .ic { display: none; }
  .opt { padding: 9px 10px 10px; font-size: 13.5px; }
  .ask { font-size: 21px; }
  .seg i { height: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .arrow .core, .target-ring, .here { animation-duration: 3s; }
}
