/* ============================================================ основа */
:root {
  --bg: #07080c;
  --bg-soft: #0d0f16;
  --card: rgba(255, 255, 255, .04);
  --card-solid: #12141d;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #eef1f8;
  --muted: #9aa3b8;
  --faint: #626b80;
  --accent: #5b8cff;
  --accent-2: #a06bff;
  --success: #3ddc97;
  --warn: #ffb648;
  --danger: #ff5f6d;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* мягкое свечение на фоне — оживляет тёмную страницу */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(91, 140, 255, .20), transparent 60%),
    radial-gradient(800px 500px at 88% 8%, rgba(160, 107, 255, .16), transparent 60%),
    radial-gradient(700px 700px at 50% 120%, rgba(61, 220, 151, .10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ============================================================ шапка */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(7, 8, 12, .72);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; gap: 20px; height: 68px; }

.logo { cursor: pointer; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; letter-spacing: -.2px; }

.logo .mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-size: 17px;
  box-shadow: 0 6px 20px rgba(91, 140, 255, .4);
}

.nav .links { display: flex; gap: 6px; margin-left: auto; align-items: center; }

.nav a.link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: .18s;
}
.nav a.link:hover { color: var(--text); background: var(--card); }

/* ============================================================ кнопки */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 20px;
  font: 600 14px var(--font);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  box-shadow: 0 8px 24px rgba(91, 140, 255, .32);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(91, 140, 255, .42); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

.btn.ghost {
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }

.btn.danger { background: linear-gradient(135deg, #ff5f6d, #ff2d55); box-shadow: 0 8px 24px rgba(255, 95, 109, .3); }
.btn.small { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; }

/* ============================================================ главный экран */
.hero { padding: 88px 0 64px; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.live { background: var(--success); box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); }
  70% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

h1 {
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 1.04;
  letter-spacing: -2px;
  font-weight: 800;
  margin-bottom: 20px;
}
h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--success));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 auto 34px; line-height: 1.6; }

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================ статистика */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 56px 0 0; }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  backdrop-filter: blur(10px);
  transition: .2s;
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.stat .value { font-size: 30px; font-weight: 750; letter-spacing: -1px; }
.stat .label { font-size: 12.5px; color: var(--faint); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ============================================================ секции */
section { padding: 76px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -1px; font-weight: 750; }
.section-head p { color: var(--muted); margin-top: 10px; font-size: 16px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: .22s;
  position: relative;
  overflow: hidden;
}
.feature::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(91, 140, 255, .12), transparent 55%);
  opacity: 0; transition: .22s;
}
.feature:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.feature:hover::after { opacity: 1; }
.feature .icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(91, 140, 255, .25), rgba(160, 107, 255, .25));
  display: grid; place-items: center; font-size: 20px; margin-bottom: 16px;
}
.feature h3 { font-size: 17px; margin-bottom: 8px; font-weight: 650; }
.feature p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ============================================================ шаги */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative;
}
.step .num {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 14px;
}
.step h3 { font-size: 16px; margin-bottom: 7px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ============================================================ окна */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 4, 8, .72);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%; max-width: 440px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.98);
  transition: transform .22s;
  max-height: 92vh; overflow-y: auto;
}
.overlay.open .modal { transform: none; }
.modal.wide { max-width: 860px; }

.modal h2 { font-size: 22px; letter-spacing: -.5px; margin-bottom: 6px; }
.modal .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ============================================================ формы */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; font-weight: 550; }

