/* Файл: /georide/styles.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--surface-base);
  color: var(--text-primary);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

#map {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.map-unavailable {
  position: absolute;
  top: 50%;
  left: 16px;
  right: 78px;
  width: auto;
  max-width: 420px;
  max-height: calc(100dvh - 160px);
  margin: 0 auto;
  padding: 22px 26px;
  overflow-y: auto;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-lg);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

#game-ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#game-ui > * {
  pointer-events: auto;
}

#game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

#game-title {
  color: var(--color-accent);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

:root {
  --color-accent: #c3d651;
  --color-accent-hover: #d2e467;
  --color-accent-active: #b3c943;
  --color-success: #65c466;
  --color-warning: #f2b84b;
  --color-danger: #ef6b6b;
  --color-info: #5b9cff;

  --surface-base: #181a1f;
  --surface-elevated: #202329;
  --surface-glass: rgba(24, 27, 32, 0.82);
  --surface-glass-hover: rgba(40, 44, 51, 0.9);
  --surface-overlay: rgba(10, 12, 18, 0.68);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.54);
  --text-disabled: rgba(255, 255, 255, 0.36);

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-default: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.24);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-round: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.38);

  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 120ms;
  --duration-normal: 180ms;

  --glass-bg: var(--surface-glass);
  --glass-brd: var(--border-default);
  --glass-hi: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(10px) saturate(1.15);
  --glass-sh: var(--shadow-sm);
}

#game-controls {
  position: absolute;
  top: 50%;
  right: 14px;
  z-index: 560;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transform: translateY(-50%);
}

.ctrl-btn.tap {
  transition: transform 0.12s ease;
}

.ctrl-btn.tap:active {
  transform: scale(0.97);
}

.zoom-caps {
  display: flex;
  flex-direction: column;
  width: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--glass-brd);
  border-radius: 16px;
  background: var(--glass-bg);
  box-shadow:
    var(--glass-sh),
    inset 0 1px 0 var(--glass-hi);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.zoom-caps .ctrl-btn {
  display: flex;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(226, 231, 240, 0.62);
  cursor: pointer;
  font-family: inherit;
  font-size: 0;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.zoom-caps .ctrl-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.zoom-caps .ctrl-btn:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.zoom-caps .ctrl-btn .compass-arrow {
  transform-origin: 50% 50%;
}

.zoom-caps .ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}

.zoom-caps .ctrl-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.geo-fab.ctrl-btn {
  position: relative;
  display: flex;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-brd);
  border-radius: 16px;
  background: var(--glass-bg);
  box-shadow:
    var(--glass-sh),
    inset 0 1px 0 var(--glass-hi);
  color: rgba(232, 234, 240, 0.8);
  cursor: pointer;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    transform 120ms ease;
}

.geo-fab .gf-ic {
  position: relative;
  top: 2px;
  left: -1px;
  width: 24px;
  height: 24px;
}

.geo-fab:hover {
  background: var(--surface-glass-hover);
  color: rgba(232, 234, 240, 0.92);
  border-color: var(--border-default);
}

.geo-fab:active {
  background: rgba(75, 82, 94, 0.96);
  color: #ffffff;
  border-color: rgba(232, 234, 240, 0.4);
}

.geo-fab .gf-spin {
  position: absolute;
  display: none;
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(77, 144, 255, 0.25);
  border-top-color: #4d90ff;
  border-radius: 50%;
  animation: gfSpin 0.8s linear infinite;
}

.geo-fab.loading .gf-ic {
  opacity: 0;
}

.geo-fab.loading .gf-spin {
  display: block;
}

@keyframes gfSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ctrl-btn.tap {
    transition: none;
  }

  .ctrl-btn.tap:active {
    transform: none;
  }

  .geo-fab .gf-spin {
    animation: none;
  }
}

#game-info {
  --surface-glass: #3b3b3b;
  --surface-elevated: #3b3b3b;

  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  width: 90%;
  max-width: 400px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

#info-message {
  min-height: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

#progress-container {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

#progress-bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.12);
}

#progress-bar-inner {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
  transition: width 300ms var(--ease-standard);
}

#progress-text {
  min-width: 40px;
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.mobile-menu-button {
  display: none;
}

/* Карточка маяка: popup MapLibre GL JS */
.maplibregl-popup.beacon-info-popup-maplibre .maplibregl-popup-content {
  padding: 0;
  border: 1px solid rgba(79, 79, 79, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(42, 48, 56, 0.2);
  font-size: 14px;
  line-height: 1.4;
}

.maplibregl-popup.beacon-info-popup-maplibre .maplibregl-popup-tip {
  border-top-color: rgba(255, 255, 255, 0.88);
}

.beacon-info-popup {
  display: grid;
  gap: 5px;
  min-width: 190px;
  max-width: 260px;
  padding: 10px 11px;
  color: #3f454b;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.beacon-info-popup__title {
  overflow: hidden;
  color: #30363c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beacon-info-popup__details {
  color: #68717a;
  font-size: 11px;
  line-height: 1.25;
}

.beacon-info-popup__status {
  color: #3f454b;
  font-size: 12px;
  line-height: 1.35;
}

.beacon-info-popup__report {
  justify-self: start;
  margin-top: 2px;
  padding: 3px 7px;
  border: 1px solid rgba(79, 79, 79, 0.42);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.68);
  color: #3f454b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.beacon-info-popup__report:hover,
.beacon-info-popup__report:focus-visible {
  border-color: #4f4f4f;
  background: #4f4f4f;
  color: #ffffff;
  outline: none;
}

/* Кольцо прогресса действия: SVG-маркер MapLibre */
.beacon-progress-ring {
  pointer-events: none;
}

/* Метка игрока: DOM-маркер MapLibre */
.player-marker {
  pointer-events: none;
}

/* Атрибуция MapLibre GL JS */
.maplibregl-ctrl-attrib {
  padding: 2px 5px;
  border-radius: 4px 0 0 0;
  background: rgba(255, 255, 255, 0.72);
  color: #4f4f4f;
  font-size: 10px;
  line-height: 1.25;
}

.maplibregl-ctrl-attrib a {
  color: #4f4f4f;
  text-decoration: none;
}

.team-selection-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.team-selection-modal[hidden] {
  display: none;
}

.team-selection-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 24, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.team-selection-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  text-align: center;
}

