/* stormrust.ru — публичная страница сервера (вход, онлайн, подключение).
   Тема «графит и ржавчина», как у панели panel.stormrust.ru (workspace/panel-web/css/tokens.css). */

:root {
  --bg: #121315;
  --bg-sunken: #0e0f10;
  --bg-card: #18191c;
  --bg-raised: #1d1f22;
  --bg-hover: #25282c;
  --border: #2c2f34;
  --border-strong: #3a3e44;
  --line-soft: rgba(255, 255, 255, 0.06);

  /* --cyan — историческое имя акцента: на него ссылаются call.css и разметка */
  --cyan: #e8622c;
  --accent: #e8622c;
  --accent-hover: #ff7a42;
  --accent-ink: #170a04;
  --accent-soft: rgba(232, 98, 44, 0.12);
  --green: #6aa84f;
  --green-text: #a9d68f;
  --red: #d8473b;
  --red-text: #f2a097;
  --amber: #d9a23a;
  --amber-text: #f0c978;
  --steel: #6f9ac2;

  --text: #ece8e1;
  --text-2: #a9a39a;
  --text-3: #747069;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --head: 'Oswald', 'Inter', "Arial Narrow", sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --radius: 4px;
  --radius-lg: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  /* мелкая диагональная штриховка — «металл» без картинок */
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #17181b 0%, var(--bg) 420px) fixed,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------------------------------------------------------------- шапка */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 15, 16, 0.92);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* слева — бренд и общие для всех ссылки (магазин, Discord), справа — вход и кнопка панели */
.top-left { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.top-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.brand { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase; }
.brand span { color: var(--accent); }

.auth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user { display: flex; align-items: center; gap: 10px; }
.user img, .user .avatar-empty { width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border-strong); }
.user .avatar-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--bg-raised); }
.user-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------------------------------------------------------------- карточки */

.main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px 16px; }

.card {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
/* оранжевая метка в углу — как заклёпка на листе */
.card::before { content: ''; position: absolute; top: -2px; left: 0; width: 56px; height: 2px; background: var(--accent); }

.server-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.server-head h1 { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }

.dot { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--text-3); }
.dot.online { background: var(--green); box-shadow: 0 0 10px rgba(106, 168, 79, 0.7); }
.dot.offline { background: var(--red); }

