/* Остальные страницы (топы, профиль, вики, блог, помощь, кабинет, карта…). Подключается после style.css.
   Без @layer — правила здесь сильнее общих слоёв ядра. Общие классы (.page-head, .card, .kicker…) — в style.css. */

/* =====================================================================================================
   ТОПЫ: витрина чемпионов → выбранный топ (пьедестал из блоков + лесенка 4–10). Разметку рисует js/pages/stats.js
   ===================================================================================================== */
.tops { padding: 8px 0 clamp(56px, 8vw, 96px); }

/* ---------- витрина чемпионов: плитка на каждый топ, она же переключатель ---------- */
.champs { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 14px; }
.champs > .skeleton { height: 190px; }
.champ {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico t" "who who" "v v";
  align-items: center; gap: 16px 14px; padding: 22px 22px 24px; min-height: 190px; min-width: 0; overflow: hidden;
  font: inherit; text-align: left; color: var(--text); cursor: pointer; border: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 13%, var(--panel)) 0%, var(--panel) 62%);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--pc-sm);
  transition: transform .45s var(--spring), box-shadow .3s, background .3s;
}
/* блик, пробегающий по плитке */
.champ::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 240, 225, .13) 50%, transparent 62%);
  transform: translateX(-120%); transition: transform .8s var(--ease-out);
}
/* полоска выбранного топа */
.champ::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tc);
  box-shadow: 0 0 14px var(--tc); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease-out);
}
.champ:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 45%, transparent), 0 20px 40px -22px color-mix(in srgb, var(--tc) 70%, transparent); }
.champ:hover::before { transform: translateX(120%); }
.champ:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tc); }
.champ[aria-pressed="true"] {
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 26%, var(--panel)) 0%, color-mix(in srgb, var(--tc) 6%, var(--panel)) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 60%, transparent), 0 18px 44px -24px var(--tc);
}
.champ[aria-pressed="true"]::after { transform: scaleX(1); }
.champ-ico {
  grid-area: ico; display: grid; place-items: center; width: 58px; height: 58px;
  background: color-mix(in srgb, var(--tc) 16%, var(--ink-2)); clip-path: var(--pc-xs);
}
.champ-ico > img { width: 38px; height: 38px; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); transition: transform .45s var(--spring); }
.champ:hover .champ-ico > img, .champ[aria-pressed="true"] .champ-ico > img { transform: rotate(-12deg) scale(1.16); }
.champ-t { grid-area: t; font: 700 1.12rem/1.2 var(--f-display); color: var(--text); }
.champ-who { grid-area: who; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 1rem; }
.champ-who > img { flex: none; width: 30px; height: 30px; image-rendering: pixelated; clip-path: var(--pc-xs); background: var(--panel-3); }
.champ-who > b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.champ-who > b::before { content: "👑 "; font-size: .8em; }
.champ-none { color: var(--muted); }
.champ-v { grid-area: v; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.champ-v > b { font: 800 clamp(1.6rem, 2.4vw, 2.1rem)/1 var(--f-display); color: color-mix(in srgb, var(--tc) 72%, #fff); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.champ-v > small { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- выбранный топ ---------- */
.board {
  position: relative; margin-top: 28px; padding: clamp(20px, 3.4vw, 40px) clamp(16px, 3.4vw, 40px) clamp(24px, 3.4vw, 40px);
  scroll-margin-top: calc(var(--nav-h) + 16px); isolation: isolate; overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--tc) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--panel) 0%, var(--ink-2) 100%);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--pc);
}
/* сетка «чанков» на фоне, тает к краям */
.board::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 200, 170, .05) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255, 200, 170, .05) 0 1px, transparent 1px 32px);
  -webkit-mask: radial-gradient(70% 60% at 50% 38%, #000, transparent 75%); mask: radial-gradient(70% 60% at 50% 38%, #000, transparent 75%);
}
.board-head { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); }
.board-head h2 { margin: .18em 0 0; font-size: clamp(1.8rem, 4.2vw, 3.1rem); line-height: 1; letter-spacing: -.03em; }
.board-ico {
  flex: none; display: grid; place-items: center; width: clamp(64px, 8vw, 88px); aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%), color-mix(in srgb, var(--tc) 12%, var(--ink-2));
  clip-path: var(--pc-sm);
}
.board-ico > img { width: 64%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--tc) 70%, transparent)) drop-shadow(0 4px 0 rgba(0, 0, 0, .4)); }

/* пьедестал: 2 · 1 · 3 */
.podium {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(8px, 2vw, 22px);
  max-width: 780px; margin: clamp(40px, 6vw, 64px) auto 0;
}
.pd { --dl: 0s; position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; color: var(--text); text-decoration: none; }
.pd:hover { text-decoration: none; }
.pd-1 { --m1: #FFE592; --m2: #D69A2E; --mc: var(--gold); --h: 176px; --skin: 188px; --dl: .3s; }
.pd-2 { --m1: #F2EEF6; --m2: #958DA3; --mc: #E8E2F0; --h: 128px; --skin: 156px; --dl: .15s; }
.pd-3 { --m1: #F4B98E; --m2: #A35A33; --mc: #F2A877; --h: 96px; --skin: 148px; --dl: 0s; }
.pd-skin-wrap { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: center; height: var(--skin); }
.pd-skin { height: 100%; width: auto; image-rendering: pixelated; filter: drop-shadow(0 16px 16px rgba(0, 0, 0, .55)); transition: transform .45s var(--spring); }
.pd-skin.is-head { height: 58%; clip-path: var(--pc-sm); }
.pd:hover .pd-skin { transform: translateY(-8px) scale(1.04); }
.pd-crown { position: absolute; z-index: 3; top: -30px; left: 50%; width: 46px; height: auto; translate: -50% 0; rotate: -8deg; filter: drop-shadow(0 0 12px rgba(255, 212, 94, .75)); }
.pd-name { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; margin-top: 14px; font-weight: 650; }
.pd-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd:hover .pd-name > span:first-child { color: var(--coral-hot); }
.pd-v {
  position: relative; z-index: 2; margin: 4px 0 12px; font: 800 clamp(1.2rem, 2.6vw, 2rem)/1.1 var(--f-display);
  color: var(--mc); text-shadow: 0 0 22px color-mix(in srgb, var(--mc) 45%, transparent); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.pd-u { position: relative; z-index: 2; margin: -10px 0 12px; color: var(--muted); font-size: .78rem; text-align: center; }
/* постамент из блоков: светлая верхняя грань, швы между блоками, тень снизу */
.pd-block {
  --bs: 32px; position: relative; z-index: 1; display: grid; justify-items: center; align-content: start;
  width: 100%; height: var(--h); padding-top: 16px; transform-origin: 50% 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .34) 0 6px, rgba(255, 255, 255, .1) 6px 10px, transparent 10px),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--bs) - 2px), rgba(0, 0, 0, .2) calc(var(--bs) - 2px) var(--bs)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--bs) - 2px), rgba(0, 0, 0, .12) calc(var(--bs) - 2px) var(--bs)),
    linear-gradient(180deg, var(--m1), var(--m2));
  box-shadow: inset 0 -18px 24px -8px rgba(0, 0, 0, .4), 0 24px 40px -18px rgba(0, 0, 0, .8);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% 100%, 0 100%);
}
.pd-block > b { font: 900 clamp(2rem, 5vw, 3.6rem)/1 var(--f-display); color: rgba(40, 20, 10, .38); text-shadow: 0 2px 0 rgba(255, 255, 255, .28); }
.pd-empty .pd-block { filter: saturate(.2) brightness(.55); }
.pd-empty .pd-name { color: var(--muted); }

