/* Блоки 8×8 — общий стиль страниц игры. Только внешний файл: CSP поддомена запрещает inline-стили. */
:root {
  color-scheme: light dark;
  --orange: #ff9a3c; --pink: #ff4f7a; --navy: #2b2d5c; --cream: #fff1e3;
  --bg: #fff7f0; --fg: #1d1d1f; --card: #ffffff; --line: rgba(43, 45, 92, 0.1); --muted: rgba(29, 29, 31, 0.68);
  --b-blue: #1f7ae0; --b-green: #2e8b4e; --b-orange: #d9822b; --b-red: #d63c3c; --b-yellow: #f2c14e; --b-purple: #8b5cf6; --b-cyan: #3bb5c9;
  --radius: 24px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12121a; --fg: #f5f5f7; --card: #1d1e2c; --line: rgba(255, 255, 255, 0.09); --muted: rgba(245, 245, 247, 0.7); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); line-height: 1.55; overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Both languages ship in the markup; JS picks one, without JS Russian shows. */
html[data-lang="ru"] [lang="en"]:not(html), html[data-lang="en"] [lang="ru"]:not(html) { display: none !important; }
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; text-decoration: none; color: var(--navy); }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.lang {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--navy); background: rgba(255, 255, 255, 0.55);
  border: 0; border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer;
}
.lang:focus-visible, .btn:focus-visible, .brand:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

/* Hero: the game's gradient; navy text (white on it is under 3:1, WCAG AA) */
.hero { background: linear-gradient(135deg, var(--orange), var(--pink)); color: var(--navy); position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.12); pointer-events: none;
}
.hero::before { width: 420px; height: 420px; right: -140px; top: -160px; }
.hero::after { width: 300px; height: 300px; left: -120px; bottom: -150px; }
.hero-grid { position: relative; z-index: 1; display: grid; gap: 32px; align-items: center; padding: 24px 0 56px; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; padding: 40px 0 72px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff;
  font-size: 14px; font-weight: 700; border-radius: 999px; padding: 6px 14px;
}
h1 { font-size: clamp(44px, 11vw, 84px); line-height: 1; letter-spacing: -0.04em; margin: 18px 0 14px; font-weight: 900; }
.lead { font-size: clamp(18px, 4.6vw, 23px); font-weight: 500; max-width: 520px; margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px;
  border-radius: 18px; font-weight: 800; font-size: 17px; text-decoration: none; background: var(--navy); color: #fff;
  box-shadow: 0 10px 24px rgba(43, 45, 92, 0.28); transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.light { background: #fff; color: var(--navy); }
.note { font-size: 14px; font-weight: 600; margin: 14px 0 0; opacity: 0.85; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* Phone mock-ups with real screenshots */
.phones { display: flex; justify-content: center; align-items: flex-end; gap: 16px; }
.phone {
  background: #0f1020; border-radius: 34px; padding: 8px; box-shadow: 0 24px 48px rgba(43, 45, 92, 0.35);
  width: min(46vw, 220px); flex: none;
}
.phone img { border-radius: 27px; width: 100%; height: auto; background: #fff; }
.phone.tilt-l { transform: rotate(-4deg) translateY(10px); }
.phone.tilt-r { transform: rotate(4deg); }

/* Sections */
section.band { padding: 56px 0; }
h2.title { font-size: clamp(28px, 6.5vw, 40px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 28px; font-size: 17px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.card h3 { font-size: 19px; margin: 14px 0 6px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); }

/* Block glyphs in the game's palette */
.piece { display: grid; grid-template-columns: repeat(3, 14px); grid-auto-rows: 14px; gap: 3px; }
.piece i { border-radius: 4px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.piece i.o { background: transparent; box-shadow: none; }
.c-blue i:not(.o) { background: var(--b-blue); }
.c-green i:not(.o) { background: var(--b-green); }
.c-orange i:not(.o) { background: var(--b-orange); }
.c-red i:not(.o) { background: var(--b-red); }
.c-purple i:not(.o) { background: var(--b-purple); }
.c-cyan i:not(.o) { background: var(--b-cyan); }

/* How to play */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 22px 70px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; left: 20px; top: 20px; width: 36px; height: 36px;
  border-radius: 12px; display: grid; place-items: center; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--pink));
}
.step b { display: block; font-size: 18px; margin-bottom: 4px; }
.step span { color: var(--muted); }

/* CTA band */
.cta { background: var(--navy); color: #fff; border-radius: 32px; padding: 36px 24px; text-align: center; }
.cta h2 { color: #fff; }
.cta .sub { color: rgba(255, 255, 255, 0.75); }
.cta .actions { justify-content: center; }
.cta .btn { background: linear-gradient(135deg, var(--orange), var(--pink)); color: var(--navy); box-shadow: none; }

footer { text-align: center; padding: 32px 16px 44px; color: var(--muted); font-size: 14px; }
footer a { margin: 0 6px; }

/* Duel page */
.duel { text-align: center; padding: 8px 0 56px; position: relative; z-index: 1; }
.duel .icon { width: 104px; height: 104px; border-radius: 26px; margin: 8px auto 0; box-shadow: 0 12px 32px rgba(43, 45, 92, 0.35); }
.duel h1 { font-size: clamp(36px, 9vw, 60px); margin: 18px 0 8px; }
.duel .lead { margin: 0 auto 8px; }
.duel .actions { justify-content: center; margin-top: 24px; }
.score { font-size: clamp(64px, 18vw, 112px); font-weight: 900; letter-spacing: -0.04em; line-height: 1; margin: 8px 0; }

/* Privacy policy */
.doc-head { padding: 8px 0 40px; position: relative; z-index: 1; }
.doc-head h1 { font-size: clamp(26px, 7.6vw, 56px); margin: 12px 0 10px; overflow-wrap: anywhere; hyphens: auto; }
.doc-head p { margin: 0; font-weight: 600; max-width: 640px; }
.doc { max-width: 760px; margin: -24px auto 0; padding: 0 16px; position: relative; z-index: 2; }
.doc article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 16px; }
.doc article > :first-child { margin-top: 0; }
.doc h2 { font-size: 20px; letter-spacing: -0.01em; margin: 26px 0 6px; }
.doc p { margin: 0 0 10px; }
.doc code { font-size: 0.92em; background: var(--line); border-radius: 6px; padding: 1px 6px; }
.doc a { color: var(--b-blue); }
@media (prefers-color-scheme: dark) { .doc a { color: #7fb4ff; } }
