/* ============================================================================
   ТВ-вид «Пати Гессера» (GM6): сцена Unity на большом экране. Скрипт —
   connection/_Scripts/Game/Gs_Tv.js. Панель ведущего — общая (_Styles/tv-panel.css).

   Откуда числа: GameMode6.unity + Game Mode 6.prefab, спроецированные камерой Unity
   (FOV 60, покой (0, −0.02, −1.12); заставка — с (0, 1.36, 1.06), 5 с OutQuart) на кадр 1920×1080.
   Пока угадывают — на выбор (юзер 29.10): слайдшоу фото точки, как в Unity (Screen.cs), или
   панорама Street View — окно игры (то же, что у телефонов) поверх сцены. Итоги (карта, факт) —
   окна веб-Гессера поверх сцены (юзер 29.10: «как в вебе сейчас»).
   Картинки — public/images_web/tv/gm6 (tools/export_gm6_tv_sprites.py); птица и облако — gm1, стрелка — gm4.
   Приставка gstv- — своя.
   ============================================================================ */
:root {
  --gstv-min-w: 1000;            /* ТВ-вид с ширины окна, px */
  --gstv-min-aspect: 1.2;        /* …и окно не уже (ширина / высота) */
  --gstv-answer-view: 1;         /* пока угадывают: 0 — слайдшоу фото (Unity), 1 — панорама Street View (окно игры) */
  --gstv-slide-ms: 7000;         /* слайдшоу: одно фото, мс (Screen.DisplayDuration 7 с) */
  /* Окно очков — общее для всех режимов: _Styles/tv-score.css (--tvs-*); здесь — только «Королевская битва». */
  --gstv-guide-title-c: #FFD990; /* гид: цвет названия места */
  --gstv-guide-fact-w: 300;      /* гид: начертание факта (300 — тонкое Book, 400 — Regular, 700 — Bold) */
  --gstv-slide-zoom: 1.08;       /* слайдшоу: альбомное фото за время показа увеличивается до (если фото несколько; 1 — стоит) */
  --gstv-where-top: 40px;        /* слайдшоу: плашка «Угадайте, где мы находимся!» у альбомного фото — сверху на */
  --gstv-where-delay: 400;       /* …въезжает через, мс после экрана с фото */
  --gstv-where-in-ms: 1500;      /* …за, мс (OutQuart, сверху) */
  --gstv-guide-in-delay: 1000;   /* гид начинает въезжать через, мс после начала ухода карты */
  --gstv-guide-in-ms: 1500;      /* гид въезжает (вместе с уходом карты) за, мс */
  --gstv-guide-in-ease: 1;       /* …кривая: 0 outQuint, 1 outQuart, 2 outExpo (Unity guideAppearEase), 3 outCubic, 4 inOutQuart, 5 linear */
  --gstv-geo-drop: 120px;        /* карта итогов: игроки падают на точки с такой высоты */
  --gstv-map-bg: #4E8391;        /* карта итогов: фон за краем мира (цвет затемнённого океана) */
  --gstv-map-in-ms: 1500;        /* карта итогов въезжает сверху за, мс (Unity mapAppearDuration 2 с OutQuint) */
  --gstv-map-in-ease: 1;         /* …кривая: 0 outQuint (Unity), 1 outQuart, 2 outExpo, 3 outCubic, 4 inOutQuart, 5 linear */
  --gstv-map-out-ms: 1500;       /* карта итогов уезжает вверх за, мс (Unity mapDisappearDuration 2 с InOutQuart) */
  --gstv-map-out-ease: 1;        /* …кривая: 0 inOutQuart (Unity), 1 inQuart, 2 inExpo, 3 inCubic, 4 inOutQuint, 5 linear */
}

