/* Visby CF — шрифт макета. Только прямые начертания: наклонные в дизайне не используются */
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-Thin.woff2") format("woff2"); font-weight: 250; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-DemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("fonts/VisbyCF-Heavy.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  /* Из макета Figma (страница «Главная») */
  --bg: #0e0e0e;
  --brand: #1798c9;
  --brand-dark: #07759f;
  --brand-edge: #2d9fcc;
  --brand-edge-dark: #1f83a9;
  --glow-cyan: #00b3ff;
  --glow-navy: #0b3e81;
  --font: "Visby CF", system-ui, sans-serif;
  --container: 1110px;
  --gutter: 16px;

  --text: #fff;
  --muted: rgba(255, 255, 255, .55);
  --line: rgba(255, 255, 255, .08);
  --tint: rgba(255, 255, 255, .06);
  --online: #5ac46c;
  --danger: #ef5b5b;
  --danger-dark: #b83636;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.55 var(--font);
}
h1, h2, h3 { font-weight: 900; line-height: 1.15; }
b, strong, th { font-weight: 800; }
button, input, select, textarea { font-family: inherit; }

a { color: var(--brand-edge); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd { background: var(--tint); padding: 1px 6px; font-size: .92em; }

/* ---------- Сетка: контейнер 1110px по центру, как в макете ---------- */
.wrap { max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Пиксельный срез углов: квадрат --cut × --cut в каждом углу */
.panel, .card, .map-frame, .menu-bg, .menu-nav, .btn, .flash, .status-card, .step-num, .badge, .pill, .cape-preview,
dialog.modal, .cape-option, .badge-tile, .badge-icon,
.form input:not([type=radio]):not([type=file]), .inline-form input:not([type=radio]) {
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, calc(100% - var(--cut)) var(--cut), 100% var(--cut),
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) calc(100% - var(--cut)), calc(100% - var(--cut)) 100%,
    var(--cut) 100%, var(--cut) calc(100% - var(--cut)), 0 calc(100% - var(--cut)), 0 var(--cut), var(--cut) var(--cut));
}

/* ---------- Блоки: стекло как у меню ---------- */
/* Фоновые блоки: сплошной белый 5% и рамка 1px белым 10%.
   .card и .map-frame — тот же блок, что .panel (классы остались от старой вёрстки) */
.panel, .card, .map-frame, .status-card, .flash {
  --cut: 8px;
  --edge-l: rgba(255, 255, 255, .1); --edge-r: rgba(255, 255, 255, .1);
  position: relative;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
}

/* Рамка по кромке пиксельного среза — общая для блоков и кнопок.
   Цвета задаются через --edge-l / --edge-r, размер среза — через --cut */
.btn::after, .panel::after, .card::after, .map-frame::after, .status-card::after, .flash::after, .menu-nav::after,
dialog.modal::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--edge-l), var(--edge-l)) 0 var(--cut) / calc(var(--cut) + 1px) 1px,
    linear-gradient(var(--edge-l), var(--edge-l)) var(--cut) 0 / 1px calc(var(--cut) + 1px),
    linear-gradient(var(--edge-l), var(--edge-l)) 0 calc(100% - var(--cut)) / calc(var(--cut) + 1px) 1px,
    linear-gradient(var(--edge-l), var(--edge-l)) var(--cut) 100% / 1px var(--cut),
    linear-gradient(var(--edge-r), var(--edge-r)) 100% var(--cut) / calc(var(--cut) + 1px) 1px,
    linear-gradient(var(--edge-r), var(--edge-r)) calc(100% - var(--cut)) 0 / 1px calc(var(--cut) + 1px),
    linear-gradient(var(--edge-r), var(--edge-r)) 100% calc(100% - var(--cut)) / calc(var(--cut) + 1px) 1px,
    linear-gradient(var(--edge-r), var(--edge-r)) calc(100% - var(--cut)) 100% / 1px var(--cut);
  background-repeat: no-repeat;
}

.card { padding: 24px; }
.narrow { max-width: 480px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Кнопки: как в меню, три размера ----------
   Углы вырезаны квадратом --cut, по кромке выреза — линия 1px (рисует ::after поверх border). */
.btn {
  --cut: 6px;
  --edge-l: var(--brand-edge); --edge-r: var(--brand-edge-dark);
  --fill: linear-gradient(106.72deg, var(--brand) 0%, var(--brand-dark) 100%);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 44px; padding: 0 20px;
  font: 900 14px/1.09 var(--font); color: #fff; white-space: nowrap;
  text-decoration: none !important; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .1);
  background: var(--fill);
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.12); }
/* Обводка снаружи срезалась бы clip-path, поэтому фокус рисуем внутри */
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.btn:has(.btn-icon) { padding-left: 16px; }

