/* Сайт RPGForge в стиле игрового клиента - те же атлас, шрифт и палитра, что у лаунчера (tools/gen_site.py).
   Пиксель атласа = 2px, кегли только 16/32/48/96 (пиксель шрифта = 1/2/3/6px), размеры - чётные.
   Целый масштаб экрана держит common.js (zoom под devicePixelRatio), поэтому раскладка - по @container,
   а не по @media: ширина контейнера считается уже в пикселях сайта. */
@font-face { font-family: 'RPGClient'; font-style: normal; font-weight: 400; font-display: block; src: url(/fonts/RPGClient.ttf) format('truetype'); }

:root {
  --gold: #d7c78d;    --sh-gold: #353123;
  --gold-lo: #96783c; --sh-gold-lo: #251e0f;
  --white: #ffffff;   --sh-white: #3f3f3f;
  --cream: #fff4d6;   --sh-cream: #3f3d35;
  --gray: #9aa3a8;    --sh-gray: #26282a;
  --dim: #606a70;     --sh-dim: #181a1c;
  --green: #78dc78;   --sh-green: #1e371e;
  --red: #e65a50;     --sh-red: #391614;
  --cyan: #5ac8dc;    --sh-cyan: #163237;
  --ink: #060a0c;
  --bar: #0a1014;
  --field: #090e12;
  --field-line: #344046;
  --modal: #10181d;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
/* Тень текста как в игре: свой цвет/4, сдвиг 1 пиксель шрифта клиента. --sh задаётся вместе с цветом */
* { text-shadow: calc(1em / 8) calc(1em / 8) 0 var(--sh); }
html { background: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  --sh: var(--sh-white);
  margin: 0; min-height: 100vh;
  display: flex; flex-direction: column;
  font: 16px/24px "RPGClient", monospace;
  font-kerning: none; font-synthesis: none; -webkit-font-smoothing: none;
  color: var(--white);
  background: var(--ink);
  image-rendering: pixelated;
  container: page / inline-size;
}
h1, h2, h3, p { margin: 0; font-weight: 400; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
main { flex: 1 0 auto; display: flex; flex-direction: column; }
main:focus { outline: none; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 12px 16px; background: var(--ink); border: 2px solid var(--gold); }
.skip:focus { top: 16px; }

.t-gold { color: var(--gold); --sh: var(--sh-gold); }
.t-white { color: var(--white); --sh: var(--sh-white); }
.t-gray { color: var(--gray); --sh: var(--sh-gray); }
.t-dim { color: var(--dim); --sh: var(--sh-dim); }
.t-red { color: var(--red); --sh: var(--sh-red); }
.t-green { color: var(--green); --sh: var(--sh-green); }

/* ширина колонки всегда чётная (кратна 4): иначе половинки пикселя у рамок и сеток */
.wrap { width: min(var(--wrap), round(down, 100% - 32px, 4px)); margin: 0 auto; }
.line { height: 2px; background: url(/ui/line.png) 0 0 / 100% 2px no-repeat; }

/* ── Значки ──────────────────────────────────────────────── */
.ico { display: inline-block; flex: 0 0 auto; background: center / 100% 100% no-repeat; }
.ico--dl { width: 14px; height: 16px; background-image: url(/ui/ico_download.png); }
.ico--vk { width: 26px; height: 14px; background-image: url(/ui/ico_vk_w.png); }
.ico--discord { width: 24px; height: 18px; background-image: url(/ui/ico_discord_w.png); }

/* ── Кнопки (как в лаунчере): видимая высота 48, по 8px вокруг под свечение ── */
.btn {
  height: 48px; padding: 0 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0 solid transparent;
  /* 28+28 из атласа 64x64 оставляют 8px однотонной середины: при высоте 48 вид тот же,
     что при 32+32, а выше (кнопка в плашке баланса, две строки) тянется середина, а не
     появляется разрыв посередине. */
  border-image: url(/ui/btn_gray.png) 28 24 fill / 28px 24px / 8px;
  background: none; cursor: pointer; white-space: nowrap;
  color: var(--white); --sh: var(--sh-white);
}
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 10px; }
.btn--block { width: 100%; }
.btn--gray { color: var(--gray); --sh: var(--sh-gray); }
.btn--gray:hover, .btn--gray.is-on { border-image-source: url(/ui/btn_gray_h.png); color: var(--white); --sh: var(--sh-white); }
.btn--brown { border-image-source: url(/ui/btn_brown.png); color: var(--cream); --sh: var(--sh-cream); }
.btn--brown:hover { border-image-source: url(/ui/btn_brown_h.png); }
.btn--green { border-image-source: url(/ui/btn_green.png); }
.btn--green:hover { border-image-source: url(/ui/btn_green_h.png); }
.btn--teal { border-image-source: url(/ui/btn_info.png); }
.btn--teal:hover, .btn--teal.is-on { border-image-source: url(/ui/btn_info_h.png); }
.btn--red { border-image-source: url(/ui/btn_red.png); }
.btn--red:hover { border-image-source: url(/ui/btn_red_h.png); }
.btn:disabled { cursor: default; transform: none; color: var(--dim); --sh: var(--sh-dim); }

/* Квадратные кнопки соцсетей: видимая часть 36x36 */
.wbtn { width: 36px; height: 36px; display: grid; place-items: center; border: 0 solid transparent; border-image: url(/ui/wbtn_vk.png) 26 fill / 26px / 8px; }
.wbtn:active { transform: translateY(2px); }
.wbtn--vk:hover { border-image-source: url(/ui/wbtn_vk_h.png); }
.wbtn--discord { border-image-source: url(/ui/wbtn_discord.png); }
.wbtn--discord:hover { border-image-source: url(/ui/wbtn_discord_h.png); }

.link { color: var(--cyan); --sh: var(--sh-cyan); cursor: pointer; }
.link:hover { text-decoration: underline 2px; text-underline-offset: 4px; }

/* ── Карточки из кнопки меню клиента (mbtn): 9 частей по 32px ── */
.card { position: relative; border: 0 solid transparent; border-image: url(/ui/card_plain.png) 32 fill / 32px; }
.card--gold { border-image-source: url(/ui/card_gold.png); }
.card--on { border-image-source: url(/ui/card_on.png); }
.card--off { border-image-source: url(/ui/card_off.png); }
a.card--on:hover, a.card--on:focus-visible { border-image-source: url(/ui/card_gold.png); outline: none; }
a.card--plain:hover, a.card--plain:focus-visible { border-image-source: url(/ui/card_plain_h.png); outline: none; }
/* Панель с золотой рамкой (panel атласа на сплошной подложке) */
.panel { position: relative; border: 0 solid transparent; border-image: url(/ui/panel_solid.png) 32 fill / 32px; }

/* ── Шапка ───────────────────────────────────────────────── */
.topbar { position: relative; z-index: 20; background: var(--bar); border-bottom: 2px solid var(--gold-lo); }
.topbar__in { height: 96px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand__crest { width: 64px; height: 64px; }
.brand__text { display: flex; flex-direction: column; gap: 4px; }
.brand__text b { font-weight: 400; font-size: 16px; line-height: 16px; letter-spacing: 2px; }
.brand__text small { font-size: 16px; line-height: 16px; }
.nav { display: flex; align-self: stretch; gap: 24px; }
.nav__a { position: relative; display: flex; align-items: center; color: var(--gray); --sh: var(--sh-gray); }
.nav__a:hover { color: var(--white); --sh: var(--sh-white); }
.nav__a.is-current { color: var(--gold); --sh: var(--sh-gold); }
.nav__a.is-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--gold); }
.topbar__act { margin-left: auto; display: flex; align-items: center; gap: 16px; }
/* вошедшему «Скачать» - только значок (плашка игрока занимает место), у админа меню плотнее */
.is-auth .topbar__dl { width: 48px; padding: 0; }
.is-auth .topbar__dl span { display: none; }
.is-admin .nav { gap: 18px; }
.burger { position: relative; display: none; width: 48px; height: 48px; padding: 0; border: 0 solid transparent; border-image: url(/ui/btn_gray.png) 32 24 fill / 32px 24px / 8px; background: none; cursor: pointer; }
.burger i, .burger i::before, .burger i::after { display: block; width: 20px; height: 4px; background: var(--gray); }
.burger i { position: relative; margin: 0 auto; }
.burger i::before, .burger i::after { content: ""; position: absolute; left: 0; }
.burger i::before { top: -8px; }
.burger i::after { top: 8px; }
.burger[aria-expanded="true"] { border-image-source: url(/ui/btn_gray_h.png); }
.burger[aria-expanded="true"] i, .burger[aria-expanded="true"] i::before, .burger[aria-expanded="true"] i::after { background: var(--gold); }
/* Мобильное меню под шапкой; показывается вместе с бургером (см. «Узкие экраны») */
.mnav { display: none; position: absolute; left: 0; right: 0; top: 98px; z-index: 19; background: var(--bar); border-bottom: 2px solid var(--gold-lo); visibility: hidden; }
.mnav.is-open { visibility: visible; }
.mnav__list { display: flex; flex-direction: column; padding: 8px 16px 16px; }
.mnav__a { padding: 12px 8px; color: var(--gray); --sh: var(--sh-gray); }
.mnav__a:hover, .mnav__a.is-current { color: var(--gold); --sh: var(--sh-gold); }

