:root {
  --bg: #0e0f12;
  --surface: #16181e;
  --border: #2a2d36;
  --body-bg-image: none;
  --text: #e8eaef;
  --muted: #8b909e;
  --accent: #6c9cff;
  --success: #3dd68c;
  --warn: #f5a623;
  --rare: #a78bfa;
  --epic: #f472b6;
  --ultimate: #f0c14b;
  --common: #94a3b8;
  --on-accent: #0a0b0d;
  --radius: 12px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --title-font: var(--font);
  --reaction-waiting-bg: #1e2229;
  --reaction-waiting-fg: var(--muted);
  --reaction-ready-bg: #2a2218;
  --reaction-ready-fg: var(--warn);
  --reaction-ready-border: var(--warn);
  --reaction-go-bg: #0d2818;
  --reaction-go-fg: var(--success);
  --reaction-go-border: var(--success);
  --reaction-too-bg: #281515;
  --reaction-too-fg: #f87171;
  --reaction-too-border: #f87171;
  --target-dot-highlight: #fff3;
  --target-dot-border: rgba(255, 255, 255, 0.35);
  --target-dot-shadow: 108, 156, 255;
  --card-glow: none;
  --header-title-shadow: none;
}

/* Классика: тёмный фон с розовым оттенком и мягким градиентом */
html:not([data-theme]) {
  --bg: #140f13;
  --surface: #1c151a;
  --border: #3a2d36;
  --body-bg-image:
    radial-gradient(ellipse 95% 65% at 50% -5%, rgba(236, 72, 153, 0.18), transparent 52%),
    radial-gradient(ellipse 75% 55% at 100% 85%, rgba(190, 80, 120, 0.12), transparent 48%),
    radial-gradient(ellipse 70% 50% at 0% 60%, rgba(244, 114, 182, 0.08), transparent 45%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background-color: var(--bg);
  background-image: var(--body-bg-image, none);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  line-height: 1.5;
  touch-action: manipulation;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1rem max(2rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}

.header-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  width: 100%;
  min-width: 0;
}

.header-lb-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.header-lb-cluster--clickable {
  cursor: pointer;
  border-radius: 10px;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
  transition: background 0.15s ease;
}

.header-lb-cluster--clickable:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.header-lb-cluster--clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-lb-bg-inline {
  font-size: 0.68rem;
  line-height: 1.25;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  max-width: min(100%, 12rem);
  text-transform: lowercase;
}

/* Тот же смысл, что цвет подложки ника: зелёная гамма = топ «лучший клик» реакции */
.header-lb-bg-inline--react {
  color: #5eead4;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

/* Оранжевая гамма = топ «лучший забег» мишеней */
.header-lb-bg-inline--targets {
  color: #fb923c;
  text-shadow: 0 0 12px rgba(251, 146, 60, 0.35);
}

/* Как фон сигила */
.header-lb-bg-inline--admin {
  color: #e879f9;
  text-shadow: 0 0 12px rgba(192, 38, 211, 0.35);
}

/* Топ реакции · сессия (10) — голубая гамма */
.header-lb-bg-inline--reactSes {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Топ мишеней · сессия (5) — розовая гамма */
.header-lb-bg-inline--targetsSes {
  color: #fb7185;
  text-shadow: 0 0 12px rgba(251, 113, 133, 0.35);
}

.header-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: var(--header-title-shadow);
  flex: 0 0 auto;
  line-height: 1.15;
}

.header-lb-preview {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.header-lb-preview .lb-player-cell {
  width: fit-content;
  max-width: 100%;
}

.header-lb-preview .lb-name-text {
  max-width: 9.5rem;
  font-size: 0.8rem;
}

@media (min-width: 400px) {
  .header-lb-preview .lb-name-text {
    max-width: 12rem;
    font-size: 0.82rem;
  }
}

.theme-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.theme-cycle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.2s;
}

.theme-cycle-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Мини-превью палитры темы (очертания стиля) */
.theme-preview {
  flex-shrink: 0;
  width: 2.35rem;
  height: 1.45rem;
  border-radius: 6px;
  box-sizing: border-box;
}

.theme-preview--classic {
  background: linear-gradient(
    125deg,
    #140f13 0%,
    #1c151a 32%,
    rgba(236, 72, 153, 0.55) 52%,
    #6c9cff 78%,
    #140f13 100%
  );
  border: 2px solid #3a2d36;
  outline: 2px solid color-mix(in srgb, #ec4899 65%, #6c9cff);
  outline-offset: 1px;
  box-shadow:
    inset 0 0 10px rgba(236, 72, 153, 0.22),
    inset 0 0 0 1px rgba(108, 156, 255, 0.2);
}

.theme-preview--neon {
  background: linear-gradient(125deg, #070710 20%, #00e8ff 48%, #ff2da6 82%);
  border: 2px solid #3d2f6b;
  outline: 2px solid #00e8ff;
  outline-offset: 1px;
  box-shadow:
    0 0 6px rgba(0, 232, 255, 0.55),
    inset 0 0 8px rgba(255, 45, 166, 0.25);
}

.theme-preview--void {
  background: #000000;
  border: 2px solid #242424;
  outline: 2px solid #e8e8e8;
  outline-offset: 1px;
  box-shadow: inset 0 0 0 3px #0a0a0a;
}

.theme-preview--retro {
  background: repeating-linear-gradient(
    0deg,
    #0a0d0a,
    #0a0d0a 2px,
    #0f180f 2px,
    #0f180f 3px
  );
  border: 2px solid #1f3d28;
  outline: 2px solid #7fff00;
  outline-offset: 1px;
  box-shadow: inset 0 -6px 0 #00ff66;
}

.theme-preview--aurora {
  background: linear-gradient(135deg, #0c1018 0%, #7dd3fc 42%, #a78bfa 72%, #141a26 100%);
  border: 2px solid #2c3548;
  outline: 2px solid color-mix(in srgb, #7dd3fc 70%, #a78bfa);
  outline-offset: 1px;
  box-shadow: inset 0 0 10px rgba(167, 139, 250, 0.2);
}

.theme-dropdown {
  position: relative;
}

.theme-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.2s;
}

.theme-dropdown-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.theme-dropdown.is-open .theme-dropdown-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.theme-dropdown-label {
  max-width: 6.5rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-dropdown-chevron {
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.1rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.theme-dropdown.is-open .theme-dropdown-chevron {
  transform: rotate(225deg) translateY(2px);
}

.theme-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: min(100vw - 2rem, 15.5rem);
  padding: 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 120;
}

.theme-dropdown-panel[hidden] {
  display: none !important;
}

.theme-dropdown-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.theme-option-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}

/* Полоска палитры — только внутри выпадающего списка тем */
.theme-dropdown-panel .theme-palette {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.theme-dropdown-panel .theme-palette-swatch {
  flex: 1;
  min-width: 0;
  border-radius: 1px;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="classic"] .theme-palette-swatch:nth-child(1) {
  background: #140f13;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="classic"] .theme-palette-swatch:nth-child(2) {
  background: #1c151a;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="classic"] .theme-palette-swatch:nth-child(3) {
  background: #6c9cff;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="classic"] .theme-palette-swatch:nth-child(4) {
  background: #ec4899;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="classic"] .theme-palette-swatch:nth-child(5) {
  background: #8b909e;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="neon"] .theme-palette-swatch:nth-child(1) {
  background: #070710;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="neon"] .theme-palette-swatch:nth-child(2) {
  background: #0f0f1a;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="neon"] .theme-palette-swatch:nth-child(3) {
  background: #00e8ff;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="neon"] .theme-palette-swatch:nth-child(4) {
  background: #ff2da6;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="neon"] .theme-palette-swatch:nth-child(5) {
  background: #9a8ec4;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="void"] .theme-palette-swatch:nth-child(1) {
  background: #000000;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="void"] .theme-palette-swatch:nth-child(2) {
  background: #0a0a0a;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="void"] .theme-palette-swatch:nth-child(3) {
  background: #e8e8e8;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="void"] .theme-palette-swatch:nth-child(4) {
  background: #242424;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="void"] .theme-palette-swatch:nth-child(5) {
  background: #7a7a7a;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="retro"] .theme-palette-swatch:nth-child(1) {
  background: #0a0d0a;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="retro"] .theme-palette-swatch:nth-child(2) {
  background: #0d120d;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="retro"] .theme-palette-swatch:nth-child(3) {
  background: #7fff00;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="retro"] .theme-palette-swatch:nth-child(4) {
  background: #00ff66;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="retro"] .theme-palette-swatch:nth-child(5) {
  background: #3d6b4a;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="aurora"] .theme-palette-swatch:nth-child(1) {
  background: #0c1018;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="aurora"] .theme-palette-swatch:nth-child(2) {
  background: #141a26;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="aurora"] .theme-palette-swatch:nth-child(3) {
  background: #7dd3fc;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="aurora"] .theme-palette-swatch:nth-child(4) {
  background: #a78bfa;
}

.theme-dropdown-panel .theme-dropdown-option[data-theme="aurora"] .theme-palette-swatch:nth-child(5) {
  background: #8b96ab;
}

.theme-dropdown-option:hover,
.theme-dropdown-option:focus-visible {
  background: var(--bg);
  outline: none;
}

.theme-dropdown-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.theme-option-text {
  line-height: 1.25;
}

@media (max-width: 380px) {
  .theme-dropdown-label {
    max-width: 4.75rem;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tab:hover {
  border-color: var(--muted);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.panel {
  display: none;
  margin-top: 1.25rem;
  animation: fade 0.2s ease;
}

.panel.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--card-glow);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.reaction-zone {
  min-height: 200px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background 0.1s, color 0.1s;
  border: 2px solid var(--border);
  touch-action: manipulation;
}

.reaction-zone.waiting {
  background: var(--reaction-waiting-bg);
  color: var(--reaction-waiting-fg);
}

.reaction-zone.ready {
  background: var(--reaction-ready-bg);
  color: var(--reaction-ready-fg);
  border-color: var(--reaction-ready-border);
}

.reaction-zone.go {
  background: var(--reaction-go-bg);
  color: var(--reaction-go-fg);
  border-color: var(--reaction-go-border);
}

.reaction-zone.too-soon {
  background: var(--reaction-too-bg);
  color: var(--reaction-too-fg);
  border-color: var(--reaction-too-border);
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.stats-row strong {
  color: var(--text);
  font-family: var(--mono);
}

.targets-stats-row {
  margin-top: 1rem;
}

.history-avg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 540px) {
  .history-avg-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.history-avg-cell {
  padding: 0.75rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}

.history-avg-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.history-avg-value {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--text);
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th,
.history-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table td:nth-child(3),
.history-table td:nth-child(4) {
  font-family: var(--mono);
}

.history-table td:nth-child(3) {
  color: var(--accent);
}

.history-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.25rem 1rem !important;
}

.history-avg-unit {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
}

/* Только на активной вкладке: иначе # перебивает .panel { display: none } */
#panel-history.panel.active,
#panel-leaderboard.panel.active,
#panel-profile.panel.active,
#panel-promo.panel.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.promo-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.promo-input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.promo-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.admin-panel-card {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 12%, transparent);
}

.admin-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
}

@media (min-width: 480px) {
  .admin-panel-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-panel-actions .btn {
    flex: 1 1 auto;
  }
}

.collection-admin-bg-wrap {
  margin-top: 0.25rem;
}

.profile-card h2,
.profile-card h3 {
  margin-top: 0;
}

.profile-subheading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 0.5rem;
}

.profile-stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.profile-stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.profile-stats-list strong {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.95rem;
}

.profile-preview-wrap {
  margin: 0.5rem 0 0.25rem;
}

.profile-preview-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.profile-preview-cell {
  max-width: 100%;
}

.profile-cosmetic-block {
  margin-top: 0.75rem;
}

.profile-cosmetic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.profile-cpick {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.5rem;
  min-width: 4.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s;
}

.profile-cpick:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.profile-cpick.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

.profile-cpick-char {
  font-size: 1.35rem;
  line-height: 1;
}

.profile-cpick-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  max-width: 6.5rem;
  line-height: 1.15;
}

.profile-cpick-reason {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  max-width: 6.75rem;
  line-height: 1.2;
  opacity: 0.92;
}

.profile-cpick-bg-swatch {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  min-width: 2.5rem;
  justify-content: center;
}

.profile-cpick-bg-swatch .lb-name-text {
  font-size: 0.75rem;
  font-weight: 700;
}

.profile-toolbar {
  margin-top: 1rem;
}

.lb-player-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.lb-patch {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
  width: 1.35rem;
  text-align: center;
}

.lb-patch--empty {
  width: 1.35rem;
}

.lb-name-bg {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  padding: 0.12rem 0.45rem 0.12rem 0.4rem;
  border-radius: 4px;
  border: 1px solid transparent;
}

.lb-name-text {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

@media (min-width: 400px) {
  .lb-name-text {
    max-width: 16rem;
  }
}

.lb-bg--none {
  background: transparent;
  border-color: transparent;
}

.lb-bg--admin_sigil {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 38%, #c026d3 72%, #fbbf24 100%);
  border-color: #e9d5ff;
  box-shadow:
    0 0 12px rgba(192, 38, 211, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.06);
}

.lb-bg--admin_sigil .lb-name-text {
  text-shadow: 0 0 8px rgba(250, 250, 250, 0.35);
}

/* Фоны за место в топе: реакция (лучший клик) — изумруд / неон */
.lb-bg--react_r1 {
  background: linear-gradient(125deg, #022c22 0%, #059669 42%, #fcd34d 100%);
  border-color: #4ade80;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.35);
}
.lb-bg--react_r2 {
  background: linear-gradient(125deg, #064e3b, #10b981 55%, #a7f3d0);
  border-color: #34d399;
}
.lb-bg--react_r3 {
  background: linear-gradient(160deg, #065f46, #14b8a6);
  border-color: #2dd4bf;
}
.lb-bg--react_r5 {
  background: repeating-linear-gradient(-50deg, rgba(45, 212, 191, 0.35) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #0f172a, #134e4a);
  border-color: #5eead4;
}
.lb-bg--react_r10 {
  background: linear-gradient(90deg, #0f172a 0%, #115e59 50%, #0f172a 100%);
  border-color: #64748b;
}
.lb-bg--react_r20 {
  background: radial-gradient(ellipse at 20% 0%, rgba(45, 212, 191, 0.25), transparent 55%), #1e293b;
  border-color: #475569;
}
.lb-bg--react_r50 {
  background: #1e293b;
  border-color: #64748b;
}
.lb-bg--react_r100 {
  background: #334155;
  border-color: #94a3b8;
}

/* Мишени (лучший забег) — уголь / оранж / кримсон */
.lb-bg--targets_r1 {
  background: linear-gradient(125deg, #450a0a 0%, #dc2626 40%, #fbbf24 100%);
  border-color: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.35);
}
.lb-bg--targets_r2 {
  background: linear-gradient(125deg, #7f1d1d, #ea580c 50%, #fdba74);
  border-color: #fb923c;
}
.lb-bg--targets_r3 {
  background: linear-gradient(160deg, #9a3412, #c2410c);
  border-color: #f97316;
}
.lb-bg--targets_r5 {
  background: repeating-linear-gradient(45deg, rgba(251, 146, 60, 0.3) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #1c1917, #431407);
  border-color: #ea580c;
}
.lb-bg--targets_r10 {
  background: linear-gradient(90deg, #1c1917 0%, #7c2d12 50%, #1c1917 100%);
  border-color: #a16207;
}
.lb-bg--targets_r20 {
  background: radial-gradient(ellipse at 80% 0%, rgba(234, 88, 12, 0.28), transparent 50%), #292524;
  border-color: #78716c;
}
.lb-bg--targets_r50 {
  background: #292524;
  border-color: #78716c;
}
.lb-bg--targets_r100 {
  background: #44403c;
  border-color: #a8a29e;
}

/* Реакция · сессия (10) — смещение в сторону неба / циана */
.lb-bg--rsession_r1 {
  background: linear-gradient(125deg, #082f49 0%, #0369a1 42%, #bae6fd 100%);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
.lb-bg--rsession_r2 {
  background: linear-gradient(125deg, #0c4a6e, #0284c7 55%, #7dd3fc);
  border-color: #0ea5e9;
}
.lb-bg--rsession_r3 {
  background: linear-gradient(160deg, #075985, #0369a1);
  border-color: #38bdf8;
}
.lb-bg--rsession_r5 {
  background: repeating-linear-gradient(-50deg, rgba(14, 165, 233, 0.35) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #0f172a, #164e63);
  border-color: #22d3ee;
}
.lb-bg--rsession_r10 {
  background: linear-gradient(90deg, #0f172a 0%, #155e75 50%, #0f172a 100%);
  border-color: #64748b;
}
.lb-bg--rsession_r20 {
  background: radial-gradient(ellipse at 20% 0%, rgba(34, 211, 238, 0.22), transparent 55%), #1e293b;
  border-color: #475569;
}
.lb-bg--rsession_r50 {
  background: #1e293b;
  border-color: #64748b;
}
.lb-bg--rsession_r100 {
  background: #334155;
  border-color: #94a3b8;
}

/* Мишени · сессия (5) — смещение в сторону розы / фуксии */
.lb-bg--tsession_r1 {
  background: linear-gradient(125deg, #4c0519 0%, #be123c 40%, #fde68a 100%);
  border-color: #fb7185;
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.35);
}
.lb-bg--tsession_r2 {
  background: linear-gradient(125deg, #881337, #e11d48 50%, #fecdd3);
  border-color: #f472b6;
}
.lb-bg--tsession_r3 {
  background: linear-gradient(160deg, #9f1239, #be185d);
  border-color: #f472b6;
}
.lb-bg--tsession_r5 {
  background: repeating-linear-gradient(45deg, rgba(244, 114, 182, 0.28) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #1e1b4b, #831843);
  border-color: #e879f9;
}
.lb-bg--tsession_r10 {
  background: linear-gradient(90deg, #1e1b4b 0%, #9d174d 50%, #1e1b4b 100%);
  border-color: #c084fc;
}
.lb-bg--tsession_r20 {
  background: radial-gradient(ellipse at 80% 0%, rgba(232, 121, 249, 0.25), transparent 50%), #312e81;
  border-color: #a78bfa;
}
.lb-bg--tsession_r50 {
  background: #312e81;
  border-color: #818cf8;
}
.lb-bg--tsession_r100 {
  background: #4c1d95;
  border-color: #c4b5fd;
}

.profile-cpick.locked,
.profile-cpick:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.profile-cpick--season-claimed:not(.locked) {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 55%, transparent);
}

@keyframes lb-claim-pop {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  35% {
    transform: scale(1.07);
    filter: brightness(1.12);
  }
  70% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes lb-claim-ring {
  0% {
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--success) 0%, transparent),
      0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
  45% {
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--success) 45%, transparent),
      0 0 28px color-mix(in srgb, var(--accent) 50%, transparent);
  }
  100% {
    box-shadow:
      0 0 0 0 transparent,
      0 0 0 0 transparent;
  }
}

.profile-cpick-bg.profile-cpick--claim-celebrate {
  position: relative;
  z-index: 2;
  animation:
    lb-claim-pop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) 2,
    lb-claim-ring 0.9s ease-out 2;
}

@media (prefers-reduced-motion: reduce) {
  .profile-cpick-bg.profile-cpick--claim-celebrate {
    animation: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 50%, transparent);
  }
}

.lb-player-td {
  padding: 0.35rem 0.5rem !important;
  max-width: 19rem;
}

.lb-player-cell--table {
  flex-wrap: wrap;
  row-gap: 0.12rem;
}

.lb-row-bg-inline {
  flex: 0 0 auto;
  max-width: 100%;
}

.lb-player-cell--clickable {
  cursor: pointer;
  border-radius: 6px;
  margin: -0.12rem -0.2rem;
  padding: 0.12rem 0.2rem;
}

.lb-player-cell--clickable:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.lb-player-cell--clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.lb-player-cell--hero .lb-patch {
  font-size: 1.35rem;
  width: 1.55rem;
}

.lb-player-cell--hero .lb-name-text {
  font-size: 1.02rem;
  max-width: min(18rem, 100%);
}

.lb-player-hero {
  margin: 0.35rem 0 0.85rem;
}

.lb-player-meta .lb-player-hint-tools {
  font-size: 0.78rem;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.lb-player-boards {
  margin-top: 0.75rem;
}

.lb-player-card-toolbar {
  margin-bottom: 0.35rem;
}

.lb-player-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.admin-pick-hint {
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
}

.admin-pick-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-end;
}

.admin-pick-row--btns {
  align-items: center;
}

.admin-pick-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-pick-label--wide {
  flex: 1;
  min-width: min(100%, 14rem);
}

.admin-pick-input {
  width: 100%;
  min-width: 12rem;
  max-width: 24rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 0.88rem;
}

.admin-pick-select {
  min-width: 9rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
}

tr.lb-row--self {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

tr.lb-row--self td {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}

.lb-your-rank {
  margin-top: 0.65rem;
}

.leaderboard-card h2 {
  margin-top: 0;
}

.leaderboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.leaderboard-timers {
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--fg) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.leaderboard-timer-line {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.leaderboard-timer-line + .leaderboard-timer-line {
  margin-top: 0.35rem;
}

.leaderboard-timer-line--cooldown {
  font-family: var(--mono-font, ui-monospace, monospace);
  color: color-mix(in srgb, var(--accent) 75%, var(--fg));
}

.leaderboard-local-stats {
  margin: 0 0 0.85rem;
}

.leaderboard-local-stats__inner {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.leaderboard-subtabs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.lb-subtab {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.lb-subtab:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
}

.lb-subtab.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  color: var(--text);
}

.leaderboard-table-root .history-table-wrap {
  margin-top: 0;
}

@media (min-width: 520px) {
  .leaderboard-subtabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.history-page-card h2 {
  margin-top: 0;
}

.mode-history-details {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.mode-history-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  list-style: none;
}

.mode-history-summary::-webkit-details-marker {
  display: none;
}

.mode-history-summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.2s ease;
  margin-right: 0.25rem;
  color: var(--muted);
}

.mode-history-details[open] .mode-history-summary::before {
  transform: rotate(90deg);
}

.mode-history-inner {
  margin-top: 0.9rem;
}

.targets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.btn {
  font-family: var(--font);
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn--small {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
}

.btn--danger-ghost {
  border-color: color-mix(in srgb, #f87171 45%, var(--border));
  color: color-mix(in srgb, #fca5a5 90%, var(--text));
  background: transparent;
}

.btn--danger-ghost:hover {
  background: color-mix(in srgb, #f87171 12%, transparent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.targets-hud {
  font-size: 0.9rem;
  color: var(--muted);
}

.targets-hud strong {
  color: var(--text);
  font-family: var(--mono);
}

.targets-field {
  position: relative;
  height: 320px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  overflow: hidden;
}

.target-dot {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(
      circle at 30% 30%,
      var(--target-dot-highlight),
      transparent 50%
    ),
    var(--accent);
  border: 2px solid var(--target-dot-border);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(var(--target-dot-shadow), 0.35);
  transform: translate(-50%, -50%);
  animation: pop 0.2s ease;
}

@keyframes pop {
  from {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes badge-card-in {
  from {
    transform: translateY(18px) scale(0.94);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.badge-grid .badge {
  animation: badge-card-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger, 0) * 38ms);
}

@media (prefers-reduced-motion: reduce) {
  .badge-grid .badge {
    animation: none;
    animation-delay: 0s;
  }
}

.collection-hint-secondary {
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.data-reset-card {
  margin-top: 1rem;
}

.data-reset-card h2 {
  margin-top: 0;
}

.data-reset-btn {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
  color: var(--warn);
}

.data-reset-btn:hover {
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg));
}

.badge {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
  background: var(--bg);
  transition: border-color 0.15s, opacity 0.15s;
  font: inherit;
  color: inherit;
  width: 100%;
  cursor: pointer;
}

.badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.badge.locked {
  opacity: 0.45;
  filter: grayscale(0.85);
}

.badge.unlocked {
  border-color: color-mix(in srgb, var(--badge-color) 55%, var(--border));
}

.badge-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.badge-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.badge-rarity {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
  color: var(--badge-color);
}

.badge-desc {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.35;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: min(90vw, 400px);
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Просмотр нашивки */
.badge-viewer {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.badge-viewer.is-open {
  visibility: visible;
  opacity: 1;
}

.badge-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.badge-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  padding: 1.5rem 1.35rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  touch-action: pan-y;
}

.badge-viewer-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-viewer-close:hover {
  background: var(--border);
}

.badge-viewer-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.badge-viewer-icon {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 8px 24px color-mix(in srgb, var(--viewer-accent, var(--accent)) 40%, transparent));
}

.badge-viewer-panel.viewer-locked .badge-viewer-icon {
  opacity: 0.55;
  filter: grayscale(0.9);
}

.badge-viewer-status {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-viewer-status.is-unlocked {
  color: var(--success);
}

.badge-viewer-status.is-locked {
  color: var(--muted);
}

.badge-viewer-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-right: 2rem;
}

.badge-viewer-rarity {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--viewer-accent, var(--accent));
}

.badge-viewer-desc {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.badge-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.badge-viewer-nav-btn {
  min-width: 2.75rem;
  font-size: 1.1rem;
}

.badge-viewer-counter {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--mono);
}

body.badge-viewer-open {
  overflow: hidden;
}

body.reward-reveal-open {
  overflow: hidden;
}

body.update-notice-open {
  overflow: hidden;
}

.code-inline {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent);
}

.admin-broadcast-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-broadcast-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.5rem 0 0.35rem;
}

.admin-broadcast-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
  margin-bottom: 0.5rem;
}

/* Окно «новая версия» из announce.json */
.update-notice {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.update-notice.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.update-notice-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 40%, black);
  backdrop-filter: blur(4px);
}

.update-notice-inner {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  width: 100%;
}

.update-notice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 16px 48px color-mix(in srgb, black 35%, transparent);
}

.update-notice-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.update-notice-title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.update-notice-version {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}

.update-notice-body {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.update-notice-intro {
  margin: 0 0 0.5rem;
}

.update-notice-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.15rem;
}

.update-notice-list li {
  margin: 0.25rem 0;
}

.update-notice-footer {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
}

/* Вручение нашивки после раунда */
.reward-reveal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.reward-reveal.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.reward-reveal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 55% at 50% 42%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 52%),
    rgba(0, 0, 0, 0.9);
}

.reward-reveal-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
}

.reward-reveal-card {
  position: relative;
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--reward-accent, var(--accent)) 42%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--reward-accent, var(--accent)) 18%, transparent),
    0 28px 90px rgba(0, 0, 0, 0.65),
    0 0 80px color-mix(in srgb, var(--reward-accent, var(--accent)) 12%, transparent);
  opacity: 0;
  transform: scale(0.55) translateY(28px);
  filter: blur(6px);
}

.reward-reveal-card.anim-in {
  animation: reward-card-enter 0.72s cubic-bezier(0.33, 1.24, 0.52, 1) forwards;
}

.reward-reveal-card.anim-out {
  animation: reward-card-leave 0.36s ease-in forwards;
}

@keyframes reward-card-enter {
  0% {
    opacity: 0;
    transform: scale(0.52) translateY(32px);
    filter: blur(8px);
  }
  55% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes reward-card-leave {
  to {
    opacity: 0;
    transform: scale(0.9) translateY(-16px);
    filter: blur(5px);
  }
}

.reward-reveal-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--reward-accent, var(--accent));
  opacity: 0;
  transform: translateY(8px);
}

.reward-reveal-card.anim-in .reward-reveal-kicker {
  animation: reward-kicker-in 0.55s ease 0.08s forwards;
}

@keyframes reward-kicker-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reward-reveal-icon-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.85rem 0 1rem;
  min-height: 7rem;
}

.reward-reveal-icon-shell::before {
  content: "";
  position: absolute;
  width: 9rem;
  height: 9rem;
  left: 50%;
  top: 50%;
  margin-left: -4.5rem;
  margin-top: -4.5rem;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--reward-accent, var(--accent)) 55%, transparent) 0%,
    transparent 68%
  );
  animation: reward-pulse-glow 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes reward-pulse-glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

.reward-reveal-icon {
  position: relative;
  z-index: 1;
  font-size: clamp(4.5rem, 18vw, 6.25rem);
  line-height: 1;
  filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--reward-accent, var(--accent)) 35%, transparent));
  opacity: 0;
  transform: scale(0.2) rotate(-18deg);
}

.reward-reveal-card.anim-in .reward-reveal-icon {
  animation: reward-icon-slam 0.7s cubic-bezier(0.28, 1.35, 0.52, 1) 0.1s forwards;
}

.reward-reveal-icon:has(.reward-reveal-bg-swatch) {
  font-size: 1rem;
}

.reward-reveal-bg-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  min-height: 2.5rem;
  font-size: 1rem;
}

.reward-reveal-fallback-icon {
  font-size: clamp(3rem, 14vw, 4.5rem);
  line-height: 1;
}

@keyframes reward-icon-slam {
  0% {
    opacity: 0;
    transform: scale(0.15) rotate(-22deg);
  }
  65% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.reward-reveal-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.reward-reveal-rarity {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--reward-accent, var(--accent));
}

.reward-reveal-desc {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.reward-reveal-more {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--mono);
}

.reward-reveal-btn {
  min-width: 10rem;
  min-height: 46px;
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .reward-reveal-card,
  .reward-reveal-card.anim-in,
  .reward-reveal-card.anim-out {
    animation: none !important;
  }

  .reward-reveal-card.anim-out {
    opacity: 0;
    transform: translateY(-8px);
    filter: none;
  }

  .reward-reveal-card.anim-in {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .reward-reveal-kicker,
  .reward-reveal-card.anim-in .reward-reveal-kicker {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .reward-reveal-icon,
  .reward-reveal-card.anim-in .reward-reveal-icon {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .reward-reveal-icon-shell::before {
    animation: none;
    opacity: 0.7;
  }

  .reward-reveal-card {
    opacity: 0;
    transform: translateY(8px);
    filter: none;
  }

  .reward-reveal.is-open .reward-reveal-card.anim-in {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .reaction-zone {
    min-height: 220px;
  }

  .targets-field {
    height: min(52vh, 340px);
    min-height: 260px;
  }

  .target-dot {
    width: 54px;
    height: 54px;
  }

  .tab {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    min-height: 44px;
  }
}

/* --- Темы оформления (переключатель в шапке) --- */

html[data-theme="neon"] {
  --bg: #070710;
  --surface: #0f0f1a;
  --border: #3d2f6b;
  --text: #f4f0ff;
  --muted: #9a8ec4;
  --accent: #00e8ff;
  --success: #39ff14;
  --warn: #ff2da6;
  --rare: #c77dff;
  --epic: #ff5ec4;
  --ultimate: #ffe566;
  --common: #8b92b8;
  --on-accent: #050508;
  --title-font: "Orbitron", var(--font);
  --reaction-waiting-bg: #12101f;
  --reaction-waiting-fg: #8a7aaa;
  --reaction-ready-bg: #2a1030;
  --reaction-ready-fg: #ff6bcb;
  --reaction-ready-border: #ff2da6;
  --reaction-go-bg: #052818;
  --reaction-go-fg: #5cff3d;
  --reaction-go-border: #39ff14;
  --reaction-too-bg: #301018;
  --reaction-too-fg: #ff6b9d;
  --reaction-too-border: #ff4d7d;
  --target-dot-highlight: rgba(255, 255, 255, 0.45);
  --target-dot-border: rgba(0, 232, 255, 0.55);
  --target-dot-shadow: 0, 232, 255;
  --card-glow:
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 0 32px color-mix(in srgb, var(--accent) 12%, transparent);
  --header-title-shadow:
    0 0 18px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 42px color-mix(in srgb, #ff2da6 35%, transparent);
}

html[data-theme="neon"] body {
  background-image:
    radial-gradient(ellipse 90% 55% at 100% -10%, rgba(255, 45, 166, 0.14), transparent 52%),
    radial-gradient(ellipse 75% 50% at -5% 105%, rgba(0, 232, 255, 0.12), transparent 48%);
}

html[data-theme="void"] {
  --body-bg-image: none;
  --bg: #000000;
  --surface: #0a0a0a;
  --border: #242424;
  --text: #f2f2f2;
  --muted: #7a7a7a;
  --accent: #e8e8e8;
  --success: #6ee7a8;
  --warn: #f0c674;
  --rare: #c4b5fd;
  --epic: #fda4af;
  --ultimate: #fcd34d;
  --common: #9ca3af;
  --on-accent: #0a0a0a;
  --reaction-waiting-bg: #111111;
  --reaction-waiting-fg: #666;
  --reaction-ready-bg: #1a1510;
  --reaction-ready-fg: var(--warn);
  --reaction-ready-border: var(--warn);
  --reaction-go-bg: #0c1810;
  --reaction-go-fg: var(--success);
  --reaction-go-border: var(--success);
  --reaction-too-bg: #1a0c0c;
  --reaction-too-fg: #f87171;
  --reaction-too-border: #f87171;
  --target-dot-highlight: rgba(255, 255, 255, 0.2);
  --target-dot-border: rgba(255, 255, 255, 0.28);
  --target-dot-shadow: 232, 232, 232;
  --card-glow: none;
  --header-title-shadow: none;
}

html[data-theme="retro"] {
  --bg: #0a0d0a;
  --surface: #0d120d;
  --border: #1f3d28;
  --text: #b4ffc8;
  --muted: #3d6b4a;
  --accent: #7fff00;
  --success: #00ff66;
  --warn: #d4ff00;
  --rare: #66ffcc;
  --epic: #ffff66;
  --ultimate: #ffee33;
  --common: #5a8f6a;
  --on-accent: #061206;
  --font: "Share Tech Mono", ui-monospace, monospace;
  --mono: "Share Tech Mono", ui-monospace, monospace;
  --title-font: var(--font);
  --reaction-waiting-bg: #0c100e;
  --reaction-waiting-fg: #3d8f55;
  --reaction-ready-bg: #181808;
  --reaction-ready-fg: #d4ff00;
  --reaction-ready-border: #c8e600;
  --reaction-go-bg: #031a0f;
  --reaction-go-fg: #00ff88;
  --reaction-go-border: #00ff66;
  --reaction-too-bg: #1a0808;
  --reaction-too-fg: #ff6b6b;
  --reaction-too-border: #ff4444;
  --target-dot-highlight: rgba(180, 255, 200, 0.35);
  --target-dot-border: rgba(127, 255, 0, 0.5);
  --target-dot-shadow: 127, 255, 0;
  --card-glow: 0 0 0 1px rgba(127, 255, 0, 0.12);
  --header-title-shadow: 0 0 12px rgba(0, 255, 102, 0.35);
}

html[data-theme="retro"] body {
  background-image: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(0, 255, 80, 0.06), transparent 55%);
}

html[data-theme="retro"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.13) 2px,
    rgba(0, 0, 0, 0.13) 3px
  );
  opacity: 0.45;
}

html[data-theme="aurora"] {
  --bg: #0c1018;
  --surface: #141a26;
  --border: #2c3548;
  --text: #e9eef8;
  --muted: #8b96ab;
  --accent: #7dd3fc;
  --success: #6ee7b7;
  --warn: #fcd34d;
  --rare: #c4b5fd;
  --epic: #f9a8d4;
  --ultimate: #fde68a;
  --common: #94a3b8;
  --on-accent: #0c1220;
  --reaction-waiting-bg: #151d2a;
  --reaction-waiting-fg: #6b7c95;
  --reaction-ready-bg: #2a2318;
  --reaction-ready-fg: #fcd34d;
  --reaction-ready-border: #fbbf24;
  --reaction-go-bg: #0f241c;
  --reaction-go-fg: #6ee7b7;
  --reaction-go-border: #34d399;
  --reaction-too-bg: #28151f;
  --reaction-too-fg: #f9a8d4;
  --reaction-too-border: #f472b6;
  --target-dot-highlight: rgba(255, 255, 255, 0.35);
  --target-dot-border: rgba(125, 211, 252, 0.45);
  --target-dot-shadow: 125, 211, 252;
  --card-glow: 0 8px 28px rgba(15, 23, 42, 0.35);
  --header-title-shadow: none;
}

html[data-theme="aurora"] body {
  background-image:
    radial-gradient(ellipse 100% 70% at 85% 15%, rgba(167, 139, 250, 0.12), transparent 50%),
    radial-gradient(ellipse 90% 60% at 10% 90%, rgba(45, 212, 191, 0.1), transparent 45%),
    radial-gradient(ellipse 80% 50% at 50% 50%, rgba(125, 211, 252, 0.06), transparent 60%);
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="retro"] body::after {
    display: none;
  }
}
