/* Мобильная версия. Вёрстка из макета задана inline-стилями под 1440 px,
   поэтому здесь — переопределения с !important для экранов до 900 px. */
body > div:first-of-type { width: 100%; max-width: 1440px; margin: 0 auto; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  body > div:first-of-type { width: 100% !important; }
  img { max-width: 100%; }

  /* Шапка: логотип и кнопка регистрации */
  header { height: auto !important; padding: 12px 16px !important; gap: 12px; }
  header svg { width: 40px !important; height: 40px !important; }
  header nav { gap: 0 !important; }
  header nav a { display: none !important; }
  header nav a[href="#register"] { padding: 8px 12px !important; font-size: 9px !important; letter-spacing: 0.6px !important; white-space: nowrap; }
  header > a, header > div:first-child { min-width: 0; flex-shrink: 1; }

  /* Отступы секций */
  section, footer { padding-left: 16px !important; padding-right: 16px !important; }
  section[style*="padding: 120px"], section[style*="padding: 96px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  section[style*="gap: 56px"] { gap: 32px !important; }
  footer { padding-top: 48px !important; }

  /* Сетки в одну колонку */
  [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; row-gap: 24px !important; column-gap: 0 !important; }
  [style*="grid-column:"] { grid-column: auto !important; }
  [style*="grid-row:"] { grid-row: auto !important; }
  [style*="grid-template-rows"] { grid-template-rows: none !important; }
  .f-row { grid-template-columns: minmax(0, 1fr) !important; }

  /* Строки элементов переносятся */
  div:has(> .chip), div:has(> .btn-p), div:has(> .btn-s), footer div[style*="display: flex"]:not([style*="flex-direction: column"]) { flex-wrap: wrap; }
  [style*="white-space: nowrap"] { white-space: normal !important; }
  .btn-p, .btn-s, header nav a, .chip { white-space: nowrap !important; }
  [style*="max-width"] { max-width: 100% !important; }
  [style*="width: 1100px"], [style*="width: 820px"], [style*="width: 800px"], [style*="width: 620px"] { width: 100% !important; }

  /* Декор, который на телефоне мешает */
  .vlabel, .ghost, .mark-hero { display: none !important; }

  /* Шрифты */
  h1 { font-size: 38px !important; letter-spacing: -0.5px !important; }
  [style*="font-size: 72px"], [style*="font-size: 64px"] { font-size: 38px !important; letter-spacing: -0.5px !important; }
  [style*="font-size: 56px"] { font-size: 40px !important; }
  [style*="font-size: 44px"] { font-size: 30px !important; }
  [style*="font-size: 48px"] { font-size: 30px !important; letter-spacing: -0.5px !important; }
  [style*="font-size: 40px"] { font-size: 30px !important; }
  [style*="font-size: 36px"] { font-size: 24px !important; }
  [style*="font-size: 32px"] { font-size: 26px !important; }
  [style*="font-size: 28px"] { font-size: 20px !important; }

  /* Первый экран */
  #top { min-height: 0 !important; padding-top: 24px !important; padding-bottom: 48px !important; gap: 32px; }
  .hero-photo, .hero-shade, .hero-shade2 { width: 100% !important; }
  .hero-shade { background: linear-gradient(180deg, rgba(25,22,21,0.72) 0%, rgba(25,22,21,0.9) 40%, #191615 75%) !important; }
  #top > div[style*="position: absolute"] { position: relative !important; top: auto !important; right: auto !important; width: 100% !important; order: 0; }
  #top > div[style*="position: relative"] { order: 1; }
  #top .chip { font-size: 10px; padding: 7px 12px; }
  /* Читаемость и воздух в тексте первого экрана */
  #top h1 { margin-bottom: 4px !important; }
  #top p[style*="font-size: 20px"] { font-size: 17px !important; }
  #top h1 + p, #top p[style*="font-size: 28px"], #top p[style*="font-size: 26px"], #top p[style*="font-size: 20px"] { color: #CFCFCF !important; line-height: 1.35 !important; }
  /* Компактный блок «таймер + кнопки» в самом верху, вместо кнопки в шапке */
  #top > div[style*="position: absolute"] { padding: 12px 14px !important; gap: 10px !important; margin-top: 0 !important; }
  #top > div[style*="position: absolute"] > span { font-size: 8.5px !important; letter-spacing: 1.6px !important; text-align: center; white-space: normal !important; }
  #top > div[style*="position: absolute"] [id^="cd-"] { font-size: 22px !important; }
  #top > div[style*="position: absolute"] [id^="cd-"] + span { font-size: 8px !important; letter-spacing: 1.2px !important; }
  #top > div[style*="position: absolute"] div[style*="min-width: 64px"] { min-width: 0 !important; gap: 2px !important; }
  #top > div[style*="position: absolute"] .btn-p, #top > div[style*="position: absolute"] .btn-s { padding: 11px 4px !important; font-size: 10px !important; letter-spacing: 0.6px !important; }
  #top > div[style*="position: absolute"] > div:last-child { flex-direction: row !important; gap: 8px !important; }
  #top { padding-top: 16px !important; gap: 20px !important; }
  #top > div[style*="margin-top: 40px"] { gap: 24px !important; margin-top: 0 !important; order: 3 !important; }
  #top > div[style*="margin-top: 40px"] > p { padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.18); font-size: 15px !important; line-height: 1.6 !important; color: #E4E4E4 !important; }
  #top > div[style*="margin-top: 40px"] > p > span:first-child { font-size: 20px !important; margin-bottom: 10px !important; }
  #top > div[style*="margin-top: 40px"] > p > span:nth-child(2) { font-size: 11px !important; letter-spacing: 1.8px !important; line-height: 1.5; margin-bottom: 14px !important; }
  #top .chip { font-size: 9.5px !important; letter-spacing: 1px !important; padding: 6px 10px !important; }

  /* Фото площадки */
  section img[style*="object-fit: cover"] { height: 220px !important; }

  /* Полоса организатора и партнёров: компактно */
  section[style*="#231F1D"][style*="space-between"] { flex-direction: column !important; align-items: stretch !important; gap: 16px !important; padding: 18px 16px !important; }
  section[style*="#231F1D"][style*="space-between"] > div { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; width: 100%; }
  section[style*="#231F1D"][style*="space-between"] > div > span:first-child { font-size: 10px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:first-child img { height: 30px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:first-child span span span:first-child { font-size: 15px !important; letter-spacing: 2.5px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:first-child span span span:last-child { font-size: 7px !important; letter-spacing: 1.6px !important; margin-top: 3px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child > div { display: grid !important; grid-template-columns: 1fr 1fr 1fr !important; gap: 14px 10px !important; align-items: center !important; justify-items: center !important; width: 100%; padding-top: 2px; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child > div > span { grid-column: auto; font-size: 14px !important; white-space: nowrap; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child img { width: auto !important; max-width: 100%; object-fit: contain; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child img[alt^="Акцент"] { height: 18px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child img[alt^="Radio"] { height: 30px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child img[alt="My Club"] { height: 28px !important; }
  section[style*="#231F1D"][style*="space-between"] > div:last-child img[alt="it.com"] { height: 18px !important; }

  /* Одна плавающая стрелка вместо стрелок в каждом разделе */
  .totop { display: none !important; }
  .fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(219,161,93,0.7); background: rgba(25,22,21,0.92); color: #DBA15D; font: 700 20px 'Manrope', Arial, sans-serif; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; cursor: pointer; padding: 0; }
  .fab.on { opacity: 1; pointer-events: auto; }
  .backpill { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; height: 46px; padding: 0 18px; border-radius: 100px; border: 1px solid rgba(219,161,93,0.7); background: rgba(25,22,21,0.92); color: #DBA15D; font: 700 12px 'Manrope', Arial, sans-serif; letter-spacing: 1px; text-transform: uppercase; display: none; align-items: center; cursor: pointer; }
  .backpill.on { display: flex; }
}
@media (min-width: 901px) { .fab, .backpill { display: none !important; } }