/* первое место: луч маяка, вращающиеся лучи, искры */
.pd-beam {
  position: absolute; z-index: 0; left: 50%; bottom: var(--h); width: 70px; height: 150%; translate: -50% 0;
  background: linear-gradient(0deg, color-mix(in srgb, var(--gold) 50%, transparent), transparent 88%);
  filter: blur(8px); pointer-events: none; transform-origin: 50% 100%;
}
.pd-rays {
  position: absolute; z-index: 0; left: 50%; top: calc(var(--skin) * .1); width: 300px; aspect-ratio: 1; translate: -50% -22%;
  background: repeating-conic-gradient(rgba(255, 212, 94, .2) 0 9deg, transparent 9deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); mask: radial-gradient(circle, #000 18%, transparent 66%);
  pointer-events: none;
}
.pd-sparks { position: absolute; z-index: 3; left: 10%; right: 10%; top: 0; bottom: var(--h); pointer-events: none; }
.pd-sparks > i { position: absolute; bottom: 8%; left: var(--x); width: var(--s); height: var(--s); background: var(--gold); box-shadow: 0 0 8px var(--gold); opacity: 0; }

/* лесенка 4–10 */
.ladder { list-style: none; display: grid; gap: 6px; max-width: 880px; margin: clamp(22px, 3vw, 32px) auto 0; padding: 0; }
.ladder a {
  display: grid; grid-template-columns: 34px 32px minmax(0, 1.1fr) minmax(48px, 2fr) minmax(5ch, auto); align-items: center; gap: 14px;
  padding: 10px 16px; color: var(--text); text-decoration: none;
  background: rgba(255, 200, 170, .035); clip-path: var(--pc-xs);
  transition: background .25s, transform .35s var(--spring);
}
.ladder a:hover { background: color-mix(in srgb, var(--tc) 11%, transparent); transform: translateX(6px); }
.ld-n { font: 700 .95rem var(--f-mono); color: var(--muted); text-align: center; }
.ladder img { width: 32px; height: 32px; image-rendering: pixelated; clip-path: var(--pc-xs); background: var(--panel-3); }
.ld-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.ld-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ladder a:hover .ld-name > span:first-child { color: var(--coral-hot); }
.ld-bar {
  position: relative; height: 8px; background: rgba(255, 200, 170, .07);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 2px), transparent calc(5% - 2px) 5%);
}
.ld-bar > i {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f) * 100%); transform-origin: 0 50%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 45%, transparent), var(--tc));
}
.ld-v { font: 700 .98rem var(--f-mono); color: color-mix(in srgb, var(--tc) 70%, #fff); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.board-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 0 24px; color: var(--muted); text-align: center; }
.board-empty > img { image-rendering: pixelated; opacity: .7; }

/* ---------- движение ---------- */
@media (prefers-reduced-motion: no-preference) {
  .champ { animation: st-rise .7s var(--ease-out) both; animation-delay: calc(var(--i) * 55ms); }
  .champ-ico > img { animation: st-bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.45s); }
  .board { animation: st-in .6s var(--ease-out) both; }
  .board-ico > img { animation: st-bob 3.6s ease-in-out infinite; }
  .pd-crown { animation: st-crown 2.6s ease-in-out infinite; }

  /* до появления на экране — постаменты не построены, игроков нет */
  .board:not(.play) .pd-block { transform: scaleY(0); }
  .board:not(.play) :is(.pd-skin-wrap, .pd-name, .pd-v, .pd-u, .pd-beam, .pd-rays, .pd-sparks, .ladder li) { opacity: 0; }
  .board:not(.play) .ld-bar > i { transform: scaleX(0); }

  /* постамент растёт рывками — блок за блоком */
  .board.play .pd-block { animation: st-grow .8s steps(5, end) both; animation-delay: var(--dl); }
  .board.play .pd-skin-wrap { animation: st-drop .9s var(--spring) both; animation-delay: calc(var(--dl) + .75s); }
  .board.play :is(.pd-name, .pd-v, .pd-u) { animation: st-rise .6s var(--ease-out) both; animation-delay: calc(var(--dl) + .95s); }
  .board.play .pd-beam { animation: st-fade 1s ease-out 1.3s both, st-beam 3.2s ease-in-out 2.3s infinite; }
  .board.play .pd-rays { animation: st-fade 1.2s ease-out 1.2s both, st-spin 22s linear infinite; }
  .board.play .pd-sparks { animation: st-fade .4s 1.5s both; }
  .board.play .pd-sparks > i { animation: st-spark 2.4s ease-out infinite; animation-delay: calc(1.5s + var(--d)); }
  .board.play .ladder li { animation: st-slide .6s var(--ease-out) both; animation-delay: calc(.9s + var(--i) * 70ms); }
  .board.play .ld-bar > i { animation: st-bar 1.2s var(--ease-out) both; animation-delay: calc(1s + var(--i) * 70ms); }
}
@keyframes st-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes st-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes st-fade { from { opacity: 0; } }
@keyframes st-bob { 50% { transform: translateY(-4px); } }
@keyframes st-crown { 50% { translate: -50% -5px; rotate: 6deg; } }
@keyframes st-grow { from { transform: scaleY(0); } }
@keyframes st-drop { 0% { opacity: 0; transform: translateY(-70px); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes st-slide { from { opacity: 0; transform: translateX(-24px); } }
@keyframes st-bar { from { transform: scaleX(0); } }
@keyframes st-beam { 50% { transform: scaleX(1.35); filter: blur(12px); } }
@keyframes st-spin { to { rotate: 360deg; } }
@keyframes st-spark { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-170px) rotate(90deg); } }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1000px) {
  .champs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .champs { gap: 8px; }
  .champ { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px 12px 14px; min-height: 0; }
  .champ-ico { width: 38px; height: 38px; }
  .champ-ico > img { width: 24px; height: 24px; }
  .champ-t { font-size: .86rem; }
  .champ-v > b { font-size: 1.25rem; }
  .champ-v > small { display: none; }
  .podium { gap: 6px; }
  .pd-1 { --h: 112px; --skin: 132px; }
  .pd-2 { --h: 82px; --skin: 112px; }
  .pd-3 { --h: 62px; --skin: 104px; }
  .pd-block { --bs: 22px; padding-top: 10px; }
  .pd-crown { width: 34px; top: -22px; }
  .pd-name { font-size: .82rem; margin-top: 10px; }
  .pd-name .rank, .pd-u { display: none; }
  .pd-rays { width: 210px; }
  .ladder a { grid-template-columns: 26px 28px minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 12px; }
  .ladder img { width: 28px; height: 28px; }
  .ld-bar { grid-column: 3 / -1; grid-row: 2; height: 5px; }
}

/* =====================================================================================================
   КАРТА — «атлас»: большая карта с плавающими панелями (мир, поиск, слои-легенда, зум, мини-карта, координаты)
   и боковая сводка. Разметка — map.html, рисование — js/pages/map.js
   ===================================================================================================== */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.map-page { padding-bottom: clamp(48px, 6vw, 80px); }
.atlas { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.atlas .map-wrap { height: clamp(520px, calc(100svh - var(--nav-h) - 40px), 900px); }
.map-panel {
  background: rgba(16, 12, 18, .92); clip-path: var(--pc-sm);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 40px -20px rgba(0, 0, 0, .8);
}

/* сверху слева: миры и поиск */
.map-top {
  position: absolute; z-index: 2; left: 12px; top: 12px; margin: 0; padding: 6px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: calc(100% - 80px);
}
.map-worlds { display: flex; gap: 2px; }
.map-worlds button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 0; cursor: pointer;
  font: 600 .86rem var(--f-body); color: var(--text-2); background: transparent; clip-path: var(--pc-xs);
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.map-worlds button img, .map-search img, .map-layer img, .map-zoom img, .map-side h2 img, .map-stat img { image-rendering: pixelated; }
.map-worlds button:hover { background: rgba(255, 200, 170, .06); color: var(--text); }
.map-worlds button[aria-selected="true"] { background: rgba(255, 127, 80, .16); color: var(--coral-hot); box-shadow: inset 0 -2px 0 var(--coral); }
.map-search {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 10px;
  background: var(--ink-2); clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px var(--line);
}
.map-top .map-search .input { flex: none; width: 190px; height: 34px; padding: 0 6px; border: 0; background: transparent; box-shadow: none; }
.map-info { display: inline-flex; align-items: center; padding: 0 8px; font-size: .84rem; color: var(--text-2); }
.map-info:empty { display: none; }
.map-tip-sw { display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45); }

.map-goto { display: flex; align-items: center; height: 36px; background: var(--ink-2); clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px var(--line); }
.map-top .map-goto .input { flex: none; width: 104px; height: 34px; padding: 0 10px; border: 0; background: transparent; box-shadow: none; font-family: var(--f-mono); font-size: .86rem; }
.map-goto button { height: 36px; width: 34px; border: 0; color: var(--coral-hot); background: rgba(255, 127, 80, .12); font-weight: 700; cursor: pointer; }
.map-goto button:hover { background: rgba(255, 127, 80, .24); }