/* ── Подвал ──────────────────────────────────────────────── */
.foot { margin-top: 96px; background: var(--bar); border-top: 2px solid var(--gold-lo); }
.foot__in { min-height: 96px; display: flex; align-items: center; gap: 24px; }
.foot__nav { margin-left: auto; display: flex; gap: 24px; }
.foot__nav a { color: var(--gray); --sh: var(--sh-gray); }
.foot__nav a:hover { color: var(--white); --sh: var(--sh-white); }
.foot__social { display: flex; gap: 16px; }

/* ── Сцена: фон страницы из макетов (ui/bg/bg_*.jpg) ─────── */
.scene { position: relative; background: var(--ink) center top / cover no-repeat; }
.scene--home { background-image: linear-gradient(rgba(6, 10, 12, 0) 72%, var(--ink)), url(/ui/bg/bg_home.jpg); }
.scene--login, .scene--register { flex: 1 0 auto; background-image: url(/ui/bg/bg_login.jpg); background-position: center bottom; }
.scene--register { background-image: url(/ui/bg/bg_register.jpg); }
.pg--login .foot { margin-top: 0; }
/* Остальные страницы: фон сверху, к низу уходит в чернила */
.scene--servers, .scene--download, .scene--rules, .scene--banlist, .scene--contacts, .scene--support,
.scene--shop, .scene--profile, .scene--wheel { background-size: max(100%, 1920px) auto; }
.scene--servers { background-image: linear-gradient(rgba(6, 10, 12, 0) 50%, var(--ink) 92%), url(/ui/bg/bg_servers.jpg); }
.scene--download { background-image: linear-gradient(rgba(6, 10, 12, 0) 50%, var(--ink) 92%), url(/ui/bg/bg_download.jpg); }
.scene--rules { background-image: linear-gradient(rgba(6, 10, 12, 0) 40%, var(--ink) 80%), url(/ui/bg/bg_rules.jpg); }
.scene--banlist { background-image: linear-gradient(rgba(6, 10, 12, 0) 50%, var(--ink) 92%), url(/ui/bg/bg_banlist.jpg); }
.scene--contacts { background-image: linear-gradient(rgba(6, 10, 12, 0) 50%, var(--ink) 92%), url(/ui/bg/bg_contacts.jpg); }
.scene--support { background-image: linear-gradient(rgba(6, 10, 12, 0) 50%, var(--ink) 92%), url(/ui/bg/bg_support.jpg); }
.scene--shop { background-image: linear-gradient(rgba(6, 10, 12, 0) 40%, var(--ink) 80%), url(/ui/bg/bg_shop.jpg); }
.scene--profile { background-image: linear-gradient(rgba(6, 10, 12, 0) 40%, var(--ink) 80%), url(/ui/bg/bg_profile.jpg); }
.scene--wheel { background-image: linear-gradient(rgba(6, 10, 12, 0) 50%, var(--ink) 92%), url(/ui/bg/bg_wheel.jpg); }

/* Заголовок обычной страницы */
.page-head { padding: 48px 0 32px; }
.page-title { font-size: 48px; line-height: 48px; text-transform: uppercase; hyphens: auto; overflow-wrap: break-word; }
.page-lead { margin-top: 16px; max-width: 640px; }
.scene__center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 72px 0; }

/* ── Главная ─────────────────────────────────────────────── */
.hero { padding: 112px 0 176px; }
.hero__title { display: flex; flex-direction: column; gap: 16px; }
.hero__name { font-size: 96px; line-height: 96px; }
.hero__sub { font-size: 48px; line-height: 48px; letter-spacing: 18px; }
.hero__lead { margin-top: 32px; max-width: 640px; font-size: 32px; line-height: 40px; }

