/* ===========================
   NASPORTE — CLEAN PROFESSIONAL THEME
   Inspired by: Strava, Linear, Notion
   =========================== */

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

:root {
  /* === АКЦЕНТ: тёмно-синий вместо фиолетового === */
  --primary: #1B3A6B;
  --primary-hover: #234a87;
  --primary-light: #2d5fa0;
  --primary-bg: #EEF3FA;
  --primary-border: #C5D6EE;

  --accent: #E8431A;   /* вторичный акцент — оранжево-красный */
  --accent-bg: #FEF0EC;

  /* Фоны */
  --bg: #F4F5F7;       /* чуть теплее, не чисто-белый */
  --bg2: #ECEDF0;
  --surface: #FFFFFF;
  --surface2: #F9FAFB;

  /* Текст */
  --text: #0F1923;     /* почти чёрный, не чисто */
  --text2: #5A6370;
  --text3: #9EA8B3;
  --text-inv: #FFFFFF;

  /* Границы */
  --border: #E2E5EA;
  --border2: #CDD2D8;

  /* Спорт — только dot-цвета, не фоны */
  --c-football: #1A7340;
  --c-basketball: #C2500A;
  --c-tennis: #A07A00;
  --c-volleyball: #1A4FAA;
  --c-hockey: #0A7A9A;
  --c-running: #5B31A0;
  --c-boxing: #B01818;
  --c-cycling: #0A7A6A;
  --c-swimming: #0A5A8A;
  --c-badminton: #9A6200;

  /* Статусы */
  --success: #1A7340;
  --warning: #C2500A;
  --danger: #B01818;

  /* Радиусы — НЕ одинаковые везде */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 50px;

  /* Тени — разные веса */
  --shadow-xs: 0 1px 2px rgba(15,25,35,0.06);
  --shadow-sm: 0 1px 4px rgba(15,25,35,0.07), 0 2px 8px rgba(15,25,35,0.04);
  --shadow-md: 0 4px 12px rgba(15,25,35,0.08), 0 1px 3px rgba(15,25,35,0.05);
  --shadow-lg: 0 8px 24px rgba(15,25,35,0.10), 0 2px 6px rgba(15,25,35,0.05);

  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

html, body {
  height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* =====================
   SPLASH
   ===================== */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* Один едва заметный блик — не градиент-шаблон */
.splash-bg {
  position: absolute; inset: 0;
  background: #FAFBFC;
}
.splash-bg::before {
  content: '';
  position: absolute; top: -120px; right: -80px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(27,58,107,0.06) 0%, transparent 70%);
}

.splash-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 28px; text-align: center; max-width: 400px; width: 100%;
}

.splash-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 48px; }
.logo-icon {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(27,58,107,0.25);
}
.logo-icon.small { width: 30px; height: 30px; border-radius: 9px; }
.logo-icon svg { filter: brightness(10); }
.logo-text { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.header-logo-text { font-size: 17px; }

.splash-title {
  font-size: 36px; font-weight: 800; line-height: 1.15;
  color: var(--text); letter-spacing: -1.5px; margin-bottom: 12px;
}
.splash-title span { color: var(--primary); }
.splash-sub { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 32px; max-width: 300px; }

.splash-sports {
  display: flex; gap: 12px; font-size: 22px; margin-bottom: 32px;
  color: var(--text2);
}

.splash-btn { width: 100%; max-width: 320px; font-size: 15px; padding: 14px 24px; margin-bottom: 10px; }

/* Цифры-факты на сплэше */
.splash-stats {
  display: flex; align-items: center; gap: 16px; margin-bottom: 32px;
  background: var(--bg); border-radius: var(--r-lg); padding: 14px 20px;
  border: 1px solid var(--border);
}
.splash-stat { text-align: center; }
.splash-stat strong { display: block; font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.splash-stat span { font-size: 11px; color: var(--text3); }
.splash-stat-div { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }

/* =====================
   КНОПКИ
   ===================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary); color: #fff; border: none; border-radius: var(--r-pill);
  padding: 12px 24px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition); font-family: inherit;
  box-shadow: 0 1px 4px rgba(27,58,107,0.2);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 3px 12px rgba(27,58,107,0.3); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.small { padding: 7px 16px; font-size: 13px; box-shadow: none; border-radius: var(--r-md); }
.btn-primary.full-width { width: 100%; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; color: var(--text2); border: 1.5px solid var(--border2);
  border-radius: var(--r-pill); padding: 11px 22px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost.full-width { width: 100%; }

.btn-outline-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary-bg); color: var(--primary); border: none;
  border-radius: var(--r-md); padding: 7px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-outline-primary:hover { background: var(--primary); color: white; }

/* =====================
   AUTH MODAL
   ===================== */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(15,25,35,0.5); backdrop-filter: blur(6px); }
.modal-box {
  position: relative; background: #fff; border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 26px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: slideUp var(--transition) both;
}
@keyframes slideUp { from{transform:translateY(36px);opacity:0} to{transform:translateY(0);opacity:1} }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg); border: none; color: var(--text2);
  width: 30px; height: 30px; border-radius: 50%; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modal-close:hover { background: var(--bg2); color: var(--text); }

