/*
 * «Морской бой» — вид игры. Общий игровой язык (фон, кнопки, меню, окно) — в kit/kit.css,
 * сетевой экран (режимы, комната, таблички, реакции) — в kit/lobby.css.
 * Здесь своё: море, корабли, попадания и промахи, причал под полем, значок в меню.
 * Все свои анимации называются sb-…; двигаются только transform и opacity.
 */

/* ---------- Оттенок: лазурное море ---------- */

:root {
  --bg-top: #1c9ceb;      /* повторён в <meta name="theme-color"> */
  --bg-mid: #1370d6;
  --bg-bottom: #0b3a9a;
  --glow-a: rgba(150, 250, 255, 0.55);
  --glow-b: rgba(70, 60, 230, 0.45);
  --frame: #2f8fe6;
  --frame-lip: #0a2f7c;
  --pit: #0c3b94;
  --shade-rgb: 3, 22, 74;
  --deep-rgb: 6, 36, 104;
  --title-hi: #d6f3ff;

  --water-own: linear-gradient(165deg, #58dcff 0%, #27aef2 42%, #1784e2 100%);
  --water-foe: linear-gradient(165deg, #5b93ff 0%, #3a66ea 45%, #3046c8 100%);
  --u: 16px;              /* клетка силуэта в ряду флота */
  --thumb: 82px;          /* уменьшенное второе поле */
  --dock-h: 92px;
  --lab: 18px;            /* поле рамки под буквы и цифры */
}

/* Высокий телефон: флот — отдельной строкой во всю ширину, под ним строка хода и уменьшенное поле. */
@media (min-height: 690px) and (max-width: 879px) {
  :root {
    --u: 19px;
    --thumb: 86px;
    --dock-h: calc(var(--u) * 2 + 23px + 8px + var(--thumb) + 8px);
  }
}

@media (min-height: 800px) and (max-width: 879px) {
  :root {
    --u: 23px;
    --thumb: 136px;
  }
}

/* Самые высокие телефоны: место есть — причал крупнее, между блоками просторнее. */
@media (min-height: 880px) and (max-width: 879px) {
  :root {
    --u: 25px;
    --thumb: 150px;
    --stack: 16px;
  }
}

/* Широкий экран: рамка под буквы и цифры просторнее. */
@media (min-height: 621px) {
  .wide {
    --lab: 21px;
  }
}

/* Градиенты и узоры лежат в невидимом SVG в начале страницы (его кладёт art.js). */
.paints {
  position: absolute;
  overflow: hidden;
}

/* ---------- Фон: морские фигуры ---------- */

.sky .drift {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  opacity: 0.2;
  transform: rotate(var(--r));
  animation: sb-drift var(--t) ease-in-out infinite alternate;
}

.sky .drift svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sky .drift:nth-child(1) { --x: 5%; --y: 10%; --s: 58px; --r: -14deg; --t: 11s; }
.sky .drift:nth-child(2) { --x: 80%; --y: 6%; --s: 46px; --r: 16deg; --t: 13s; }
.sky .drift:nth-child(3) { --x: 86%; --y: 33%; --s: 62px; --r: 9deg; --t: 15s; }
.sky .drift:nth-child(4) { --x: -4%; --y: 42%; --s: 52px; --r: -8deg; --t: 12s; }
.sky .drift:nth-child(5) { --x: 10%; --y: 76%; --s: 66px; --r: -9deg; --t: 16s; }
.sky .drift:nth-child(6) { --x: 78%; --y: 72%; --s: 50px; --r: -20deg; --t: 10s; }
.sky .drift:nth-child(7) { --x: 44%; --y: 91%; --s: 48px; --r: 12deg; --t: 14s; }
.sky .drift:nth-child(8) { --x: 58%; --y: 15%; --s: 34px; --r: -6deg; --t: 9s; }

@keyframes sb-drift {
  from { transform: translateY(-10px) rotate(var(--r)); }
  to { transform: translateY(14px) rotate(calc(var(--r) + 12deg)); }
}

/* ---------- Значок в меню ---------- */

/* Глянцевая плитка моря, на ней корабль под прицелом и круг от промаха. */
.sb-logo {
  display: block;
  width: 144px;
  height: 144px;
}

.lg-tile {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 30%;
  background: var(--water-own);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.65),
    inset 0 -7px 0 rgba(0, 30, 110, 0.22),
    0 9px 0 #0b56b8,
    0 18px 22px rgba(var(--shade-rgb), 0.5);
  animation: k-pop-in 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

.lg-water {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border-radius: inherit;
}

.lg-water::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(120% 90% at 22% 6%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 55%);
}

.lg-ship {
  position: absolute;
  left: -6%;
  top: 23%;
  width: 112%;
  height: 56%;
  transform: rotate(-20deg);
  filter: drop-shadow(0 6px 4px rgba(4, 30, 90, 0.5));
  animation: sb-logo-ship 2.8s ease-in-out infinite alternate;
}

@keyframes sb-logo-ship {
  from { transform: rotate(-21deg) translate(-2%, 2%); }
  to { transform: rotate(-17deg) translate(2%, -3%); }
}

.lg-aim {
  position: absolute;
  right: -12%;
  top: -13%;
  width: 52%;
  height: 52%;
  filter: drop-shadow(0 3px 2px rgba(4, 30, 90, 0.45));
  animation: sb-logo-aim 1.4s ease-in-out infinite alternate;
}

@keyframes sb-logo-aim {
  from { transform: scale(0.92) rotate(-8deg); }
  to { transform: scale(1.06) rotate(8deg); }
}

.lg-aim .xhair {
  width: 100%;
  height: 100%;
}

.lg-miss {
  position: absolute;
  left: 9%;
  bottom: 9%;
  width: 24%;
  height: 24%;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 2px 2px rgba(0, 50, 130, 0.35);
}

.lg-miss::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  margin: -17% 0 0 -17%;
  border-radius: 50%;
  background: #fff;
}

.lg-fire {
  position: absolute;
  left: 14%;
  top: 33%;
  width: 30%;
  height: 36%;
}

.lg-fire .fire {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

/* ---------- Меню ---------- */

.menu-actions {
  gap: 14px;
  margin-top: 26px;
}

.menu-best {
  margin-top: 16px;
  font-size: 15.5px;
  white-space: nowrap;
}

.sb-howto {
  align-self: center;
  min-height: 44px;
}

/* «Продолжить»: недоигранная партия с компьютером. */
.sb-resume {
  width: 100%;
  min-width: 0;
}

/* Кнопки языка и имени — не ниже 44 px. */
.menu .lang-btn,
.menu .lob-me {
  height: 44px;
}

@media (max-height: 720px) {
  .sb-logo {
    width: 104px;
    height: 104px;
  }

  .title-long {
    margin-top: 20px;
  }

  .menu-actions {
    margin-top: 20px;
  }
}

@media (max-height: 620px) {
  .sb-logo {
    width: 76px;
    height: 76px;
  }

  .lg-tile {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.65),
      inset 0 -5px 0 rgba(0, 30, 110, 0.22),
      0 6px 0 #0b56b8,
      0 12px 16px rgba(var(--shade-rgb), 0.5);
  }

  .title-long {
    margin-top: 16px;
    font-size: min(38px, 11vw);
  }

  .menu-best {
    height: 28px;
    margin-top: 10px;
    font-size: 14px;
  }

  .menu-actions {
    gap: 10px;
    margin-top: 14px;
  }

  .lob-modes {
    gap: 12px;
  }

  .lob-tile {
    height: 62px;
  }

  .lob-tile.wide {
    height: 48px;
  }

  .sb-howto {
    height: 44px;
  }

  /* С «Продолжить» кнопок на одну больше: справка остаётся в партии (кнопка «?»). */
  .menu.has-resume .sb-howto {
    display: none;
  }

  .sb-resume {
    height: 46px;
  }
}

