:root {
  color-scheme: dark;
  --bg: #0c121a;
  --page: #0c121a;
  --surface: #16212e;
  --surface-2: #1b2939;
  --surface-3: #213246;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f6f8ff;
  --text-soft: #d7deeb;
  --muted: #a6b3c3;
  --muted-2: #626d7f;
  --accent: #4b9fff;
  --accent-hover: #8cd8f6;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --accent-line: rgba(78, 164, 255, 0.36);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.14);
  --danger-line: rgba(255, 105, 97, 0.34);
  --matte: rgba(16, 18, 24, 0.94);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.28);
  --tabbar-clearance: calc(env(safe-area-inset-bottom) + 102px);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: auto;
  touch-action: auto;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, #191b22 0%, var(--page) 42%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
textarea,
select {
  font: inherit;
  font-size: 16px;
}

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

.app-shell {
  width: min(100%, 430px);
  min-height: var(--app-height, 100vh);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 14px 24px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065) 0%, rgba(255, 255, 255, 0) 24%),
    linear-gradient(180deg, #181a21 0%, var(--page) 48%, var(--bg) 100%);
  border-inline: 1px solid rgba(255, 255, 255, 0.045);
}

.view-stack {
  position: relative;
  min-width: 0;
}

.view-screen {
  position: relative;
  z-index: 1;
  min-width: 0;
  transform-origin: 50% 0;
}

.view-screen.is-entering {
  z-index: 2;
  opacity: 0;
  transform: translate3d(0, 6px, 0) scale(0.998);
  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: opacity, transform;
}

.view-screen.is-entering.from-right {
  transform: translate3d(8px, 0, 0) scale(0.998);
}

.view-screen.is-entering.from-left {
  transform: translate3d(-8px, 0, 0) scale(0.998);
}

.view-screen.is-entering.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.loader,
.auth-screen {
  min-height: min(72vh, calc(var(--app-height, 100vh) - 80px));
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

/* Экран загрузки — строго по центру всего вьюпорта (лого ровно посередине) */
.loader {
  min-height: var(--app-height, 100dvh);
}

.loader-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(229, 238, 248, 0.94) 100%);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 0 5px rgba(10, 132, 255, 0.1);
}

.loader-mark img {
  width: 52px;
  height: 52px;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(1.04) contrast(1.04);
}

.auth-screen p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-screen .title {
  white-space: normal;
}

.auth-screen .club-wordmark {
  width: min(100%, 220px);
  justify-content: center;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  margin-bottom: 18px;
}

/* Надпись клуба — отдельной строкой по центру всего хедера */
.topbar > .club-wordmark {
  justify-content: center;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(229, 238, 248, 0.94) 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.32),
    0 0 0 4px rgba(10, 132, 255, 0.08);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  filter: saturate(1.04) contrast(1.04);
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.top-avatar {
  flex: 0 0 auto;
}