.team-selection-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 28px;
  line-height: 1;
}

.team-selection-modal__close:active {
  background: rgba(255, 255, 255, 0.16);
}

.team-selection-modal__card h2 {
  font-size: 24px;
  line-height: 1.2;
}

.team-selection-modal__text {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.team-selection-modal__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.team-choice {
  min-height: 142px;
  padding: 18px 14px;
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}

.team-choice--lime {
  border-color: #4f4f4f;
  background: #c3d651;
  color: #4f4f4f;
}

.team-choice--graphite {
  border-color: #c3d651;
  background: #4f4f4f;
  color: #c3d651;
}

.team-choice:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.team-choice:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.team-choice:active {
  transform: translateY(0);
}

.team-choice__name {
  display: block;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
}

.team-choice__description {
  display: block;
  margin-top: 9px;
  color: currentColor;
  font-size: 13px;
  line-height: 1.35;
}

.team-choice:disabled,
.team-choice:disabled:hover {
  box-shadow: none;
  cursor: wait;
  filter: none;
  opacity: 0.62;
  transform: none;
}

/* Лента событий: нижняя немодальная панель */
.events-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  height: 33.333vh;
  height: 33.333dvh;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px 16px 0 0;
  background: #3b3b3b;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
  color: var(--text-primary);
}

.events-panel[hidden],
.events-panel [hidden] {
  display: none;
}

