/* ─────────────────────────────────────────────────────────────────────────
   «Стрелки: Пазл на Фигурах» — сайт игры. Палитра снята с иконки приложения:
   бумага #f3f5fa, синий #4a72f5, янтарный #fbb724, чернила #171c2b.
   Один файл на все страницы, без сборки и без внешних шрифтов.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --paper:      #f3f5fa;
  --paper-deep: #e9edf8;
  --white:      #ffffff;
  --ink:        #171c2b;
  --ink-soft:   #333a4f;
  --muted:      #626c86;
  --blue:       #4a72f5;
  --blue-deep:  #3557d6;
  --blue-wash:  #eaf0ff;
  --amber:      #fbb724;
  --amber-wash: #fff4dc;
  --ice:        #58a8e8;
  --line:       rgba(23, 28, 43, 0.09);
  --line-soft:  rgba(23, 28, 43, 0.05);
  --shadow-sm:  0 2px 6px rgba(48, 66, 130, 0.06);
  --shadow:     0 12px 30px rgba(48, 66, 130, 0.10);
  --shadow-lg:  0 28px 60px rgba(38, 55, 115, 0.18);
  --radius:     22px;
  --radius-sm:  14px;
  --wrap:       1120px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: clamp(34px, 5.2vw, 54px); }
h2 { font-size: clamp(27px, 3.6vw, 38px); }
h3 { font-size: 20px; letter-spacing: -0.01em; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.center { text-align: center; }

/* ── шапка ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243, 245, 250, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-soft); font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--white); text-decoration: none; }
.nav a[aria-current] { color: var(--blue-deep); background: var(--blue-wash); }
.lang { display: inline-flex; margin-left: 10px; padding: 3px; background: var(--paper-deep); border-radius: 11px; }
.lang a, .lang span { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px; color: var(--muted); letter-spacing: 0.02em; }
.lang .on { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
.lang a:hover { text-decoration: none; color: var(--ink); }
@media (max-width: 720px) {
  .site-header .wrap { height: 60px; gap: 8px; }
  .nav a { display: none; }
  .nav a.keep, .lang a { display: inline-block; }
  .nav a.keep { padding: 8px 9px; font-size: 14.5px; }
  .lang { margin-left: 2px; }
  .lang a, .lang span { padding: 5px 8px; }
}
@media (max-width: 560px) {
  .site-header .wrap { padding: 0 14px; }
  .site-header .brand span { display: none; }
  .nav a.keep { padding: 8px 7px; font-size: 14px; }
  .lang a, .lang span { padding: 5px 7px; font-size: 12.5px; }
}

/* ── кнопки ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: 15px; border: 1px solid transparent;
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(180deg, #5a7ef7, var(--blue-deep)); color: #fff; box-shadow: 0 10px 22px rgba(53, 87, 214, 0.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(53, 87, 214, 0.36); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-store { background: #14181f; color: #fff; padding: 13px 22px; }
.btn-store:hover { transform: translateY(-2px); }
.btn-store.soon { background: var(--white); color: var(--muted); border: 1px dashed rgba(23, 28, 43, 0.22); cursor: default; box-shadow: none; }
.btn-store.soon:hover { transform: none; }
.btn-store svg { width: 22px; height: 22px; flex: none; }
.btn-store b { display: block; font-size: 16px; line-height: 1.15; font-weight: 700; }
.btn-store small { display: block; font-size: 11px; line-height: 1.3; opacity: 0.7; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ── герой ─────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: clamp(46px, 7vw, 88px) 0 clamp(50px, 7vw, 92px); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -20%; height: 720px; z-index: 0;
  background:
    radial-gradient(760px 420px at 18% 8%, rgba(74, 114, 245, 0.14), transparent 62%),
    radial-gradient(560px 380px at 86% 22%, rgba(251, 183, 36, 0.18), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--blue-deep); background: var(--blue-wash); padding: 7px 13px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { margin-bottom: 18px; }
.hero .lead { font-size: clamp(17px, 1.9vw, 20px); color: var(--ink-soft); max-width: 33em; margin-bottom: 26px; }
.hero-note { margin-top: 16px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hero-note span { display: inline-flex; align-items: center; gap: 7px; }
.hero-note span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

/* телефоны */
.phones { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 420px; }
.phone { position: relative; padding: 9px; border-radius: 42px; background: linear-gradient(160deg, #ffffff, #e6ebf7); box-shadow: var(--shadow-lg); }
.phone::after { content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 74px; height: 5px; border-radius: 3px; background: rgba(23, 28, 43, 0.10); }
.phone img { border-radius: 34px; width: 100%; height: auto; background: var(--paper); }
.phone.front { width: min(300px, 74vw); z-index: 2; }
.phone.back { position: absolute; right: 0; bottom: 46px; width: min(196px, 46vw); z-index: 1; transform: rotate(7deg); opacity: 0.97; }
.phone.back::after { display: none; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .phones { order: -1; min-height: 0; margin-bottom: 6px; }
  .phone.back { display: none; }
}

/* ── секции ────────────────────────────────────────────────────────────── */
section { padding: clamp(52px, 7vw, 92px) 0; }
section.tint { background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.4)); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.sec-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head.center { margin-left: auto; margin-right: auto; }
.sec-head p { color: var(--muted); font-size: 18px; margin-top: -2px; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15.5px; }
.card-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card figure { margin: 0 0 18px; background: var(--paper); border-radius: 16px; overflow: hidden; border: 1px solid var(--line-soft); }
.card figure img { width: 100%; height: auto; }

.rule-art { width: 100%; height: auto; border-radius: 16px; background: var(--paper); margin-bottom: 18px; border: 1px solid var(--line-soft); }

/* полоса цифр */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; text-align: center; }
.stat b { display: block; font-size: clamp(28px, 3.6vw, 38px); font-weight: 800; letter-spacing: -0.03em; color: var(--blue-deep); line-height: 1.1; }
.stat span { display: block; font-size: 14.5px; color: var(--muted); margin-top: 4px; }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* главы */
.chapter { display: flex; flex-direction: column; }
.chapter .tag { align-self: flex-start; font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; margin-bottom: 12px; }
.tag-classic { background: var(--paper-deep); color: var(--ink-soft); }
.tag-ice { background: #e4f2fd; color: #1f6ea8; }
.tag-lock { background: var(--amber-wash); color: #9a6a06; }
.tag-mix { background: #efe9fd; color: #5a41ad; }

/* фичи */
.feature { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.feature .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--blue-wash); display: grid; place-items: center; }
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin-bottom: 4px; }
.feature p { font-size: 15px; color: var(--muted); margin: 0; }

/* ── интерактивная демонстрация правила ────────────────────────────────── */
.demo-box { background: var(--white); border: 1px solid var(--line); border-radius: 26px; padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; }
@media (max-width: 860px) { .demo-box { grid-template-columns: 1fr; } }
#demo-board { width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 1; display: block; touch-action: manipulation; }
#demo-board .cellbtn { cursor: pointer; }
#demo-board .arrow { transition: transform 0.42s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.42s ease; }
#demo-board .arrow.gone { opacity: 0; }
#demo-board .arrow.bump { animation: bump 0.36s ease; }
@keyframes bump { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 0); } 60% { transform: translate(3px, 0); } }
.demo-status { min-height: 26px; font-weight: 700; color: var(--blue-deep); }
.demo-status.bad { color: #d1493f; }
.demo-status.win { color: #1c8a5b; }

/* ── документ (политика, поддержка) ────────────────────────────────────── */
.doc { padding: clamp(34px, 5vw, 60px) 0 clamp(50px, 7vw, 90px); }
.doc-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .doc-grid { grid-template-columns: 1fr; } .toc { position: static !important; } }
.toc { position: sticky; top: 92px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.toc strong { display: block; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0 0 2px; }
.toc a { display: block; font-size: 14.5px; color: var(--ink-soft); padding: 5px 8px; border-radius: 8px; }
.toc a:hover { background: var(--paper); text-decoration: none; color: var(--blue-deep); }

.doc-body { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 46px); box-shadow: var(--shadow-sm); max-width: 78ch; }
.doc-body h2 { font-size: clamp(21px, 2.4vw, 26px); margin-top: 2em; scroll-margin-top: 92px; }
.doc-body h2:first-of-type { margin-top: 0.4em; }
.doc-body h3 { font-size: 17.5px; margin-top: 1.6em; }
.doc-body ul, .doc-body ol { margin: 0 0 1em; padding-left: 1.25em; }
.doc-body li { margin-bottom: 0.45em; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: 15.5px; }
.doc-body th, .doc-body td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.doc-body th { background: var(--paper); font-size: 13.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.doc-body td:first-child { font-weight: 600; width: 34%; }
.doc-meta { font-size: 14.5px; color: var(--muted); margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.callout { background: var(--blue-wash); border: 1px solid rgba(74, 114, 245, 0.22); border-radius: 16px; padding: 18px 20px; margin: 0 0 26px; }
.callout.amber { background: var(--amber-wash); border-color: rgba(251, 183, 36, 0.4); }
.callout p { font-size: 16px; }
.doc-head { margin-bottom: clamp(24px, 4vw, 42px); }
.doc-head h1 { font-size: clamp(30px, 4.4vw, 44px); }
.doc-head p { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* поддержка */
.contact-card { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between; background: linear-gradient(145deg, #ffffff, #eef2fd); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3.4vw, 34px); box-shadow: var(--shadow-sm); margin-bottom: 26px; }
.contact-card h2 { margin: 0 0 6px; font-size: 24px; }
.contact-card p { color: var(--muted); margin: 0; max-width: 46ch; }
.mail { font-size: 17px; font-weight: 700; }
details.faq { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
details.faq summary { cursor: pointer; list-style: none; padding: 16px 30px 16px 0; font-weight: 700; font-size: 16.5px; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s ease; }
details.faq[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details.faq .faq-body { padding: 0 0 18px; color: var(--ink-soft); font-size: 16px; }
details.faq .faq-body p { margin-bottom: 0.7em; }

/* ── подвал ────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-deep); padding: 46px 0 40px; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 780px) { .site-footer .wrap { grid-template-columns: 1fr; gap: 22px; } }
.site-footer h4 { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 800; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--ink-soft); font-size: 15.5px; }
.site-footer .brand { margin-bottom: 12px; }
.site-footer .fine { font-size: 14px; color: var(--muted); max-width: 40ch; }

/* ── мелочи ────────────────────────────────────────────────────────────── */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--white); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.pill-list li { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14.5px; color: var(--ink-soft); box-shadow: var(--shadow-sm); }
