/* Общая оболочка standalone Penalty Rush. */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #0a0e1e;
  font-family: "Courier New", monospace;
  color: #e8e8f0;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

#stage {
  position: relative;
  width: 100vw;
  width: var(--app-vw, 100vw);
  height: 100vh;
  height: 100dvh;
  height: var(--app-vh, 100dvh);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  background: #0a0e1e;
}

#game {
  --pr-safe-top: env(safe-area-inset-top, 0px);
  --pr-safe-left: env(safe-area-inset-left, 0px);
  --pr-safe-right: env(safe-area-inset-right, 0px);
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #0a0e1e;
  touch-action: none;
}

/* Во встроенной карточке внешний вертикальный скролл должен работать на меню
   и финалке. Полный перехват оставляем только на активный забег с drag-перчатками. */
body.surface-embedded-card:not(.mode-gk) #stage,
body.surface-embedded-card:not(.mode-gk) #game {
  touch-action: pan-y;
}

body.surface-embedded-card.mode-gk #stage,
body.surface-embedded-card.mode-gk #game {
  touch-action: none;
}

body.surface-embedded-card #stage {
  align-items: stretch;
  justify-content: flex-start;
}

body.surface-embedded-card #game {
  height: min(56.25vw, calc(var(--app-vh, 100dvh) - 82px));
  min-height: 190px;
  max-height: 100%;
  object-position: center top;
}

@media (orientation: landscape) {
  body.surface-embedded-card.presentation-expanded #stage {
    align-items: center;
    justify-content: center;
  }

  body.surface-embedded-card.presentation-expanded #game {
    width: min(var(--app-vw, 100vw), var(--app-game-w-16-9, 177.7778dvh));
    height: min(var(--app-vh, 100dvh), var(--app-game-h-16-9, 56.25vw));
    min-height: 0;
    object-position: center center;
  }
}

body.surface-embedded-card.presentation-expanded.layout-landscape #stage {
  align-items: center;
  justify-content: center;
}

body.surface-embedded-card.presentation-expanded.layout-landscape #game {
  width: min(var(--app-vw, 100vw), var(--app-game-w-16-9, 177.7778dvh));
  height: min(var(--app-vh, 100dvh), var(--app-game-h-16-9, 56.25vw));
  min-height: 0;
  object-position: center center;
}

body.surface-embedded-card.presentation-expanded.layout-landscape.mode-gk #game {
  width: min(var(--app-vw, 100vw), var(--app-game-w-16-9-controls, 177.7778dvh));
  height: min(var(--app-game-h-16-9-controls, calc(100dvh - 72px)), var(--app-game-h-16-9, 56.25vw));
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell {
  background: #050814;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #stage {
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--app-forced-landscape-w, 100dvh);
  height: var(--app-forced-landscape-h, 100vw);
  max-width: none;
  max-height: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #game {
  width: min(var(--app-forced-landscape-w, 100dvh), var(--app-forced-game-w-16-9-controls, 177.7778vw));
  height: min(var(--app-forced-landscape-h, 100vw), var(--app-forced-game-h-16-9-controls, calc(100vw - 72px)));
  min-height: 0;
  object-position: center center;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(6, 10, 26, 0.58), rgba(6, 10, 26, 0.88)),
    radial-gradient(90% 70% at 50% 18%, rgba(255, 224, 0, 0.12), rgba(6, 10, 26, 0) 62%);
}

.hidden { display: none !important; }

