/* ============================================================
   КормоКот — РАДИКАЛЬНЫЙ редизайн.
   Тёмная неоновая тема «закат»: глубокий плам-фон, градиенты
   коралл→розовый→фиолет, стекло (glassmorphism), свечение,
   орнамент из котов. Mobile-first, RTL через логические свойства.
   ============================================================ */

:root {
  --bg: #120b1e;             /* глубокий плам-чёрный */
  --bg-2: #1c1030;
  --surface: #1d1433;        /* непрозрачная панель (была «стеклянной» — убрано, чтобы фон не просвечивал) */
  --surface-solid: #1d1433;
  --surface-2: #2a1f47;      /* чуть светлее — для hover/выделений */
  --text: #f4ecff;
  --muted: #a99bc6;
  --accent: #ff5d8f;                        /* розовый акцент */
  --accent-dark: #ff8a4c;                   /* коралл (для hover/ссылок) */
  --accent-soft: rgba(255, 93, 143, .15);
  --grad: linear-gradient(135deg, #ff8a4c 0%, #ff4d8d 48%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,138,76,.22), rgba(168,85,247,.22));
  --border: rgba(255, 255, 255, .12);
  --on-accent: #1a0a14;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  --glow: 0 0 0 1px rgba(255,93,143,.35), 0 8px 28px rgba(255, 77, 141, .4);

  --fresh: #43e08a;          /* кормили < 24 ч — неоновый зелёный */
  --warm: #ffc24b;           /* 1–3 дня — янтарный */
  --old: #ff6b81;            /* > 3 дней / никогда — розово-красный */

  --radius: 22px;
  --radius-sm: 14px;
  --header-h: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);

  /* Орнамент: тайл с разными милыми котиками и лента для hero.
     cats-bg.png — растровый паттерн Романа; если файла нет, фон просто тёмный (видно сияние). */
  --cat-tile: url("../assets/cats-bg.png");
  --cat-band: url("../assets/cats-band.svg");
}

* { box-sizing: border-box; }

/* hidden должен побеждать любой display (flex/grid) у оверлеев */
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Слой 1: анимированные «северные сияния» — цветные пятна, медленно дышат */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 12% 8%,  rgba(255,138,76,.55), transparent 60%),
    radial-gradient(40% 38% at 88% 14%, rgba(255,77,141,.5),  transparent 60%),
    radial-gradient(46% 42% at 70% 96%, rgba(168,85,247,.55), transparent 60%),
    radial-gradient(40% 40% at 22% 92%, rgba(56,189,248,.32), transparent 60%);
  filter: blur(20px);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.04); }
}

/* Слой 2: орнамент из котов поверх затемнения.
   Тайл повторяется (width 520px, высота auto — пропорции картинки сохраняются).
   Затемняющий градиент держит текст читаемым; opacity слегка пропускает «сияние» снизу.
   Если у картинки видны стыки при повторе — заменить `520px auto repeat` на `center / cover no-repeat`. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .9;
  background:
    linear-gradient(180deg, rgba(18,11,30,.70), rgba(18,11,30,.84)),
    var(--cat-tile) center top / 520px auto repeat;
}

main { flex: 1; display: flex; flex-direction: column; position: relative; z-index: 0; }

h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin: .4em 0; }
h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: .3em 0 .6em; }
h3 { font-size: .78rem; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .12em; margin: 1.3em 0 .5em; }

.muted { color: var(--muted); font-size: .9em; }
.container { padding: 24px 16px; max-width: 1140px; margin-inline: auto; width: 100%; }

/* Страницы-контейнеры (рейтинг/достижения/корм/база знаний/о проекте) — собственная
   сплошная подложка, чтобы контент не лежал прямо на фоне-паттерне. Карточки внутри
   (--surface = #1d1433) светлее подложки и за счёт этого выделяются. Карта (.view-map)
   не container — остаётся во весь экран на фоне. */
.view.container {
  background: #160e26;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-block: 18px;
}

