/* KRIP Bot · сайт и панель управления · © 2026 SbeyTyan · Discord: fall3063
   Тёмная тема, «стекло», живой фон из светящихся пятен и звёзд. */
:root {
  --bg: #06070f;
  --panel: rgba(18, 21, 38, 0.62);
  --glass: blur(12px) saturate(140%);
  --panel-solid: #121526;
  --panel-hover: rgba(30, 35, 60, 0.7);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0ff;
  --muted: #9aa0c3;
  --faint: #6b7096;
  --red: #ff3d6e;
  --cyan: #2ee6d6;
  --green: #3ddc84;
  --amber: #ffb547;
  --accent: #e5243b; /* красный из логотипа, без градиентов */
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }

/* ---------- Живой фон ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%);
}
.stars {
  position: absolute; inset: -50%;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 60%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 80%, #c9d0ff 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 15%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 45%, #ffd1dc 50%, transparent 51%);
  background-size: 420px 420px;
  opacity: 0.35;
  will-change: opacity;
  animation: twinkle 6s ease-in-out infinite alternate; /* только мерцание: движение огромного слоя звёзд тормозило «стекло» */
}
@keyframes twinkle { to { opacity: 0.15; } }
/* Пока страницу листают — фон на паузе: «стеклу» не нужно пересчитывать размытие под карточками каждый кадр */
.scrolling .bg * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .stars { animation: none; } }

