/* Страница шара выпуска формата 2: добавка к globe-shell.css. */
/* Двойной тап и щипок не приближают страницу; прокрутка панелей остаётся. */
html,body { touch-action:pan-x pan-y; }
#world-page {
  position:fixed;
  inset:0;
  background:#152837
}
#world-globe {
  position:absolute;
  inset:0;
  touch-action:none;
  cursor:grab
}
#world-globe:active {
  cursor:grabbing
}
#pick {
  position:fixed;
  left:14px;
  bottom:calc(96px + env(safe-area-inset-bottom));
  max-width:min(360px,calc(100% - 28px));
  font-size:14px;
  color:var(--text);
  background:var(--panel);
  border-radius:12px;
  padding:6px 12px;
  pointer-events:none
}
#pick:empty {
  display:none
}
#political-time .exact-year {
  margin-top:6px;
  text-align:center
}
#political-input {
  width:120px
}

#water-help {
  max-width:min(240px,calc(100vw - 28px));
  margin:0;
  padding:10px 12px;
  color:var(--text);
  background:var(--panel);
  border-radius:12px;
  font-size:13px;
  line-height:1.4
}
#water-note, #layers-note {
  margin:8px 0 0
}
#water-note:empty, #layers-note:empty {
  display:none
}
#water-help summary {
  cursor:pointer
}
/* Меню над подписями карты (их холсты — z-index 5) и над панелью лет. */
#atlas-menu {
  z-index:20;
  bottom:calc(150px + env(safe-area-inset-bottom))
}
/* Карточка государства: над подписями и панелью лет, прокрутка внутри. */
#state-card {
  position:fixed;
  z-index:20;
  left:50%;
  transform:translateX(-50%);
  bottom:calc(150px + env(safe-area-inset-bottom));
  width:min(380px,calc(100% - 28px));
  max-height:min(56dvh,calc(100dvh - 230px));
  display:flex;
  border-radius:24px;
  background:var(--panel);
  border:1px solid var(--line);
  backdrop-filter:blur(24px);
  box-shadow:0 12px 40px #0004;
  color:var(--text)
}
#state-card[hidden] {
  display:none
}
#state-card .state-body {
  overflow:auto;
  overscroll-behavior:contain;
  padding:14px 16px;
  flex:1;
  font-size:14px;
  line-height:1.4
}
#state-card .state-close {
  position:absolute;
  top:8px;
  right:8px;
  width:40px;
  height:40px;
  border-radius:50%;
  padding:0;
  font-size:22px
}
#state-card .state-head {
  display:flex;
  gap:12px;
  align-items:center;
  margin-right:44px;
  margin-bottom:8px
}
#state-card .state-emblem {
  height:40px;
  width:auto;
  max-width:72px;
  object-fit:contain;
  flex-shrink:0;
  outline:1px solid var(--line)
}
#state-card h2 {
  font-size:18px;
  margin:0;
  line-height:1.2
}
#state-card .state-muted {
  color:var(--muted);
  font-size:12px
}
#state-card .state-line,#state-card .state-relation {
  margin:2px 0
}
#state-card p {
  font-size:13px;
  color:var(--text);
  margin:8px 0
}
#state-card details a {
  display:block;
  color:var(--accent);
  font-size:12px;
  margin:4px 0
}
#state-card summary {
  cursor:pointer;
  color:var(--muted)
}
/* Слои и условные обозначения в меню. */
.layer-toggles {
  display:grid;
  gap:4px;
  margin:8px 0
}
.layer-toggles label {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:40px;
  font-size:15px
}
.layer-toggles input {
  width:18px;
  height:18px;
  min-width:0;
  min-height:0;
  margin:0
}
#layers-content h2 {
  font-size:15px;
  margin:14px 0 6px
}
.world-legend {
  display:grid;
  gap:6px;
  font-size:13px;
  color:var(--muted)
}
.world-legend i {
  display:inline-block;
  width:18px;
  height:12px;
  border-radius:3px;
  margin-right:8px;
  vertical-align:-1px;
  outline:1px solid var(--line)
}
.world-legend i.owner {
  background:linear-gradient(90deg,#a99bc6,#c79a62,#9db38a)
}
.world-legend b {
  color:var(--text);
  font-weight:500;
  margin:0 4px 0 6px
}
.world-legend b:first-child {
  margin-left:0
}

/* Коты стоят на штатном шаре. У заставки нет собственного фона или шара. */
#world-splash { position:fixed; inset:0; z-index:40; touch-action:none; transition:opacity .5s ease; }
#world-splash.done { opacity:0; }
#assembly-cats { position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.assembly-cat { position:absolute; left:0; top:0; width:0; height:0; transition:opacity .35s ease; --tempo:.76s; --beat:0s; --whip:1; }
.assembly-cat[hidden] { display:none; }
/* Коты — прежний рисунок (владелец 17.10: «предыдущие были куда ближе по стилю»). Лист 3×3 выровнен
   по ступням: в каждом кадре середина между лапами в 110/230 ячейки, низ лап в 233/240, поэтому при смене
   кадров лапы стоят на месте. Порядок кадров постоянный, удар «хлыстом»: долгий замах, быстрый удар, пауза. */
.assembly-sprite {
  display:block; position:absolute; width:112px; height:117px; left:-53.6px; bottom:-3.4px;
  background:0 var(--coat) / 300% 300% no-repeat;
  transform-origin:47.8% 97%;
  animation:cat-frames var(--tempo) var(--beat) infinite step-end, cat-squash var(--tempo) var(--beat) infinite;
}
.assembly-sprite::after { content:""; position:absolute; inset:0; background:inherit; }
/* Хвост вырезан из прежних кадров. Звенья вложены: основание ведёт,
   середина и кончик запаздывают; перекрытие скрывает стыки. */
.assembly-tail {
  display:block; position:absolute; inset:0;
  background:0 var(--coat) / 300% 300% no-repeat;
  animation:cat-frames var(--tempo) var(--beat) infinite step-end;
}
.assembly-tail-base {
  transform-origin:30% 80%;
  animation-name:cat-frames,cat-tail-base,cat-joint-base;
  animation-timing-function:step-end,ease-in-out,step-end;
}
.assembly-tail-middle {
  transform-origin:19% 71%;
  animation-name:cat-frames,cat-tail-middle,cat-joint-middle;
  animation-timing-function:step-end,ease-in-out,step-end;
}
.assembly-tail-tip {
  transform-origin:21% 57.5%;
  animation-name:cat-frames,cat-tail-tip,cat-joint-tip;
  animation-timing-function:step-end,ease-in-out,step-end;
}
#world-splash.failed .assembly-tail,
.assembly-cat.hopping .assembly-tail { animation-play-state:paused; }
/* Хвост продолжает удар (владелец 18.10): на замахе отходит назад, на махе волочится. В миг удара (51%, кадр
   «удар») корпус встаёт, а хвост по инерции ещё уходит назад и только потом хлещет вперёд — основание, за ним
   середина и кончик, каждое звено позже (владелец 18.10: «хвост после удара должен реагировать позже»). --whip — сила. */
@keyframes cat-tail-base {
  0%,100% { transform:rotate(calc(var(--whip) * 0deg)); animation-timing-function:ease-in-out; }
  30% { transform:rotate(calc(var(--whip) * -2deg)); animation-timing-function:cubic-bezier(.5,0,1,.6); }
  43% { transform:rotate(calc(var(--whip) * -3deg)); animation-timing-function:cubic-bezier(.5,0,1,.6); }
  51% { transform:rotate(calc(var(--whip) * -5deg)); animation-timing-function:cubic-bezier(.2,.6,.4,1); }
  58% { transform:rotate(calc(var(--whip) * -8deg)); animation-timing-function:cubic-bezier(.3,0,.2,1); }
  65% { transform:rotate(calc(var(--whip) * 7deg)); animation-timing-function:ease-in-out; }
  72% { transform:rotate(calc(var(--whip) * -3deg)); animation-timing-function:ease-in-out; }
  80% { transform:rotate(calc(var(--whip) * 1deg)); animation-timing-function:ease-in-out; }
  88% { transform:rotate(calc(var(--whip) * 0deg)); }
}
@keyframes cat-tail-middle {
  0%,100% { transform:rotate(calc(var(--whip) * 0deg)); animation-timing-function:ease-in-out; }
  33% { transform:rotate(calc(var(--whip) * -3deg)); animation-timing-function:cubic-bezier(.5,0,1,.6); }
  46% { transform:rotate(calc(var(--whip) * -4deg)); animation-timing-function:cubic-bezier(.5,0,1,.6); }
  51% { transform:rotate(calc(var(--whip) * -6deg)); animation-timing-function:cubic-bezier(.2,.6,.4,1); }
  62% { transform:rotate(calc(var(--whip) * -10deg)); animation-timing-function:cubic-bezier(.3,0,.2,1); }
  70% { transform:rotate(calc(var(--whip) * 10deg)); animation-timing-function:ease-in-out; }
  77% { transform:rotate(calc(var(--whip) * -4deg)); animation-timing-function:ease-in-out; }
  85% { transform:rotate(calc(var(--whip) * 2deg)); animation-timing-function:ease-in-out; }
  93% { transform:rotate(calc(var(--whip) * 0deg)); }
}
@keyframes cat-tail-tip {
  0%,100% { transform:rotate(calc(var(--whip) * 0deg)); animation-timing-function:ease-in-out; }
  36% { transform:rotate(calc(var(--whip) * -3deg)); animation-timing-function:cubic-bezier(.5,0,1,.6); }
  49% { transform:rotate(calc(var(--whip) * -5deg)); animation-timing-function:cubic-bezier(.5,0,1,.6); }
  51% { transform:rotate(calc(var(--whip) * -6deg)); animation-timing-function:cubic-bezier(.2,.6,.4,1); }
  66% { transform:rotate(calc(var(--whip) * -12deg)); animation-timing-function:cubic-bezier(.3,0,.2,1); }
  75% { transform:rotate(calc(var(--whip) * 14deg)); animation-timing-function:ease-in-out; }
  82% { transform:rotate(calc(var(--whip) * -6deg)); animation-timing-function:ease-in-out; }
  89% { transform:rotate(calc(var(--whip) * 3deg)); animation-timing-function:ease-in-out; }
  95% { transform:rotate(calc(var(--whip) * -1deg)); animation-timing-function:ease-in-out; }
}
.assembly-shadow { position:absolute; width:48px; height:9px; left:-23px; bottom:-3px; background:#153c4540; border-radius:50%; }
.assembly-status {
  position:absolute; bottom:max(26px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%);
  width:min(400px,calc(100% - 40px)); padding:17px 22px 14px; box-sizing:border-box;
  background:#f4f5ecf0; color:#26454c; border:1px solid #fff8; border-radius:20px;
  box-shadow:0 5px 24px #112e4020; text-align:center; font-family:Onest,sans-serif;
}
#splash-text { margin:0 0 12px; color:#26454c; font-size:16px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
#splash-count { margin:9px 0 0; font-size:12px; color:#48656a; font-variant-numeric:tabular-nums; }
#splash-progress { display:block; appearance:none; border:0; border-radius:9px; overflow:hidden; width:100%; height:6px; background:#d4dfda; color:#397e79; }
#splash-progress::-webkit-progress-bar { background:#d4dfda; border-radius:9px; }
#splash-progress::-webkit-progress-value { background:#397e79; border-radius:9px; }
#splash-progress::-moz-progress-bar { background:#397e79; border-radius:9px; }
#splash-retry { margin-top:12px; color:#26454c; background:#e1e9e1; font:500 14px Onest,sans-serif; }
#world-splash.failed .assembly-sprite { animation-play-state:paused; }
#world-splash.failed #splash-progress::-webkit-progress-value { background:#9a6252; }
body:has(#world-splash) #political-time,body:has(#world-splash) nav,body:has(#world-splash) .country-labels { visibility:hidden; }
/* Три исходные позы. Держим замах, проходим движение быстро, даём удару осесть.
   Масштабы взаимно обратны: площадь силуэта сохраняется, опора остаётся у лап. */
.assembly-body { position:absolute; left:0; top:0; width:0; height:0; transform-origin:0 0; }
.assembly-cat:nth-child(3n + 2) { --tempo:.88s; --whip:1.25; }
.assembly-cat:nth-child(3n + 3) { --tempo:.64s; --whip:.8; }
.assembly-cat.hopping .assembly-sprite,
.assembly-cat.hopping .assembly-shadow,
.assembly-cat.hopping .assembly-body::after { animation-play-state:paused; }
.assembly-cat.hopping .assembly-body::after { visibility:hidden; }
.assembly-shadow { animation:cat-contact var(--tempo) var(--beat) infinite; }
.assembly-body::after {
  content:""; position:absolute; left:28px; top:-6px; width:4px; height:4px;
  border-radius:50%; background:#e4e5c9; box-shadow:7px -3px 0 -1px #e4e5c9,-4px 2px 0 -1px #c9d6c2;
  opacity:0; pointer-events:none; animation:cat-dust var(--tempo) var(--beat) infinite;
}
#world-splash.failed .assembly-shadow,
#world-splash.failed .assembly-body::after { animation-play-state:paused; }
@keyframes cat-frames {
  0%,100% { background-position-x:0; }
  43% { background-position-x:50%; }
  51% { background-position-x:100%; }
  76% { background-position-x:50%; }
  88% { background-position-x:0; }
}
@keyframes cat-squash {
  0%,100% { transform:scale(1); animation-timing-function:cubic-bezier(.4,0,.6,1); }
  37% { transform:scale(.976,1.025) rotate(-2deg); animation-timing-function:cubic-bezier(.55,0,1,.45); }
  51% { transform:scale(1.06,.943) rotate(1deg); animation-timing-function:cubic-bezier(0,.6,.3,1); }
  65% { transform:scale(.99,1.01) rotate(-.7deg); animation-timing-function:ease-in-out; }
  82% { transform:scale(1); }
}
@keyframes cat-contact {
  0%,45%,80%,100% { transform:scale(1); opacity:.65; }
  51% { transform:scale(1.18,1.08); opacity:1; }
}
@keyframes cat-dust {
  0%,50%,76%,100% { opacity:0; transform:translate(0,0) scale(.6); }
  52% { opacity:.8; transform:translate(0,-1px) scale(1); animation-timing-function:ease-out; }
  74% { opacity:0; transform:translate(9px,-12px) scale(.7); }
}
@media (max-width:600px) { .assembly-sprite { width:88px; height:92px; left:-42.1px; bottom:-2.7px; } }
@media (prefers-reduced-motion:reduce) { #assembly-cats { display:none; } #world-splash,.assembly-cat { transition:none; } .assembly-sprite,.assembly-tail,.assembly-shadow,.assembly-body::after { animation:none; } }

/* Суставы следуют положению хвоста в трёх исходных позах. */
.assembly-cat { --base-0:31.739% 78.333%;--base-1:30.870% 76.667%;--base-2:32.609% 79.583%;--middle-0:19.565% 71.250%;--middle-1:23.043% 71.250%;--middle-2:25.652% 71.250%;--tip-0:20.435% 57.500%;--tip-1:26.522% 57.500%;--tip-2:30.435% 57.500%; }
.assembly-cat:nth-child(3n + 2) { --base-0:22.609% 82.917%;--base-1:26.087% 80.833%;--base-2:25.652% 80.833%;--middle-0:10.435% 71.250%;--middle-1:22.174% 71.250%;--middle-2:25.652% 71.250%;--tip-0:13.043% 57.500%;--tip-1:28.696% 57.500%;--tip-2:34.783% 57.500%; }
.assembly-cat:nth-child(3n + 3) { --base-0:32.609% 81.667%;--base-1:32.174% 80.417%;--base-2:31.304% 80.833%;--middle-0:18.696% 71.250%;--middle-1:23.478% 71.250%;--middle-2:27.826% 71.250%;--tip-0:22.609% 57.500%;--tip-1:29.130% 57.500%;--tip-2:36.522% 57.500%; }
@keyframes cat-joint-base { 0%,88%,100% { transform-origin:var(--base-0); } 43%,76% { transform-origin:var(--base-1); } 51% { transform-origin:var(--base-2); } }
@keyframes cat-joint-middle { 0%,88%,100% { transform-origin:var(--middle-0); } 43%,76% { transform-origin:var(--middle-1); } 51% { transform-origin:var(--middle-2); } }
@keyframes cat-joint-tip { 0%,88%,100% { transform-origin:var(--tip-0); } 43%,76% { transform-origin:var(--tip-1); } 51% { transform-origin:var(--tip-2); } }

/* Однократное вступление: лист 4×3; движение по дуге выполняет WAAPI. */
.assembly-wake { display:none; position:absolute; width:112px; height:117px; left:-53.6px; bottom:-3.4px; background:0 var(--coat) / 400% 300% no-repeat; }
.assembly-cat.waking .assembly-wake { display:block; animation:cat-wake 1.05s step-end var(--sleep) forwards; }
.assembly-cat.waking .assembly-sprite, .assembly-cat.waking .assembly-body::after { visibility:hidden; }
.assembly-cat.waking .assembly-shadow { animation:none; }
/* Сон держится задержкой (--sleep, кадр сна — исходный фон); потом без пауз: пробуждение 0,5 с, молоток 0,35 с,
   присед 0,2 с и прыжок (владелец 18.10: «после пробуждения переходить к стучанию быстрее»). */
@keyframes cat-wake { 0% { background-position:33.333333% var(--coat); } 48% { background-position:66.666667% var(--coat); } 81%,100% { background-position:100% var(--coat); } }
#world-splash.failed .assembly-wake { animation-play-state:paused; }
@media (max-width:600px) { .assembly-wake { width:88px; height:92px; left:-42.1px; bottom:-2.7px; } }

.assembly-cat.preparing .assembly-wake { display:block; }
.assembly-cat.preparing .assembly-sprite, .assembly-cat.preparing .assembly-body::after { visibility:hidden; }
.assembly-cat.preparing .assembly-shadow { animation:none; }
/* Затянувшаяся загрузка: бегущая полоса по нижнему краю строки года, рядом со шкалой (аудит владельца 19.10). */
.time-heading { position:relative; overflow:hidden }
.time-heading.loading::after {
  content:'';
  position:absolute;
  left:0;
  bottom:0;
  width:30%;
  height:3px;
  border-radius:2px;
  background:var(--accent);
  animation:year-loading 1.1s ease-in-out infinite
}
.time-heading.loading #political-year { opacity:.65 }
@keyframes year-loading { from { transform:translateX(-100%) } to { transform:translateX(340%) } }
@media (prefers-reduced-motion: reduce) { .time-heading.loading::after { animation:none; width:100%; opacity:.6 } }

/* Кнопка «солнце» и меню времени (docs/plans/daynight.md). */
#sun-toggle { width:46px; height:46px; border-radius:50%; padding:0; display:grid; place-items:center; background:transparent; color:inherit; -webkit-touch-callout:none; user-select:none }
#sun-toggle svg { width:22px; height:22px }
#sun-toggle[aria-pressed="true"] { color:#c9d6ff }
#sun-menu { position:fixed; z-index:20; box-sizing:border-box; display:grid; gap:10px; padding:12px 14px; border-radius:18px; background:var(--panel); border:1px solid var(--line); backdrop-filter:blur(24px); box-shadow:0 12px 36px #0004 }
#sun-menu[hidden] { display:none }
.sun-modes { display:grid; grid-template-columns:repeat(3,1fr); gap:6px }
.sun-modes button { height:36px; border-radius:18px; padding:0; background:transparent; border:1px solid var(--line); color:inherit }
.sun-modes button[aria-checked="true"] { background:var(--accent); color:#162b30; border-color:transparent }
.sun-row { display:grid; grid-template-columns:44px 1fr 92px; align-items:center; gap:8px; font-size:13px }
.sun-row output { text-align:right; font-variant-numeric:tabular-nums; color:var(--muted) }
.sun-row input:disabled { opacity:.4 }
.sun-note { margin:0; font-size:12px; color:var(--muted) }
.sun-note:empty { display:none }
.cine-mode #sun-toggle, .cine-mode #sun-menu { display:none }