.profile-trigger {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.top-avatar .avatar {
  margin-right: 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.club-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #38a8ff;
  font-family: "Avenir Next Condensed", "Arial Narrow", -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 8px;
  font-weight: 780;
  line-height: 1;
  text-transform: none;
}

.club-wordmark-line {
  width: 14px;
  height: 1px;
  flex: 0 0 14px;
  background: linear-gradient(90deg, rgba(56, 168, 255, 0), currentColor);
  opacity: 0.78;
}

.club-wordmark-line:last-child {
  background: linear-gradient(90deg, currentColor, rgba(56, 168, 255, 0));
}

.club-wordmark-text,
.club-wordmark-word {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.club-wordmark-text {
  flex: 0 1 auto;
  gap: 5px;
  overflow: hidden;
}

.club-wordmark-word {
  flex: 0 0 auto;
  gap: 2px;
}

.title {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill,
.status {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(28, 31, 40, 0.72);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-count {
  flex: 0 0 auto;
  padding-inline: 10px;
}

.status.red {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.section-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-card,
.panel,
.game-tile {
  scroll-margin-bottom: calc(env(safe-area-inset-bottom) + 96px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.026)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.game-tile {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.024)),
    rgba(30, 33, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.event-carousel {
  overflow: hidden;
  border-radius: 20px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.event-carousel.is-dragging {
  cursor: grabbing;
}

.event-carousel-track {
  display: flex;
  transform: translate3d(0, 0, 0);
  transition: transform 980ms cubic-bezier(0.2, 0.86, 0.22, 1);
  will-change: transform;
}

.app-shell > section {
  animation: screen-in 360ms cubic-bezier(0.18, 0.82, 0.2, 1);
}

.event-carousel-track.is-jump-reset {
  transition: none;
}

.event-carousel-track.is-dragging {
  transition: none;
}

.event-carousel-slide {
  flex: 0 0 100%;
  opacity: 0.42;
  transform: scale(0.982);
  transition:
    opacity 680ms ease,
    transform 980ms cubic-bezier(0.2, 0.86, 0.22, 1);
}

.event-carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.event-carousel .hero-card {
  height: 100%;
}

.hero-card {
  position: relative;
  min-height: unset;
  aspect-ratio: 16 / 9;
  padding: 18px;
  border-color: rgba(78, 176, 255, 0.4);
  overflow: hidden;
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px rgba(42, 151, 255, 0.12),
    0 0 20px rgba(24, 145, 255, 0.16),
    inset 0 0 18px rgba(38, 159, 255, 0.08);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.92) 0%, rgba(10, 13, 19, 0.78) 46%, rgba(10, 14, 22, 0.18) 100%),
    linear-gradient(135deg, rgba(10, 132, 255, 0.18) 0%, rgba(255, 255, 255, 0.018) 52%);
  pointer-events: none;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  /* Свечение статично на «пике», а дышит только opacity — так браузер не
     перерисовывает тень каждый кадр (композитинг на GPU), а вид тот же. */
  border: 1.5px solid rgba(123, 215, 255, 0.78);
  pointer-events: none;
  box-shadow:
    inset 0 0 14px rgba(111, 216, 255, 0.25),
    inset 0 0 34px rgba(10, 132, 255, 0.1),
    0 0 13px rgba(76, 190, 255, 0.38),
    0 0 34px rgba(38, 162, 255, 0.2);
  transform: translateZ(0);
  will-change: opacity;
  animation: game-neon-breathe 5.8s cubic-bezier(0.36, 0, 0.24, 1) infinite;
}

.hero-card.has-image {
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.78), rgba(8, 10, 14, 0.36) 48%, rgba(8, 10, 14, 0.04)),
    var(--card-bg),
    var(--surface);
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-size: auto, cover, auto;
}

.empty-hero .primary-action {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
}

.event-card {
  cursor: pointer;
}

.event-copy {
  width: min(62%, 240px);
}

.event-kicker {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.event-status {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(21, 24, 32, 0.78);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.hero-title {
  width: min(100%, 320px);
  margin: 0 0 12px;
  color: var(--text);
  /* адаптивный размер: длинные названия в 3 строки не вылезают за 16:9-карточку */
  font-size: clamp(17px, 4.6vw, 23px);
  line-height: 1.12;
  letter-spacing: 0;
}

.detail-card {
  margin-top: 10px;
}

.description-text {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

.back-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 720;
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-action {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  font-weight: 820;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.primary-action {
  color: #f8fbff;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  box-shadow:
    0 10px 22px rgba(10, 132, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary-action:hover {
  background: var(--accent-hover);
}

.secondary-action {
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
}

a.secondary-action,
a.primary-action,
a.danger-action,
a.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-action svg,
.primary-action svg,
.danger-action svg,
.ghost-action svg {
  width: 17px;
  height: 17px;
  margin-right: 5px;
  fill: currentColor;
  vertical-align: -3px;
}

.danger-action {
  color: var(--danger);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
}

.ghost-action {
  color: var(--muted);
  background: transparent;
}

.primary-action:active,
.secondary-action:active,
.danger-action:active,
.ghost-action:active {
  transform: scale(0.98);
}

.primary-action:disabled,
.secondary-action:disabled,
.danger-action:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.danger-action:focus-visible,
.ghost-action:focus-visible,
.tab-button:focus-visible,
.segment:focus-visible,
.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 20px;
}

.dot {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  opacity: 0.72;
  transition:
    width 260ms ease,
    background 260ms ease,
    opacity 260ms ease;
}

.dot.is-active {
  width: 24px;
  background: var(--accent);
  opacity: 1;
}

.panel {
  margin-top: 14px;
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
}

.panel-head > :first-child {
  min-width: 0;
}

.panel-title {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.link-button {
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.rank-list,
.list,
.grid {
  display: grid;
  gap: 10px;
}

.grid {
  padding-bottom: 24px;
}

.rating-showcase-panel {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 20px;
  border-color: rgba(82, 170, 255, 0.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 18%, rgba(30, 155, 255, 0.14), transparent 34%),
    radial-gradient(circle at 18% 78%, rgba(66, 183, 255, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(30, 44, 61, 0.58), rgba(8, 13, 22, 0.74) 56%, rgba(4, 8, 14, 0.82)),
    rgba(7, 12, 20, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rating-showcase-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 24%, rgba(221, 245, 255, 0.04) 0 1px, transparent 1.6px),
    radial-gradient(circle at 74% 62%, rgba(221, 245, 255, 0.035) 0 1px, transparent 1.7px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.035), transparent 38% 62%, rgba(30, 155, 255, 0.04));
  background-size: 92px 92px, 120px 120px, auto;
  opacity: 0.88;
}

.rating-showcase-panel > * {
  position: relative;
  z-index: 1;
}

/* A separate sky behind the original transparent iceberg and floating podium.
   Its size follows the panel width, so a long ranking list never stretches it. */
.rating-showcase-panel[data-sky="aurora"]::before {
  bottom: auto;
  aspect-ratio: 1 / 1.08;
  background:
    linear-gradient(180deg, rgba(3, 10, 24, .76), rgba(3, 10, 24, .14) 23%, transparent 52%, rgba(5, 12, 22, .48)),
    url("./assets/ranking-aurora-v1.webp") center top / cover no-repeat;
  opacity: 1;
  -webkit-mask-image: linear-gradient(#000 68%, transparent 100%);
  mask-image: linear-gradient(#000 68%, transparent 100%);
}

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

.rating-showcase-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  /* адаптивно: «Рейтинг — Сентябрь 2026» помещается в одну строку на телефоне */
  font-size: clamp(15px, 4.4vw, 22px);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.48);
}

.rating-showcase-link {
  flex: 0 0 auto;
  padding: 7px 2px 7px 10px;
  color: #2f9bff;
  font-size: 18px;
  font-weight: 760;
}

.rating-showcase-self {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.rating-showcase-self-gap {
  color: var(--muted, #8391a6);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 0.6;
  text-align: center;
}

.rating-podium-scene {
  position: relative;
  /* Пропорциональная высота от ширины: айсберг и карточки всегда
     совпадают на любой ширине экрана (адаптив подиума). */
  aspect-ratio: 1 / 0.87;
  display: block;
  margin: -6px -6px 8px;
  overflow: hidden;
  border-radius: 26px;
}

.rating-podium-scene::before {
  --ranking-iceberg-opacity: 0.96;
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: min(152%, 660px);
  height: 100%;
  transform: translateX(-50%);
  background: var(--ranking-iceberg-image, url("./assets/ranking-iceberg.png?v=20260827-podium-above-float")) center bottom / 100% auto no-repeat;
  opacity: 0.96;
  filter:
    saturate(1.12)
    contrast(1.05)
    drop-shadow(0 0 24px rgba(33, 155, 255, 0.3))
    drop-shadow(0 28px 34px rgba(3, 8, 14, 0.34));
  animation: ranking-iceberg-in 520ms ease both;
}

.rating-podium-scene::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 4px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(28, 147, 255, 0.28), transparent);
  filter: blur(16px);
}

.rating-showcase-panel[data-iceberg="modern"] .rating-podium-scene::before {
  filter: saturate(0.8) contrast(1.02)
    drop-shadow(0 0 20px rgba(77, 135, 174, 0.12))
    drop-shadow(0 24px 30px rgba(3, 8, 14, 0.3));
}

.rating-showcase-panel[data-iceberg="modern"] .rating-podium-scene::after {
  opacity: 0.45;
}

.rating-showcase-panel[data-iceberg="luminous"] .rating-podium-scene::before {
  filter: saturate(1.02) contrast(1.03)
    drop-shadow(0 0 24px rgba(24, 162, 255, 0.26))
    drop-shadow(0 28px 34px rgba(3, 8, 14, 0.34));
}

.rating-iceberg {
  --ranking-iceberg-opacity: 0.72;
  position: absolute;
  left: 50%;
  top: 76px;
  width: min(112%, 490px);
  height: 230px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 64%, rgba(66, 183, 255, 0.26), transparent 42%),
    linear-gradient(90deg, transparent, rgba(189, 232, 255, 0.08), transparent);
  opacity: 0.72;
  filter: blur(10px);
  animation: ranking-iceberg-in 580ms 60ms ease both;
}

.rating-podium-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  display: block;
  pointer-events: none;
}

.rating-podium-spacer {
  min-height: 150px;
}

.rating-podium-card {
  --rating-card-x: 0px;
  --rating-card-y: 0px;
  position: absolute;
  top: auto;
  bottom: 27.5%;
  left: 7.5%;
  width: clamp(82px, 26%, 96px);
  max-width: 96px;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  overflow: hidden;
  min-height: 136px;
  padding: 43px 8px 8px;
  pointer-events: auto;
  border: 2px solid rgba(118, 184, 255, 0.62);
  border-radius: 24px 24px 17px 17px;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  text-align: center;
  transform: translate(var(--rating-card-x), var(--rating-card-y));
  animation:
    ranking-card-in 460ms ease both,
    podium-card-float 5.8s 760ms cubic-bezier(0.36, 0, 0.24, 1) infinite;
}

.rating-podium-card::before {
  display: none;
}

.rating-podium-card.is-first {
  --rating-card-x: -50%;
  --rating-card-y: 0px;
  top: auto;
  bottom: 38%;
  left: 50%;
  /* Нижняя граница чуть меньше: на узких экранах (Android webview) рамка
     1-го места не «расползается» шире ледяного пьедестала. На iPhone/десктопе
     активен % (или кап 116px) — там ширина прежняя. */
  width: clamp(90px, 30%, 116px);
  max-width: 116px;
  min-height: 138px;
  padding-top: 40px;
  border-color: rgba(72, 178, 255, 0.96);
  border-radius: 30px 30px 19px 19px;
  background: transparent;
  box-shadow: none;
  animation-delay: 120ms, 680ms;
}

.rating-podium-card.is-second {
  --rating-card-x: 0px;
  --rating-card-y: 0px;
  top: auto;
  bottom: 27.5%;
  left: 1.5%;
  min-height: 114px;
  border-color: rgba(190, 213, 239, 0.74);
  animation-delay: 40ms, 1120ms;
}

.rating-podium-card.is-third {
  --rating-card-x: 0px;
  --rating-card-y: 0px;
  top: auto;
  bottom: 27.5%;
  right: 1.5%;
  left: auto;
  min-height: 114px;
  border-color: rgba(224, 151, 89, 0.78);
  animation-delay: 200ms, 1480ms;
}

.rating-place-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #f8fbff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)),
    rgba(77, 91, 107, 0.86);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.rating-podium-card.is-first .rating-place-badge {
  width: 30px;
  height: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    #128cff;
  box-shadow: 0 0 20px rgba(18, 140, 255, 0.54);
}

.rating-podium-card.is-third .rating-place-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    #a6673d;
}

.rating-podium-card.is-me {
  box-shadow: none;
}

.rating-podium-card.is-first.is-me {
  box-shadow: none;
}

.rating-crown {
  position: absolute;
  top: 55px;
  right: 14px;
  z-index: 2;
  color: #d89a1d;
  filter: drop-shadow(0 0 12px rgba(216, 154, 29, 0.5));
}

.rating-crown svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.rating-podium-card .rating-you-pill {
  display: none;
}

.rating-podium-card .avatar {
  position: relative;
  z-index: 2;
  margin-right: 0;
  border-color: rgba(70, 176, 255, 0.72);
  background: rgba(12, 24, 38, 0.92);
}

.rating-podium-card .avatar.is-podium-avatar {
  width: 48px;
  height: 48px;
  border-color: rgba(245, 196, 81, 0.44);
  box-shadow:
    0 0 0 1px rgba(66, 183, 255, 0.34),
    0 0 0 7px rgba(255, 255, 255, 0.08),
    0 0 32px rgba(47, 155, 255, 0.5);
}

.rating-podium-card .avatar.is-podium-small {
  width: 36px;
  height: 36px;
}

.rating-podium-card.is-second .avatar {
  border-color: rgba(184, 196, 212, 0.58);
}

.rating-podium-card.is-third .avatar {
  border-color: rgba(200, 134, 85, 0.58);
}

.rating-podium-name,
.rating-podium-score,
.rating-podium-sub {
  position: relative;
  z-index: 2;
  max-width: 100%;
  white-space: nowrap;
}

.rating-podium-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text);
  width: 100%;
  font-size: 13px;
  font-weight: 880;
  line-height: 1.08;
  overflow: visible;
  white-space: normal;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.96),
    0 0 8px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(40, 160, 255, 0.46);
}

.rating-podium-card.is-first .rating-podium-name {
  font-size: 16px;
}

/* 1-е место: имя в одну строку, чтобы карточка не росла вверх за панель. */
.rating-podium-card.is-first .rating-name-text {
  white-space: nowrap;
  overflow-wrap: normal;
}

.rating-podium-score {
  color: #32a1ff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.96),
    0 0 10px rgba(0, 0, 0, 0.76),
    0 0 20px rgba(50, 161, 255, 0.64);
}

.rating-podium-card.is-second .rating-podium-score {
  color: #b8c4d4;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.96),
    0 0 10px rgba(0, 0, 0, 0.76),
    0 0 16px rgba(184, 196, 212, 0.34);
}

.rating-podium-card.is-first .rating-podium-score {
  font-size: 25px;
}

.rating-podium-card.is-third .rating-podium-score {
  color: #d9904d;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.96),
    0 0 10px rgba(0, 0, 0, 0.76),
    0 0 18px rgba(217, 144, 77, 0.5);
}

.rating-podium-sub {
  display: none;
}

.rating-showcase-list {
  display: grid;
  gap: 7px;
}

.rating-list-row {
  display: grid;
  grid-template-columns: 34px 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(11, 20, 31, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 10px 22px rgba(0, 0, 0, 0.18);
  animation: ranking-row-in 360ms ease both;
}

.rating-list-row:nth-child(1) {
  animation-delay: 180ms;
}

.rating-list-row:nth-child(2) {
  animation-delay: 220ms;
}

.rating-list-row:nth-child(3) {
  animation-delay: 260ms;
}

.rating-list-row:nth-child(4) {
  animation-delay: 300ms;
}

.rating-list-row:nth-child(n + 5) {
  animation-delay: 340ms;
}

.rating-list-row.clickable-row:hover {
  background:
    linear-gradient(90deg, rgba(47, 155, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(11, 20, 31, 0.82);
}

.rating-list-row.is-me {
  border-color: rgba(66, 183, 255, 0.34);
  background:
    linear-gradient(90deg, rgba(30, 155, 255, 0.12), rgba(255, 255, 255, 0.028)),
    rgba(11, 20, 31, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 20px rgba(30, 155, 255, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.18);
}

.rating-podium-card.clickable-row:hover {
  background: transparent;
  border-color: rgba(96, 194, 255, 0.96);
  box-shadow: none;
}

.rating-podium-card.is-first.clickable-row {
  border-color: rgba(86, 181, 255, 0.96);
  background: transparent;
  box-shadow: none;
}

.rating-podium-card.clickable-row:active {
  transform: translate(var(--rating-card-x), var(--rating-card-y)) scale(0.985);
}

.rating-list-row.clickable-row:active {
  transform: scale(0.985);
}

.rating-list-row .avatar {
  width: 38px;
  height: 38px;
  margin-right: 0;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.rating-list-rank {
  color: #c2cee1;
  font-size: 20px;
  font-weight: 760;
  text-align: center;
}

.rating-list-main {
  min-width: 0;
}

.rating-list-name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 760;
  white-space: nowrap;
}

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

/* На подиуме имя целиком, без «…». Длинные ники, которые не влезают
   в строку, включаются «бегущей строкой» (fitPodiumNames в app.js). */
.rating-podium-card .rating-name-text {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: none;
}

.rating-podium-name.is-measuring,
.rating-podium-name.is-measuring .rating-name-text {
  white-space: nowrap;
}

.rating-podium-name.is-measuring {
  overflow: hidden;
}

.rating-podium-name.is-marquee {
  overflow: hidden;
  justify-content: flex-start;
}

.rating-podium-name.is-marquee .rating-name-text {
  white-space: nowrap;
  overflow-wrap: normal;
  will-change: transform;
  animation: podium-name-marquee 6.5s ease-in-out infinite alternate;
}

@keyframes podium-name-marquee {
  0%,
  14% {
    transform: translateX(0);
  }
  86%,
  100% {
    transform: translateX(var(--marquee-shift, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .rating-podium-name.is-marquee .rating-name-text {
    animation: none;
  }
}

/* Узкие экраны (напр. Android 359px): сцена подиума пропорционально ниже, а
   содержимое карточек было фиксированным по высоте — из-за этого рамка 1-го
   места «вырастала» до самой шапки. Здесь чуть уменьшаем контент, чтобы рамки
   оставались над ледяным пьедесталом. iPhone (390px+) и десктоп не затрагиваются. */
@media (max-width: 380px) {
  .rating-podium-card {
    padding-top: 32px;
    min-height: 108px;
    gap: 3px;
  }
  .rating-podium-card.is-first {
    padding-top: 30px;
    min-height: 116px;
  }
  .rating-podium-card .avatar.is-podium-avatar {
    width: 42px;
    height: 42px;
  }
  .rating-podium-card .avatar.is-podium-small {
    width: 32px;
    height: 32px;
  }
  .rating-podium-name {
    font-size: 12px;
  }
  .rating-podium-card.is-first .rating-podium-name {
    font-size: 14px;
  }
  .rating-podium-score {
    font-size: 18px;
  }
  .rating-podium-card.is-first .rating-podium-score {
    font-size: 21px;
  }
  .rating-podium-sub {
    font-size: 10px;
  }
}

.rating-you-pill {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(66, 183, 255, 0.28);
  border-radius: 999px;
  color: #8ed4ff;
  background: rgba(30, 155, 255, 0.1);
  font-size: 10px;
  font-weight: 820;
  line-height: 1;
  text-transform: lowercase;
}

.rating-list-sub {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(199, 210, 226, 0.62);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-list-score {
  color: #aebbd1;
  font-size: 18px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rating-list-arrow {
  display: grid;
  place-items: center;
  color: #f0a044;
}

.rating-list-arrow svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.rating-live-note {
  margin: 18px 0 1px;
  color: rgba(170, 182, 200, 0.72);
  font-size: 13px;
  font-weight: 520;
  text-align: center;
}

.rating-live-note span {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-left: 7px;
  border-radius: 50%;
  background: #2f9bff;
  box-shadow: 0 0 14px rgba(47, 155, 255, 0.82);
  vertical-align: middle;
}

.rating-empty-state {
  position: relative;
  min-height: 250px;
  display: grid;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  padding: 34px 20px 28px;
  border: 1px solid rgba(82, 170, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 56% 50%, rgba(30, 155, 255, 0.16), transparent 42%),
    rgba(8, 13, 22, 0.44);
}

.rating-empty-state::before {
  content: "";
  position: absolute;
  inset: auto -18% -32px -18%;
  height: 210px;
  background: var(--ranking-iceberg-image, url("./assets/ranking-iceberg.png?v=20260827-podium-above-float")) center bottom / contain no-repeat;
  opacity: 0.22;
  filter: saturate(0.88) blur(0.2px);
}

.rating-empty-state h3,
.rating-empty-state p {
  position: relative;
  z-index: 1;
  margin: 0;
}

.rating-empty-state h3 {
  max-width: 260px;
  color: var(--text);
  font-size: 28px;
  font-weight: 760;
  line-height: 1.1;
}

.rating-empty-state p {
  max-width: 250px;
  color: rgba(199, 210, 226, 0.68);
  font-size: 14px;
  line-height: 1.35;
}

.podium-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.podium-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.podium-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  padding: 14px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    var(--surface);
  text-align: center;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.podium-card.is-first {
  min-height: 164px;
  padding: 18px 12px;
  border-color: rgba(228, 177, 63, 0.38);
  background:
    linear-gradient(135deg, rgba(228, 177, 63, 0.2), rgba(255, 255, 255, 0.07) 44%),
    var(--surface);
}

.podium-card.is-second {
  border-color: rgba(154, 167, 183, 0.4);
}

.podium-card.is-third {
  border-color: rgba(200, 132, 85, 0.36);
}

.podium-place {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--text);
  background: rgba(20, 23, 30, 0.72);
  font-size: 13px;
  font-weight: 940;
}

.podium-crown {
  position: absolute;
  top: 9px;
  right: 12px;
  display: grid;
  place-items: center;
  color: #d89a1d;
}

.podium-crown svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  filter: drop-shadow(0 6px 10px rgba(216, 154, 29, 0.24));
}

.podium-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-card.is-first .podium-name {
  font-size: 18px;
}

.podium-score {
  color: var(--text);
  font-size: 14px;
  font-weight: 940;
}

.podium-sub {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.rating-rest-list {
  margin-top: 2px;
}

.rank-row,
.list-row,
.history-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rank-row.is-podium {
  position: relative;
  padding: 12px 10px 12px 12px;
  border: 1px solid var(--podium-border);
  border-radius: 18px;
  background:
    linear-gradient(90deg, var(--podium-soft), rgba(255, 255, 255, 0.05)),
    var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.rank-row.is-podium::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 999px;
  background: var(--podium);
  box-shadow: 0 0 14px var(--podium-glow);
}

.rank-row.is-rank-1 {
  --podium: #e4b13f;
  --podium-border: rgba(228, 177, 63, 0.46);
  --podium-soft: rgba(228, 177, 63, 0.16);
  --podium-glow: rgba(228, 177, 63, 0.32);
}

.rank-row.is-rank-2 {
  --podium: #9aa7b7;
  --podium-border: rgba(154, 167, 183, 0.46);
  --podium-soft: rgba(154, 167, 183, 0.18);
  --podium-glow: rgba(154, 167, 183, 0.26);
}

.rank-row.is-rank-3 {
  --podium: #c88455;
  --podium-border: rgba(200, 132, 85, 0.46);
  --podium-soft: rgba(200, 132, 85, 0.16);
  --podium-glow: rgba(200, 132, 85, 0.28);
}

.rank-row.is-podium .rank-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--podium-border);
  border-radius: 50%;
  color: #08090c;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0)),
    var(--podium);
  box-shadow: 0 8px 16px var(--podium-glow);
  font-size: 14px;
  font-weight: 940;
}

.clickable-row {
  border-radius: 16px;
  cursor: pointer;
  transition:
    background 0.16s ease,
    transform 0.16s ease;
}

.clickable-row:hover {
  background: rgba(10, 132, 255, 0.09);
}

.rank-row.is-podium.clickable-row:hover {
  background:
    linear-gradient(90deg, var(--podium-soft), rgba(255, 255, 255, 0.075)),
    var(--surface);
}

.clickable-row:active {
  transform: scale(0.99);
}

.rank-row:not(.is-podium):last-child,
.list-row:last-child,
.history-row:last-child {
  border-bottom: 0;
}

.list-row,
.history-row {
  grid-template-columns: 1fr auto;
}

.rank-number {
  color: var(--muted);
  font-size: 16px;
  font-weight: 820;
}

.avatar {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
  overflow: hidden;
}

.avatar[data-view-avatar] {
  cursor: pointer;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--avatar-position, 50% 50%);
}

.avatar.is-large {
  width: 58px;
  height: 58px;
  margin-right: 0;
  font-size: 18px;
}

.avatar.is-podium-avatar {
  width: 70px;
  height: 70px;
  margin-right: 0;
  border-width: 2px;
  box-shadow:
    0 14px 30px rgba(10, 132, 255, 0.22),
    0 0 0 7px rgba(228, 177, 63, 0.16);
  font-size: 22px;
}

.avatar.is-podium-small {
  width: 50px;
  height: 50px;
  margin-right: 0;
  font-size: 16px;
}

.profile-panel {
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profile-head > div {
  min-width: 0;
  overflow: hidden;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Кнопки профиля одинаковой ширины (на всю ширину) — ровно и аккуратно. */
.profile-actions > button {
  width: 100%;
}

/* Отступы в блоке «Приглашения», чтобы кнопка не наезжала на плитки и код. */
.referral-stats {
  margin-bottom: 14px;
}

.referral-actions {
  margin-bottom: 16px;
}

.referral-code {
  margin: 4px 0 12px;
}

.profile-editor {
  padding: 16px;
}

.profile-edit-form {
  gap: 12px;
}

.avatar-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.18), rgba(10, 132, 255, 0.04)),
    var(--surface-2);
  cursor: pointer;
}

.avatar-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-picker-preview {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-picker-preview.is-dragging {
  cursor: grabbing;
}


.avatar-picker-preview .avatar {
  pointer-events: none;
}

/* Крупнее превью — чтобы удобно кадрировать лицо перетаскиванием */
.avatar-picker-preview .avatar.is-large {
  width: 112px;
  height: 112px;
  font-size: 34px;
}

.avatar-picker-preview .avatar {
  box-shadow:
    0 12px 26px rgba(10, 132, 255, 0.24),
    0 0 0 6px rgba(10, 132, 255, 0.13);
}

.avatar-picker-copy {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.avatar-picker-copy strong {
  font-size: 14px;
  font-weight: 860;
}

.avatar-picker-copy small {
  color: var(--muted);
  font-size: 12px;
}

.profile-edit-actions {
  margin-top: 2px;
}

.danger-panel {
  border-color: var(--danger-line);
  background:
    linear-gradient(180deg, rgba(255, 69, 58, 0.13), rgba(255, 255, 255, 0.035)),
    var(--surface);
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.request-row:last-child {
  border-bottom: 0;
}

.request-user {
  min-width: 0;
  padding: 8px;
  margin: -8px;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  gap: 6px;
}

.compact-action {
  min-height: 34px;
  padding-inline: 11px;
  font-size: 12px;
}

.noshow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.noshow-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.avatar-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}

.avatar-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.avatar-viewer-dialog {
  position: relative;
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: rgba(22, 24, 31, 0.92);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.avatar-viewer-dialog img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  object-fit: contain;
  background: #07080b;
}

.avatar-viewer-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 860;
  text-align: center;
}

.avatar-viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  background: rgba(42, 47, 60, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.row-main {
  min-width: 0;
}

.row-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.row-score {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.tabs {
  --tab-gap: 6px;
  --tab-pad: 8px;
  --tab-indicator-x: 0px;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--tab-gap);
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(calc(100% - 24px), 402px);
  padding: var(--tab-pad);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(18, 20, 26, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.tab-indicator {
  position: absolute;
  top: var(--tab-pad);
  bottom: var(--tab-pad);
  left: var(--tab-pad);
  z-index: 0;
  width: calc(25% - 8.5px);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(105, 184, 255, 0.98), rgba(10, 132, 255, 0.96)),
    var(--accent);
  box-shadow:
    0 12px 26px rgba(10, 132, 255, 0.36),
    0 0 22px rgba(34, 163, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -10px 22px rgba(0, 73, 169, 0.16);
  transform: translate3d(var(--tab-indicator-x), 0, 0);
  transition:
    transform 560ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 260ms ease,
    box-shadow 360ms ease;
  will-change: transform;
  pointer-events: none;
}

.tabs.has-no-active .tab-indicator {
  opacity: 0;
}

.tabbar-spacer {
  height: var(--tabbar-clearance);
  flex: 0 0 auto;
}

.tab-button {
  position: relative;
  z-index: 1;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
  transition:
    color 260ms ease,
    filter 300ms ease,
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.tab-button:active {
  transform: scale(0.94);
}

.tab-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  transition:
    filter 300ms ease,
    transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.tab-button.is-active {
  color: #f8fbff;
  transform: translateY(-1px);
}

.tab-button.is-active:active {
  transform: translateY(-1px) scale(0.96);
}

.tab-button.is-active svg {
  filter: drop-shadow(0 4px 10px rgba(0, 50, 120, 0.32));
  transform: scale(1.05);
}

.game-tile {
  padding: 14px;
}

.event-list-card {
  cursor: pointer;
}

.game-list-card {
  width: 100%;
  padding: 16px;
}

.game-list-copy {
  width: min(60%, 236px);
}

.game-list-card .hero-title {
  margin-bottom: 12px;
  /* Адаптив: на узких экранах (Android webview) заголовок чуть уже, чтобы не
     заезжать под статус-пилюлю; на iPhone/десктопе — прежние 21px (кап). */
  font-size: clamp(18px, 5vw, 21px);
}

.game-list-card .meta-row {
  margin-bottom: 12px;
}

.event-seat-badge {
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 7px 12px;
  overflow: hidden;
  border: 1px solid rgba(47, 155, 255, 0.46);
  border-radius: 999px;
  color: #dff1ff;
  background:
    linear-gradient(180deg, rgba(38, 155, 255, 0.22), rgba(38, 155, 255, 0.08)),
    rgba(4, 11, 21, 0.54);
  box-shadow:
    0 0 18px rgba(47, 155, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.event-seat-badge svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.game-list-card .primary-action,
.game-list-card .danger-action {
  min-height: 38px;
  padding-inline: 13px;
}

.game-tile .meta-row {
  margin-bottom: 10px;
}

.admin-game-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.tournament-admin-panel {
  display: grid;
  gap: 12px;
}

.tournament-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric-box {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.metric-value {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 940;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-label {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.tournament-row:last-child {
  border-bottom: 0;
}

.blind-clock-panel {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
  border-color: rgba(70, 178, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.72), rgba(2, 5, 10, 0.9)),
    radial-gradient(circle at 50% 24%, rgba(45, 169, 255, 0.28), transparent 28%),
    radial-gradient(circle at 20% 72%, rgba(84, 202, 255, 0.12), transparent 26%),
    var(--blind-bg, none) center / cover no-repeat,
    linear-gradient(180deg, rgba(27, 35, 51, 0.82), rgba(6, 10, 17, 0.94));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 44px rgba(34, 157, 255, 0.08);
}

.blind-clock-panel > *:not(.blind-ambient) {
  position: relative;
  z-index: 1;
}

.blind-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.88;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, 0.055) 36% 37%, transparent 38%),
    radial-gradient(ellipse at 50% 82%, rgba(33, 169, 255, 0.28), transparent 38%),
    radial-gradient(ellipse at 82% 25%, rgba(71, 121, 255, 0.16), transparent 24%);
}

.blind-ambient::before,
.blind-ambient::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.blind-ambient::before {
  right: -42px;
  bottom: 76px;
  width: 150px;
  height: 150px;
  border: 16px solid rgba(61, 165, 255, 0.18);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.08),
    0 0 30px rgba(48, 156, 255, 0.14);
}

.blind-ambient::after {
  left: 20px;
  bottom: 46px;
  width: 72%;
  height: 82px;
  transform: rotate(-4deg);
  border: 1px solid rgba(101, 195, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(63, 179, 255, 0.07), transparent),
    rgba(2, 6, 12, 0.18);
}

.blind-clock-head {
  align-items: start;
  margin-bottom: 2px;
}

.blind-clock-head-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 0;
}

.blind-clock-head-actions .compact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 144px;
  min-height: 38px;
  padding-inline: 12px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.blind-clock-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}

.blind-clock-ring {
  display: grid;
  place-items: center;
  width: min(68vw, 268px);
  aspect-ratio: 1;
  border: 1px solid rgba(80, 188, 255, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(48, 167, 255, 0.26), transparent 36%),
    radial-gradient(circle, rgba(10, 14, 24, 0.42) 0 54%, rgba(4, 8, 15, 0.76) 55% 100%);
  box-shadow:
    0 0 34px rgba(30, 161, 255, 0.22),
    inset 0 0 28px rgba(89, 195, 255, 0.14),
    inset 0 0 70px rgba(0, 0, 0, 0.36);
}

.blind-clock-level {
  align-self: end;
  color: var(--accent);
  font-size: 15px;
  font-weight: 860;
  text-transform: uppercase;
}

.blind-clock-time {
  color: var(--text);
  font-size: clamp(48px, 15vw, 72px);
  font-weight: 940;
  letter-spacing: 0;
  line-height: 0.95;
  text-shadow:
    0 0 18px rgba(48, 169, 255, 0.34),
    0 16px 34px rgba(0, 0, 0, 0.5);
}

.blind-clock-sub {
  align-self: start;
  max-width: 80%;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blind-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.blind-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d8fff, #61c8ff);
  box-shadow: 0 0 16px rgba(47, 166, 255, 0.56);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.blind-values,
.blind-player-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.blind-player-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.blind-player-strip > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.blind-player-strip strong,
.blind-player-strip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blind-player-strip strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.blind-player-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.blind-level-form {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.blind-level-editor {
  display: grid;
  gap: 8px;
}

.blind-level-row {
  display: grid;
  grid-template-columns: 28px repeat(5, minmax(0, 1fr)) 30px;
  align-items: end;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.blind-level-row .field {
  gap: 4px;
}

.blind-level-row .field span {
  font-size: 10px;
}

.blind-level-row .field input {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 13px;
}

.blind-level-number {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(47, 156, 255, 0.16);
  font-size: 13px;
  font-weight: 880;
}

.blind-remove-level {
  width: 30px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.blind-participant-list {
  padding-top: 2px;
}

.blind-player-row {
  background: rgba(255, 255, 255, 0.035);
}

.table-map-panel {
  display: grid;
  gap: 12px;
}

.my-seat-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(47, 155, 255, 0.36);
  border-radius: 15px;
  color: var(--text-soft);
  background:
    linear-gradient(180deg, rgba(33, 150, 255, 0.16), rgba(33, 150, 255, 0.05)),
    rgba(8, 18, 33, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.my-seat-banner svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: var(--accent-hover);
}

.my-seat-banner strong {
  overflow: hidden;
  color: var(--accent-hover);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.table-box {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 8%, rgba(66, 182, 255, 0.13), transparent 48%),
    rgba(255, 255, 255, 0.035);
}

.table-box-center {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(47, 155, 255, 0.3);
  border-radius: 15px;
  color: var(--text);
  background: rgba(10, 132, 255, 0.12);
  box-shadow: inset 0 0 20px rgba(47, 155, 255, 0.1);
  font-size: 12px;
  font-weight: 820;
}

.table-seats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.table-seat {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 10px;
  font-weight: 840;
}

.table-seat.is-busy {
  color: #dbeeff;
  border-color: rgba(47, 155, 255, 0.34);
  background: rgba(47, 155, 255, 0.12);
}

.table-seat.is-mine {
  color: #fff;
  border-color: rgba(96, 205, 255, 0.92);
  background: linear-gradient(180deg, #55bdff, #0a84ff);
  box-shadow:
    0 0 18px rgba(47, 155, 255, 0.74),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.stat-box {
  min-width: 0;
  min-height: 80px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.stat-box.is-clickable {
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.stat-box.is-clickable:hover {
  border-color: var(--accent-line);
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.13), rgba(10, 132, 255, 0.04)),
    var(--surface-2);
}

.stat-box.is-clickable:active {
  transform: scale(0.985);
}

.stat-box.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stat-value {
  overflow: hidden;
  color: var(--text);
  font-size: 22px;
  font-weight: 940;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-label {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.segment {
  min-height: 36px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.segment.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.form {
  display: grid;
  gap: 10px;
}

.preset-preview {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(82, 186, 255, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.024)),
    rgba(17, 21, 30, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.22);
}

.preset-preview-image {
  display: grid;
  place-items: center;
  min-height: 112px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  color: var(--muted);
  background:
    radial-gradient(circle at 72% 52%, rgba(44, 169, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.016)),
    rgba(10, 14, 22, 0.9);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 28px rgba(10, 132, 255, 0.08);
}

.preset-preview.has-image .preset-preview-image {
  background:
    linear-gradient(90deg, rgba(4, 6, 10, 0.62), rgba(4, 6, 10, 0.2) 48%, rgba(4, 6, 10, 0.04)),
    var(--preset-bg),
    rgba(10, 14, 22, 0.9);
  background-position: center, center, center;
  background-size: auto, cover, auto;
}

.preset-preview-image span {
  font-size: 13px;
  font-weight: 800;
}

.preset-preview-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preset-preview-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-preview-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 13px;
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  color-scheme: dark;
}

.field input[type="date"],
.field input[type="datetime-local"] {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.35;
  text-align: left;
}

.field input[type="date"]::-webkit-date-and-time-value,
.field input[type="datetime-local"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  flex: 0 0 auto;
}

.file-field {
  overflow: hidden;
}

.file-field input {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-note {
  min-height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

select {
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.empty {
  padding: 22px 0;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 14px);
  z-index: 10;
  width: min(calc(100% - 32px), 390px);
  padding: 12px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: rgba(24, 27, 35, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.registration-screen {
  padding-inline: 8px;
}

.registration-form {
  width: min(100%, 330px);
  margin-top: 6px;
}

.telegram-fill-action {
  width: 100%;
}

.registration-avatar-picker {
  text-align: left;
}

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

@keyframes game-neon-breathe {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes ranking-iceberg-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.97);
  }

  to {
    opacity: var(--ranking-iceberg-opacity, 0.74);
    transform: translateX(-50%) scale(1);
  }
}

@keyframes ranking-card-in {
  from {
    opacity: 0;
    transform: translate(var(--rating-card-x), calc(var(--rating-card-y) + 12px)) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate(var(--rating-card-x), var(--rating-card-y)) scale(1);
  }
}

@keyframes podium-card-float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -5px;
  }
}

@keyframes ranking-row-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell > section,
  .event-carousel-track,
  .event-carousel-slide,
  .view-screen,
  .dot,
  .tab-button,
  .rating-podium-scene::before,
  .rating-iceberg,
  .rating-podium-card,
  .rating-list-row {
    animation: none;
    transition: none;
  }

  .hero-card::after {
    animation: none;
  }

  .blind-progress span {
    transition: none;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .tabs {
    width: calc(100% - 18px);
  }

  .status-pill {
    padding-inline: 9px;
  }

  .event-copy {
    width: min(68%, 220px);
  }

  .rating-showcase-panel {
    padding: 16px 10px 18px;
    border-radius: 26px;
  }

  .rating-showcase-link {
    font-size: 16px;
  }

  .rating-podium-scene {
    margin-inline: -2px;
  }

  .rating-podium-scene::before {
    top: auto;
    bottom: -4px;
    width: min(154%, 520px);
    height: 100%;
  }

  .rating-iceberg {
    top: 66px;
    height: 190px;
  }

  .rating-podium-stage {
    display: block;
  }

  .rating-podium-card {
    width: clamp(78px, 25%, 90px);
    max-width: 90px;
    min-height: 130px;
    padding: 42px 7px 8px;
    border-radius: 22px 22px 16px 16px;
  }

  .rating-podium-card.is-first {
    --rating-card-x: -50%;
    --rating-card-y: 0px;
    top: auto;
    bottom: 39%;
    left: 50%;
    width: clamp(96px, 30%, 108px);
    max-width: 108px;
    min-height: 164px;
    padding-top: 46px;
    border-radius: 26px 26px 18px 18px;
  }

  .rating-podium-card.is-second {
    --rating-card-x: 0px;
    --rating-card-y: 0px;
    top: auto;
    bottom: 27.5%;
    left: 1%;
  }

  .rating-podium-card.is-third {
    --rating-card-x: 0px;
    --rating-card-y: 0px;
    top: auto;
    bottom: 27.5%;
    right: 1%;
    left: auto;
  }

  .rating-podium-card .avatar.is-podium-avatar,
  .rating-podium-card .avatarx.is-podium-avatar {
    width: 52px;
    height: 52px;
  }

  .rating-podium-card .avatar.is-podium-small,
  .rating-podium-card .avatarx.is-podium-small {
    width: 34px;
    height: 34px;
  }

  .rating-podium-name {
    font-size: 12px;
  }

  .rating-podium-card.is-first .rating-podium-name {
    font-size: 15px;
  }

  .rating-podium-score {
    font-size: 18px;
  }

  .rating-podium-card.is-first .rating-podium-score {
    font-size: 25px;
  }

  .rating-list-row {
    grid-template-columns: 28px 34px minmax(0, 1fr) auto 14px;
    gap: 7px;
    padding: 9px 8px;
  }

  .rating-list-row .avatar,
  .rating-list-row .avatarx {
    width: 34px;
    height: 34px;
  }

  .rating-list-rank {
    font-size: 17px;
  }

  .rating-list-name {
    font-size: 15px;
  }

  .rating-list-score {
    font-size: 15px;
  }

  .rating-list-arrow svg {
    width: 15px;
    height: 15px;
  }

  .blind-clock-panel {
    padding-inline: 10px;
  }

  .blind-clock-ring {
    width: min(76vw, 244px);
  }

  .blind-player-strip {
    grid-template-columns: 1fr;
  }

  .blind-level-row {
    grid-template-columns: 28px repeat(2, minmax(0, 1fr)) 30px;
  }
}

/* Полноэкранный кроппер аватарки (как в Telegram) */
.avatar-cropper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 8, 14, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.avatar-cropper-panel {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: min(92vw, 380px);
}

.avatar-cropper-title {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
}

.avatar-cropper-stage {
  position: relative;
  width: min(84vw, 320px);
  height: min(84vw, 320px);
  overflow: hidden;
  border-radius: 20px;
  background: #05070c;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.avatar-cropper-stage:active {
  cursor: grabbing;
}

.avatar-cropper-img {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.avatar-cropper-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(4, 8, 14, 0.62);
  border: 2px solid rgba(120, 186, 255, 0.65);
}

.avatar-cropper-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  max-width: 300px;
}

.avatar-cropper-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.avatar-cropper-actions button {
  flex: 1;
}

/* Заметное уведомление по центру экрана */
.center-notice {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 14, 0.72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.center-notice-card {
  width: min(88vw, 360px);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(120, 186, 255, 0.14),
    0 0 40px rgba(24, 145, 255, 0.14);
}

.center-notice-icon {
  font-size: 42px;
  line-height: 1;
}

.center-notice-title {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.center-notice-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 300px;
}

.center-notice-card button {
  width: 100%;
  margin-top: 6px;
}

/* Онбординг: юридические согласия (блокирующий экран) */
.legal-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px
    calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: rgba(6, 10, 18, 0.92);
  backdrop-filter: blur(4px);
}
.legal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  border: 1px solid #2c3450;
  border-radius: 18px;
  background: #0e1320;
  overflow: hidden;
}
.legal-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid #1c2438;
}
.legal-step {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7688;
}
.legal-head h2 {
  margin: 4px 0 2px;
  font-size: 18px;
  color: #e7ecf5;
}
.legal-sub {
  font-size: 13px;
  color: #8b97ac;
}
.legal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 18px;
  -webkit-overflow-scrolling: touch;
}
.legal-body p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #cdd6e6;
}
.legal-body .legal-h {
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px solid #1c2438;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #7db4ff;
}
.legal-body .legal-h:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.legal-end {
  margin: 16px 0 4px;
  text-align: center;
  font-size: 12px;
  color: #5c6678;
}
.legal-foot {
  border-top: 1px solid #1c2438;
  background: #0b101b;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 14px);
}
.legal-scrollhint {
  margin-bottom: 10px;
  text-align: center;
  font-size: 12.5px;
  color: #ffb454;
}
.legal-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #e7ecf5;
  cursor: pointer;
}
.legal-agree input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: #2f9bff;
}
.legal-agree-off {
  opacity: 0.5;
  cursor: default;
}
.legal-actions {
  display: flex;
  gap: 10px;
}
.legal-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.legal-btn {
  flex: 1 1 auto;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.legal-btn-primary {
  background: #2f9bff;
  color: #fff;
}
.legal-btn-ghost {
  background: transparent;
  border: 1px solid #3a4664;
  color: #cbd5e8;
}
.legal-blocked {
  padding: 28px 22px;
  text-align: center;
}
.legal-blocked-icon {
  font-size: 40px;
}
.legal-blocked h2 {
  margin: 10px 0 8px;
  font-size: 18px;
  color: #e7ecf5;
}
.legal-blocked p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: #aeb8c9;
}
.legal-blocked .legal-btn {
  width: 100%;
}

/* ==== Наградные рамки аватара (сезонные ачивки) ==== */
/* Рамка не меняет размеров аватара: кольцо рисуется поверх, с выходом за край,
   поэтому в грид/флекс-строках аватар не сжимается в овал. */
/* Обёртка с внутренним паддингом: кольцо рисуется ВНУТРИ неё, поэтому не
   обрезается родителями с overflow:hidden (строки записи на игру) и всегда
   круглое. Обёртка = аватар + паддинг (квадрат). Отступ до имени — на обёртке. */
.avatar-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  box-sizing: content-box;
  padding: 3px;
  flex: 0 0 auto;
  isolation: isolate;
  line-height: 0;
  vertical-align: middle;
  margin-right: 8px;
  align-self: center;
  justify-self: center;
}
.top-avatar .avatar-frame,
.rating-podium-card .avatar-frame,
.rating-list-row .avatar-frame,
.frame-swatch .avatar-frame { margin-right: 0; }
.frame-swatch .frame-none .avatar { margin: 0; }
.avatar-frame > .avatar { position: relative; z-index: 2; margin: 0; }
.avatar-frame .af-ring,
.avatar-frame .af-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.avatar-frame .af-ring { z-index: 1; inset: 1px; }
.avatar-frame .af-glow { z-index: 0; inset: 0; }
.avatar-frame.is-podium-small { padding: 2px; }

@keyframes af-spin { to { transform: rotate(360deg); } }
@keyframes af-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Алмаз */
.avatar-frame.f-diamond .af-ring {
  background: conic-gradient(from 0deg, #dff3ff, #7fd4ff, #ffffff, #56e0ff, #ffffff, #7fd4ff, #dff3ff);
  animation: af-spin 4.5s linear infinite;
}
.avatar-frame.f-diamond .af-glow {
  box-shadow: 0 0 18px 2px rgba(191, 233, 255, 0.6);
  animation: af-pulse 2.6s ease-in-out infinite;
}
/* Золото — чемпион */
.avatar-frame.f-gold .af-ring {
  background: conic-gradient(from 0deg, #6b4a10, #ffcf5c, #fff4cf, #ffcf5c, #6b4a10, #ffcf5c, #6b4a10);
  animation: af-spin 7s linear infinite;
}
.avatar-frame.f-gold .af-glow { box-shadow: 0 0 18px 2px rgba(255, 207, 92, 0.55); animation: af-pulse 3.2s ease-in-out infinite; }
/* Серебро */
.avatar-frame.f-silver .af-ring {
  background: conic-gradient(from 0deg, #5b667a, #9fb0c9, #ffffff, #9fb0c9, #5b667a, #cbd6e6, #5b667a);
  animation: af-spin 9s linear infinite;
}
.avatar-frame.f-silver .af-glow { box-shadow: 0 0 14px 2px rgba(215, 224, 238, 0.4); }
/* Бронза */
.avatar-frame.f-bronze .af-ring {
  background: conic-gradient(from 0deg, #6a3c17, #e0975a, #ffcf9e, #e0975a, #6a3c17, #e0975a, #6a3c17);
  animation: af-spin 9s linear infinite;
}
.avatar-frame.f-bronze .af-glow { box-shadow: 0 0 13px 2px rgba(224, 151, 90, 0.4); }
/* Ледяное кольцо */
.avatar-frame.f-ice .af-ring {
  background: repeating-conic-gradient(from 0deg, #48b2ff 0 10deg, rgba(72,178,255,0.12) 10deg 26deg);
  animation: af-spin 12s linear infinite;
}
.avatar-frame.f-ice .af-glow { box-shadow: 0 0 16px 2px rgba(72, 178, 255, 0.45); animation: af-pulse 3.4s ease-in-out infinite; }
/* Полярное сияние */
.avatar-frame.f-aurora .af-ring {
  background: conic-gradient(from 0deg, #56e0ff, #66f0c0, #7fffc4, #4b8cff, #9b6bff, #56e0ff);
  animation: af-spin 8s linear infinite;
}
.avatar-frame.f-aurora .af-glow { box-shadow: 0 0 18px 2px rgba(102, 240, 192, 0.4); animation: af-pulse 4s ease-in-out infinite; }
/* Легенда */
.avatar-frame.f-legend .af-ring {
  background: conic-gradient(from 0deg, #b48bff, #ffcf5c, #56e0ff, #b48bff, #ffcf5c, #b48bff);
  animation: af-spin 6s linear infinite;
}
.avatar-frame.f-legend .af-glow { box-shadow: 0 0 20px 3px rgba(180, 139, 255, 0.5); animation: af-pulse 2.8s ease-in-out infinite; }
/* Корона */
.avatar-frame.f-crown .af-ring {
  background: conic-gradient(from 0deg, #6b4a10, #ffcf5c, #fff4cf, #ffcf5c, #6b4a10, #ffcf5c, #6b4a10);
  animation: af-spin 10s linear infinite;
}
.avatar-frame.f-crown .af-glow { box-shadow: 0 0 18px 2px rgba(255, 207, 92, 0.5); animation: af-pulse 3.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .avatar-frame .af-ring, .avatar-frame .af-glow { animation: none !important; }
}

/* Раздел выбора рамок в профиле */
.frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.frame-swatch {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  position: relative;
  min-height: 118px;
  text-align: center;
}
.frame-swatch:disabled { cursor: default; }
.frame-swatch.locked { opacity: 0.5; }
.frame-swatch.is-on {
  border-color: var(--accent-hover, #2f9bff);
  background: rgba(47, 155, 255, 0.12);
}
.frame-swatch .avatar,
.frame-swatch .frame-none .avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}
.frame-swatch-label {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.15;
}
.frame-swatch-sub {
  font-size: 11px;
  color: var(--text-soft, #8b97ac);
  line-height: 1.2;
}
.frame-swatch.is-on .frame-swatch-sub { color: var(--accent-hover, #2f9bff); }
.frame-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
}

/* В строках записи на игру убираем свечение рамки (обрезалось квадратом), кольцо оставляем */
.row-title .avatar-frame .af-glow { display: none; }

/* Аватар с PNG-рамкой (борода): 3 независимых слоя, рамка не влияет на layout */
.avatarx {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  overflow: visible;
  vertical-align: middle;
  flex: 0 0 auto;
}
/* Размеры-слоты зеркалят .avatar в тех же контекстах — рамка не меняет footprint. */
.avatarx.is-large { width: 100px; height: 100px; margin-right: 0; }
.avatarx.is-podium-avatar { width: 70px; height: 70px; margin-right: 0; }
.avatarx.is-podium-small { width: 50px; height: 50px; margin-right: 0; }
.top-avatar .avatarx { margin-right: 0; }
.rating-list-row .avatarx { width: 38px; height: 38px; margin-right: 0; }
.rating-podium-card .avatarx { margin-right: 0; }
.rating-podium-card .avatarx.is-podium-avatar { width: 48px; height: 48px; }
.rating-podium-card .avatarx.is-podium-small { width: 36px; height: 36px; }
.avatarx-photo {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
}
.avatarx-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--avatar-position, 50% 50%);
}
.avatarx-initial {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 900;
}
.avatarx-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
}

/* ─── Оформление (скины) ─── */
.skins-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 380px) {
  .skins-grid { grid-template-columns: repeat(3, 1fr); }
}
.skin {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  min-width: 0;
}
.skin.is-on { border-color: var(--sw, var(--accent)); box-shadow: 0 0 0 1px var(--sw, var(--accent)); }
.skin.locked { opacity: 0.5; cursor: default; }
.skin-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 4px 10px rgba(0, 0, 0, 0.3);
}
.skin-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skin-sub { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.1; }
.skin-lock { position: absolute; top: 6px; right: 8px; font-size: 11px; }

/* ─── Прошедшие игры (история во вкладке «Игры») ─── */
.past-games-section { margin-top: 22px; }
.past-game-card { opacity: 0.94; }
.past-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(21, 24, 32, 0.82);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}
.past-badge-muted { color: var(--muted); font-weight: 700; }
.past-badge-gold {
  color: #1b1405;
  background: linear-gradient(180deg, #ffd873, #f5c451);
  border-color: rgba(255, 216, 115, 0.6);
}
.past-badge-bronze {
  color: #f6f8ff;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.9), rgba(160, 96, 34, 0.9));
  border-color: rgba(205, 127, 50, 0.5);
}

/* ─── Переключатель «Ближайшие / Прошедшие» во вкладке «Игры» ─── */
.games-seg {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.games-seg-btn {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 820;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.games-seg-btn.is-on {
  background: var(--accent);
  color: #f8fbff;
  box-shadow: 0 6px 16px rgba(10, 132, 255, 0.28);
}

/* ─── Итоговая таблица завершённой игры (места 1..N) ─── */
.standing-row { display: flex; align-items: center; gap: 12px; }
.standing-rank {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.standing-rank-gold {
  color: #1b1405;
  background: linear-gradient(180deg, #ffd873, #f5c451);
  border-color: rgba(255, 216, 115, 0.6);
}
.standing-rank-bronze {
  color: #f6f8ff;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.92), rgba(160, 96, 34, 0.92));
  border-color: rgba(205, 127, 50, 0.5);
}
.standing-rank-out { color: var(--muted); }


/* Iceberg: shared visual language and profile collection, September 2026. */
body, .app-shell { background: var(--bg); }
.app-shell { width: min(100%, 480px); padding: calc(env(safe-area-inset-top) + 18px) 20px 18px; border: 0; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg.line-icon { fill: none !important; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 2px solid #8cd8f6; outline-offset: 4px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; background: transparent; color: var(--muted); border-radius: 12px; }
.icon-button svg { width: 25px; height: 25px; }
.section-label, .panel-title { text-transform: none; letter-spacing: -.02em; color: var(--text); }
.section-label { font-size: 23px; line-height: 1.25; font-weight: 730; }
.panel-title { font-size: 17px; font-weight: 700; line-height: 1.35; }
.panel, .game-tile { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.panel { padding: 18px; margin-top: 20px; }
.panel-head { margin-bottom: 14px; gap: 10px; }
.primary-action, .secondary-action, .ghost-action, .danger-action { min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 650; }
.primary-action { color: #fff; background: #247be0; border: 1px solid #4698f5; box-shadow: none; }
.primary-action:hover { background: #3188ed; }
.secondary-action { color: #9edcff; background: #172d44; border-color: #32526f; box-shadow: none; }
.ghost-action { background: transparent; }
.danger-action { box-shadow: none; }
.link-button { color: #8cd8f6; min-height: 44px; font-size: 13px; font-weight: 600; }
.status, .status-pill { font-size: 11px; font-weight: 600; border-color: var(--line); background: #1b2a3b; }
.row-sub { color: var(--muted); font-size: 13px; line-height: 1.5; }
.row-title { font-size: 15px; }
.eyebrow { color: #8eb4ca; font-size: 11px; line-height: 1.5; margin: 0 0 5px; }
.section-description { margin: 8px 0 20px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.page-heading { margin: 8px 0 22px; }
.page-heading h2 { margin: 0; color: var(--text); font-size: 28px; font-weight: 720; line-height: 1.2; letter-spacing: -.035em; }
.page-heading .section-description { margin-bottom: 0; }
.home-heading { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.home-heading .section-label { margin: 0; }
.home-heading .link-button { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.home-heading svg { width: 16px; height: 16px; fill: currentColor; }
.hero-card, .event-carousel { border-radius: 18px; }
.event-kicker { font-size: 11px; color: #bfcee0; }
.hero-title { font-weight: 730; letter-spacing: -.03em; }
.meta-chip { font-size: 11px; background: rgba(12,18,26,.6); border-color: rgba(173,201,229,.17); border-radius: 6px; }
.game-list-card { min-height: 200px; }
.event-status { font-size: 11px; }
.games-seg { margin-bottom: 20px; border-radius: 12px; padding: 4px; border: 1px solid var(--line); background: var(--surface); }
.games-seg-btn { min-height: 40px; border-radius: 9px; font-size: 14px; }
.games-seg-btn.is-on { background: #274761; box-shadow: none; color: #e6f7ff; }
.grid { gap: 16px; }
.empty { padding: 28px 16px; color: var(--muted); font-size: 14px; line-height: 1.6; display: grid; justify-items: center; gap: 8px; text-align: center; }
.empty strong { color: var(--text); font-size: 17px; }
.empty span { max-width: 290px; }
.empty .link-button { margin-top: 4px; }
.field input, .field select, .field textarea { background: #101c29; border-color: #304457; border-radius: 11px; }
.stats-grid { gap: 10px; }
.stat-box { background: #12202e; border: 1px solid #2a3b4d; border-radius: 12px; padding: 14px; box-shadow: none; }
.stat-value { font-size: 25px; font-weight: 700; }
.stat-label { font-size: 12px; line-height: 1.4; }
.tabs { --tab-gap: 4px; grid-template-columns: repeat(var(--nav-count,4),minmax(0,1fr)); width: min(100%,480px); bottom: 0; padding: 9px 12px calc(env(safe-area-inset-bottom) + 9px); border: 0; border-top: 1px solid #283746; border-radius: 0; background: rgba(13,22,32,.97); box-shadow: 0 -8px 24px rgba(0,0,0,.08); }
.tab-button { height: 50px; align-content: center; gap: 5px; border-radius: 10px; font-weight: 500; }
.tab-button svg { width: 21px; height: 21px; }
.tab-label { display: block; font-size: 10px; }
.tab-button.is-active { background: #172c40; color: #8cd8f6; transform: none; }
.tab-button.is-active svg { filter: none; transform: none; }
.tabbar-spacer { height: calc(env(safe-area-inset-bottom) + 82px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; color: var(--muted); background: transparent; font-size: 14px; }
.back-link svg { width: 18px; height: 18px; fill: currentColor; }
.profile-identity { display: flex; align-items: center; gap: 16px; margin: 10px 0 22px; }
.profile-identity > div { min-width: 0; }
.profile-identity .avatar, .profile-identity .avatarx { width: 70px; height: 70px; flex: 0 0 auto; margin: 0; }
.profile-identity h2 { margin: 0 0 5px; font-size: 23px; font-weight: 720; line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -.025em; }
.profile-identity .row-sub { margin: 0; font-size: 12px; }
.profile-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.profile-name-line .status { margin-bottom: 5px; flex: 0 0 auto; }
.profile-edit-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; }
.profile-edit-link svg { width: 16px; height: 16px; fill: currentColor; }
.profile-scoreboard { border: 1px solid #2d536f; border-radius: 16px; overflow: hidden; background: #142333; box-shadow: 0 0 22px rgba(24, 125, 191, .08), inset 0 1px rgba(143, 220, 255, .1); }
.profile-score-hero {
  display: flex;
  align-items: center;
  position: relative;
  padding: 20px;
  min-height: 148px;
  background-color: #0d1d2c;
  background-image: linear-gradient(90deg, rgba(7, 21, 35, .22), rgba(7, 21, 35, .1) 52%, transparent 78%), url("./assets/profile-score-iceberg-v1.png");
  background-size: cover;
  background-position: right center;
  border-bottom: 1px solid rgba(93, 172, 220, .22);
}
.profile-score-hero > div { position: relative; z-index: 1; min-width: 0; text-shadow: 0 2px 12px rgba(0, 12, 25, .8); }
.profile-score-hero > div > span { font-size: 14px; font-weight: 600; color: #b6e9ff; }
.profile-score-number { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 9px; font-size: 52px; line-height: 1.15; font-weight: 740; letter-spacing: -.06em; margin-top: 8px; overflow-wrap: anywhere; }
.profile-score-number small { font-size: 14px; color: #bfd5e6; font-weight: 400; letter-spacing: normal; }
.profile-metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); padding: 0 16px 14px; }
.profile-metrics > div { grid-column: span 2; padding: 14px 9px; min-width: 0; display: grid; gap: 6px; border-bottom: 1px solid #2a3d50; }
.profile-metrics > div:nth-child(n+4) { grid-column: span 3; border: 0; padding-bottom: 0; }
.profile-metrics strong { font-size: 21px; font-weight: 680; }
.profile-metrics span { font-size: 11px; color: #b1c0d0; line-height: 1.4; }
.collection-count { color: #8cd8f6; font-size: 13px; white-space: nowrap; }
.achievement-preview { padding-bottom: 0; }
.achievement-shelf { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.achievement-shelf > button { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; padding: 0; background: transparent; color: var(--text); font-size: 12px; line-height: 1.4; }
.achievement-shelf > .achievement-shelf-item { cursor: default; }
.achievement-shelf .achievement-art { width: 66px; height: 66px; }
.profile-collection-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 12px; border-top: 1px solid var(--line); background: transparent; color: #8cd8f6; font-size: 13px; }
.profile-collection-link svg { width: 16px; height: 16px; fill: currentColor; }
.profile-menu { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 0 16px; margin-top: 20px; }
.profile-menu-row { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 70px; padding: 14px 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; color: var(--text); }
.profile-menu-row:last-child { border: 0; }
.menu-icon { width: 24px; height: 24px; color: #a3bfd6; flex: 0 0 auto; }
.menu-icon svg { width: 24px; height: 24px; fill: currentColor; }
.menu-copy { display: grid; gap: 5px; flex: 1 1 auto; min-width: 0; }
.menu-copy strong { font-size: 14px; font-weight: 570; }
.menu-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.profile-menu-row > svg { width: 17px; height: 17px; fill: currentColor; color: #8198ac; flex: 0 0 auto; }
.menu-count { color: #9edbfa; font-size: 12px; min-width: 22px; text-align: center; }
.account-settings { margin-top: 28px; }
.profile-section > .panel:first-of-type { margin-top: 0; }
.player-profile > .back-link { margin-bottom: 8px; }
.player-friendship { margin: -4px 0 20px; }
.player-section + .player-section { border-top: 1px solid var(--line); }
.player-section > summary { list-style: none; cursor: pointer; border: 0; }
.player-section > summary::-webkit-details-marker { display: none; }
.player-section > summary::marker { content: ""; }
.player-section[open] > summary > svg { transform: rotate(90deg); }
.player-section > summary:focus-visible { outline: 2px solid #8cd8f6; outline-offset: 2px; border-radius: 10px; }
.player-section-content > .panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; margin: 0; padding: 0 0 16px; }
.player-section-content .empty { padding: 14px 0; }
.collection-summary { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 24px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; }
.collection-summary > div { display: grid; gap: 8px; min-width: 0; }
.collection-summary strong { font-size: 26px; font-weight: 720; letter-spacing: -.035em; }
.collection-summary strong small { font-size: 18px; font-weight: 500; color: #b7c9db; }
.collection-summary span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.collection-progress { display: block; height: 6px; width: 100%; background: #2e4155; border-radius: 99px; overflow: hidden; }
.collection-progress > span { display: block; height: 100%; border-radius: inherit; background: #74d1f4; transition: width 180ms ease; }
.collection-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-bottom: 24px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #111d2a; }
.collection-filters button { min-height: 40px; padding: 8px 3px; border-radius: 8px; background: transparent; color: #a6b3c3; font-size: 12px; font-weight: 600; }
.collection-filters button.is-active { background: #244760; color: #e7f8ff; }
.subsection-title { margin: 0 0 12px; font-size: 15px; font-weight: 650; color: var(--text); }
.nearest-section { margin-bottom: 25px; }
.achievement-next { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 12px; background: #182b3d; border: 1px solid #35526d; border-radius: 14px; text-align: left; color: var(--text); }
.achievement-next > svg { width: 18px; height: 18px; fill: currentColor; color: #8cd8f6; flex: 0 0 auto; }
.achievement-next .achievement-art { width: 60px; height: 60px; flex: 0 0 auto; }
.achievement-next-copy { display: grid; gap: 7px; flex: 1; min-width: 0; }
.achievement-next-copy > strong { font-size: 15px; }
.achievement-next-copy > span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.achievement-inline-progress { display: flex; align-items: center; gap: 12px; }
.achievement-inline-progress b { white-space: nowrap; color: #a9e7ff; font-size: 12px; font-weight: 650; }
.collection-heading { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 12px; }
.achievement-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.achievement-card { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; padding: 16px 14px; border: 1px solid #293d51; border-radius: 15px; background: var(--surface); text-align: left; color: var(--text); min-width: 0; transition: border-color 180ms ease, background 180ms ease; }
.achievement-card:hover { background: #1a2b3d; border-color: #607f99; }
.achievement-card.is-earned { border-color: #35576d; background: linear-gradient(155deg,#1a2f40,#16212e); }
.achievement-art { position: relative; display: grid; place-items: center; width: 80px; height: 80px; align-self: center; border-radius: 14px; overflow: hidden; }
.achievement-art > svg { display: none; width: 38px; height: 38px; fill: currentColor; color: #8cd8f6; }
.achievement-art.has-fallback > svg { display: block; }
.achievement-art img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
.achievement-art.is-muted img { filter: grayscale(.85) brightness(.9); }
.achievement-name { font-size: 15px; font-weight: 660; line-height: 1.3; overflow-wrap: anywhere; }
.achievement-condition { font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.achievement-card-footer { margin-top: auto; padding-top: 5px; display: grid; width: 100%; gap: 8px; }
.achievement-status { display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 1.4; color: #a6b3c3; }
.achievement-status svg { width: 15px; height: 15px; flex: 0 0 auto; fill: currentColor; }
.is-earned .achievement-status, .is-progress .achievement-status { color: #8cd8f6; }
.achievement-numbers { color: #b3c9dc; font-size: 11px; }
.collection-empty { border: 1px dashed #31495f; border-radius: 16px; }
.collection-empty > svg { width: 40px; height: 40px; fill: #779dbb; margin-bottom: 8px; }
body.award-open { overflow: hidden; }
.award-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(3,9,16,.76); padding: 24px 0 0; overscroll-behavior: contain; }
.award-dialog { width: min(100%,480px); max-height: calc(100dvh - 24px); max-height: calc(var(--app-height,100dvh) - 24px); overflow-y: auto; overscroll-behavior: contain; position: relative; border: 1px solid #35506a; border-bottom: 0; border-radius: 24px 24px 0 0; background: #172635; padding: 34px 24px calc(env(safe-area-inset-bottom) + 24px); box-shadow: 0 -20px 60px rgba(0,0,0,.2); text-align: center; }
.sheet-handle { position: absolute; top: 12px; left: calc(50% - 22px); width: 44px; height: 4px; border-radius: 4px; background: #60758b; }
.award-close { position: absolute; top: 18px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; color: #bbccdf; background: transparent; border-radius: 50%; }
.award-close svg { width: 22px; height: 22px; }
.achievement-detail-art { width: 128px; height: 128px; margin: 0 auto 20px; border-radius: 20px; }
.award-dialog h2 { margin: 0 0 12px; font-size: 27px; font-weight: 710; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.achievement-detail-status { display: inline-block; padding: 6px 12px; border: 1px solid #496176; border-radius: 99px; color: #bbccdf; font-size: 12px; }
.achievement-detail-status.is-earned, .achievement-detail-status.is-progress { color: #8cd8f6; border-color: #4d91b3; }
.award-condition { text-align: left; margin-top: 24px; }
.award-condition h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.award-condition p { font-size: 15px; color: #dce8f5; line-height: 1.5; margin: 0; }
.award-progress { margin-top: 20px; padding: 16px; border: 1px solid #385069; border-radius: 12px; background: #1c3043; text-align: left; }
.award-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 12px; }
.award-progress p { color: #b4c8da; font-size: 12px; margin: 10px 0 0; }
.award-explainer { font-size: 12px; color: var(--muted); line-height: 1.5; text-align: left; margin: 16px 0; }
.award-cta { width: 100%; min-height: 48px; margin-top: 4px; }
.frames-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.frame-swatch { border-radius: 14px; background: #142231; padding: 20px 12px 14px; min-height: 178px; gap: 12px; }
.frame-swatch.locked { opacity: 1; }
.frame-swatch.locked .avatar-frame { filter: saturate(.45); }
.frame-swatch-label { font-size: 14px; white-space: normal; line-height: 1.3; }
.frame-swatch-sub { font-size: 12px; line-height: 1.45; white-space: normal; }
.frame-lock svg { width: 16px; height: 16px; }
.frame-detail-avatar { display: grid; place-items: center; height: 128px; margin-bottom: 12px; }
.frame-detail-avatar .avatar { width: 90px; height: 90px; margin: 0; }
.frames-panel { padding: 0; border: 0; background: transparent; }
.frame-swatch .af-glow, .frame-swatch .af-ring { animation: none; }
@media (max-width: 359px) {
  .app-shell { padding-inline: 14px; }
  .brand-caption { font-size: 9px; }
  .achievement-grid { grid-template-columns: 1fr; }
  .achievement-card { min-height: 210px; }
  .profile-identity h2 { font-size: 21px; }
  .collection-summary { gap: 12px; padding: 14px; }
}
@media (min-width: 700px) {
  .app-shell { border-inline: 1px solid #1d2a38; }
  .award-overlay { align-items: center; padding: 24px; }
  .award-dialog { border: 1px solid #35506a; border-radius: 24px; max-height: calc(100dvh - 48px); padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Preserve the club signature: original iceberg, podium and motion. */
.rating-showcase-panel {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 20px;
  border-color: rgba(82, 170, 255, 0.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 18%, rgba(30, 155, 255, 0.14), transparent 34%),
    radial-gradient(circle at 18% 78%, rgba(66, 183, 255, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(30, 44, 61, 0.58), rgba(8, 13, 22, 0.74) 56%, rgba(4, 8, 14, 0.82)),
    rgba(7, 12, 20, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rating-showcase-panel { --surface: rgba(30,33,42,.84); --muted: #8e99aa; --accent: #0a84ff; --accent-hover: #2f9bff; }
.icon-button { padding: 0; aspect-ratio: 1; }
.icon-button svg { display: block; width: 26px; height: 26px; min-width: 26px; min-height: 26px; flex: 0 0 26px; }
html.award-open, body.award-open { overflow: hidden; overscroll-behavior: none; }
.achievement-art.is-atlas { overflow: hidden; background: transparent; border-radius: 0; }
.achievement-art.is-atlas img { position: absolute; width: 400%; height: 300%; max-width: none; object-fit: fill; left: calc(var(--badge-column) * -100%); top: calc(var(--badge-row) * -100%); border-radius: 0; }
.achievement-art.is-atlas.is-muted img { filter: grayscale(.95) brightness(.85); }
.achievement-card .achievement-art { width: 108px; height: 108px; }
.achievement-shelf .achievement-art { width: 76px; height: 76px; }
.achievement-next .achievement-art { width: 68px; height: 68px; }
.achievement-detail-art.is-atlas { width: 156px; height: 156px; }

/* User-supplied collection: equal optical bounds and a shared label baseline. */
.achievement-art.is-user-art { border-radius: 0; mix-blend-mode: lighten; }
.achievement-art.is-user-art img {
  border-radius: 0;
  transform: translate(var(--badge-x), var(--badge-y)) scale(var(--badge-scale));
  mix-blend-mode: normal;
}
.achievement-art.is-user-art img[hidden] { display: none; }
.achievement-shelf > button { grid-template-rows: 82px auto; align-items: start; }
.achievement-shelf .achievement-art { width: 82px; height: 82px; align-self: start; }
.achievement-shelf > button > span:last-child { min-height: 2.8em; display: flex; align-items: flex-start; justify-content: center; }
.achievement-detail-art.is-user-art { width: 156px; height: 156px; }
@media (max-width: 359px) {
  .achievement-shelf { gap: 6px; }
  .achievement-shelf > button { grid-template-rows: 68px auto; font-size: 11px; }
  .achievement-shelf .achievement-art { width: 68px; height: 68px; }
}

/* DEV companion fitting; the statistics remain a separate, readable layer. */
.profile-score-scene { position: relative; }
.profile-score-scene.has-companion { margin-top: 100px; }
.profile-dragon {
  position: absolute;
  width: 192px;
  height: 192px;
  top: -151px;
  right: 8px;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  filter: drop-shadow(0 5px 8px rgba(0, 10, 24, .55));
}
.profile-dragon.is-ready { opacity: 1; }
.profile-dragon[hidden], .profile-dragon img[hidden] { display: none; }
.dragon-sprite {
  position: absolute;
  inset: 0;
  display: block;
  background-image: url("./assets/companions/ice-dragon-sprite-v1.png");
  background-size: 300% 100%;
  background-repeat: no-repeat;
  transform-origin: 65% 77%;
}
.dragon-fallback { display: none; background-position: 100% 0; }
.profile-dragon.has-art-error .dragon-rig { display: none; }
.profile-dragon.has-art-error .dragon-fallback { display: block; }
/* The same body and articulated wings remain visible in flight and at rest. */
.dragon-rig, .dragon-wing, .dragon-wing-hinge {
  position: absolute; inset: 0; display: block; pointer-events: none;
}
.dragon-rig { transform-origin: 77% 79%; }
.dragon-rig img[hidden] { display: none; }
.dragon-body-art, .dragon-rig-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.dragon-body-art { object-fit: contain; z-index: 2; }
.dragon-rig-art { overflow: hidden; }
.dragon-wing { transform-origin: 70% 60%; }
.dragon-wing-far { z-index: 1; transform: translate(-2%, -2%) scale(.88); filter: brightness(.86); }
.dragon-wing-near { z-index: 3; }
.dragon-wing-hinge { transform-origin: 70% 60%; transform: perspective(500px) rotateX(0deg) rotateZ(-7deg) scale(.93, .22); backface-visibility: visible; }
.dragon-wing-far .dragon-wing-hinge { transform: perspective(500px) rotateX(0deg) rotateZ(-13deg) scale(.93, .22); }
.dragon-wing-art { transform: translate(-8.9%, -8.7%); }
.profile-dragon.is-flying, .profile-dragon.is-flying .dragon-rig, .profile-dragon.is-flying .dragon-wing-hinge { will-change: transform; }
.profile-dragon.is-resting .dragon-rig { animation: dragon-breathe 5s ease-in-out infinite; }
@keyframes dragon-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
.companion-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 5px 0 0; color: #829aaf; font-size: 10px; }
.companion-toolbar > span { flex: 1 1 135px; }
.companion-toolbar button { min-height: 44px; padding: 0 4px; font-size: 11px; background: transparent; color: #9bdcf7; }
.companion-fitting { text-align: center; }
.companion-tag { display: inline-block; padding: 6px 10px; border: 1px solid #355e7d; border-radius: 99px; color: #9bdcf7; font-size: 11px; }
.companion-portrait { position: relative; width: min(100%,280px); aspect-ratio: 1; margin: -35px auto -15px; pointer-events: none; }
.companion-portrait::before { content: ""; position: absolute; inset: 35% 0 10%; border-radius: 50%; background: radial-gradient(ellipse,rgba(20,130,228,.2),transparent 70%); }
.companion-stage { position: relative; width: min(100%,280px); aspect-ratio: 1; margin: 6px auto 0; overflow: hidden; }
.companion-stage::before { content: ""; position: absolute; inset: 40% 6% 8%; border-radius: 50%; background: radial-gradient(ellipse,rgba(20,130,228,.22),transparent 70%); }
.companion-stage .profile-dragon { position: absolute; inset: 0; top: 0; right: 0; width: 100%; height: 100%; }
.companion-fitting h3 { font-size: 23px; margin: 0 0 10px; }
.companion-fitting > button { display: block; width: 100%; min-height: 48px; margin-top: 10px; }
.companion-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 20px 0 0; }
.companion-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin: 0 0 20px; border: 1px solid #284157; border-radius: 15px; background: #0e1a26; }
.companion-choices button { min-height: 46px; border-radius: 10px; padding: 8px; background: transparent; color: #99b1c6; font-size: 12px; line-height: 1.3; }
.companion-choices button[aria-pressed="true"] { background: #223b50; color: #d7f4ff; box-shadow: inset 0 0 0 1px #4b7998; }
.companion-description { margin: 0 auto 18px; max-width: 260px; color: #9eb6c9; font-size: 13px; line-height: 1.55; }
.profile-score-scene.has-companion-geese { margin-top: 130px; }
.profile-geese { position: absolute; right: 2px; top: -141px; width: 256px; height: 148px; max-width: calc(100% - 4px); z-index: 2; pointer-events: none; user-select: none; opacity: 0; }
.profile-geese.is-ready { opacity: 1; }
.ice-goose { position: absolute; width: 54%; aspect-ratio: 1; bottom: 0; transform-origin: 50% 96%; filter: drop-shadow(0 4px 5px rgba(4,16,31,.5)); }
.ice-goose-0 { left: 0; z-index: 3; }
.ice-goose-1 { right: 0; z-index: 2; }
.goose-facing, .goose-idle, .goose-wing-hinge, .goose-neck-hinge { display: block; position: absolute; inset: 0; }
.goose-facing { transform: scaleX(-1); }
.goose-idle { transform-origin: 48% 96%; }
.goose-body, .goose-wing-art, .goose-neck-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* Articulated neck uses the same texture; a small overlap conceals the shoulder joint. */
.goose-body { clip-path: polygon(0 0, 60% 0, 60% 42%, 100% 52%, 100% 100%, 0 100%); }
.goose-neck-hinge { transform-origin: 73% 49%; z-index: 4; }
.goose-neck-art { clip-path: polygon(60% 0, 100% 0, 100% 54%, 64% 46%, 60% 42%); }
.goose-wing-hinge { transform-origin: 66% 57%; transform: perspective(420px) rotateX(0deg) rotateZ(-24deg) scale(.68,.27); }
.goose-wing-art { transform: translate(-18%,-22%); }
.profile-geese [hidden] { display: none !important; }
.profile-geese.is-flying .ice-goose, .profile-geese.is-flying .goose-wing-hinge { will-change: transform; }
.profile-geese.is-resting .goose-idle { animation: goose-lean 7s ease-in-out infinite; }
.profile-geese.is-resting .goose-neck-hinge { animation: goose-peek-at-score 7s ease-in-out infinite; }
.profile-geese.is-resting .goose-tag-pendant { animation: goose-tag-hang 7s ease-in-out infinite; }
.profile-geese.is-resting .ice-goose-1 .goose-idle,
.profile-geese.is-resting .ice-goose-1 .goose-neck-hinge,
.profile-geese.is-resting .ice-goose-1 .goose-tag-pendant { animation-delay: 2.9s; }
/* Each card hangs from its bird's neck, in front of the feathers. The text is
   unmirrored and the pendant counter-rotates as the goose looks down. */
.goose-tag { position: absolute; left: 61%; top: 34%; width: 28px; height: 49px; z-index: 5; }
.goose-tag::before { content: ""; position: absolute; top: 0; left: 4px; width: 20px; height: 7px; border: 1.5px solid #bddcf0; border-radius: 50%; box-shadow: 0 1px 2px #133656; }
.goose-tag-pendant { position: absolute; inset: 0; transform-origin: 50% 4px; }
.goose-tag-pendant::before { content: ""; position: absolute; top: 4px; left: 13px; width: 2px; height: 13px; background: linear-gradient(90deg,#597e9a,#e0f4ff); box-shadow: 1px 0 2px #0b2438; }
.goose-tag-card { position: absolute; top: 15px; left: 0; width: 28px; height: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 4px; border: 1px solid #c4ebff; background: linear-gradient(145deg,#f7fcff,#b7dcef); color: #153b56; box-shadow: 0 2px 5px #06192dc9, inset 0 0 0 2px #ffffff52; transform: scaleX(-1); }
.goose-tag-card::before { content: ""; position: absolute; top: 2px; left: calc(50% - 1.5px); width: 3px; height: 3px; border-radius: 50%; background: #61869f; }
.goose-tag-card strong { font-size: 17px; line-height: 1; font-weight: 850; margin-top: 3px; }
.goose-tag-card small { font-size: 11px; line-height: 1; }
.goose-tag-card.is-heart { color: #ac4260; }
.geese-sparkles { position: absolute; bottom: 2px; left: 18%; right: 18%; height: 22px; }
.geese-sparkles i { position: absolute; bottom: 0; left: calc(var(--spark) * 30%); width: 3px; height: 7px; border-radius: 50%; background: #c2f4ff; box-shadow: 0 0 8px #40b7ff; opacity: 0; }
.is-resting .geese-sparkles i { animation: goose-ice-spark 5.8s calc(var(--spark) * .18s) ease-out infinite; }
.companion-stage-geese { height: 215px; aspect-ratio: auto; }
.companion-stage-geese .profile-geese { top: auto; bottom: 31px; left: calc(50% - 128px); right: auto; }
.geese-perch { position: absolute; bottom: 31px; left: 12px; right: 12px; height: 10px; border-radius: 50%; border-top: 1px solid #83dfff; background: radial-gradient(ellipse,#3593c765,transparent 70%); box-shadow: 0 -6px 24px #1d8bcc26; }
@keyframes goose-lean {
  0%, 8%, 65%, 100% { transform: rotate(0deg) scaleY(1); }
  25%, 43% { transform: rotate(4deg) scaleY(.98); }
}
@keyframes goose-peek-at-score {
  0%, 8%, 65%, 100% { transform: rotate(0deg); }
  25%, 43% { transform: rotate(54deg); }
  34% { transform: rotate(58deg); }
}
@keyframes goose-tag-hang {
  0%, 8%, 65%, 100% { transform: rotate(0deg); }
  25%, 43% { transform: rotate(-54deg); }
  34% { transform: rotate(-58deg); }
}
@keyframes goose-ice-spark {
  0%, 25%, 100% { opacity: 0; transform: translate3d(0,0,0) scale(.3); }
  5% { opacity: .85; }
  22% { opacity: 0; transform: translate3d(4px,-22px,0) scale(.8); }
}
@media (prefers-reduced-motion: reduce) {
  .profile-dragon, .profile-dragon * { animation: none !important; }
  .profile-dragon, .profile-dragon .dragon-rig { transform: none !important; }
  .profile-geese, .profile-geese * { animation: none !important; transition: none !important; }
}

/* Clans: team identity, current public rating and owner applications. */
.clan-heading { margin: 12px 0 24px; }
.clan-heading h2 { font-size: 32px; margin: 8px 0; }
.clan-heading p:last-child { color: #9cbbce; margin-top: 8px; }
.clan-emblem { flex: 0 0 48px; width: 48px; height: 56px; display: inline-grid; place-items: center; position: relative; color: #79d6f5; }
.clan-emblem svg { width: 100%; height: 100%; fill: currentColor; opacity: .4; filter: drop-shadow(0 0 10px #4aabcc); }
.clan-emblem b { position: absolute; font-size: 11px; letter-spacing: .5px; color: #e3f8ff; }
.clan-emblem.is-large { width: 92px; height: 104px; flex-basis: 92px; }
.clan-emblem.is-large b { font-size: 17px; }
.clan-emblem.has-photo { height: 48px; border-radius: 14px; overflow: hidden; border: 1px solid #456277; box-sizing: border-box; background: #102130; }
.clan-emblem.has-photo.is-large { width: 96px; height: 96px; border-radius: 50%; }
.clan-emblem.has-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.team-avatar-editor { display: grid; justify-items: center; gap: 10px; margin: 12px 0 20px; }
.team-avatar-editor small { color: #8ea8b9; font-size: 11px; }
.team-avatar-pick { position: relative; display: inline-flex !important; align-items: center; gap: 8px; padding: 11px 14px; background: #1d3548; border: 1px solid #3c6179; border-radius: 10px; color: #c5e9fa !important; cursor: pointer; font-size: 13px !important; }
.team-avatar-pick svg { width: 17px; height: 17px; fill: currentColor; }
.team-avatar-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; cursor: pointer; }
.team-avatar-pick:focus-within { outline: 2px solid #80d8fa; outline-offset: 3px; }
.team-avatar-pick:has(input:disabled) { opacity: .55; pointer-events: none; }
.clan-intro { margin-bottom: 16px; display: flex; align-items: center; gap: 16px; background: radial-gradient(ellipse at 0 50%, #173c51, transparent 80%), #111e2b; border-color: #2e5368; }
.clan-intro h3 { font-size: 17px; margin: 0 0 8px; line-height: 1.4; }
.clan-intro p { color: #9cbbce; font-size: 13px; line-height: 1.6; margin: 0; }
.clan-create-cta { width: 100%; display: flex; gap: 10px; align-items: center; justify-content: center; }
.clan-create-cta svg { width: 20px; height: 20px; }
.clan-hint { color: #90a7b8; font-size: 12px; line-height: 1.6; margin: 12px 0 24px; }
.clan-own { display: grid; width: 100%; text-align: left; gap: 9px; padding: 20px; border: 1px solid #3b7690; border-radius: 16px; background: linear-gradient(120deg,#18394b,#14222e); color: #effaff; margin-bottom: 24px; }
.clan-own strong { font-size: 20px; overflow-wrap: anywhere; }
.clan-own > span:last-child { display: flex; align-items: center; color: #9ed9ef; font-size: 13px; }
.clan-own svg { fill: currentColor; width: 16px; height: 16px; margin-left: auto; }
.clan-list { display: grid; gap: 10px; }
.clan-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 12px; border: 1px solid #294050; background: #13212d; border-radius: 16px; text-align: left; color: #edf7ff; }
.clan-rank { width: 20px; flex-shrink: 0; color: #9eb9cb; font-size: 17px; font-weight: 700; }
.clan-row-copy { min-width: 0; flex: 1; display: grid; gap: 7px; }
.clan-row-copy strong { font-size: 15px; overflow-wrap: anywhere; }
.clan-row-copy small { font-size: 11px; color: #91abba; }
.clan-points { display: grid; gap: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.clan-points b { font-size: 18px; color: #b7ecff; }
.clan-points small { font-size: 11px; color: #91abba; }
.clan-empty { text-align: center; padding: 28px 20px; }
.clan-empty > svg { height: 38px; width: 38px; color: #83c7e4; margin: 10px; }
.clan-empty h3 { margin: 12px 0; }
.clan-empty p { color: #9cb1bf; font-size: 14px; line-height: 1.65; }
.clan-form { display: grid; gap: 20px; }
.clan-form label { display: grid; gap: 9px; color: #e8f3fa; font-size: 14px; }
.clan-form input, .clan-form textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #35546a; background: #101c28; border-radius: 10px; padding: 13px; color: #e8f3fa; font: inherit; }
.clan-form small { color: #92acbc; font-size: 12px; }
.clan-form-error { color: #ff9b9b; margin: 0; font-size: 13px; }
.clan-form-error:empty { display: none; }
.clan-hero { text-align: center; background: radial-gradient(ellipse at 50% 0,#20465b,transparent 70%), #131f2b; border-color: #355369; }
.clan-hero h2 { font-size: 28px; margin: 10px 0; overflow-wrap: anywhere; }
.clan-description { color: #a9bdca; line-height: 1.6; font-size: 14px; overflow-wrap: anywhere; }
.clan-stats { display: grid; grid-template-columns: 1.5fr 1fr 1fr; margin: 24px 0 10px; }
.clan-stats > div { display: grid; gap: 7px; padding: 6px; border-right: 1px solid #314a5c; }
.clan-stats > div:last-child { border: 0; }
.clan-stats strong { font-size: 26px; color: #d1f3ff; }
.clan-stats span { font-size: 11px; color: #a0b8c7; }
.clan-pending { color: #96d9ec; font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.clan-person { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 4px 0; background: none; color: inherit; border: none; text-align: left; }
.clan-person > img, .clan-person > .avatar, .clan-person > .avatar-wrap { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.clan-person > span:last-child { display: grid; gap: 6px; min-width: 0; }
.clan-person strong { font-size: 14px; overflow-wrap: anywhere; }
.clan-person small { font-size: 11px; color: #9cb4c4; }
.clan-member { padding: 12px 0; border-bottom: 1px solid #293d4e; }
.clan-member:last-child { border: none; }
.clan-member-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clan-member-main > b { color: #aeddef; font-size: 17px; white-space: nowrap; }
.clan-member-controls { margin-top: 10px; font-size: 12px; color: #8fa8b8; }
.clan-member-controls summary { cursor: pointer; padding: 8px 0; }
.clan-member-controls button { margin: 8px 0; width: 100%; }
.clan-application { padding: 14px 0; border-bottom: 1px solid #2a3e50; }
.clan-application .actions { margin-top: 12px; display: flex; gap: 8px; }
.clan-application .actions button { flex: 1; font-size: 13px; padding: 10px; }
.clan-footer { padding: 12px 0; display: grid; gap: 10px; }
.clan-footer > button { width: 100%; }
.clan-footer .clan-hint { margin: 0; }
.profile-clan { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; margin: 0 0 24px; background: #132b3a; border: 1px solid #2f5367; border-radius: 14px; color: #b6e6f7; text-align: left; }
.profile-clan > svg { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.profile-clan > svg:last-child { width: 16px; margin-left: auto; }
.profile-clan span { display: grid; gap: 5px; min-width: 0; }
.profile-clan strong { font-size: 14px; overflow-wrap: anywhere; }
.profile-clan small { font-size: 11px; color: #8eabba; }
.profile-clan > .clan-emblem { display: inline-grid; width: 36px; height: 40px; flex-basis: 36px; }
.profile-clan > .clan-emblem.has-photo { height: 36px; border-radius: 50%; }
.profile-clan > .clan-emblem b { font-size: 9px; }
@media (max-width: 370px) { .clan-row { gap: 7px; padding: 12px 9px; } .clan-row .clan-emblem { width: 36px; height: 44px; flex-basis: 36px; } .clan-points b { font-size: 15px; } .clan-intro { gap: 10px; } .clan-intro .is-large { width: 64px; flex-basis: 64px; } }
@media (max-width: 370px) { .clan-row .clan-emblem.has-photo { height: 36px; border-radius: 10px; } }

/* Уведомления: колокольчик в шапке + экран уведомлений */
.topbar-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.notification-bell { position: relative; }
.notification-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: #ff4d4f; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; border: 2px solid var(--bg, #0c121a); box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.notifications-page { padding-bottom: 8px; }
.notification-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 4px; }
.notification-list { display: grid; gap: 10px; margin-top: 12px; }
.notification-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; }
.notification-item.is-unread { border-color: var(--accent-line); background: #132537; }
.notification-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #16283a; color: #9edcff; }
.notification-icon svg { width: 22px; height: 22px; }
.notification-copy { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.notification-copy strong { font-size: 14px; font-weight: 700; }
.notification-copy span { font-size: 13px; color: var(--text-soft); overflow-wrap: anywhere; }
.notification-copy small { font-size: 11px; color: var(--muted); }
.notification-dot { flex: 0 0 auto; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.notification-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 18px; }
.notification-empty svg { width: 40px; height: 40px; color: var(--accent); }
.notification-more { width: 100%; margin-top: 12px; }

/* Скелет вкладки «Команды» — плавный вход без скачка «загрузка → контент» */
.clan-skeleton { display: grid; gap: 10px; margin-top: 20px; }
.clan-skeleton-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.clan-skeleton-badge { flex: 0 0 auto; width: 40px; height: 48px; border-radius: 10px; }
.clan-skeleton-lines { display: grid; gap: 8px; flex: 1 1 auto; }
.clan-skeleton-lines i { display: block; height: 12px; border-radius: 6px; }
.clan-skeleton-lines i:first-child { width: 55%; }
.clan-skeleton-lines i:last-child { width: 32%; }
.clan-skeleton-badge, .clan-skeleton-lines i { background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.12) 37%, rgba(255,255,255,.05) 63%); background-size: 400% 100%; animation: clan-skeleton-shimmer 1.4s ease infinite; }
@keyframes clan-skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .clan-skeleton-badge, .clan-skeleton-lines i { animation: none; } }

/* Команда доступна с 700 очков — заблокированное состояние создания */
.clan-locked { display: flex; align-items: flex-start; gap: 14px; margin-top: 16px; }
.clan-locked > svg { flex: 0 0 auto; width: 30px; height: 30px; color: var(--accent); opacity: .85; }
.clan-locked strong { display: block; font-size: 15px; font-weight: 750; margin-bottom: 6px; }
.clan-locked p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.45; }

/* Переключатель режимов рейтинга: Сезон · Общий · Друзья */
.rating-mode-switch { display: flex; gap: 4px; padding: 4px; margin: 2px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.04); }
.rating-mode-tab { flex: 1; min-height: 40px; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; cursor: pointer; transition: background .15s ease, color .15s ease; }
.rating-mode-tab.is-active { background: #247be0; color: #fff; }
.rating-mode-sub { margin: 0 0 12px; padding: 0 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Форма закрытия сезона (админка) */
.season-close-form { display: grid; gap: 10px; margin-top: 8px; }
.season-close-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

/* Брендовый сплэш-экран загрузки (пока грузится приложение) */
.splash { position: relative; gap: 16px; }
.splash-glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(40,130,235,.30), transparent 68%); filter: blur(12px); pointer-events: none; }
.splash-mark { position: relative; width: 104px; height: 104px; display: grid; place-items: center; border-radius: 26px; overflow: hidden; border: 1px solid rgba(255,255,255,.22); background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(229,238,248,.94) 100%); box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 5px rgba(10,132,255,.10), 0 0 44px rgba(40,130,235,.35); animation: splash-pulse 2.4s ease-in-out infinite; }
.splash-mark img { width: 104px; height: 104px; max-width: none; object-fit: cover; object-position: 50% 50%; filter: saturate(1.05) contrast(1.05); }
.splash-title { position: relative; font-size: 30px; font-weight: 850; letter-spacing: .34em; text-indent: .34em; color: #eaf3ff; }
.splash-sub { position: relative; font-size: 12px; font-weight: 600; letter-spacing: .26em; text-indent: .26em; text-transform: uppercase; color: #7fa6c8; }
.splash-divider { position: relative; width: 148px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #3aa8ff, transparent); animation: splash-shimmer 1.6s ease-in-out infinite; }
@keyframes splash-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes splash-shimmer { 0%,100% { opacity:.35; } 50% { opacity:1; } }
@media (prefers-reduced-motion: reduce) { .splash-mark, .splash-divider { animation: none; } }

/* Батл-пасс «Ледяной путь» (прототип) */
.bp-hero { text-align: center; background: linear-gradient(180deg,#0f2438,#0b1a2a); border-color: #2a4c68; }
.bp-level { display: flex; flex-direction: column; align-items: center; margin: 6px 0 14px; }
.bp-level span { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bp-level strong { font-size: 48px; font-weight: 850; line-height: 1; color: #eaf6ff; text-shadow: 0 0 22px rgba(58,168,255,.5); }
.bp-progress-bar { height: 8px; border-radius: 99px; background: #16324a; overflow: hidden; }
.bp-progress-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#2f8bff,#7fe0ff); }
.bp-progress-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.bp-note { margin: 14px 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.bp-track { display: grid; gap: 10px; position: relative; }
.bp-tier { display: grid; grid-template-columns: 44px 1fr; align-items: stretch; gap: 10px; }
.bp-rail { display: grid; place-items: center; position: relative; }
.bp-rail::before { content: ""; position: absolute; top: -10px; bottom: -10px; width: 2px; background: #1d3a52; }
.bp-tier:first-child .bp-rail::before { top: 50%; }
.bp-tier:last-child .bp-rail::before { bottom: 50%; }
.bp-node { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #7fa6c8; background: #10233a; border: 2px solid #2a4c68; }
.bp-tier.is-claimed .bp-node, .bp-tier.is-ready .bp-node { color: #fff; background: #247be0; border-color: #6fb2f6; }
.bp-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.bp-tier.is-ready .bp-card { border-color: var(--accent-line); background: #13273b; }
.bp-tier.is-locked .bp-card { opacity: .6; }
.bp-reward-icon { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #16283a; color: #9edcff; }
.bp-reward-icon svg { width: 22px; height: 22px; fill: currentColor; }
.bp-reward-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.bp-reward-copy strong { font-size: 14px; overflow-wrap: anywhere; }
.bp-reward-copy small { font-size: 11px; color: var(--muted); }
.bp-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.bp-badge svg { width: 14px; height: 14px; fill: currentColor; }
.bp-done { color: #57c98a; }
.bp-lock { color: var(--muted-2, #7f8a99); }
.bp-claim { flex: 0 0 auto; min-height: 36px; padding: 0 16px; border-radius: 10px; background: #247be0; color: #fff; border: 1px solid #4698f5; font-size: 13px; font-weight: 700; cursor: pointer; }

/* Любимая рука: карты, панель профиля, окно выбора */
.card-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 30px; height: 42px; border-radius: 6px; background: #f4f7fb; color: #0c1a2b; line-height: 1; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.card-chip b { font-size: 15px; }
.card-chip i { font-style: normal; font-size: 13px; }
.card-chip.is-red { color: #d33b4a; }
.fav-hand { display: inline-flex; gap: 6px; }
.fav-hand.is-big .card-chip { width: 58px; height: 80px; border-radius: 10px; }
.fav-hand.is-big .card-chip b { font-size: 27px; }
.fav-hand.is-big .card-chip i { font-size: 22px; }
.fav-hand-panel { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; margin: 0 0 12px; background: #132537; border: 1px solid #2f5367; border-radius: 14px; color: #b6e6f7; text-align: left; }
.fav-hand-panel > svg { width: 16px; margin-left: auto; fill: currentColor; flex-shrink: 0; }
.fav-hand-panel-copy { display: grid; gap: 6px; min-width: 0; }
.fav-hand-panel-copy small { font-size: 11px; color: #8eabba; }
.fav-hand-panel-copy strong { font-size: 14px; }
.fhp-overlay { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(4,10,20,.74); backdrop-filter: blur(4px); }
.fhp-dialog { width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; background: #0e1b29; border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px; text-align: center; }
.fhp-dialog h2 { margin: 0 0 6px; font-size: 20px; }
.fhp-sub { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.fhp-note { margin: 0 0 14px; font-size: 12px; color: #f0c27b; line-height: 1.4; padding: 8px 10px; background: rgba(240, 194, 123, 0.1); border: 1px solid rgba(240, 194, 123, 0.28); border-radius: 10px; }
.fav-hand-panel.is-locked { cursor: default; opacity: 0.92; }
.fhp-selected { min-height: 86px; display: grid; place-items: center; margin-bottom: 14px; }
.fhp-empty { font-size: 12px; color: var(--muted); }
.fhp-grid { display: grid; gap: 6px; }
.fhp-row { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.fhp-card { padding: 0; background: transparent; border: none; cursor: pointer; display: grid; place-items: center; }
.fhp-card .card-chip { width: 100%; height: 36px; border-radius: 5px; box-shadow: none; }
.fhp-card .card-chip b { font-size: 12px; }
.fhp-card .card-chip i { font-size: 10px; }
.fhp-card.is-selected .card-chip { outline: 3px solid #3aa8ff; box-shadow: 0 0 12px rgba(58,168,255,.6); }
.fhp-actions { display: flex; gap: 10px; margin-top: 16px; }
.fhp-actions > button { flex: 1; }

/* Любимая рука рядом с ником + переворот при открытии профиля */
.profile-identity-main { flex: 1 1 auto; min-width: 0; }
.fav-hand-nick { flex: 0 0 auto; margin-left: auto; display: inline-flex; gap: 6px; align-self: center; perspective: 700px; }
.fav-hand-nick.as-button { background: transparent; border: none; padding: 0; cursor: pointer; }
.fav-hand-add { flex: 0 0 auto; margin-left: auto; display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 10px; border: 1px dashed #3a5b78; border-radius: 10px; background: transparent; color: #8fb4d0; font-size: 11px; cursor: pointer; }
.fav-hand-add svg { width: 20px; height: 20px; fill: currentColor; }
.fav-hand-nick .card-chip { width: 40px; height: 56px; border-radius: 7px; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.fav-hand-nick .card-chip b { font-size: 18px; }
.fav-hand-nick .card-chip i { font-size: 15px; }
.fav-card-flip { display: inline-block; }
.fav-hand-nick.is-flip .fav-card-flip { animation: fav-flip .7s ease both; transform-origin: center; }
.fav-hand-nick.is-flip .fav-card-flip:nth-child(2) { animation-delay: .13s; }
@keyframes fav-flip { 0% { transform: rotateY(90deg); opacity: 0; } 55% { opacity: 1; } 100% { transform: rotateY(0deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fav-hand-nick.is-flip .fav-card-flip { animation: none; } }

/* Чекбокс в формах (нокаут-режим и т.п.) */
.field.field-check { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.field.field-check input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #f0c27b; }
.field.field-check span { font-size: 14px; }

/* Bounty Master — красная эксклюзивная рамка */
.avatar-frame.f-bounty-master .af-ring {
  background: conic-gradient(from 0deg, #5c0f0f, #ff4d4d, #ffe0e0, #ff4d4d, #5c0f0f, #ff4d4d, #5c0f0f);
  animation: af-spin 7s linear infinite;
}
.avatar-frame.f-bounty-master .af-glow { box-shadow: 0 0 18px 2px rgba(255, 77, 77, 0.5); animation: af-pulse 3.2s ease-in-out infinite; }

.trainer-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(75, 159, 255, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(20, 43, 61, 0.92), rgba(10, 20, 33, 0.92));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(178, 225, 255, 0.06);
  color: #eaf4ff;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.trainer-tile:active { transform: scale(0.985); }
.trainer-tile:hover { border-color: var(--accent-hover); }
.trainer-tile-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 22px;
  color: #cbe6ff;
  background: linear-gradient(135deg, rgba(75, 159, 255, 0.28), rgba(75, 159, 255, 0.08));
  border: 1px solid var(--accent-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.trainer-tile-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.trainer-tile-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.trainer-tile-title { font-size: 17px; font-weight: 740; color: #fff; line-height: 1.2; }
.trainer-tile-sub { font-size: 12.5px; color: #9fb4c9; line-height: 1.3; }
.trainer-tile-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--accent);
  opacity: 0.85;
}
.trainer-tile-arrow svg { width: 18px; height: 18px; }


/* Ушки — чёрная рамка с ушами (ручная выдача) */
.avatar-frame.f-ears .af-ring {
  background: radial-gradient(circle at 50% 28%, #2b2e35, #141519 46%, #050506 100%);
}
.avatar-frame.f-ears .af-glow {
  box-shadow: 0 0 15px 2px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.avatar-frame.f-ears .af-ring::before,
.avatar-frame.f-ears .af-ring::after {
  content: "";
  position: absolute;
  top: -30%;
  width: 52%;
  height: 52%;
  background: linear-gradient(155deg, #2e3139 0%, #0c0d10 72%, #050506 100%);
  clip-path: polygon(50% 0%, 6% 100%, 94% 100%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  box-shadow: inset 0 -6px 10px rgba(255, 255, 255, 0.04);
}
.avatar-frame.f-ears .af-ring::before { left: -5%; transform: rotate(-20deg); transform-origin: bottom center; }
.avatar-frame.f-ears .af-ring::after { right: -5%; transform: rotate(20deg); transform-origin: bottom center; }
