/* Инфографика: один общий заголовок, три равных модуля; реальные силуэты самолётов — смысловые якоря. */
.ng-score {
  max-inline-size: calc(var(--colw) + var(--fl) + var(--fr));
}

.ng-score figcaption {
  margin: 0 0 var(--p-s);
}

.ng-score figcaption > span,
.ng-score figcaption strong {
  display: block;
}

.ng-score figcaption > span {
  margin-block-start: 0;
  color: var(--mute);
  font-size: var(--t-small);
  line-height: var(--l-small);
}

.ng-score figcaption strong {
  max-inline-size: var(--colw);
  margin-block-start: 0.2em;
  font-size: var(--p-text);
  font-weight: 500;
  line-height: var(--p-s);
}

.ng-score ol {
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0 clamp(16px, 4vw, 64px);
}

.ng-score li {
  display: grid;
  grid-template-rows: clamp(52px, 8vw, 86px) auto auto;
  place-items: end center;
  padding-block-start: clamp(12px, 2vw, 24px);
  text-align: center;
}

.ng-score-plane {
  display: block;
  block-size: clamp(42px, 6vw, 68px);
  inline-size: auto;
  color: var(--mute);
  fill: currentcolor;
}

.ng-score b {
  margin-block-start: 0.18em;
  font-size: clamp(48px, 8.5vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.ng-score li > span {
  margin-block-start: 0.45em;
}

.ng-score .ng-us .ng-score-plane {
  color: #fff;
}

/* Упаковка и характеристики остаются частью истории, но игра завершает страницу. */
.ng-details {
  padding-block-start: calc(2 * var(--p-s));
  border-block-start: 1px solid #2a2a2a;
}

.ng-details .sp-img {
  max-inline-size: calc(560px + var(--fl) + var(--fr));
}

/* Игра. Над экраном — подсказка клавиш и второстепенные кнопки (пауза, звук): в стороне от пульта, чтобы не задеть их
   в игре. Под экраном на сенсорных экранах — пульт: крупные цели, движение под левым большим пальцем, огонь — под правым.
   Кнопки отделены от фона заливкой, без рамок. Экран вместе с пультом помещается в окно под шапкой. */
.ng-game {
  max-inline-size: calc(var(--colw) + var(--fl) + var(--fr));
  margin: 0 auto calc(3 * var(--p-s));
  padding-inline: var(--fl) var(--fr);
}

.ng-game-title {
  margin: 0 0 var(--p-s);
  font-size: var(--t-big);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.ng-game-machine {
  --ng-header: 110px; /* шапка сайта, с запасом */
  --ng-chrome: 64px; /* строка над экраном и промежутки */
  --ng-pad-size: 64px;
  --ng-key-fill: #222; /* заливка кнопок пульта */
  --ng-key-pressed: #484848;
  --ng-gap: 8px;

  max-inline-size: min(var(--colw), 840px);
  color: #fff;
  user-select: none;
  -webkit-touch-callout: none;
}

@supports (height: 100svh) {
  .ng-game-machine {
    max-inline-size: min(var(--colw), 840px, max(280px, calc((100svh - var(--ng-header) - var(--ng-chrome)) * 0.8)));
  }
}

.ng-game-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  min-block-size: 44px;
  margin-block-end: var(--ng-gap);
}

.ng-game-keys {
  margin: 0;
  color: var(--mute);
  font-size: var(--t-small);
  line-height: var(--l-small);
}

.ng-game-keys b {
  color: #fff;
  font-weight: 400;
}

.ng-game-options {
  display: flex;
  flex: none;
  margin-inline-start: auto;
}

.ng-game-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #000;
}

.ng-game-canvas {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  outline: none;
  touch-action: none;
}

.ng-game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  padding: 24px;
  background: rgb(0 0 0 / 78%);
  text-align: center;
}