.modal-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }

.auth-tabs {
  display: flex; background: var(--bg); border-radius: var(--r-md); padding: 3px; gap: 3px; margin-bottom: 20px;
}
.auth-tab { flex: 1; padding: 8px; border: none; background: transparent; color: var(--text2); border-radius: var(--r-sm); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; }
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); font-weight: 600; }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text2); }
.form-input {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); padding: 10px 13px;
  font-size: 14px; font-family: inherit; transition: var(--transition); outline: none; width: 100%;
}
.form-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(27,58,107,0.08); }
.form-input::placeholder { color: var(--text3); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 90px; }

.auth-divider { text-align: center; position: relative; margin: 16px 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { position: relative; background: #fff; padding: 0 12px; color: var(--text3); font-size: 12px; }

.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  padding: 10px; border-radius: var(--r-sm); border: 1.5px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer;
  transition: var(--transition); margin-bottom: 8px; font-family: inherit; font-weight: 500;
}
.btn-social:hover { border-color: var(--primary); }
.btn-social .si { display: inline-flex; width: 20px; height: 20px; border-radius: 5px; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: white; }
.btn-social.vk .si { background: #0077FF; }
.btn-social.google .si { background: white; border: 1px solid var(--border); color: #EA4335; font-size: 13px; }

/* =====================
   APP LAYOUT
   ===================== */
.app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}

/* HEADER */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; background: #fff;
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 100; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-right { display: flex; align-items: center; gap: 6px; }

.city-selector {
  display: flex; align-items: center; gap: 5px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 5px 12px;
  color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.city-selector:hover { border-color: var(--primary); color: var(--primary); }
.city-pin { width: 13px; height: 13px; color: var(--primary); }

.icon-btn {
  position: relative; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); transition: var(--transition);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.notif-badge {
  position: absolute; top: -4px; right: -4px; background: var(--accent);
  color: white; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; padding: 0 2px;
}
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid var(--border); transition: var(--transition); }
.avatar-btn:hover { border-color: var(--primary); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* BOTTOM NAV */
.bottom-nav {
  display: flex; align-items: center; justify-content: space-around;
  background: #fff; border-top: 1px solid var(--border);
  padding: 6px 4px 8px;
  flex-shrink: 0; position: relative; z-index: 100;
  /* safe area для iPhone */
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text3); font-size: 10px; font-weight: 500;
  cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); transition: var(--transition);
  min-width: 52px; font-family: inherit;
}
.nav-item:hover { color: var(--primary); background: var(--primary-bg); }
.nav-item.active { color: var(--primary); }
.nav-item svg { stroke: currentColor; transition: var(--transition); }

.nav-create { padding: 0; min-width: 56px; }
.create-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(27,58,107,0.25); transition: var(--transition); margin-top: -14px;
}
.nav-create:hover .create-icon { background: var(--primary-hover); transform: translateY(-1px); }

/* PAGES */
.app-main { flex: 1; overflow: hidden; position: relative; }
.page { position: absolute; inset: 0; overflow: hidden; display: none; }
.page.active { display: block; }
.page-scroll { height: 100%; overflow-y: auto; padding-bottom: 24px; }
.page-scroll::-webkit-scrollbar { width: 0; }

/* =====================
   SPORT FILTER
   ===================== */
.sport-filter-wrap { padding: 12px 14px 0; }
.sport-filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.sport-filter::-webkit-scrollbar { display: none; }
.sport-chip {
  flex-shrink: 0; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 14px; color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition);
  white-space: nowrap; font-family: inherit;
}
.sport-chip:hover { border-color: var(--primary); color: var(--primary); }
.sport-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =====================
   BANNER — НЕТ ГРАДИЕНТА, строгий стиль
   ===================== */