/* ---------- Рамка поля и море ---------- */

/* Причал лежит выше сцены: уменьшенное поле видно сквозь прозрачное гнездо, а его рамка и значок — поверх. */
.stage {
  position: relative;
  z-index: 1;
}

.well {
  --shard: calc(var(--cell, 30px) * 0.2);
  padding: var(--lab) 10px 10px var(--lab);
}

/* Телефон: поле шире шапки и причала — рамка подходит к краям экрана ближе, клетки крупнее. */
.app:not(.wide) .stage {
  margin-left: -8px;
  margin-right: -8px;
}

.app:not(.wide) .well {
  padding-right: 8px;
}

/* Заклёпки по углам рамки. */
.well::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background-image:
    radial-gradient(circle at 38% 34%, #eaf6ff 0%, #9cc8f5 38%, #2f6cc4 62%, rgba(47, 108, 196, 0) 70%),
    radial-gradient(circle at 38% 34%, #eaf6ff 0%, #9cc8f5 38%, #2f6cc4 62%, rgba(47, 108, 196, 0) 70%),
    radial-gradient(circle at 38% 34%, #eaf6ff 0%, #9cc8f5 38%, #2f6cc4 62%, rgba(47, 108, 196, 0) 70%),
    radial-gradient(circle at 38% 34%, #eaf6ff 0%, #9cc8f5 38%, #2f6cc4 62%, rgba(47, 108, 196, 0) 70%);
  background-repeat: no-repeat;
  background-size: 9px 9px;
  background-position: 6px 6px, calc(100% - 6px) 6px, 6px calc(100% - 6px), calc(100% - 6px) calc(100% - 6px);
  opacity: 0.85;
  pointer-events: none;
}

.sea {
  position: relative;
  z-index: 0;
  width: calc(var(--cell, 30px) * 10);
  height: calc(var(--cell, 30px) * 10);
}

.wide .sea {
  width: calc(var(--cell, 30px) * 21);
}

/* Буквы и цифры на рамке. */
.axis {
  position: absolute;
  display: flex;
  z-index: 1;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(var(--shade-rgb), 0.5);
  pointer-events: none;
}

.axis span {
  flex: none;
  display: block;
  text-align: center;
}

.axis-top {
  left: var(--lab);
  top: 0;
  height: calc(var(--lab) - 5px);
  line-height: calc(var(--lab) - 4px);
}

.axis-top span {
  width: var(--cell, 30px);
}

.axis-left,
.axis-mid {
  flex-direction: column;
  left: 0;
  top: var(--lab);
  width: calc(var(--lab) - 4px);
}

.axis-left span,
.axis-mid span {
  height: var(--cell, 30px);
  line-height: var(--cell, 30px);
}

.axis-mid {
  left: calc(var(--cell, 30px) * 10);
  top: 0;
  width: var(--cell, 30px);
}

/* Табличка с именем поля — на нижней кромке рамки. */
.cap {
  position: absolute;
  left: calc(var(--lab) + var(--cell, 30px) * 5);
  bottom: -15px;
  z-index: 3;
  height: 24px;
  padding: 0 13px;
  border-radius: 12px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.2s ease-out;
}

.cap-own {
  background: linear-gradient(180deg, #5cd0ff, #1f9ef6);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #0c62b8;
  text-shadow: 0 1px 0 rgba(8, 60, 130, 0.6);
}

.cap-foe {
  background: linear-gradient(180deg, #ff9a3d, #ff4d5e);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.45), 0 2px 0 #b3202f;
  text-shadow: 0 1px 0 rgba(140, 20, 30, 0.6);
}

.app:not(.wide)[data-focus="own"] .cap-foe,
.app:not(.wide)[data-focus="foe"] .cap-own {
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
}

.wide .cap-foe {
  left: calc(var(--lab) + var(--cell, 30px) * 16);
}

/* Поверх поля лежит окно (итог, вопрос): подпись под рамкой не торчит из-под него. */
.app.has-over:not(.peeking) .cap {
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
}

/* Одно поле 10×10. На телефоне поле либо большое (в рамке), либо уменьшенное (на причале). */
.ocean {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--cell, 30px) * 10);
  height: calc(var(--cell, 30px) * 10);
  border-radius: calc(var(--cell, 30px) * 0.34);
  transform-origin: 0 0;
  transition: transform 0.5s cubic-bezier(0.5, 0, 0.2, 1), opacity 0.3s ease-out;
}

.ocean.mini {
  z-index: 2;
  pointer-events: none;
  transform: translate(var(--mx, 0px), var(--my, 0px)) scale(var(--ms, 0.25));
}

.sea.no-anim .ocean {
  transition: none;
}

.wide .ocean-foe {
  transform: translateX(calc(var(--cell, 30px) * 11));
}

/* На расстановке второго поля на телефоне нет. */
.app:not(.wide)[data-phase="setup"] .ocean-foe {
  opacity: 0;
}

.water {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--water-own);
  box-shadow: inset 0 3px 7px rgba(var(--shade-rgb), 0.5);
}

.ocean-foe .water {
  background: var(--water-foe);
}

/* Блик на воде. */
.water::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: radial-gradient(110% 80% at 14% 0%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 60%);
  box-shadow: inset 0 3px 7px rgba(var(--shade-rgb), 0.45);
}

/* Волны: два слоя узора едут навстречу друг другу. */
.wave {
  position: absolute;
  left: -100px;
  top: 0;
  width: calc(100% + 200px);
  height: 100%;
  opacity: 0.2;
}

.wave-A {
  animation: sb-wave-a 9s linear infinite;
}

.wave-B {
  opacity: 0.12;
  animation: sb-wave-b 17s linear infinite;
}

.ocean-foe .wave-A { opacity: 0.15; }
.ocean-foe .wave-B { opacity: 0.1; }

@keyframes sb-wave-a {
  to { transform: translateX(-64px); }
}

@keyframes sb-wave-b {
  from { transform: translateX(-92px); }
}

/* Клетки: тонкая сетка и мягкий блик в каждой — вода в лунках. */
.gridl {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0.3) 1px, rgba(0, 40, 120, 0.2) 1px, rgba(0, 40, 120, 0.2) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0.3) 1px, rgba(0, 40, 120, 0.2) 1px, rgba(0, 40, 120, 0.2) 2px, transparent 2px),
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 62%);
  background-size: var(--cell, 30px) var(--cell, 30px);
  background-position: -1px -1px, -1px -1px, 0 0;
  pointer-events: none;
}

.ocean.mini .gridl {
  opacity: 0.45;
}

.ships,
.marks,
.fxl,
.cells {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.marks,
.fxl {
  pointer-events: none;
}

.fxl {
  z-index: 4;
}

/* Чьё поле сейчас под огнём — золотой ободок. */
.ocean::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: -3px;
  border-radius: calc(var(--cell, 30px) * 0.34 + 3px);
  box-shadow: 0 0 0 3px #ffd24a, 0 0 18px 4px rgba(255, 210, 74, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.app[data-phase="battle"][data-shown="me"] .ocean-foe:not(.mini)::after {
  opacity: 1;
}

/*
 * Чей ход показан (data-shown ставит app.js в момент удара снаряда). Лобби переключает табличку и
 * строку хода, как только пришло состояние, — раньше, чем снаряд долетел; здесь они удерживаются
 * на прежнем стрелке до удара, чтобы исход выстрела не был виден заранее.
 */
.app[data-shown="me"] .lob-plate.turn:not(.me),
.app[data-shown="foe"] .lob-plate.turn.me {
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.1), 0 3px 0 rgba(var(--shade-rgb), 0.4);
  transform: none;
}

.app[data-shown="me"] .lob-plate.me,
.app[data-shown="foe"] .lob-plate:not(.me) {
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 210, 74, 0.35),
    0 0 0 3px #ffd24a,
    0 5px 0 3px rgba(var(--shade-rgb), 0.45),
    0 0 18px 3px rgba(255, 210, 74, 0.42);
  transform: translateY(-2px);
}

