/* EonRise — базовая дизайн-система «voxel court»: глубокий фиолетовый, аметистовые панели
   с пиксельными (ступенчатыми) углами и золотой окантовкой. Общая для сайта, форума и панели. */
:root {
  --bg: #09051a;
  --bg-2: #0f0a22;
  --panel: #161030;
  --panel-2: #1e1542;
  --raise: #291b58;
  --amrgb: 155, 92, 255;
  --goldrgb: 255, 201, 77;
  --line: rgba(185, 146, 255, 0.15);
  --line-2: rgba(185, 146, 255, 0.3);
  --text: #f8f3ff;
  --muted: #a99dc9;
  --dim: #74689a;
  --accent: #9b5cff;
  --accent-2: #6a37d6;
  --accent-3: #c39bff;
  --gold: #ffc94d;
  --gold-2: #ffe596;
  --gold-3: #ff9f1c;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #ff6b8a;
  --info: #6fd3ff;
  --radius: 10px;
  --font: 'Onest', 'Inter', system-ui, sans-serif;
  --font-d: 'Unbounded', 'Montserrat', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-d); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--raise); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.gold { color: var(--gold); }
.mono { font-family: var(--font-m); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grad { background: linear-gradient(100deg, #fff1b8, var(--gold) 35%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-am { background: linear-gradient(100deg, #fff, var(--accent-3) 45%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- пиксельные углы ----------
   Элемент заливается цветом кромки, ::before (inset 2px) — заливкой панели.
   --edge / --fill переопределяются вариантами. */
.px, .card, .modal {
  --n: 6px;
  position: relative; isolation: isolate; background: var(--edge, var(--line-2));
  clip-path: polygon(0 var(--n), var(--n) var(--n), var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)));
}
.px::before, .card::before, .modal::before {
  content: ''; position: absolute; inset: 2px; z-index: -1; --n: 4px; background: var(--fill, var(--panel));
  clip-path: polygon(0 var(--n), var(--n) var(--n), var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)));
}
.px.gold, .card.gold { --edge: linear-gradient(135deg, #ffe08a, var(--gold) 40%, #b8730a); }
.px.am, .card.am { --edge: linear-gradient(135deg, var(--accent-3), var(--accent) 50%, var(--accent-2)); }
.px-s { --n: 4px; }
.px-s::before { --n: 2px; }
/* мягкая подсветка за курсором */
.glow-card::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--goldrgb), 0.14), transparent 70%); }
.glow-card:hover::after { opacity: 1; }
.glow-card > :not(.item-tools):not(.badge):not(.disc) { position: relative; z-index: 1; }

/* ---------- кнопки ---------- */
.btn {
  --n: 4px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; overflow: hidden; white-space: nowrap; user-select: none;
  font: 700 13px/1 var(--font-d); letter-spacing: 0.02em; color: var(--text);
  background: linear-gradient(180deg, #2c1d5e, #201448);
  clip-path: polygon(0 var(--n), var(--n) var(--n), var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)));
  transition: transform 0.2s, filter 0.2s;
}
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%); transform: translateX(-120%); transition: transform 0.6s; pointer-events: none; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-primary, .btn-gold { color: #2b1600; background: linear-gradient(180deg, var(--gold-2), var(--gold) 48%, var(--gold-3)); }
.btn-alt { color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent-2) 55%, color-mix(in srgb, var(--accent-2) 75%, #000)); }
.btn-white { color: #2b1600; background: linear-gradient(180deg, var(--gold-2), var(--gold) 48%, var(--gold-3)); }
.btn-ghost { background: transparent; color: var(--muted); clip-path: none; border-radius: 8px; }
.btn-ghost:hover { background: rgba(var(--amrgb), 0.14); color: var(--text); filter: none; }
.btn-ghost::after { display: none; }
.btn-danger { color: #fff; background: linear-gradient(180deg, #ff7d97, #d93a5f); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 11.5px; gap: 8px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 11px; gap: 6px; --n: 3px; }
.btn-lg { height: 56px; padding: 0 30px; font-size: 14px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-icon.btn-xs { width: 30px; }
.ibtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; color: var(--muted); transition: 0.2s; }
.ibtn:hover { color: var(--text); border-color: var(--accent-3); background: var(--panel-2); }

/* ---------- формы ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span, .label { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.field small { color: var(--dim); font-size: 12px; }
.input, .select, .textarea { width: 100%; height: 44px; padding: 0 13px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--panel); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-3); box-shadow: 0 0 0 3px rgba(var(--amrgb), 0.25); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .ic { position: absolute; left: 14px; color: var(--dim); pointer-events: none; z-index: 1; }
.input-group .input { padding-left: 40px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 40px; height: 22px; border-radius: 11px; background: var(--raise); border: 1px solid var(--line-2); transition: 0.2s; flex-shrink: 0; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: 0.2s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent-3); }
.switch input:checked + i::after { left: 20px; background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.color-input { display: flex; align-items: center; gap: 8px; }
.color-input input[type=color] { width: 44px; height: 44px; padding: 3px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; flex-shrink: 0; }

/* ---------- метки ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 11.5px var(--font-m); background: var(--raise); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.pill-ok { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.pill-err { background: rgba(255, 107, 138, 0.14); color: var(--err); }
.pill-warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.pill-accent { background: rgba(var(--amrgb), 0.22); color: var(--accent-3); }
.pill-gold { background: rgba(var(--goldrgb), 0.16); color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: ping 2s infinite; flex-shrink: 0; }
.dot.off { background: var(--err); animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

/* ---------- аватары (скин игрока, иначе пиксельное лицо) ---------- */
.ava { position: relative; display: inline-block; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--bg-2) center / cover no-repeat; image-rendering: pixelated; border: 1px solid var(--line-2); }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

/* ---------- модалки ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(5, 2, 14, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.25s; }
.modal-wrap.in { opacity: 1; }
.modal { --edge: var(--line-2); width: min(540px, 100%); margin: auto; padding: 30px 28px; transform: translateY(14px) scale(0.97); transition: transform 0.35s var(--ease); }
.modal-wrap.in .modal { transform: none; }
.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(860px, 100%); }
.modal-xl { width: min(1100px, 100%); }
.modal-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line-2); background: var(--panel); transition: 0.2s; z-index: 3; }
.modal-x:hover { color: var(--text); border-color: var(--accent-3); }
.modal-head { margin-bottom: 18px; padding-right: 44px; }
.modal-head h3 { font: 800 21px var(--font-d); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- тосты ---------- */
.toasts { position: fixed; z-index: 2000; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 10px; font-size: 14px; background: var(--raise); border: 1px solid var(--accent); box-shadow: var(--shadow); transform: translateY(14px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.3s; pointer-events: auto; }
.toast.in { transform: none; opacity: 1; }
.toast .ic { color: var(--gold); }
.toast-error { border-color: var(--err); }
.toast-error .ic { color: var(--err); }
.toast-info .ic { color: var(--accent-3); }

/* ---------- разное ---------- */
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--dim); margin: 0 auto 12px; display: block; }
.kbd { font-family: var(--font-m); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.spr { image-rendering: pixelated; }
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 600px) { .modal { padding: 24px 18px; } }

/* первый визит: страница ждёт содержимое с сервера (не дольше 2,5 с), чтобы не мелькали стандартные тексты */
html.eon-wait body > :not(.preloader):not(.toasts) { visibility: hidden; }