.feed-banner {
  margin: 14px 14px 0;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--border);
  display: flex; align-items: stretch;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 114px;
}
.banner-accent-bar {
  width: 4px; background: var(--primary); flex-shrink: 0; border-radius: 0;
}
.banner-content { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.banner-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
}
.banner-tag::before { content: ''; width: 6px; height: 6px; background: var(--primary); border-radius: 50%; }
.feed-banner h2 { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 4px; }
.feed-banner p { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.feed-banner .btn-primary { align-self: flex-start; padding: 7px 18px; font-size: 13px; border-radius: var(--r-sm); box-shadow: none; }
.banner-icon {
  display: flex; align-items: center; justify-content: center;
  padding: 0 18px;
  font-size: 44px; flex-shrink: 0;
  background: var(--primary-bg);
  border-left: 1px solid var(--primary-border);
}

/* =====================
   SECTION TITLE
   ===================== */
.feed-section-title {
  padding: 16px 14px 8px; font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px;
}

/* =====================
   GAME CARDS — вариативный стиль
   ===================== */
.feed-cards { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 4px; }

/* Чередуем стили карточек — не все одинаковые */
.game-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-md); /* 12px — основной */
  padding: 14px; cursor: pointer; transition: var(--transition);
}
.game-card:nth-child(odd) { border-radius: var(--r-md); padding: 14px; }
.game-card:nth-child(even) {
  border-radius: var(--r-lg); /* 18px — чуть больше */
  padding: 15px 16px;
  background: var(--surface2);
}
.game-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-border); transform: translateY(-1px); }
.game-card:active { transform: translateY(0); }

/* SPORT LABEL — просто dot + текст, без цветного фона */
.gc-sport-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--text2);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.4px;
}
.gc-sport-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.gc-sport-label.football .gc-sport-dot { background: var(--c-football); }
.gc-sport-label.basketball .gc-sport-dot { background: var(--c-basketball); }
.gc-sport-label.tennis .gc-sport-dot { background: var(--c-tennis); }
.gc-sport-label.volleyball .gc-sport-dot { background: var(--c-volleyball); }
.gc-sport-label.hockey .gc-sport-dot { background: var(--c-hockey); }
.gc-sport-label.running .gc-sport-dot { background: var(--c-running); }
.gc-sport-label.boxing .gc-sport-dot { background: var(--c-boxing); }
.gc-sport-label.cycling .gc-sport-dot { background: var(--c-cycling); }
.gc-sport-label.swimming .gc-sport-dot { background: var(--c-swimming); }
.gc-sport-label.badminton .gc-sport-dot { background: var(--c-badminton); }
.gc-sport-label.tabletennis .gc-sport-dot { background: var(--c-running); }

.gc-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -0.2px; }
.gc-host { font-size: 12px; color: var(--text3); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.gc-host-av { width: 17px; height: 17px; border-radius: 50%; }

.gc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 11px; }
.gc-meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); }
.gc-meta-item svg { flex-shrink: 0; color: var(--text3); }