.app[data-shown="foe"] .lob-turn.mine {
  background: var(--deep);
  box-shadow: none;
  color: var(--ink-2);
}

.app[data-shown="me"] .lob-turn:not(.warn) {
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), 0 2px 0 #c97b00;
  color: #5a3100;
}

/* Полоса света по полю: «флот готов», «в бой». */
.sweep {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.sweep::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -60%;
  width: 50%;
  height: 140%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  animation: sb-sweep 0.7s ease-out both;
}

@keyframes sb-sweep {
  to { transform: translateX(340%) skewX(-18deg); }
}

/* ---------- Корабли ---------- */

.ship {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--w) * var(--cell, 30px));
  height: calc(var(--h) * var(--cell, 30px));
  transform: translate(calc(var(--x) * var(--cell, 30px)), calc(var(--y) * var(--cell, 30px)));
  transition: transform 0.34s cubic-bezier(0.3, 1.3, 0.5, 1);
  pointer-events: none;
}

/* Тень корабля нарисована в самом рисунке (art.js): фильтры на десятке кораблей дороги на телефоне. */
.ship-body {
  position: relative;
  width: 100%;
  height: 100%;
}

.ship-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sh-ember {
  animation: sb-ember 0.9s ease-in-out infinite alternate;
}

@keyframes sb-ember {
  from { opacity: 0.25; }
}

/* Целые корабли чуть покачиваются на волне. */
.ocean:not(.editing) .ship:not(.wreck) .ship-body {
  animation: sb-bob 2.6s ease-in-out infinite alternate;
  animation-delay: calc(var(--k, 0) * -0.37s);
}

@keyframes sb-bob {
  from { transform: translateY(-2.5%); }
  to { transform: translateY(2.5%); }
}

/* Потопленный: обгорел, под ним тёмно-красное пятно — виден с первого взгляда; над ним дым. */
.ship.wreck::before {
  content: "";
  position: absolute;
  top: 3%;
  right: 3%;
  bottom: 3%;
  left: 3%;
  border-radius: calc(var(--cell, 30px) * 0.3);
  background: rgba(132, 22, 12, 0.42);
  box-shadow: inset 0 0 0 1.5px rgba(255, 120, 90, 0.3);
}

.ship.wreck::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--cell, 30px) * 0.5);
  height: calc(var(--cell, 30px) * 0.5);
  margin: calc(var(--cell, 30px) * -0.25);
  border-radius: 50%;
  background: rgba(30, 32, 44, 0.6);
  opacity: 0;
  animation: sb-smoke 3.2s ease-out infinite;
  animation-delay: calc(var(--k, 0) * -0.7s);
}

.ocean.mini .gain,
.ocean.mini .finger {
  display: none;
}

.ship.sinking .ship-body {
  animation: sb-sink 0.7s cubic-bezier(0.3, 0.8, 0.4, 1) both;
}

@keyframes sb-sink {
  0% { transform: scale(1.22) rotate(-4deg); opacity: 0.2; }
  35% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  60% { transform: scale(0.96) rotate(-1.5deg); }
  100% { transform: scale(1); opacity: 1; }
}

/* Уцелевшие корабли соперника, открытые после конца партии. */
.ship.reveal .ship-body {
  animation: sb-reveal 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  animation-delay: calc(var(--k, 0) * 70ms);
}

@keyframes sb-reveal {
  from { transform: scale(0.4); opacity: 0; }
}

/* Расстановка: корабли можно брать. */
.ocean.editing .ships {
  z-index: 3;
}

.ocean.editing .ship {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.ship:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -1px;
  border-radius: calc(var(--cell, 30px) * 0.3);
}

.ship.drag {
  z-index: 5;
  cursor: grabbing;
  transition: none;
}

.ship .ship-body {
  transition: transform 0.14s ease-out;
}

.ship.drag .ship-body {
  transform: scale(1.12);
  filter: drop-shadow(0 calc(var(--cell, 30px) * 0.3) calc(var(--cell, 30px) * 0.22) rgba(3, 30, 90, 0.55));
}

/* Под пальцем корабль приподнят, чтобы его было видно; встанет он туда, где зелёный след. */
.ship.drag.lifted .ship-body {
  transform: translateY(calc(var(--cell, 30px) * -0.9)) scale(1.12);
}

/* Над запрещённым местом корабль краснеет. */
.ship.drag.bad .ship-body {
  filter: drop-shadow(0 0 calc(var(--cell, 30px) * 0.16) rgba(255, 40, 30, 0.95)) drop-shadow(0 calc(var(--cell, 30px) * 0.3) calc(var(--cell, 30px) * 0.22) rgba(3, 30, 90, 0.55));
}

.ship.settle .ship-body {
  animation: sb-settle 0.32s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes sb-settle {
  0% { transform: scale(1.12); }
  45% { transform: scale(0.9, 0.86); }
}

.ship.spin .ship-body {
  animation: sb-spin 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes sb-spin {
  from { transform: rotate(-70deg) scale(0.6); }
}

.ship.nope .ship-body {
  animation: sb-nope 0.32s ease-in-out;
}

@keyframes sb-nope {
  20% { transform: translateX(-9%) rotate(-3deg); }
  45% { transform: translateX(8%) rotate(3deg); }
  70% { transform: translateX(-5%); }
  90% { transform: translateX(3%); }
}

.ship.fly {
  transition: transform 0.5s cubic-bezier(0.3, 1.25, 0.5, 1);
  transition-delay: calc(var(--k, 0) * 28ms);
}

/* Куда встанет корабль: зелёный след — можно, красный — нельзя. */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: calc(var(--w) * var(--cell, 30px));
  height: calc(var(--h) * var(--cell, 30px));
  border-radius: calc(var(--cell, 30px) * 0.3);
  background: rgba(110, 255, 150, 0.45);
  box-shadow: inset 0 0 0 2.5px rgba(220, 255, 230, 0.95), 0 0 0 3px rgba(110, 255, 150, 0.5), 0 0 14px rgba(110, 255, 150, 0.7);
  transform: translate(calc(var(--x) * var(--cell, 30px)), calc(var(--y) * var(--cell, 30px)));
  pointer-events: none;
}

.ghost.bad {
  background: rgba(255, 70, 70, 0.5);
  box-shadow: inset 0 0 0 2.5px rgba(255, 220, 220, 0.95), 0 0 0 3px rgba(255, 70, 70, 0.55), 0 0 14px rgba(255, 70, 70, 0.7);
}

/* ---------- Отметки на клетках ---------- */

.mark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cell, 30px);
  height: var(--cell, 30px);
  transform: translate(calc(var(--x) * var(--cell, 30px)), calc(var(--y) * var(--cell, 30px)));
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
}

/* Промах: застывшие круги на воде — толстое кольцо с точкой и слабое кольцо пошире. */
.mark.miss::before {
  box-sizing: border-box;
  width: 58%;
  height: 58%;
  margin: -29% 0 0 -29%;
  border: calc(var(--cell, 30px) * 0.11) solid rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 1.5px 2px rgba(0, 40, 120, 0.45), inset 0 1.5px 2px rgba(0, 40, 120, 0.35);
}

.mark.miss::after {
  width: 16%;
  height: 16%;
  margin: -8% 0 0 -8%;
  background: #fff;
}

.ripple {
  box-sizing: border-box;
  position: absolute;
  left: 9%;
  top: 9%;
  width: 82%;
  height: 82%;
  border: calc(var(--cell, 30px) * 0.045) solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
}