/* ---------- Каркас ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; /* вращающиеся кольца героя не расширяют страницу на телефоне; clip не ломает липкую шапку */ }
.boot { flex: 1; display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { position: relative; z-index: 1; text-align: center; padding: 40px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(6, 7, 15, 0.55); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: 0.04em; font-size: 18px; }
.brand .logo { width: 40px; height: 40px; object-fit: contain; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); }
.nav { display: flex; gap: 6px; margin-left: 12px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: 0.2s; }
.nav a:hover, .nav a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.user-chip .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 13px; object-fit: cover; }
.user-chip .logout { border: 0; background: rgba(255,255,255,0.08); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 14px; margin-left: 2px; }
.user-chip .logout:hover { background: var(--red); color: #fff; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 120px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.05); font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { border: 0; background: var(--accent); box-shadow: 0 10px 30px rgba(229,36,59,0.35); }
.btn.primary:hover { box-shadow: 0 14px 40px rgba(255,61,110,0.4); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn.ghost { background: transparent; }

/* ---------- Главная ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding: 24px 0 56px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(61,220,132,0.6); animation: pulse 2s infinite; }
.pulse.off { background: var(--faint); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.hero h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.04; margin: 18px 0 16px; letter-spacing: -0.02em; font-weight: 900; }
.accent-text { color: var(--accent); }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 560px; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 420px; justify-self: center; width: 100%; }
/* Вся анимация героя — только transform и opacity: браузер считает их отдельно от страницы, без перерисовки */
.hero-art .halo { position: absolute; inset: 4%; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(229,36,59,0.34), rgba(229,36,59,0.1) 62%, rgba(229,36,59,0) 100%); will-change: transform, opacity; animation: halo 7s ease-in-out infinite; }
.hero-art .wave { position: absolute; inset: 14%; border-radius: 50%; border: 1px solid rgba(229,36,59,0.55); opacity: 0; will-change: transform, opacity; animation: wave 7s cubic-bezier(0.22, 0.61, 0.36, 1) infinite; }
.hero-art .wave.w2 { animation-delay: -3.5s; }
/* Орбиты: тонкое кольцо, светлая дуга и точка, которая едет вместе с ним */
.hero-art .orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08); border-top-color: rgba(229,36,59,0.75); will-change: transform; animation: spin 26s linear infinite; }
.hero-art .orbit::before { content: ''; position: absolute; top: 14.6%; left: 14.6%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 2px rgba(229,36,59,0.75); }
.hero-art .orbit.o2 { inset: 8%; border-top-color: rgba(255,255,255,0.08); border-right-color: rgba(255,255,255,0.4); animation-duration: 18s; animation-direction: reverse; }
.hero-art .orbit.o2::before { top: 85.4%; left: 14.6%; width: 6px; height: 6px; margin: -3px; background: #fff; box-shadow: 0 0 10px 1px rgba(255,255,255,0.7); }
.hero-art .orbit.o3 { inset: 16%; border-color: rgba(229,36,59,0.16); border-bottom-color: rgba(229,36,59,0.65); animation-duration: 12s; }
.hero-art .orbit.o3::before { top: 85.4%; left: 85.4%; width: 7px; height: 7px; margin: -3.5px; }
.hero-art .core { position: absolute; inset: 15%; will-change: transform; animation: drift 9s ease-in-out infinite; }
.hero-art .core img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Без стекла: размытие под движущейся плашкой пересчитывается каждый кадр — от этого и дёргалась аватарка */
.hero-art .chip { position: absolute; z-index: 1; padding: 8px 12px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); will-change: transform; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; animation: float 8s ease-in-out infinite; }
.hero-art .chip:nth-of-type(1) { top: 8%; left: 0; animation-delay: -2s; }
.hero-art .chip:nth-of-type(2) { top: 20%; right: -4%; animation-delay: -4s; }
.hero-art .chip:nth-of-type(3) { bottom: 14%; left: -6%; animation-delay: -1s; }
.hero-art .chip:nth-of-type(4) { bottom: 4%; right: 6%; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -10px, 0); } }
/* Аватарка плывёт по кругу и чуть покачивается — без остановок в верхней и нижней точке */
@keyframes drift {
  0%, 100% { transform: translate3d(0, 6px, 0) rotate(-1.2deg) scale(1); }
  25% { transform: translate3d(5px, 0, 0) rotate(0deg) scale(1.012); }
  50% { transform: translate3d(0, -6px, 0) rotate(1.2deg) scale(1.024); }
  75% { transform: translate3d(-5px, 0, 0) rotate(0deg) scale(1.012); }
}
@keyframes halo { 0%, 100% { transform: scale(0.94); opacity: 0.65; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes wave { 0% { transform: scale(0.82); opacity: 0; } 15% { opacity: 0.7; } 100% { transform: scale(1.32); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero-art .halo, .hero-art .wave, .hero-art .orbit, .hero-art .core, .hero-art .chip { animation: none; }
}

.section-title { font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.section-sub { color: var(--muted); margin: 0 0 24px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.feature { padding: 22px; transition: transform 0.2s, border-color 0.2s, background 0.2s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(229,36,59,0.4); background: var(--panel-hover); }
.feature .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); margin-bottom: 14px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.footer { text-align: center; color: var(--faint); font-size: 13px; padding: 40px 0 0; }

/* ---------- Выбор сервера ---------- */
.guilds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.guild {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 28px 18px 22px; text-decoration: none; cursor: pointer; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.guild::before { content: ''; position: absolute; inset: 0 0 auto; height: 70px; background: var(--accent); opacity: 0.18; }
.guild:hover { transform: translateY(-4px); border-color: rgba(229,36,59,0.5); }
.guild .icon { position: relative; width: 72px; height: 72px; border-radius: 22px; background: var(--panel-solid); display: grid; place-items: center; font-size: 26px; font-weight: 800; border: 3px solid var(--bg); overflow: hidden; box-shadow: var(--shadow); }
.guild .icon img { width: 100%; height: 100%; object-fit: cover; }
.guild h3 { margin: 0; font-size: 17px; word-break: break-word; }
.guild .meta { color: var(--muted); font-size: 13px; }
.guild.add { border-style: dashed; justify-content: center; color: var(--muted); }
.guild.add .icon { background: rgba(255,255,255,0.04); border: 1px dashed var(--line-strong); font-size: 30px; }

.notice { padding: 36px; text-align: center; max-width: 560px; margin: 40px auto; }
.notice .big { font-size: 44px; margin-bottom: 10px; }
.notice h2 { margin: 0 0 8px; }
.notice p { color: var(--muted); margin: 0 0 22px; }

/* ---------- Панель сервера ---------- */
.dash { display: grid; grid-template-columns: 270px 1fr; gap: 22px; align-items: start; }
.side { position: sticky; top: 84px; padding: 14px; max-height: calc(100vh - 100px); overflow-y: auto; }
.side-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.side-head .icon { width: 44px; height: 44px; border-radius: 14px; background: var(--panel-solid); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.side-head .icon img { width: 100%; height: 100%; object-fit: cover; }
.side-head b { display: block; font-size: 15px; line-height: 1.25; word-break: break-word; }
.side-head small { color: var(--muted); font-size: 12px; }
.mod-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; transition: 0.15s; }
.mod-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.mod-link.active { background: rgba(229,36,59,0.16); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.mod-link .e { width: 22px; text-align: center; }
.mod-link .state { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.mod-link .state.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.back-link { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 8px; margin-bottom: 6px; }
.back-link:hover { color: var(--text); }

.mod-head { display: flex; gap: 18px; align-items: center; padding: 24px; margin-bottom: 18px; }
.mod-head .big-ico { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: var(--accent); box-shadow: 0 10px 30px rgba(229,36,59,0.35); flex: none; }
.mod-head h1 { margin: 0 0 4px; font-size: 26px; }
.mod-head p { margin: 0; color: var(--muted); font-size: 14px; }
.mod-head .switch { margin-left: auto; }

.fields { display: grid; gap: 14px; }
.field { padding: 18px 20px; display: grid; gap: 10px; }
.field.row { grid-template-columns: 1fr auto; align-items: center; }
.field label.title { font-weight: 700; font-size: 15px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: -4px; }
.field.disabled { opacity: 0.45; pointer-events: none; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(5, 6, 14, 0.6); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,36,59,0.25); }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
select.input option, select.input optgroup { background: var(--panel-solid); }
.counter { text-align: right; font-size: 12px; color: var(--faint); margin-top: -6px; }

.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,0.12); transition: 0.25s; }
.switch .track::after { content: ''; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: 0.25s; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(229,36,59,0.4); }

.range-row { display: flex; gap: 14px; align-items: center; }
.range-row input[type=range] { flex: 1; accent-color: #a855f7; }
.range-row .input { width: 110px; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(5,6,14,0.6); border: 1px solid var(--line-strong); }
.segmented button { flex: 1; min-width: 90px; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; transition: 0.2s; }
.segmented button.on { background: var(--accent); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip-item .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip-item button { border: 0; background: rgba(255,255,255,0.1); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 13px; }
.chip-item button:hover { background: var(--red); }
.chip-add { display: flex; gap: 8px; }

/* ---------- Полоса сохранения и уведомления ---------- */
.savebar {
  position: fixed; left: 50%; bottom: 22px; z-index: 30; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 20px; width: min(720px, calc(100% - 32px));
  border-radius: 16px; background: rgba(14, 16, 30, 0.92); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); transition: transform 0.35s cubic-bezier(.2,.9,.3,1.2);
}
.savebar.show { transform: translate(-50%, 0); }
.savebar span { flex: 1; font-weight: 600; }
.toast { position: fixed; right: 22px; top: 84px; z-index: 40; padding: 14px 18px; border-radius: 14px; background: rgba(14,16,30,0.95); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-weight: 600; max-width: 360px; animation: toast-in 0.3s ease; }
.toast.ok { border-color: rgba(61,220,132,0.5); }
.toast.err { border-color: rgba(255,61,110,0.6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

.badge.applying { margin: 0 0 14px; color: var(--amber); border-color: rgba(255,181,71,0.35); }
.history { margin-top: 26px; padding: 18px 20px; }
.history h3 { margin: 0 0 10px; font-size: 15px; }
.history li { color: var(--muted); font-size: 13px; padding: 4px 0; list-style: none; }
.history ul { margin: 0; padding: 0; }

/* ---------- Телефоны ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-art { max-width: 300px; order: -1; }
  .dash { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .side-head, .back-link { display: none; }
  .mod-link { flex: none; white-space: nowrap; }
  .mod-link .state { margin-left: 6px; }
  .nav { margin-left: 0; gap: 2px; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: none; }
  .topbar .spacer { display: none; }
  .topbar .user-chip, .topbar .login, .topbar .brand { flex: none; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .brand small, .user-chip .user-name { display: none; }
  .user-chip { padding: 4px; gap: 4px; }
}
@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 12px 14px; }
  .brand > span:not(.logo) { display: none; }
  .nav a { white-space: nowrap; }
  .login { white-space: nowrap; }
  .login .long { display: none; }
  .mod-head { flex-wrap: wrap; }
  .field.row { grid-template-columns: 1fr; }
  .savebar { flex-wrap: wrap; }
}