.gc-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--bg2); }
.gc-players-info { display: flex; align-items: center; gap: 6px; }
.gc-avs { display: flex; }
.gc-avs img { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; margin-left: -5px; }
.gc-avs img:first-child { margin-left: 0; }
.gc-slots { font-size: 12px; color: var(--text3); }
.gc-price-badge { padding: 3px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; }
.gc-price-badge.free { background: #E9F5EE; color: var(--success); }
.gc-price-badge.paid { background: #FEF0EC; color: var(--warning); }

/* =====================
   PLAYERS ROW
   ===================== */
.players-row { display: flex; gap: 8px; padding: 0 14px 4px; overflow-x: auto; scrollbar-width: none; }
.players-row::-webkit-scrollbar { display: none; }
.player-card {
  flex-shrink: 0; width: 88px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 8px; text-align: center; cursor: pointer; transition: var(--transition);
}
.player-card:nth-child(odd) { border-radius: var(--r-md); }
.player-card:nth-child(even) { border-radius: var(--r-lg); }
.player-card:hover { box-shadow: var(--shadow-sm); border-color: var(--primary-border); transform: translateY(-1px); }
.player-av { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 7px; overflow: hidden; border: 2px solid var(--bg2); }
.player-av img { width: 100%; height: 100%; display: block; }
.player-name { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sport { font-size: 11px; color: var(--text3); margin-top: 2px; }
.player-rating { font-size: 11px; color: var(--warning); font-weight: 600; margin-top: 3px; display: flex; align-items: center; justify-content: center; gap: 2px; }

/* =====================
   LEAFLET MAP
   ===================== */
.map-container {
  height: 100%; position: relative; display: flex; flex-direction: column;
}

#leaflet-map {
  flex: 1; min-height: 0;
  z-index: 1;
}

/* Leaflet attribution уменьшить */
.leaflet-control-attribution { font-size: 9px !important; }

/* Кастомные маркеры */
.lmap-marker {
  display: flex; align-items: center; gap: 5px;
  background: #fff; border: 1.5px solid #C5D6EE;
  border-radius: 8px; padding: 5px 10px 5px 7px;
  box-shadow: 0 2px 8px rgba(15,25,35,0.12);
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  color: #0F1923; white-space: nowrap;
  cursor: pointer; transition: all 0.15s ease;
  position: relative;
}
.lmap-marker::after {
  content: ''; position: absolute; bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #fff; border-bottom: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}
.lmap-marker:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.lmap-marker:hover::after { border-top-color: var(--primary); }
.lmap-marker:hover .lmap-dot { background: rgba(255,255,255,0.7) !important; }
.lmap-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.lmap-marker.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.lmap-marker.selected::after { border-top-color: var(--primary); }
.lmap-marker.selected .lmap-dot { background: rgba(255,255,255,0.6) !important; }

/* Маркер пользователя */
.lmap-user {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(27,58,107,0.15), 0 2px 8px rgba(27,58,107,0.3);
}

.map-filter-bar { position: absolute; top: 10px; left: 10px; z-index: 10; display: flex; gap: 5px; max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.map-filter-bar::-webkit-scrollbar { display: none; }
.map-placeholder { flex: 1; overflow: hidden; position: relative; }
.map-bg { position: absolute; inset: 0; background: #E8EDF2; }
.map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(27,58,107,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27,58,107,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.map-road-h { position: absolute; background: #fff; border-top: 1px solid #D1D7DE; border-bottom: 1px solid #D1D7DE; left: 0; right: 0; }
.map-road-v { position: absolute; background: #fff; border-left: 1px solid #D1D7DE; border-right: 1px solid #D1D7DE; top: 0; bottom: 0; }
.map-block { position: absolute; background: #D8DDE4; border-radius: 3px; }

/* Map pins — строгие, без ярких цветов */
.map-pin { position: absolute; transform: translate(-50%, -100%); cursor: pointer; z-index: 10; }
.map-pin-inner {
  display: flex; align-items: center; gap: 5px;
  background: #fff; border: 1.5px solid var(--border2); border-radius: var(--r-sm);
  padding: 5px 10px 5px 7px; box-shadow: var(--shadow-sm); transition: var(--transition);
  white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text);
}
.map-pin-inner .pin-sport-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.map-pin::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; border-bottom: none; filter: drop-shadow(0 2px 1px rgba(0,0,0,0.08)); }
.map-pin:hover .map-pin-inner { background: var(--primary); color: #fff; border-color: var(--primary); }
.map-pin:hover .map-pin-inner .pin-sport-dot { background: rgba(255,255,255,0.7) !important; }
.map-pin:hover::after { border-top-color: var(--primary); }

.map-user-loc { position: absolute; z-index: 20; }
.user-loc-pulse { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 32px; height: 32px; border-radius: 50%; background: rgba(27,58,107,0.12); animation: locPulse 2s ease-in-out infinite; }
@keyframes locPulse { 0%,100%{transform:translate(-50%,-50%) scale(1);opacity:1} 50%{transform:translate(-50%,-50%) scale(2.2);opacity:0} }
.user-loc-dot { position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%; background: var(--primary); border: 3px solid white; box-shadow: 0 2px 6px rgba(27,58,107,0.4); }

.map-controls { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 3px; z-index: 20; }
.map-btn {
  width: 36px; height: 36px; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); color: var(--text2); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.map-btn:hover { border-color: var(--primary); color: var(--primary); }

.map-filter-bar { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 20; max-width: calc(100% - 70px); overflow-x: auto; scrollbar-width: none; }
.map-filter-bar::-webkit-scrollbar { display: none; }
.map-filter-chip {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 5px 12px; font-size: 13px; color: var(--text2); cursor: pointer;
  transition: var(--transition); box-shadow: var(--shadow-xs); white-space: nowrap; font-family: inherit;
}
.map-filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.map-filter-chip.active { background: var(--primary); border-color: var(--primary); color: white; }

.map-game-sheet {
  background: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--border); padding: 10px 14px 14px; min-height: 100px;
  box-shadow: 0 -3px 16px rgba(0,0,0,0.05);
}
.sheet-handle { width: 32px; height: 4px; background: var(--bg2); border-radius: 2px; margin: 0 auto 12px; }
.sheet-hint { text-align: center; color: var(--text3); font-size: 13px; padding: 6px 0; }

/* =====================
   CREATE
   ===================== */
.create-header { padding: 16px 14px 8px; }
.create-header h2 { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.4px; }
.create-header h2 span { color: var(--primary); }
.create-header p { color: var(--text2); font-size: 13px; margin-top: 2px; }

.create-form { padding: 0 14px; }
.form-section {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 10px;
}
.form-section:nth-child(odd) { border-radius: var(--r-lg); }
.form-section-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 12px; }

.sport-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.sport-grid-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg); border: 1.5px solid transparent; border-radius: var(--r-sm);
  padding: 9px 4px; cursor: pointer; transition: var(--transition); text-align: center;
}
.sport-grid-item:hover { background: var(--primary-bg); }
.sport-grid-item span { font-size: 20px; }
.sport-grid-item small { font-size: 10px; color: var(--text2); font-weight: 500; }
.sport-grid-item.active { border-color: var(--primary); background: var(--primary-bg); }
.sport-grid-item.active small { color: var(--primary); font-weight: 600; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.counter-input {
  display: flex; align-items: center;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; height: 42px;
}
.counter-btn {
  background: none; border: none; color: var(--text2); width: 38px; height: 100%;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); font-family: inherit; flex-shrink: 0;
}
.counter-btn:hover { background: var(--primary-bg); color: var(--primary); }
#players-count { font-size: 15px; font-weight: 700; flex: 1; text-align: center; color: var(--text); }

.price-row { display: flex; align-items: center; gap: 7px; }
.price-input { flex: 1; }
.price-currency { color: var(--text2); font-size: 15px; font-weight: 600; flex-shrink: 0; }
.toggle-label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text2); white-space: nowrap; }
.toggle-label input { display: none; }
.toggle { width: 34px; height: 19px; background: var(--bg2); border-radius: 10px; position: relative; transition: var(--transition); flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; width: 13px; height: 13px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-label input:checked + .toggle { background: var(--primary); }
.toggle-label input:checked + .toggle::after { left: 18px; }

.create-submit-btn { margin-top: 4px; margin-bottom: 32px; padding: 14px; font-size: 14px; border-radius: var(--r-md); }

/* =====================
   TEAMS
   ===================== */
.page-top-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.page-top-bar h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }

.search-bar {
  display: flex; align-items: center; gap: 7px; background: #fff;
  border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 8px 13px;
  margin: 0 14px 8px; color: var(--text3); transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); }
.search-input { background: none; border: none; outline: none; color: var(--text); font-size: 14px; flex: 1; font-family: inherit; }
.search-input::placeholder { color: var(--text3); }

.teams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 14px; }
.team-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 12px; cursor: pointer; transition: var(--transition); text-align: center;
}
.team-card:nth-child(odd) { border-radius: var(--r-md); }
.team-card:nth-child(even) { border-radius: var(--r-lg); background: var(--surface2); }
.team-card:hover { box-shadow: var(--shadow-sm); border-color: var(--primary-border); transform: translateY(-1px); }
.team-emblem { width: 50px; height: 50px; border-radius: 14px; margin: 0 auto 9px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--bg); border: 1px solid var(--border); }
.team-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.team-sport { font-size: 11px; color: var(--text3); margin-bottom: 7px; }
.team-members { font-size: 11px; color: var(--text2); display: flex; align-items: center; justify-content: center; gap: 4px; }
.team-rating { font-size: 11px; color: var(--warning); margin-top: 4px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 3px; }

