/* ==========================================================
   MERIDIAN ONLINE — личный кабинет, вход и регистрация
   Использует цвета и кнопки из style.css
   ========================================================== */

.cab { min-height: 100vh; display: flex; flex-direction: column; }
.cab-main { flex: 1; padding: calc(var(--header-h) + 36px) 0 72px; position: relative; z-index: 1; }
.cab .footer { position: relative; z-index: 1; }
.muted { color: var(--muted); }

/* ---------- Шапка ---------- */
.cab-nav { display: flex; gap: 28px; margin-left: 48px; margin-right: auto; }
.cab-nav a { font-weight: 600; font-size: 15px; color: var(--text); transition: color .2s; }
.cab-nav a:hover { color: var(--blue); }
.cab-user { display: flex; align-items: center; gap: 10px; }
.cab-user__name {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 6px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: 14px;
}
.cab-user__name svg { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--grad-v); color: #fff; }
.cab-user__logout { margin: 0; }
.cab-user .btn { height: 44px; padding: 0 18px; }

/* ---------- Уведомления ---------- */
.cab-alert {
  padding: 14px 18px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; font-weight: 500; line-height: 1.5;
  border: 1px solid transparent; background: #fff;
}
.cab-alert strong { font-weight: 800; }
.cab-alert--ok    { background: #ecfbf2; border-color: #bdeccf; color: #12693a; }
.cab-alert--error { background: #fff0f0; border-color: #ffcdcd; color: #a61b1b; }
.cab-alert--warn  { background: #fff8e6; border-color: #fbe2a2; color: #8a5a00; }
.cab-alert--info  { background: var(--sky); border-color: #cfe2ff; color: var(--blue-dark); }

/* ==========================================================
   Вход / регистрация
   ========================================================== */
.auth { display: grid; place-items: center; padding: 0 20px; }
.auth__card {
  width: 100%; max-width: 460px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
  border-radius: 24px; padding: 36px 34px 28px; box-shadow: var(--shadow-card); border: 1px solid #fff;
}
.auth__head { text-align: center; margin-bottom: 22px; }
.auth__logo { margin: 0 auto 14px; display: block; }
.auth__title { font-size: 26px; font-weight: 900; letter-spacing: -.02em; color: var(--navy); }
.auth__lead { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; background: #eef3fb; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth__tabs a { text-align: center; padding: 10px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); transition: .2s; }
.auth__tabs a.is-active { background: #fff; color: var(--blue-deep); box-shadow: 0 4px 14px -6px rgba(15,40,90,.25); }
.auth__form { display: grid; gap: 16px; }
.auth__submit { width: 100%; height: 54px; margin-top: 4px; justify-content: center; }
.auth__foot { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth__foot a { color: var(--blue); font-weight: 700; }

.field { display: grid; gap: 7px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field__label { font-size: 13px; font-weight: 700; color: var(--text); padding: 0; }
.field__input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  font: 500 15px var(--font); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.field__input::placeholder { color: var(--muted-2); }
.field__input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,124,255,.14); }
.field.is-invalid .field__input { border-color: var(--red); }
.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12.5px; color: #c81e1e; font-weight: 600; }
.field__pass { position: relative; display: block; }
.field__pass .field__input { padding-right: 96px; }
.field__eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 12px; border-radius: 8px;
  border: 0; background: #f1f4f9; font: 600 12px var(--font); color: var(--muted); cursor: pointer;
}
.field__eye:hover { color: var(--blue-deep); }
.field-row { display: grid; grid-template-columns: 1fr 120px; gap: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: grid; place-items: center; height: 50px; border-radius: 12px; border: 1.5px solid var(--line);
  font-weight: 600; font-size: 14px; color: var(--muted); transition: .2s; background: #fff;
}
.seg input:checked + span { border-color: var(--blue); color: var(--blue-deep); background: var(--sky); }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px rgba(31,124,255,.2); }

/* ==========================================================
   Профиль
   ========================================================== */
.profile__grid { display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start; }

/* ----- Карточка персонажа ----- */
.hero-card {
  position: sticky; top: calc(var(--header-h) + 20px);
  background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-card);
}
.hero-card__stage {
  position: relative; height: 380px; display: grid; place-items: end center; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 100%, rgba(60,196,255,.55), transparent 60%),
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.18) 0 22%, transparent 23%),
    linear-gradient(170deg, #1d6dff 0%, #0b3fb4 55%, #071a45 100%);
}
/* меридианы глобуса за персонажем */
.hero-card__stage::before {
  content: ""; position: absolute; left: 50%; top: 40px; width: 300px; height: 300px; transform: translateX(-50%);
  border-radius: 50%; border: 1px solid rgba(255,255,255,.22);
  background:
    radial-gradient(ellipse 30% 50% at 50% 50%, transparent 98%, rgba(255,255,255,.2) 99% 100%, transparent 101%),
    radial-gradient(ellipse 65% 50% at 50% 50%, transparent 98%, rgba(255,255,255,.16) 99% 100%, transparent 101%),
    linear-gradient(transparent calc(50% - .5px), rgba(255,255,255,.2) 0 calc(50% + .5px), transparent 0);
}
.hero-card__skin {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 93%; width: auto; max-width: 92%; object-fit: contain; object-position: bottom center;
  filter: drop-shadow(0 18px 26px rgba(0,10,40,.55));
}
.hero-card__placeholder { position: relative; display: grid; justify-items: center; gap: 12px; margin-bottom: 110px; color: rgba(255,255,255,.85); font-weight: 700; font-size: 14px; }
.hero-card__placeholder svg { width: 110px; height: 110px; opacity: .9; }
.hero-card__server {
  position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em;
}
.hero-card__server svg { width: 15px; height: 15px; color: #ffd76a; }
.hero-card__level {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px;
  background: #fff; color: var(--blue-deep); font-weight: 900; font-size: 24px; line-height: 1; box-shadow: 0 12px 26px -10px rgba(0,0,0,.5);
}
.hero-card__level small { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: .1em; }

.hero-card__vitals { display: grid; gap: 10px; padding: 18px 22px 6px; }
.vital { display: grid; grid-template-columns: 20px 1fr 34px; align-items: center; gap: 10px; }
.vital svg { width: 18px; height: 18px; }
.vital b { font-size: 13px; text-align: right; }
.vital__bar { display: block; height: 8px; border-radius: 99px; background: #edf1f7; overflow: hidden; }
.vital__bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.vital--hp svg { color: #ef4444; }
.vital--hp .vital__bar i { background: linear-gradient(90deg, #ff7a7a, #ef4444); }
.vital--ar svg { color: #64748b; }
.vital--ar .vital__bar i { background: linear-gradient(90deg, #b6c2d4, #64748b); }

.hero-card__facts { padding: 10px 22px 22px; }
.hero-card__facts > div, .kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.hero-card__facts > div:last-child, .kv > div:last-child { border-bottom: 0; }
.hero-card__facts dt, .kv dt { color: var(--muted); }
.hero-card__facts dd, .kv dd { font-weight: 700; text-align: right; }
.is-warn { color: #d97706; }
.is-admin { color: var(--blue-deep); }

/* ----- Основная колонка ----- */
.profile__main { display: grid; gap: 18px; min-width: 0; }

.pf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 4px 2px 6px; }
.pf-head__name { font-size: clamp(30px, 4vw, 46px); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; color: var(--navy); }
.pf-head__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 99px; font-weight: 700; font-size: 13px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--on  { background: #e6f9ee; color: #16a34a; }
.status--on::before { box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: cab-pulse 2s infinite; }
.status--off { background: #f1f4f9; color: var(--muted); }
.status--unk { background: #f1f4f9; color: var(--muted-2); }
@keyframes cab-pulse { 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }

.pf-level { width: min(320px, 100%); }
.pf-level__row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.pf-level__row span:last-child { color: var(--muted); font-weight: 600; }
.pf-level__bar { height: 10px; border-radius: 99px; background: rgba(31,124,255,.12); overflow: hidden; }
.pf-level__bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }

/* Деньги — главный акцент страницы */
.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.money__item {
  position: relative; display: grid; gap: 4px; padding: 20px 22px; border-radius: 20px; background: #fff; overflow: hidden;
  box-shadow: 0 14px 34px -22px rgba(15,40,90,.35);
}
.money__item svg { width: 26px; height: 26px; margin-bottom: 8px; color: var(--blue); }
.money__item span { font-size: 13px; color: var(--muted); font-weight: 600; }
.money__item b { font-size: clamp(20px, 2.2vw, 27px); font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money__item--cash svg { color: #16a34a; }
.money__item--total { background: var(--grad-v); color: #fff; box-shadow: var(--shadow-blue); }
.money__item--total svg { color: #fff; }
.money__item--total span { color: rgba(255,255,255,.8); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { display: grid; align-content: start; gap: 3px; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.85); border: 1px solid #fff; }
.tile svg { width: 22px; height: 22px; color: var(--blue); margin-bottom: 8px; }
.tile span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile b { font-size: 15px; font-weight: 800; line-height: 1.3; }
.tile small { font-size: 12.5px; color: var(--muted); }

/* Блоки */
.block { background: #fff; border-radius: 20px; padding: 20px 22px; box-shadow: 0 14px 34px -24px rgba(15,40,90,.35); }
.block__title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--navy); }
.block__title > svg:first-child { width: 22px; height: 22px; color: var(--blue); flex: none; }
.block__sub { margin: 16px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.count { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--sky); color: var(--blue-deep); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.block--fold > summary { cursor: pointer; list-style: none; user-select: none; }
.block--fold > summary::-webkit-details-marker { display: none; }
.block--fold > summary > svg:last-child { margin-left: auto; width: 20px; height: 20px; color: var(--muted); transition: transform .3s var(--ease); }
.block--fold[open] > summary > svg:last-child { transform: rotate(180deg); }
.block--fold[open] > summary { margin-bottom: 16px; }
.block--fold > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 6px; border-radius: 6px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0 2px; }
.block > .empty, .block > .chips, .block > .music__lead { margin-top: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px; background: #f3f5f9; color: var(--muted-2); font-size: 13.5px; font-weight: 700; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.15); }
.chip--yes { background: #e8f8ef; color: #15803d; text-decoration: none; }
.chip--yes::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }

/* Транспорт */
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.car { display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 12px; border-radius: 18px; background: var(--sky-2); border: 1px solid #e3ecf8; }
.car__img {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(70% 55% at 50% 78%, rgba(31,124,255,.18), transparent 70%), linear-gradient(170deg, #e4efff, #f7faff);
}
.car__img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(10,30,70,.25)); }
.car__img svg { width: 48px; height: 48px; color: #9db8e6; }
.car__body { padding: 0 4px 4px; }
.car__body { display: grid; align-content: start; gap: 5px; min-width: 0; }
.car h3 { font-size: 15px; font-weight: 800; }
.car__meta, .car__tune { font-size: 12.5px; color: var(--muted); }
.car__tune { color: var(--blue-deep); font-weight: 600; }
.car__cond { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.car__cond b { color: var(--text); }
.car__cond .vital__bar { height: 6px; }
.car__cond .vital__bar i { background: linear-gradient(90deg, #4ade80, #16a34a); }

/* Имущество */
.props, .list, .skills, .tracks { list-style: none; }
.prop { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.prop:first-child { border-top: 0; padding-top: 0; }
.prop > svg { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--sky); color: var(--blue); }
.prop b { display: block; font-size: 15px; font-weight: 800; }
.prop small { color: var(--muted); font-size: 13px; }
.prop__val { font-weight: 800; font-variant-numeric: tabular-nums; }

.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.skills li { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--sky-2); font-size: 14px; }
.skills span { color: var(--muted); }
.skills b { font-weight: 800; }

/* Музыка */
.music__lead { font-size: 14px; color: var(--muted); line-height: 1.55; }
.music code { padding: 2px 7px; border-radius: 6px; background: var(--sky); color: var(--blue-deep); font-weight: 700; font-family: inherit; }
.upload { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
.upload__drop {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border-radius: 16px; cursor: pointer; text-align: center;
  border: 2px dashed #c7d8f3; background: var(--sky-2); transition: border-color .2s, background .2s;
}
.upload__drop:hover, .upload__drop.is-over { border-color: var(--blue); background: var(--sky); }
.upload__drop:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,124,255,.14); }
.upload__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload__drop svg { width: 30px; height: 30px; color: var(--blue); }
.upload__text { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.upload__drop small { color: var(--muted); font-size: 12px; }
.upload .btn { justify-content: center; height: 50px; }
.upload .btn[disabled] { opacity: .65; pointer-events: none; }

.tracks { margin-top: 16px; display: grid; gap: 8px; }
.track { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--sky-2); border: 1px solid #e3ecf8; }
.track form { margin: 0; }
.track__play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad-v); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 18px -8px rgba(31,124,255,.7); }
.track__play svg { width: 18px; height: 18px; grid-area: 1 / 1; }
.track__play svg:last-child, .track.is-playing .track__play svg:first-child { display: none; }
.track.is-playing .track__play svg:last-child { display: block; }
.track__info { min-width: 0; display: grid; gap: 2px; }
.track__info b { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__info small { font-size: 12px; color: var(--muted); }
.track__progress { display: block; height: 3px; border-radius: 9px; background: #dbe5f3; margin-top: 5px; overflow: hidden; cursor: pointer; }
.track__progress i { display: block; height: 100%; width: 0; background: var(--blue); }
.track__id {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px solid #cfe0fb; background: #fff;
  font: 800 13px var(--font); color: var(--blue-deep); cursor: pointer; white-space: nowrap; transition: .2s;
}
.track__id svg { width: 15px; height: 15px; }
.track__id:hover { border-color: var(--blue); }
.track__id.is-copied { background: #e8f8ef; border-color: #a7e5c0; color: #15803d; }
.track__del { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted-2); cursor: pointer; display: grid; place-items: center; }
.track__del svg { width: 18px; height: 18px; }
.track__del:hover { background: #fff0f0; color: var(--red); }

/* Почта и безопасность */
.profile__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.profile__cols .block > .list, .profile__cols .block > .kv { margin-top: 12px; }
.list li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li:first-child { border-top: 0; }
.list li span { overflow-wrap: anywhere; }
.list small { color: var(--muted); font-size: 12px; }
.list li.is-new b::after { content: "новое"; margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 10.5px; vertical-align: 1px; }
.list--compact li { display: flex; justify-content: space-between; padding: 8px 0; }

:focus-visible { outline-color: var(--blue); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .cab-nav { display: none; }
  .profile__grid { grid-template-columns: 1fr; }
  .hero-card { position: static; display: grid; grid-template-columns: 260px 1fr; }
  .hero-card__stage { grid-row: span 2; height: 100%; min-height: 340px; }
  .hero-card__facts { padding-top: 0; }
}
@media (max-width: 680px) {
  .cab-main { padding-top: calc(var(--header-h) + 20px); }
  .cab-user__name span, .cab-user .btn span { display: none; }
  .cab-user__name { padding: 0 6px; }
  .cab-user .btn { padding: 0 12px; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card__stage { height: 320px; min-height: 0; }
  .money { grid-template-columns: 1fr 1fr; }
  .money__item--total { grid-column: span 2; }
  .money__item { padding: 16px; }
  .money__item b { font-size: clamp(16px, 4.6vw, 20px); }
  .profile__cols { grid-template-columns: 1fr; }
  .track { grid-template-columns: 44px 1fr auto; }
  .track form { grid-column: 3; grid-row: 1; }
  .track__id { grid-column: 2 / span 2; justify-self: start; }
  .auth__card { padding: 28px 20px 22px; }
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .status--on::before { animation: none; }
  .block--fold > summary > svg:last-child { transition: none; }
}

/* Сброс отступов списков и фиксированный фон на длинных страницах */
.props, .list, .skills, .tracks, .chips { padding: 0; margin-left: 0; }
.cab .site-bg { position: fixed; inset: 0; height: auto; }
