/* Морський бій — сайт. Кольори й типографіка з дизайн-системи застосунку. */
:root {
  --navy: #0B1D33;
  --navy-deep: #081628;
  --panel: #16304F;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #EAF2FF;
  --text-2: #C9D6E8;
  --muted: #A9BDD8;
  --accent: #4DA3FF;
  --warm: #FF8A3D;
  --success: #3DD6B0;
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.6 var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(77, 163, 255, 0.18), transparent 70%),
    linear-gradient(var(--navy), var(--navy-deep));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
/* Тонка «сітка поля» на фоні, як на банерах. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(77, 163, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 163, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(black, transparent 80%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* height: auto — інакше атрибут height розтягує зображення. */
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; }

/* Мовні блоки: показується лише обрана мова. */
html[data-lang="uk"] .en, html[data-lang="en"] .uk { display: none !important; }

/* ---------- Шапка ---------- */
header.top {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  background: rgba(11, 29, 51, 0.72);
  border-bottom: 1px solid var(--border);
}
header.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 900; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
nav.links { margin-left: auto; display: flex; gap: 20px; font-weight: 700; font-size: 15px; }
nav.links a { color: var(--text-2); }
nav.links a:hover { color: var(--text); text-decoration: none; }
.lang-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
}
.lang-switch button {
  font: 800 13px var(--font); color: var(--muted); background: none; border: 0;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--navy); }

/* ---------- Перший екран ---------- */
/* Лише вертикальні відступи — бокові дає .wrap. */
.hero { padding-top: 40px; padding-bottom: 24px; text-align: center; }
.hero img.banner {
  width: 100%; border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.hero .lead { max-width: 720px; margin: 28px auto 0; font-size: 20px; color: var(--text-2); }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 26px; border-radius: 18px;
  font: 800 17px var(--font);
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.primary { background: var(--accent); color: #04162B; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn .small { display: block; font-size: 11px; font-weight: 700; opacity: .75; line-height: 1; }
.btn .big { display: block; font-size: 17px; line-height: 1.15; }

/* ---------- Секції ---------- */
section { padding: 56px 0; }
.kicker {
  font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--warm);
}
h1, h2, h3 { line-height: 1.15; margin: 0; }
h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 900; margin: 8px 0 14px; letter-spacing: -0.5px; }
h2 .blue { color: var(--accent); }
.section-lead { color: var(--text-2); max-width: 680px; margin: 0 0 32px; font-size: 18px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.card .icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px;
}
.card h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; }
.i-blue { background: rgba(77, 163, 255, 0.18); }
.i-green { background: rgba(61, 214, 176, 0.18); }
.i-orange { background: rgba(255, 138, 61, 0.2); }

.wide-banner { border-radius: 28px; border: 1px solid var(--border); width: 100%; }


/* Галерея скріншотів — горизонтальна прокрутка з прилипанням. */
.gallery {
  display: flex; gap: 18px; overflow-x: auto; padding: 4px 24px 18px;
  margin: 0 -24px; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.gallery img {
  flex: 0 0 auto; width: clamp(200px, 60vw, 290px); border-radius: 26px;
  border: 1px solid var(--border); scroll-snap-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* На широкому екрані всі 5 скріншотів вміщаються в ряд без прокрутки. */
@media (min-width: 900px) {
  .gallery { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; margin: 0; padding: 4px 0 18px; }
  .gallery img { width: 100%; border-radius: 22px; }
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding-top: 58px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 22px; left: 22px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: 15px;
  background: rgba(77, 163, 255, 0.22); color: #A9D2FF;
}

.note {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(255, 138, 61, 0.12); border: 1px solid rgba(255, 138, 61, 0.4);
  border-radius: var(--radius); padding: 18px 22px; margin-top: 18px; color: var(--text-2);
}

/* ---------- Текстові сторінки (політика, підтримка) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 48px 24px 24px; }
.doc h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 900; margin: 8px 0 6px; letter-spacing: -0.5px; }
.doc .updated { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 22px; margin: 34px 0 10px; }
.doc p, .doc li { color: var(--text-2); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--text); }
.summary {
  background: rgba(61, 214, 176, 0.12); border: 1px solid rgba(61, 214, 176, 0.4);
  border-radius: var(--radius); padding: 18px 22px; color: var(--text);
}
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 16px 20px; margin: 12px 0;
}
.faq summary {
  cursor: pointer; font-weight: 800; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p, .faq details ul, .faq details ol { margin-bottom: 0; }

/* ---------- Підвал ---------- */
footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer nav { margin-left: auto; display: flex; gap: 18px; }
footer a { color: var(--text-2); }

@media (max-width: 820px) {
  .features, .steps { grid-template-columns: 1fr; }
  nav.links { display: none; }
  header.top .wrap { justify-content: space-between; }
  .hero { padding-top: 20px; }
  .hero .lead { font-size: 18px; }
  .card { padding: 18px; }
  .features .card { display: grid; grid-template-columns: 46px 1fr; column-gap: 14px; }
  .features .card .icon { grid-row: span 2; margin-bottom: 0; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
  .hero img.banner, .wide-banner { border-radius: 18px; }
  section { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Кнопка App Store у шапці. */
.store-pill {
  margin-left: 4px; padding: 7px 14px; border-radius: 999px;
  background: var(--accent); color: #04162B; font-weight: 800; font-size: 14px; white-space: nowrap;
}
.store-pill:hover { text-decoration: none; filter: brightness(1.06); }
nav.links + .store-pill { margin-left: 0; }
header.top .brand + .store-pill { margin-left: auto; }
.doc-cta { justify-content: flex-start; margin-top: 40px; }
@media (max-width: 820px) {
  .store-pill { margin-left: auto; }
  header.top .wrap { gap: 10px; }
}
.brand span { white-space: nowrap; }
/* На вузькому екрані в шапці лишається тільки іконка — інакше назва налазить на кнопку. */
@media (max-width: 480px) {
  .brand span { display: none !important; }
  .store-pill { padding: 7px 12px; }
}
@media (max-width: 820px) { nav.links + .store-pill { margin-left: auto; } }