.top-controls {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  z-index: 12;
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-switch { display: flex; gap: 6px; }

.lang-btn,
.sound-btn {
  font-family: inherit;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  min-height: 34px;
  padding: 6px 11px;
  background: #1a2138;
  color: #aeb8d4;
  border: 2px solid #303850;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
}

.sound-btn { min-width: 104px; }
.lang-btn:hover,
.sound-btn:hover { color: #ffffff; border-color: #4a5478; }
.lang-btn.active,
.sound-btn[aria-pressed="true"] { background: #ffe000; color: #0b1224; border-color: #ffffff; }

body.surface-embedded-card .top-controls {
  left: calc(env(safe-area-inset-left, 0px) + 10px);
  right: auto;
}

.yr-menu {
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
  padding: 0 16px;
}

.yr-logo {
  font-size: 72px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #ffe000;
  text-shadow: 5px 5px 0 #c03020, 10px 10px 0 #1840a0;
  line-height: 0.95;
}

.legal-links {
  position: absolute;
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 12;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 10px;
}

.legal-links a {
  color: #8f9ac0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-links a:active { color: #ffffff; }

.btn {
  font-family: inherit;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 2px;
  min-height: 48px;
  padding: 12px 22px;
  background: #1840a0;
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  transition: transform 0.05s, background 0.12s;
}

.btn:hover:not(:disabled) { background: #2858d0; transform: translate(-1px, -1px); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn.expand-btn {
  display: none;
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  z-index: 18;
  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0;
  border-width: 2px;
  box-shadow: 2px 2px 0 #000;
  background: rgba(24, 64, 160, 0.92);
}

body.surface-embedded-card .btn.expand-btn { display: flex; }
body.surface-embedded-card.presentation-expanded .btn.expand-btn { display: none !important; }

body.surface-embedded-card.mode-gk .btn.expand-btn {
  top: min(58vw, calc(var(--app-vh, 100dvh) - 74px));
  right: calc(env(safe-area-inset-right, 0px) + 12px);
}
.btn-big { width: 100%; font-size: 17px; padding: 15px 26px; }
.btn-cta { width: min(360px, 88vw); font-size: 24px; padding: 22px 26px; letter-spacing: 3px; }
.btn-accent { background: #b02058; border-color: #ffe000; }
.btn-accent:hover:not(:disabled) { background: #d83070; }

.menu-endless-btn {
  width: min(360px, 88vw);
  min-height: 58px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #ffffff;
  background: #202945;
  border-color: #65749a;
}

.menu-endless-btn strong { font-size: 14px; letter-spacing: 1.5px; }
.menu-endless-btn small {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: #b9c3dc;
}

#screen-gk-end {
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(255, 224, 0, 0.08), rgba(4, 8, 20, 0) 60%),
    rgba(5, 9, 22, 0.82);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

.panel {
  background: linear-gradient(180deg, rgba(19, 28, 56, 0.94) 0%, rgba(12, 18, 40, 0.94) 100%);
  border: 3px solid #ffe000;
  box-shadow: 6px 6px 0 #000, 0 0 0 100vmax rgba(4, 8, 20, 0.18);
  padding: 32px 42px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.panel.gk-end { width: min(380px, 92vw); }

/* Двухшаговый финал на ВСЕХ платформах (не только embedded-card):
   result-шаг прячет лидерборд, leaders-шаг прячет hero-блок результата.
   Иначе результат и полный лидерборд с табами вываливаются одной простынёй. */
#screen-gk-end[data-end-step="result"] .leaderboard { display: none; }

#screen-gk-end[data-end-step="leaders"] .gk-end-glove,
#screen-gk-end[data-end-step="leaders"] .gk-end-rank,
#screen-gk-end[data-end-step="leaders"] .gk-end-scorebox,
#screen-gk-end[data-end-step="leaders"] .gk-end-record,
#screen-gk-end[data-end-step="leaders"] .gk-end-stats,
#screen-gk-end[data-end-step="leaders"] .gk-end-next,
#screen-gk-end[data-end-step="leaders"] .gk-end-killer,
#screen-gk-end[data-end-step="leaders"] .gk-end-nearmiss,
#screen-gk-end[data-end-step="leaders"] .gk-end-achievements,
#screen-gk-end[data-end-step="leaders"] .gk-player-rank,
#screen-gk-end[data-end-step="leaders"] .end-status,
#screen-gk-end[data-end-step="leaders"] #gk-leaders {
  display: none;
}

/* Компактный инфо-блок между статами и CTA: мелкий кегль, плотные отступы —
   PLAY AGAIN не должен уезжать под фолд. */
.gk-end-killer,
.gk-end-nearmiss,
.gk-end-next,
.gk-player-rank {
  font-size: 11px;
  line-height: 1.35;
  min-height: 0;
}

.gk-player-rank { color: #80e890; letter-spacing: 1px; }
.gk-end-glove {
  width: 78px;
  height: 78px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.6));
}

.gk-end-rank {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 4px;
  color: #80f0ff;
  text-shadow: 2px 2px 0 #000;
}

.gk-end-scorebox { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gk-end-score {
  font-size: 72px;
  font-weight: bold;
  line-height: 0.9;
  color: #fff;
  text-shadow: 4px 4px 0 #000, 0 0 22px rgba(255, 224, 0, 0.35);
}

.gk-end-score-cap { font-size: 12px; letter-spacing: 4px; color: #8090b0; }
.gk-end-record {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #0b1224;
  background: #ffe000;
  padding: 5px 14px;
  box-shadow: 3px 3px 0 #000;
  animation: gk-record-pulse 0.9s ease-in-out infinite;
}

@keyframes gk-record-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .gk-end-record { animation: none; }
}

.gk-end-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 2px 0 4px;
}

.gk-end-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid #28304c;
}

.gk-end-stat-v { font-size: 22px; font-weight: bold; color: #ffe000; }
.gk-end-stat-l { font-size: 9px; letter-spacing: 2px; color: #8090b0; }
/* Информационная строка (best score и т.п.) — нейтральный цвет, не «успех» */
.end-status { font-size: 11px; color: #8f9ac0; min-height: 14px; }
.end-buttons { display: flex; flex-direction: column; gap: 14px; align-items: center; width: 100%; }
.leaderboard {
  width: 100%;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.12);
}

.leaderboard-title {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #ffe000;
  margin-bottom: 8px;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  font-size: 11px;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
}

.leaderboard-list li.is-player {
  background: rgba(255, 224, 0, 0.1);
  border-color: rgba(255, 224, 0, 0.55);
}

.leaderboard-list li.lb-gap {
  display: block;
  min-height: 12px;
  padding: 0;
  background: transparent;
  border: none;
  text-align: center;
  color: #5f6a8c;
  line-height: 12px;
}

.leaderboard-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

.leaderboard-flag {
  flex: 0 0 auto;
  font-family: system-ui, sans-serif;
  letter-spacing: 0;
  line-height: 1;
}

.leaderboard-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: #ffe000;
  font-weight: bold;
}

.leaderboard-rank,
.leaderboard-wave {
  color: #8f9ac0;
}

.leaderboard-empty,
.leaderboard-loading {
  display: block !important;
  text-align: center !important;
  color: #8f9ac0;
}

/* Статусы шера/лидерборда: зелёный «успех» вводил в заблуждение на ошибках
   («Could not share» зелёным) — нейтральный серо-голубой. */
.leaderboard-status {
  min-height: 16px;
  margin-top: 6px;
  font-size: 11px;
  color: #aeb8d4;
}

.end-exit {
  font-family: inherit;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  color: #8a92b0;
  background: none;
  border: none;
  padding: 6px 10px;
  margin-top: 2px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.end-exit:hover { color: #ffffff; }

#touch-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#touch-overlay.hidden { display: none !important; }
body:not(.is-touch) #touch-overlay { display: none !important; }

.touch-joy-zone {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 45%;
  pointer-events: auto;
  touch-action: none;
}

#touch-overlay.touch-mode-gk .touch-joy-zone {
  width: 100%;
}

#touch-overlay.touch-mode-gk .touch-joy-base {
  display: none !important;
}

.touch-joy-base {
  position: absolute;
  width: 124px;
  height: 124px;
  margin-left: -62px;
  margin-top: -62px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.touch-joy-base.hidden { display: none; }
.touch-joy-knob {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 224, 0, 0.85);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  will-change: transform;
}

.touch-actions {
  position: absolute;
  right: calc(env(safe-area-inset-right, 0px) + 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  width: 184px;
  height: 184px;
  pointer-events: none;
}

.touch-btn {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  font-family: inherit;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 1px;
  color: #ffffff;
  background: rgba(24, 64, 160, 0.78);
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn.dim { opacity: 0.4; }
.touch-btn.pressed { transform: scale(0.9); background: rgba(40, 88, 208, 0.95); }
.touch-btn-shoot,
.touch-btn-pass,
.touch-btn-lob { width: 76px; height: 76px; }
.touch-btn-shoot { right: 0; top: 54px; background: rgba(200, 48, 32, 0.82); }
.touch-btn-pass { left: 0; top: 54px; background: rgba(64, 160, 80, 0.82); }
.touch-btn-lob { left: 54px; top: 0; }
.touch-btn-switch {
  position: absolute;
  right: calc(env(safe-area-inset-right, 0px) + 210px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 34px);
  width: 64px;
  height: 64px;
  font-size: 12px;
  background: rgba(48, 56, 80, 0.82);
}

body.surface-embedded-card #touch-overlay.touch-mode-gk .touch-actions {
  left: auto;
  right: calc(env(safe-area-inset-right, 0px) + 18px);
  top: min(calc(56.25vw - 70px), calc(var(--app-vh, 100dvh) - 152px));
  bottom: auto;
  width: 56px;
  height: 56px;
  transform: none;
}

body.surface-embedded-card #touch-overlay.touch-mode-gk .touch-btn-pass {
  left: 0;
  top: 0;
  width: 56px;
  height: 56px;
  border-width: 2px;
  font-size: 9px;
  letter-spacing: 1px;
}

body.surface-embedded-card.presentation-expanded.layout-landscape #touch-overlay.touch-mode-gk .touch-actions {
  left: auto;
  right: max(18px, calc((var(--app-vw, 100vw) - var(--app-game-w-16-9-controls, 177.7778dvh)) / 2 + 18px));
  top: auto;
  bottom: max(18px, calc((var(--app-vh, 100dvh) - var(--app-game-h-16-9-controls, calc(100dvh - 72px))) / 2 + 18px));
  width: 56px;
  height: 56px;
  transform: none;
}

body.surface-embedded-card.presentation-expanded.layout-landscape #touch-overlay.touch-mode-gk .touch-btn-pass {
  width: 56px;
  height: 56px;
  font-size: 9px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #touch-overlay.touch-mode-gk .touch-actions {
  left: auto;
  right: max(18px, calc((var(--app-forced-landscape-w, 100dvh) - var(--app-forced-game-w-16-9-controls, 177.7778vw)) / 2 + 18px));
  top: max(18px, calc((var(--app-forced-landscape-h, 100vw) - var(--app-forced-game-h-16-9-controls, calc(100vw - 72px))) / 2 + 18px));
  bottom: auto;
  width: 56px;
  height: 56px;
  transform: none;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #touch-overlay.touch-mode-gk .touch-btn-pass {
  width: 56px;
  height: 56px;
  font-size: 9px;
}

#rotate-notice {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(6, 10, 26, 0.96);
  text-align: center;
}

.rotate-ico { font-size: 64px; color: #ffe000; animation: rotate-spin 2.4s linear infinite; }
.rotate-text { font-size: 18px; font-weight: bold; letter-spacing: 2px; line-height: 1.6; }
.rotate-text span { font-size: 12px; font-weight: normal; color: #80e890; letter-spacing: 1px; }
@keyframes rotate-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .yr-logo { font-size: 50px; text-shadow: 3px 3px 0 #c03020, 6px 6px 0 #1840a0; }
  .top-controls { left: 12px; right: 12px; justify-content: space-between; }
  .btn-cta { font-size: 20px; }
}

@media (max-height: 480px) {
  .top-controls { top: calc(env(safe-area-inset-top, 0px) + 8px); }
  .yr-menu { gap: 18px; }
  .yr-logo { font-size: 46px; }
  .btn-cta { padding: 16px 20px; }
  .player-profile { width: min(330px, 82vw); gap: 3px; }
  .profile-line { min-height: 14px; }
  .profile-controls { grid-template-columns: minmax(0, 1fr) 104px 38px; gap: 5px; }
  .profile-name,
  .profile-country,
  .profile-save { min-height: 26px; font-size: 10px; }
  .profile-status { display: none; }
  .panel { padding: 16px 28px; gap: 7px; }
  .gk-end-glove { width: 36px; height: 36px; }
  .gk-end-score { font-size: 46px; }
  .gk-end-rank { font-size: 18px; letter-spacing: 3px; }
  .gk-end-score-cap { font-size: 10px; }
  .gk-end-record { font-size: 12px; padding: 4px 12px; }
  .gk-end-stats { gap: 8px; margin: 0; }
  .gk-end-stat { padding: 6px 4px; }
  .gk-end-stat-v { font-size: 17px; }
  .end-buttons { gap: 8px; }
  .btn-big { padding: 10px; }
}

@media (max-height: 400px) {
  .gk-end-glove { display: none; }
  .gk-end-score { font-size: 40px; }
}

@media (max-height: 480px) {
  body.surface-embedded-card.presentation-expanded .panel.gk-end {
    width: min(760px, calc(var(--app-vw, 100vw) - 36px));
    height: min(306px, calc(var(--app-vh, 100dvh) - 34px));
    max-height: calc(var(--app-vh, 100dvh) - 34px);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 158px 176px minmax(210px, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: 16px;
    row-gap: 7px;
    align-items: center;
    overflow: hidden;
    text-align: left;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-glove,
  body.surface-embedded-card.presentation-expanded .end-status,
  body.surface-embedded-card.presentation-expanded .end-exit {
    display: none;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-rank {
    grid-column: 1;
    grid-row: 1;
    font-size: 16px;
    letter-spacing: 2px;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-scorebox {
    grid-column: 1;
    grid-row: 2;
    align-items: flex-start;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-score {
    font-size: 54px;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-score-cap {
    font-size: 9px;
    letter-spacing: 2px;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-record {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    font-size: 10px;
    padding: 3px 8px;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-stats {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    gap: 5px;
    margin: 0;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-record:not(.hidden) + .gk-end-stats {
    display: flex;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-stat {
    padding: 4px 3px;
    gap: 1px;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-stat-v {
    font-size: 15px;
  }

  body.surface-embedded-card.presentation-expanded .gk-end-stat-l {
    font-size: 7px;
    letter-spacing: 1px;
  }

  body.surface-embedded-card.presentation-expanded .end-buttons {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    gap: 10px;
  }

  body.surface-embedded-card.presentation-expanded .btn-big {
    min-height: 50px;
    padding: 10px 12px;
    font-size: 14px;
    letter-spacing: 2px;
  }

  body.surface-embedded-card.presentation-expanded .leaderboard {
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: stretch;
    margin: 0;
    padding: 0 0 0 14px;
    border-top: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
  }

  body.surface-embedded-card.presentation-expanded .leaderboard-title {
    margin-bottom: 6px;
    font-size: 10px;
  }

  body.surface-embedded-card.presentation-expanded .leaderboard-list {
    gap: 4px;
    font-size: 10px;
  }

  body.surface-embedded-card.presentation-expanded .leaderboard-list li {
    grid-template-columns: 22px 1fr auto auto;
    gap: 5px;
    min-height: 22px;
    padding: 3px 5px;
  }

  body.surface-embedded-card.presentation-expanded .leaderboard-list li:nth-child(n+4):not(.lb-extra) {
    display: none;
  }
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .panel.gk-end {
  width: min(760px, calc(var(--app-forced-landscape-w, 100dvh) - 44px));
  height: min(306px, calc(var(--app-forced-landscape-h, 100vw) - 38px));
  max-height: calc(var(--app-forced-landscape-h, 100vw) - 38px);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 158px 176px minmax(210px, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
  row-gap: 7px;
  align-items: center;
  overflow: hidden;
  text-align: left;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-glove,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .end-status,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .end-exit {
  display: none;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-rank {
  grid-column: 1;
  grid-row: 1;
  font-size: 16px;
  letter-spacing: 2px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-scorebox {
  grid-column: 1;
  grid-row: 2;
  align-items: flex-start;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-score {
  font-size: 54px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-score-cap {
  font-size: 9px;
  letter-spacing: 2px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-record {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  font-size: 10px;
  padding: 3px 8px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stats {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  gap: 5px;
  margin: 0;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-record:not(.hidden) + .gk-end-stats {
  display: flex;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stat {
  padding: 4px 3px;
  gap: 1px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stat-v {
  font-size: 15px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stat-l {
  font-size: 7px;
  letter-spacing: 1px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .end-buttons {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  gap: 10px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .btn-big {
  min-height: 50px;
  padding: 10px 12px;
  font-size: 14px;
  letter-spacing: 2px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard {
  grid-column: 3;
  grid-row: 1 / 4;
  align-self: stretch;
  margin: 0;
  padding: 0 0 0 14px;
  border-top: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-title {
  margin-bottom: 6px;
  font-size: 10px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-list {
  gap: 4px;
  font-size: 10px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-list li {
  grid-template-columns: 22px 1fr auto auto;
  gap: 5px;
  min-height: 22px;
  padding: 3px 5px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-list li:nth-child(n+4):not(.lb-extra) {
  display: none;
}

body.surface-embedded-card #screen-gk-end {
  justify-content: center;
}

body.surface-embedded-card .panel.gk-end {
  width: min(360px, calc(var(--app-vw, 100vw) - 32px));
  max-height: calc(var(--app-vh, 100dvh) - 28px);
  padding: 18px 22px;
  gap: 8px;
  overflow: hidden;
}

body.surface-embedded-card .gk-end-glove {
  display: block;
  width: 46px;
  height: 46px;
}

body.surface-embedded-card .gk-end-rank {
  font-size: 18px;
  letter-spacing: 3px;
}

body.surface-embedded-card .gk-end-score {
  font-size: 52px;
}

body.surface-embedded-card .gk-end-score-cap {
  font-size: 10px;
  letter-spacing: 3px;
}

body.surface-embedded-card .gk-end-record {
  font-size: 12px;
  padding: 4px 12px;
}

body.surface-embedded-card .gk-end-stats {
  gap: 7px;
  margin: 0;
}

body.surface-embedded-card .gk-end-stat {
  padding: 6px 4px;
}

body.surface-embedded-card .gk-end-stat-v {
  font-size: 17px;
}

body.surface-embedded-card .end-status {
  display: none;
}

body.surface-embedded-card .end-buttons {
  gap: 8px;
}

body.surface-embedded-card .btn-big {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 14px;
}

body.surface-embedded-card .leaderboard {
  margin-top: 2px;
  padding-top: 8px;
}

body.surface-embedded-card .leaderboard-title {
  margin-bottom: 6px;
  font-size: 10px;
}

body.surface-embedded-card .leaderboard-list {
  gap: 4px;
  font-size: 10px;
}

body.surface-embedded-card .leaderboard-list li {
  grid-template-columns: 22px 1fr auto auto;
  min-height: 22px;
  padding: 3px 5px;
  gap: 5px;
}

body.surface-embedded-card .leaderboard-list li:nth-child(n+6):not(.lb-extra) {
  display: none;
}

body.surface-embedded-card .leaderboard-status {
  display: none;
}

body.surface-embedded-card .end-exit {
  display: none;
}

@media (max-height: 620px) {
  body.surface-embedded-card .panel.gk-end {
    padding: 14px 18px;
    gap: 6px;
  }

  body.surface-embedded-card .gk-end-glove {
    width: 40px;
    height: 40px;
  }

  body.surface-embedded-card .gk-end-score {
    font-size: 46px;
  }

  body.surface-embedded-card .leaderboard {
    padding-top: 6px;
  }
}

body.surface-embedded-card.presentation-expanded .panel.gk-end {
  position: relative;
  width: min(720px, calc(var(--app-vw, 100vw) - 36px));
  height: min(322px, calc(var(--app-vh, 100dvh) - 36px));
  max-height: calc(var(--app-vh, 100dvh) - 36px);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 182px 166px minmax(196px, 1fr);
  grid-template-rows: 44px 1fr auto auto;
  column-gap: 16px;
  row-gap: 6px;
  align-items: center;
  overflow: hidden;
  text-align: left;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .panel.gk-end {
  width: min(720px, calc(var(--app-forced-landscape-w, 100dvh) - 42px));
  height: min(322px, calc(var(--app-forced-landscape-h, 100vw) - 42px));
  max-height: calc(var(--app-forced-landscape-h, 100vw) - 42px);
}

body.surface-embedded-card.presentation-expanded .gk-end-glove,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-glove {
  display: block;
  grid-column: 1;
  grid-row: 1;
  width: 42px;
  height: 42px;
  justify-self: start;
  align-self: center;
}

body.surface-embedded-card.presentation-expanded .gk-end-rank,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-rank {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  margin-left: 50px;
  font-size: 15px;
  letter-spacing: 2px;
}

body.surface-embedded-card.presentation-expanded .gk-end-scorebox,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-scorebox {
  grid-column: 1;
  grid-row: 2;
  align-items: flex-start;
}

body.surface-embedded-card.presentation-expanded .gk-end-score,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-score {
  font-size: 56px;
}

body.surface-embedded-card.presentation-expanded .gk-end-score-cap,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-score-cap {
  font-size: 9px;
  letter-spacing: 2px;
}

body.surface-embedded-card.presentation-expanded .gk-end-record,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-record {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  font-size: 10px;
  padding: 3px 8px;
}

body.surface-embedded-card.presentation-expanded .gk-end-stats,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stats {
  grid-column: 1;
  grid-row: 4;
  gap: 5px;
  margin: 0;
}

body.surface-embedded-card.presentation-expanded .gk-end-record:not(.hidden) + .gk-end-stats,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-record:not(.hidden) + .gk-end-stats {
  display: flex;
}

body.surface-embedded-card.presentation-expanded .gk-end-stat,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stat {
  padding: 4px 3px;
  gap: 1px;
}

body.surface-embedded-card.presentation-expanded .gk-end-stat-v,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stat-v {
  font-size: 15px;
}

body.surface-embedded-card.presentation-expanded .gk-end-stat-l,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .gk-end-stat-l {
  font-size: 7px;
  letter-spacing: 1px;
}

body.surface-embedded-card.presentation-expanded .end-buttons,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .end-buttons {
  grid-column: 2;
  grid-row: 1 / 5;
  align-self: center;
  gap: 10px;
}

body.surface-embedded-card.presentation-expanded .btn-big,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .btn-big {
  min-height: 52px;
  padding: 10px 12px;
  font-size: 14px;
  letter-spacing: 2px;
}

body.surface-embedded-card.presentation-expanded .leaderboard,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard {
  grid-column: 3;
  grid-row: 1 / 5;
  align-self: stretch;
  margin: 0;
  padding: 0 0 0 14px;
  border-top: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

body.surface-embedded-card.presentation-expanded .leaderboard-title,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-title {
  margin-bottom: 8px;
  font-size: 10px;
}

body.surface-embedded-card.presentation-expanded .leaderboard-list,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-list {
  gap: 5px;
  font-size: 10px;
}

body.surface-embedded-card.presentation-expanded .leaderboard-list li,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-list li {
  grid-template-columns: 22px 1fr auto auto;
  min-height: 24px;
  padding: 4px 5px;
  gap: 5px;
}

body.surface-embedded-card.presentation-expanded .leaderboard-list li:nth-child(n+4):not(.lb-extra),
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .leaderboard-list li:nth-child(n+4):not(.lb-extra) {
  display: none;
}

body.surface-embedded-card #screen-gk-end[data-end-step="result"] .leaderboard,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-glove,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-rank,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-scorebox,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-record,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-stats,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-next,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-killer,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-nearmiss,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-end-achievements,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .gk-player-rank,
body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] #gk-leaders {
  display: none !important;
}

body.surface-embedded-card .gk-player-rank {
  min-height: 18px;
  color: #80e890;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
}

body.surface-embedded-card #screen-gk-end[data-end-step="result"] .panel.gk-end {
  display: flex;
  width: min(360px, calc(var(--app-vw, 100vw) - 32px));
  height: auto;
  max-height: calc(var(--app-vh, 100dvh) - 28px);
  padding: 14px 22px 12px;
  gap: 6px;
  text-align: center;
}

body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .panel.gk-end {
  display: flex;
  width: min(360px, calc(var(--app-vw, 100vw) - 32px));
  height: auto;
  max-height: calc(var(--app-vh, 100dvh) - 28px);
  padding: 16px 18px;
  gap: 10px;
  text-align: center;
}

body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .leaderboard {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .end-buttons {
  order: 2;
  flex-direction: row;
  gap: 8px;
}

body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .btn-big {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 11px;
  letter-spacing: 1px;
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.leaderboard-back {
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 1px;
  color: #aeb8d4;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 7px;
  cursor: pointer;
}

.leaderboard-me {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
  padding: 7px 8px;
  background: rgba(255, 224, 0, 0.12);
  border: 2px solid rgba(255, 224, 0, 0.68);
  box-shadow: 2px 2px 0 #000;
  text-align: left;
}

.leaderboard-me-rank,
.leaderboard-me-score {
  color: #ffe000;
  font-weight: bold;
}

.leaderboard-me-label,
.leaderboard-me-wave {
  color: #aeb8d4;
}

.leaderboard-me-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

body.surface-embedded-card #screen-gk-end[data-end-step="leaders"] .leaderboard-list li:nth-child(n+6):not(.lb-extra) {
  display: none;
}

body.surface-embedded-card.presentation-expanded.layout-landscape #touch-overlay.touch-mode-gk .touch-actions {
  left: auto;
  right: max(20px, calc((var(--app-vw, 100vw) - var(--app-game-w-16-9-controls, 177.7778dvh)) / 2 + 24px));
  top: auto;
  bottom: max(20px, calc((var(--app-vh, 100dvh) - var(--app-game-h-16-9-controls, calc(100dvh - 72px))) / 2 + 24px));
  width: 56px;
  height: 56px;
  transform: none;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #touch-overlay.touch-mode-gk .touch-actions {
  left: auto;
  right: max(20px, calc((var(--app-forced-landscape-w, 100dvh) - var(--app-forced-game-w-16-9-controls, 177.7778vw)) / 2 + 24px));
  top: auto;
  bottom: max(20px, calc((var(--app-forced-landscape-h, 100vw) - var(--app-forced-game-h-16-9-controls, calc(100vw - 72px))) / 2 + 24px));
  width: 56px;
  height: 56px;
  transform: none;
}

body.surface-embedded-card.presentation-expanded.layout-landscape #touch-overlay.touch-mode-gk .touch-btn-pass,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #touch-overlay.touch-mode-gk .touch-btn-pass {
  width: 56px;
  height: 56px;
  font-size: 9px;
}

body.surface-embedded-card.presentation-expanded #screen-gk-end[data-end-step="result"] .panel.gk-end,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .panel.gk-end {
  width: min(380px, calc(var(--app-forced-landscape-w, var(--app-vw, 100vw)) - 40px));
  max-height: calc(var(--app-forced-landscape-h, var(--app-vh, 100dvh)) - 40px);
}

body.surface-embedded-card.presentation-expanded #screen-gk-end[data-end-step="leaders"] .panel.gk-end,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .panel.gk-end {
  width: min(430px, calc(var(--app-forced-landscape-w, var(--app-vw, 100vw)) - 44px));
  max-height: calc(var(--app-forced-landscape-h, var(--app-vh, 100dvh)) - 44px);
}

/* --- UX-пасс embedded-card: иконка звука, меню-витрина, иерархия финальных CTA. ---
   Новые классы использует только разметка с соответствующими элементами. */

.sound-btn-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sound-btn-icon[aria-pressed="true"] {
  background: #1a2138;
  color: #e8e8f0;
  border-color: #4a5478;
}

.menu-best {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffe000;
  text-shadow: 1px 1px 0 #000;
}

.menu-hint {
  min-height: 13px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #8f9ac0;
}

.menu-lb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  max-width: 100%;
}

.menu-teaser {
  font-size: 11px;
  letter-spacing: 1px;
  color: #aeb8d4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-leaders-btn {
  font-family: inherit;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 1px;
  flex-shrink: 0;
  padding: 6px 11px;
  background: #1a2138;
  color: #aeb8d4;
  border: 2px solid #303850;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
}

.menu-leaders-btn:hover { color: #ffffff; border-color: #4a5478; }
.menu-leaders-btn.active { background: #ffe000; color: #0b1224; border-color: #ffffff; }

body.portal-fast-start #screen-menu .menu-lb-row {
  max-width: min(360px, 86vw);
}

body.portal-fast-start #screen-menu #btn-leaderboard,
body.portal-fast-start #screen-menu #btn-achievements,
body.portal-fast-start #screen-menu #menu-leaderboard,
body.portal-fast-start #screen-menu #menu-achievements,
body.portal-fast-start #screen-menu .profile-controls,
body.portal-fast-start #screen-menu .profile-status {
  display: none !important;
}

body.portal-fast-start #screen-menu .menu-user {
  width: min(320px, 78vw);
  color: #8f9ac0;
}

.menu-leaderboard {
  width: min(320px, 86vw);
}

.menu-user {
  width: min(360px, 86vw);
  font-size: 10px;
  letter-spacing: 1px;
  color: #5f6a8c;
}

.player-profile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.profile-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 16px;
  color: #aeb8d4;
}

.profile-flag {
  min-width: 16px;
  font-family: system-ui, sans-serif;
  letter-spacing: 0;
  line-height: 1;
}

.profile-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 42px;
  gap: 6px;
  align-items: stretch;
}

.profile-name,
.profile-country,
.profile-save {
  min-width: 0;
  min-height: 30px;
  font-family: inherit;
  font-size: 11px;
  border: 2px solid #303850;
  background: rgba(10, 14, 30, 0.82);
  color: #e8e8f0;
  box-shadow: 2px 2px 0 #000;
}

.profile-name {
  padding: 5px 8px;
}

.profile-name:disabled {
  color: #aeb8d4;
  opacity: 0.82;
}

.profile-country {
  padding: 4px 5px;
  letter-spacing: 0;
}

.profile-save {
  font-weight: bold;
  cursor: pointer;
  background: #1a2138;
  color: #ffe000;
}

.profile-save:disabled {
  opacity: 0.55;
  cursor: default;
}

.profile-status {
  min-height: 12px;
  color: #80e890;
}

body.surface-embedded-card .yr-menu { gap: 13px; }

body.surface-embedded-card .yr-logo {
  font-size: 34px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #c03020, 4px 4px 0 #1840a0;
}

body.surface-embedded-card .btn-cta {
  font-size: 18px;
  padding: 14px 20px;
}

body.surface-embedded-card.presentation-expanded .yr-logo {
  font-size: 46px;
  text-shadow: 3px 3px 0 #c03020, 6px 6px 0 #1840a0;
}

.end-secondary {
  display: flex;
  gap: 10px;
  width: 100%;
}

.end-secondary .btn-big { flex: 1; }

body.surface-embedded-card.presentation-expanded .end-secondary {
  flex-direction: column;
  gap: 8px;
}

.btn-secondary { background: #222c4a; border-color: #aeb8d4; }
.btn-secondary:hover:not(:disabled) { background: #2c3860; }

/* Вторичная кнопка подписки: заметная, но не конкурирует с PLAY AGAIN */
.btn-subscribe {
  width: 100%;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #aeb8d4;
  border-color: #3f9c62;
}

.gk-end-next {
  min-height: 14px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #8f9ac0;
}

body.surface-embedded-card.presentation-expanded .gk-end-next { display: none; }

/* «Тебя выбил: ЭЛЬ КУРВО · волна 21» — личный обидчик */
.gk-end-killer {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ff8a3d;
}

/* «2× до сэйва не хватило <10px» — топливо для реванша */
.gk-end-nearmiss {
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffe000;
}

/* Полоса новых ачивок на end-screen */
.gk-end-achievements {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.gk-end-ach {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffd700;
  background: #1a2138;
  border: 1px solid #4a5478;
  padding: 4px 8px;
  box-shadow: 2px 2px 0 #000;
}

/* Панель ачивок в меню */
.ach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(320px, 86vw);
  max-height: min(240px, 42vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: #131a30;
  border: 1px solid #262f4c;
  opacity: 0.55;
  text-align: left;
}

.ach-item.is-unlocked {
  opacity: 1;
  background: #1a2138;
  border-color: #4a5478;
}

.ach-icon { font-size: 16px; flex-shrink: 0; }

.ach-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ach-name {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #dbe6ff;
}

.ach-item.is-unlocked .ach-name { color: #ffd700; }

.ach-desc {
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #8f9ac0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ach-pct {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #4bd37b;
}

.leaderboard-tabs {
  display: flex;
  gap: 6px;
}

.lb-tab {
  font-family: inherit;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 1px;
  color: #aeb8d4;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 8px;
  cursor: pointer;
}

.lb-tab.active {
  background: #ffe000;
  color: #0b1224;
  border-color: #ffe000;
}

.gk-end-record {
  animation:
    record-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1),
    record-pulse 1.8s ease-in-out 0.6s infinite;
}

@keyframes record-pop {
  0% { transform: scale(0.3); opacity: 0; }
  65% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes record-pulse {
  50% { box-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 224, 0, 0.75); }
}

/* --- Низкий landscape (телефон горизонтально): вертикальная колонка меню и
   финалки не влезает (~360px) — переходим на двухколоночные сетки.
   Реальный landscape ловим media max-height + layout-landscape; forced shell
   (повернутый #stage) — media max-width + force-landscape-shell, потому что
   физический viewport там портретный и max-height не сработает. --- */

@media (max-height: 480px) {
  body.surface-embedded-card.layout-landscape .yr-menu {
    gap: 7px;
    padding: 0 12px;
  }

  body.surface-embedded-card.layout-landscape .yr-logo {
    font-size: 26px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #c03020, 4px 4px 0 #1840a0;
  }

  body.surface-embedded-card.layout-landscape #btn-play {
    width: min(280px, 60vw);
    font-size: 16px;
    padding: 10px 16px;
    min-height: 42px;
  }

  body.surface-embedded-card.layout-landscape #menu-hint { font-size: 10px; min-height: 11px; }
  body.surface-embedded-card.layout-landscape .menu-leaderboard { width: min(340px, 60vw); }
  body.surface-embedded-card.layout-landscape .menu-leaderboard li:nth-child(n+4) { display: none; }
  body.surface-embedded-card.layout-landscape .menu-user { font-size: 9px; }
}

@media (max-width: 480px) {
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .yr-menu {
    gap: 7px;
    padding: 0 12px;
  }

  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .yr-logo {
    font-size: 26px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #c03020, 4px 4px 0 #1840a0;
  }

  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #btn-play {
    width: 280px;
    max-width: 100%;
    font-size: 16px;
    padding: 10px 16px;
    min-height: 42px;
  }

  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #menu-hint { font-size: 10px; min-height: 11px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .menu-leaderboard { width: 340px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .menu-leaderboard li:nth-child(n+4) { display: none; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell .menu-user { font-size: 9px; }
}

/* Result-шаг финалки в низком landscape: слева ранг/счёт/статы, справа кнопки. */

@media (max-height: 440px) {
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .panel.gk-end {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "rank buttons"
      "score buttons"
      "record buttons"
      "stats buttons"
      "meta buttons"
      "place buttons";
    align-items: center;
    justify-items: start;
    column-gap: 20px;
    row-gap: 6px;
    width: min(640px, calc(var(--app-vw, 100vw) - 28px));
    height: auto;
    max-height: calc(var(--app-vh, 100dvh) - 16px);
    padding: 14px 20px;
    text-align: left;
    overflow: hidden;
  }

  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-glove {
    display: block;
    grid-area: rank;
    width: 34px;
    height: 34px;
    justify-self: start;
    align-self: center;
  }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-rank { grid-area: rank; margin-left: 44px; font-size: 16px; letter-spacing: 2px; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-scorebox { grid-area: score; align-items: flex-start; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-score { font-size: 44px; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-record { grid-area: record; font-size: 11px; padding: 3px 10px; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-stats { grid-area: stats; width: auto; gap: 6px; margin: 0; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-stat { padding: 5px 9px; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-next { grid-area: meta; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .gk-player-rank { grid-area: place; text-align: left; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .end-buttons {
    grid-area: buttons;
    justify-self: stretch;
    align-self: center;
    gap: 8px;
  }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .end-secondary { flex-direction: row; gap: 8px; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="result"] .btn-big { min-height: 46px; padding: 9px 10px; font-size: 14px; }

  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="leaders"] .panel.gk-end {
    width: min(430px, calc(var(--app-vw, 100vw) - 28px));
    max-height: calc(var(--app-vh, 100dvh) - 16px);
    padding: 12px 16px;
    gap: 8px;
  }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="leaders"] .leaderboard-me { display: none; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="leaders"] .leaderboard-list li:nth-child(n+4):not(.lb-extra) { display: none; }
  body.surface-embedded-card.layout-landscape #screen-gk-end[data-end-step="leaders"] .btn-big { min-height: 38px; padding: 7px 9px; font-size: 11px; }
}

@media (max-width: 440px) {
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .panel.gk-end {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "rank buttons"
      "score buttons"
      "record buttons"
      "stats buttons"
      "meta buttons"
      "place buttons";
    align-items: center;
    justify-items: start;
    column-gap: 20px;
    row-gap: 6px;
    width: min(640px, calc(var(--app-forced-landscape-w, 100dvh) - 28px));
    height: auto;
    max-height: calc(var(--app-forced-landscape-h, 100vw) - 16px);
    padding: 14px 20px;
    text-align: left;
    overflow: hidden;
  }

  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-glove {
    display: block;
    grid-area: rank;
    width: 34px;
    height: 34px;
    justify-self: start;
    align-self: center;
  }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-rank { grid-area: rank; margin-left: 44px; font-size: 16px; letter-spacing: 2px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-scorebox { grid-area: score; align-items: flex-start; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-score { font-size: 44px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-record { grid-area: record; font-size: 11px; padding: 3px 10px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-stats { grid-area: stats; width: auto; gap: 6px; margin: 0; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-stat { padding: 5px 9px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-next { grid-area: meta; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-player-rank { grid-area: place; text-align: left; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .end-buttons {
    grid-area: buttons;
    justify-self: stretch;
    align-self: center;
    gap: 8px;
  }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .end-secondary { flex-direction: row; gap: 8px; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .btn-big { min-height: 46px; padding: 9px 10px; font-size: 14px; }

  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .panel.gk-end {
    width: min(430px, calc(var(--app-forced-landscape-w, 100dvh) - 28px));
    max-height: calc(var(--app-forced-landscape-h, 100vw) - 16px);
    padding: 12px 16px;
    gap: 8px;
  }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .leaderboard-me { display: none; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .leaderboard-list li:nth-child(n+4):not(.lb-extra) { display: none; }
  body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .btn-big { min-height: 38px; padding: 7px 9px; font-size: 11px; }
}

/* --- «Дека» под канвасом в портретной карточке: мёртвая чёрная зона под
   16:9-полем превращается в явный тачпад (drag-зона и так покрывает весь stage
   через touch-mode-gk — дека лишь делает это видимым), а CATCH уезжает с поля
   вниз-вправо, в зону большого пальца. Только embedded inline portrait + touch. --- */

.gk-deck { display: none; }

.gk-deck-hint {
  transition: opacity 300ms ease-out;
}

body.tutorial-completing .gk-deck-hint {
  opacity: 0;
}

body.tutorial-complete .gk-deck-hint {
  display: none !important;
}

/* Первый запуск: короткая карточка перед интерактивным тренировочным ударом. */
.gk-coach-card {
  position: absolute;
  z-index: 72;
  left: 50%;
  top: 50%;
  width: min(390px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  padding: 22px;
  color: #fff;
  text-align: center;
  font: 700 13px/1.45 "Courier New", monospace;
  background: rgba(5, 10, 25, 0.96);
  border: 2px solid #80e8ff;
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.72);
}

.gk-coach-card strong {
  display: block;
  margin-bottom: 8px;
  color: #ffe000;
  font-size: 20px;
}

.gk-coach-card p { margin: 0 auto 18px; max-width: 330px; }
.gk-coach-device { margin-bottom: 8px; color: #80e8ff; font-size: 30px; }
.gk-coach-actions { display: flex; justify-content: center; gap: 10px; }
.gk-coach-actions button,
.coach-replay-btn {
  min-height: 42px;
  padding: 8px 12px;
  color: #fff;
  font: 700 11px/1.2 "Courier New", monospace;
  background: #182342;
  border: 1px solid #80e8ff;
}
.gk-coach-actions #coach-continue { color: #071022; background: #ffe000; border-color: #fff; }
.coach-replay-btn { width: auto; margin: 8px auto 0; }
.settings-panel .coach-replay-btn { width: 100%; }
body.surface-embedded-card .embedded-settings-panel {
  position: absolute;
  top: 43px;
  left: 0;
  width: 210px;
  padding: 10px;
  background: rgba(5, 10, 25, 0.96);
  border: 2px solid #80e8ff;
  box-shadow: 4px 4px 0 #000;
}

@media (prefers-reduced-motion: reduce) {
  .gk-coach-card *, .gk-coach-device { animation: none !important; transition: none !important; }
}

/* Канвас в портретной inline-карточке заполняет весь стейдж: рендерер синхронно
   наращивает логическую высоту (GKRenderer._syncViewport), поэтому fill не искажает.
   Сцена всегда занимает верхние 56.25vw, ниже — нарисованный фартук. */
body.cap-portrait-layout.layout-portrait:not(.presentation-expanded) #game {
  height: 100%;
  max-height: none;
  min-height: 0;
  object-fit: fill;
  object-position: center top;
}

body.cap-portrait-layout.is-touch.mode-gk.layout-portrait:not(.presentation-expanded) .gk-deck {
  position: absolute;
  /* Низ сцены публикует рендерер (--pr-scene-bottom): сцена в полном портрете
     опущена «шапкой» неба, статический 56.25vw — только фолбэк. */
  top: var(--pr-scene-bottom, 56.25vw);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* Фон и HUD рисует канвас (фартук); здесь только аффорданс тач-зоны. */
  padding-top: 12.5vw;
}

body.cap-portrait-layout.mode-gk.layout-portrait:not(.presentation-expanded) .btn.expand-btn {
  /* Ниже HUD-строки фартука (~12.5vw), чтобы не тереться с текстом LIVES/WAVE. */
  top: calc(var(--pr-scene-bottom, 56.25vw) + 13vw);
}

.gk-deck-pad {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 180ms ease-out;
}

/* До первого касания пунктирный круг спокойно обозначает drag-поверхность.
   Затем его заменяет динамический ghost-якорь в последней точке пальца. */
body.gk-touch-anchor-seen .gk-deck-pad {
  opacity: 0;
}

.gk-deck-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 224, 0, 0.4);
  animation: deck-drift 3.2s ease-in-out infinite;
}

@keyframes deck-drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-11px, 4px); }
  50% { transform: translate(0, -8px); }
  75% { transform: translate(11px, 4px); }
}

.gk-deck-hint {
  max-width: 78%;
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.5;
  text-align: center;
  color: #6f7ca0;
}

/* В GK стандартный виртуальный стик скрыт. Для portrait-capability возвращаем
   только его тихую визуальную оболочку: во время драга она чуть заметнее, после
   отпускания остаётся призрачным пунктирным якорем в последней точке касания. */
body.cap-portrait-layout.layout-portrait:not(.presentation-expanded).mode-gk
  #touch-overlay.touch-mode-gk .touch-joy-base {
  display: flex !important;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  margin-top: -29px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 68%);
  box-shadow: 0 0 0 1px rgba(4, 9, 23, 0.22);
  opacity: 0.46;
  transition: opacity 180ms ease-out;
}

body.cap-portrait-layout.layout-portrait:not(.presentation-expanded).mode-gk
  #touch-overlay.touch-mode-gk .touch-joy-base.hidden {
  display: none !important;
}

body.cap-portrait-layout.layout-portrait:not(.presentation-expanded).mode-gk
  #touch-overlay.touch-mode-gk .touch-joy-base.touch-joy-anchor {
  opacity: 0.24;
}

body.cap-portrait-layout.layout-portrait:not(.presentation-expanded).mode-gk
  #touch-overlay.touch-mode-gk .touch-joy-knob {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 224, 0, 0.34);
  box-shadow: none;
}

/* CATCH в портретной карточке: вниз-вправо, крупнее — раньше висел на кромке
   поля и перекрывал ворота. */
body.cap-portrait-layout.layout-portrait:not(.presentation-expanded) #touch-overlay.touch-mode-gk .touch-actions {
  left: auto;
  right: calc(env(safe-area-inset-right, 0px) + 20px);
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  width: 72px;
  height: 72px;
  transform: none;
}

body.cap-portrait-layout.layout-portrait:not(.presentation-expanded) #touch-overlay.touch-mode-gk .touch-btn-pass {
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  border-width: 3px;
  font-size: 11px;
  letter-spacing: 1px;
}

/* ---------- Режим для левшей (ключ lefty в localStorage): кнопка ЛОВИТЬ слева ----------
   Джойстик-зона в GK — весь экран (драг перчаток), сторона не важна; зеркалим
   только кластер кнопок. Блок в КОНЦЕ файла, чтобы горизонталь (left/right)
   перебивала все embedded/expanded-оверрайды выше; top/bottom не трогаем —
   их выставляют исходные правила. */
#touch-overlay.lefty .touch-actions,
body.surface-embedded-card #touch-overlay.touch-mode-gk.lefty .touch-actions {
  right: auto;
  left: calc(env(safe-area-inset-left, 0px) + 18px);
}
#touch-overlay.lefty .touch-btn-shoot { right: auto; left: 0; }
#touch-overlay.lefty .touch-btn-pass { left: auto; right: 0; }
#touch-overlay.lefty .touch-btn-switch {
  right: auto;
  left: calc(env(safe-area-inset-left, 0px) + 210px);
}
body.cap-portrait-layout.layout-portrait:not(.presentation-expanded) #touch-overlay.touch-mode-gk.lefty .touch-actions {
  right: auto;
  left: calc(env(safe-area-inset-left, 0px) + 20px);
}
body.surface-embedded-card.presentation-expanded.layout-landscape #touch-overlay.touch-mode-gk.lefty .touch-actions {
  right: auto;
  left: max(20px, calc((var(--app-vw, 100vw) - var(--app-game-w-16-9-controls, 177.7778dvh)) / 2 + 24px));
}
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #touch-overlay.touch-mode-gk.lefty .touch-actions {
  right: auto;
  left: max(20px, calc((var(--app-forced-landscape-w, 100dvh) - var(--app-forced-game-w-16-9-controls, 177.7778vw)) / 2 + 24px));
}

/* Чип-переключатель в меню — виден только на тач-устройствах */
body:not(.is-touch) .lefty-btn { display: none !important; }

/* ---------- iOS: стартовый экран и финал ----------
   iOS-разметка помечена surface-ios, поэтому этот UX-пасс не меняет другие
   платформенные сборки. Общая механика и canvas остаются прежними. */

body.surface-ios #screen-menu {
  justify-content: flex-start;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(5, 9, 22, 0.12) 0%, rgba(5, 9, 22, 0.28) 37%, rgba(5, 9, 22, 0.88) 63%, #050916 100%);
}

body.surface-ios .top-controls {
  left: 50%;
  right: auto;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  transform: translateX(-50%);
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(143, 154, 192, 0.22);
  background: rgba(5, 9, 22, 0.74);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}

body.surface-ios .lang-switch { gap: 4px; }

body.surface-ios .lang-btn,
body.surface-ios .sound-btn {
  width: 40px;
  min-width: 40px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8ddeb;
  border-color: #4a5478;
  background: #151d34;
  box-shadow: 2px 2px 0 #000;
}

body.surface-ios .lang-btn.active,
body.surface-ios .sound-btn[aria-pressed="true"] {
  color: #ffffff;
  border-color: #80e8ff;
  background: #24345a;
}

body.surface-ios .lefty-btn {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body.surface-ios.layout-portrait .yr-menu {
  position: absolute;
  top: clamp(150px, 19dvh, 186px);
  width: min(390px, calc(100vw - 24px));
  padding: 0;
  gap: 10px;
}

body.surface-ios .menu-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

body.surface-ios.layout-portrait .menu-hero-copy {
  /* Оставляем CTA на привычной высоте, а свободный промежуток отдаём сцене:
     ворота и перчатки читаются целиком между тайтлом и кнопкой. */
  margin-bottom: clamp(132px, 18dvh, 160px);
}

body.surface-ios .yr-logo {
  max-width: 100%;
  color: #f7f3e8;
  font-size: clamp(34px, 10vw, 43px);
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 3px 3px 0 #c03020, 6px 6px 0 #1840a0;
}

body.surface-ios .menu-best {
  min-height: 16px;
  font-size: 12px;
}

body.surface-ios .menu-hint {
  box-sizing: border-box;
  width: min(360px, calc(100vw - 32px));
  min-height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0;
}

body.surface-ios .menu-user {
  width: min(360px, calc(100vw - 32px));
  min-height: 16px;
  color: #aeb8d4;
}

body.surface-ios .menu-retention {
  box-sizing: border-box;
  width: min(360px, calc(100vw - 28px));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(28, 38, 70, 0.92), rgba(14, 21, 43, 0.94));
  border: 2px solid #4a5478;
  box-shadow: 4px 4px 0 #000;
}

body.surface-ios.layout-portrait .menu-retention {
  margin-top: clamp(54px, 10dvh, 90px);
}

body.surface-ios .menu-retention-head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

body.surface-ios .menu-retention-title {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #80e8ff;
  text-transform: uppercase;
}

body.surface-ios .menu-teaser {
  min-width: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  letter-spacing: 0;
  color: #c5cce0;
}

body.surface-ios .menu-lb-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.surface-ios .menu-leaders-btn {
  min-width: 0;
  min-height: 58px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #ffffff;
  background: #253154;
  border-color: #7381aa;
  text-align: left;
}

body.surface-ios .menu-leaders-btn:active,
body.surface-ios .menu-leaders-btn.active {
  color: #ffffff;
  background: #31436f;
  border-color: #80e8ff;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

body.surface-ios .menu-action-icon {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

body.surface-ios .menu-action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.surface-ios .menu-action-copy strong {
  font-size: 11px;
  letter-spacing: 1px;
}

body.surface-ios .menu-action-copy small {
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 9px;
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: 0;
  color: #b8c2dd;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.surface-ios .menu-progress-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.surface-ios .menu-progress-stat {
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  color: #b8c2dd;
  background: rgba(5, 9, 22, 0.58);
  border: 1px solid #4a5478;
}

body.surface-ios .menu-progress-stat strong {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 13px;
  color: #80e8ff;
}

body.surface-ios .menu-retention .menu-leaderboard,
body.surface-ios .menu-retention .ach-list {
  width: 100%;
  max-height: min(126px, 19dvh);
}

body.surface-ios .legal-links {
  gap: 13px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  flex-wrap: nowrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  letter-spacing: -0.1px;
}

body.surface-ios .gk-end-summary,
body.surface-ios .gk-end-details {
  display: contents;
}

@media (max-height: 700px) and (orientation: portrait) {
  body.surface-ios.layout-portrait .yr-menu {
    top: clamp(132px, 19dvh, 150px);
    gap: 7px;
  }

  body.surface-ios.layout-portrait .menu-hero-copy {
    margin-bottom: clamp(116px, 20dvh, 140px);
  }

  body.surface-ios .yr-logo { font-size: 34px; }
  body.surface-ios .btn-cta { padding-top: 16px; padding-bottom: 16px; }
  body.surface-ios .menu-retention { padding: 8px; gap: 6px; }
  body.surface-ios.layout-portrait .menu-retention {
    margin-top: 28px;
  }
  body.surface-ios .menu-progress-strip { display: none; }
  body.surface-ios .menu-leaders-btn { min-height: 50px; padding: 6px 7px; }
  body.surface-ios .menu-action-copy small { display: none; }
  body.surface-ios .legal-links { font-size: 9px; gap: 10px; }
}

/* Стартовый экран горизонтально: витрина слева, retention-блок справа. */
@media (max-height: 520px) and (orientation: landscape) {
  body.surface-ios.layout-landscape #screen-menu {
    justify-content: center;
    padding:
      max(10px, env(safe-area-inset-top, 0px))
      max(18px, env(safe-area-inset-right, 0px))
      max(24px, env(safe-area-inset-bottom, 0px))
      max(18px, env(safe-area-inset-left, 0px));
  }

  body.surface-ios.layout-landscape .top-controls {
    left: max(16px, env(safe-area-inset-left, 0px));
    top: max(10px, env(safe-area-inset-top, 0px));
    transform: none;
  }

  body.surface-ios.layout-landscape .yr-menu {
    width: min(760px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 36px));
    padding: 12px 0 0;
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
    grid-template-areas:
      "hero retention"
      "play retention"
      "hint retention"
      "user retention";
    column-gap: 28px;
    row-gap: 8px;
  }

  body.surface-ios.layout-landscape .menu-hero-copy { grid-area: hero; margin: 0; }
  body.surface-ios.layout-landscape .yr-logo { font-size: 38px; }
  body.surface-ios.layout-landscape #btn-play { grid-area: play; width: 100%; }
  body.surface-ios.layout-landscape #menu-hint { grid-area: hint; width: 100%; }
  body.surface-ios.layout-landscape #menu-user { grid-area: user; width: 100%; }
  body.surface-ios.layout-landscape .menu-retention { grid-area: retention; width: 100%; }
  body.surface-ios.layout-landscape .legal-links { font-size: 9px; }
}

/* ---------- Result V3: мотиватор повтора, прогресс и празднование. ---------- */

#screen-gk-end {
  padding: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: rgba(3, 8, 20, 0.76);
  overflow: hidden;
}

#screen-gk-end[data-end-step="result"] .panel.gk-end {
  box-sizing: border-box;
  width: min(430px, calc(100vw - 20px));
  height: min(740px, calc(100dvh - 20px));
  max-height: none;
  padding: clamp(12px, 2dvh, 18px);
  display: grid;
  grid-template-areas: "summary" "details" "actions" "exit";
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(8px, 1.4dvh, 12px);
  align-content: stretch;
  overflow: hidden;
}

#screen-gk-end[data-end-step="result"] .gk-end-summary {
  grid-area: summary;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

#screen-gk-end[data-end-step="result"] .gk-end-details {
  grid-area: details;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

#screen-gk-end[data-end-step="result"] .end-buttons { grid-area: actions; }
#screen-gk-end[data-end-step="result"] .end-exit { grid-area: exit; margin: 0; }

.gk-end-motivator,
.gk-end-progress-tier {
  width: 100%;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

.gk-end-motivator {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(11, 22, 48, 0.92);
  border: 1px solid rgba(128, 232, 255, 0.32);
}

.gk-end-progress-tier {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(5, 12, 28, 0.68);
  border: 1px solid rgba(115, 129, 170, 0.34);
}

.gk-end-record-gap,
.gk-end-rank-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gk-progress-title,
.gk-rank-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.gk-rank-progress-head {
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 10px;
  color: #d8def0;
}

.gk-rank-progress-head span:last-child { color: #80e8ff; text-align: right; }

.gk-progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  overflow: hidden;
  background: #121a30;
  border: 1px solid #4a5478;
  box-shadow: inset 1px 1px 0 #000;
}

.gk-progress-track > span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ffe000, #ff8a3d);
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gk-end-rank-progress .gk-progress-track > span {
  background: linear-gradient(90deg, #4bd37b, #80e8ff);
}

.gk-progress-caption {
  min-height: 12px;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 9px;
  line-height: 1.2;
  color: #99a5c6;
  text-align: right;
}

#screen-gk-end .gk-end-record {
  margin: 0;
  padding: 7px 10px;
  font-size: 13px;
  color: #091126;
  background: #ffe000;
  border: 0;
  box-shadow: 3px 3px 0 #000;
}

#screen-gk-end.is-new-record .gk-end-score {
  color: #ffffff;
  font-size: clamp(62px, 18vw, 82px);
  text-shadow: 3px 3px 0 #c03020, 6px 6px 0 #1840a0;
}

#screen-gk-end .gk-end-killer,
#screen-gk-end .gk-end-nearmiss,
#screen-gk-end .gk-player-rank,
#screen-gk-end .end-status {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.28;
  letter-spacing: 0;
}

#screen-gk-end .gk-end-nearmiss {
  color: #ffe88a;
  padding: 0;
  border: 0;
  background: none;
}

#screen-gk-end .gk-end-achievements {
  position: relative;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

#screen-gk-end .gk-end-achievements[data-count="2"],
#screen-gk-end .gk-end-achievements[data-count="3"] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

#screen-gk-end .gk-end-achievements[data-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#screen-gk-end .gk-end-ach-heading {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 800 9px/1.1 system-ui, -apple-system, sans-serif;
  color: #ffe000;
  letter-spacing: 0.8px;
}

#screen-gk-end .gk-end-ach-heading strong {
  min-width: 17px;
  padding: 2px 5px;
  color: #081127;
  background: #ffe000;
  border: 1px solid #ffffff;
  box-shadow: 1px 1px 0 #000;
  font: 900 9px/1 ui-monospace, Menlo, Monaco, monospace;
}

#screen-gk-end .gk-end-ach {
  min-width: 0;
  padding: 5px 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon kicker" "icon name";
  align-items: center;
  column-gap: 8px;
  color: #ffffff;
  background: rgba(35, 48, 83, 0.94);
  border: 1px solid #7381aa;
  box-shadow: 2px 2px 0 #000;
  transition: padding 280ms ease, flex-basis 280ms ease;
}

#screen-gk-end .gk-end-ach.is-featured { flex: 1 1 100%; padding: 8px 10px; }
.gk-end-ach-icon { grid-area: icon; font-family: system-ui, sans-serif; font-size: 26px; }
.gk-end-ach-kicker { grid-area: kicker; font: 800 9px/1.1 system-ui, sans-serif; color: #ffe000; letter-spacing: 0.8px; }
.gk-end-ach-name { grid-area: name; overflow: hidden; font: 700 11px/1.2 system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }

#screen-gk-end .gk-end-ach.is-compact {
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  text-align: center;
}

#screen-gk-end .gk-end-ach.is-compact .gk-end-ach-icon { font-size: 19px; line-height: 1; }
#screen-gk-end .gk-end-ach.is-compact .gk-end-ach-name {
  width: 100%;
  min-height: 20px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 9px;
  line-height: 1.15;
  white-space: normal;
}

#screen-gk-end .gk-end-achievements.is-settled .gk-end-ach.is-featured {
  flex: 1 1 auto;
  padding: 5px 8px;
  grid-template-areas: "icon name";
}

#screen-gk-end .gk-end-achievements.is-settled .gk-end-ach.is-featured .gk-end-ach-kicker { display: none; }
#screen-gk-end .gk-end-achievements.is-settled .gk-end-ach.is-featured .gk-end-ach-icon { font-size: 18px; }

.gk-end-confetti {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.gk-end-confetti span {
  position: absolute;
  left: var(--confetti-x);
  top: -18px;
  width: 8px;
  height: 15px;
  opacity: 0;
  animation: gkConfettiFall 1.7s cubic-bezier(0.18, 0.72, 0.3, 1) var(--confetti-delay) forwards;
}

#screen-gk-end .panel.gk-end { position: relative; z-index: 4; }

#screen-gk-end.is-new-record.has-share .end-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

#screen-gk-end.is-new-record.has-share .end-secondary { display: contents; }
#screen-gk-end.is-new-record.has-share #gk-again { grid-column: 1; grid-row: 1; width: 100%; }
#screen-gk-end.is-new-record.has-share #gk-share-score {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  color: #081127;
  background: #80e8ff;
  border-color: #ffffff;
}
#screen-gk-end.is-new-record.has-share #gk-leaders { grid-column: 1 / -1; grid-row: 2; width: 100%; }

#screen-gk-end.is-result-entering .gk-end-stat,
#screen-gk-end.is-result-entering .gk-end-motivator,
#screen-gk-end.is-result-entering .gk-end-progress-tier,
#screen-gk-end.is-result-entering .end-buttons {
  opacity: 0;
  animation: gkResultEnter 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#screen-gk-end.is-result-entering .gk-end-stat:nth-child(1) { animation-delay: 160ms; }
#screen-gk-end.is-result-entering .gk-end-stat:nth-child(2) { animation-delay: 260ms; }
#screen-gk-end.is-result-entering .gk-end-stat:nth-child(3) { animation-delay: 360ms; }
#screen-gk-end.is-result-entering .gk-end-motivator { animation-delay: 460ms; }
#screen-gk-end.is-result-entering .gk-end-progress-tier { animation-delay: 560ms; }
#screen-gk-end.is-result-entering .end-buttons { animation-delay: 620ms; pointer-events: auto; }
#screen-gk-end.is-result-entering .gk-end-ach.is-featured { animation: gkBadgeReveal 640ms cubic-bezier(0.2, 1.5, 0.4, 1) 720ms both; }

@keyframes gkResultEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gkBadgeReveal {
  from { opacity: 0; transform: scale(0.62) rotate(-3deg); filter: brightness(1.8); }
  to { opacity: 1; transform: scale(1) rotate(0); filter: brightness(1); }
}

@keyframes gkConfettiFall {
  0% { opacity: 0; transform: translate3d(0, -10px, 0) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0.96; transform: translate3d(var(--confetti-drift), 105dvh, 0) rotate(var(--confetti-turn)); }
}

#screen-gk-end[data-end-step="leaders"] .gk-end-summary,
#screen-gk-end[data-end-step="leaders"] .gk-end-details { display: none !important; }

@media (max-height: 700px) and (orientation: portrait) {
  #screen-gk-end[data-end-step="result"] .panel.gk-end { padding: 10px 12px; gap: 7px; }
  #screen-gk-end[data-end-step="result"] .gk-end-summary { gap: 2px; }
  #screen-gk-end[data-end-step="result"] .gk-end-glove { width: 34px; height: 34px; }
  #screen-gk-end[data-end-step="result"] .gk-end-rank { font-size: 16px; }
  #screen-gk-end[data-end-step="result"] .gk-end-score { font-size: 43px; }
  #screen-gk-end[data-end-step="result"].is-new-record .gk-end-score { font-size: 52px; }
  #screen-gk-end[data-end-step="result"] .gk-end-stat { padding: 5px 3px; }
  #screen-gk-end[data-end-step="result"] .gk-end-stat-v { font-size: 16px; }
  #screen-gk-end[data-end-step="result"] .gk-end-motivator,
  #screen-gk-end[data-end-step="result"] .gk-end-progress-tier { padding: 7px 9px; gap: 5px; }
  #screen-gk-end[data-end-step="result"] .btn-big { min-height: 44px; padding: 8px; font-size: 12px; }
}

@media (orientation: landscape) and (max-height: 620px) {
  #screen-gk-end[data-end-step="result"] .panel.gk-end {
    width: min(860px, calc(100vw - 24px));
    height: min(390px, calc(100dvh - 16px));
    padding: 12px 16px;
    grid-template-columns: minmax(250px, 1.05fr) minmax(270px, 0.95fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas: "summary details" "summary actions" "summary exit";
    column-gap: 20px;
    row-gap: 7px;
  }

  #screen-gk-end[data-end-step="result"] .gk-end-summary {
    height: 100%;
    padding-right: 18px;
    justify-content: center;
    border-right: 2px solid rgba(128, 232, 255, 0.18);
  }

  #screen-gk-end[data-end-step="result"] .gk-end-details { justify-content: center; gap: 5px; }
  #screen-gk-end[data-end-step="result"] .gk-end-glove { width: 36px; height: 36px; }
  #screen-gk-end[data-end-step="result"] .gk-end-rank { font-size: 17px; }
  #screen-gk-end[data-end-step="result"] .gk-end-score { font-size: 52px; }
  #screen-gk-end[data-end-step="result"].is-new-record .gk-end-score { font-size: 62px; }
  #screen-gk-end[data-end-step="result"] .gk-end-stats { margin: 2px 0 0; }
  #screen-gk-end[data-end-step="result"] .gk-end-motivator,
  #screen-gk-end[data-end-step="result"] .gk-end-progress-tier { padding: 5px 8px; gap: 4px; }
  #screen-gk-end[data-end-step="result"] .gk-progress-caption { display: none; }
  #screen-gk-end[data-end-step="result"] .gk-player-rank { font-size: 9px; line-height: 1.1; }
  #screen-gk-end[data-end-step="result"] .end-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
  }
  #screen-gk-end[data-end-step="result"] .end-secondary { display: contents; }
  #screen-gk-end[data-end-step="result"] .btn-big {
    width: 100%;
    min-height: 42px;
    padding: 7px 6px;
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  #screen-gk-end[data-end-step="result"] .end-exit { padding: 2px 8px; font-size: 10px; }
}

/* Нативная оболочка может оставить expanded webview физически портретным. В этом
   случае stage уже повёрнут в landscape, но orientation media-query выше не
   срабатывает. Повторяем Result V3 в логических размерах forced shell и
   учитываем дополнительный CTA (Join daily challenge). */
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end {
  box-sizing: border-box;
  padding: 8px 12px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .panel.gk-end {
  box-sizing: border-box;
  width: min(780px, calc(var(--app-forced-landscape-w, 100dvh) - 24px));
  height: min(350px, calc(var(--app-forced-landscape-h, 100vw) - 16px));
  max-height: none;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(230px, 1.12fr) minmax(210px, 0.88fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: "summary details" "summary actions" "summary exit";
  column-gap: 20px;
  row-gap: 7px;
  align-items: center;
  overflow: hidden;
  text-align: center;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-summary {
  grid-area: summary;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding-right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 2px solid rgba(128, 232, 255, 0.18);
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-details {
  grid-area: details;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-glove { width: 36px; height: 36px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-rank { margin-left: 0; font-size: 17px; letter-spacing: 3px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-scorebox { align-items: center; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-score { font-size: 52px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"].is-new-record .gk-end-score { font-size: 62px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-stats { width: 100%; margin: 2px 0 0; gap: 7px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-stat { padding: 5px 4px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-stat-v { font-size: 18px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-motivator,
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-end-progress-tier { padding: 5px 8px; gap: 4px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-progress-caption { display: none; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .gk-player-rank { font-size: 9px; line-height: 1.1; }

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .end-buttons {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .end-secondary { display: contents; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] #gk-again { grid-column: 1; grid-row: 1; width: 100%; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] #gk-share-score { grid-column: 2; grid-row: 1; width: 100%; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] #gk-subscribe { grid-column: 1; grid-row: 2; width: 100%; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] #gk-leaders { grid-column: 2; grid-row: 2; width: 100%; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] #gk-subscribe.hidden + .end-secondary #gk-leaders { grid-column: 1 / -1; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .btn-big {
  min-height: 38px;
  padding: 6px 5px;
  font-size: 9px;
  line-height: 1.1;
  letter-spacing: 0.5px;
}
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .btn-subscribe { font-size: 8px; letter-spacing: 0; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="result"] .end-exit { grid-area: exit; margin: 0; padding: 2px 8px; font-size: 10px; }

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .panel.gk-end {
  box-sizing: border-box;
  width: min(760px, calc(var(--app-forced-landscape-w, 100dvh) - 24px));
  height: min(330px, calc(var(--app-forced-landscape-h, 100vw) - 16px));
  max-height: none;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 190px);
  grid-template-areas: "leaders actions" "leaders exit";
  gap: 8px 16px;
  overflow: hidden;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .leaderboard {
  grid-area: leaders;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
}

body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .leaderboard-list li:nth-child(n+6):not(.lb-extra) { display: none; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .leaderboard-list li:nth-child(-n+5):not(.lb-gap) { display: grid; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .end-buttons { grid-area: actions; display: flex; flex-direction: column; gap: 6px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .end-secondary { display: flex; flex-direction: column; gap: 6px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .btn-big { min-height: 38px; padding: 6px; font-size: 9px; letter-spacing: 0.5px; }
body.surface-embedded-card.presentation-expanded.layout-portrait.force-landscape-shell #screen-gk-end[data-end-step="leaders"] .end-exit { grid-area: exit; margin: 0; padding: 2px 8px; font-size: 9px; }

@media (prefers-reduced-motion: reduce) {
  #screen-gk-end.is-result-entering .gk-end-stat,
  #screen-gk-end.is-result-entering .gk-end-motivator,
  #screen-gk-end.is-result-entering .gk-end-progress-tier,
  #screen-gk-end.is-result-entering .end-buttons,
  #screen-gk-end.is-result-entering .gk-end-ach.is-featured,
  .gk-end-confetti span { animation: none; opacity: 1; transform: none; }
  .gk-progress-track > span { transition: none; }
}

/* Результат горизонтально: score и статы слева, контекст и действия справа. */
@media (max-height: 520px) and (orientation: landscape) {
  body.surface-ios.layout-landscape #screen-gk-end {
    box-sizing: border-box;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px));
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .panel.gk-end {
    box-sizing: border-box;
    width: min(780px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px));
    height: min(350px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px));
    max-height: none;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: minmax(270px, 1.12fr) minmax(240px, 0.88fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "summary details"
      "summary actions"
      "summary exit";
    column-gap: 24px;
    row-gap: 8px;
    align-items: center;
    overflow: hidden;
    text-align: center;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-summary {
    grid-area: summary;
    min-width: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding-right: 20px;
    border-right: 2px solid rgba(128, 232, 255, 0.18);
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-details {
    grid-area: details;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-glove {
    width: 38px;
    height: 38px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-rank {
    font-size: 17px;
    letter-spacing: 3px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-score { font-size: 52px; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-record { font-size: 10px; padding: 4px 10px; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-stats { gap: 7px; margin: 2px 0 0; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-stat { padding: 6px 4px; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-stat-v { font-size: 18px; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-killer,
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-nearmiss,
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-end-next,
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .gk-player-rank,
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .end-status {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: 0;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .end-buttons {
    grid-area: actions;
    gap: 8px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .end-secondary {
    flex-direction: row;
    gap: 8px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .btn-big {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 12px;
    letter-spacing: 1px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="result"] .end-exit {
    grid-area: exit;
    margin: 0;
    padding: 2px 8px;
    font-size: 10px;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .panel.gk-end {
    box-sizing: border-box;
    width: min(760px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px));
    height: min(330px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px));
    padding: 14px 18px;
    display: grid;
    grid-template-columns: minmax(340px, 1fr) 210px;
    grid-template-areas:
      "leaders actions"
      "leaders exit";
    gap: 10px 20px;
    overflow: hidden;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .leaderboard {
    grid-area: leaders;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
  }

  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .leaderboard-list li:nth-child(n+6):not(.lb-extra) { display: none; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .end-buttons { grid-area: actions; gap: 8px; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .end-secondary { flex-direction: column; gap: 8px; }
  body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .btn-big { min-height: 42px; padding: 8px; font-size: 11px; }
body.surface-ios.layout-landscape #screen-gk-end[data-end-step="leaders"] .end-exit { grid-area: exit; margin: 0; padding: 3px 8px; }
}

/* ---------- Standalone menu V3: игровая сцена, один центр и progressive disclosure. ---------- */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.menu-scene-v3 #screen-menu {
  justify-content: flex-start;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(5, 9, 22, 0.02) 0%, rgba(5, 9, 22, 0.01) 58%, rgba(5, 9, 22, 0.36) 100%);
}

body.menu-scene-v3 #stage,
body.menu-scene-v3 #game {
  background: #0c2d59;
}

/* В expanded embedded-card базовое правило держит gameplay canvas в формате 16:9.
   Домашняя сцена, как и в iOS, должна заполнять весь viewport. */
body.menu-scene-v3.surface-embedded-card.mode-menu #game {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-position: center center;
}

body.menu-scene-v3 .yr-menu {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  display: block;
  pointer-events: none;
}

body.menu-scene-v3.layout-portrait .yr-menu {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  gap: 0;
  display: block;
}

body.menu-scene-v3 .menu-hero-copy {
  position: absolute;
  left: 50%;
  top: clamp(172px, 22dvh, 214px);
  width: min(390px, calc(100vw - 32px));
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

body.menu-scene-v3 .menu-hero-copy::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: -1;
  width: min(390px, calc(100vw - 24px));
  height: 88px;
  background: radial-gradient(ellipse at center, rgba(4, 12, 28, 0.42), rgba(4, 12, 28, 0) 72%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body.menu-scene-v3.layout-portrait .menu-hero-copy { margin: 0; }

body.menu-scene-v3 .yr-logo {
  max-width: 100%;
  color: #f7f3e8;
  font-size: clamp(34px, 10vw, 43px);
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 3px 3px 0 #c03020, 6px 6px 0 #1840a0;
}

body.menu-scene-v3 .menu-best {
  min-height: 14px;
  font-size: 11px;
  line-height: 1.2;
  color: #ffe000;
  letter-spacing: 1px;
}

body.menu-scene-v3 #btn-play {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 238px);
  width: min(360px, calc(100vw - 42px));
  transform: translateX(-50%);
  pointer-events: auto;
}

body.menu-scene-v3 #btn-endless-menu {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 163px);
  width: min(360px, calc(100vw - 42px));
  transform: translateX(-50%);
  pointer-events: auto;
}

body.menu-scene-v3 .menu-actions {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
  pointer-events: auto;
}

body.menu-scene-v3 .menu-icon-btn,
body.menu-scene-v3 .menu-settings-btn {
  position: relative;
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(28, 40, 73, 0.94);
  border: 2px solid #7381aa;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

body.menu-scene-v3 .menu-icon-btn:active,
body.menu-scene-v3 .menu-icon-btn.active,
body.menu-scene-v3 .menu-settings-btn:active,
body.menu-scene-v3 .menu-settings-btn[aria-expanded="true"] {
  background: #31436f;
  border-color: #80e8ff;
  transform: none;
  box-shadow: 1px 1px 0 #000;
}

body.menu-scene-v3 .menu-icon-glyph,
body.menu-scene-v3 .menu-settings-btn > span[aria-hidden="true"] {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 27px;
  line-height: 1;
}

body.menu-scene-v3 .menu-notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  background: #e83e67;
  border: 2px solid #ffffff;
  box-shadow: 2px 2px 0 #000;
}

body.menu-scene-v3 .top-controls {
  left: auto;
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  transform: none;
}

body.menu-scene-v3 .menu-settings-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
}

body.menu-scene-v3 .settings-panel {
  position: absolute;
  top: 56px;
  right: 0;
  box-sizing: border-box;
  /* Третья колонка — под переключатель вибрации рядом со звуком. Ширина
     панели выросла ровно на эту кнопку с отступом, чтобы язык не сжимался. */
  width: 272px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  grid-template-rows: 40px auto auto;
  align-items: center;
  gap: 9px 8px;
  overflow: hidden;
  background: rgba(11, 18, 38, 0.97);
  border: 2px solid #7381aa;
  box-shadow: 4px 4px 0 #000;
}

body.menu-scene-v3 .settings-panel .lang-switch {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body.menu-scene-v3 .settings-panel .lang-btn {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

body.menu-scene-v3 .settings-panel .sound-btn {
  width: 44px;
  min-width: 44px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

body.menu-scene-v3 .settings-panel .settings-lefty-btn {
  width: 100%;
  min-width: 0;
  padding: 0 7px;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Кнопки во всю ширину панели, иначе они делят строку с иконками и текст
   обрезается. */
body.menu-scene-v3 .settings-panel .coach-replay-btn {
  grid-column: 1 / -1;
}

body.menu-scene-v3 .settings-panel .lang-btn.active,
body.menu-scene-v3 .settings-panel .sound-btn[aria-pressed="true"] {
  color: #ffffff;
  background: #24345a;
  border-color: #80e8ff;
}

body.menu-scene-v3 .settings-panel #menu-user {
  /* В старом landscape-макете #menu-user получал grid-area:user. Внутри
     поповера это создавало неявную колонку и сжимало RU/EN до нескольких px. */
  grid-area: auto;
  grid-column: 1 / -1;
  grid-row: 3;
  min-width: 0;
  width: 100%;
  min-height: 15px;
  margin-top: 2px;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0;
  color: #aeb8d4;
}

body.menu-scene-v3 .settings-panel .profile-line,
body.menu-scene-v3 .settings-panel .profile-label {
  min-width: 0;
  max-width: 100%;
}

body.menu-scene-v3 .menu-drawer {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
  z-index: 25;
  box-sizing: border-box;
  width: min(390px, calc(100vw - 28px));
  max-height: min(470px, 62dvh);
  padding: 42px 12px 12px;
  display: none;
  overflow: hidden;
  background: rgba(10, 17, 36, 0.98);
  border: 2px solid #7381aa;
  box-shadow: 5px 5px 0 #000;
  transform: translateX(-50%);
  pointer-events: auto;
}

body.menu-scene-v3 .menu-drawer:has(#menu-leaderboard:not(.hidden)),
body.menu-scene-v3 .menu-drawer:has(#menu-achievements:not(.hidden)) {
  display: block;
}

body.menu-scene-v3 .menu-drawer-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
  background: #253154;
  border: 1px solid #7381aa;
}

body.menu-scene-v3 .menu-drawer .menu-teaser {
  position: absolute;
  top: 13px;
  left: 12px;
  right: 48px;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0;
  color: #c5cce0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.menu-scene-v3 .menu-drawer .menu-leaderboard,
body.menu-scene-v3 .menu-drawer .ach-list {
  width: 100%;
  max-height: calc(min(470px, 62dvh) - 56px);
  overflow-y: auto;
}

body.menu-scene-v3 .legal-links {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 7px);
  gap: 13px;
  flex-wrap: nowrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: -0.1px;
}

body.menu-scene-v3 .prematch-side {
  position: absolute;
  inset: 0;
  z-index: 32;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 44%, rgba(8, 17, 40, 0.12), rgba(5, 9, 22, 0.42));
}

body.menu-scene-v3 .prematch-objective,
.prematch-objective {
  box-sizing: border-box;
  width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  display: grid;
  gap: 5px;
  color: #ffffff;
  background: rgba(10, 17, 36, 0.92);
  border: 2px solid #80e8ff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.62);
  text-align: center;
}

.prematch-objective strong {
  color: #ffe000;
  font-size: clamp(17px, 5vw, 23px);
  letter-spacing: 1px;
}

.prematch-objective-goal {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.prematch-objective small {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  color: #bcc8e5;
}

.prematch-objective small:empty { display: none; }

body.menu-scene-v3.prematch-active .gk-deck { display: none !important; }

body.menu-scene-v3 .prematch-countdown {
  font-size: clamp(64px, 22vw, 100px);
  font-weight: bold;
  line-height: 0.9;
  color: #ffffff;
  text-shadow: 4px 4px 0 #c03020, 8px 8px 0 #1840a0;
}

body.menu-scene-v3 .prematch-side-label {
  margin-top: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #d7ddef;
  text-transform: uppercase;
}

body.menu-scene-v3 .prematch-side-btn {
  min-width: 94px;
  min-height: 50px;
  padding: 8px 14px;
  pointer-events: auto;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0;
  color: #ffffff;
  background: rgba(28, 40, 73, 0.96);
  border: 2px solid #80e8ff;
  box-shadow: 3px 3px 0 #000;
}

@media (max-height: 700px) and (orientation: portrait) {
  body.menu-scene-v3 .menu-hero-copy { top: 138px; }
  body.menu-scene-v3 .yr-logo { font-size: 34px; }
  body.menu-scene-v3 #btn-play {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 205px);
    padding-top: 16px;
    padding-bottom: 16px;
  }
  body.menu-scene-v3 #btn-endless-menu { bottom: calc(env(safe-area-inset-bottom, 0px) + 134px); }
  body.menu-scene-v3 .menu-actions { bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); }
  body.menu-scene-v3 .menu-icon-btn { width: 52px; min-width: 52px; height: 52px; min-height: 52px; }
  body.menu-scene-v3 .legal-links { bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); font-size: 9px; gap: 10px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  body.menu-scene-v3.layout-landscape #screen-menu { padding: 0; }
  body.menu-scene-v3.layout-landscape .yr-menu {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
  }
  body.menu-scene-v3.layout-landscape .menu-hero-copy {
    top: max(156px, env(safe-area-inset-top, 0px));
    width: min(380px, 46vw);
  }
  body.menu-scene-v3.layout-landscape .yr-logo { font-size: 36px; }
  body.menu-scene-v3.layout-landscape #btn-play {
    left: calc(50% - 280px);
    bottom: max(32px, env(safe-area-inset-bottom, 0px));
    width: 236px;
    min-height: 58px;
    padding: 12px 18px;
    transform: none;
  }
  body.menu-scene-v3.layout-landscape #btn-endless-menu {
    left: calc(50% - 34px);
    bottom: max(32px, env(safe-area-inset-bottom, 0px));
    width: 236px;
    min-height: 58px;
    padding: 7px 10px;
    transform: none;
  }
  body.menu-scene-v3.layout-landscape #btn-endless-menu small { display: none; }
  body.menu-scene-v3.layout-landscape .menu-actions {
    left: calc(50% + 215px);
    bottom: max(34px, env(safe-area-inset-bottom, 0px));
    gap: 8px;
    transform: none;
  }
  body.menu-scene-v3.layout-landscape .menu-icon-btn { width: 48px; min-width: 48px; height: 48px; min-height: 48px; }
  body.menu-scene-v3.layout-landscape .top-controls {
    left: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    top: max(10px, env(safe-area-inset-top, 0px));
  }
  body.menu-scene-v3.layout-landscape .settings-panel {
    top: 52px;
    right: 0;
    width: 236px;
  }
  body.menu-scene-v3.layout-landscape .legal-links { bottom: 3px; font-size: 9px; }
  body.menu-scene-v3.layout-landscape .menu-drawer {
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    width: min(520px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 36px));
    max-height: calc(100dvh - 24px);
  }
  body.menu-scene-v3.layout-landscape .menu-drawer .menu-leaderboard,
  body.menu-scene-v3.layout-landscape .menu-drawer .ach-list { max-height: calc(100dvh - 82px); }
}
