/* ===== df$ Battles — дизайн-система ===== */
:root {
  --bg: #0b0e17;
  --bg2: #111627;
  --card: #161c30;
  --card2: #1c2440;
  --border: #26304f;
  --text: #e8ecf6;
  --muted: #8b94ad;
  --gold: #ffd166;
  --green: #4ade80;
  --red: #f87171;
  --blue: #38bdf8;
  --violet: #a78bfa;
  --grad: linear-gradient(120deg, #ffd166, #ff9a3d 55%, #ff6b6b);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(255, 209, 102, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(167, 139, 250, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Шапка ---- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 23, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo {
  font-family: 'Russo One', sans-serif; font-size: 21px; letter-spacing: .5px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  cursor: pointer; white-space: nowrap;
}
.logo span { font-family: 'Press Start 2P', monospace; font-size: 13px; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); padding: 7px 13px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.nav-links a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.nav-links a.active { color: var(--gold); background: rgba(255, 209, 102, .1); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.coins-pill, .points-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-weight: 700; font-size: 13px; white-space: nowrap;
}
.coins-pill { color: var(--gold); }
.points-pill { color: var(--violet); }

/* ---- Кнопки ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  text-decoration: none !important;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--grad); color: #241a05; }
.btn-primary { background: var(--blue); color: #06263a; }
.btn-green { background: var(--green); color: #06301b; }
.btn-danger { background: var(--red); color: #3b0a0a; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---- Формы ---- */
input, textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
textarea { resize: vertical; min-height: 90px; }

/* ---- Контейнер ---- */
main { flex: 1; width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
.page-title { font-family: 'Russo One', sans-serif; font-size: 26px; margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 22px; }

/* ---- Карточки ---- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-title { font-family: 'Russo One', sans-serif; font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ---- Герой ---- */
.hero {
  padding: 54px 30px; text-align: center; border-radius: 20px;
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(255, 209, 102, .12), transparent 70%),
    var(--card);
  border: 1px solid var(--border); margin-bottom: 26px;
}
.hero h1 { font-family: 'Russo One', sans-serif; font-size: 42px; line-height: 1.15; }
.hero h1 .brand { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 620px; margin: 14px auto 26px; font-size: 16px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Стат-плитки ---- */
.stat {
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; text-align: center;
}
.stat .num { font-family: 'Russo One', sans-serif; font-size: 26px; color: var(--gold); }
.stat .lbl { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }

/* ---- Никнеймы: шрифты (15) ---- */
.nick { font-weight: 700; white-space: nowrap; }
.font-pixel { font-family: 'Press Start 2P', monospace; font-size: .8em; }
.font-cosmo { font-family: 'Orbitron', sans-serif; }
.font-russo { font-family: 'Russo One', sans-serif; }
.font-bungee { font-family: 'Bungee', sans-serif; }
.font-audio { font-family: 'Audiowide', sans-serif; }
.font-pacifico { font-family: 'Pacifico', cursive; }
.font-unbounded { font-family: 'Unbounded', sans-serif; }
.font-rubik { font-family: 'Rubik Mono One', sans-serif; font-size: .92em; }
.font-play { font-family: 'Play', sans-serif; }
.font-exo { font-family: 'Exo 2', sans-serif; }
.font-vibes { font-family: 'Great Vibes', cursive; font-size: 1.22em; font-weight: 400; }
.font-amatic { font-family: 'Amatic SC', cursive; font-size: 1.35em; font-weight: 700; }
.font-creep { font-family: 'Creepster', cursive; letter-spacing: .5px; }
.font-mono { font-family: 'Monoton', cursive; font-size: .95em; }
.font-comfort { font-family: 'Comfortaa', sans-serif; }

/* ---- Никнеймы: анимации (10) ---- */
.anim-glow { animation: a-glow 2s ease-in-out infinite alternate; }
@keyframes a-glow {
  from { text-shadow: 0 0 4px rgba(255, 209, 102, .35); }
  to { text-shadow: 0 0 16px rgba(255, 209, 102, .95), 0 0 38px rgba(255, 209, 102, .4); }
}
.anim-rainbow {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #4ade80, #38bdf8, #a78bfa, #ff6b6b);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: a-shift 4s linear infinite;
}
@keyframes a-shift { to { background-position: 300% 0; } }
.anim-pulse { animation: a-pulse 1.5s ease-in-out infinite; }
@keyframes a-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
.anim-shake { display: inline-block; animation: a-shake .55s ease-in-out infinite; }
@keyframes a-shake {
  0%, 100% { transform: rotate(-2deg); } 25% { transform: rotate(2deg) translateY(-1px); }
  50% { transform: rotate(-1.5deg); } 75% { transform: rotate(1.5deg) translateY(1px); }
}
.anim-float { display: inline-block; animation: a-float 2.4s ease-in-out infinite; }
@keyframes a-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.anim-flicker { animation: a-flicker 2.1s linear infinite; }
@keyframes a-flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; text-shadow: 0 0 12px rgba(56, 189, 248, .8); }
  20%, 24%, 55% { opacity: .35; text-shadow: none; }
}
.anim-bounce { display: inline-block; animation: a-bounce 1.3s ease infinite; }
@keyframes a-bounce {
  0%, 100% { transform: translateY(0); } 35% { transform: translateY(-8px); } 55% { transform: translateY(2px); } 70% { transform: translateY(-3px); }
}
.anim-spin { display: inline-block; animation: a-spin 5s linear infinite; }
@keyframes a-spin { to { transform: rotate(360deg); } }
.anim-fire {
  background: linear-gradient(90deg, #ff9a3d, #ff4d2e, #ffd166, #ff7a3d, #ff4d2e);
  background-size: 280% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: a-shift 2.8s linear infinite;
}
.anim-electric {
  color: #9be2ff; animation: a-electric 1.1s steps(3) infinite;
}
@keyframes a-electric {
  0%, 100% { text-shadow: 0 0 10px #38bdf8, 0 0 26px #38bdf8; }
  50% { text-shadow: 0 0 2px #38bdf8, 0 0 8px #38bdf8, 0 0 40px #7dd3fc; }
}

/* ---- Значки ---- */
.badge-img { width: 22px; height: 22px; vertical-align: -5px; margin-left: 6px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.badge-img.big { width: 56px; height: 56px; margin: 0; }

/* ---- Таблицы / списки ---- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .8px; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 12px; border-bottom: 1px solid rgba(38, 48, 79, .5); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.rank { font-family: 'Russo One', sans-serif; width: 46px; }
.rank-1 { color: var(--gold); } .rank-2 { color: #cfd8ea; } .rank-3 { color: #d29a6b; }

.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card2);
  margin-bottom: 10px; cursor: pointer; transition: border-color .15s ease;
}
.list-item:hover { border-color: var(--gold); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; font-size: 15px; }
.list-item .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Бейджи статусов ---- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
}
.chip-gold { background: rgba(255, 209, 102, .15); color: var(--gold); }
.chip-green { background: rgba(74, 222, 128, .13); color: var(--green); }
.chip-red { background: rgba(248, 113, 113, .14); color: var(--red); }
.chip-blue { background: rgba(56, 189, 248, .13); color: var(--blue); }
.chip-violet { background: rgba(167, 139, 250, .14); color: var(--violet); }
.chip-gray { background: rgba(139, 148, 173, .14); color: var(--muted); }

/* ---- Чат ---- */
.chat { display: flex; flex-direction: column; height: 460px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 6px 4px 6px 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; }
.msg .msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.msg .msg-name { font-size: 13px; }
.msg .msg-time { color: var(--muted); font-size: 11px; }
.msg .msg-body {
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 13px; font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.msg.mine { align-self: flex-end; }
.msg.mine .msg-head { justify-content: flex-end; }
.msg.mine .msg-body { background: rgba(56, 189, 248, .13); border-color: rgba(56, 189, 248, .3); }
.msg.system { align-self: center; max-width: 92%; }
.msg.system .msg-body {
  background: transparent; border: 1px dashed var(--border); color: var(--muted);
  font-size: 12.5px; text-align: center;
}
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input input { flex: 1; }

/* ---- Модалка ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 8, 15, .72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; width: 100%; max-width: 520px; box-shadow: var(--shadow);
  max-height: 88vh; overflow-y: auto;
}
.modal h3 { font-family: 'Russo One', sans-serif; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---- Тосты ---- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card2); border: 1px solid var(--border); border-left: 4px solid var(--gold);
  padding: 12px 16px; border-radius: 12px; min-width: 230px; max-width: 340px; box-shadow: var(--shadow);
  animation: slide-in .25s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Магазин ---- */
.shop-item {
  background: var(--card2); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 12px;
}
.shop-item .preview {
  min-height: 58px; display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border-radius: 10px; padding: 10px; font-size: 19px; overflow: hidden;
}
.shop-item .price { color: var(--gold); font-weight: 800; }
.shop-item.equipped { border-color: var(--green); }
.shop-item.owned { border-color: rgba(255, 209, 102, .45); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); cursor: pointer; font-weight: 700; font-size: 13.5px;
}
.tab.active { background: rgba(255, 209, 102, .12); color: var(--gold); border-color: rgba(255, 209, 102, .4); }

/* ---- Работы в профиле ---- */
.work-card {
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.work-card .score-big { font-family: 'Russo One', sans-serif; font-size: 22px; color: var(--gold); }
.medal { font-size: 26px; }

/* ---- Профиль ---- */
.profile-head {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.profile-head .avatar-box {
  width: 92px; height: 92px; border-radius: 22px; background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Russo One', sans-serif; font-size: 38px; color: #241a05;
}
.profile-nick { font-size: 30px; }

/* ---- Футер ---- */
footer {
  border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
  text-align: center; padding: 18px; margin-top: auto;
}

/* ---- Переключатель языка ---- */
.lang-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.lang-btn {
  background: transparent; color: var(--muted); border: none; cursor: pointer;
  padding: 5px 11px; font-family: inherit; font-size: 12px; font-weight: 800; letter-spacing: .5px;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--gold); color: #241a05; }

/* ---- Служебное ---- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hidden { display: none !important; }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }
.link-danger { color: var(--red); cursor: pointer; font-weight: 600; }
.auth-wrap { max-width: 420px; margin: 50px auto; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 720px) {
  .hero h1 { font-size: 30px; }
  .nav { gap: 10px; }
  .nav-right { width: 100%; justify-content: flex-end; }
  .profile-head .profile-nick { font-size: 22px; }
}