.mark.miss.in::before {
  animation: sb-mark-in 0.4s 0.16s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.mark.miss.in::after {
  animation: sb-mark-in 0.3s 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.mark.miss.in .ripple {
  animation: sb-mark-in 0.5s 0.3s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

/* Клетка рядом с потопленным кораблём: тут пусто. */
.mark.dot::after {
  width: 26%;
  height: 26%;
  margin: -13% 0 0 -13%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 1px rgba(0, 40, 120, 0.4);
}

.mark.dot.in::after {
  animation: sb-mark-in 0.34s cubic-bezier(0.3, 1.8, 0.5, 1) both;
  animation-delay: var(--d, 0ms);
}

@keyframes sb-mark-in {
  from { transform: scale(0); opacity: 0; }
}

/* Попадание: красно-оранжевое зарево на всю клетку, обгоревший кусок борта и огонь, который продолжает гореть. */
.mark.hit::before {
  width: 150%;
  height: 150%;
  margin: -75% 0 0 -75%;
  background: radial-gradient(circle, rgba(255, 96, 40, 0.62) 0%, rgba(255, 96, 40, 0.3) 38%, rgba(255, 96, 40, 0) 66%);
}

.mark.hit.in::before {
  animation: sb-mark-in 0.4s ease-out both;
}

.plate {
  position: absolute;
  left: 13%;
  top: 13%;
  right: 13%;
  bottom: 13%;
  border-radius: 28%;
}

.ocean-foe .mark.hit .plate {
  background:
    radial-gradient(circle at 60% 62%, rgba(15, 10, 8, 0.75) 0%, rgba(15, 10, 8, 0) 62%),
    linear-gradient(160deg, #a9b3c4 0%, #6d7789 50%, #474f5e 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.32),
    0 2px 3px rgba(3, 30, 90, 0.55);
}

.ocean-own .mark.hit .plate {
  left: 4%;
  top: 4%;
  right: 4%;
  bottom: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 8, 6, 0.82) 0%, rgba(14, 8, 6, 0.5) 42%, rgba(14, 8, 6, 0) 70%);
}

/* На обломках — только воронка: сам корабль уже нарисован обгоревшим. */
.mark.dead .plate {
  left: 28%;
  top: 28%;
  right: 28%;
  bottom: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 6, 5, 0.85) 0%, rgba(10, 6, 5, 0.45) 55%, rgba(10, 6, 5, 0) 78%);
}

