/* Минималистичная тема: нейтральные тона, тонкие линии, один акцент.
   Светлая по умолчанию, тёмная — по системной настройке или переключателю. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --line: #e7e7e9;
  --line-soft: #f1f1f3;
  --text: #16171a;
  --muted: #74767d;
  --faint: #a1a3aa;
  --accent: #2b6cf6;
  --good: #1a7f4b;
  --bad: #c03030;
  --radius: 10px;
}

:root[data-theme='dark'],
:root:not([data-theme='light']) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1011;
    --surface: #151617;
    --surface-2: #1a1b1d;
    --line: #26282b;
    --line-soft: #1f2123;
    --text: #e8e9ea;
    --muted: #92959b;
    --faint: #6b6e74;
    --accent: #5b91ff;
    --good: #4ec98a;
    --bad: #ff7676;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1011;
  --surface: #151617;
  --surface-2: #1a1b1d;
  --line: #26282b;
  --line-soft: #1f2123;
  --text: #e8e9ea;
  --muted: #92959b;
  --faint: #6b6e74;
  --accent: #5b91ff;
  --good: #4ec98a;
  --bad: #ff7676;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------- Шапка ------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  height: 52px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 4px;
  height: 100%;
}

.tab {
  position: relative;
  padding: 0 4px;
  margin-right: 18px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--text);
}

.tab.has-news::before {
  content: "";
  position: absolute;
  top: 12px;
  right: -9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.status {
  color: var(--faint);
  font-size: 12.5px;
}

.status .sep {
  margin: 0 8px;
  opacity: 0.45;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--faint);
}

/* ------------------------------ Разметка ------------------------------ */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.placeholder {
  padding: 80px 0;
  text-align: center;
  color: var(--faint);
}

.section {
  margin-top: 36px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.section-note {
  color: var(--faint);
  font-size: 12.5px;
}

.row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.col {
  flex: 1 1 380px;
  min-width: 0;
}

.error-box {
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--bad);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------ Профиль ------------------------------ */
.profile {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.avatar-slot {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  flex: none;
}

.avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-slot .avatar-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  line-height: 1.25;
  padding: 0 6px;
}

.avatar-slot .avatar-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.15s;
}

.avatar-slot:hover .avatar-hover {
  opacity: 1;
}

.profile-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.profile-sub {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.server-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text);
}

.server-chip img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.server-chip .online {
  color: var(--faint);
}

.profile-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.kv {
  text-align: right;
}

.kv .k {
  color: var(--faint);
  font-size: 11.5px;
}

.kv .v {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

.kv .v img {
  width: 24px;
  height: 24px;
}

.link {
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
}

.link:hover {
  color: var(--accent);
}

.btn {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--faint);
}

.btn:disabled {
  color: var(--faint);
  cursor: default;
}

/* ------------------------------ Метрики ------------------------------ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Ровная сетка для больших полос статистики: 12 и 6 плиток делятся
   на 6, 3 и 2 без остатка, поэтому пустых ячеек в последнем ряду не бывает. */