/* до начала игры экран не затемнён: строй ходит, табло горит — сразу видно, что это игра. Кнопка — в пустой полосе
   между строем и Т-50; на паузе и после игры экран, как прежде, затемнён под надписью */
.ng-game-machine[data-state='idle'] .ng-game-overlay {
  align-content: start;
  padding-block-start: 76%; /* доля ширины: при экране 4 : 5 это около 60 % высоты — под рядом F-35 */
  background: none;
}

.ng-game-machine[data-state='idle'] .ng-game-message {
  display: none;
}

.ng-game-overlay[hidden] {
  display: none;
}

/* надпись — моноширинным, как табло игры на холсте */
.ng-game-message {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ng-game button {
  min-block-size: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.ng-game button:disabled {
  opacity: 0.28;
  cursor: default;
}

.ng-game button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* главная кнопка — белой заливкой: на тёмном экране сразу видно, что это кнопка */
.ng-game .ng-game-start-button {
  min-block-size: 48px;
  padding-inline: 28px;
  background: #fff;
  color: #000;
  font-size: var(--t-text);
  font-weight: 500;
}

.ng-game .ng-game-icon-button {
  display: grid;
  place-items: center;
  inline-size: 44px;
  padding: 10px;
  color: #b8c0ca;
}

.ng-game-icon-button svg {
  display: block;
  inline-size: 24px;
  block-size: 24px;
  fill: currentcolor;
}

.ng-game-pause .ng-icon-play,
.ng-game-sound .ng-icon-muted {
  display: none;
}

.ng-game-pause[data-state='paused'] .ng-icon-pause,
.ng-game-sound[aria-pressed='false'] .ng-icon-waves {
  display: none;
}

.ng-game-pause[data-state='paused'] .ng-icon-play,
.ng-game-sound[aria-pressed='false'] .ng-icon-muted {
  display: block;
}

.ng-game-sound .ng-icon-waves,
.ng-game-sound .ng-icon-muted {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-width: 2;
}

/* пульт: «влево» и «вправо» — по четверти ширины, «Огонь» — половина */
.ng-game-pad {
  display: none;
  grid-template-columns: 1fr 1fr 2fr;
  gap: var(--ng-gap);
  margin-block-start: var(--ng-gap);
}

.ng-game .ng-game-pad button {
  min-block-size: var(--ng-pad-size);
  background: var(--ng-key-fill);
  font-size: 28px;
  touch-action: none;
}

.ng-game .ng-game-pad button.is-pressed {
  background: var(--ng-key-pressed);
}

.ng-game .ng-game-pad .ng-game-fire {
  font-size: var(--t-text);
  font-weight: 500;
}

.ng-game-status {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ng-game-noscript {
  margin-block-start: var(--p-s);
}

@media (hover: hover) {
  .ng-game button:not(:disabled):hover {
    opacity: 0.68;
  }

  .ng-game .ng-game-icon-button:not(:disabled):hover {
    color: #fff;
    opacity: 1;
  }
}

/* сенсорный экран: клавиш нет — вместо подсказки пульт под экраном */
@media (pointer: coarse) {
  .ng-game-machine {
    --ng-header: 64px;
    --ng-chrome: calc(64px + var(--ng-pad-size) + var(--ng-gap) + 16px);
  }

  .ng-game-keys {
    display: none;
  }

  .ng-game-pad {
    display: grid;
  }
}

@media (max-width: 639.98px) {
  .ng-game {
    padding-inline: 0;
  }

  .ng-game-title {
    margin-inline: var(--fl) var(--fr);
  }

  /* на телефоне — на одной оси с заголовком; на низком экране ширину экрана игры ограничивает высота окна */
  .ng-game-machine {
    padding-inline: var(--fl) var(--fr);
  }
}

@media (max-width: 479.98px) {
  .ng-score ol {
    gap: 0 14px;
  }

  .ng-score b {
    font-size: clamp(46px, 16vw, 64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ng-game button {
    transition: none;
  }
}