/* слева снизу: слои — они же легенда */
.map-layers {
  position: absolute; z-index: 2; left: 12px; bottom: 12px; margin: 0; padding: 10px; width: 200px;
  display: flex; flex-direction: column; gap: 2px;
}
.map-panel-t { padding: 2px 8px 8px; font: 600 .66rem/1 var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.map-layer {
  position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 7px 8px; font-size: .88rem; color: var(--text); cursor: pointer; clip-path: var(--pc-xs);
  transition: background-color .2s, opacity .2s;
}
.map-layer:hover { background: rgba(255, 200, 170, .06); }
.map-layer input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.map-layer:has(input:not(:checked)) { opacity: .42; }
.map-layer:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--amber); }
.map-sw { display: block; width: 26px; height: 12px; justify-self: end; }
.sw-terrain { background: linear-gradient(90deg, #5f9e3c 0 34%, #d8c48a 34% 66%, #4fb5e8 66%); }
.sw-claims { background: linear-gradient(90deg, #ff7f50 0 25%, #8e6bff 25% 50%, #79d86b 50% 75%, #ffd45e 75%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.sw-spawn { background: repeating-linear-gradient(135deg, rgba(255, 127, 80, .7) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px #ff7f50; }
.sw-shops, .sw-warps, .sw-players { width: 13px; height: 13px; background: rgba(14, 10, 16, .9); }
.sw-shops { box-shadow: inset 0 0 0 2px #3fe07a; }
.sw-warps { box-shadow: inset 0 0 0 2px #8e6bff; }
.sw-players { box-shadow: inset 0 0 0 2px #fff; }

/* справа: зум и мини-карта */
.map-wrap .map-zoom { z-index: 2; }
.map-wrap .map-zoom button { width: 42px; height: 42px; display: grid; place-items: center; background: rgba(16, 12, 18, .92); }
.map-mini { position: absolute; z-index: 2; right: 12px; bottom: 12px; width: 210px; padding: 8px; display: grid; gap: 6px; }
.map-mini canvas { display: block; width: 100%; height: 136px; cursor: pointer; }
.map-mini span { font-size: .72rem; color: var(--muted); text-align: center; }

/* снизу по центру: координаты и масштаб */
.map-hud {
  position: absolute; z-index: 2; left: 50%; bottom: 12px; translate: -50% 0; pointer-events: none; white-space: nowrap;
  display: flex; align-items: center; gap: 16px; padding: 8px 14px; font: 600 .82rem var(--f-mono); color: var(--text);
}
.map-scale { display: inline-flex; align-items: center; gap: 8px; }
.map-scale > i { display: block; height: 7px; transition: width .2s; box-shadow: inset 0 -2px 0 var(--text-2), inset 2px 0 0 var(--text-2), inset -2px 0 0 var(--text-2); }
.map-scale > b { font-weight: 600; color: var(--muted); }

.map-wrap .map-tip {
  z-index: 3; max-width: 260px; white-space: normal; padding: 9px 12px; line-height: 1.4;
  background: rgba(16, 12, 18, .97); clip-path: var(--pc-xs);
}

/* боковая панель: сводка и крупнейшие владения */
.map-side { display: grid; gap: 16px; position: sticky; top: calc(var(--nav-h) + 16px); }
.map-side .card { padding: 18px; }
.map-side h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.05rem; }
.map-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-stat {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center;
  padding: 10px; background: rgba(255, 200, 170, .04); clip-path: var(--pc-xs);
}
.map-stat img { grid-row: 1 / span 2; }
.map-stat b { font: 800 1.3rem/1.05 var(--f-display); font-variant-numeric: tabular-nums; }
.map-stat span { font-size: .74rem; color: var(--muted); line-height: 1.25; }
.map-events h2 + .map-ev + h2 { margin-top: 18px; }
.map-ev { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.map-ev button {
  width: 100%; display: grid; gap: 2px; padding: 9px 12px; border: 0; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  clip-path: var(--pc-xs); transition: background-color .2s;
}
.map-ev .ev-lot { background: rgba(255, 212, 94, .08); box-shadow: inset 3px 0 0 var(--gold); }
.map-ev .ev-exp { background: rgba(255, 90, 90, .07); box-shadow: inset 3px 0 0 var(--bad); }
.map-ev button:hover { background: rgba(255, 200, 170, .1); }
.map-ev b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-ev span { font-size: .78rem; color: var(--muted); }
.sw-auction { width: 13px; height: 13px; background: rgba(255, 212, 94, .4); box-shadow: inset 0 0 0 2px var(--gold); }
.sw-expiring { width: 13px; height: 13px; background: rgba(255, 90, 90, .3); box-shadow: inset 0 0 0 2px var(--bad); }
.map-owners ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.map-owners li button {
  width: 100%; display: grid; grid-template-columns: 18px 24px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 5px;
  padding: 8px 10px; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  background: transparent; clip-path: var(--pc-xs); transition: background-color .2s, box-shadow .2s;
}
.map-owners li button:hover, .map-owners li.on button { background: color-mix(in srgb, var(--c) 14%, transparent); }
.map-owners li.on button { box-shadow: inset 3px 0 0 var(--c); }
.mo-n { font: 700 .78rem var(--f-mono); color: var(--muted); text-align: center; }
.map-owners li button > img { width: 24px; height: 24px; image-rendering: pixelated; clip-path: var(--pc-xs); background: var(--panel-3); }
.mo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 600; }
.map-owners li button > b { font: 700 .86rem var(--f-mono); color: var(--c); }
.mo-bar { grid-column: 3 / -1; display: block; height: 3px; background: rgba(255, 200, 170, .07); }
.mo-bar > i { display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--c); transform-origin: 0 50%; }

/* движение: панели проявляются, полоски владений растут */
@media (prefers-reduced-motion: no-preference) {
  .map-panel, .map-wrap .map-zoom { animation: map-in .7s var(--ease-out) both; }
  .map-layers { animation-delay: .12s; }
  .map-hud, .map-mini { animation-delay: .2s; }
  .mo-bar > i { animation: map-bar .9s var(--ease-out) both; }
  .map-owners li:nth-child(n) .mo-bar > i { animation-delay: calc(.2s + var(--f) * .1s); }
}
@keyframes map-in { from { opacity: 0; } }
@keyframes map-bar { from { transform: scaleX(0); } }

/* планшет и телефон */
@media (max-width: 1100px) {
  .atlas { grid-template-columns: minmax(0, 1fr); }
  .map-side { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 760px) {
  .atlas .map-wrap { height: 72svh; min-height: 440px; }
  .map-top { max-width: calc(100% - 70px); }
  .map-worlds button { padding: 0 10px; }
  .map-worlds button span { display: none; }
  .map-top .map-search .input { width: 120px; }
  .map-goto { display: none; }
  /* панель по ширине иконок — без пустого хвоста справа; места под кнопки зума хватает */
  .map-layers { width: max-content; max-width: calc(100% - 76px); right: auto; flex-direction: row; flex-wrap: wrap; padding: 6px; }
  .map-panel-t, .map-layer > span, .map-sw { display: none; }
  .map-layer { grid-template-columns: 18px; padding: 8px; }
  .map-mini, .map-hud { display: none; }
  .map-side { grid-template-columns: minmax(0, 1fr); }
}
/* внутри Mini App — только карта */
body.embed .map-side, body.embed .page-head { display: none; }
body.embed .atlas { display: block; }
body.embed .atlas .map-wrap { height: calc(100vh - 16px); }

/* =====================================================================================================
   ПРОФИЛЬ ИГРОКА: сцена с 3D-моделью и скином, статус и титул, паутинка сильных сторон, медали, статистика
   с живыми сравнениями, достижения, владения, магазины и карточка «Итогов». Разметку рисует js/pages/player.js
   ===================================================================================================== */
.profile { padding-bottom: clamp(64px, 8vw, 110px); }
.pf-skel { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: center; padding: 56px 0; }
.pf-skel-stage { height: clamp(360px, 60svh, 560px); }
.pf-skel-id { display: grid; gap: 16px; }

/* ---------- сцена ---------- */
.pf-hero {
  position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(20px, 4vw, 48px) 0 clamp(24px, 4vw, 40px); min-height: min(80svh, 740px);
}
/* свечение во всю ширину экрана в цветах префикса (или коралл → сумерки) */
.pf-hero::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; translate: -50% 0; pointer-events: none;
  background:
    radial-gradient(38% 60% at 24% 52%, color-mix(in srgb, var(--pc1) 34%, transparent), transparent 70%),
    radial-gradient(30% 50% at 34% 80%, color-mix(in srgb, var(--pc2) 22%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 200, 170, .035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255, 200, 170, .035) 0 1px, transparent 1px 32px);
  -webkit-mask: linear-gradient(180deg, transparent, #000 12%, #000 80%, transparent); mask: linear-gradient(180deg, transparent, #000 12%, #000 80%, transparent);
}
.pf-stage { position: relative; height: clamp(380px, 64svh, 620px); }
/* лучи за моделью и «софит» на блоке */
.pf-stage::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 42%; width: min(120%, 620px); aspect-ratio: 1; translate: -50% -50%; pointer-events: none;
  background: repeating-conic-gradient(color-mix(in srgb, var(--pc1) 16%, transparent) 0 8deg, transparent 8deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%); mask: radial-gradient(circle, #000 12%, transparent 62%);
}
.pf-stage::after {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: 6%; width: 70%; height: 22%; translate: -50% 0; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--pc1) 40%, transparent), transparent);
  filter: blur(6px);
}
.pf-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity .8s var(--ease-out); }
.pf-stage canvas.live { opacity: 1; }
.pf-stage canvas.grab { cursor: grabbing; }
.pf-body { position: absolute; left: 50%; bottom: 8%; height: 78%; translate: -50% 0; image-rendering: pixelated; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .6)); }
.pf-hint {
  position: absolute; left: 50%; bottom: 0; translate: -50% 0; padding: 6px 12px; white-space: nowrap; pointer-events: none;
  font: 600 .72rem/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  background: rgba(14, 10, 16, .7); clip-path: var(--pc-xs);
}