.metrics.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1080px) {
  .metrics.grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 620px) {
  .metrics.grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric {
  padding: 10px 13px;
  background: var(--surface);
}

.metric .label {
  color: var(--faint);
  font-size: 11px;
}

.metric .value {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric .note {
  margin-top: 1px;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric .note.good {
  color: var(--good);
}

.metric .note.bad {
  color: var(--bad);
}

/* ------------------------------ Таблицы ------------------------------ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tfoot td {
  color: var(--muted);
  border-top: 1px solid var(--line);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.name {
  font-weight: 500;
}

.icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: -5px;
}

.icon.rank {
  border-radius: 0;
}

.map-thumb {
  width: 44px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
  vertical-align: -8px;
}

.good {
  color: var(--good);
}

.bad {
  color: var(--bad);
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.small {
  font-size: 12px;
}

.res {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.res::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bad);
}

.res.win::before {
  background: var(--good);
}

.tag-me {
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: var(--surface-2);
}

tr.clickable.open {
  background: var(--surface-2);
}

.chev {
  display: inline-block;
  margin-right: 8px;
  color: var(--faint);
  font-size: 9px;
  transition: transform 0.15s;
}

tr.clickable.open .chev {
  transform: rotate(90deg);
  color: var(--text);
}

td.detail-cell {
  padding: 0;
  background: var(--surface-2);
}

/* --------------------------- Детали игры --------------------------- */
.detail {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--line);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.detail-score {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.detail-score .sep {
  margin: 0 7px;
  color: var(--faint);
  font-weight: 400;
}

.team-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.team-head:first-of-type {
  margin-top: 0;
}

.team-head img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.team-head .side {
  font-weight: 400;
  color: var(--faint);
}

.team-head .team-score {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.detail .table-wrap {
  background: var(--surface);
}

tr.me-row td {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

tr.me-row .name {
  color: var(--accent);
}

.moments {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.moment {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.rounds {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.round {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--line-soft);
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.round.win {
  background: color-mix(in srgb, var(--good) 20%, transparent);
  color: var(--good);
}

.round.lose {
  background: color-mix(in srgb, var(--bad) 18%, transparent);
  color: var(--bad);
}

/* ---------------------- Форма, полосы, графики ---------------------- */
.form-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.form-chip {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.form-chip.win {
  background: color-mix(in srgb, var(--good) 18%, transparent);
  color: var(--good);
}

.bar-row {
  margin-bottom: 11px;
}

.bar-row .bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}

.bar-row .bar-top b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 4px;
  margin-top: 5px;
  border-radius: 2px;
  background: var(--line-soft);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.split-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0 10px;
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}

.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 6px;
}

svg.spark {
  display: block;
  width: 100%;
  height: 56px;
  margin-bottom: 6px;
}

/* ------------------------------- Лента ------------------------------- */
.feed {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow: auto;
}

.feed-item {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item time {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 760px) {
  header {
    padding: 0 16px;
  }
  main {
    padding: 20px 16px 60px;
  }
  .profile-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .kv {
    text-align: left;
  }
  .kv .v {
    justify-content: flex-start;
  }
}

/* ------------------------- Карточка ранга ------------------------- */
.rank-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rank-card img {
  width: 54px;
  height: 54px;
}

.rank-card .tier {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.rank-card .sub {
  color: var(--faint);
  font-size: 12px;
  margin-top: 2px;
}

/* --------------------- Любимый сет скинов --------------------- */
/* Семь пушек — на широком экране ставим их в один ряд, чтобы не оставалось
   полупустой второй строки. */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

@media (max-width: 1080px) {
  .skin-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 620px) {
  .skin-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skin-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.skin-card:hover {
  border-color: var(--faint);
}

.skin-card .w {
  color: var(--faint);
  font-size: 11.5px;
}

.skin-card .shot {
  height: 42px;
  display: grid;
  place-items: center;
}

.skin-card .shot img {
  max-width: 100%;
  max-height: 42px;
  object-fit: contain;
}

.skin-card .n {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skin-card .t {
  font-size: 11px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.skin-card .t i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.skin-card .empty {
  color: var(--faint);
  font-size: 12.5px;
}

/* -------------------------- Выбор скина -------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
}

.modal-box {
  display: flex;
  flex-direction: column;
  width: min(940px, 100%);
  max-height: 86vh;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head .title {
  font-weight: 600;
  white-space: nowrap;
}

.modal-head input {
  flex: 1;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.modal-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  padding: 14px 16px 18px;
  overflow: auto;
}

.skin-opt {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
}

.skin-opt:hover {
  border-color: var(--accent);
}

.skin-opt.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.skin-opt img {
  width: 100%;
  height: 36px;
  object-fit: contain;
}

.skin-opt .n {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.3;
}

.chroma-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

/* --------------------- Сравнение сторон --------------------- */
.vs-row {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.vs-row .vs-name {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: -4px;
  color: var(--faint);
  font-size: 11.5px;
}

.vs-row .right {
  text-align: right;
}

.vs-track {
  display: flex;
  height: 6px;
  gap: 3px;
}

.vs-track span {
  height: 100%;
  border-radius: 3px;
  background: var(--line-soft);
}

.vs-track .l {
  margin-left: auto;
  background: var(--accent);
}

.vs-track .r {
  background: var(--good);
}

/* ------------------------- Клатчи ------------------------- */
.clutch-row {
  display: grid;
  grid-template-columns: 42px 1fr 64px;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.clutch-row .label {
  color: var(--muted);
}

.clutch-row .count {
  text-align: right;
  color: var(--muted);
}

/* ------------------------- Мультикиллы ------------------------- */
.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
}

.mk {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: center;
}

.mk .v {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mk .k {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11.5px;
}

/* ----------------- Распределение попаданий в строке ----------------- */
.hit-bar {
  display: flex;
  height: 5px;
  width: 92px;
  border-radius: 3px;
  overflow: hidden;
  margin-left: auto;
}

.agent-stack {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.agent-stack img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

/* ========================= Личная страница ========================= */
.panel-two {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 980px) {
  .panel-two {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card + .card {
  margin-top: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-head .t {
  font-weight: 600;
  font-size: 13px;
}

.card-head .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --------------------------- Сейчас слушаю --------------------------- */
.np {
  display: flex;
  gap: 16px;
  align-items: center;
}

.np-cover {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.np-body {
  min-width: 0;
  flex: 1;
}

.np-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-artist {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-meta {
  margin-top: 3px;
  color: var(--faint);
  font-size: 12px;
}

.np-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.np-progress .bar {
  flex: 1;
  margin-top: 0;
}

.np-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--good);
  font-size: 12px;
}

.np-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  animation: blink 1.6s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.np-idle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 13px;
}

/* ------------------------- Закреплённое ------------------------- */
.pin {
  display: flex;
  gap: 14px;
  align-items: center;
}

.pin img.ava {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}

.pin-name {
  font-size: 15px;
  font-weight: 600;
}

.pin-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.dot-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.dot-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.dot-state.on::before {
  background: var(--good);
}

.dot-state.play::before {
  background: var(--accent);
}

.twitch-embed {
  margin-top: 12px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

.pin-thumb {
  margin-top: 12px;
  width: 100%;
  border-radius: 8px;
  display: block;
}

/* ---------------------------- Формы ---------------------------- */
.form-grid {
  display: grid;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  color: var(--faint);
  font-size: 11.5px;
}

.field input,
.field textarea {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.field textarea {
  resize: vertical;
  min-height: 56px;
}

.field .hint {
  color: var(--faint);
  font-size: 11.5px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.copy-line {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  word-break: break-all;
}

.steps {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.steps li {
  margin-bottom: 4px;
}

.modal-body.wide {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.arcana-opt {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.arcana-opt:hover {
  border-color: var(--accent);
}

.arcana-opt.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.arcana-opt img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  background: var(--surface-2);
  display: block;
}

.arcana-opt .n {
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
}

/* ===================== Личная страница: шапка ===================== */
.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 20px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(26px) saturate(1.2);
  transform: scale(1.25);
  opacity: 0.4;
}

.hero-bg.plain {
  background: linear-gradient(120deg, var(--surface-2), var(--surface));
  filter: none;
  transform: none;
  opacity: 1;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), var(--bg));
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 24px;
}

.avatar-slot.big {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
}

.hero-main {
  min-width: 0;
  flex: 1;
}

.hero-title {
  margin: 0;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hero-bio {
  margin: 6px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: text;
  border-radius: 6px;
}

.hero-bio.empty {
  color: var(--faint);
  font-style: italic;
}

.hero-bio:hover {
  color: var(--text);
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(6px);
}

.hs img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.hs b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.hs span {
  display: block;
  color: var(--faint);
  font-size: 11.5px;
}

/* ===================== Личная страница: сетка ===================== */
.personal-stack {
  margin-top: 16px;
}

.personal-stack > .card + .card {
  margin-top: 16px;
}

/* Список игр раскладываем в две колонки — карточка во всю ширину это позволяет. */
.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px 16px;
}





/* ===================== Арканы: крупные карточки ===================== */
.arcana-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

/* Арканов семь — на узких экранах последнюю растягиваем, чтобы ряд был полным. */
@media (max-width: 1180px) {
  .arcana-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .arcana:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .arcana-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.arcana {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  transition: transform 0.18s, border-color 0.18s;
}

.arcana:hover {
  transform: translateY(-3px);
  border-color: var(--faint);
}

.arcana img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-2);
}

.arcana figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #fff;
}

.arcana figcaption .n {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.arcana figcaption .h {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  opacity: 0.75;
}

.arcana-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}

.arcana:hover .arcana-actions {
  opacity: 1;
}

.mini {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.mini:hover {
  background: var(--accent);
}

/* ========================= Баннер в шапке ========================= */
.hero-bg.banner {
  filter: none;
  transform: none;
  opacity: 1;
}

.hero-card.has-banner {
  min-height: 190px;
}

.hero-card.has-banner::after {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 25%, transparent),
    color-mix(in srgb, var(--bg) 82%, transparent) 65%,
    var(--bg)
  );
}

.hero-card.has-banner .hero-inner {
  padding-top: 64px;
}

.banner-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}

.hero-card:hover .banner-actions {
  opacity: 1;
}

/* ===================== Панели платформ ===================== */
:root {
  --c-spotify: #1aa34a;
  --c-steam: #1a73a8;
  --c-twitch: #7b2ff7;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --c-spotify: #1ed760;
    --c-steam: #66c0f4;
    --c-twitch: #a970ff;
  }
}

:root[data-theme='dark'] {
  --c-spotify: #1ed760;
  --c-steam: #66c0f4;
  --c-twitch: #a970ff;
}

.card.brand {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 9%, transparent), transparent 140px),
    var(--surface);
}

.card.brand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand);
  opacity: 0.85;
}

.brand-spotify {
  --brand: var(--c-spotify);
}

.brand-steam {
  --brand: var(--c-steam);
}

.brand-twitch {
  --brand: var(--c-twitch);
}

.brand-ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
  flex: none;
}

.brand-ic svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.card.brand .card-head .t {
  color: var(--brand);
}

.card.brand .np-live {
  color: var(--brand);
}

.card.brand .np-live::before {
  background: var(--brand);
}

.card.brand .dot-state.on::before,
.card.brand .dot-state.play::before {
  background: var(--brand);
}

/* ============================ Снег ============================ */
/* Три слоя точек, двигаются трансформом — браузер рисует их на видеокарте,
   поэтому на загрузку страницы это практически не влияет. */
.snow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
}

.snow i {
  position: absolute;
  top: -120%;
  left: 0;
  width: 100%;
  height: 220%;
  background-repeat: repeat;
  will-change: transform;
  animation: snowfall linear infinite;
}

.snow i:nth-child(1) {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 8%, var(--snow) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 38% 22%, var(--snow) 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 67% 14%, var(--snow) 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 85% 30%, var(--snow) 50%, transparent 52%);
  background-size: 420px 420px;
  animation-duration: 34s;
}

.snow i:nth-child(2) {
  background-image:
    radial-gradient(2.4px 2.4px at 22% 16%, var(--snow) 50%, transparent 52%),
    radial-gradient(2px 2px at 54% 40%, var(--snow) 50%, transparent 52%),
    radial-gradient(2.6px 2.6px at 78% 8%, var(--snow) 50%, transparent 52%);
  background-size: 560px 560px;
  animation-duration: 24s;
  opacity: 0.8;
}

.snow i:nth-child(3) {
  background-image:
    radial-gradient(3.4px 3.4px at 30% 28%, var(--snow) 50%, transparent 52%),
    radial-gradient(3px 3px at 72% 56%, var(--snow) 50%, transparent 52%);
  background-size: 760px 760px;
  animation-duration: 17s;
  opacity: 0.6;
}

@keyframes snowfall {
  from {
    transform: translate3d(0, -14%, 0);
  }
  to {
    transform: translate3d(28px, 14%, 0);
  }
}

:root {
  --snow: rgba(90, 120, 160, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --snow: rgba(255, 255, 255, 0.75);
  }
}

:root[data-theme='dark'] {
  --snow: rgba(255, 255, 255, 0.75);
}

/* Кому анимация мешает — снег просто замирает. */
@media (prefers-reduced-motion: reduce) {
  .snow i {
    animation: none;
  }
}

header,
main {
  position: relative;
  z-index: 1;
}

/* ===================== Игры в панели Steam ===================== */
.game-now {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  vertical-align: -3px;
  margin-right: 2px;
}

.games {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.games-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 11.5px;
  color: var(--faint);
}

.game {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}

a.game:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.game img,
.game-logo-empty {
  width: 46px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-2);
  flex: none;
}

.game-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-hours {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.game.recent .game-hours {
  color: var(--brand);
}

.steam-hint {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  line-height: 1.5;
}

/* ===================== Режим гостя ===================== */
/* Гость видит страницу целиком, но без кнопок правки.
   Сервер всё равно не пустит его к записи — это просто чистый вид. */
body.guest [data-refresh],
body.guest [data-edit],
body.guest [data-spotify-setup],
body.guest [data-spotify-logout],
body.guest [data-save-bio],
body.guest [data-save-name],
body.guest .banner-actions,
body.guest .arcana-actions,
body.guest .steam-hint,
body.guest .form-grid {
  display: none !important;
}

body.guest .avatar-slot,
body.guest .hero-title,
body.guest .hero-bio {
  cursor: default;
  pointer-events: none;
}

body.guest .avatar-hover {
  display: none;
}

body.guest .hero-bio.empty {
  display: none;
}

/* Блоки настроек внутри карточки «Сейчас слушаю». */
.setup-block {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.setup-block:first-child {
  border-top: 0;
  padding-top: 0;
}

/* Цвет карточки «Сейчас слушаю» зависит от того, что играет. */
:root {
  --c-yandex: #c08a00;
  --c-player: #2b6cf6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --c-yandex: #ffcc00;
    --c-player: #7aa2ff;
  }
}

:root[data-theme='dark'] {
  --c-yandex: #ffcc00;
  --c-player: #7aa2ff;
}

.brand-yandex {
  --brand: var(--c-yandex);
}

.brand-player {
  --brand: var(--c-player);
}
