/* 🐈‍⬛ Экскурсия с кошкой Вэйт (11.11.2026) — стили `tour.js`. Префикс tr-. Слой лежит выше листов и окон игры (80–90), ниже тостов (9999). */

.tr { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.tr[hidden] { display: none; }
.tr.out { opacity: 0; transition: opacity .3s ease; }

/* четыре панели затемнения вокруг «окна»: нажатия по ним глухие, в окне (где подсвеченное) доходят до настоящего элемента */
.tr-pane { position: fixed; background: rgba(8, 4, 14, .8); pointer-events: auto; touch-action: none; transition: background .2s ease; }
.tr:not(.has-target) .tr-pane[data-p="t"] { background: rgba(8, 4, 14, .91); }

/* подсветка подсвеченного: золотая рамка с пульсацией — горит, пока не нажмёшь */
.tr-ring { position: fixed; z-index: 1; pointer-events: none; border: 2px solid #ffe2a6;
  box-shadow: 0 0 0 3px rgba(255, 214, 150, .28), 0 0 30px 6px rgba(255, 200, 120, .5); animation: tr-pulse 1.3s ease-in-out infinite; }
.tr-ring[hidden] { display: none; }
@keyframes tr-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 214, 150, .28), 0 0 22px 3px rgba(255, 200, 120, .4); } 50% { box-shadow: 0 0 0 7px rgba(255, 214, 150, .16), 0 0 38px 10px rgba(255, 200, 120, .7); } }

/* кружок-«нажми»: расходящиеся волны на подсвеченном */
.tr-tap { position: fixed; z-index: 2; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 240, 205, .95) 0 28%, rgba(255, 220, 160, .35) 30% 100%); animation: tr-tap 1.3s ease-out infinite; }
.tr-tap[hidden] { display: none; }
@keyframes tr-tap { 0% { transform: scale(.7); opacity: 1; } 70% { transform: scale(1.5); opacity: .15; } 100% { transform: scale(1.6); opacity: 0; } }
.tr.hit .tr-ring { animation: none; box-shadow: 0 0 0 10px rgba(255, 214, 150, .5), 0 0 60px 16px rgba(255, 200, 120, .9); transition: box-shadow .3s ease; }