.pf-id { min-width: 0; }
.pf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.pf-status {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px; font-size: .86rem; color: var(--text-2);
  background: rgba(255, 200, 170, .06); clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px var(--line);
}
.pf-status > i { width: 9px; height: 9px; background: var(--muted); }
.pf-status.on { color: var(--good); box-shadow: inset 0 0 0 1px rgba(121, 216, 107, .35); }
.pf-status.on > i { background: var(--good); box-shadow: 0 0 10px var(--good); }
.pf-prefix {
  display: inline-block; font: 700 clamp(1rem, 1.6vw, 1.25rem) var(--f-display); letter-spacing: .02em;
  background: linear-gradient(90deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pf-name { margin: .08em 0 .18em; font-size: clamp(2.8rem, 7.4vw, 6.6rem); line-height: .92; letter-spacing: -.035em; overflow-wrap: anywhere; }
.pf-name .rank { margin-left: .2em; vertical-align: middle; }
.pf-name .rank > img { height: .32em; }
.pf-title {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 9px 16px 9px 12px;
  font: 700 clamp(.95rem, 1.4vw, 1.1rem) var(--f-display); color: #2a1606;
  background: linear-gradient(100deg, #ffe08a, #ffc46b 40%, #ff9a6b); clip-path: var(--pc-sm);
  box-shadow: 0 10px 40px -12px rgba(255, 196, 107, .7);
}
.pf-title img { image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.pf-title::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%);
}
.pf-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 2px; margin-bottom: 22px; background: var(--line); clip-path: var(--pc-sm); }
.pf-quick > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 14px 16px; background: rgba(18, 13, 20, .92); }
.pf-quick img { grid-row: 1 / span 2; image-rendering: pixelated; }
.pf-quick b { font: 800 clamp(1.3rem, 2.2vw, 1.7rem)/1.05 var(--f-display); font-variant-numeric: tabular-nums; }
.pf-quick span { font-size: .78rem; color: var(--muted); }
.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-actions .btn { gap: 9px; }
.pf-actions .btn img { image-rendering: pixelated; }