/* --- Шапка (стекло) ---------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding-inline: 18px;
  background: #160e26;
  border-block-end: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  margin-inline-end: auto;
}
.logo-icon { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255,77,141,.55)); }

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.nav-active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(255,77,141,.4);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Выпадающее меню языка с флагами */
.lang-dd { position: relative; }
.lang-dd-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.lang-dd-btn:hover { background: var(--surface-2); }
.lang-dd-btn .caret { color: var(--muted); }
.lang-dd-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.lang-dd-menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 175px;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 1300;
}
.lang-dd-menu.open { display: flex; }
.lang-dd-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: start;
  transition: background .15s;
}
.lang-dd-menu button:hover { background: var(--surface-2); }
.lang-dd-menu button.lang-active { background: var(--grad-soft); }

.flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}

.burger {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.burger:hover { background: var(--surface-2); }

@media (max-width: 680px) {
  .burger { display: block; }
  .nav {
    display: none;
    position: absolute;
    inset-block-start: var(--header-h);
    inset-inline: 0;
    flex-direction: column;
    background: var(--surface-solid);
    border-block-end: 1px solid var(--border);
    padding: 10px;
    box-shadow: var(--shadow);
  }
  .nav.nav-open { display: flex; }
  .nav a { padding: 13px 14px; border-radius: var(--radius-sm); }
}

/* --- Кнопки ------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 22px rgba(255, 77, 141, .42);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--glow); }
.btn-primary:disabled { opacity: .55; cursor: default; filter: grayscale(.3); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 15px; font-size: .85rem; }
.btn-link {
  background: none; border: 0; color: var(--accent-dark);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; padding: 4px;
}
.btn-link:hover { text-decoration: underline; }

/* --- Главная: hero + карта ---------------------------------- */

.view-map { display: flex; flex-direction: column; flex: 1; }

.hero {
  padding: 34px 18px 18px;
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  margin-block-end: 14px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 5vw, 2.9rem);
  line-height: 1.05;
  /* Градиентный текст */
  background: linear-gradient(135deg, #ffd0a8 0%, #ff7eb0 45%, #c79bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255,77,141,.25);
}
.hero p { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 1rem; }

/* Орнамент: лента разных милых котиков под приветствием */
.cat-band {
  height: 56px;
  margin: 22px auto 0;
  max-width: 660px;
  background: var(--cat-band) center bottom / auto 100% repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  filter: drop-shadow(0 0 8px rgba(255,138,76,.45));
}

.map-wrap {
  position: relative;
  width: min(100% - 32px, 1120px);
  height: clamp(380px, 60vh, 660px);
  margin-inline: auto;
  margin-block-end: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 60px rgba(168,85,247,.18);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  background: var(--bg-2);
  direction: ltr;
}
#map.map-placing { cursor: crosshair; }
/* Тайлы OSM приглушаем под тёмную тему */
#map .leaflet-tile-pane { filter: brightness(.78) saturate(1.05) contrast(1.02); }

.map-controls {
  position: absolute;
  z-index: 1000;
  inset-block-end: 26px;
  inset-inline-start: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.map-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(29, 20, 51, .8);
  backdrop-filter: blur(10px);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, transform .12s;
}
.map-btn:hover { background: var(--surface-2); transform: translateY(-1px); }

.map-legend {
  position: absolute;
  z-index: 1000;
  inset-block-start: 14px;
  inset-inline-start: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(29, 20, 51, .75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: .75rem;
  color: var(--muted);
}
.map-legend > span { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-fresh { background: var(--fresh); box-shadow: 0 0 8px var(--fresh); }
.dot-warm { background: var(--warm); box-shadow: 0 0 8px var(--warm); }
.dot-old { background: var(--old); box-shadow: 0 0 8px var(--old); }

.place-hint {
  position: absolute;
  z-index: 1000;
  inset-block-start: 16px;
  inset-inline: 0;
  margin-inline: auto;
  width: fit-content;
  max-width: 92%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(29, 20, 51, .92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding-block: 9px;
  padding-inline-start: 18px;
  padding-inline-end: 9px;
  box-shadow: var(--glow);
  font-size: .9rem;
}

/* --- Маркеры-лапки (со свечением) --------------------------- */

.paw-marker {
  width: 36px; height: 36px;
  border-radius: 50% 50% 50% 6px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 2px solid rgba(255,255,255,.85);
}
.paw-fresh { background: var(--fresh); box-shadow: 0 0 14px var(--fresh); }
.paw-warm { background: var(--warm); box-shadow: 0 0 14px var(--warm); }
.paw-old { background: var(--old); box-shadow: 0 0 14px var(--old); }

/* --- Панель точки: bottom sheet / боковая (стекло) ---------- */

.point-panel {
  position: fixed;
  z-index: 1200;
  background: rgba(29, 20, 51, .82);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  box-shadow: var(--shadow);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
  overflow-y: auto;

  inset-inline: 0;
  inset-block-end: 0;
  max-height: 74vh;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-block-end: 0;
  transform: translateY(100%);
}
.point-panel.panel-open { transform: translateY(0); }

.panel-grip {
  width: 42px; height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 10px auto 0;
  cursor: pointer;
}
.panel-close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s;
}
.panel-close:hover { color: var(--text); }
.panel-content { padding: 16px 22px 28px; }
.point-status { color: var(--accent-dark); font-weight: 700; font-size: .92rem; margin: 0 0 8px; }
.btn-feed { width: 100%; margin-block: 14px; font-size: 1.05rem; padding-block: 14px; }

@media (min-width: 768px) {
  .point-panel {
    inset-block: calc(var(--header-h) + 16px) 16px;
    inset-inline-end: 16px;
    inset-inline-start: auto;
    width: 396px;
    max-height: none;
    border-radius: var(--radius);
    transform: translateX(calc(var(--panel-dir, 1) * 115%));
  }
  [dir="rtl"] .point-panel { --panel-dir: -1; }
  .point-panel.panel-open { transform: translateX(0); }
  .panel-grip { display: none; }
}

/* --- Лента кормлений ----------------------------------------- */

.feeding-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.feeding-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.feeding-photo {
  width: 70px; height: 70px;
  object-fit: cover;
  border-radius: 11px;
  cursor: zoom-in;
  flex-shrink: 0;
  background: var(--surface-2);
}
.feeding-photo.img-broken { visibility: hidden; }
.feeding-meta { min-width: 0; font-size: .92rem; }
.feeding-meta p { margin: 3px 0 0; font-size: .88rem; overflow-wrap: break-word; }
.feeding-meta .muted { margin-inline-start: 6px; }

/* --- Формы и модалки (стекло) -------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(8, 4, 16, .6);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .18s;
}
.modal-backdrop.modal-open { opacity: 1; }
.modal-backdrop.modal-leaving { opacity: 0; }

.modal {
  position: relative;
  background: var(--surface-solid);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 60px rgba(168,85,247,.2);
  width: 100%;
  max-width: 430px;
  max-height: 86vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-end: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .8rem;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 26px; }

.form { display: grid; gap: 15px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; }
.form small { font-weight: 400; color: var(--muted); }
.form input, .form textarea, .form select {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
/* Селект — в том же стиле, тёмный нативный список */
.form select { color-scheme: dark; cursor: pointer; width: 100%; }
.form select option { background: var(--surface-solid); color: var(--text); }
.form input::placeholder, .form textarea::placeholder { color: var(--muted); }
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 93, 143, .28);
}
/* Поле пароля с кнопкой «показать пароль» */
.pwd-field { position: relative; display: block; }
.form .pwd-field input { width: 100%; padding-inline-end: 44px; }
.pwd-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 4px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: .75;
}
.pwd-toggle:hover { opacity: 1; }
.form-notice {
  background: var(--grad-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin: 0 0 4px;
  font-size: .88rem;
}

.photo-btn { width: 100%; }
.photo-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-block-start: 6px;
}