.btn-ghost {
  --edge-l: #3f3f3f; --edge-r: #3f3f3f;
  --fill: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .05);
}
.btn-danger {
  --edge-l: #f37a7a; --edge-r: #d65252;
  --fill: linear-gradient(106.72deg, var(--danger) 0%, var(--danger-dark) 100%);
}
.btn-twitch { /* вход через Twitch — основной стиль, как «Авторизация» в меню */ }

.btn-sm { --cut: 5px; height: 34px; padding: 0 14px; font-size: 13px; }
.btn-sm:has(.btn-icon) { padding-left: 10px; }
.btn-lg { --cut: 7px; height: 52px; padding: 0 28px; font-size: 16px; gap: 6px; }
.btn-lg:has(.btn-icon) { padding-left: 22px; }

.btn.disabled, .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.btn-icon { display: block; width: 20px; height: 20px; padding: 2.9px 3.3px; flex-shrink: 0; }
.btn-icon.icon-login { transform: rotate(90deg); }

.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font: inherit; }
.link:hover { color: var(--danger); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Меню ---------- */
.site-header { padding-top: 40px; position: relative; z-index: 10; }
.menu {
  position: relative; height: 80px;
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px 0 15px;
}
/* Фон отдельным слоем: он обрезается по пиксельным углам, а шляпа может свисать ниже панели */
.menu-bg {
  --cut: 8px;
  position: absolute; inset: 0; overflow: hidden; z-index: -1;
  background: linear-gradient(94deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0));
  backdrop-filter: blur(9.5px); -webkit-backdrop-filter: blur(9.5px);
}
.menu-bg::before, .menu-bg::after {
  content: ""; position: absolute; width: 83px; height: 83px; border-radius: 50%; filter: blur(54px);
}
.menu-bg::before { background: var(--glow-cyan); right: -42px; top: -1px; }
.menu-bg::after { background: var(--glow-navy); right: 70px; bottom: -35px; }

.menu-logo { display: flex; align-items: center; gap: 10px; align-self: stretch; text-decoration: none !important; flex-shrink: 0; }
.menu-logo-hat { align-self: flex-start; margin-top: 15px; width: 53px; height: 82px; }
.menu-logo-text { display: flex; flex-direction: column; font: 900 15px/1.2 var(--font); }
.menu-logo-top { color: rgba(255, 255, 255, .5); }
.menu-logo-bottom { color: #fff; }

.menu-nav {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 30px;
}
.menu-nav a { font: 900 14px/1.09 var(--font); color: #fff; text-decoration: none; transition: color .15s; }
.menu-nav a:hover { color: var(--brand-edge); }
.menu-nav a[aria-current="page"] { color: var(--brand-edge); }

.menu-actions { margin-left: auto; display: flex; gap: 10px; }
.menu-actions .btn { padding-right: 20px; }
.menu-profile { padding-left: 10px !important; gap: 8px; }
.menu-profile[aria-current="page"] { --fill: rgba(255, 255, 255, .16); }
.menu-avatar { width: 24px; height: 24px; border-radius: 50%; }

.menu-toggle { display: none; padding: 0 13px !important; }
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: #fff; position: relative; transition: transform .2s, opacity .2s;
}
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu.is-open .menu-toggle-bars { background: transparent; }
.menu.is-open .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu.is-open .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Уже полной ширины контейнера навигация уходит в выпадающую панель — иначе 5–6 пунктов наползут на кнопки */
@media (max-width: 1180px) {
  .menu { gap: 12px; }
  .menu-toggle { display: inline-flex; order: 3; }
  .menu-nav {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 8px); transform: none;
    --cut: 8px;
    flex-direction: column; gap: 0; padding: 8px;
    /* Лежит поверх страницы, поэтому непрозрачный: #191919 = белый 5% поверх фона */
    background: #191919; border: 1px solid rgba(255, 255, 255, .1);
    --edge-l: rgba(255, 255, 255, .1); --edge-r: rgba(255, 255, 255, .1);
  }
  .menu.is-open .menu-nav { display: flex; }
  .menu-nav a { padding: 14px 12px; }
}
@media (max-width: 600px) {
  .site-header { padding-top: 16px; }
  .menu { height: 64px; padding: 0 10px 0 8px; }
  .menu-logo-hat { margin-top: 8px; width: 40px; height: 62px; }
  .menu-logo-text { font-size: 13px; }
  .menu-actions { gap: 6px; }
  .menu-actions .btn { padding: 0 12px; }
  /* На телефоне у «Лаунчера» и профиля остаются только иконка и аватар */
  .menu-actions .btn-ghost { font-size: 0; gap: 0; }
}