.events-panel__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#events-panel-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.events-panel__close {
  display: inline-flex;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.events-panel__content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 14px max(12px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

.events-panel__status {
  margin: 0;
  padding: 16px 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.events-panel__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.events-panel__item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow-wrap: anywhere;
}

.events-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.events-panel__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.events-panel__more {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.events-panel__close:active,
.events-panel__more:active {
  background: rgba(255, 255, 255, 0.16);
}

.events-panel__close:focus-visible,
.events-panel__more:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.events-panel__more:disabled {
  opacity: 0.6;
  cursor: wait;
}

.mobile-menu-panel {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
}

.mobile-menu-panel[hidden] {
  display: none;
}

.mobile-menu-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.54);
}

.mobile-menu-panel__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(86vw, 340px);
  min-height: 100%;
  padding: max(20px, env(safe-area-inset-top)) 16px 24px;
  background: #3b3b3b;
  box-shadow: -14px 0 36px rgba(0, 0, 0, 0.38);
  color: #ffffff;
}

.mobile-menu-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.mobile-menu-panel__header h2 {
  font-size: 22px;
  line-height: 1.2;
}

.mobile-menu-panel__close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-panel__items {
  display: flex;
  flex-direction: column;
}

.mobile-menu-panel__item {
  width: 100%;
  min-height: 52px;
  margin-bottom: 10px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-panel__item:active,
.mobile-menu-panel__close:active {
  background: rgba(255, 255, 255, 0.16);
}

.mobile-menu-panel__item:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.mobile-menu-panel__version {
  margin-top: auto;
  padding: 18px 4px 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.game-settings-option {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  padding: 8px 0;
  font-size: 17px;
  line-height: 1.4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.game-settings-option > span {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.game-settings-option > input[type="checkbox"] {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.game-settings-option > input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.game-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.game-menu-modal[hidden] {
  display: none;
}

.game-menu-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.game-menu-modal__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: #3b3b3b;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.38);
  color: #ffffff;
}

.game-menu-modal__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.game-menu-modal__header h2 {
  min-width: 0;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.2;
}

.game-menu-modal__close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.game-menu-modal__close:active {
  background: rgba(255, 255, 255, 0.16);
}

.game-menu-modal__content {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.game-menu-modal__content h3 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.25;
}

.game-menu-modal__content p + p {
  margin-top: 12px;
}

.game-menu-modal__content ul,
.game-menu-modal__content ol {
  margin: 12px 0 0;
  padding-left: 20px;
}

.game-menu-modal__content li + li {
  margin-top: 8px;
}

.game-menu-modal__link {
  display: inline-block;
  margin-top: 6px;
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.game-menu-modal__link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.game-menu-modal__link:active {
  color: var(--color-accent-active);
}

.game-menu-section {
  margin-bottom: 24px;
}

.game-menu-section:last-child {
  margin-bottom: 0;
}

.statistics-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.statistics-modal[hidden] {
  display: none;
}

.statistics-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.statistics-modal__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(79, 79, 79, 0.2);
  border-radius: 20px;
  background: rgba(245, 246, 247, 0.96);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.34);
  color: #30343a;
}

.statistics-modal__header {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 17px 18px 15px;
  border-bottom: 1px solid rgba(79, 79, 79, 0.14);
  background: rgba(250, 251, 252, 0.97);
  box-shadow: 0 3px 10px rgba(38, 38, 38, 0.05);
}

.statistics-modal__header h2 {
  margin: 0;
  color: #30343a;
  font-size: 22px;
  line-height: 1.2;
}

.statistics-modal__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.statistics-modal__collapse {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(79, 79, 79, 0.22);
  border-radius: 10px;
  background: rgba(79, 79, 79, 0.08);
  color: #30343a;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.statistics-modal__collapse:active {
  background: rgba(79, 79, 79, 0.16);
}

.statistics-modal__close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(79, 79, 79, 0.22);
  border-radius: 10px;
  background: rgba(79, 79, 79, 0.08);
  color: #30343a;
  cursor: pointer;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.statistics-modal__close:active {
  background: rgba(79, 79, 79, 0.16);
}

.statistics-modal__content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  gap: 14px;
  overflow-y: auto;
  padding: 15px 18px 18px;
  scrollbar-color: rgba(79, 79, 79, 0.42) transparent;
  scrollbar-width: thin;
}

.statistics-modal__content::-webkit-scrollbar {
  width: 7px;
}

.statistics-modal__content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(79, 79, 79, 0.36);
}

.statistics-modal__status {
  margin: 0;
  padding: 26px 12px;
  color: rgba(48, 52, 58, 0.72);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.statistics-modal__section[hidden],
.statistics-modal__status[hidden] {
  display: none;
}

.statistics-modal__section {
  padding: 15px;
  border: 1px solid rgba(79, 79, 79, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 9px rgba(38, 38, 38, 0.04);
}

#statistics-modal-personal,
#statistics-modal-history {
  border-color: rgba(79, 79, 79, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 2px 9px rgba(38, 38, 38, 0.08);
}

.statistics-modal__section-title {
  margin: 0 0 13px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

/* Персональный список обслуживания маяков */
.maintenance-list {
  margin: 0;
  padding-left: 1.5em;
}

.maintenance-list > li + li {
  margin-top: 4px;
}

.maintenance-list__row {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 32px;
}

.maintenance-list__name {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.maintenance-list__name:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.maintenance-list__name:disabled {
  opacity: 0.6;
  cursor: default;
}

.maintenance-list__due {
  flex: 0 0 auto;
  white-space: pre;
}

#statistics-modal-battle .statistics-modal__section-title,
#statistics-modal-rankings .statistics-modal__section-title {
  color: #30343a;
}

.statistics-modal__player-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.statistics-modal__player-item {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid currentColor;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  text-align: center;
}

.statistics-modal__player-value {
  display: block;
  overflow-wrap: anywhere;
  color: inherit;
  font-size: clamp(16px, 4.8vw, 21px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.statistics-modal__player-label {
  display: block;
  margin-top: 7px;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.statistics-modal__battle-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.statistics-modal__battle-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.statistics-modal__battle-label {
  color: #30343a;
  font-size: 13px;
  font-weight: 700;
}

.statistics-modal__battle-bar {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 32px;
  overflow: hidden;
  border: 1px solid rgba(79, 79, 79, 0.22);
  border-radius: 10px;
  background: rgba(79, 79, 79, 0.08);
}

.statistics-modal__battle-segment {
  min-width: 0;
  transition: width 0.2s ease;
}

.statistics-modal__battle-segment--first {
  border-right: 1px solid rgba(255, 255, 255, 0.38);
}

.statistics-modal__battle-value {
  position: absolute;
  top: 50%;
  z-index: 1;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  -webkit-text-stroke: 1px var(--battle-value-stroke-color);
  paint-order: stroke fill;
}

.statistics-modal__battle-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(48, 52, 58, 0.72);
  font-size: 11px;
  line-height: 1.2;
}

.statistics-modal__battle-legend span:last-child {
  text-align: right;
}

.statistics-modal__tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.statistics-modal__tabs::-webkit-scrollbar {
  display: none;
}

.statistics-modal__tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(79, 79, 79, 0.22);
  border-radius: 9px;
  background: rgba(79, 79, 79, 0.06);
  color: rgba(48, 52, 58, 0.76);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  -webkit-tap-highlight-color: transparent;
}

.statistics-modal__tab.is-active {
  border-color: rgba(79, 79, 79, 0.52);
  background: rgba(195, 214, 81, 0.32);
  color: #30343a;
}

.statistics-modal__tab:active {
  background: rgba(79, 79, 79, 0.13);
}

.statistics-modal__criteria {
  margin-top: 13px;
}

.statistics-modal__criteria-title {
  margin-bottom: 8px;
  color: rgba(48, 52, 58, 0.7);
  font-size: 12px;
  font-weight: 700;
}

.statistics-modal__ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 13px;
}

.statistics-modal__ranking-row {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(79, 79, 79, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.statistics-modal__ranking-row.is-current-user {
  border-color: rgba(195, 214, 81, 0.86);
  background: rgba(195, 214, 81, 0.24);
}

.statistics-modal__ranking-rank {
  color: rgba(48, 52, 58, 0.62);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.statistics-modal__ranking-name {
  overflow: hidden;
  color: #30343a;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-modal__ranking-value {
  color: #30343a;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.statistics-modal__ranking-separator {
  padding: 1px 0;
  color: rgba(48, 52, 58, 0.62);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.statistics-modal__ranking-empty {
  margin: 13px 0 0;
  padding: 16px 10px;
  color: rgba(48, 52, 58, 0.62);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 481px) {
  .statistics-modal {
    position: fixed;
    z-index: 600;
    top: 82px;
    left: 14px;
    right: auto;
    bottom: auto;
    display: block;
    width: min(390px, calc(100vw - 28px));
    padding: 0;
    pointer-events: auto;
  }

  .statistics-modal.hidden {
    display: block;
  }

  .statistics-modal__backdrop {
    display: none;
  }

  .statistics-modal__card {
    width: 100%;
    max-height: min(620px, calc(100dvh - 96px));
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }

  .statistics-modal__collapse {
    display: inline-flex;
  }

  .statistics-modal__close {
    display: none;
  }

  .statistics-modal.is-collapsed {
    width: min(390px, calc(100vw - 28px));
  }

  .statistics-modal.is-collapsed .statistics-modal__card {
    width: 100%;
    max-height: none;
    overflow: hidden;
    border-radius: 16px;
  }

  .statistics-modal.is-collapsed .statistics-modal__header {
    min-width: 0;
    padding: 17px 18px 15px;
    border-bottom: 0;
    box-shadow: none;
  }

  .statistics-modal.is-collapsed .statistics-modal__content {
    display: none;
  }

  .statistics-modal.is-collapsed .statistics-modal__collapse {
    width: 38px;
    height: 38px;
  }

  .statistics-modal.is-collapsed .statistics-modal__collapse span {
    display: block;
    transform: translateY(-1px);
  }
}

@media (max-width: 480px) {
  #game-title {
    font-size: 18px;
  }

  .mobile-menu-button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-button:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.96);
  }

  .zoom-caps {
    width: 44px;
    border-radius: var(--radius-md);
  }

  .zoom-caps .ctrl-btn svg {
    width: 18px;
    height: 18px;
  }

  .geo-fab {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
  }

  .geo-fab .gf-ic,
  .geo-fab .gf-spin {
    width: 21px;
    height: 21px;
  }

  #game-info {
    width: 95%;
    padding: 12px 14px;
  }

  #info-message {
    font-size: 12px;
  }

  .statistics-modal {
    padding: 10px;
  }

  .statistics-modal__card {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .statistics-modal__header {
    padding: 15px 16px 13px;
  }

  .statistics-modal__content {
    padding: 13px 16px 16px;
  }
}

@media (max-width: 380px) {
  .team-selection-modal {
    padding: 14px;
  }

  .team-selection-modal__card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .team-selection-modal__choices {
    grid-template-columns: 1fr;
  }

  .team-choice {
    min-height: 104px;
  }

  .statistics-modal {
    padding: 8px;
  }

  .statistics-modal__card {
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .statistics-modal__header {
    padding: 13px 14px 12px;
  }

  .statistics-modal__header h2 {
    font-size: 20px;
  }

  .statistics-modal__content {
    padding: 12px 14px 14px;
  }

  .statistics-modal__section {
    padding: 13px;
    border-radius: 14px;
  }

  .statistics-modal__player-grid {
    gap: 6px;
  }

  .statistics-modal__player-item {
    padding: 9px 4px;
  }

  .statistics-modal__player-value {
    font-size: clamp(14px, 4.7vw, 18px);
  }

  .statistics-modal__player-label {
    font-size: 10px;
  }

  .statistics-modal__tab {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 11px;
  }
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.game-number,
.statistics-modal__player-value,
.statistics-modal__ranking-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

@supports not (backdrop-filter: blur(10px)) {
  #game-header,
  #game-info,
  .zoom-caps,
  .geo-fab {
    background: var(--surface-elevated);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