.gstv {
  position: fixed; inset: 0; z-index: 25;
  overflow: hidden; display: none;
  background: linear-gradient(#2A2A2A 50%, #CB984E 50%);
  -webkit-user-select: none; user-select: none;
}
body.gstv-on .gstv { display: block; }
/* Снимок карты итогов, уезжающий вверх (mapExit): поверх сцены, под панелью сайта. */
.gstv-mapshot { position: fixed !important; inset: 0; z-index: 29; display: block !important; pointer-events: none; }
/* Окно игры поверх сцены (панорама, карта, итоги, факт): сцену прячем целиком —
   кроме мига, пока карта итогов въезжает сверху (сцена видна под ней). */
body.gstv-on.gstv-cover .gstv { display: none; }
body.gstv-on.gstv-cover.gstv-map-in .gstv { display: block; }
/* Окна сайта — в .wrapper (z-index 1, style.css): на время cover он над сценой, но под нижней панелью;
   окно ответа Гессера — выше снимка карты (его кнопки «Открыть карту», «Готово» — у самого низа). */
body.gstv-on.gstv-cover .wrapper { z-index: 26; }
body.gstv-on.gstv-cover .wrapper:has(#game_6_window.active) { z-index: 31; }
/* Экран трансляции не игрок: окно игры (fixed, z-index 9999) поверх слайдшоу не показываем — иначе панорама
   ложилась поверх сцены (юзер 02.11). Играющий хост видит окно игры поверх сцены, как раньше. */
html.pb-display body.gstv-on #game_6_window.active { visibility: hidden; }
/* Карта итогов на ТВ: за краем мира и пока не загрузились тайлы — цвет затемнённого океана, а не серо-белый
   фон Leaflet (юзер 30.10: «белая полоса сверху»). */
body.gstv-on #web_geo_window .leaflet-container { background: var(--gstv-map-bg); }
/* Игроки на карте итогов на ТВ падают на свои точки сверху (юзер 30.10), а не выезжают снизу, как на телефоне;
   высота падения — --gstv-geo-drop. Длительность и каскад — те же, что у окна (Web_Geo_Window.js). */
body.gstv-on #web_geo_window .web-geo-player { animation-name: gstv-geo-drop; }
@keyframes gstv-geo-drop { from { opacity: 0; transform: translateY(calc(-1 * var(--gstv-geo-drop))); } to { opacity: 1; transform: none; } }
.gstv img, .gstv video { max-width: none; }   /* style.css: video { max-width: 100% } — в коробке нулевой ширины пламя сжималось в ноль */

.gstv-stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px; margin: -540px 0 0 -960px;
  transform-origin: 50% 50%;
  font-family: 'Bebas Neue', 'Bebas Neue Pro', Impact, sans-serif;
  line-height: 1;
}
.gstv-plane { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 960px 540px; pointer-events: none; }
.gstv-plane > * { position: absolute; }
.gstv-plane.is-behind { visibility: hidden; }
.gstv-sc { font-size: 0.8em; }
.gstv-spr { background: center / 100% 100% no-repeat; }
.gstv-text { display: flex; align-items: center; justify-content: center; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.gstv-text > .gstv-in { display: block; width: 100%; }
.gstv-canvas { position: absolute; left: 0; top: 0; }

/* -------------------------------------------------------- Background -- */
/* «Слой 13@4x» (z 7, цвет #525252 запечён), облака как в квизе (Cloud 2, α 0.035, z 4.06), песок Square #CB984E (z 0.11). */
.gstv-bg { left: -440.2px; top: -356.5px; width: 2806px; height: 1797px;
  /* «Слой 13@4x» Unity × цвет #525252 — вертикальный градиент, по горизонтали ровный: вместо картинки — CSS
     (юзер 30.10: у сжатой картинки была видна ступенчатость). Опоры сняты с исходника, расхождение < 1 уровня цвета. */
  background-image: linear-gradient(to bottom, rgb(52 48 82) 0%, rgb(53 49 82) 23.12%, rgb(73 72 82) 56.91%,
    rgb(82 82 82) 73.41%, rgb(82 82 82) 100%); }
.gstv-clouds { left: -198.7px; top: 99.4px; height: 501.7px; width: 7462.2px; display: flex; animation: gstv-clouds 184.2s linear infinite; }
.gstv-clouds i { flex: 0 0 2487.4px; height: 100%; opacity: .035;
  background: url('/images_web/tv/gm1/cloud.svg') center / 100% 100% no-repeat; }
@keyframes gstv-clouds { to { transform: translateX(-2487.4px); } }
.gstv-sand { left: -219.4px; top: 860.5px; width: 2358.8px; height: 376.4px; background: #CB984E; }

/* -------------------------------------------------------------- Front -- */
/* Земля Frontground ×3 (средняя — отражена дважды, т. е. прямо), под ней — та же полоса вверх ногами (высокое окно). */
.gstv-ground { width: 2020.3px; height: 420.9px; top: 657px; background-image: url('/images_web/tv/gm6/ground.webp'); }
.gstv-ground.g0 { left: -2104.5px; scale: -1 1; }
.gstv-ground.g1 { left: -98.6px; }
.gstv-ground.g2 { left: 1904px; scale: -1 1; }
.gstv-ground.lo { top: 1071.1px; height: 434.2px; }
.gstv-ground.lo.g0 { scale: -1 -1; }
.gstv-ground.lo.g1 { scale: 1 -1; }
.gstv-ground.lo.g2 { scale: -1 -1; }
.gstv-bird { left: 308.2px; top: 834.3px; width: 104.4px; height: 107.9px; background-image: url('/images_web/tv/gm1/bird1.webp'); }

/* ---------------------------------------------------------- слайдшоу -- */
/* Screen.cs: фото точки; ориентация — по самой картинке. Альбомное — во весь кадр (z 0.72) с отражёнными
   копиями по бокам и плашкой «Угадайте, где мы находимся!»; портретное — справа, плашка слева, стрелка.
   Экран въезжает сверху (y +2.5 → 0, 1.5 с OutQuart), уезжает вверх (1 с InQuart); фото меняются без анимации. */
.gstv-land, .gstv-port { left: 0; top: 0; width: 1920px; height: 1080px; display: none; }
.gstv.is-land .gstv-land, .gstv.is-port .gstv-port { display: block; }
.gstv-land > *, .gstv-port > * { position: absolute; }
.gstv-land .gstv-photo { left: -26.2px; top: -24.2px; width: 1951.9px; height: 1098px; }
.gstv-land .gstv-photo.l { left: -1973px; scale: -1 1; }
.gstv-land .gstv-photo.r { left: 1925.8px; scale: -1 1; }
.gstv-photo { background: #000 center / cover no-repeat; }
/* Плашка «Угадайте…» — группа .gstv-wbox: у альбомного фото — сверху (юзер 30.10; в Unity — снизу, top 713.7),
   въезжает своим ходом через --gstv-where-delay после экрана. */
.gstv-wbox > * { position: absolute; }
.gstv-land .gstv-wbox { left: 724px; top: var(--gstv-where-top); width: 480.4px; height: 95.2px; }
.gstv-land .gstv-tbg { left: 0; top: 0; width: 480.4px; height: 95.2px; background: #000; }
.gstv-land .gstv-where { left: 42.4px; top: 21.2px; width: 405.5px; height: 49.9px; color: #F7E8DC; font-weight: 300; }
.gstv-port .gstv-photo { left: 1119.7px; top: -62.3px; width: 649.4px; height: 1154.4px; }
.gstv-port .gstv-wbox { left: 225.6px; top: 276.3px; width: 634.8px; height: 125.7px; }
.gstv-port .gstv-tbg { left: 0; top: 0; width: 634.8px; height: 125.7px; background: #000; }
.gstv-port .gstv-where { left: 54.4px; top: 28px; width: 526.1px; height: 66.1px; color: #F7E8DC; font-weight: 300; }
.gstv-arrow { left: 650.1px; top: 631.9px; width: 157.3px; height: 78.2px; opacity: .106;
  background: url('/images_web/tv/gm4/arrow.webp') center / 100% 100% no-repeat; animation: gstv-arrow 1s ease-in-out infinite alternate; }
@keyframes gstv-arrow { to { translate: 40px 0; } }

/* Окно очков «Королевской битвы» (обычное — общее, tv-score.css): те же колонки, ручки — общие (--tvs-*). */
.gstv-score { left: 0; top: 0; display: none; opacity: 0; }
.gstv.is-score .gstv-score { display: block; }
.gstv-scol { position: absolute; width: 0; height: 0; }
.gstv-scol > * { position: absolute; }
.gstv-sline { position: absolute; top: -1080px; height: 3240px; width: var(--tvs-line-w); margin-left: calc(var(--tvs-line-w) / -2);
  background: rgba(247, 232, 220, var(--tvs-line-a)); }
.gstv-scol img { left: -59.8px; top: -59.8px; width: 119.6px; height: 119.6px; }
.gstv-sdelta { display: flex; align-items: center; justify-content: center; white-space: nowrap; left: -60px; top: -118.3px; width: 120px; height: 37.9px; font-size: 34.7px; font-weight: 400; }
.gstv-sdelta.is-plus { color: #6DFF6D; }
.gstv-sdelta.is-minus { color: #FF6B6B; }
.gstv-sdelta.is-zero { color: #fff; }
.gstv-splate { left: -58.4px; top: 26.6px; width: 116.8px; height: 37.9px; background: #000;
  -webkit-mask: url('/images_web/tv/gm1/name_tab.webp') center / 100% 100% no-repeat;
  mask: url('/images_web/tv/gm1/name_tab.webp') center / 100% 100% no-repeat; }
.gstv-sname { left: -50.4px; top: 26.6px; width: 100.8px; height: 37.9px; color: #F7E8DC; font-weight: 700; }
.gstv-sname > .gstv-in { translate: 0 var(--tvs-sname-shift); }

/* Гид — факт о месте (GameMode6LocationGuidePresenter): появляется сразу, уходит за 1 с (InExpo) —
   тексты влево, фото вправо. С фото: название и текст слева (по левому краю), фото в белой рамке справа;
   без фото — название и текст по центру. Название — Bold 115 px, текст — Bold 66 px, белые, капитель. */
.gstv-guide { left: 0; top: 0; width: 1920px; height: 1080px; display: none; }
.gstv.is-guide .gstv-guide { display: block; }
.gstv-guide > * { position: absolute; }
/* Название — жёлтым (#FFD990 — цвет «Highlight» Unity) с тенью, факт — не жирным (юзер 30.10; в файлах Unity
   наоборот: название белое Bold Shadow, жёлтым — факт). */
.gstv-gtitle { color: var(--gstv-guide-title-c); font-weight: 700; text-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.gstv-gfact { color: #fff; font-weight: var(--gstv-guide-fact-w); align-items: flex-start; }
.gstv-guide.is-img .gstv-gtitle { left: 201.2px; top: 141.5px; width: 655.9px; height: 135.6px; justify-content: flex-start; text-align: left; }
.gstv-guide.is-img .gstv-gfact { left: 201.8px; top: 315.6px; width: 766.4px; height: 375.4px; justify-content: flex-start; text-align: left; }
.gstv-guide:not(.is-img) .gstv-gtitle { left: 352.2px; top: 160.7px; width: 1215.7px; height: 135.6px; }
.gstv-guide:not(.is-img) .gstv-gfact { left: 353.1px; top: 363.2px; width: 1213.8px; height: 375.4px; }
.gstv-gframe { left: 1175.4px; top: 151.5px; width: 622.3px; height: 569.9px; background: #fff; display: none; }
.gstv-guide.is-img .gstv-gframe { display: block; }
.gstv-gframe i { position: absolute; left: 19.1px; top: 17.6px; width: 584.1px; height: 534.7px; background: #000 center / cover no-repeat; }

/* Окно очков «Королевской битвы» (Score Item в режиме битвы): над аватаркой — расстояние раунда (ближе всех —
   зелёным, дальше всех — красным), под ней — сердечки (только живые, по центру). Выбывший — аватарка чёрная
   (battleRoyaleEliminatedAvatarColor #000); эффекты (разбитое сердце, череп, нимб) — вспышкой поверх. */
.gstv-hearts { left: -60px; top: 89.8px; width: 120px; height: 34.3px; display: flex; justify-content: center; }
.gstv-hearts i { flex: 0 0 34.3px; height: 34.3px; background: url('/images_web/tv/gm6/heart.webp') center / 100% 100% no-repeat; }
.gstv-scol img.is-dead { filter: brightness(0); }
/* Слой эффектов битвы (череп, нимб) — поверх земли и соседних колонок. */
.gstv-brfx { left: 0; top: 0; }
.gstv-broken { left: -89px; top: -67px; width: 178px; height: 156px; background: url('/images_web/tv/gm6/broken.webp') center / contain no-repeat; opacity: 0; }
.gstv-skull { left: -72px; top: -61px; width: 144px; height: 156px; background: url('/images_web/tv/gm6/skull.webp') center / contain no-repeat; opacity: 0; }
.gstv-halo { left: -72px; top: -107px; width: 144px; height: 49px; background: url('/images_web/tv/gm6/halo.webp') center / contain no-repeat; opacity: 0; }
.gstv-sdelta.is-near { color: #6DFF6D; }
.gstv-sdelta.is-far { color: #FF6B6B; }

/* Countdown Text: «3», «2», «GO!» — 539 px. */
.gstv-count { left: -19.5px; top: -354.9px; width: 1955.6px; height: 1522.5px; font-size: 539.3px; color: #fff; font-weight: 400; opacity: 0; }

.gstv-timer { position: absolute; left: 59px; top: 24px; color: #fff; font-size: 41.4px; font-weight: 700; display: none; z-index: 3;
  font-variant-numeric: tabular-nums; }

/* Название режима на заставке — как в «Шпионаже» (Game Name: z 0.6 → на кадре 1547×663 по центру 960, 411;
   Bebas 407 px, #FFDAB1, капитель), юзер 30.10. Скрипт — gameNameIn(). */
.gstv-gname { position: absolute; left: 186.3px; top: calc(var(--gstv-gname-y) - 331.45px); width: 1547.4px; height: 662.9px; opacity: 0;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1; white-space: normal;
  color: var(--gstv-gname-c); font-family: 'Bebas Neue', 'Bebas Neue Pro', Impact, sans-serif; font-weight: 400; pointer-events: none; }
:root {
  --gstv-gname-z: 1.36;            /* название режима на заставке: дальше камеры в покое на, единиц Unity (как «Шпионаж»: 1.36) */
  --gstv-gname-y: 411px;         /* …центр по высоте на кадре в покое */
  --gstv-gname-fs: 407px;        /* …кегль (длинное название уменьшается, чтобы влезть) */
  --gstv-gname-c: #FFDAB1;         /* …цвет */
}
.gstv-gname > span { display: block; }
.gstv-gname-sc { font-size: 0.8em; }