/* ---------- Страница ---------- */
/* main.wrap сильнее .wrap — иначе .wrap обнулит вертикальные отступы. 48px сверху — с запасом под свисающую шляпу */
main.wrap { padding-top: 48px; padding-bottom: 48px; }
.footer { color: var(--muted); font-size: 14px; padding-bottom: 32px; }

.flash {
  --cut: 6px;
  padding: 12px 16px 12px 19px; margin-bottom: 16px;
  box-shadow: inset 3px 0 0 var(--flash-color);
}
.flash-ok { --flash-color: var(--online); }
.flash-error { --flash-color: var(--danger); }

.hero { text-align: center; padding: 32px 0 40px; }
.hero h1 { font-size: clamp(40px, 8vw, 72px); margin: 0 0 12px; letter-spacing: .5px; }
.lead { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 auto 24px; }
.hero .actions { justify-content: center; margin-top: 24px; }

.status-card {
  --cut: 6px;
  display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; padding: 10px 20px;
}
.status-card .small { flex-basis: 100%; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; }
.dot-on { background: var(--online); box-shadow: 0 0 8px var(--online); }
.dot-off { background: var(--danger); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.steps h3 { margin: 12px 0 8px; }
.steps p { margin: 0; color: var(--muted); }
.step-num {
  --cut: 4px;
  width: 32px; height: 32px; display: grid; place-items: center;
  background: linear-gradient(106.72deg, var(--brand) 0%, var(--brand-dark) 100%);
  font-weight: 900; color: #fff;
}

.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { margin-top: 0; }
.prose li { margin-bottom: 6px; }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.form input:not([type=radio]):not([type=file]), .inline-form input:not([type=radio]) {
  --cut: 5px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: var(--text);
  padding: 11px 14px; font: 500 16px/1.2 var(--font);
}
.form input:focus, .inline-form input:focus {
  outline: none; border-color: var(--brand-edge); background: rgba(45, 159, 204, .08);
}
.form input[type=file] { font: 500 14px var(--font); color: var(--muted); }
.form input[type=file]::file-selector-button {
  font: 900 13px var(--font); color: #fff; cursor: pointer; margin-right: 12px;
  height: 34px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .05); background: rgba(255, 255, 255, .1);
}
input[type=radio] { accent-color: var(--brand); }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }

.twitch-who { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.twitch-who img { width: 48px; height: 48px; border-radius: 50%; }
.nick { margin: 0; }

/* ---------- Профиль ---------- */
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.skin-card { display: grid; place-items: center; align-content: center; min-height: 380px; }
.skin-empty { color: var(--muted); text-align: center; }
.skin-note { text-align: center; margin: 4px 0 0; }
.skin-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
#skin-turn { font-size: 16px; padding: 0 12px; }

.presence { display: flex; align-items: center; margin: 14px 0 0; color: var(--muted); font-weight: 700; }
.presence.is-online { color: var(--online); }
.dot-off-soft { background: rgba(255, 255, 255, .25); }
.looks-tight { margin-top: 6px; }

/* ---------- Голова игрока из скина (макрос mc_head) ---------- */
.mc-head {
  --s: 4;
  position: relative; display: inline-block; flex-shrink: 0; vertical-align: middle;
  width: calc(8px * var(--s)); height: calc(8px * var(--s));
  background-size: calc(64px * var(--s)) auto; background-position: calc(-8px * var(--s)) calc(-8px * var(--s));
  background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges;
}
/* Второй слой (шапка, волосы) — чуть крупнее, как в игре */
.mc-head::after {
  content: ""; position: absolute; inset: calc(-0.5px * var(--s));
  background-image: inherit; background-repeat: no-repeat; image-rendering: inherit;
  background-size: calc(64px * var(--s) * 9 / 8) auto;
  background-position: calc(-40px * var(--s) * 9 / 8) calc(-8px * var(--s) * 9 / 8);
}
.mc-head-empty { background: rgba(255, 255, 255, .1); }
.mc-head-empty::after { content: none; }
.mc-head-fallback { border-radius: 4px; flex-shrink: 0; }

/* ---------- Топ по онлайну ---------- */
.top-card { margin-top: 16px; }
.top-card h2 { margin: 0; }
.top-list { list-style: none; margin: 12px 0 0; padding: 0; }
.top-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.top-row:last-child { border-bottom: 0; }
.top-place { width: 28px; text-align: center; font-weight: 900; font-size: 18px; color: var(--muted); }
.top-name { color: #fff; font-weight: 800; }
.top-row .dot { margin: 0; }
.top-time { margin-left: auto; font-weight: 800; color: var(--brand-edge); }

/* ---------- Игроки ---------- */
.page-head { margin-bottom: 16px; }
.page-head .page-title { margin: 0; }
.online-count { color: var(--online); }
.players-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.player-card { display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--text); text-decoration: none !important; }
.player-card:hover { background: rgba(255, 255, 255, .08); }
.player-card.is-online { --edge-l: rgba(90, 196, 108, .5); --edge-r: rgba(90, 196, 108, .5); border-color: rgba(90, 196, 108, .5); }
.player-card-body { display: flex; flex-direction: column; min-width: 0; }
.player-card-name { font-weight: 900; font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.player-card-seen { font-size: 13px; color: var(--muted); display: flex; align-items: center; }
.player-card.is-online .player-card-seen { color: var(--online); }
.player-card-meta { display: flex; gap: 14px; font-size: 13px; margin-top: 4px; font-weight: 700; }

/* ---------- Скриншоты ---------- */
.shot-grid { columns: 3 300px; column-gap: 12px; }
.shot-grid-small { columns: 4 180px; }
.shot { break-inside: avoid; margin: 0 0 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.shot img { display: block; width: 100%; height: auto; }
.shot-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; font-size: 14px; }
.shot-author { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; }
.shot-caption { color: var(--muted); flex-basis: 100%; }
.shot figcaption form { margin-left: auto; }
.my-shots { margin-bottom: 16px; }
.my-shots h2 { margin-top: 0; }
dialog.lightbox { width: min(1400px, calc(100vw - 32px)); padding: 12px; }
dialog.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 140px); margin: 0 auto; }
dialog.lightbox .modal-close { position: absolute; right: 12px; top: 6px; z-index: 1; text-shadow: 0 0 6px #000; }
.lightbox-caption { margin: 10px 4px 0; }
.lightbox-caption a { font-weight: 800; color: #fff; }

/* Модерация в админке */
.review-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.review-item { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-thumb { flex-shrink: 0; width: 240px; }
.review-thumb img { display: block; width: 100%; height: auto; }
.review-body { min-width: 0; flex: 1; }
.review-caption { margin: 6px 0; }
@media (max-width: 640px) { .review-item { flex-direction: column; } .review-thumb { width: 100%; } }

/* ---------- Значки ---------- */
.badges-card { margin-top: 16px; }
.badges-card h2 { margin: 0; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }
.badge-tile {
  --cut: 6px;
  --tier: rgba(255, 255, 255, .35);
  display: grid; grid-template-columns: 40px 1fr; grid-auto-rows: auto; column-gap: 10px; align-content: start;
  padding: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--tier) 22%, transparent), rgba(255, 255, 255, .03) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier) 45%, transparent);
}
/* Иконка — слева на всю высоту, весь текст — во второй колонке */
.badge-tile > :not(.badge-icon) { grid-column: 2; }
.badge-icon {
  grid-column: 1; grid-row: 1 / span 5; width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--tier) 25%, rgba(0, 0, 0, .3));
}
.badge-name { font-weight: 900; font-size: 14px; line-height: 1.2; }
.badge-desc { font-size: 12px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.badge-tier { font-size: 11px; font-weight: 800; color: var(--tier); text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }
.badge-progress { height: 4px; background: rgba(255, 255, 255, .1); margin-top: 8px; }
.badge-progress > span { display: block; height: 100%; background: var(--brand-edge); }
.badge-progress-text { font-size: 11px; color: var(--muted); margin-top: 4px; }
.tier-common { --tier: #9aa4b2; }
.tier-rare { --tier: #2d9fcc; }
.tier-epic { --tier: #a66cff; }
.tier-legendary { --tier: #f2b33d; }
.tier-special { --tier: #5ac46c; }
.badge-tile.is-locked { background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.badge-tile.is-locked .badge-icon { filter: grayscale(1); opacity: .35; background: rgba(255, 255, 255, .05); }
.badge-tile.is-locked .badge-name { color: rgba(255, 255, 255, .6); }

.looks { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 20px 0 0; }
.looks dt { color: var(--muted); }
.looks dd { margin: 0; font-weight: 700; }

/* ---------- Всплывающие окна ---------- */
dialog.modal {
  --cut: 8px;
  --edge-l: rgba(255, 255, 255, .1); --edge-r: rgba(255, 255, 255, .1);
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; overflow-x: hidden;
  padding: 20px 24px 24px; color: var(--text);
  background: #191919; border: 1px solid rgba(255, 255, 255, .1);
}
dialog.modal-wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.modal h3 { margin: 20px 0 10px; font-size: 16px; }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: #fff; }

/* Мини-превью официальных плащей: лицевая сторона 10×16, пиксель текстуры = 4×4 */
.cape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cape-option {
  --cut: 5px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid transparent; color: var(--text); cursor: pointer;
  font: 700 12px/1.2 var(--font); text-align: center;
}
.cape-option:hover { background: rgba(255, 255, 255, .1); }
.cape-option.is-current { background: rgba(45, 159, 204, .2); border-color: var(--brand-edge); }
.cape-mini {
  width: 40px; height: 64px;
  background-size: 256px 128px; background-position: -4px -4px; background-repeat: no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* Плащ: лицевая сторона — область 10×16 в точке (1,1) текстуры 64×32, каждый пиксель 10×10 без сглаживания */
.cape-row { display: flex; gap: 20px; align-items: flex-start; }
.cape-controls { flex: 1; min-width: 0; }
.cape-controls .form { margin-top: 0; }
.cape-preview {
  --cut: 6px;
  flex-shrink: 0; width: 100px; height: 160px;
  background-size: 640px 320px; background-position: -10px -10px; background-repeat: no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.cape-preview-empty {
  display: grid; place-items: center; text-align: center;
  background: rgba(255, 255, 255, .05); border: 1px dashed rgba(255, 255, 255, .15);
  color: var(--muted); font-size: 13px; line-height: 1.3;
}
@media (max-width: 520px) { .cape-row { flex-direction: column; } }
.advanced { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.advanced summary { cursor: pointer; color: var(--muted); }
.logout { margin-top: 24px; }

/* ---------- Карта: на всю ширину и оставшуюся высоту под меню (40 + 80px) ---------- */
main.map-main { padding: 24px var(--gutter) var(--gutter); }
.map-main .flash { margin: 16px; }
.map-frame { height: calc(100vh - 160px); min-height: 400px; }
.map-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.map-open { position: absolute; right: 16px; bottom: 16px; }

/* ---------- Админка ---------- */
.page-title { margin: 0 0 16px; }
.admin-section { margin-bottom: 16px; }
.admin-section h2 { margin-top: 0; }
.admin-section h3 { margin: 24px 0 4px; font-size: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.inline-form input:not([type=radio]) { padding: 0 10px; height: 34px; font-size: 14px; }
.pill { --cut: 4px; background: rgba(255, 255, 255, .08); padding: 6px 12px; cursor: pointer; }
.pill:has(input:checked) { background: rgba(45, 159, 204, .22); }
.table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .right { text-align: right; }
.nowrap { white-space: nowrap; }
.row-banned td { opacity: .65; }
.player { display: flex; gap: 10px; align-items: center; }
.player img { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.player-link { color: #fff; }
.badge {
  --cut: 3px;
  display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; margin: 0 4px 4px 0;
  background: rgba(255, 255, 255, .08);
}
.badge-admin { background: rgba(45, 159, 204, .22); color: #8fd6f2; }
.badge-banned { background: rgba(239, 91, 91, .2); color: #ff9d9d; }
.badge-online { background: rgba(90, 196, 108, .2); color: #9fe3ac; }
.actions-menu summary { cursor: pointer; color: var(--muted); }
.actions-body { padding-top: 8px; min-width: 300px; }

@media (max-width: 720px) {
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .skin-card { min-height: 0; }
}