input, select {
  width: 100%;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font: 15px var(--font);
  transition: .16s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(91, 140, 255, .07);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .16);
}
input::placeholder { color: var(--faint); }
select option { background: var(--card-solid); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hint { font-size: 12.5px; color: var(--faint); margin-top: 7px; line-height: 1.5; }

.message {
  border-radius: 12px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 15px;
  display: none; line-height: 1.5;
}
.message.show { display: block; }
.message.bad { background: rgba(255, 95, 109, .12); border: 1px solid rgba(255, 95, 109, .3); color: #ffa8b0; }
.message.good { background: rgba(61, 220, 151, .12); border: 1px solid rgba(61, 220, 151, .3); color: #8ff0c4; }

.switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.switch a { color: var(--accent); text-decoration: none; cursor: pointer; font-weight: 550; }
.switch a:hover { text-decoration: underline; }

/* пол персонажа выбираем плитками, а не скучным списком */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice input { display: none; }
.choice label {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px;
  text-align: center; cursor: pointer; font-size: 14px; transition: .16s; margin: 0;
  color: var(--text);
}
.choice input:checked + label {
  border-color: var(--accent);
  background: rgba(91, 140, 255, .12);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .12);
}

/* ============================================================ кабинет */
.cabinet { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}

.avatar {
  width: 92px; height: 92px; border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 36px; font-weight: 700;
  margin: 0 auto 16px;
  box-shadow: 0 12px 34px rgba(91, 140, 255, .35);
}

.who { text-align: center; margin-bottom: 20px; }
.who .name { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.who .nick { color: var(--faint); font-size: 13.5px; margin-top: 3px; }

.tag {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.tag.admin { background: rgba(160, 107, 255, .18); color: #c9a6ff; }
.tag.player { background: rgba(91, 140, 255, .16); color: #a8c2ff; }
.tag.banned { background: rgba(255, 95, 109, .16); color: #ffa8b0; }

.rows { display: flex; flex-direction: column; gap: 1px; }
.line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.line:last-child { border-bottom: 0; }
.line .k { color: var(--muted); }
.line .v { font-weight: 600; }

.wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.wallet .box {
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px;
}
.wallet .box .k { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; }
.wallet .box .v { font-size: 24px; font-weight: 700; margin-top: 5px; letter-spacing: -.6px; }
.wallet .box .v.green { color: var(--success); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11.5px; color: var(--faint); text-transform: uppercase;
  letter-spacing: .5px; padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 600;
}
td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* ============================================================ подвал */
footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  color: var(--faint);
  font-size: 13.5px;
  text-align: center;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--card-solid); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 13px 22px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .24s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.hidden { display: none !important; }

/* ============================================================ узкий экран */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid, .steps { grid-template-columns: 1fr; }
  .cabinet { grid-template-columns: 1fr; }
  .nav .links a.link { display: none; }
  .hero { padding: 56px 0 40px; }
  section { padding: 52px 0; }
}


/* ============================================================ заявки */
textarea {
  width: 100%;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font: 15px var(--font);
  resize: vertical;
  min-height: 120px;
  transition: .16s;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(91, 140, 255, .07);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .16);
}
textarea::placeholder { color: var(--faint); }

.application {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .03);
}
.application .head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.application .who { font-weight: 600; }
.application .text {
  color: var(--muted); font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.application .actions { margin-top: 12px; display: flex; gap: 8px; }

.tag.pending { background: rgba(255, 182, 72, .16); color: #ffd08a; }
.tag.approved { background: rgba(61, 220, 151, .16); color: #8ff0c4; }
.tag.rejected { background: rgba(255, 95, 109, .16); color: #ffa8b0; }

/* карточка фракции на главной */
.faction .bar { height: 3px; border-radius: 3px; margin: 14px 0 0; opacity: .85; }

/* Эмблема фракции. Цвет приходит из --tint, поэтому одна и та же вёрстка
   годится хоть для милицейского синего, хоть для чёрного ОПГ. */
.faction .emblem {
  position: relative;
  display: grid; place-items: center;
  width: 54px; height: 54px;
  margin-bottom: 16px;
  border-radius: 16px;
  color: var(--tint, #5b8cff);
  /* запасной вариант для браузеров без color-mix — ниже он перекрывается */
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 30% 20%,
      color-mix(in srgb, var(--tint) 26%, transparent), transparent 70%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--tint) 14%, transparent),
      rgba(255, 255, 255, .02));
  border: 1px solid color-mix(in srgb, var(--tint) 34%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 6px 18px -10px color-mix(in srgb, var(--tint) 70%, transparent);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1),
              box-shadow .32s, border-color .32s;
}
/* мягкое свечение позади — оживает при наведении на карточку */
.faction .emblem::before {
  content: '';
  position: absolute; inset: -30%;
  border-radius: inherit;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--tint) 40%, transparent), transparent 62%);
  opacity: 0; transition: opacity .34s;
  pointer-events: none;
}
.faction:hover .emblem {
  transform: translateY(-2px) rotate(-3deg) scale(1.05);
  border-color: color-mix(in srgb, var(--tint) 62%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 12px 26px -12px color-mix(in srgb, var(--tint) 85%, transparent);
}
.faction:hover .emblem::before { opacity: .55; }

.faction .emblem svg {
  position: relative;
  width: 28px; height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* линии прочерчиваются, когда карточка появляется в поле зрения */
.faction .emblem svg > * {
  stroke-dasharray: 96;
  stroke-dashoffset: 96;
}
.faction.seen .emblem svg > * {
  animation: emblem-draw .9s cubic-bezier(.4, 0, .2, 1) forwards;
}
.faction.seen .emblem svg > *:nth-child(2) { animation-delay: .12s; }
.faction.seen .emblem svg > *:nth-child(3) { animation-delay: .22s; }
.faction.seen .emblem svg > *:nth-child(4) { animation-delay: .3s; }
@keyframes emblem-draw { to { stroke-dashoffset: 0; } }