/* =====================
   PROFILE
   ===================== */
.profile-header-bg {
  height: 90px;
  background: var(--primary);  /* сплошной цвет без градиента */
}
.profile-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  margin: -32px 14px 12px; padding: 16px; text-align: center; position: relative; z-index: 1;
  box-shadow: var(--shadow-sm);
}
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 9px; margin-top: -40px; }
.profile-avatar { width: 74px; height: 74px; border-radius: 50%; border: 3px solid #fff; box-shadow: var(--shadow-sm); display: block; }
.avatar-edit-btn {
  position: absolute; bottom: 1px; right: 1px; background: var(--primary); border: none;
  border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid #fff;
}
.profile-name { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.profile-location { font-size: 12px; color: var(--text3); margin-top: 3px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.profile-rating { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 7px 0 12px; }
.stars { color: #C2500A; font-size: 12px; letter-spacing: 1px; }
.rating-val { font-size: 13px; font-weight: 700; color: var(--text); }
.rating-count { font-size: 12px; color: var(--text3); }

.profile-stats { display: flex; justify-content: space-around; padding-top: 12px; border-top: 1px solid var(--bg2); }
.stat-item { text-align: center; }
.stat-val { font-size: 19px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.stat-label { font-size: 11px; color: var(--text3); margin-top: 1px; }

.profile-section { padding: 0 14px; margin-bottom: 12px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 9px; display: flex; align-items: center; gap: 7px; letter-spacing: -0.2px; }
.count-badge { background: var(--primary-bg); color: var(--primary); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-sm); }

.sport-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.sport-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600;
  background: var(--bg2); color: var(--text2); border: 1px solid var(--border);
}
.sport-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sport-tag.football::before { background: var(--c-football); }
.sport-tag.basketball::before { background: var(--c-basketball); }
.sport-tag.tennis::before { background: var(--c-tennis); }
.sport-tag.running::before { background: var(--c-running); }

/* Skill list — вместо level bars */
.skill-list { display: flex; flex-direction: column; gap: 8px; }
.skill-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-radius: var(--r-sm); padding: 9px 12px;
  border-left: 3px solid var(--primary-border);
}
.skill-row.football { border-left-color: var(--c-football); }
.skill-row.basketball { border-left-color: var(--c-basketball); }
.skill-row.tennis { border-left-color: var(--c-tennis); }
.skill-row.running { border-left-color: var(--c-running); }
.skill-sport { font-size: 13px; font-weight: 600; color: var(--text); }
.skill-level { font-size: 12px; color: var(--text3); font-weight: 500; }

.mini-game-list { display: flex; flex-direction: column; gap: 6px; }
.mini-game { display: flex; align-items: center; gap: 9px; background: var(--bg); border-radius: var(--r-sm); padding: 9px 11px; }
.mini-game-icon { font-size: 16px; width: 32px; height: 32px; border-radius: var(--r-sm); background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--border); }
.mini-game-info { flex: 1; }
.mini-game-title { font-size: 13px; font-weight: 600; color: var(--text); }
.mini-game-date { font-size: 11px; color: var(--text3); margin-top: 1px; }
.mini-game-result { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-sm); }
.mini-game-result.win { background: #E9F5EE; color: var(--success); }
.mini-game-result.loss { background: #FEE9E9; color: var(--danger); }

.mt-12 { margin-top: 10px; }

.profile-menu { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.profile-menu-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--bg); color: var(--text);
  padding: 12px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: var(--transition); text-align: left; font-family: inherit; gap: 9px;
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: var(--bg); }
.profile-menu-item.danger { color: var(--danger); }
.profile-menu-item .menu-icon { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-menu-item .menu-label { flex: 1; }

/* =====================
   CITY MODAL
   ===================== */
.city-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.city-list { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.city-item { padding: 10px 11px; border-radius: var(--r-sm); font-size: 14px; color: var(--text2); cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 7px; }
.city-item:hover { background: var(--bg); color: var(--text); }
.city-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* =====================
   NOTIFICATIONS PANEL
   ===================== */
.side-panel { position: fixed; inset: 0; z-index: 400; display: flex; }
.panel-overlay { position: absolute; inset: 0; background: rgba(15,25,35,0.4); backdrop-filter: blur(4px); }
.panel-box { position: relative; background: #fff; height: 100%; overflow-y: auto; box-shadow: var(--shadow-lg); }
.panel-box.right { margin-left: auto; width: 300px; max-width: 90vw; animation: slideRight var(--transition) both; }
@keyframes slideRight { from{transform:translateX(100%)} to{transform:translateX(0)} }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px; border-bottom: 1px solid var(--border); }
.panel-header h3 { font-size: 16px; font-weight: 700; }

.notif-list { padding: 6px; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 9px; border-radius: var(--r-sm); cursor: pointer; transition: var(--transition); margin-bottom: 2px; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-bg); }
.notif-item.unread:hover { background: #E4EDF8; }
.notif-icon { width: 36px; height: 36px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: #fff; border: 1px solid var(--border); }
.notif-content { flex: 1; font-size: 13px; color: var(--text2); line-height: 1.5; }
.notif-content strong { color: var(--text); }
.notif-time { display: block; font-size: 11px; color: var(--text3); margin-top: 2px; }

/* =====================
   GAME DETAIL MODAL
   ===================== */
.game-detail-box { padding: 0; overflow: hidden; }
.gd-header { padding: 20px 18px 14px; border-bottom: 1px solid var(--border); }
.gd-sport-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.gd-sport-chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; }
.gd-title { font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 5px; letter-spacing: -0.3px; }
.gd-host-row { display: flex; align-items: center; gap: 7px; }
.gd-host-av { width: 22px; height: 22px; border-radius: 50%; }
.gd-host-name { font-size: 13px; color: var(--text2); }
.gd-body { padding: 14px 18px; }
.gd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 14px; }
.gd-meta-card { background: var(--bg); border-radius: var(--r-sm); padding: 9px 11px; }
.gd-meta-label { font-size: 10px; color: var(--text3); margin-bottom: 3px; display: flex; align-items: center; gap: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.gd-meta-val { font-size: 14px; font-weight: 600; color: var(--text); }
.gd-section-title { font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.gd-players-avatars { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.gd-player-av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); cursor: pointer; }
.gd-player-av img { width: 100%; height: 100%; }
.gd-desc { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 16px; background: var(--bg); border-radius: var(--r-sm); padding: 11px 13px; border-left: 3px solid var(--primary-border); }
.gd-join-btn { width: 100%; padding: 13px; font-size: 14px; border-radius: var(--r-md); }

/* =====================
   PLAYER DETAIL MODAL
   ===================== */
.player-detail-box { padding: 0; overflow: hidden; }
.pd-header { background: var(--primary); height: 70px; position: relative; border-radius: var(--r-xl) var(--r-xl) 0 0; }
.pd-av { width: 68px; height: 68px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; position: absolute; bottom: -18px; left: 18px; box-shadow: var(--shadow-sm); }
.pd-av img { width: 100%; height: 100%; }
.pd-body { padding: 26px 18px 18px; }
.pd-name { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.pd-loc { font-size: 12px; color: var(--text3); margin-top: 2px; }
.pd-rating { font-size: 12px; color: var(--warning); font-weight: 600; margin-top: 3px; }
.pd-stats { display: flex; justify-content: space-around; background: var(--bg); border-radius: var(--r-sm); padding: 12px; margin: 12px 0; }
.pd-stat { text-align: center; }
.pd-stat-val { font-size: 17px; font-weight: 800; color: var(--primary); letter-spacing: -0.3px; }
.pd-stat-label { font-size: 11px; color: var(--text3); }
.pd-sports { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.pd-actions { display: flex; gap: 7px; }
.pd-actions .btn-primary { flex: 1; }
.pd-actions .btn-outline-primary { padding: 11px 14px; border-radius: var(--r-pill); }

/* =====================
   TOAST
   ===================== */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; border-radius: var(--r-pill); padding: 10px 20px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 9999;
  white-space: nowrap; animation: toastIn 0.25s ease both;
}
@keyframes toastIn { from{transform:translateX(-50%) translateY(8px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }

/* =====================
   RESPONSIVE
   ===================== */
@media (min-width: 480px) {
  .modal-box { border-radius: var(--r-xl); margin: auto; max-height: 85vh; }
  .game-detail-box, .player-detail-box, .city-box { border-radius: var(--r-xl); }
  .pd-header { border-radius: var(--r-xl) var(--r-xl) 0 0; }
}
@media (min-width: 768px) {
  .teams-grid { grid-template-columns: repeat(3, 1fr); }
  .sport-grid { grid-template-columns: repeat(6, 1fr); }
  .feed-cards { display: grid; grid-template-columns: 1fr 1fr; }
}