.mark.hit.in .plate {
  animation: sb-mark-in 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* Клетка потопленного корабля: воронка с тлеющим углём. */
.mark.dead::after {
  width: 22%;
  height: 22%;
  margin: -11% 0 0 -11%;
  background: radial-gradient(circle, #ffe9a0 0%, #ff8a1e 45%, rgba(255, 60, 20, 0) 75%);
  animation: sb-ember 1.1s ease-in-out infinite alternate;
}

.fire {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 94%;
  height: 112%;
  margin: -84% 0 0 -47%;
}

.fl {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 100%;
  animation: sb-flame-a 0.62s ease-in-out infinite alternate;
}

.fl-b {
  left: 21%;
  width: 58%;
  height: 60%;
  filter: none;
  animation: sb-flame-b 0.43s ease-in-out infinite alternate;
}

@keyframes sb-flame-a {
  from { transform: scale(0.92, 0.88) rotate(-4deg); }
  to { transform: scale(1.05, 1.1) rotate(4deg); }
}

@keyframes sb-flame-b {
  from { transform: scale(1.08, 0.86) rotate(5deg); }
  to { transform: scale(0.9, 1.14) rotate(-5deg); }
}

.mark.hit.in .fire {
  animation: sb-fire-in 0.4s 0.12s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  transform-origin: 50% 90%;
}

@keyframes sb-fire-in {
  from { transform: scale(0); }
}

.smoke {
  position: absolute;
  left: 28%;
  top: -8%;
  width: 44%;
  height: 37%;
  border-radius: 50%;
  background: rgba(38, 42, 56, 0.6);
  opacity: 0;
  animation: sb-smoke 2.3s ease-out infinite;
}

.smoke.s2 {
  left: 40%;
  animation-delay: 1.15s;
}

@keyframes sb-smoke {
  0% { transform: translate(0, 60%) scale(0.5); opacity: 0; }
  22% { opacity: 0.6; }
  100% { transform: translate(34%, -170%) scale(1.55); opacity: 0; }
}

/* ---------- Клетки поля соперника ---------- */

.cells {
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 1fr;
}

.cell {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 24%;
  background: none;
  touch-action: none;
  cursor: default;
}

.lob-myturn .ocean-foe:not(.mini) .cell:not(.shot) {
  cursor: crosshair;
}

@media (hover: hover) {
  .lob-myturn .ocean-foe:not(.mini) .cell:not(.shot):hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
  }
}

.lob-myturn .ocean-foe:not(.mini) .cell:not(.shot):active {
  background: rgba(255, 255, 255, 0.34);
}

.cell:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

.cell.nope {
  animation: sb-cell-nope 0.34s ease-out;
}

@keyframes sb-cell-nope {
  0%, 60% { box-shadow: inset 0 0 0 3px #ff5a4a, 0 0 12px rgba(255, 70, 60, 0.7); }
}

/* Туман над полем соперника, пока идёт расстановка. */
.fog {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(10, 28, 96, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

.app[data-phase="setup"] .fog,
.app[data-phase="wait"] .fog {
  opacity: 1;
}

.fog-chip {
  max-width: 84%;
  padding: 8px 16px;
  border-radius: 16px;
  background: rgba(var(--deep-rgb), 0.86);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.18), 0 4px 0 rgba(var(--shade-rgb), 0.5);
  font-size: 15px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
}

.fog-chip.ok {
  background: linear-gradient(180deg, #5fe08a, #25b25a);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.5), 0 4px 0 #14803c;
  text-shadow: 0 1px 0 rgba(10, 90, 40, 0.6);
}

.ocean.mini .fog-chip {
  display: none;
}

/* ---------- Выстрел: прицел, снаряд, всплеск, взрыв ---------- */

.aim,
.volley,
.splash,
.boom {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cell, 30px);
  height: var(--cell, 30px);
  transform: translate(calc(var(--x) * var(--cell, 30px)), calc(var(--y) * var(--cell, 30px)));
  pointer-events: none;
}

.xhair {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.aim .xhair {
  animation: sb-aim-in 0.26s cubic-bezier(0.3, 1.5, 0.5, 1) both, sb-aim-spin 2.4s 0.26s linear infinite;
}

@keyframes sb-aim-in {
  from { transform: scale(2.6) rotate(-60deg); opacity: 0; }
}

@keyframes sb-aim-spin {
  to { transform: rotate(90deg); }
}

.xh-o {
  fill: none;
  stroke: #3a1205;
  stroke-width: 15;
  stroke-linecap: round;
}

.xh-i {
  fill: none;
  stroke: #ffe066;
  stroke-width: 8;
  stroke-linecap: round;
}

.xh-d {
  fill: #ffe066;
  stroke: #3a1205;
  stroke-width: 3.5;
}

/* Прицел соперника на моём поле и прицел на значке — красные. */
.aim.theirs .xh-i,
.lg-aim .xh-i,
.help-ico .xh-i {
  stroke: #ff5136;
}

.aim.theirs .xh-d,
.lg-aim .xh-d,
.help-ico .xh-d {
  fill: #ff5136;
}

.xh-o,
.lg-aim .xh-o {
  stroke: #4a1206;
}

.lg-aim .xh-i {
  stroke: #ff5136;
}

/* Снаряд летит по дуге: растёт к вершине, уменьшается у цели. */
.shell {
  position: absolute;
  left: 31%;
  top: 31%;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0%, #ffe07a 22%, #c9781a 55%, #3a1d06 100%);
  box-shadow: 0 0 calc(var(--cell, 30px) * 0.34) rgba(255, 190, 70, 0.9);
  animation: sb-shell var(--ft, 0.34s) cubic-bezier(0.4, 0, 0.8, 0.7) both;
}

@keyframes sb-shell {
  0% { transform: translate(var(--sx), var(--sy)) scale(0.8); opacity: 0.3; }
  12% { opacity: 1; }
  55% { transform: translate(calc(var(--sx) * 0.36), calc(var(--sy) * 0.36)) scale(2.3); }
  100% { transform: translate(0, 0) scale(0.75); }
}

/* Тень снаряда на воде. */
.shell-shade {
  position: absolute;
  left: 20%;
  top: 30%;
  width: 60%;
  height: 46%;
  border-radius: 50%;
  background: rgba(3, 22, 74, 0.5);
  animation: sb-shade var(--ft, 0.34s) ease-in both;
}

@keyframes sb-shade {
  from { transform: scale(2.4); opacity: 0; }
}

/* Всплеск: столб воды, круги, брызги. */
.splash i,
.boom i {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.splash .col {
  left: 14%;
  top: -46%;
  width: 72%;
  height: 132%;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #ffffff 0%, #dff6ff 55%, rgba(190, 236, 255, 0.5) 100%);
  transform-origin: 50% 82%;
  box-shadow: inset calc(var(--cell, 30px) * -0.08) 0 0 rgba(120, 200, 255, 0.55);
  animation: sb-col 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes sb-col {
  0% { transform: scale(0.3, 0.1); opacity: 1; }
  38% { transform: scale(0.9, 1.15); opacity: 1; }
  62% { transform: scale(1, 0.95); opacity: 1; }
  100% { transform: scale(1.3, 0.08); opacity: 0; }
}

.splash .ring,
.boom .ringf {
  box-sizing: border-box;
  border: calc(var(--cell, 30px) * 0.08) solid rgba(255, 255, 255, 0.92);
  animation: sb-ring 0.75s ease-out both;
}

.splash .ring.r2 { animation-delay: 0.14s; }
.splash .ring.r3 { animation-delay: 0.28s; }

@keyframes sb-ring {
  from { transform: scale(0.15); opacity: 1; }
  to { transform: scale(2.3); opacity: 0; }
}

.splash .drop {
  left: 39%;
  top: 39%;
  width: 22%;
  height: 22%;
  background: #fff;
  animation: sb-drop 0.56s cubic-bezier(0.2, 0.7, 0.5, 1) both;
}

@keyframes sb-drop {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  55% { transform: translate(calc(var(--dx) * 0.8), calc(var(--dy) - var(--cell, 30px) * 0.8)) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* Взрыв: вспышка, огненный шар, кольцо, клубы дыма. Осколки добавляет kit.fx.burst. */
.boom .flash {
  background: radial-gradient(circle, #ffffff 0%, #fff0a0 30%, rgba(255, 170, 40, 0.9) 55%, rgba(255, 80, 20, 0) 72%);
  animation: sb-flash 0.44s ease-out both;
}

@keyframes sb-flash {
  0% { transform: scale(0.2); opacity: 1; }
  55% { opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.boom .ball {
  background: radial-gradient(circle at 42% 38%, #fff3b0 0%, #ffb02e 38%, #f2491c 70%, rgba(170, 30, 10, 0) 78%);
  animation: sb-ball 0.5s 0.04s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes sb-ball {
  0% { transform: scale(0.2); opacity: 1; }
  50% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(1.75); opacity: 0; }
}

.boom .ringf {
  border-color: rgba(255, 210, 110, 0.95);
  animation: sb-ring-f 0.5s ease-out both;
}

@keyframes sb-ring-f {
  from { transform: scale(0.15); opacity: 1; }
  to { transform: scale(1.9); opacity: 0; }
}

.boom .puff {
  left: 25%;
  top: 25%;
  width: 50%;
  height: 50%;
  background: rgba(36, 38, 50, 0.72);
  animation: sb-puff 0.95s 0.1s ease-out both;
}

@keyframes sb-puff {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  25% { opacity: 0.85; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.7); opacity: 0; }
}

/* Ударная волна вдоль потопленного корабля. */
.shock {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--w) * var(--cell, 30px));
  height: calc(var(--h) * var(--cell, 30px));
  border-radius: calc(var(--cell, 30px) * 0.5);
  box-shadow: 0 0 0 calc(var(--cell, 30px) * 0.1) rgba(255, 236, 170, 0.95), 0 0 calc(var(--cell, 30px) * 0.6) rgba(255, 150, 40, 0.8);
  transform: translate(calc(var(--x) * var(--cell, 30px)), calc(var(--y) * var(--cell, 30px)));
  pointer-events: none;
  animation: sb-shock 0.6s ease-out both;
}

@keyframes sb-shock {
  from { opacity: 1; }
  to { opacity: 0; box-shadow: 0 0 0 calc(var(--cell, 30px) * 0.9) rgba(255, 236, 170, 0), 0 0 calc(var(--cell, 30px) * 0.6) rgba(255, 150, 40, 0); }
}

/* Надписи над клеткой. */
.fxl .gain {
  font-size: calc(var(--cell, 30px) * 0.6);
  text-shadow: 0 2px 0 rgba(var(--shade-rgb), 0.9), 0 0 8px rgba(var(--shade-rgb), 0.7);
}

.fxl .gain.g-hit {
  color: #ffe066;
  font-size: calc(var(--cell, 30px) * 0.72);
  text-shadow: 0 2px 0 #a33a00, 0 0 10px rgba(var(--shade-rgb), 0.8);
}

.fxl .gain.g-bad {
  color: #ff8d7a;
  font-size: calc(var(--cell, 30px) * 0.66);
  text-shadow: 0 2px 0 #7a1408, 0 0 10px rgba(var(--shade-rgb), 0.8);
}

/* Соперник промахнулся по моему полю. */
.fxl .gain.g-ok {
  color: #8dffd9;
  text-shadow: 0 2px 0 #0a6a58, 0 0 10px rgba(var(--shade-rgb), 0.8);
}

/*
 * Подсказка первого запуска: рука-указатель показывает, что делать. .finger — точка касания
 * (середина клетки); рука висит под ней так, что кончик пальца приходится в эту точку.
 */
.finger {
  position: absolute;
  left: calc(var(--cell, 30px) * 0.5);
  top: calc(var(--cell, 30px) * 0.5);
  z-index: 6;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.finger .hand {
  position: absolute;
  left: calc(var(--cell, 30px) * -0.75);
  top: calc(var(--cell, 30px) * -0.1);
  width: calc(var(--cell, 30px) * 1.5);
  height: calc(var(--cell, 30px) * 1.8);
  overflow: visible;
  transform: rotate(-18deg);
  transform-origin: 50% 6%;
  filter: drop-shadow(0 4px 5px rgba(3, 22, 74, 0.5));
}

/* Кольцо под кончиком пальца в момент нажатия. */
.tap-ring {
  box-sizing: border-box;
  position: absolute;
  left: calc(var(--cell, 30px) * -0.6);
  top: calc(var(--cell, 30px) * -0.6);
  width: calc(var(--cell, 30px) * 1.2);
  height: calc(var(--cell, 30px) * 1.2);
  border: calc(var(--cell, 30px) * 0.09) solid #fff;
  border-radius: 50%;
  opacity: 0;
}

.finger.drag-demo {
  animation: sb-finger-drag 2.8s ease-in-out infinite;
}

.finger.drag-demo .hand {
  animation: sb-hand-drag 2.8s ease-in-out infinite;
}

.finger.drag-demo .tap-ring {
  animation: sb-ring-drag 2.8s ease-out infinite;
}

@keyframes sb-finger-drag {
  0% { transform: translate(var(--fx0), var(--fy0)); opacity: 0; }
  12% { transform: translate(var(--fx0), var(--fy0)); opacity: 1; }
  28% { transform: translate(var(--fx0), var(--fy0)); opacity: 1; }
  66% { transform: translate(var(--fx1), var(--fy1)); opacity: 1; }
  78% { transform: translate(var(--fx1), var(--fy1)); opacity: 1; }
  90%, 100% { transform: translate(var(--fx1), var(--fy1)); opacity: 0; }
}

@keyframes sb-hand-drag {
  0%, 12% { transform: rotate(-18deg) scale(1.15); }
  22%, 70% { transform: rotate(-18deg) scale(0.9); }
  80%, 100% { transform: rotate(-18deg) scale(1.15); }
}

@keyframes sb-ring-drag {
  0%, 18% { transform: scale(0); opacity: 0; }
  20% { transform: scale(0.1); opacity: 1; }
  34%, 100% { transform: scale(1); opacity: 0; }
}

.finger.tap-demo {
  animation: sb-finger-tap 1.7s ease-in-out infinite;
}

.finger.tap-demo .hand {
  animation: sb-hand-tap 1.7s ease-in-out infinite;
}

.finger.tap-demo .tap-ring {
  animation: sb-ring-tap 1.7s ease-out infinite;
}

@keyframes sb-finger-tap {
  0% { transform: translate(var(--fx0), var(--fy0)); opacity: 0; }
  18%, 74% { transform: translate(var(--fx0), var(--fy0)); opacity: 1; }
  92%, 100% { transform: translate(var(--fx0), var(--fy0)); opacity: 0; }
}

@keyframes sb-hand-tap {
  0%, 22% { transform: rotate(-18deg) scale(1.2) translateY(14%); }
  36%, 50% { transform: rotate(-18deg) scale(0.9); }
  66%, 100% { transform: rotate(-18deg) scale(1.2) translateY(14%); }
}

@keyframes sb-ring-tap {
  0%, 34% { transform: scale(0); opacity: 0; }
  36% { transform: scale(0.1); opacity: 1; }
  60%, 100% { transform: scale(1); opacity: 0; }
}

/* ---------- Причал под полем ---------- */

.dock {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--col, 460px);
  height: var(--dock-h);
}

.dock-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  height: 100%;
}

.dock-status {
  flex: none;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
}

.app[data-phase="setup"] .dock-status {
  justify-content: center;
}

/* Флот: десять силуэтов в две строки на тёмной плашке. Потопленный — остов под красной чертой. */
.fleets {
  flex: none;
  min-width: 0;
}

.fleet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px 5px;
  padding: 8px 9px 9px;
  border-radius: 16px;
  background: var(--deep);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.1), 0 3px 0 rgba(var(--shade-rgb), 0.4);
}

.fleet-own {
  display: none;
}

/* Перенос строки: 4 + 3 + 3 сверху, 2 + 2 + 2 + 1 + 1 + 1 + 1 снизу. */
.fs-br {
  flex: 0 0 100%;
  height: 0;
}

.fs {
  position: relative;
  flex: none;
  width: calc(var(--len) * var(--u));
  height: var(--u);
}

.fs .ship-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fs.gone .ship-art {
  opacity: 0.72;
}

.fs.gone::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff8a6a, #ff3d2a);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92), 0 2.5px 0 rgba(90, 10, 0, 0.75);
  transform: rotate(-9deg);
}

.fs.gone.pop {
  animation: sb-fs-pop 0.5s cubic-bezier(0.3, 1.7, 0.5, 1);
}

@keyframes sb-fs-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.5) rotate(-8deg); }
}

.app[data-phase="setup"] .fleets,
.app[data-phase="setup"] .thumb {
  display: none;
}

/* Кнопки расстановки. */
.setup-actions {
  flex: none;
  display: flex;
  gap: 10px;
  min-width: 0;
  padding-bottom: 5px;
}

/* Ширина кнопок — по подписи (свободное место делится поровну): длинное «Tötänleýin» не обрезается. */
.setup-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 10px;
  border-radius: 18px;
  font-size: 18px;
}

.setup-actions .btn-gold {
  flex-grow: 3;
}

/* На расстановке причал не уже 400 px (или экрана), даже когда поле уже: его ужала высота. */
.app:not(.wide)[data-phase="setup"] .dock {
  max-width: max(var(--col, 460px), min(100%, 400px));
}

.setup-actions .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Игральная кость на кнопке «Случайно». */
.dice {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 27% 27%, #0c62b8 0, #0c62b8 2.4px, transparent 2.9px),
    radial-gradient(circle at 73% 27%, #0c62b8 0, #0c62b8 2.4px, transparent 2.9px),
    radial-gradient(circle at 50% 50%, #0c62b8 0, #0c62b8 2.4px, transparent 2.9px),
    radial-gradient(circle at 27% 73%, #0c62b8 0, #0c62b8 2.4px, transparent 2.9px),
    radial-gradient(circle at 73% 73%, #0c62b8 0, #0c62b8 2.4px, transparent 2.9px),
    linear-gradient(180deg, #ffffff, #d9ecff);
  box-shadow: 0 2px 0 rgba(8, 60, 130, 0.6);
  transform: rotate(-10deg);
}

.btn.roll .dice {
  animation: sb-roll 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes sb-roll {
  from { transform: rotate(-370deg) scale(0.7); }
}

/* Уменьшенное второе поле: рамка-гнездо; само поле кладётся поверх него. Нажатие меняет поля местами. */
.thumb {
  position: relative;
  flex: none;
  width: var(--thumb);
  height: var(--thumb);
  margin: 0 4px 6px 0;
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: none;
  box-shadow:
    inset 0 0 0 5px var(--pit),
    inset 0 7px 6px rgba(var(--shade-rgb), 0.5),
    0 0 0 3px var(--frame),
    0 -1px 0 4px rgba(255, 255, 255, 0.22),
    0 6px 0 3px var(--frame-lip),
    0 11px 14px rgba(var(--shade-rgb), 0.4);
}

.thumb:active {
  filter: brightness(1.2);
}

/* Значок «поменять местами» на углу. */
.thumb-badge {
  position: absolute;
  right: -7px;
  top: -8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), 0 2px 0 #c97b00;
  color: #5a3100;
}

.thumb-badge svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wide .thumb {
  display: none;
}

/* Кнопка реакций: на низком экране шесть реакций свёрнуты в неё (см. «Низкие экраны»). */
.emo-btn {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), 0 3px 0 rgba(var(--deep-rgb), 0.45);
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out;
}

.emo-btn:active,
.emo-open .emo-btn {
  transform: translateY(3px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), 0 0 0 rgba(var(--deep-rgb), 0.45);
}

.emo-btn svg {
  width: 26px;
  height: 26px;
}

/* Реакции и второстепенные кнопки окон — не ниже 44 px. */
.lob-emotes {
  height: 47px;
}

.lob-emotes button {
  height: 44px;
}

.over-actions .btn-ghost,
.lob-body .btn-ghost {
  min-height: 44px;
}

/* ---------- Высокий телефон: флот отдельной строкой ---------- */

@media (min-height: 690px) and (max-width: 879px) {
  .dock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px 12px;
  }

  .dock-main {
    display: contents;
  }

  .fleets {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .dock-status {
    grid-column: 1;
    grid-row: 2;
  }

  .thumb {
    grid-column: 2;
    grid-row: 2;
    margin-right: 6px;
  }

  .lob-turn {
    min-height: 36px;
    padding: 4px 16px;
    border-radius: 18px;
    font-size: 16.5px;
  }

  .lob-turn.long {
    font-size: 13.5px;
  }

  /* Расстановка: строка-подсказка и кнопки по середине причала. */
  .app[data-phase="setup"] .dock {
    grid-template-rows: auto auto;
    align-content: center;
    gap: 12px;
  }

  .app[data-phase="setup"] .dock-status {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .setup-actions {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .setup-actions .btn {
    height: 54px;
    font-size: 20px;
  }
}

/* Очень высокий телефон: рядом с уменьшенным полем — ещё и свой флот (кто у меня уцелел). */
@media (min-height: 800px) and (max-width: 879px) {
  .dock {
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  }

  .fleets {
    display: contents;
  }

  .fleet-foe {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .dock-status {
    grid-row: 2;
    align-self: end;
  }

  .fleet-own {
    --u: 14px;
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    justify-self: start;
    display: flex;
    justify-content: flex-start;
    max-width: 100%;
    padding: 6px 8px 7px;
    gap: 2px 4px;
  }

  /* Подпись «Мой флот» (текст кладёт app.js). */
  .fleet-own::before {
    content: attr(data-cap);
    flex: 0 0 100%;
    margin-bottom: 3px;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 800;
    line-height: 14px;
    letter-spacing: 0.03em;
  }

  .fleet-own .fs.gone::after {
    height: 3px;
    margin-top: -1.5px;
  }

  .thumb {
    grid-row: 2 / 4;
  }

  .app[data-phase="setup"] .dock {
    grid-template-rows: auto auto;
  }
}

/* Очень высокий телефон, расстановка: над подсказкой — состав флота, кнопки крупнее. */
@media (min-height: 800px) and (max-width: 879px) {
  .app[data-phase="setup"] .dock {
    grid-template-rows: auto auto auto;
    gap: 14px;
  }

  .app[data-phase="setup"] .fleets {
    display: contents;
  }

  .app[data-phase="setup"] .fleet-foe {
    display: none;
  }

  .app[data-phase="setup"] .fleet-own {
    --u: 23px;
    grid-column: 1 / 3;
    grid-row: 1;
    align-self: auto;
    justify-self: stretch;
    justify-content: center;
    gap: 3px 5px;
    padding: 8px 9px 9px;
  }

  .app[data-phase="setup"] .fleet-own::before {
    display: none;
  }

  .app[data-phase="setup"] .dock-status {
    grid-row: 2;
    align-self: center;
  }

  .app[data-phase="setup"] .setup-actions {
    grid-row: 3;
  }

  .setup-actions .btn {
    height: 60px;
    border-radius: 21px;
    font-size: 21px;
  }
}

@media (min-height: 880px) and (max-width: 879px) {
  .app[data-phase="setup"] .fleet-own {
    --u: 25px;
  }
}

/* Игра по сети на телефоне пониже (621–689 px): таблички игроков ниже — клетки крупнее. */
@media (min-height: 621px) and (max-height: 689px) and (max-width: 879px) {
  .app[data-lob-mode="online"] .lob-plates {
    min-height: 40px;
  }

  .app[data-lob-mode="online"] .lob-plate {
    height: 40px;
    border-radius: 15px;
  }

  .app[data-lob-mode="online"] .lob-plate .lob-mark {
    width: 28px;
    height: 28px;
  }
}

/*
 * Игра по сети на телефоне средней высоты (690–799 px): внизу ещё и строка реакций. Чтобы поле не
 * мельчало, причал тут низкий, как на экранах пониже: флот и строка хода столбиком рядом с
 * уменьшенным полем.
 */
@media (min-height: 690px) and (max-height: 799px) and (max-width: 879px) {
  .app[data-lob-mode="online"] {
    --u: 16px;
    --thumb: 82px;
    --dock-h: 92px;
  }

  .app[data-lob-mode="online"] .dock,
  .app[data-lob-mode="online"] .dock-main {
    display: flex;
  }

  .app[data-lob-mode="online"] .thumb {
    margin-right: 4px;
  }

  .app[data-lob-mode="online"] .lob-turn {
    min-height: 30px;
    padding: 3px 14px;
    border-radius: 15px;
    font-size: 15px;
  }

  .app[data-lob-mode="online"] .lob-turn.long {
    padding: 3px 10px;
    font-size: 12.5px;
  }

  .app[data-lob-mode="online"] .setup-actions .btn {
    height: 48px;
    font-size: 18px;
  }
}

/* ---------- Широкий экран: оба поля рядом ---------- */

.wide .dock-main {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wide .fleets {
  display: contents;
}

.wide .fleet {
  --u: 22px;
  flex: 1 1 0;
  display: flex;
  max-width: 330px;
}

.wide .fleet-own { order: 1; }
.wide .dock-status { order: 2; justify-content: center; }
.wide .fleet-foe { order: 3; }
.wide .setup-actions { order: 4; flex: 0 0 380px; }

.wide[data-phase="setup"] .fleet {
  display: none;
}

.wide[data-phase="setup"] .dock-main {
  justify-content: center;
}

.wide {
  --dock-h: 80px;
}

/* ---------- Низкие экраны ---------- */
/*
 * 360×560 с табличками, часами и реакциями: всё вокруг поля ужато, чтобы клетка была не меньше
 * 30 px. Таблички ниже, силуэты мельче, шесть реакций свёрнуты в одну кнопку рядом с уменьшенным
 * полем (нажатие открывает полоску над причалом).
 */

@media (max-height: 620px) {
  :root {
    --u: 12px;
    --thumb: 60px;
    --dock-h: 74px;
    --lab: 8px;
  }

  .axis-top,
  .axis-left,
  .well::before {
    display: none;
  }

  .well {
    padding: 8px;
  }

  .lob-plates {
    min-height: 40px;
  }

  .lob-plate {
    height: 40px;
    border-radius: 15px;
  }

  .lob-plate .lob-mark {
    width: 28px;
    height: 28px;
  }

  .app:not(.wide) .dock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 4px 8px;
  }

  .app:not(.wide) .dock-main {
    display: contents;
  }

  .app:not(.wide) .fleets {
    grid-column: 1;
    grid-row: 1;
  }

  .app:not(.wide) .dock-status {
    grid-column: 1;
    grid-row: 2;
    min-height: 26px;
  }

  .app:not(.wide) .emo-btn {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .app:not(.wide) .thumb {
    grid-column: 3;
    grid-row: 1 / 3;
    margin: 0 4px 5px 0;
    border-radius: 14px;
  }

  .app:not(.wide)[data-phase="setup"] .dock-status {
    grid-column: 1 / 4;
    grid-row: 1;
  }

  .app:not(.wide) .setup-actions {
    grid-column: 1 / 4;
    grid-row: 2;
    padding-bottom: 3px;
  }

  .app:not(.wide)[data-lob-mode="online"] .setup-actions {
    grid-column: 1 / 3;
  }

  /* Рядом с кнопками расстановки стоит кнопка реакций: подписи мельче, «Случайно» шире. */
  .app:not(.wide)[data-lob-mode="online"] .setup-actions {
    gap: 8px;
  }

  .app:not(.wide)[data-lob-mode="online"] .setup-actions .btn {
    padding: 0 6px;
    font-size: 15px;
  }

  .app:not(.wide)[data-phase="setup"] .emo-btn {
    grid-column: 3;
    grid-row: 2;
  }

  .app:not(.wide)[data-lob-mode="online"] .emo-btn {
    display: flex;
  }

  /* Шесть реакций — полоска над причалом; в поток экрана не входит и места у поля не занимает. */
  .app:not(.wide) .lob-emotes {
    position: absolute;
    left: 50%;
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + var(--dock-h) + 4px);
    z-index: 9;
    display: none;
    width: auto;
    height: auto;
    padding: 8px 8px 10px;
    border-radius: 22px;
    background: var(--frame);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 5px 0 var(--frame-lip), 0 12px 20px rgba(var(--shade-rgb), 0.55);
    transform: translateX(-50%);
  }

  .app.emo-open:not(.wide) .lob-emotes:not([hidden]) {
    display: flex;
    animation: sb-emo-in 0.18s cubic-bezier(0.3, 1.5, 0.5, 1);
  }

  .app:not(.wide) .lob-emotes button {
    flex: none;
    width: 46px;
  }

  .lob-turn {
    min-height: 26px;
    font-size: 14px;
  }

  .fleet {
    gap: 2px 4px;
    padding: 5px 7px 6px;
    border-radius: 13px;
  }

  .fs.gone::after {
    height: 3px;
    margin-top: -1.5px;
  }

  .setup-actions .btn {
    height: 44px;
    border-radius: 16px;
    font-size: 16px;
  }

  .cap {
    bottom: -13px;
    height: 21px;
    font-size: 11.5px;
    line-height: 21px;
  }
}

@keyframes sb-emo-in {
  from { transform: translateX(-50%) translateY(10px) scale(0.8); opacity: 0; }
}

/* ---------- Экраны лобби: лицо игры ---------- */
/* Сами экраны (уровень, имя, код) рисует набор; игра добавляет свои рисунки (картинки готовит app.js). */

.lob-body [data-level] {
  position: relative;
}

.lob-body [data-level]::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  height: 20px;
  margin-top: -11px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.lob-body [data-level="1"]::before { width: 20px; background-image: var(--sb-ship1); }
.lob-body [data-level="2"]::before { width: 40px; background-image: var(--sb-ship2); }
.lob-body [data-level="3"]::before { width: 80px; background-image: var(--sb-ship4); }

.lob-p-level .lob-h::before,
.lob-p-name .lob-h::before,
.lob-p-join .lob-h::before {
  content: "";
  display: block;
  width: 72px;
  height: 77px;
  margin: 0 auto 12px;
  background: var(--sb-badge) center / contain no-repeat;
  animation: k-pop-in 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

@media (max-height: 620px) {
  .lob-p-name .lob-h::before,
  .lob-p-join .lob-h::before {
    display: none;
  }

  .lob-p-level .lob-h::before {
    width: 52px;
    height: 56px;
    margin-bottom: 6px;
  }
}

/* ---------- Экономия на телефоне ---------- */

/* На уменьшенном поле ничего не движется: его всё равно не разглядеть. */
.ocean.mini .wave,
.ocean.mini .fl,
.ocean.mini .smoke,
.ocean.mini .sh-ember,
.ocean.mini .ship-body,
.ocean.mini .mark.dead::after,
.ocean.mini .ship.wreck::after {
  animation: none !important;
}

/* Страница в фоне: всё бесконечное стоит. */
.app.paused *,
.app.paused *::before,
.app.paused *::after {
  animation-play-state: paused !important;
}

/* ---------- Справка ---------- */

.help-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 100%;
  margin-top: 14px;
  text-align: left;
}

.help-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-ico {
  position: relative;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--water-own);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -3px 0 rgba(0, 30, 110, 0.22), 0 3px 0 #0b56b8;
}

.help-ico > * {
  position: absolute;
}

.help-ico .ship-art {
  left: 4%;
  top: 27%;
  width: 92%;
  height: 46%;
}

.help-ico .xhair {
  left: 14%;
  top: 14%;
  width: 72%;
  height: 72%;
}

.help-ico .fire {
  left: 50%;
  top: 56%;
}

.help-ico .mark {
  left: 5px;
  top: 5px;
  width: 40px;
  height: 40px;
  transform: none;
}

.help-ico.spin .ship-art {
  transform: rotate(-38deg);
}

.help-row b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 20px;
}

.help-row span {
  display: block;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 17px;
}

@media (max-height: 620px) {
  .help-list {
    gap: 7px;
    margin-top: 8px;
  }

  .help-ico {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .help-ico .mark {
    left: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
  }

  .help-row b {
    font-size: 14.5px;
    line-height: 17px;
  }

  .help-row span {
    font-size: 12.5px;
    line-height: 15px;
  }
}

/* ---------- Итог партии: звёзды, рекорд ---------- */

.sb-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 6px 0 0;
}

/* Звёзды вбиваются по одной. */
.res-star {
  width: 50px;
  height: 50px;
  overflow: visible;
  animation: sb-star-in 0.34s cubic-bezier(0.3, 1.2, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 250ms + 320ms);
}

.res-star:nth-child(2) {
  width: 62px;
  height: 62px;
  margin-top: -8px;
}

.res-star.off {
  opacity: 0.4;
  filter: grayscale(1) brightness(0.55);
}

@keyframes sb-star-in {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  60% { transform: scale(1.28) rotate(6deg); opacity: 1; }
  100% { transform: scale(1); }
}

.lob-result.lob-win .over-title.solo {
  margin-top: 2px;
}

.sb-flag {
  display: inline-block;
  height: 26px;
  margin-top: 12px !important;
  padding: 0 12px;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), 0 2px 0 #c97b00;
  color: #5a3100;
  font-size: 14px;
  font-weight: 800;
  line-height: 26px;
  animation: k-nudge 0.4s 1.1s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}

/* Поражение: заголовок холодный, серо-голубой, с тёмной кромкой — как золотой у победы. */
.lob-result.lob-lose .over-title.solo {
  color: #c4d6f2;
  font-size: 32px;
  line-height: 36px;
  text-shadow:
    0 2px 0 #f2f7ff,
    0 5px 0 #2a4580,
    0 10px 18px rgba(var(--shade-rgb), 0.6);
}

/* Рисунок поражения: наш корабль, накренившись, уходит под воду; над ним дым. */
.sb-lost {
  position: relative;
  flex: none;
  width: 200px;
  height: 78px;
  margin: 0 auto 8px;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
}

.sb-lost.small {
  margin: -13px auto -5px;
  transform: scale(0.7);
}

.sb-lost-ship {
  position: absolute;
  left: 30px;
  top: 20px;
  width: 150px;
  height: 50px;
  transform: rotate(-15deg);
  transform-origin: 40% 50%;
  animation: sb-lost-bob 2.8s ease-in-out infinite alternate;
}

.sb-lost-ship .ship-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes sb-lost-bob {
  from { transform: rotate(-16deg) translateY(-2px); }
  to { transform: rotate(-12deg) translateY(4px); }
}

.sb-lost-sea {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 36px;
  opacity: 0.96;
}

.sb-lost-smoke {
  position: absolute;
  left: 120px;
  top: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(190, 200, 222, 0.6);
  opacity: 0;
  animation: sb-smoke 2.4s ease-out infinite;
}

.sb-lost-smoke.s2 {
  left: 86px;
  top: 26px;
  animation-delay: 1.2s;
}

/* «Посмотреть поле»: окно итога убрано, осталась кнопка возврата. */
.over.sb-peek {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}

.over.sb-peek .card {
  display: none;
}

/* «К итогу» и строка «партия окончена» стоят на причале, на месте строки хода: поле они не закрывают. */
.dock-status .sb-unpeek {
  flex: none;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 16px;
  white-space: nowrap;
}

.dock-status .sb-unpeek span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Область нажатия не меньше 44 px и там, где кнопка ниже (низкий причал). */
.dock-status .sb-unpeek::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 46px;
  margin-top: -23px;
}

.sb-ended {
  animation: k-nudge 0.36s cubic-bezier(0.3, 1.8, 0.5, 1);
}

/* Низкий причал (флот и строка хода столбиком рядом с уменьшенным полем): кнопка ниже. */
@media (max-height: 689px) {
  .app:not(.wide) .dock-status .sb-unpeek {
    height: 34px;
    padding: 0 14px;
    border-radius: 13px;
    font-size: 14.5px;
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #0b56b8;
  }
}

@media (max-height: 620px) {
  .app:not(.wide) .dock-status .sb-unpeek {
    height: 30px;
    font-size: 13.5px;
  }
}

@media (min-height: 690px) and (max-height: 799px) and (max-width: 879px) {
  .app[data-lob-mode="online"] .dock-status .sb-unpeek {
    height: 34px;
    padding: 0 14px;
    border-radius: 13px;
    font-size: 14.5px;
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #0b56b8;
  }
}

/* ---------- Меньше движения ---------- */

@media (prefers-reduced-motion: reduce) {
  .smoke,
  .finger,
  .sb-lost-smoke,
  .ship.wreck::after {
    display: none;
  }
}