/* ---------- секции ---------- */
.pf-sec { margin-top: clamp(40px, 6vw, 76px); }
.pf-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -.02em; }
.pf-h small { font: 600 .9rem var(--f-mono); color: var(--coral-hot); letter-spacing: 0; }
.profile .card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.15rem; }
.profile .card h2 img, .pf-h2 img { image-rendering: pixelated; }
.pf-power { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.pf-radar, .pf-medals { padding: clamp(18px, 2.4vw, 28px); }
.pf-radar-svg { display: block; width: min(100%, 380px); margin: 0 auto; overflow: visible; }
.pf-radar-svg .rg { fill: none; stroke: rgba(255, 200, 170, .12); }
.pf-radar-svg .ra { stroke: rgba(255, 200, 170, .1); }
.pf-radar-svg .rp { fill: rgba(255, 127, 80, .26); stroke: #ff9a6b; stroke-width: 2; stroke-linejoin: round; }
.pf-radar-svg .rd { fill: #ffd45e; }
.pf-radar-svg text { fill: var(--text-2); font: 700 11px var(--f-display); letter-spacing: .08em; text-transform: uppercase; }
.pf-radar-svg .rv { transform-origin: 160px 160px; }
.pf-note { margin: 8px 0 0; text-align: center; font-size: .8rem; color: var(--muted); }
.pf-medal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pf-medal-list li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 6px;
  padding: 10px 12px; background: rgba(255, 200, 170, .035); clip-path: var(--pc-xs);
}
.pf-medal-list img { image-rendering: pixelated; }
.pm-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-p { font: 800 1.05rem var(--f-display); color: var(--text); }
.pm-p small { font: 500 .78rem var(--f-body); color: var(--muted); }
.pf-medal-list li.gold .pm-p { color: var(--gold); text-shadow: 0 0 14px rgba(255, 212, 94, .55); }
.pf-medal-list li.silver .pm-p { color: #e8e2f0; }
.pf-medal-list li.bronze .pm-p { color: #f2a877; }
.pf-medal-list li.gold { box-shadow: inset 3px 0 0 var(--gold); }
.pm-bar { grid-column: 2 / -1; display: block; height: 4px; background: rgba(255, 200, 170, .07); }
.pm-bar > i { display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--c); transform-origin: 0 50%; }
.pf-link { display: inline-block; margin-top: 14px; font-weight: 600; }

/* статистика */
.pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pf-stat {
  position: relative; display: grid; gap: 4px; padding: 20px 20px 18px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--panel)), var(--panel) 65%);
  clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line);
}
.pf-stat.gold { box-shadow: inset 0 0 0 1px rgba(255, 212, 94, .55), 0 0 40px -14px rgba(255, 212, 94, .6); }
.ps-ico { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px; background: color-mix(in srgb, var(--c) 16%, var(--ink-2)); clip-path: var(--pc-xs); }
.ps-ico img { image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.ps-v { font: 800 clamp(1.9rem, 3vw, 2.5rem)/1 var(--f-display); color: color-mix(in srgb, var(--c) 70%, #fff); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ps-l { font-size: .86rem; color: var(--muted); }
.ps-fun { margin-top: 6px; font-size: .82rem; color: var(--text-2); }
.ps-fun::before { content: "≈ "; display: none; }
.ps-place { position: absolute; top: 14px; right: 14px; padding: 4px 8px; font: 800 .82rem var(--f-display); color: var(--text-2); background: rgba(14, 10, 16, .6); clip-path: var(--pc-xs); }
.pf-stat.gold .ps-place { color: #2a1606; background: var(--gold); }
.pf-stat.silver .ps-place { color: #1e1a24; background: #e8e2f0; }
.pf-stat.bronze .ps-place { color: #2a1606; background: #f2a877; }

/* достижения: слоты инвентаря */
.pf-ach { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pf-badge {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "i t" "i d" "i b";
  column-gap: 12px; align-items: center; padding: 12px; background: var(--panel); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line);
}
.pb-ico {
  grid-area: i; display: grid; place-items: center; width: 56px; height: 56px;
  background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; /* слот как в игре */
}
.pb-ico img { image-rendering: pixelated; filter: grayscale(1) brightness(.55); opacity: .7; }
.pf-badge b { grid-area: t; font: 700 .95rem var(--f-display); color: var(--muted); }
.pb-d { grid-area: d; font-size: .76rem; color: var(--muted); line-height: 1.3; }
.pb-bar { grid-area: b; display: block; height: 4px; margin-top: 6px; background: rgba(255, 200, 170, .08); }
.pb-bar > i { display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--coral); transform-origin: 0 50%; }
.pb-ok { grid-area: b; justify-self: start; margin-top: 6px; padding: 2px 8px; font: 700 .68rem var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: #2a1606; background: var(--gold); }
.pf-badge.done { background: linear-gradient(160deg, rgba(255, 212, 94, .12), var(--panel) 70%); box-shadow: inset 0 0 0 1px rgba(255, 212, 94, .4); }
.pf-badge.done b { color: var(--text); }
.pf-badge.done .pb-ico img { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); opacity: 1; }

/* владения, магазины, варпы */
.pf-world { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.pf-land, .pf-shops { padding: clamp(18px, 2.4vw, 26px); }
.pf-land-view {
  position: relative; height: 280px; background:
    repeating-linear-gradient(0deg, rgba(255, 200, 170, .05) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(255, 200, 170, .05) 0 1px, transparent 1px 16px), var(--ink-2);
  clip-path: var(--pc-sm);
}
.pf-land-view canvas { display: block; width: 100%; height: 100%; }
.pf-land-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); }
.pf-land-empty img { image-rendering: pixelated; opacity: .8; }
.pf-land-meta { margin: 12px 0 0; color: var(--text-2); }
.pf-land-meta b { font: 800 1.2rem var(--f-display); color: var(--coral-hot); }
.pf-shops ul { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 4px; }
.pf-shops li a { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; color: var(--text); background: rgba(255, 200, 170, .035); clip-path: var(--pc-xs); transition: background-color .2s; }
.pf-shops li a:hover { background: rgba(63, 224, 122, .1); text-decoration: none; }
.pf-shops li img { image-rendering: pixelated; }
.pf-shops li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-shops li span { font-size: .8rem; color: var(--muted); }
.pf-h2 { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: 1.15rem; }
.pf-warps { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-warps span { padding: 6px 10px; font-size: .86rem; background: rgba(142, 107, 255, .12); box-shadow: inset 0 0 0 1px rgba(142, 107, 255, .35); clip-path: var(--pc-xs); }

/* итоги */
/* карточка — вертикальная (1080×1920, формат сторис): как экран телефона, с наклоном и свечением */
.pf-wrapped {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: center;
  padding: clamp(24px, 4vw, 48px); background: radial-gradient(60% 90% at 18% 50%, rgba(255, 127, 80, .18), transparent 70%), var(--panel);
  clip-path: var(--pc); box-shadow: inset 0 0 0 1px var(--line);
}
.pf-wcard { display: block; width: clamp(200px, 22vw, 300px); rotate: -4deg; clip-path: var(--pc-sm); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .9), 0 0 60px -20px rgba(255, 127, 80, .7); transition: rotate .5s var(--spring); }
.pf-wcard:hover { rotate: 0deg; }
.pf-wcard img { display: block; width: 100%; height: auto; background: var(--ink-2); aspect-ratio: 1080 / 1920; }
.pf-wrapped h2 { margin: .3em 0 .4em; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.pf-wrapped p { color: var(--text-2); max-width: 520px; }

.pf-missing { display: grid; justify-items: center; gap: 10px; padding: 18vh 0; text-align: center; }
.pf-missing img { image-rendering: pixelated; }
.pf-missing p { max-width: 520px; color: var(--text-2); }

/* ---------- движение ---------- */
@media (prefers-reduced-motion: no-preference) {
  .pf-stage::before { animation: pf-spin 40s linear infinite; }
  .pf-id > * { animation: pf-rise .9s var(--ease-out) both; }
  .pf-id > :nth-child(2) { animation-delay: .08s; } .pf-id > :nth-child(3) { animation-delay: .16s; }
  .pf-id > :nth-child(4) { animation-delay: .26s; } .pf-id > :nth-child(5) { animation-delay: .36s; } .pf-id > :nth-child(6) { animation-delay: .46s; }
  .pf-name { animation: pf-name 1.1s var(--ease-out) .12s both !important; }
  .pf-title::after { animation: pf-shine 3.6s var(--ease-io) 1.2s infinite; }
  .pf-status.on > i { animation: pf-pulse 1.6s ease-in-out infinite; }
  .pf-radar:not(.in) .rv { transform: scale(0); }
  .pf-radar.in .rv { animation: pf-radar 1.2s var(--spring) both; }
  .pf-radar:not(.in) .rd { opacity: 0; }
  .pf-radar.in .rd { animation: pf-fade .4s ease-out both; animation-delay: calc(.6s + var(--i) * 80ms); }
  .pf-medals:not(.in) .pm-bar > i, .pf-ach:not(.in) .pb-bar > i { transform: scaleX(0); }
  .pf-medals.in .pm-bar > i, .pf-ach.in .pb-bar > i { animation: pf-bar 1.1s var(--ease-out) .2s both; }
  .pf-ach:not(.in) .pf-badge { opacity: 0; }
  .pf-ach.in .pf-badge { animation: pf-pop .6s var(--spring) both; animation-delay: calc(var(--i) * 40ms); }
  .pf-ach.in .pf-badge.done .pb-ico { animation: pf-glow 2.4s ease-in-out calc(1s + var(--i) * 40ms) infinite alternate; }
}
@keyframes pf-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pf-name { from { opacity: 0; letter-spacing: .12em; filter: blur(8px); } }
@keyframes pf-shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes pf-pulse { 50% { opacity: .35; } }
@keyframes pf-spin { to { rotate: 360deg; } }
@keyframes pf-radar { from { transform: scale(0) rotate(-30deg); } }
@keyframes pf-fade { from { opacity: 0; } }
@keyframes pf-bar { from { transform: scaleX(0); } }
@keyframes pf-pop { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes pf-glow { to { box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff, 0 0 22px rgba(255, 212, 94, .55); } }

/* ---------- планшет и телефон ---------- */
@media (max-width: 960px) {
  .pf-hero, .pf-skel { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pf-stage { height: clamp(320px, 52svh, 460px); }
  .pf-hero::before { background:
    radial-gradient(70% 40% at 50% 26%, color-mix(in srgb, var(--pc1) 32%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 200, 170, .035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255, 200, 170, .035) 0 1px, transparent 1px 32px); }
  .pf-power, .pf-world, .pf-wrapped { grid-template-columns: minmax(0, 1fr); }
  .pf-stats, .pf-ach { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-wrapped { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .pf-wrapped p { margin-inline: auto; }
}
@media (max-width: 560px) {
  .pf-quick { grid-template-columns: 1fr 1fr; }
  .pf-ach { grid-template-columns: minmax(0, 1fr); }
  .pf-stats { gap: 8px; }
  .pf-stat { padding: 14px; }
  .ps-ico { width: 44px; height: 44px; }
  .pf-actions .btn { flex: 1 1 calc(50% - 5px); justify-content: center; }
}

/* =====================================================================================================
   WIKI: оглавление-книга с поиском, разделы с иконками и якорями, команды копируются по клику
   ===================================================================================================== */
.wiki { grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-top: 28px; }
.wiki nav#wiki-nav {
  position: sticky; top: calc(var(--nav-h) + 16px); align-self: start; display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100svh - var(--nav-h) - 32px); padding: 12px; background: var(--panel); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line);
}
.wiki-search { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; height: 40px; background: var(--ink-2); clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px var(--line); }
.wiki-search img { image-rendering: pixelated; }
.wiki-search .input { height: 38px; border: 0; padding: 0 6px; background: transparent; box-shadow: none; }
.wiki-found { padding: 0 6px; font-size: .8rem; color: var(--coral-hot); }
.wiki-toc { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.wiki nav#wiki-nav .wiki-toc a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: .9rem; color: var(--text-2);
  box-shadow: none; clip-path: var(--pc-xs); background: transparent;
}
.wiki-toc a img { image-rendering: pixelated; flex: none; opacity: .85; }
.wiki nav#wiki-nav .wiki-toc a:hover { background: rgba(255, 200, 170, .05); color: var(--text); }
.wiki nav#wiki-nav .wiki-toc a.active { background: rgba(255, 127, 80, .12); color: var(--coral-hot); box-shadow: inset 3px 0 0 var(--coral); }
.wiki-toc a.off { opacity: .3; }
.wiki-progress { position: sticky; top: var(--nav-h); z-index: 3; height: 3px; margin-bottom: 18px; background: rgba(255, 200, 170, .06); }
.wiki-progress > i { display: block; height: 100%; background: var(--g-sunset); transform: scaleX(0); transform-origin: 0 50%; }
.wiki article .wiki-sec { position: relative; padding: clamp(20px, 2.6vw, 32px); margin-bottom: 16px; border: 0; background: var(--panel); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line); }
.wiki-sec > h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.wiki-sec > h2 img { image-rendering: pixelated; padding: 6px; width: 44px; height: 44px; background: var(--ink-2); clip-path: var(--pc-xs); }
.wiki-anchor { margin-left: auto; padding: 4px 10px; font: 700 1rem var(--f-mono); color: var(--muted); opacity: 0; transition: opacity .2s, color .2s; }
.wiki-sec:hover .wiki-anchor, .wiki-anchor:focus-visible { opacity: 1; }
.wiki-anchor:hover { color: var(--coral-hot); text-decoration: none; }
.wiki-text { line-height: 1.7; }
.wiki-text h3 { margin: 1.6em 0 .5em; font-size: 1.2rem; color: var(--text); }
.wiki-text h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; vertical-align: .15em; background: var(--coral); }
.wiki-text ul { padding-left: 1.2em; }
.wiki-text li::marker { color: var(--coral); }
.wiki-text code.cmd { cursor: copy; color: var(--amber); background: rgba(255, 196, 107, .1); box-shadow: inset 0 0 0 1px rgba(255, 196, 107, .25); transition: background-color .2s; }
.wiki-text code.cmd:hover { background: rgba(255, 196, 107, .22); }
.wiki-text table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .92rem; }
.wiki-text th, .wiki-text td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.wiki-text th { color: var(--text); font-weight: 650; background: rgba(255, 200, 170, .04); }
.wiki-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 0; color: var(--muted); text-align: center; }
.wiki-empty img { image-rendering: pixelated; }
.wiki-up { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
@media (max-width: 900px) {
  .wiki { grid-template-columns: minmax(0, 1fr); }
  .wiki nav#wiki-nav { position: static; max-height: none; }
  .wiki-toc { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .wiki nav#wiki-nav .wiki-toc a { flex: none; background: var(--ink-2); }
}

/* =====================================================================================================
   БЛОГ И ИВЕНТЫ: свежая новость крупно, сетка карточек, окно чтения; галерея плитками; хроника ивентов
   ===================================================================================================== */
.blog-tabs { display: inline-flex; gap: 4px; padding: 5px; background: var(--panel); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line); }
.blog-tabs button {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px; border: 0; cursor: pointer;
  font: 650 .95rem var(--f-body); color: var(--text-2); background: transparent; clip-path: var(--pc-xs); transition: background-color .2s, color .2s;
}
.blog-tabs button img { image-rendering: pixelated; }
.blog-tabs button:hover { color: var(--text); background: rgba(255, 200, 170, .05); }
.blog-tabs button[aria-selected="true"] { color: var(--coral-hot); background: rgba(255, 127, 80, .14); box-shadow: inset 0 -2px 0 var(--coral); }
.blog-skel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.blog-skel > .skeleton { height: 320px; }
.blog-skel > .skeleton:first-child { grid-column: 1 / -1; height: 380px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.blog-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; cursor: pointer; overflow: hidden;
  background: var(--panel); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .45s var(--spring), box-shadow .3s;
}
.blog-card:hover, .blog-card:focus-visible { transform: translateY(-5px); box-shadow: inset 0 0 0 1px rgba(255, 127, 80, .45), 0 24px 50px -26px rgba(255, 127, 80, .55); outline: none; }
.bc-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink-2); }
.bc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.blog-card:hover .bc-cover img { transform: scale(1.05); }
.bc-blank { display: grid; place-items: center; background: radial-gradient(60% 80% at 50% 50%, rgba(255, 127, 80, .18), transparent), var(--ink-2); }
.bc-blank img { width: 48px !important; height: 48px !important; image-rendering: pixelated; object-fit: contain; }
.bc-count { position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; font-size: .78rem; font-weight: 650; color: #fff; background: rgba(14, 10, 16, .78); clip-path: var(--pc-xs); }
.bc-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.bc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.blog-card h2 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.bc-ex { margin: 0; color: var(--text-2); font-size: .94rem; line-height: 1.55; }
.bc-more { margin-top: auto; padding-top: 4px; font-weight: 650; color: var(--coral-hot); }
.bc-more i { font-style: normal; display: inline-block; transition: transform .3s var(--spring); }
.blog-card:hover .bc-more i { transform: translateX(4px); }
.blog-card.big { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.blog-card.big .bc-cover { aspect-ratio: auto; min-height: 360px; }
.blog-card.big .bc-body { justify-content: center; padding: clamp(22px, 3.4vw, 44px); gap: 14px; }
.blog-card.big h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.blog-card.big .bc-ex { font-size: 1.02rem; }
.blog-del { margin-left: auto; padding: 3px 8px; border: 0; font: 600 .75rem var(--f-body); color: var(--bad); background: rgba(255, 90, 90, .1); cursor: pointer; }
.blog-empty { display: grid; justify-items: center; gap: 6px; padding: 72px 0; text-align: center; color: var(--muted); }
.blog-empty img { image-rendering: pixelated; margin-bottom: 8px; }
.blog-empty h3 { margin: 0; color: var(--text); }

/* галерея: плитки разной высоты */
.gallery.masonry { display: block; columns: 3 300px; column-gap: 14px; }
.gallery.masonry figure { position: relative; break-inside: avoid; margin: 0 0 14px; overflow: hidden; clip-path: var(--pc-sm); background: var(--panel); }
.gallery.masonry img { display: block; width: 100%; height: auto; cursor: zoom-in; transition: transform .8s var(--ease-out); }
.gallery.masonry figure:hover img { transform: scale(1.04); }
.gallery.masonry figcaption {
  position: absolute; inset: auto 0 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 28px 14px 12px;
  font-size: .86rem; background: linear-gradient(0deg, rgba(10, 7, 12, .9), transparent); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s var(--ease-out);
}
.gallery.masonry figure:hover figcaption, .gallery.masonry figure:focus-within figcaption { opacity: 1; transform: none; }
.gallery.masonry figcaption span { color: var(--text-2); }

/* окно чтения новости */
.reader {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: start center; overflow-y: auto; padding: clamp(16px, 5vh, 64px) 16px;
  background: rgba(8, 6, 10, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: map-in .3s ease-out;
}
html.reader-open { overflow: hidden; }
.reader-card { position: relative; width: min(820px, 100%); background: var(--panel); clip-path: var(--pc); box-shadow: inset 0 0 0 1px var(--line-2); animation: pf-rise .5s var(--ease-out); }
.reader-x { position: absolute; z-index: 2; right: 14px; top: 14px; width: 40px; height: 40px; border: 0; color: #fff; background: rgba(14, 10, 16, .8); cursor: pointer; clip-path: var(--pc-xs); font-size: 1rem; }
.reader-cover { display: block; width: 100%; max-height: 460px; object-fit: cover; cursor: zoom-in; }
.reader-body { padding: clamp(20px, 4vw, 44px); }
.reader-body h1 { margin: 12px 0 18px; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.1; }
.reader-text p { color: var(--text-2); font-size: 1.04rem; line-height: 1.75; }
.reader-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 20px; }
.reader-imgs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; clip-path: var(--pc-xs); }

/* хроника ивентов */
.ev-line { position: relative; display: grid; gap: 22px; padding-left: 4px; }
.ev-line::before { content: ""; position: absolute; left: 39px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--coral), var(--rose) 50%, var(--dusk)); opacity: .5; }
.ev-item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; align-items: start; }
.ev-date {
  position: relative; z-index: 1; display: grid; justify-items: center; padding: 8px 4px; text-align: center; background: var(--ink-2);
  clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px rgba(255, 127, 80, .45);
}
.ev-date b { font: 800 1.6rem/1 var(--f-display); color: var(--coral-hot); }
.ev-date span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.ev-date small { font-size: .7rem; color: var(--muted); }
.ev-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); padding: 0; overflow: hidden; }
.ev-card:not(:has(.ev-cover)) { grid-template-columns: minmax(0, 1fr); }
.ev-cover { width: 100%; height: 100%; min-height: 240px; object-fit: cover; cursor: zoom-in; }
.ev-body { padding: clamp(18px, 2.6vw, 30px); display: grid; gap: 10px; align-content: start; }
.ev-body h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.ev-text p { margin: 0 0 .7em; color: var(--text-2); line-height: 1.65; }
.ev-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.ev-strip img { flex: none; width: 108px; height: 72px; object-fit: cover; cursor: zoom-in; clip-path: var(--pc-xs); }

