/* ============================================================
   Yore — общие стили всех страниц
   Страница проходит игровые сутки: сверху светлый день, внизу ночь.
   ============================================================ */
:root {
  color-scheme: light;
  --page:   #F4F6FA;
  --card:   #FFFFFF;
  --ink:    #131A2C;
  --ink-2:  #566078;
  --ink-3:  #8A92A8;
  --line:   #E2E6EE;
  --deep:   #1C2750;
  --deep-2: #2B3A76;
  --night:  #0B1024;
  --grass:  #69B25A;
  --sun:    #F3B85C;
  --dusk:   #F2D3C4;
  --tint-g: #E6F3E1; --tint-b: #E3EAFA; --tint-s: #FCEFD9; --tint-p: #F6E4EC; --tint-v: #EEE8F8; --tint-t: #E3F4EF;
  --f:  "Geologica", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fw: "Unbounded", "Geologica", sans-serif;
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px;
  --shadow: 0 1px 1px rgba(19,26,44,.03), 0 18px 40px -22px rgba(19,26,44,.22);
  --shadow-up: 0 1px 1px rgba(19,26,44,.03), 0 30px 54px -24px rgba(19,26,44,.32);
  --spring: cubic-bezier(.22, 1.25, .36, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1180px;
}
* { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; color: var(--ink); font: 400 17px/1.65 var(--f); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: linear-gradient(180deg, var(--page) 0%, var(--page) calc(100% - 900px), #F6E7E4 calc(100% - 520px), var(--dusk) 100%); }
a { color: inherit; }
button { font: inherit; color: inherit; }
/* Явные цвета, чтобы тёмная тема браузера не перекрашивала окна и поля */
dialog { background: var(--card); color: var(--ink); }
input, textarea { background-color: var(--card); color: var(--ink); }
img { max-width: 100%; }
::selection { background: var(--tint-s); }
:focus-visible { outline: 2px solid var(--deep-2); outline-offset: 3px; border-radius: 10px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 28px; }
@media (max-width: 560px) { .wrap { padding-inline: 18px; } }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mark { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Навигация ---------- */
.nav { position: fixed; z-index: 50; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); translate: -50% 0;
  width: min(calc(100% - 28px), 980px); display: flex; align-items: center; gap: 6px; padding: 7px 7px 7px 16px;
  background: rgba(255,255,255,.62); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.8); border-radius: 30px; box-shadow: 0 10px 30px -18px rgba(19,26,44,.35);
  animation: navIn 1s .1s var(--out) both; transition: background .4s, border-color .4s; flex-wrap: wrap; }
.nav.dark { background: rgba(20,26,52,.55); border-color: rgba(255,255,255,.12); color: #fff; }
.nav.dark .links a { color: rgba(255,255,255,.72); } .nav.dark .links a:hover, .nav.dark .links a[aria-current] { color: #fff; background: rgba(255,255,255,.08); }
.nav.dark .btn-icon { background: rgba(255,255,255,.1); } .nav.dark .btn-deep { background: #fff; color: var(--deep); }
@keyframes navIn { from { translate: -50% -30px; opacity: 0; } }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; font: 500 17px/1 var(--fw); letter-spacing: .08em; min-height: 46px; }
.brand .mark { width: 26px; height: 26px; transition: rotate .6s var(--spring); }
.brand:hover .mark { rotate: -12deg; }
.links { display: flex; }
.links a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-2); padding: 11px 15px; border-radius: 999px; transition: color .2s, background .2s; }
.links a:hover { color: var(--ink); background: rgba(19,26,44,.05); }
.links a[aria-current] { color: var(--ink); background: rgba(19,26,44,.06); }
.nav .burger { display: none; }
@media (max-width: 860px) {
  .nav .burger { display: inline-flex; }
  .links { order: 9; width: 100%; flex-direction: column; gap: 2px; max-height: 0; overflow: hidden; transition: max-height .5s var(--out), padding .5s var(--out); }
  .nav.open .links { max-height: 360px; padding: 8px 0 6px; }
  .links a { font-size: 17px; padding: 13px 12px; border-radius: 16px; }
  .nav .tg-btn { display: none; }
}
.burger .ico line { transition: transform .4s var(--spring), opacity .2s; transform-origin: 12px 12px; }
.nav.open .burger .l1 { transform: translateY(5px) rotate(45deg); }
.nav.open .burger .l2 { opacity: 0; }
.nav.open .burger .l3 { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform .35s var(--spring), background .25s, box-shadow .3s, color .25s; }
.btn:active { transform: scale(.96); }
.btn-deep { background: var(--deep); color: #fff; } .btn-deep:hover { background: var(--deep-2); }
.btn-icon { width: 46px; padding: 0; background: rgba(19,26,44,.05); } .btn-icon:hover { background: rgba(19,26,44,.1); }
.btn-icon .ico { width: 19px; height: 19px; }
.btn-white { background: #fff; color: var(--deep); } .btn-white:hover { background: #EDF1FD; }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; } .btn-glass:hover { background: rgba(255,255,255,.2); }
.btn-line { background: transparent; border: 1px solid var(--line); color: var(--ink); } .btn-line:hover { background: #fff; border-color: #fff; box-shadow: var(--shadow); }
.play { min-height: 60px; padding: 0 10px 0 24px; gap: 14px; font-size: 16px; box-shadow: 0 16px 34px -16px rgba(28,39,80,.8); }
.play:hover { transform: translateY(-2px); }
.play .addr { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); padding: 11px 15px; border-radius: 999px; font-variant-numeric: tabular-nums; transition: background .25s; }
.play .addr .ico { width: 17px; height: 17px; }
.play.ok .addr { background: var(--grass); }

/* ---------- Заголовки и секции ---------- */
section { padding-top: 136px; }
@media (max-width: 700px) { section { padding-top: 92px; } }
h1, h2 { font-weight: 500; letter-spacing: -.032em; text-wrap: balance; }
h2 { margin: 0; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.06; max-width: 17ch; }
.lead { margin: 16px 0 0; color: var(--ink-2); font-size: 18px; max-width: 56ch; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 40px; margin-bottom: 44px; }
.more { color: var(--deep-2); font-weight: 500; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1.5px; background-position: 0 78%; background-repeat: no-repeat; transition: background-size .35s var(--out); }
.more:hover { background-size: 100% 1.5px; }
.rise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 26%; }
@keyframes rise { from { translate: 0 40px; } to { translate: 0 0; } }
@keyframes up { from { opacity: 0; translate: 0 16px; } }
code { font-family: inherit; font-weight: 500; font-size: .93em; background: var(--tint-b); color: var(--deep-2); padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
kbd { font: 500 .88em/1 var(--f); background: #fff; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.badge { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--bg); color: var(--fg); transition: transform .6s var(--spring); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--bg, var(--tint-b)); color: var(--fg, var(--deep-2)); }

/* Шапка внутренних страниц */
.page-hero { position: relative; overflow: hidden; isolation: isolate; padding: 160px 0 70px;
  background: linear-gradient(180deg, #C3D6F2 0%, #E3E8F5 55%, var(--page) 100%); }
.page-hero::before { content: ""; position: absolute; z-index: -1; width: 700px; height: 700px; right: -200px; top: -380px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.95), transparent 65%); }
.page-hero h1 { margin: 14px 0 0; font-size: clamp(42px, 6vw, 76px); line-height: 1.02; animation: up 1s .1s var(--out) both; }
.page-hero .lead { font-size: 19px; animation: up 1s .2s var(--out) both; }
.crumb { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; animation: up 1s var(--out) both; }
.crumb:hover { color: var(--ink); }
.crumb .ico { width: 16px; height: 16px; }

/* ---------- Головы игроков ---------- */
.face { position: relative; display: inline-block; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none; background: #ddd; transition: transform .5s var(--spring); vertical-align: middle; }
.face img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 -4px 0 rgba(0,0,0,.08), inset 0 3px 0 rgba(255,255,255,.14); }
.tick { width: 20px; height: 20px; border-radius: 50%; background: #3B82F6; display: inline-grid; place-items: center; flex: none; }
.tick svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; }

/* ---------- Карточка ---------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); }
[hidden] { display: none !important; }
.demo-note { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); background: var(--tint-s); border-radius: 14px; padding: 12px 16px; }
.demo-note .ico { width: 18px; height: 18px; color: #B77714; }

/* ---------- Ночь: подвал ---------- */
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.night { position: relative; overflow: hidden; isolation: isolate; margin-top: 140px; color: #E8ECF8;
  background: linear-gradient(180deg, var(--dusk) 0%, #B98FA8 7%, #4A4378 18%, #1A1F48 32%, var(--night) 55%); padding: 220px 0 calc(40px + env(safe-area-inset-bottom, 0px)); }
.moon { position: absolute; z-index: -1; top: 130px; right: 12%; width: 74px; height: 74px; border-radius: 10px; background: #F4F1E6;
  box-shadow: 0 0 0 10px rgba(244,241,230,.05), 0 0 80px 20px rgba(244,241,230,.28); animation: moon 12s ease-in-out infinite; }
.moon::before, .moon::after { content: ""; position: absolute; border-radius: 4px; background: rgba(170,168,160,.45); }
.moon::before { width: 18px; height: 18px; left: 14px; top: 16px; } .moon::after { width: 12px; height: 12px; right: 14px; bottom: 16px; }
@keyframes moon { 50% { translate: 0 -8px; } }
.sleep { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.12; font-weight: 300; letter-spacing: -.03em; max-width: 20ch; margin: 0; color: #fff; text-wrap: balance; }
.sleep-sub { margin: 18px 0 0; color: #A9B2D6; max-width: 48ch; font-size: 17px; }
.night .cta { display: flex; margin-top: 30px; }
.night .play { background: #fff; color: var(--deep); box-shadow: 0 16px 40px -16px rgba(255,255,255,.35); }
.night .play .addr { background: rgba(28,39,80,.08); }
.night .play.ok .addr { background: var(--grass); color: #fff; }
.cols { margin-top: 110px; display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 36px; padding-top: 40px; border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; margin-top: 70px; } .cols > :first-child { grid-column: 1 / -1; } .night .play { width: 100%; justify-content: space-between; } }
.cols h4 { margin: 0 0 14px; font-size: 14px; font-weight: 500; color: #7E88B0; }
.cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cols a { color: #DDE3F5; text-decoration: none; display: inline-flex; min-height: 34px; align-items: center; transition: color .2s, translate .3s var(--spring); }
.cols a:hover { color: #fff; translate: 4px 0; }
.foot-brand { display: grid; gap: 14px; align-content: start; }
.foot-brand .row { display: flex; align-items: center; gap: 12px; font: 200 22px/1 var(--fw); letter-spacing: .1em; color: #fff; text-decoration: none; }
.foot-brand .mark { width: 34px; height: 34px; color: #fff; }
.foot-brand p { margin: 0; color: #8E97BD; font-size: 15px; max-width: 32ch; }
.legal { margin-top: 80px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.07); display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between; color: #6F79A0; font-size: 13px; }
.legal s { color: #8E97BD; }

/* ---------- Всплывашка ---------- */
.toast-g { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 20px; opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 15px; padding: 12px 18px; border-radius: 14px; box-shadow: 0 20px 40px -18px rgba(0,0,0,.5); transition: opacity .3s, translate .5s var(--spring); }
.toast-g.on { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