.online-label { font-family: var(--head); font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.12em; }
.connect-label { font-size: 13px; color: var(--text-2); }
.online-value { font-family: var(--head); font-size: 56px; font-weight: 700; line-height: 1.1; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.online-max { font-size: 24px; color: var(--text-3); font-weight: 500; }
.bar { height: 8px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(135deg, var(--accent) 0 8px, #c94f1f 8px 16px);
  transition: width 0.6s;
}

.connect { margin-top: 26px; display: grid; gap: 10px; }
.connect-row { display: flex; gap: 10px; flex-wrap: wrap; }
.connect-row code {
  flex: 1 1 240px;
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-hover);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------------------------------------------------------------- кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 14px var(--font);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-steam { background: #4c6b22; border-color: #6f9a2e; color: #eef5e0; }
.btn-steam:hover { background: #5a7f28; }
/* кнопка панели (panel.stormrust.ru) — у всех вошедших */
.btn-panel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); font-weight: 700; }
.btn-panel:hover { background: var(--accent); color: var(--accent-ink); }
.btn-out { background: transparent; border-color: rgba(216, 71, 59, 0.55); color: var(--red-text); }
.btn-out:hover { background: rgba(216, 71, 59, 0.12); }
.btn-shop { background: var(--bg-raised); border-color: var(--amber); color: var(--amber-text); }
.btn-shop:hover { background: rgba(217, 162, 58, 0.14); }
.btn-discord { background: var(--bg-raised); border-color: #5865f2; color: #c3c8fb; }
.btn-discord:hover { background: rgba(88, 101, 242, 0.16); }

/* ---------------------------------------------------------------- статистика игроков (/api/public/players/*) */

.pstats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pstats-head h2 { font-size: 19px; }
.sub-title { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0.12em; margin: 22px 0 10px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg-btn { background: transparent; border: 0; color: var(--text-2); font: 600 13px var(--font); padding: 7px 12px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.seg-btn:hover { color: var(--text); background: var(--bg-hover); }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-wide { display: flex; margin-bottom: 10px; }
.seg-wide .seg-btn { flex: 1 1 auto; padding: 8px 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--bg-sunken); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; }
.tile-label { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.06em; text-transform: uppercase; }
.tile-value { font-family: var(--head); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.tile-rank { font-size: 12px; color: var(--text-3); }
.tile-rank b { color: var(--accent); }
.breakdown { margin-top: 12px; }
.breakdown .seg { margin-bottom: 8px; }
.bd-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; max-height: 260px; overflow-y: auto; }
.bd-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.bd-list .n { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-list .a { font-weight: 700; font-variant-numeric: tabular-nums; }
.my-login { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); font-size: 14px; }
.muted { color: var(--text-3); font-size: 14px; }
.toplist { list-style: none; display: grid; gap: 4px; }
.toplist li { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--bg-sunken); border: 1px solid var(--line-soft); overflow: hidden; font-size: 14px; }
.toplist .fill { position: absolute; inset: 0 auto 0 0; background: rgba(232, 98, 44, 0.1); pointer-events: none; }
.toplist .rank { position: relative; flex: none; width: 24px; font-family: var(--head); font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.toplist li:nth-child(1) .rank { color: #f0c978; }
.toplist li:nth-child(2) .rank { color: #cfd2d6; }
.toplist li:nth-child(3) .rank { color: #d08a52; }
.toplist .name { position: relative; flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist .val { position: relative; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.toplist .empty { color: var(--text-3); justify-content: center; }
.pstats-note { font-size: 12px; color: var(--text-3); margin-top: 12px; }

/* ---------------------------------------------------------------- медиа: демки и запросы монет (роль «Медиа») */

.media-hint { font-size: 14px; color: var(--text-2); line-height: 1.5; margin-bottom: 12px; }
.media code, .media-hint code { font-family: var(--mono); font-size: 13px; color: var(--accent-hover); background: var(--bg-sunken); padding: 1px 5px; border-radius: 2px; }
.media-guide { margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--bg-sunken); border: 1px solid var(--border); font-size: 14px; color: var(--text-2); line-height: 1.5; }
.media-guide summary { cursor: pointer; font-weight: 700; color: var(--text); }
.media-guide ol { margin: 8px 0 2px; padding-left: 20px; display: grid; gap: 6px; }
.media-guide b { color: var(--text); }
.media-guide code { overflow-wrap: anywhere; }
.media-list { list-style: none; display: grid; gap: 6px; }
.media-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-sunken); border: 1px solid var(--line-soft); font-size: 14px; }
.media-list .empty { color: var(--text-3); justify-content: center; }
.media-list .m-main { flex: 1 1 220px; min-width: 0; }
.media-list .m-title { font-weight: 700; overflow-wrap: anywhere; }
.media-list .m-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow-wrap: anywhere; }
.media-list .m-actions { display: flex; gap: 6px; }
.media-form { display: grid; gap: 10px; }
.media-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.media-form input, .media-form textarea { width: 100%; padding: 9px 11px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg-sunken); color: var(--text); font: 14px var(--font); resize: vertical; }
.media-form input:focus, .media-form textarea:focus { outline: none; border-color: var(--accent); }
.media-form .btn { justify-self: start; }
.st { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 2px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
.st-pending { background: rgba(217, 162, 58, 0.15); color: var(--amber-text); }
.st-approved { background: rgba(106, 168, 79, 0.15); color: var(--green-text); }
.st-rejected { background: rgba(216, 71, 59, 0.15); color: var(--red-text); }

/* ---------------------------------------------------------------- голосование за карту вайпа */

.vote-when { font-size: 13px; color: var(--amber-text); font-weight: 700; }
.vote-hint { font-size: 14px; color: var(--text-2); margin: 10px 0 14px; line-height: 1.5; }
.vote-hint a, .vote-count a { color: var(--accent-hover); }
.vote-list { display: grid; gap: 8px; }
.vote-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-sunken); }
.vote-item.mine { border-color: var(--accent); background: var(--accent-soft); }
.vote-item img, .vote-noimg { width: 84px; height: 84px; flex: none; border-radius: var(--radius); object-fit: cover; }
.vote-noimg { display: grid; place-items: center; background: var(--bg-raised); font-size: 28px; }
.vote-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.vote-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.vote-name span { font-weight: 600; font-size: 12px; color: var(--text-3); }
.vote-bar { height: 6px; border-radius: 1px; background: var(--bg-raised); overflow: hidden; }
.vote-bar div { height: 100%; background: var(--accent); }
.vote-count { font-size: 12.5px; color: var(--text-2); }

/* ---------------------------------------------------------------- подвал и всплывашка */

.foot { color: var(--text-3); font-size: 12px; text-align: center; padding: 18px 16px 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.foot a { color: var(--text-2); }
.foot a:hover { color: var(--accent-hover); }
.foot div { flex-basis: 100%; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.danger { border-left-color: var(--red); }

@media (max-width: 480px) {
  .top { padding: 12px 16px; }
  .card { padding: 20px 18px; }
  .online-value { font-size: 44px; }
  .tile-value { font-size: 20px; }
  .user-role { display: none; }
  .vote-item { flex-wrap: wrap; }
  .vote-item img, .vote-noimg { width: 64px; height: 64px; }
  .vote-item .btn { width: 100%; }
}