/* просмотр фото с листанием (поверх старого .lightbox) */
.lightbox { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-width: 92vw; }
.lightbox figure img { max-width: 92vw; max-height: 82vh; object-fit: contain; }
.lightbox figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: .9rem; color: var(--text-2); }
.lightbox figcaption span { color: var(--muted); font-family: var(--f-mono); }
.lb-nav, .lb-x { position: fixed; border: 0; color: #fff; background: rgba(20, 14, 22, .8); cursor: pointer; clip-path: var(--pc-xs); }
.lb-nav { top: 50%; translate: 0 -50%; width: 52px; height: 72px; font-size: 2rem; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-x { right: 14px; top: 14px; width: 44px; height: 44px; }
.lb-nav:hover, .lb-x:hover { background: rgba(255, 127, 80, .5); }

.composer summary { display: flex; align-items: center; gap: 10px; }
.composer summary img { image-rendering: pixelated; }
@media (max-width: 960px) {
  .blog-grid, .blog-skel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-card.big { grid-template-columns: minmax(0, 1fr); }
  .blog-card.big .bc-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .ev-card { grid-template-columns: minmax(0, 1fr); }
  .ev-cover { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  .blog-grid, .blog-skel { grid-template-columns: minmax(0, 1fr); }
  .ev-item { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .ev-line::before { left: 29px; }
  .ev-date b { font-size: 1.25rem; }
  .blog-tabs { display: flex; }
  .blog-tabs button { flex: 1; justify-content: center; padding: 0 10px; }
}

/* =====================================================================================================
   ПОМОЩЬ: поддержка, жалоба, FAQ и правила; частые вопросы; хелперы с трекером заявки
   ===================================================================================================== */
.help-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.help-support {
  position: relative; overflow: hidden; display: grid; align-content: start; gap: 10px; padding: clamp(24px, 3.4vw, 44px);
  --card-bg: radial-gradient(70% 90% at 100% 0%, rgba(255, 127, 80, .2), transparent 70%), var(--panel);
}
.help-support h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.help-support > .kicker, .help-support > h2 { max-width: calc(100% - 120px); }
.help-support p { margin: 0; color: var(--text-2); max-width: 520px; }
.hs-art { position: absolute; right: clamp(16px, 3vw, 40px); top: clamp(16px, 3vw, 36px); width: 96px; height: 96px; display: grid; place-items: center; background: rgba(255, 127, 80, .12); clip-path: var(--pc-sm); }
.hs-art img { image-rendering: pixelated; animation: pf-float 4s ease-in-out infinite; }
.help-support .help-extra { padding: 14px 16px; background: rgba(255, 200, 170, .05); clip-path: var(--pc-xs); color: var(--text-2); }
.help-support .help-extra p { margin: 0; }
#support-action { margin-top: 8px; }
#support-action .btn { gap: 10px; }
#support-action .btn img { image-rendering: pixelated; }
.help-side { display: grid; gap: 12px; }
.help-tile { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px 20px; color: var(--text); }
.help-tile > img { image-rendering: pixelated; width: 48px; height: 48px; padding: 6px; background: var(--ink-2); clip-path: var(--pc-xs); }
.help-tile h3 { margin: 0 0 4px; font-size: 1.08rem; }
.help-tile p { margin: 0; font-size: .9rem; color: var(--text-2); }
a.help-tile:hover { text-decoration: none; }
.help-more { display: inline-block; margin-top: 8px; font-weight: 650; color: var(--coral-hot); }
.help-cmd {
  margin-top: 10px; padding: 7px 12px; border: 0; cursor: copy; font: 600 .9rem var(--f-mono); color: var(--amber);
  background: rgba(255, 196, 107, .1); box-shadow: inset 0 0 0 1px rgba(255, 196, 107, .3); clip-path: var(--pc-xs);
}
.help-cmd:hover { background: rgba(255, 196, 107, .2); }
.help-faq { margin-top: clamp(36px, 5vw, 64px); }
.help-h { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.help-h img { image-rendering: pixelated; }
.helper-block { margin-top: clamp(40px, 6vw, 76px); padding-bottom: 72px; }
.helper-banner {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 52px); align-items: center;
  padding: clamp(24px, 4vw, 52px); clip-path: var(--pc);
  background: radial-gradient(50% 120% at 12% 50%, rgba(142, 107, 255, .28), transparent 70%), linear-gradient(120deg, #1d1530, var(--panel) 60%);
  box-shadow: inset 0 0 0 1px rgba(142, 107, 255, .35);
}
.hb-art { display: grid; place-items: center; width: clamp(120px, 14vw, 180px); aspect-ratio: 1; background: rgba(142, 107, 255, .14); clip-path: var(--pc-sm); }
.hb-art img { image-rendering: pixelated; width: 60%; height: auto; filter: drop-shadow(0 0 24px rgba(142, 107, 255, .6)); animation: pf-float 5s ease-in-out infinite; }
.hb-text h2 { margin: .2em 0 .3em; font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.hb-text p { margin: 0 0 14px; color: var(--text-2); max-width: 560px; }
.hb-perks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; }
.hb-perks li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .9rem; background: rgba(14, 10, 16, .5); clip-path: var(--pc-xs); }
.hb-perks img { image-rendering: pixelated; }
.apply-state { margin-top: 16px; padding: 20px 22px; display: grid; gap: 14px; }
.as-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.as-track { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; counter-reset: none; }
.as-track li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: .86rem; color: var(--muted); text-align: center; }
.as-track li::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.as-track li:first-child::before { display: none; }
.as-track li.on::before { background: var(--coral); }
.as-track i { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; font: 700 .9rem var(--f-mono); font-style: normal; background: var(--ink-2); clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px var(--line-2); }
.as-track li.on { color: var(--text); }
.as-track li.on i { color: #2a1606; background: var(--coral); }
.apply-state.accepted .as-track li.end i { background: var(--good); }
.apply-state.rejected .as-track li.end i { background: var(--bad); }
.as-note { margin: 0; padding: 12px 14px; background: rgba(255, 200, 170, .05); clip-path: var(--pc-xs); }
.apply-form { margin-top: 16px; padding: clamp(20px, 3vw, 32px); display: grid; gap: 14px; }
.apply-form h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.4rem; }
.apply-form h3 img { image-rendering: pixelated; }
.apply-q > span { display: flex; align-items: center; gap: 10px; }
.apply-q > span i { display: grid; place-items: center; flex: none; width: 24px; height: 24px; font: 700 .78rem var(--f-mono); font-style: normal; color: #2a1606; background: var(--coral-hot); clip-path: var(--pc-xs); }
@keyframes pf-float { 50% { transform: translateY(-8px); } }
@media (max-width: 900px) {
  .help-top { grid-template-columns: minmax(0, 1fr); }
  .helper-banner { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .hs-art { position: static; width: 72px; height: 72px; }
}

/* =====================================================================================================
   ЛИЧНЫЙ КАБИНЕТ: вход (голова по нику, шаги, код по клеткам) и кабинет (шапка, предупреждения, карточки)
   ===================================================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; min-height: calc(100svh - var(--nav-h) - 80px); padding: 32px 0 64px; }
.auth-art { position: relative; display: grid; justify-items: center; gap: 22px; }
.auth-head {
  position: relative; display: grid; place-items: center; width: clamp(150px, 18vw, 220px); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 127, 80, .35), transparent), var(--ink-2); clip-path: var(--pc);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.auth-head img { width: 62%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .6)); transition: transform .5s var(--spring); }
.auth-head img.on { animation: auth-pop .6s var(--spring); }
.auth-door { position: absolute; right: 12%; top: 6%; width: 56px; image-rendering: pixelated; opacity: .8; rotate: 8deg; }
.auth-steps { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.auth-steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; }
.auth-steps i { display: grid; place-items: center; width: 30px; height: 30px; font: 700 .86rem var(--f-mono); font-style: normal; background: var(--ink-2); clip-path: var(--pc-xs); box-shadow: inset 0 0 0 1px var(--line-2); }
.auth-steps li.on { color: var(--text); }
.auth-steps li.on i { color: #2a1606; background: var(--coral); box-shadow: none; }
.auth .auth-box { max-width: 480px; margin: 0; padding: clamp(24px, 3vw, 36px); display: grid; gap: 12px; }
.auth .auth-box h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.auth .auth-box .row { margin-top: 4px; }
.auth .code-input { height: 64px; text-align: center; font: 700 2rem var(--f-mono); letter-spacing: .5em; padding-left: .5em; }
@keyframes auth-pop { from { transform: scale(.7) rotate(-8deg); } }

.cab-hero {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(16px, 3vw, 36px); align-items: center;
  margin: 28px 0 18px; padding: clamp(20px, 3vw, 32px); clip-path: var(--pc);
  background: radial-gradient(60% 120% at 0% 50%, rgba(255, 127, 80, .2), transparent 70%), var(--panel); box-shadow: inset 0 0 0 1px var(--line);
}
.cab-avatar { width: clamp(88px, 10vw, 128px); aspect-ratio: 1; padding: 8px; background: var(--ink-2); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line-2); }
.cab-avatar img { width: 100%; height: 100%; image-rendering: pixelated; }
.cab-hello { color: var(--muted); font-size: .95rem; }
.cab-who h1 { margin: 2px 0 10px; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1; letter-spacing: -.03em; overflow-wrap: anywhere; }
.cab-who .chips { margin-bottom: 14px; }
.cab-who .badge img { image-rendering: pixelated; vertical-align: -2px; }
.cab-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cab-actions .btn { gap: 8px; }
.cab-actions .btn img { image-rendering: pixelated; }
.cab-quick { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 2px; background: var(--line); clip-path: var(--pc-sm); }
.cab-quick > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 12px 14px; background: rgba(18, 13, 20, .95); }
.cab-quick img { grid-row: 1 / span 2; image-rendering: pixelated; }
.cab-quick b { font: 800 1.35rem/1.05 var(--f-display); }
.cab-quick span { font-size: .74rem; color: var(--muted); }
.cab-alerts { display: grid; gap: 8px; margin: 0 0 18px; }
.cab-alert {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 16px;
  background: linear-gradient(90deg, rgba(255, 127, 80, .14), rgba(255, 127, 80, .04)); clip-path: var(--pc-xs); box-shadow: inset 3px 0 0 var(--coral);
}
.cab-alert img { image-rendering: pixelated; width: 40px; height: 40px; padding: 6px; background: rgba(14, 10, 16, .5); clip-path: var(--pc-xs); }
.cab-alert p { margin: 0; color: var(--text); }
.cab-card { padding: 20px 22px; }
.cab-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; }
.cab-card h3 img, .cab-warps h2 img, .cab-notify h2 img { image-rendering: pixelated; }
.cab-warps h2, .cab-notify h2 { display: flex; align-items: center; gap: 10px; }
.cab-land { display: flex; align-items: center; gap: 18px; }
.cab-ring { position: relative; display: grid; place-items: center; width: 92px; aspect-ratio: 1; flex: none; }
.cab-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.cab-ring circle { fill: none; stroke: rgba(255, 200, 170, .1); stroke-width: 4; }
.cab-ring circle.v { stroke: var(--good); stroke-linecap: square; stroke-dasharray: 119.4; stroke-dashoffset: calc(119.4 * (1 - var(--f))); transition: stroke-dashoffset 1.2s var(--ease-out); }
.cab-ring.warn circle.v { stroke: var(--bad); }
.cab-ring b { font: 800 1.5rem/1 var(--f-display); margin-top: -10px; }
.cab-ring span { position: absolute; bottom: 22px; font-size: .7rem; line-height: 1; text-align: center; color: var(--muted); }
.cab-auto { white-space: nowrap; min-width: max-content; }
.cab-toggle { display: flex; gap: 10px; }
.cab-toggle > img { image-rendering: pixelated; flex: none; margin-top: 1px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-door { display: none; }
  .cab-hero { grid-template-columns: auto minmax(0, 1fr); }
  .cab-quick { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cab-hero { grid-template-columns: minmax(0, 1fr); }
  .cab-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================================================
   TELEGRAM: привязка с сайта (кнопка → код → бот) и уведомления. Разметку рисует js/pages/telegram.js
   ===================================================================================================== */
.tg-head { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 5vw, 72px); align-items: center; }
.tg-head .tgphone { margin-top: 28px; }
#tg-root { display: grid; gap: 18px; margin: 36px 0 clamp(64px, 8vw, 110px); }
.tgl { display: grid; gap: 30px; padding: clamp(22px, 4vw, 40px); }
.tgl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tgl-steps li { position: relative; display: grid; gap: 3px; padding: 16px 18px 16px 64px; background: var(--panel-2); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.tgl-steps li > span {
  position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 34px; height: 36px; display: grid; place-items: center;
  font: 800 1.1rem var(--f-display); color: var(--muted); background: var(--panel-3); clip-path: var(--pc-xs);
}
.tgl-steps li.now { box-shadow: inset 0 0 0 1px rgba(255, 127, 80, .55); }
.tgl-steps li.now > span { color: #221008; background: var(--g-coral); box-shadow: inset 0 -3px 0 #B4432A; }
.tgl-steps li.done > span { color: #0e1a0b; background: var(--good); }
.tgl-steps b { font: 700 1rem/1.2 var(--f-display); }
.tgl-steps small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.tgl-box { display: grid; justify-items: center; gap: 20px; text-align: center; padding: 6px 0 4px; }
.tgl-lead { max-width: 580px; margin: 0; color: var(--text-2); font-size: 1.05rem; }
.tgl-lead b { color: var(--text); }
.tgl-code { display: flex; gap: clamp(5px, 1.4vw, 10px); padding: 0; border: 0; background: none; cursor: pointer; }
.tgl-code span {
  width: clamp(42px, 10vw, 66px); aspect-ratio: 1 / 1.15; display: grid; place-items: center;
  font: 800 clamp(1.5rem, 5.4vw, 2.5rem)/1 var(--f-display); color: var(--text); background: #120d14;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .6), inset -3px -3px 0 rgba(255, 220, 200, .08), inset 0 0 0 1px rgba(255, 200, 170, .16);
  text-shadow: 0 0 20px rgba(255, 127, 80, .55); transition: color .2s;
  animation: code-in .55s var(--spring) both;
}
.tgl-code span:nth-child(2) { animation-delay: .05s; }
.tgl-code span:nth-child(3) { animation-delay: .1s; }
.tgl-code span:nth-child(4) { animation-delay: .15s; }
.tgl-code span:nth-child(5) { animation-delay: .2s; }
.tgl-code span:nth-child(6) { animation-delay: .25s; }
.tgl-code:hover span { color: var(--coral-hot); }
@keyframes code-in { from { opacity: 0; transform: translateY(-18px) scale(.8); } }
.tgl-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tgl-wait { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: .92rem; }
.tgl-wait b { color: var(--text); font-family: var(--f-mono); }
.tgl-msg { display: flex; align-items: center; gap: 16px; padding: 24px; }
.tgl-msg img { image-rendering: pixelated; }
.tgl-msg p { margin: 0; }
.tgm-hero { --card-line: rgba(121, 216, 107, .38); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: clamp(20px, 3vw, 32px); }
.tgm-ok { width: 68px; height: 68px; display: grid; place-items: center; background: rgba(121, 216, 107, .12); clip-path: var(--pc-sm); box-shadow: inset 0 0 0 1px rgba(121, 216, 107, .45); }
.tgm-ok img { image-rendering: pixelated; }
.tgm-hero.fresh .tgm-ok { animation: ok-pop .8s var(--spring) both; }
@keyframes ok-pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.tgm-who h2 { margin: 10px 0 4px; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.tgm-who p { margin: 0; }
.tgm-actions { display: flex; flex-direction: column; gap: 10px; }
.tgm-note { display: flex; align-items: flex-start; gap: 10px; margin: 2px 2px 0; color: var(--muted); font-size: .9rem; }
.tgm-note img { image-rendering: pixelated; flex: none; margin-top: 2px; }
.tgm-note b { color: var(--text-2); }
@media (max-width: 900px) {
  .tg-head { grid-template-columns: minmax(0, 1fr); }
  .tg-head .tgphone { width: min(100%, 270px); margin-top: 8px; }
  .tgl-steps { grid-template-columns: minmax(0, 1fr); }
  .tgm-hero { grid-template-columns: auto minmax(0, 1fr); }
  .tgm-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .tgm-actions .btn { flex: 1 1 200px; }
}

/* кабинет: карточка «Telegram и уведомления» (сами настройки — на /telegram) */
.cab-tg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-top: 18px; padding: 20px 24px; }
.cab-tg-ico { width: 60px; height: 60px; display: grid; place-items: center; background: #120d14; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .6), inset -2px -2px 0 rgba(255, 220, 200, .08); }
.cab-tg-ico img { image-rendering: pixelated; }
.cab-tg h2 { margin: 0 0 4px; font-size: 1.3rem; }
.cab-tg p { margin: 0; }
@media (max-width: 640px) { .cab-tg { grid-template-columns: auto minmax(0, 1fr); } .cab-tg .btn { grid-column: 1 / -1; } }