/* --- Профиль --------------------------------------------------- */

.profile-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-block-end: 14px;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.8rem; }

/* --- Рейтинг ----------------------------------------------------- */

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-block-end: 18px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: .88rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button.seg-active { background: var(--grad); color: #fff; }

.leaders { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.leader {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: transform .12s, border-color .15s;
}
.leader:hover { transform: translateX(2px); border-color: var(--accent); }
.leader-top {
  background: var(--grad-soft);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(255,77,141,.18);
}
.leader-rank { width: 30px; text-align: center; font-weight: 800; font-size: 1.1rem; }
.leader-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.leader-points { color: var(--accent-dark); font-weight: 800; font-size: .95rem; white-space: nowrap; }

/* --- Лайтбокс ------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 2, 8, .92);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity .2s;
}
.lightbox.lightbox-open { opacity: 1; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 80px rgba(168,85,247,.4);
}

/* --- Тосты и анимация «+1 балл» -------------------------------------- */

.toast-root {
  position: fixed;
  z-index: 2500;
  inset-block-end: 24px;
  inset-inline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  max-width: 92%;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--old); color: #2a0810; border-color: transparent; }
.toast-success { background: var(--fresh); color: #052113; border-color: transparent; }

.points-pop {
  position: fixed;
  z-index: 2600;
  inset-inline: 0;
  inset-block-start: 36%;
  margin-inline: auto;
  width: fit-content;
  background: var(--grad);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 18px 32px;
  border-radius: 999px;
  box-shadow: var(--glow);
  animation: pop 2.6s ease forwards;
  pointer-events: none;
}
@keyframes pop {
  0% { opacity: 0; transform: scale(.5); }
  12% { opacity: 1; transform: scale(1.12); }
  20% { transform: scale(1); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-34px); }
}

/* --- Мобильная адаптация ---------------------------------------- */

@media (max-width: 680px) {
  .header { padding-inline: 12px; gap: 8px; }
  .logo { font-size: 1rem; gap: 8px; }
  .logo-icon { width: 40px; height: 40px; }
  #authBtn {
    display: inline-block;
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
  }
  .lang-dd-btn { padding: 6px 10px; }

  /* Компактное приветствие: длинный текст и бейдж прячем,
     чтобы карта с кнопками влезала в первый экран телефона */
  .hero { padding: 12px 16px 6px; }
  .hero-badge { display: none; }
  .hero p { display: none; }
  .hero h1 { font-size: 1.3rem; }
  .cat-band { height: 34px; margin-block-start: 10px; }

  .map-wrap {
    width: 100%;
    /* Высота = экран минус шапка и компактное приветствие:
       кнопки внизу карты видны сразу, без прокрутки.
       svh учитывает панели мобильного браузера (vh — фолбэк). */
    height: calc(100vh - var(--header-h) - 132px);
    height: calc(100svh - var(--header-h) - 132px);
    min-height: 320px;
    border-radius: 0;
    border-inline: 0;
    margin-block-end: 20px;
  }

  .map-legend { font-size: .68rem; padding: 8px 10px; }
  .map-controls { inset-block-end: 18px; inset-inline-start: 12px; gap: 8px; }
  .map-controls .btn { font-size: .85rem; padding: 10px 15px; }
  .map-btn { width: 44px; height: 44px; }
  .place-hint { font-size: .82rem; }

  .container { padding: 18px 14px; }
  .modal-body { padding: 22px 18px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding-inline: 8px; }
}

/* ============================================================
   Купить корм
   ============================================================ */
.food-intro { color: var(--muted); max-width: 640px; }

.food-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
}
.food-country-field { display: flex; flex-direction: column; gap: 6px; }
.food-country-field > span { color: var(--muted); font-size: .85rem; }
.food-country {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .95rem;
  min-width: 240px;
  color-scheme: dark; /* тёмный нативный дропдаун */
}
.food-country option { background: var(--surface-solid); color: var(--text); }

