/* Night at the Zoo — портал (главная и правила).
   Стиль: почти чёрная ночь, золото фонарей, прямые углы, тонкие линии, плотные крупные заголовки. */
:root {
  --bg: #0b0d12;
  --surface: #14171f;
  --surface-2: #181c25;
  --surface-3: #20252f;
  --line: #2e333d;
  --line-2: #3a3f49;
  --dim: #9297a3;
  --text: #f4f1ea;
  --soft: #b4b6bc;
  --gold: #f4c54c;
  --gold-2: #ffda75;
  --gold-ink: #1f1b12;
  --green: #5fd6ac;
  --red: #ff7c7e;
  --night: #6f5fe0;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); overflow-x: clip; min-height: 100vh; position: relative; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
a { color: inherit; }
::selection { color: var(--gold-ink); background: var(--gold); }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { width: min(1190px, 100%); margin: 0 auto; padding-left: max(30px, env(safe-area-inset-left, 0px)); padding-right: max(30px, env(safe-area-inset-right, 0px)); }
.ambient { pointer-events: none; position: absolute; z-index: -1; filter: blur(110px); border-radius: 50%; opacity: .16; }
.ambient-one { top: 40px; right: 4vw; width: 540px; height: 440px; background: #8a7125; }
.ambient-two { top: 980px; left: -300px; width: 520px; height: 520px; background: #3a2f8a; }
.kicker { color: var(--gold); letter-spacing: .18em; font-weight: 850; font-size: 11px; margin: 0 0 16px; text-transform: uppercase; }
.muted { color: var(--dim); }

/* ---------- Шапка ---------- */
.site-nav { min-height: 84px; display: flex; align-items: center; gap: 40px; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--gold); border-radius: 9px; flex: none; }
.brand-copy { display: flex; flex-direction: column; line-height: .9; }
.brand-copy b { font-size: 19px; font-weight: 900; letter-spacing: -.04em; }
.brand-copy b span { color: var(--gold); }
.brand-copy small { color: #8c8f97; font-size: 8px; letter-spacing: .24em; margin-top: 6px; font-weight: 700; }
.site-nav nav { display: flex; align-items: center; gap: 28px; margin-inline-start: auto; }
.site-nav nav a { text-decoration: none; color: #c6c5c5; font-size: 13px; font-weight: 650; transition: color .2s; }
.site-nav nav a:hover, .site-nav nav a[aria-current="page"] { color: var(--gold); }
.nav-right { display: flex; align-items: center; gap: 14px; min-height: 44px; }
.signed-in { display: flex; align-items: center; gap: 10px; }
.signed-in a { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; text-decoration: none; font-weight: 750; max-width: 170px; }
.signed-in a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { background: transparent; color: #d3d2d0; border: 1px solid #4b4c50; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: #3f4656; }
.ava-letter { font-weight: 900; color: #fff; font-size: 13px; }
.devlogin { display: flex; gap: 6px; }
.devlogin input { width: 150px; }

/* ---------- Кнопки и поля ---------- */
.button-gold, .button-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 12px 20px;
  font-size: 12px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; text-align: center;
  border: 1px solid var(--gold); border-radius: 0; transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.button-gold { background: var(--gold); color: var(--gold-ink); }
.button-gold:hover:not(:disabled) { background: var(--gold-2); border-color: var(--gold-2); transform: translateY(-1px); }
.button-outline { border-color: #50535b; color: #ecebe9; background: transparent; }
.button-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.button-arrow { font-size: 20px; line-height: 1; }
.link-cta { font-size: 11px; letter-spacing: .1em; font-weight: 850; text-decoration: none; border-bottom: 1px solid #7c6d46; display: inline-flex; align-items: center; gap: 48px; padding-bottom: 10px; text-transform: uppercase; }
.link-cta span:last-child { font-size: 18px; color: var(--gold); }
.link-cta:hover { border-color: var(--gold); }
.field, select.field { background: #222731; border: 1px solid #454950; color: var(--text); padding: 10px 14px; border-radius: 0; min-height: 44px; }
.field:focus { border-color: var(--gold); outline: none; }
/* устаревшие классы из общих скриптов (модальные окна, вход) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border: 1px solid #50535b; background: transparent; color: var(--text); border-radius: 0; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover:not(:disabled) { background: var(--gold-2); color: var(--gold-ink); }
.devlogin input, .modal input:not([type=checkbox]):not([type=radio]) { background: #222731; border: 1px solid #454950; padding: 10px 12px; min-height: 44px; border-radius: 0; }

/* ---------- Герой ---------- */
.hero { min-height: 640px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 20px; padding-top: 64px; padding-bottom: 72px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--gold); letter-spacing: .18em; font-weight: 850; font-size: 11px; text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px #f4c54c88; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hero h1 { font-size: clamp(54px, 7vw, 94px); line-height: .96; letter-spacing: -.065em; margin: 0 0 24px; font-weight: 900; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-lead { max-width: 520px; color: #b2b3b6; font-size: 17px; line-height: 1.75; margin: 0 0 34px; }
.hero-facts { display: flex; gap: 38px; margin-bottom: 40px; flex-wrap: wrap; }
.hero-facts div { display: grid; gap: 3px; }
.hero-facts strong { font-size: 25px; letter-spacing: -.04em; font-weight: 850; }
.hero-facts small { font-size: 13px; margin-left: 3px; color: #bcb4a1; font-weight: 600; }
.hero-facts span { font-size: 10px; letter-spacing: .095em; color: #81858d; font-weight: 850; text-transform: uppercase; }
.hero-cta { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.hero-art { height: 510px; position: relative; display: grid; place-items: center; isolation: isolate; }
.art-glow { position: absolute; width: 430px; height: 430px; background: radial-gradient(circle, #d2a5372a, transparent 70%); z-index: -2; }
.art-ring { border: 1px solid rgba(244, 197, 76, .14); position: absolute; border-radius: 50%; transform: rotate(-17deg); }
.art-ring-one { width: 430px; height: 430px; }
.art-ring-two { width: 340px; height: 340px; border-style: dashed; }
.art-moon { position: absolute; top: 18px; right: 40px; width: 70px; height: 70px; z-index: -1; }
.tilecard { position: absolute; width: 206px; background: #1c2029; border: 3px solid #ebe3cf; border-radius: 14px; overflow: hidden; box-shadow: 0 26px 55px #000a; transition: transform .3s; }
.tilecard .tc-art { aspect-ratio: 1 / 1; display: block; }
.tilecard .tc-art svg { width: 100%; height: 100%; display: block; }
.tilecard .tc-plate { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #12151c; border-top: 2px solid #ebe3cf; }
.tilecard .tc-plate b { font-size: 17px; letter-spacing: -.02em; }
.tilecard .tc-plate span { color: var(--gold); font-weight: 900; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.tc-one { transform: translate(-112px, 24px) rotate(-17deg); z-index: 1; }
.tc-two { transform: translate(0, -18px) rotate(3deg); z-index: 3; }
.tc-three { transform: translate(114px, 30px) rotate(17deg); z-index: 2; }
.tc-one:hover { transform: translate(-112px, 6px) rotate(-12deg); z-index: 4; }
.tc-two:hover { transform: translate(0, -34px) rotate(0); }
.tc-three:hover { transform: translate(114px, 12px) rotate(12deg); z-index: 4; }

/* ---------- Секции ---------- */
.section { border-top: 1px solid var(--line); padding-top: 86px; padding-bottom: 92px; }
.section-topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 45px; margin-bottom: 40px; }
.section-topline > p { width: 360px; color: #a7aab2; line-height: 1.75; margin: 0 0 4px; }
.section h2, .setup-intro h2 { font-size: clamp(31px, 3.65vw, 49px); line-height: 1.06; letter-spacing: -.05em; margin: 0; font-weight: 870; text-wrap: balance; }
.section h2 em, .setup-intro h2 em { font-style: normal; color: var(--gold); }

/* ---------- Настройка игры ---------- */
.setup-section { padding-bottom: 96px; }
.setup-content { border: 1px solid #3a3c3e; background: #15181e; display: grid; grid-template-columns: 1fr .9fr; }
.setup-intro { padding: 44px 50px; display: flex; flex-direction: column; justify-content: center; }
.setup-intro h2 { margin-bottom: 20px; }
.setup-intro > p:not(.kicker) { max-width: 440px; color: #aeb1b9; font-size: 15px; margin: 0; }
.setup-perks { display: flex; gap: 14px 24px; flex-wrap: wrap; margin-top: 26px; color: #d2d1cc; font-weight: 650; font-size: 12px; }
.setup-perks span { display: inline-flex; align-items: center; gap: 7px; }
.setup-form { padding: 38px 44px; border-left: 1px solid #3a3c3e; background: #191c23; display: flex; flex-direction: column; gap: 0; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #454950; margin-bottom: 24px; }
.modes button { background: transparent; border: 0; border-right: 1px solid #454950; padding: 12px 6px; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: #c6c5c4; min-height: 46px; }
.modes button:last-child { border-right: 0; }
.modes button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid #33363c; }
.form-row:first-of-type { border-top: 0; }
.form-row > label, .form-row > .label { font-size: 11px; font-weight: 850; letter-spacing: .13em; color: #c6c5c4; text-transform: uppercase; }
.count-control { display: flex; align-items: center; gap: 12px; }
.count-control button { width: 38px; height: 38px; background: #262a33; border: 1px solid #383f4c; color: var(--text); font-weight: 700; font-size: 20px; display: grid; place-items: center; padding: 0; }
.count-control output { font-size: 31px; font-weight: 900; width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.form-hint { color: #a6a9b1; font-size: 12px; text-align: end; margin: -8px 0 4px; }
.form-row select { min-width: 150px; }
.checks { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 22px; border-top: 1px solid #33363c; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 13px; color: #d6d5d1; line-height: 1.45; }
.check input { appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border: 1px solid #5a5e66; background: #222731; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--gold); border-color: var(--gold); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: solid var(--gold-ink); border-width: 0 0 2.5px 2.5px; transform: translate(0, -1px) rotate(-45deg); }
.check small { display: block; color: var(--dim); font-size: 12px; }
.start-button { width: 100%; justify-content: space-between; min-height: 56px; font-size: 13px; }
.setup-login { margin-top: 14px; padding: 14px; border: 1px dashed #6d633b; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.setup-login p { margin: 0; font-size: 13px; color: #d9d2bd; }
.setup-login.flash { animation: flashbox .9s ease-out 2; }
@keyframes flashbox { 50% { border-color: var(--gold); background: #f4c54c14; } }
.joincode { display: flex; gap: 8px; margin-top: 16px; }
.joincode input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .12em; }

/* ---------- Кабинет ---------- */
.dashboard-hero { padding-top: 60px; padding-bottom: 64px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.dashboard-head h2 { font-size: clamp(36px, 5.2vw, 62px); letter-spacing: -.065em; line-height: 1; margin: 0; font-weight: 900; }
.dashboard-head h2 em { font-style: normal; color: var(--gold); }
.dashboard-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.profile-top { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.5fr); gap: 14px; margin-bottom: 14px; }
.panel { background: #171b23; border: 1px solid #383d47; }
.profile-card { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.profile-welcome { display: flex; align-items: center; gap: 15px; }
.profile-welcome .ava { width: 56px; height: 56px; font-size: 22px; border: 2px solid var(--gold); }
.profile-welcome h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.profile-welcome p { margin: 3px 0 0; color: var(--gold); font-size: 13px; font-weight: 700; }
.xp-progress { margin: 22px 0 6px; height: 8px; background: #32353b; overflow: hidden; }
.xp-progress span { display: block; height: 100%; background: var(--gold); transition: width .5s; }
.xp-metrics { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; font-size: 12px; font-variant-numeric: tabular-nums; }
.xp-metrics b { color: #fff2c3; }
.xp-metrics span { color: #bfc5d0; }
.nudge { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: #f4c54c12; color: #f1e3bd; font-size: 13px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-stats > div { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; border-right: 1px solid #333942; border-bottom: 1px solid #333942; min-width: 0; }
.profile-stats > div:nth-child(3n) { border-right: 0; }
.profile-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
.profile-stats strong { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.05em; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1; }
.profile-stats strong small { font-size: 13px; color: var(--dim); letter-spacing: 0; margin-left: 4px; }
.profile-stats span { font-size: 10px; letter-spacing: .08em; color: #a8abb4; font-weight: 750; text-transform: uppercase; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.account-box { padding: 24px; min-width: 0; }
.account-box h3 { margin: 0 0 16px; font-size: 20px; letter-spacing: -.02em; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.account-box h3 small { font-size: 11px; color: var(--gold); letter-spacing: .1em; font-weight: 850; }
.account-box.wide { grid-column: 1 / -1; }
.quest { padding: 12px 0; border-top: 1px solid #2e333c; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; }
.quest:first-of-type { border-top: 0; padding-top: 0; }
.quest b { font-size: 13px; font-weight: 650; }
.quest em { font-style: normal; color: var(--gold); font-size: 12px; font-weight: 850; white-space: nowrap; }
.quest .qbar { height: 5px; background: #2c3038; grid-column: 1 / -1; }
.quest .qbar span { display: block; height: 100%; background: var(--green); }
.quest.done b { color: var(--dim); text-decoration: line-through; }
.chest { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border: 1px dashed #6d633b; font-size: 13px; color: #d9d2bd; }
.chest.open { border-style: solid; border-color: var(--gold); background: #f4c54c10; }
.match { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #20242d; padding: 11px 12px; font-size: 12px; color: #c4c6cc; margin-bottom: 7px; flex-wrap: wrap; }
.match strong { color: var(--text); }
.match .place { display: inline-grid; place-items: center; width: 24px; height: 24px; background: #343a45; font-weight: 900; color: var(--text); margin-right: 8px; }
.match .place.p1 { background: var(--gold); color: var(--gold-ink); }
.match .xp { color: var(--gold); font-weight: 800; }
.match .button-gold, .match .button-outline { min-height: 34px; padding: 6px 12px; font-size: 10px; }
.empty-note { color: var(--dim); font-size: 13px; margin: 0; }
.ach-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.ach { border: 1px solid #373d46; padding: 11px; display: flex; gap: 10px; align-items: center; color: #9c9fa8; min-width: 0; }
.ach.on { color: var(--text); border-color: #887243; background: #56432222; }
.ach svg { flex: none; }
.ach strong, .ach small { display: block; }
.ach strong { font-size: 12px; }
.ach small { font-size: 11px; color: #999fa7; line-height: 1.35; }

/* ---------- Рейтинг и комнаты ---------- */
.boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.board-box { min-width: 0; background: #171a21; border: 1px solid #343842; }
.board-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #343842; }
.board-head h3 { font-size: clamp(16px, 1.75vw, 20px); letter-spacing: -.03em; margin: 0; }
.board-index { color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .13em; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.rank-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rank-table th { text-align: left; color: #8e97a4; font-size: 10px; letter-spacing: .09em; padding: 12px 10px; font-weight: 750; }
.rank-table td { padding: 11px 10px; border-top: 1px solid #2c3139; font-size: 13px; font-weight: 650; }
.rank-table th:first-child, .rank-table td:first-child { padding-left: 20px; width: 48px; }
.rank-table th:last-child, .rank-table td:last-child { padding-right: 20px; text-align: end; }
.rank-table td:last-child { color: var(--gold); font-weight: 850; }
.rank-table tr.me td { background: #f4c54c10; }
.rank-table .empty { color: #9399a6; text-align: center !important; padding: 28px 15px; font-weight: 400; }
.player { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; }
.player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medal { display: inline-grid; place-items: center; width: 24px; height: 24px; font-weight: 900; font-size: 12px; color: var(--gold-ink); }
.m1 { background: var(--gold); } .m2 { background: #d9d6ea; } .m3 { background: #e0a070; }
.caption { font-size: 12px; color: #939ba6; margin: 16px 0 0; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.room { background: #171a21; border: 1px solid #343842; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.room.waiting { border-color: #5a5236; }
.room-head { display: flex; align-items: center; gap: 10px; }
.room-head b { display: block; font-size: 14px; }
.room-head small { color: var(--dim); font-size: 11px; letter-spacing: .06em; }
.code { color: var(--gold); font-weight: 850; letter-spacing: .12em; }
.badge { margin-inline-start: auto; font-size: 10px; font-weight: 850; letter-spacing: .08em; padding: 5px 9px; border: 1px solid #454950; text-transform: uppercase; white-space: nowrap; }
.badge.waiting { border-color: var(--green); color: var(--green); }
.room-seats { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.seat-open { width: 30px; height: 30px; border-radius: 50%; border: 1px dashed #5a5e66; display: inline-block; }
.seat-bot { width: 30px; height: 30px; border-radius: 50%; background: #2a2f3a; display: inline-grid; place-items: center; overflow: hidden; }
.room-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.room-foot .button-gold, .room-foot .button-outline { margin-inline-start: auto; min-height: 40px; padding: 8px 14px; font-size: 11px; }
.tag { font-size: 10px; font-weight: 850; letter-spacing: .08em; padding: 4px 8px; background: #23402f; color: #9fe8c4; text-transform: uppercase; }
.room-animals { display: flex; gap: 2px; }
.empty-box { grid-column: 1 / -1; display: flex; align-items: center; gap: 22px; padding: 24px 26px; border: 1px solid var(--line); background: #171a21; flex-wrap: wrap; }
.empty-box p { flex: 1 1 280px; margin: 0; color: #adb0b9; }

/* ---------- Как играть: три карточки ---------- */
.three-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; }
.feature-card { border: 1px solid var(--line); background: var(--surface); padding: 25px 27px 30px; min-width: 0; }
.feature-index { font-size: 10px; letter-spacing: .14em; color: var(--gold); font-weight: 850; }
.feature-art { height: 140px; display: flex; align-items: center; justify-content: center; margin: 16px auto 18px; }
.feature-art svg { width: 100%; height: 100%; }
.feature-card h3 { font-size: 21px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.025em; }
.feature-card p { color: #abaeb5; line-height: 1.7; margin: 0; font-size: 13px; }

/* ---------- Животные ---------- */
.animal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.animal { border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.animal-art { aspect-ratio: 1 / 1; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.animal-art svg { width: 100%; height: 100%; display: block; transition: transform .4s; }
.animal:hover .animal-art svg { transform: scale(1.06); }
.animal-art .tag { position: absolute; left: 10px; top: 10px; }
.animal-body { padding: 14px 15px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.animal-body h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.animal-body h3 span { color: var(--gold); font-size: 15px; font-weight: 900; }
.moons { display: flex; gap: 3px; }
.animal-body p { margin: 0; color: #abaeb5; font-size: 12px; line-height: 1.55; }
.animal-body .score { color: #e8dcb6; font-weight: 650; }

/* ---------- Главное отличие ---------- */
.rules-section { display: grid; grid-template-columns: .95fr 1.05fr; gap: 80px; align-items: center; }
.rules-visual { min-height: 320px; display: grid; place-items: center; background: radial-gradient(ellipse, #d5b24c17, transparent 67%); }
.rules-visual svg { width: min(100%, 520px); height: auto; filter: drop-shadow(0 22px 25px #0008); }
.rules-copy h2 { margin-bottom: 20px; }
.rules-copy p:not(.kicker) { color: #aeb1b8; line-height: 1.8; max-width: 520px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.pills span { font-size: 11px; border: 1px solid #46474b; padding: 9px 12px; color: #c5c7c8; }

/* ---------- Вопросы ---------- */
.faq-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; }
.faq-section h2 { margin-bottom: 22px; }
.faq-list { border-top: 1px solid #373a41; }
.faq-list details { border-bottom: 1px solid #373a41; padding: 20px 0; }
.faq-list summary { list-style: none; font-weight: 750; cursor: pointer; position: relative; padding-inline-end: 34px; font-size: 15px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; inset-inline-end: 0; top: -2px; color: var(--gold); font-size: 24px; line-height: 1; }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list p { color: #aaaeb5; line-height: 1.7; font-size: 14px; margin: 11px 30px 0 0; }

/* ---------- Финальный призыв и подвал ---------- */
.cta-band { border: 1px solid #5a5236; background: linear-gradient(110deg, #1d1a12, #15171f 60%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center; padding: 40px 44px; position: relative; overflow: hidden; }
.cta-band h2 { font-size: clamp(28px, 3.4vw, 44px); margin: 0 0 10px; font-weight: 870; letter-spacing: -.05em; line-height: 1.06; }
.cta-band p { margin: 0; color: #b9b6aa; max-width: 560px; }
.cta-band svg.cta-moon { position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; opacity: .08; pointer-events: none; }
.landing-footer { border-top: 1px solid var(--line); padding-top: 36px; padding-bottom: 50px; margin-top: 90px; display: grid; grid-template-columns: auto 1fr auto; gap: 36px; align-items: center; }
.landing-footer p { font-size: 12px; line-height: 1.7; color: #8f9299; max-width: 600px; margin: 0; }
.landing-footer p a { color: var(--gold); text-decoration: none; }
.footer-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.footer-links a { font-weight: 800; font-size: 11px; letter-spacing: .08em; text-decoration: none; color: var(--gold); white-space: nowrap; text-transform: uppercase; }

/* ---------- Модальные окна и уведомления (общие скрипты) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #06080ce3; padding: 18px; overflow-y: auto; backdrop-filter: blur(9px); }
.modal-card { position: relative; background: #1a1f29; border: 1px solid #59606a; box-shadow: 0 40px 100px #000c; padding: 30px; width: min(620px, 100%); max-height: 92vh; overflow: auto; }
.modal-card h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.07; letter-spacing: -.045em; margin: 0 0 12px; }
.modal-card p { color: #aab2be; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 24px; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(450px, 92vw); }
.toast { background: #283441; border: 1px solid var(--gold); padding: 12px 20px; box-shadow: 0 13px 34px #0008; font-size: 13px; text-align: center; transition: opacity .4s, transform .4s; }
.toast.err { border-color: var(--red); background: #3a2328; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- Страница правил ---------- */
.rules-page .rules-hero { padding-top: 64px; padding-bottom: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 50px; align-items: end; }
.rules-page .rules-hero h1 { font-size: clamp(44px, 6vw, 80px); line-height: .98; letter-spacing: -.06em; margin: 0 0 22px; font-weight: 900; text-wrap: balance; }
.rules-page .rules-hero h1 em { font-style: normal; color: var(--gold); }
.rules-page .rules-hero .hero-lead { margin: 0; }
.toc { border: 1px solid var(--line); background: var(--surface); padding: 20px 22px; }
.toc p { margin: 0 0 12px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; border-top: 1px solid #2c3139; }
.toc li:first-child { border-top: 0; }
.toc a { display: flex; gap: 12px; padding: 9px 0; text-decoration: none; font-size: 13px; font-weight: 650; color: #d4d3cf; }
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--gold); font-size: 11px; font-weight: 850; letter-spacing: .08em; padding-top: 2px; }
.toc a:hover { color: var(--gold); }
.rule-block { border-top: 1px solid var(--line); padding-top: 64px; padding-bottom: 20px; scroll-margin-top: 20px; }
.rule-block > h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.06; letter-spacing: -.05em; margin: 0 0 18px; font-weight: 870; }
.rule-block h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 34px 0 10px; font-weight: 850; }
.rule-block p, .rule-block li { color: #b9bcc3; line-height: 1.8; max-width: 74ch; }
.rule-block ul { padding-inline-start: 20px; }
.rule-block li::marker { color: var(--gold); }
.rule-block b { color: var(--text); }
.rule-block .kicker { color: var(--gold); line-height: 1.4; }
.ill { margin: 18px 0; border: 1px solid #343842; background: #12151c; padding: 14px; }
.ill svg { display: block; width: 100%; height: auto; max-height: 560px; }
.ill figcaption { color: #9399a6; font-size: 13px; margin-top: 10px; line-height: 1.6; }
.ill.small { margin: 12px 0 0; padding: 10px; }
.ill.small svg { max-height: 200px; }
.ill-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ill-row .ill svg { max-height: 160px; }
.legend { padding-left: 0 !important; list-style: none; counter-reset: lg; columns: 2 320px; column-gap: 30px; margin: 18px 0 0; }
.legend li { counter-increment: lg; position: relative; padding-inline-start: 40px; margin-bottom: 12px; break-inside: avoid; }
.legend li::before { content: counter(lg); position: absolute; inset-inline-start: 0; top: 2px; width: 26px; height: 26px; display: grid; place-items: center; background: #ff8a3d; color: #2b1406; font-weight: 900; font-size: 12px; border-radius: 50%; }
.tile-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.tile-row div { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 108px; text-align: center; font-size: 12px; color: #9fa3ab; }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid #343842; margin: 14px 0; }
.acts div { padding: 16px 18px; border-right: 1px solid #343842; background: var(--surface); }
.acts div:last-child { border-right: 0; }
.acts dt { font-weight: 850; color: var(--gold); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.acts dd { margin: 6px 0 0; color: #b9bcc3; font-size: 14px; line-height: 1.6; }
.animal-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.animal-rule { border: 1px solid #343842; background: var(--surface); padding: 16px 18px; min-width: 0; }
.animal-rule header { display: flex; gap: 12px; align-items: center; }
.animal-rule h3 { margin: 0; color: var(--text); font-size: 18px; letter-spacing: -.02em; text-transform: none; }
.animal-rule h3 small, .rules-page .tag-small { font-size: 9px; letter-spacing: .1em; background: #23402f; color: #9fe8c4; padding: 2px 6px; vertical-align: middle; text-transform: uppercase; font-weight: 850; margin-left: 6px; }
.moons-row { margin: 3px 0 0; display: flex; gap: 2px; align-items: center; font-size: 12px; }
.moons-row b { margin-left: 8px; color: #e8dcb6; font-weight: 650; }
.animal-rule > p { margin: 10px 0 0; font-size: 14px; }
.score-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-variant-numeric: tabular-nums; border: 1px solid #343842; }
.score-table th, .score-table td { padding: 12px; border-top: 1px solid #343842; text-align: center; }
.score-table th { color: #8e97a4; font-size: 11px; letter-spacing: .08em; font-weight: 750; background: var(--surface); }
.score-table td { font-weight: 800; color: var(--gold); }
.score-table td:first-child, .score-table th:first-child { text-align: left; color: var(--text); }
.rank-ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid #343842; margin: 14px 0; }
.rank-ladder div { padding: 14px; border-right: 1px solid #343842; }
.rank-ladder div:last-child { border-right: 0; }
.rank-ladder b { display: block; color: var(--gold); font-size: 20px; letter-spacing: -.03em; }
.rank-ladder span { font-size: 12px; color: #b9bcc3; }

/* SVG-слои игрового поля (иллюстрации правил) */
.b-lbl { font: 700 15px var(--font); fill: #e3dcff; }
.b-food { font: 700 14px var(--font); fill: #e6fbf7; }
.b-food .on { fill: var(--gold); }
.t-num { font: 800 13px var(--font); fill: #1b1442; }
.t-lbl { font: 500 14px var(--font); fill: #d9d2ff; }
.t-cnt { font: 800 14px var(--font); fill: #3b2306; }
.t-cnt2 { font: 700 15px var(--font); fill: #d9d2ff; }
.t-cnt2.on { fill: var(--gold); }
.t-row { font: 800 13px var(--font); fill: #9d93d8; letter-spacing: 2px; }
.rec-ring { fill: none; stroke: var(--gold); stroke-width: 6; }

/* ---------- Адаптив ---------- */
@media (max-width: 1150px) {
  .site-nav { gap: 22px; }
  .site-nav nav { gap: 18px; }
  .hero-art { transform: scale(.88); }
  .animal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .profile-top, .account-grid { grid-template-columns: 1fr; }
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .animal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rules-page .rules-hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .site-nav { flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; gap: 12px 20px; }
  .site-nav nav { order: 3; width: 100%; margin: 0; gap: 6px 18px; flex-wrap: wrap; }
  .nav-right { margin-inline-start: auto; }
  .hero { grid-template-columns: 1fr; gap: 0; padding-top: 52px; min-height: 0; }
  .hero-art { height: 400px; transform: scale(.82); margin-top: -10px; }
  .setup-content, .rules-section, .faq-section, .cta-band { grid-template-columns: 1fr; }
  .setup-form { border-left: 0; border-top: 1px solid #3a3c3e; }
  .rules-section { gap: 20px; }
  .rules-visual { order: 2; }
  .faq-section { gap: 30px; }
  .boards { grid-template-columns: 1fr; }
  .section-topline { display: block; }
  .section-topline > p { width: auto; margin-top: 14px; }
  .three-cards { grid-template-columns: 1fr; }
  .feature-art { height: 120px; }
  .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acts div { border-right: 0; border-bottom: 1px solid #343842; }
  .acts div:last-child { border-bottom: 0; }
  .rank-ladder { grid-template-columns: 1fr; }
  .rank-ladder div { border-right: 0; border-bottom: 1px solid #343842; display: flex; gap: 14px; align-items: baseline; }
  .rank-ladder div:last-child { border-bottom: 0; }
}
@media (max-width: 620px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .site-nav nav a { font-size: 12px; }
  .brand-copy b { font-size: 16px; }
  .brand-icon { width: 34px; height: 34px; }
  .signed-in a span { display: none; }
  .hero { padding-top: 40px; padding-bottom: 36px; }
  .hero h1 { font-size: clamp(44px, 13vw, 66px); }
  .hero-lead { font-size: 15px; margin-bottom: 26px; }
  .hero-facts { gap: 22px; margin-bottom: 28px; }
  .hero-facts strong { font-size: 21px; }
  .hero-cta .button-gold { width: 100%; justify-content: space-between; }
  .hero-art { height: 300px; transform: scale(.62); margin: -30px 0 -40px; }
  .section { padding-top: 60px; padding-bottom: 64px; }
  .setup-section { padding-bottom: 64px; }
  .setup-intro, .setup-form { padding: 24px 20px; }
  .form-row select { min-width: 0; width: 100%; max-width: 180px; }
  .dashboard-hero { padding-top: 40px; }
  .dashboard-actions { width: 100%; }
  .dashboard-actions > * { flex: 1; }
  .profile-card { padding: 20px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats > div { padding: 14px 16px; border-right: 1px solid #333942 !important; border-bottom: 1px solid #333942 !important; }
  .profile-stats > div:nth-child(2n) { border-right: 0 !important; }
  .profile-stats > div:nth-last-child(-n+2) { border-bottom: 0 !important; }
  .account-box { padding: 18px; }
  .ach-grid { grid-template-columns: 1fr; }
  .animal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .animal-body { padding: 12px; }
  .animal-body p:not(.score) { display: none; }
  .rooms { grid-template-columns: 1fr; }
  .rank-table th:first-child, .rank-table td:first-child { padding-left: 12px; width: 40px; }
  .rank-table th:last-child, .rank-table td:last-child { padding-right: 12px; }
  .rank-table td { padding: 10px 6px; font-size: 12px; }
  .rank-table .lvl { display: none; }
  .cta-band { padding: 28px 20px; }
  .cta-band .button-gold { width: 100%; justify-content: space-between; }
  .landing-footer { grid-template-columns: 1fr; gap: 16px; margin-top: 60px; }
  .footer-links { align-items: flex-start; }
  .modal-card { padding: 22px 18px; }
  .row.end > * { flex: 1; }
  .devlogin input { width: 110px; }
  .rules-page .rules-hero { padding-top: 40px; }
  .rule-block { padding-top: 44px; }
  .legend { columns: 1; }
}
@media (max-width: 380px) {
  .brand-copy small { display: none; }
  .site-nav nav a { font-size: 11px; }
  .modes button { font-size: 10px; letter-spacing: .04em; }
  .count-control output { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Языки ---------- */
.language-picker { max-width: 150px; min-height: 40px; padding: 8px 10px; font-size: 12px; }
.nav-right { flex-wrap: wrap; justify-content: flex-end; }
.art-fill { width: 100%; height: 100%; }
.art-fill svg, .tc-art svg { width: 100%; height: 100%; display: block; }
.footer-languages { border-top: 1px solid var(--line); padding-top: 30px; margin-top: 90px; }
.footer-languages + .landing-footer { margin-top: 30px; }
.footer-languages-heading { color: #a5a8b2; font-size: 10px; letter-spacing: .14em; font-weight: 850; margin: 0 0 16px; text-transform: uppercase; }
.footer-language-links { display: flex; flex-wrap: wrap; gap: 9px 16px; }
.footer-language-links a { color: #a6acb9; font-size: 12px; text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 3px; }
.footer-language-links a:hover, .footer-language-links a[aria-current="page"] { color: var(--gold); border-color: var(--gold); }
/* Игровые схемы и карточки всегда слева направо */
html[dir="rtl"] .hero-art, html[dir="rtl"] .rules-visual, html[dir="rtl"] .feature-art, html[dir="rtl"] .ill svg, html[dir="rtl"] .tile-row { direction: ltr; }
html[dir="rtl"] .link-cta span:last-child, html[dir="rtl"] .button-arrow { transform: scaleX(-1); }
@media (max-width: 620px) {
  .language-picker { max-width: 120px; }
  .footer-languages { margin-top: 60px; }
}