.steps { display: grid; grid-template-columns: 1fr 18px 1fr 18px 1fr; gap: 16px; align-items: stretch; }
.steps__arrow { align-self: center; width: 18px; height: 14px; background: url(/ui/arrow.png) 0 0 / 18px 14px no-repeat; }
.step { display: flex; gap: 20px; padding: 28px 28px 28px 40px; min-height: 176px; }
.step__num { flex: 0 0 56px; height: 56px; display: grid; place-items: center; font-size: 32px; line-height: 32px; padding: 2px 0 0 2px; background: url(/ui/diamond.png) 0 0 / 56px 56px no-repeat; }
.step__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.step__title { font-size: 32px; line-height: 36px; }
.step__btn { margin-top: auto; }

.block { margin-top: 64px; }
.block__title { font-size: 32px; line-height: 32px; margin-bottom: 16px; }
.block > .line { margin-bottom: 24px; }

.srv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.srv { display: flex; flex-direction: column; padding: 12px 12px 24px 16px; min-height: 336px; }
.srv__art { position: relative; height: 150px; overflow: hidden; background: var(--field); }
.srv__art img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.card--off .srv__art img { filter: grayscale(0.7) brightness(0.7); }
.srv__name { margin: 16px 4px 0; font-size: 32px; line-height: 36px; overflow-wrap: break-word; }
.srv__desc { margin: 4px 4px 0; }
.srv__online { margin: auto 4px 0; padding-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; }
.srv__online > .t-dim { text-transform: uppercase; }
.srv__count { font-weight: 400; font-size: 32px; line-height: 32px; }
.meter { display: block; height: 12px; margin: 12px 4px 0; background: var(--field); border: 2px solid var(--ink); }
.meter span { display: block; height: 100%; background: var(--green); }
.card--off .meter span { background: var(--dim); }
.tag { position: absolute; left: 8px; top: 8px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: rgba(6, 10, 12, 0.85); border: 2px solid #2c5a32; text-transform: uppercase; color: var(--green); --sh: var(--sh-green); }
.tag i { width: 8px; height: 8px; background: currentColor; box-shadow: 2px 2px 0 var(--ink); }
.tag--off { border-color: #5a2a26; color: var(--red); --sh: var(--sh-red); }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post { display: flex; flex-direction: column; padding: 12px 12px 24px; }
.post__img { height: 170px; overflow: hidden; background: var(--field); }
.post__img img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.post__date { margin: 16px 8px 0; }
.post__title { margin: 4px 8px 0; font-size: 32px; line-height: 36px; }

/* ── Формы ───────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; }
.field { display: block; margin-bottom: 16px; }
.field__label { display: block; margin-bottom: 8px; color: var(--gray); --sh: var(--sh-gray); }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--field); border: 2px solid var(--field-line); border-radius: 0;
  box-shadow: inset 0 2px 0 #04070a; outline: none;
  color: var(--white); --sh: var(--sh-white); caret-color: var(--gold);
}
.input::placeholder { color: var(--dim); opacity: 1; text-shadow: none; }
.input:focus { border-color: var(--gold); }
.form__error { margin-bottom: 16px; }
.form__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 24px; }
.check { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; }
.check__box { flex: 0 0 18px; height: 18px; border: 2px solid var(--field-line); background: var(--field) center / 14px 12px no-repeat; }
.check input:checked + .check__box { background-color: var(--gold-lo); border-color: var(--gold); background-image: url(/ui/ico_check.png); }
.check input:focus-visible + .check__box { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Вход / регистрация ──────────────────────────────────── */
.auth { width: 980px; max-width: 100%; display: grid; grid-template-columns: 400px 1fr; min-height: 560px; }
.auth__side { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 32px 32px 32px 36px; border-right: 2px solid var(--field-line); margin: 12px 0; }
.auth__crest { width: 128px; height: 128px; }
.auth__side-title { font-size: 32px; line-height: 36px; margin-bottom: 8px; }
.auth__main { padding: 44px 44px 36px; }
.auth__title { font-size: 48px; line-height: 48px; text-transform: uppercase; }
.auth__lead { margin: 16px 0 28px; }
.auth__line { margin: 24px 0 20px; }
.auth__hint { margin: -12px 0 24px; }
/* одиночная панель без боковины: восстановление, сброс пароля, письма */
.auth--solo { width: 600px; grid-template-columns: 1fr; min-height: 0; }
.auth--solo .auth__title { overflow-wrap: anywhere; }
.form--stack { gap: 12px; }
.facts { margin: 20px 0 0; padding: 12px 16px; background: var(--field); border: 2px solid var(--field-line); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
/* документы (оферта, политика): разделы как в правилах, без оглавления */
.doc { display: flex; flex-direction: column; gap: 20px; }
.form__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
/* Вкладки (Почта / Telegram и т.п.): выбранная - коричневая кнопка */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.tab { height: 40px; padding: 0 16px; border: 0 solid transparent; border-image: url(/ui/btn_gray.png) 32 24 fill / 32px 24px / 8px; background: none; cursor: pointer; color: var(--gray); --sh: var(--sh-gray); }
.tab:hover { border-image-source: url(/ui/btn_gray_h.png); color: var(--white); --sh: var(--sh-white); }
.tab.active, .tab.is-on { border-image-source: url(/ui/btn_brown.png); color: var(--cream); --sh: var(--sh-cream); }
@container page (width < 640px) {
  .form__cols { grid-template-columns: 1fr; }
}

/* ── Серверы ─────────────────────────────────────────────── */
.world-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.world { display: grid; grid-template-columns: 252px 1fr; min-height: 260px; padding: 12px 12px 12px 16px; }
.world__art { overflow: hidden; background: var(--field); }
.world__art img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.card--off .world__art img { filter: grayscale(0.7) brightness(0.7); }
.world__body { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 12px 12px 20px; min-width: 0; }
.world__name { margin: 12px 0 8px; font-size: 32px; line-height: 36px; }
.world__body .srv__online { align-self: stretch; margin: auto 0 0; }
.world__body .meter { align-self: stretch; margin: 12px 0 0; }
.tag--static { position: static; }
.empty { max-width: 720px; padding: 40px; }
.empty__title { font-size: 32px; line-height: 36px; margin-bottom: 12px; }
.empty__act { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
@container page (width < 1200px) {
  .world-grid { grid-template-columns: 1fr; }
}
@container page (width < 640px) {
  .world { grid-template-columns: 1fr; }
  .world__art { height: 160px; }
  .world__body { padding: 16px 4px 12px; }
}

/* ── Скачать ─────────────────────────────────────────────── */
.dl { display: grid; grid-template-columns: 1fr 560px; gap: 40px; align-items: start; padding: 48px 0 40px; }
.dl__side { display: flex; flex-direction: column; gap: 20px; }
.stats { display: grid; grid-template-columns: auto auto auto; gap: 12px; margin: 0; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-height: 80px; }
.stat dt, .stat > span:first-child { text-transform: uppercase; }
.stat dd { margin: 0; font-size: 32px; line-height: 32px; white-space: nowrap; }
.note { display: flex; gap: 16px; align-items: flex-start; padding: 20px 24px; }
.note__mark { flex: 0 0 32px; height: 32px; display: grid; place-items: center; font-size: 32px; line-height: 32px; border: 2px solid var(--gold-lo); }
.shot { display: flex; justify-content: center; padding-bottom: 8px; }
.shot__img { width: 1120px; max-width: 100%; height: auto; }
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.howto__item { padding: 28px 28px 32px 32px; }
.howto__item .step__num { margin-bottom: 20px; width: 56px; }
.howto__title { font-size: 32px; line-height: 36px; margin-bottom: 8px; font-weight: 400; }
@container page (width < 1200px) {
  .dl { grid-template-columns: 1fr; }
  .howto { grid-template-columns: 1fr; }
}
@container page (width < 640px) {
  .stats { grid-template-columns: 1fr; }
  .stat dd { font-size: 16px; line-height: 24px; }
  .howto__title { font-size: 16px; line-height: 24px; }
  .shot__img { image-rendering: auto; }
}

/* ── Общие мелочи страниц ────────────────────────────────── */
.t-cyan { color: var(--cyan); --sh: var(--sh-cyan); }
.ico--coin { width: 20px; height: 14px; vertical-align: -1px; background-image: url(/ui/ico_coin.png); }
/* голова скина: холст 8x8, пиксель лица = 4px (в шапке и таблицах) или 10px (контакты) */
.head { display: block; flex: 0 0 auto; width: 32px; height: 32px; image-rendering: pixelated; background: var(--field); border: 2px solid var(--ink); outline: 2px solid var(--gold-lo); outline-offset: 0; }
.head--big { width: 80px; height: 80px; }
.chip { display: inline-block; padding: 2px 8px; border: 2px solid var(--field-line); background: rgba(6, 10, 12, 0.6); white-space: nowrap; color: var(--gray); --sh: var(--sh-gray); }
.chip--gold { border-color: var(--gold-lo); color: var(--gold); --sh: var(--sh-gold); }
.chip--red { border-color: #7a3430; color: var(--red); --sh: var(--sh-red); }
.chip--green { border-color: #2c5a32; color: var(--green); --sh: var(--sh-green); }
.box-title { font-size: 32px; line-height: 36px; margin-bottom: 20px; }
.input--area { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 24px; }

/* Плашка игрока в шапке */
.me { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px 0 10px; border: 0 solid transparent; border-image: url(/ui/btn_gray.png) 32 24 fill / 32px 24px / 8px; }
.me:hover, .me.is-on { border-image-source: url(/ui/btn_gray_h.png); }
.me .head { width: 28px; height: 28px; border-width: 2px; outline: 0; }
.me__text { display: flex; flex-direction: column; line-height: 18px; }
.me__text b { font-weight: 400; max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container page (width < 640px) {
  .me__text { display: none; }
  .me { padding: 0 10px; }
}

/* ── Правила ─────────────────────────────────────────────── */
.rules { display: grid; grid-template-columns: 288px 1fr; gap: 28px; align-items: start; }
.toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px; padding: 24px 20px; }
.toc__title { margin: 0 0 12px 8px; text-transform: uppercase; }
.toc__a { display: flex; gap: 12px; padding: 10px 12px; border: 0 solid transparent; color: var(--gray); --sh: var(--sh-gray); }
.toc__a:hover { color: var(--white); --sh: var(--sh-white); }
.toc__a.is-on { border-image: url(/ui/btn_brown.png) 32 24 fill / 32px 24px / 0; color: var(--cream); --sh: var(--sh-cream); }
.toc__a.is-on b { color: var(--cream); --sh: var(--sh-cream); }
.toc__a b, .rule-sec__title b { font-weight: 400; }
.rules__list { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rule-sec { padding: 28px 32px 16px; scroll-margin-top: 24px; }
.rule-sec__title { display: flex; align-items: baseline; gap: 16px; font-size: 32px; line-height: 36px; padding-bottom: 16px; border-bottom: 2px solid var(--field-line); }
.rule-sec__title b { font-size: 16px; }
.rule { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 8px; padding: 18px 0; border-bottom: 2px solid #1a252c; }
.rule:last-child { border-bottom: 0; }
.rule__body { overflow-wrap: anywhere; }
.rule__pun { display: inline-block; margin-top: 12px; padding: 4px 10px; border: 2px solid #7a3430; background: rgba(57, 22, 20, 0.35); }
.rule-sec__note { margin: 8px 0 12px; padding: 16px 0 0; border-top: 2px solid var(--field-line); }
@container page (width < 1200px) {
  .rules { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@container page (width < 640px) {
  .rule-sec { padding: 24px 20px 12px; }
  .rule-sec__title { font-size: 16px; line-height: 24px; }
  .rule { grid-template-columns: 44px minmax(0, 1fr); }
}

/* ── Банлист ─────────────────────────────────────────────── */
.search { display: block; margin-bottom: 16px; }
.search .input { background: rgba(9, 14, 18, 0.92); }
.table-card { padding: 8px 12px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 18px 12px 14px; text-align: left; font-weight: 400; text-transform: uppercase; white-space: nowrap; border-bottom: 2px solid var(--gold-lo); color: var(--gold); --sh: var(--sh-gold); }
.table td { padding: 12px; border-bottom: 2px solid #1a252c; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table__empty td { padding: 40px 12px; text-align: center; line-height: 32px; }
.who { display: flex; align-items: center; gap: 12px; }
@container page (width < 900px) {
  .table, .table tbody { display: block; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 0; border-bottom: 2px solid #1a252c; }
  .table td { min-width: 0; padding: 0 4px; border: 0; overflow-wrap: anywhere; }
  .table tr:last-child { border-bottom: 0; }
}

/* ── Контакты ────────────────────────────────────────────── */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.mate { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px 28px 24px; }
.mate__cat { margin-top: 16px; text-transform: uppercase; }
.mate__name { margin-top: 4px; font-size: 16px; line-height: 24px; max-width: 100%; overflow-wrap: anywhere; color: var(--white); }
.mate__role { margin: 8px 0 20px; }
.mate__btn { margin-top: auto; }
.community { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 24px; }
.club { display: flex; align-items: center; gap: 20px; padding: 20px 24px 20px 36px; }
.club__text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.club__text b { font-weight: 400; font-size: 32px; line-height: 36px; }
.club:hover { border-image-source: url(/ui/card_gold.png); }
@container page (width < 900px) {
  .community { grid-template-columns: minmax(0, 1fr); }
}
@container page (width < 640px) {
  .club__text b { font-size: 16px; line-height: 24px; }
}

/* ── Поддержка ───────────────────────────────────────────── */
.desk { display: grid; grid-template-columns: 480px 1fr; gap: 24px; align-items: start; }
.desk__new { padding: 32px; }
.desk__list { padding: 32px; min-height: 200px; }
.ticket { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; width: 100%; padding: 16px 0; text-align: left; background: none; border: 0; border-bottom: 2px solid #1a252c; cursor: pointer; }
.ticket:last-child { border-bottom: 0; }
.ticket:hover .ticket__subj { color: var(--gold); --sh: var(--sh-gold); }
.ticket__meta { grid-column: 1 / -1; }
.ticket .chip { align-self: start; }
.thread { padding: 32px; }
.thread__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 8px; }
.thread__head .box-title { margin: 0; overflow-wrap: anywhere; }
.msg { margin: 16px 0; padding: 16px 20px; background: var(--field); border: 2px solid var(--field-line); }
.msg--staff { border-color: #1e5a66; }
.msg__body { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread__act { display: flex; flex-wrap: wrap; gap: 16px; }
@container page (width < 1100px) {
  .desk { grid-template-columns: 1fr; }
}
@container page (width < 640px) {
  .desk__new, .desk__list, .thread { padding: 24px 20px; }
}

/* ── Сообщения форм, окна поверх ─────────────────────────── */
.form-error { margin: 0 0 16px; color: var(--red); --sh: var(--sh-red); }
.form-success { margin: 0 0 16px; color: var(--green); --sh: var(--sh-green); }
.form-error:empty, .form-success:empty { display: none; }
.form-hint { margin: -4px 0 16px; }
.wbtn--x { border-image-source: url(/ui/wbtn_red.png); }
.wbtn--x:hover { border-image-source: url(/ui/wbtn_red_h.png); }
.ico--close { width: 14px; height: 10px; background-image: url(/ui/ico_close.png); }
/* <dialog>: золотая панель клиента, подложка затемняет страницу */
dialog.shop-modal, dialog.modal {
  width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  padding: 28px 32px; color: var(--white);
  background: none; border: 0 solid transparent; border-image: url(/ui/panel_solid.png) 32 fill / 32px;
}
dialog.shop-modal::backdrop, dialog.modal::backdrop { background: rgba(6, 10, 12, 0.72); }
.shop-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; font-size: 32px; line-height: 36px; color: var(--gold); --sh: var(--sh-gold); }
.shop-modal__image { margin-bottom: 16px; background: var(--field); border: 2px solid var(--field-line); }
.shop-modal__image img { width: 100%; max-height: 260px; object-fit: contain; image-rendering: auto; }
.shop-modal__description { margin-bottom: 16px; white-space: pre-wrap; }
.shop-modal__perks { margin-bottom: 16px; padding: 12px 14px; background: var(--field); border: 2px solid var(--field-line); }
.shop-modal__perks-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.shop-modal__perks-list { max-height: 180px; overflow: auto; }
.shop-perk { padding: 6px 0; border-top: 2px solid #1a252c; }
.shop-perk:first-child { border-top: 0; }
.shop-perk__command { font: inherit; color: var(--cyan); --sh: var(--sh-cyan); }
.shop-perk__description { display: block; color: var(--gray); --sh: var(--sh-gray); }
.shop-modal__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 4px 0; border-bottom: 2px solid #1a252c; }
.shop-modal__row strong { font-weight: 400; }
.shop-modal__recipient-input { width: 240px; }
.shop-modal__qty { display: flex; gap: 8px; align-items: center; }
.shop-modal__qty .input { width: 80px; text-align: center; }
.shop-modal__qty-btn { width: 48px; padding: 0; }
.shop-modal__actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 20px; }
.shop-modal #shop-modal-error { margin: 16px 0 0; }
.shop-thanks-modal { text-align: center; }
.shop-thanks__emoji { margin: 0 auto 16px; width: 64px; height: 64px; image-rendering: pixelated; }
.shop-thanks__title { font-size: 32px; line-height: 36px; margin-bottom: 12px; }
.shop-thanks__text { margin-bottom: 24px; }
.shop-emoji-particle { position: fixed; z-index: 100; width: 32px; height: 32px; margin: -16px 0 0 -16px; pointer-events: none; image-rendering: pixelated; animation: emoji-burst 0.9s ease-out forwards; }
@keyframes emoji-burst {
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ── Магазин ─────────────────────────────────────────────── */
.page-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.wallet { display: flex; align-items: stretch; gap: 16px; }
.wallet .btn { height: auto; align-self: stretch; }
.stat b { font-weight: 400; font-size: 32px; line-height: 32px; white-space: nowrap; }
.tabs--bar { display: inline-flex; flex-wrap: wrap; padding: 10px; margin-bottom: 24px; background: rgba(9, 14, 18, 0.9); border: 2px solid var(--field-line); }
.tabs--bar .tab { height: 48px; padding: 0 20px; }
.shop-panel { display: none; }
.shop-panel.active { display: block; }
.shop-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.shop-tile { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 14px 20px 18px; background: none; cursor: pointer; text-align: center; }
.shop-tile:hover, .shop-tile:focus-visible { border-image-source: url(/ui/card_plain_h.png); outline: none; }
.shop-tile:hover .shop-tile__buy { border-image-source: url(/ui/btn_brown_h.png); }
.shop-tile__image { aspect-ratio: 1 / 1; overflow: hidden; background: var(--field); }
.shop-tile__image img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.shop-tile__name { font-size: 32px; line-height: 36px; overflow-wrap: anywhere; }
.shop-tile__buy { margin-top: auto; }
.shop-tile__buy b { font-weight: 400; }
.shop-hover-tooltip { position: fixed; z-index: 90; max-width: 360px; padding: 10px; transform: translate(-50%, -100%); pointer-events: none; visibility: hidden; border: 0 solid transparent; border-image: url(/ui/panel_solid.png) 32 fill / 32px; }
.shop-hover-tooltip.is-visible { visibility: visible; }
.shop-hover-tooltip img { max-width: 340px; max-height: 420px; image-rendering: auto; }
.shop-hover-tooltip__empty { display: block; padding: 10px 14px; color: var(--gray); --sh: var(--sh-gray); }
.shop-history { margin-top: 32px; padding: 28px 32px; }
.shop-history__toolbar { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.shop-history__toolbar > .input { flex: 1 1 260px; }
.shop-history__range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-history__range .input { width: 180px; }
.shop-history__status { margin-bottom: 12px; color: var(--green); --sh: var(--sh-green); }
.shop-history__status.is-error { color: var(--red); --sh: var(--sh-red); }
.shop-history__row { display: grid; grid-template-columns: 1.4fr 1.4fr 0.6fr 1fr 96px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 2px solid #1a252c; }
.shop-history__del { justify-self: end; width: 32px; height: 32px; padding: 0; font: inherit; font-size: 24px; line-height: 28px; cursor: pointer; background: none; border: 2px solid var(--field-line); color: var(--gray); --sh: var(--sh-gray); }
.shop-history__del:hover, .shop-history__del:focus-visible { border-color: #7a3430; color: var(--red); --sh: var(--sh-red); outline: none; }
.shop-history__del:disabled { opacity: 0.5; cursor: default; }
.shop-history__pending { justify-self: end; font-size: 16px; color: var(--gold); --sh: var(--sh-gold); white-space: nowrap; }
@container page (width < 1200px) {
  .shop-tiles { grid-template-columns: repeat(3, 1fr); }
  .page-head--split { flex-direction: column; align-items: flex-start; }
}
@container page (width < 900px) {
  .shop-tiles { grid-template-columns: repeat(2, 1fr); }
  .shop-history__row { grid-template-columns: 1fr 1fr; }
  .shop-history__del, .shop-history__pending { grid-column: 2; }
}
@container page (width < 640px) {
  .shop-tile__name { font-size: 16px; line-height: 24px; }
  .shop-tile__buy { padding: 0 8px; }
  dialog.shop-modal, dialog.modal { padding: 24px 20px; }
  .shop-modal__recipient-input { width: 160px; }
}

/* ── Личный кабинет ──────────────────────────────────────── */
.cab { padding-top: 40px; }
.cab__head { display: flex; align-items: center; gap: 24px; padding: 28px 32px; margin-bottom: 28px; }
.head--hero { width: 80px; height: 80px; }
.cab__name { font-size: 48px; line-height: 48px; margin-bottom: 8px; overflow-wrap: anywhere; }
.cab__act { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.cab__grid { display: grid; grid-template-columns: 380px 1fr 1fr; gap: 20px; align-items: start; }
.cab__col { display: flex; flex-direction: column; gap: 20px; }
.box { padding: 28px 28px 28px 32px; }
.box-sub { font-size: 16px; line-height: 24px; margin-bottom: 12px; color: var(--gold); --sh: var(--sh-gold); }
.box__line { margin: 24px 0; }
.box__text { margin-bottom: 16px; }
.skin3d { display: flex; justify-content: center; background: radial-gradient(circle at 50% 45%, #1e4650, var(--field) 70%); border: 2px solid var(--gold-lo); }
.skin3d canvas { display: block; width: 280px; height: 360px; max-width: 100%; }
.skin3d__hint { margin: 8px 0 16px; text-align: center; }
.upload { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 12px; background: var(--field); border: 2px solid var(--field-line); }
.upload__prev { flex: 0 0 64px; height: 64px; display: grid; place-items: center; overflow: hidden; background: var(--ink); border: 2px solid var(--gold-lo); color: var(--gold); --sh: var(--sh-gold); }
.upload__prev img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.upload__text { display: flex; flex-direction: column; min-width: 0; }
.upload__text b { font-weight: 400; }
.upload__btn { position: relative; margin-left: auto; height: 40px; padding: 0 16px; cursor: pointer; }
.upload__btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload__btn:focus-within { outline: 2px solid var(--gold); outline-offset: 10px; }
@container page (width < 1272px) {
  .cab__grid { grid-template-columns: 1fr 1fr; }
  .cab__grid > :first-child { grid-row: span 2; }
}
@container page (width < 900px) {
  .cab__grid { grid-template-columns: 1fr; }
  .cab__grid > :first-child { grid-row: auto; }
  .cab__head { flex-wrap: wrap; }
  .cab__act { margin-left: 0; justify-content: flex-start; }
}
@container page (width < 640px) {
  .cab__name { font-size: 32px; line-height: 36px; }
  .box { padding: 24px 20px; }
}

/* ── Колесо удачи ────────────────────────────────────────── */
/* Буфер колеса 128 пикселей, пиксель текстуры = 2.5 буфера: сцена 512 -> пиксель текстуры ровно 10px */
.wheel { display: grid; grid-template-columns: 560px 1fr; gap: 24px; align-items: start; }
.wheel__stage { display: grid; place-items: center; padding: 24px; }
.wheel-stage { position: relative; width: 512px; height: 512px; }
.wheel-stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.wheel-pointer { position: absolute; z-index: 2; top: -8px; left: 50%; width: 36px; height: 24px; margin-left: -18px; background: url(/ui/wheel_pointer.png) 0 0 / 36px 24px no-repeat; }
/* ступица - спрайт 8x18 текстуры (глаз - нижние 8 строк), центр глаза на 14-й строке над центром диска */
.wheel-hub { position: absolute; z-index: 2; top: 22.656%; left: 42.1875%; width: 15.625%; height: 35.156%; background: url(/images/wheel/eye_stand.png) center / 100% 100% no-repeat; image-rendering: pixelated; pointer-events: none; }
.wheel__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.wheel-status { margin-bottom: 8px; }
.wheel-playtime { margin-bottom: 20px; }
.wheel-result { margin-top: 16px; }
.wheel-result:empty { display: none; }
.wheel-bonuses ul, .wheel-prizes ul { margin: 0; padding: 0; list-style: none; }
.wheel-bonuses li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 2px solid #1a252c; }
.wheel-bonuses li strong { font-weight: 400; }
.wheel-bonuses li small { color: var(--gold); --sh: var(--sh-gold); white-space: nowrap; }
.wheel-bonuses > small { display: block; margin-top: 12px; }
.wheel-prizes li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px solid #1a252c; }
.wheel-prizes li:last-child, .wheel-bonuses li:last-child { border-bottom: 0; }
.wheel-swatch { flex: 0 0 auto; width: 16px; height: 16px; box-shadow: 2px 2px 0 var(--ink); }
@container page (width < 1200px) {
  .wheel { grid-template-columns: 1fr; }
}
@container page (width < 640px) {
  .wheel__stage { padding: 16px 8px; }
  .wheel-stage { width: 256px; height: 256px; }
}

/* ── Админка: разметку строят admin.ejs/admin.js, здесь их классы в стиле клиента ── */
.admin { padding-top: 48px; }
.admin__title { margin-bottom: 24px; }
.admin__denied { padding: 32px 40px; }
.admin h2 { font-size: 32px; line-height: 36px; margin: 0 0 16px; color: var(--gold); --sh: var(--sh-gold); }
.admin h3 { font-size: 16px; line-height: 24px; margin: 0 0 8px; color: var(--gold); --sh: var(--sh-gold); }
.admin p { margin: 0 0 12px; }
.admin code { font: inherit; color: var(--cyan); --sh: var(--sh-cyan); }
.admin .meta { margin: 4px 0; color: var(--gray); --sh: var(--sh-gray); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin-bottom: 20px; background: rgba(9, 14, 18, 0.9); border: 2px solid var(--field-line); }
.admin-tab { height: 40px; padding: 0 16px; background: none; cursor: pointer; border: 0 solid transparent; color: var(--gray); --sh: var(--sh-gray); }
.admin-tab:hover { border-image: url(/ui/btn_gray_h.png) 32 24 fill / 32px 24px / 8px; color: var(--white); --sh: var(--sh-white); }
.admin-tab.active { border-image: url(/ui/btn_brown.png) 32 24 fill / 32px 24px / 8px; color: var(--cream); --sh: var(--sh-cream); }
.admin-panel { display: none; padding: 32px 36px; border: 0 solid transparent; border-image: url(/ui/panel_solid.png) 32 fill / 32px; }
.admin-panel.active { display: block; }
.admin-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; align-items: end; margin-bottom: 24px; }
.admin-form > p, .admin-form > .meta, .admin-form > .form-error, .admin-form > .form-success, .admin-form .field:has(textarea) { grid-column: 1 / -1; }
.admin-form > .btn { justify-self: start; margin-bottom: 16px; }
.admin .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; min-width: 0; }
.admin .field label { color: var(--gray); --sh: var(--sh-gray); }
.admin input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="hidden"]), .admin select, .admin textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 0;
  font: inherit; line-height: 24px; color: var(--white); --sh: var(--sh-white);
  background: var(--field); border: 2px solid var(--field-line); box-shadow: inset 0 2px 0 #04070a; outline: none; caret-color: var(--gold);
}
.admin textarea { resize: vertical; }
.admin input:focus, .admin select:focus, .admin textarea:focus { border-color: var(--gold); }
.admin input::placeholder, .admin textarea::placeholder { color: var(--dim); text-shadow: none; }
.admin select option { background: var(--field); color: var(--white); }
.admin input[type="color"] { width: 64px; height: 48px; padding: 4px; background: var(--field); border: 2px solid var(--field-line); }
.admin input[type="file"] { font: inherit; color: var(--gray); --sh: var(--sh-gray); }
.admin input[type="file"]::file-selector-button { height: 40px; margin-right: 12px; padding: 0 16px; font: inherit; cursor: pointer; color: var(--white); border: 0 solid transparent; border-image: url(/ui/btn_gray.png) 32 24 fill / 32px 24px / 0; background: none; }
/* в админке .btn - главное действие (коричневая), .btn.secondary - второстепенное (серая) */
.admin .btn { height: 40px; padding: 0 16px; border-image-source: url(/ui/btn_brown.png); color: var(--cream); --sh: var(--sh-cream); }
.admin .btn:hover { border-image-source: url(/ui/btn_brown_h.png); }
.admin .btn.secondary { border-image-source: url(/ui/btn_gray.png); color: var(--gray); --sh: var(--sh-gray); }
.admin .btn.secondary:hover { border-image-source: url(/ui/btn_gray_h.png); color: var(--white); --sh: var(--sh-white); }
.admin .card { margin-bottom: 12px; padding: 20px 24px 20px 28px; }
.admin .card p { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin .card .btn { margin: 8px 8px 0 0; }
.admin .card--staff { border-image-source: url(/ui/card_on.png); }
.empty-state { color: var(--gray); --sh: var(--sh-gray); }
.status-answered { color: var(--green); --sh: var(--sh-green); }
.status-closed { color: var(--red); --sh: var(--sh-red); }
.ticket-delete-btn { float: right; }
.balance-player-row { display: flex; justify-content: space-between; gap: 16px; cursor: pointer; }
.balance-player-row:hover { border-image-source: url(/ui/card_plain_h.png); }
.shop-group { margin-bottom: 16px; }
.shop-group > summary { padding: 12px 0; cursor: pointer; border-bottom: 2px solid var(--gold-lo); color: var(--gold); --sh: var(--sh-gold); }
.shop-item-row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 2px solid #1a252c; }
.shop-item-row__image { flex: 0 0 64px; width: 64px; height: 64px; object-fit: cover; background: var(--field); border: 2px solid var(--field-line); }
.shop-item-row__main { flex: 1; min-width: 0; }
.shop-item-row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.shop-item-row__title strong { font-weight: 400; }
.shop-item-row__price { color: var(--gold); --sh: var(--sh-gold); }
.shop-item-row__badge { padding: 0 8px; border: 2px solid var(--field-line); color: var(--gray); --sh: var(--sh-gray); }
.shop-item-row__badge--off { border-color: #7a3430; color: var(--red); --sh: var(--sh-red); }
.shop-item-row__command { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.shop-item-row__command--missing { color: var(--red); --sh: var(--sh-red); }
.shop-item-row__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.shop-item-row__actions .btn { margin: 0; }
.donation-perk-row__description { color: var(--gray); --sh: var(--sh-gray); }
.wheel-admin-swatch { display: inline-block; width: 16px; height: 16px; vertical-align: -2px; box-shadow: 2px 2px 0 var(--ink); }
@container page (width < 640px) {
  .admin-panel { padding: 24px 20px; }
  .admin h2 { font-size: 16px; line-height: 24px; }
}

/* Плашка «подтверди почту» (verify-reminder.js) - вверху main у вошедших без подтверждённой почты */
.verify-reminder { width: min(var(--wrap), round(down, 100% - 32px, 4px)); margin: 16px auto 0; border: 0 solid transparent; border-image: url(/ui/card_on.png) 32 fill / 32px; }
.verify-reminder__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 24px 16px 32px; }
.verify-reminder__text { display: flex; flex-direction: column; flex: 1; min-width: 220px; }
.verify-reminder__text strong { font-weight: 400; color: var(--cyan); --sh: var(--sh-cyan); }
.verify-reminder__text span { color: var(--gray); --sh: var(--sh-gray); }
.verify-reminder__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.verify-reminder__email { width: 240px; }
.verify-reminder__status { flex-basis: 100%; margin: 0; color: var(--green); --sh: var(--sh-green); }
.verify-reminder__status.is-error { color: var(--red); --sh: var(--sh-red); }

/* ── Узкие экраны ────────────────────────────────────────── */
@container page (width < 1272px) {
  .nav { gap: 20px; }
  .srv-grid { grid-template-columns: repeat(2, 1fr); }
  /* у админа в шапке на пункт больше и плашка игрока - меню уходит в бургер раньше */
  .is-admin .nav { display: none; }
  .is-admin .burger, .is-admin .mnav { display: block; }
}
@container page (width < 1200px) {
  .nav, .topbar__dl { display: none; }
  .burger, .mnav { display: block; }
  .steps { grid-template-columns: 1fr; }
  .steps__arrow { justify-self: center; transform: rotate(90deg); }
  .news-grid { grid-template-columns: 1fr; }
  .post__img { height: 240px; }
  .auth { grid-template-columns: minmax(0, 1fr); width: 600px; }
  .auth__side { display: none; }
  .foot__in { flex-wrap: wrap; justify-content: center; padding: 24px 0; }
  .foot__nav { margin-left: 0; flex-wrap: wrap; justify-content: center; }
}
@container page (width < 640px) {
  .topbar__in { height: 80px; gap: 16px; }
  .mnav { top: 82px; }
  .brand__crest { width: 64px; height: 64px; }
  .brand__text { display: none; }
  .hero { padding: 48px 0 64px; }
  .hero__name { font-size: 48px; line-height: 48px; }
  .hero__sub { font-size: 32px; line-height: 32px; letter-spacing: 12px; }
  .hero__lead { font-size: 16px; line-height: 24px; margin-top: 24px; }
  .step { padding: 24px 20px 24px 32px; min-height: 0; }
  .step__title { font-size: 16px; line-height: 24px; }
  .srv-grid { grid-template-columns: 1fr; }
  .post__img { height: 160px; }
  .post__title { font-size: 16px; line-height: 24px; }
  .auth__main { padding: 32px 24px 28px; }
  .auth__title { font-size: 32px; line-height: 36px; }
  .page-title { font-size: 32px; line-height: 36px; hyphens: auto; overflow-wrap: break-word; }
  .form__row { flex-wrap: wrap; }
  .scene__center { padding: 32px 0; }
}

/* ── Телефоны: ничего не шире экрана ─────────────────────── */
/* Колонка 1fr = minmax(auto, 1fr): не сжимается уже самого широкого содержимого
   (кнопка с nowrap, длинная строка) и распирала страницу вбок - магазин уезжал
   до 488px, "Скачать" и кабинет тоже. minmax(0, 1fr) + min-width: 0 у детей
   отдают ширину контейнеру, а длинный текст переносится. */
.dl > *, .cab__grid > *, .cab__col > *, .shop-tiles > *, .wheel > *, .shop-tile > * { min-width: 0; }
@container page (width < 1200px) {
  .dl { grid-template-columns: minmax(0, 1fr); }
  .shop-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container page (width < 900px) {
  .cab__grid { grid-template-columns: minmax(0, 1fr); }
  .shop-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container page (width < 640px) {
  .wallet { flex-wrap: wrap; }
  .wallet > * { flex: 1 1 100%; }
  .wallet .btn { height: 48px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat dd, .stat b { white-space: normal; overflow-wrap: anywhere; }
  /* кнопка во всю ширину может стать двухстрочной - высота по тексту, не 48px */
  .btn--block { white-space: normal; height: auto; min-height: 48px; padding-top: 8px; padding-bottom: 8px; text-align: center; }
  /* Атлас 64x64 резался 32+32 - без середины, и двухстрочная кнопка "рвалась" пополам.
     28+28 оставляет 8px однотонной середины: при высоте 48 вид тот же, выше - тянется середина. */
  .shop-tile { padding: 10px 10px 16px 12px; }
  .upload { flex-wrap: wrap; }
  .upload__btn { margin-left: 0; }
  .page-lead { overflow-wrap: break-word; }
  /* На узкой плитке и кнопке - короткие подписи: двухстрочный текст рвёт фон кнопки из атласа */
  .shop-tile__buy-label { display: none; }
  .dl__btn-long { display: none; }
}
.dl__btn-short { display: none; }
@container page (width < 640px) { .dl__btn-short { display: inline; } }

/* ── Админка на узком экране ─────────────────────────────── */
/* Длинные подписи полей команд распирали ячейку грида формы (пустая дыра на ПК),
   поэтому эти поля - на всю ширину формы. */
.admin-form .field:has(#shop-item-command), .admin-form .field:has(#shop-item-broadcast-command) { grid-column: 1 / -1; }
/* Строка товара: картинка + текст сверху, кнопки отдельной строкой под ними. Раньше
   кнопки забирали ширину, и текст сжимался до одной буквы в строке. */
@container page (width < 900px) {
  .shop-item-row { flex-wrap: wrap; }
  .shop-item-row__main { flex: 1 1 0; }
  .shop-item-row__actions { flex: 1 1 100%; margin-top: 4px; }
}

/* Картинка характеристик товара в окне покупки - на телефоне, где нет наведения */
.shop-modal__info { margin-bottom: 16px; }
.shop-modal__info img { display: block; width: 100%; height: auto; image-rendering: auto; }