.food-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.food-empty { color: var(--muted); padding: 24px 0; }
.food-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.food-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.food-shop-title { margin: 0; font-size: 1.05rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.food-price { color: var(--accent-dark); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.food-desc { margin: 0; color: var(--muted); font-size: .9rem; }
.food-go { align-self: flex-start; margin-top: 4px; }

/* Ряд полей цена/валюта/количество в форме */
.form-row { display: flex; gap: 10px; }
.form-row label { flex: 1; }
.form-row select { color-scheme: dark; }
@media (max-width: 480px) { .form-row { flex-wrap: wrap; } }

/* Блок «Наши авторы» на странице О проекте */
.authors { margin-top: 40px; text-align: center; }
.authors h2 { margin-bottom: 18px; }
.authors-grid {
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}
.author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
  max-width: 220px;
}
.author-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(255, 93, 143, .28);
}
.author-desc { color: var(--muted); font-size: .92rem; line-height: 1.45; }

@media (max-width: 600px) {
  .authors-grid { gap: 18px; }
  .author { max-width: 46%; }          /* по 2 в ряд на телефоне */
  .author-photo { width: 110px; height: 110px; }
  .author-desc { font-size: .85rem; }
}

/* ============================================================
   Памятки (#/guides): тема = заголовок + шаги «фото + текст»
   ============================================================ */