/* кошка и её фразы: внизу, а если подсвеченное в нижней половине — вверху */
.tr-dock { position: fixed; left: 50%; width: min(calc(100% - 20px), 520px); transform: translateX(-50%); z-index: 3; display: flex; align-items: flex-end; gap: 4px; pointer-events: none;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.tr-dock[data-pos="top"] { top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto; align-items: flex-start; }
.tr-dock[data-side="right"] { flex-direction: row-reverse; }
/* кошка тёмная, как и затемнённый экран, — её «выводит» розовое свечение по краю */
.tr-cat { flex: none; width: 132px; height: auto; max-height: 168px; object-fit: contain; object-position: bottom; pointer-events: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 0 9px rgba(255, 160, 206, .42)) drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); transform-origin: 50% 100%; animation: tr-bob 3.4s ease-in-out infinite; }
.tr-cat[hidden] { display: none; }
@keyframes tr-bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(-1.2deg); } }
/* новая поза «выскакивает» — как будто кошка перескочила на новое место */
.tr-cat.pop { animation: tr-pop .42s cubic-bezier(.2, .9, .3, 1.25) both, tr-bob 3.4s ease-in-out .42s infinite; }
.tr-cat.pop.talking { animation: tr-pop .42s cubic-bezier(.2, .9, .3, 1.25) both, tr-talk .38s ease-in-out .42s infinite; }
@keyframes tr-pop { 0% { transform: translateY(16px) scale(.86); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }

/* Фразы — «в воздухе» (11.11.2026, владелица: «нееет, я хочу, чтобы фразы были как бы в воздухе и кошка их говорила»): никакой рамки, плашки и хвостика — просто текст рядом
   с кошкой, читаемый за счёт тени и мягкого затемнения за ним; слова проявляются одно за другим, пока кошка «говорит» (tour.js: reveal). */
.tr-bubble { position: relative; flex: 1; min-width: 0; padding: 4px 4px 6px; color: #fff; pointer-events: none; }
.tr-bubble::before { content: ''; position: absolute; z-index: -1; left: -26px; right: -26px; top: -34px; bottom: -22px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(8, 4, 14, .72) 0, rgba(8, 4, 14, .5) 45%, rgba(8, 4, 14, 0) 78%); }
.tr-name { font: 700 10px/1 var(--sans, 'Jost', system-ui, sans-serif); letter-spacing: .2em; text-transform: uppercase; color: #ffd998; margin-bottom: 5px; text-shadow: 0 0 10px rgba(8, 4, 14, .95); }
.tr-title { font: 700 22px/1.12 var(--serif, 'Philosopher', serif); color: #ffe9b8; margin-bottom: 6px; text-shadow: 0 2px 3px rgba(0, 0, 0, .85), 0 0 18px rgba(8, 4, 14, .95); }
.tr-text p { margin: 0 0 7px; font-size: 15.5px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 12px rgba(8, 4, 14, .95), 0 0 24px rgba(8, 4, 14, .85); }
.tr-text p:last-child { margin-bottom: 0; }
.tr-word { background: none; color: #ffd98a; font-weight: 700; border-bottom: 2px solid rgba(255, 214, 150, .8); animation: tr-word 1.3s ease-in-out infinite; }
@keyframes tr-word { 0%, 100% { text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 12px rgba(8, 4, 14, .95); } 50% { text-shadow: 0 0 12px rgba(255, 214, 150, .95), 0 0 24px rgba(255, 190, 110, .6); } }

/* слова проявляются по очереди: кошка говорит (задержку каждому слову ставит tour.js) */
.tr-w { display: inline-block; opacity: 0; transform: translateY(6px); animation: tr-w-in .36s ease forwards; }
@keyframes tr-w-in { to { opacity: 1; transform: none; } }
.tr-bubble.skip .tr-w { animation: none; opacity: 1; transform: none; }
.tr-cat.talking { animation: tr-talk .38s ease-in-out infinite; }
@keyframes tr-talk { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-4px) scale(1.012, .99); } }
/* и сам текст чуть парит, не стоит на месте: фразы «в воздухе» */
.tr-title, .tr-text { animation: tr-float 5.4s ease-in-out infinite; }
.tr-text { animation-delay: -1.8s; }
@keyframes tr-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }

/* кнопки появляются, когда кошка договорила (tour.js ставит .said); до этого они невидимы и не нажимаются */
.tr-actions { display: flex; gap: 8px; margin-top: 10px; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.tr-bubble.said .tr-actions { opacity: 1; pointer-events: auto; }
.tr-actions:not(:has(button:not([hidden]))) { display: none; }
.tr-actions .primary-btn, .tr-actions .ghost-btn { flex: 1; min-height: 42px; padding: 8px 12px; font-size: 14.5px; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
.tr-dots { display: flex; justify-content: flex-start; gap: 5px; margin-top: 10px; }
.tr-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.tr-dots i.done { background: rgba(255, 214, 150, .6); }
.tr-dots i.now { background: #ffd98a; box-shadow: 0 0 8px rgba(255, 214, 150, .95); }

/* нет картинки кошки — на её месте пусто, и тексту не нужно «выглядывать» из-за неё */
.tr-dock:has(.tr-cat[hidden]) .tr-bubble { padding-left: 8px; }

/* нажали не туда: фразы качаются, кошка «качает головой» */
.tr.shake .tr-bubble { animation: tr-shake .42s ease; }
@keyframes tr-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

body.tr-lock { overflow: hidden; }

/* «Меньше анимаций» в настройках — без пульса, покачивания и постепенного проявления слов */
body.calm .tr-ring, body.calm .tr-tap, body.calm .tr-cat, body.calm .tr-word, body.calm .tr-title, body.calm .tr-text, body.calm .tr.shake .tr-bubble { animation: none; }
body.calm .tr-w { opacity: 1; transform: none; animation: none; }
body.calm .tr-actions { transition: none; }
/* Системную настройку «уменьшить анимацию» (prefers-reduced-motion) здесь НЕ слушаем — как и у рамок аватара: у владелицы она включена на компьютере, и она бы не увидела,
   как кошка говорит. Выключатель один — «Меньше анимаций» в «Настройках» игры (body.calm). */

@media (max-width: 360px) { .tr-cat { width: 110px; max-height: 140px; } .tr-text p { font-size: 14.5px; } .tr-title { font-size: 20px; } }