.guides-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 24px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.guide-name {
  margin: 0 0 18px;
  font-size: 1.3rem;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}
.guide-steps { display: flex; flex-direction: column; gap: 18px; }

.guide-step {
  display: flex;
  gap: 20px;
  align-items: center;
}
.guide-step:nth-child(even) { flex-direction: row-reverse; } /* чередуем фото слева/справа */
.guide-step--nophoto { display: block; } /* фото не загрузилось — текст на всю ширину */

.guide-photo {
  width: 320px;
  height: auto;          /* высота по пропорциям — фото видно целиком, без обрезки */
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent);
  background: var(--surface-solid);
  cursor: zoom-in;
}
.guide-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-line;
}

@media (max-width: 700px) {
  .guide-step, .guide-step:nth-child(even) { flex-direction: column; align-items: stretch; }
  .guide-photo { width: 100%; height: auto; }
}

/* ============================================================
   Достижения
   ============================================================ */
.ach-cats { margin-top: 18px; }
.ach-cat { margin-bottom: 24px; }
.ach-cat-title {
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 10px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
/* На широком экране 5 медалей типа помещаются в один ряд */
.ach-cat .ach-grid { grid-template-columns: repeat(5, 1fr); margin-top: 0; }
@media (max-width: 760px) { .ach-cat .ach-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 460px) { .ach-cat .ach-grid { grid-template-columns: repeat(2, 1fr); } }
.ach-desc-sm { color: var(--muted); font-size: .76rem; line-height: 1.3; margin-top: 2px; }
.ach-grid-sm { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.ach-badge {
  text-align: center;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.ach-off { opacity: .45; filter: grayscale(.75); }
.ach-medal {
  position: relative;
  width: 60px; height: 60px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 3px solid var(--border);
}
.ach-on .ach-medal { box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.ach-icon { font-size: 1.6rem; line-height: 1; }
.ach-img { width: 38px; height: 38px; object-fit: contain; display: block; }

/* Медаль с загруженной картинкой: без кружка/рамки, картинка крупнее */
.ach-has-img .ach-medal {
  width: 134px; height: 134px;
  max-width: 100%;
  border: none;
  background: none;
  box-shadow: none;
}
.ach-has-img .ach-img { width: 134px; height: 134px; max-width: 100%; }
.ach-has-img .ach-goal { right: 0; bottom: 0; }
.ach-goal {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 20px; padding: 1px 5px;
  border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: .72rem; font-weight: 700; color: var(--text);
}
.ach-name { font-weight: 600; font-size: .9rem; }
.ach-progress { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* Цвет медали по уровню */
.tier-bronze .ach-medal { border-color: #cd7f32; }
.tier-silver .ach-medal { border-color: #d6d6e0; }
.tier-gold   .ach-medal { border-color: #ffd700; }
.tier-plat   .ach-medal { border-color: #7fe7e0; }
.tier-accent .ach-medal { border-color: var(--accent); }

/* Медали рядом с именем в рейтинге */
.lb-medals { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.lb-medal-img { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.lb-medal {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; margin-inline-start: 4px;
  border-radius: 50%; font-size: .66rem;
  border: 2px solid var(--border); vertical-align: middle;
}
.lb-medal.tier-bronze { border-color: #cd7f32; }
.lb-medal.tier-silver { border-color: #d6d6e0; }
.lb-medal.tier-gold   { border-color: #ffd700; }
.lb-medal.tier-plat   { border-color: #7fe7e0; }
.lb-medal.tier-accent { border-color: var(--accent); }

/* Достижения в профиле */
.profile-ach-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 18px; }
.profile-ach-head h3 { margin: 0; }
.profile-ach { margin-top: 8px; }

/* Страница сброса пароля */
.reset-wrap { max-width: 440px; margin: 0 auto; padding: 48px 16px 64px; }
.reset-wrap h1 { margin-top: 0; }

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .points-pop { animation-duration: .01ms; }
}
