/* ============================================================
   QQALL.RU — главные стили
   Шрифт: Montserrat (self-hosted)
   ============================================================ */

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-ExtraBold.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}

/* --- Переменные --- */
:root {
  --font: 'Montserrat', sans-serif;
  --bg:   #06060a;
  --bg2:  #0d0d14;
  --bg3:  #13131e;
  --border: rgba(255,255,255,0.07);
  --text:   #e2e8f0;
  --muted:  rgba(226,232,240,0.45);
  --dim:    rgba(226,232,240,0.25);
  --accent-purple: #c84bff;
  --accent-orange: #ff6a00;
  --accent-grad: linear-gradient(135deg, #7c3aed, #c84bff);
  /* Dota 2 */
  --dota-green: #22c55e;
  --dota-green-dim: rgba(34,197,94,0.12);
  /* Diablo IV */
  --d4-red: #c84040;
  --d4-red-dim: rgba(180,40,40,0.12);
  /* Dance World */
  --dw-blue: #818cf8;
  --dw-blue-dim: rgba(129,140,248,0.12);
  /* Discord */
  --discord: #5865f2;
  --radius: 10px;
  --radius-lg: 14px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: var(--font); }

/* --- Утилиты --- */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 32px;
  background: rgba(6,6,10,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.nav-logo img { height: 32px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-size: 13px; font-weight: 600;
  color: var(--muted); padding: 6px 12px; border-radius: 7px;
  transition: all .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,0.07); }
.nav-cta {
  display: flex; align-items: center; gap: 8px;
  background: var(--discord); border: none; color: #fff;
  font-size: 13px; font-weight: 700; padding: 8px 18px;
  border-radius: 8px; cursor: pointer; transition: transform .15s;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta svg { width: 17px; height: 17px; fill: #fff; flex-shrink: 0; }

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: 9px; border: none;
  cursor: pointer; transition: transform .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.98); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-outline {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
}
.btn-outline:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.btn-purple { background: var(--accent-grad); color: #fff; }
.btn-green  { background: linear-gradient(135deg,#15803d,#22c55e); color: #fff; }
.btn-red    { background: linear-gradient(135deg,#991b1b,#dc2626); color: #fff; }

/* ============================================================
   BADGE / TAG
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; padding: 3px 10px; border-radius: 5px;
}
.badge-pulse::before {
  content: ''; display: block; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor;
  animation: badge-blink 2s ease-in-out infinite;
}
@keyframes badge-blink { 0%,100%{opacity:1}50%{opacity:.3} }
.badge-green { background: rgba(34,197,94,.1); color: #86efac; border: 1px solid rgba(34,197,94,.2); }
.badge-red   { background: rgba(220,40,40,.1); color: #fca5a5; border: 1px solid rgba(220,40,40,.2); }
.badge-blue  { background: rgba(129,140,248,.1); color: #c7d2fe; border: 1px solid rgba(129,140,248,.2); }
.badge-purple{ background: rgba(200,75,255,.1); color: #d8b4fe; border: 1px solid rgba(200,75,255,.2); }

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* ============================================================
   TICKER (бегущая строка)
   ============================================================ */
.ticker-wrap {
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.ticker-inner {
  display: flex; gap: 48px;
  animation: ticker-move 22s linear infinite;
  width: max-content; white-space: nowrap;
}
@keyframes ticker-move { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.ticker-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--dim);
}
.ticker-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-purple); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.footer-copy { font-size: 12px; color: var(--dim); }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  font-size: 12px; font-weight: 600; color: var(--dim);
  transition: color .15s;
}
.footer-links a:hover { color: var(--text); }

/* ============================================================
   DISCORD CTA БЛОК
   ============================================================ */
.discord-cta {
  position: relative; overflow: hidden;
  margin: 0 32px 48px;
  background: #1e2028;
  border: 1px solid rgba(88,101,242,.3);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.discord-cta-glow {
  position: absolute; border-radius: 50%; pointer-events: none;
}
.discord-cta-glow:nth-child(1) {
  width: 260px; height: 260px; left: -60px; top: -60px;
  background: radial-gradient(circle, rgba(88,101,242,.15), transparent 70%);
}
.discord-cta-glow:nth-child(2) {
  width: 180px; height: 180px; right: -40px; bottom: -40px;
  background: radial-gradient(circle, rgba(200,75,255,.1), transparent 70%);
}
.discord-cta-content { position: relative; z-index: 1; }
.discord-cta-title { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.discord-cta-sub { font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 380px; }
.discord-avatars { display: flex; margin-top: 16px; }
.discord-avatars .av {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #1e2028; margin-left: -9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
}
.discord-avatars .av:first-child { margin-left: 0; }
.discord-avatars-count { font-size: 12px; color: var(--muted); margin-left: 10px; align-self: center; }
.discord-avatars-count b { color: var(--text); }
.discord-cta-btn { position: relative; z-index: 1; flex-shrink: 0; }

/* ============================================================
   GAME CARDS (главная)
   ============================================================ */
.game-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.game-card {
  border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,.07);
  min-height: 200px; padding: 20px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.15); }
.game-card-shine {
  position: absolute; top: 0; right: 0;
  width: 140px; height: 140px; border-radius: 0 var(--radius-lg) 0 0;
}
.game-card-grid {
  position: absolute; inset: 0; opacity: .035;
  background-image: repeating-linear-gradient(0deg,transparent,transparent 28px,rgba(255,255,255,.5) 28px,rgba(255,255,255,.5) 29px);
}
.game-card-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 4px; letter-spacing: -.3px; }
.game-card-meta  { font-size: 11px; color: rgba(255,255,255,.4); font-weight: 500; }
.game-card-arrow {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: rgba(255,255,255,.4);
}

/* D4 card */
.game-card-d4 { background: linear-gradient(150deg,#0d0303,#1a0505,#4a0e0e,#7a1515); }
.game-card-d4 .game-card-shine { background: radial-gradient(circle at top right,rgba(255,60,60,.32),transparent 65%); }
/* Dota card */
.game-card-dota { background: linear-gradient(150deg,#010d08,#03180f,#0a3d22,#165c35); }
.game-card-dota .game-card-shine { background: radial-gradient(circle at top right,rgba(30,220,100,.25),transparent 65%); }
/* DW card */
.game-card-dw { background: linear-gradient(150deg,#02020f,#050519,#0d0d4a,#1a1a7a); }
.game-card-dw .game-card-shine { background: radial-gradient(circle at top right,rgba(130,100,255,.32),transparent 65%); }

/* ============================================================
   ТАЙМЕРЫ (D4)
   ============================================================ */
.timer-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
}
.timer-card:last-child { margin-bottom: 0; }
.timer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.timer-name { font-size: 12px; font-weight: 700; color: var(--text); }
.timer-value { font-size: 22px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.timer-sub { font-size: 10px; color: var(--dim); margin-top: 2px; font-weight: 500; }

/* ============================================================
   SEASON STRIP (D4)
   ============================================================ */
.season-strip {
  display: grid; grid-template-columns: repeat(3,1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(5,3,14,.95);
}
.season-strip-item { padding: 14px 20px; text-align: center; border-right: 1px solid var(--border); }
.season-strip-item:last-child { border-right: none; }
.season-strip-label { font-size: 10px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px; }
.season-strip-value { font-size: 14px; font-weight: 700; color: #c0b0ff; }
.season-strip-value.large { font-size: 20px; font-weight: 900; }

/* ============================================================
   DOTA 2 - таблица очков
   ============================================================ */
.guild-table-wrap { padding: 16px 24px 24px; }
.guild-table-header {
  display: grid;
  grid-template-columns: 36px 1fr 90px 100px 120px;
  padding: 0 14px 10px; gap: 0;
}
.guild-th {
  font-size: 10px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: .8px;
}
.guild-th.right { text-align: right; }
.guild-th.center { text-align: center; }

.player-row {
  display: grid;
  grid-template-columns: 36px 1fr 90px 100px 120px;
  align-items: center; gap: 0;
  padding: 10px 14px; border-radius: 9px;
  margin-bottom: 6px; border: 1px solid transparent;
  cursor: pointer; transition: all .15s;
}
.player-row:hover { background: rgba(34,197,94,.04); border-color: rgba(34,197,94,.1); }
.player-row.rank-1 { background: rgba(250,204,21,.03); border-color: rgba(250,204,21,.1); }

.player-rank { font-size: 13px; font-weight: 800; color: var(--dim); text-align: center; }
.player-rank.gold   { color: #fbbf24; }
.player-rank.silver { color: #94a3b8; }
.player-rank.bronze { color: #b45309; }

.player-info { display: flex; align-items: center; gap: 10px; }
.player-avatar {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.08);
}
.player-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #86efac;
}
.player-name { font-size: 13px; font-weight: 700; color: var(--text); }
.player-name a:hover { color: #86efac; }
.player-sub  { font-size: 11px; color: var(--dim); margin-top: 1px; font-weight: 500; }

.player-pts { font-size: 16px; font-weight: 800; color: #86efac; text-align: right; }
.player-delta { font-size: 13px; font-weight: 700; text-align: right; }
.player-delta.pos  { color: #4ade80; }
.player-delta.neg  { color: #f87171; }
.player-delta.zero { color: var(--dim); }

/* Спарклайн */
.sparkline-cell { display: flex; align-items: center; justify-content: flex-end; }
.sparkline-cell canvas { display: block; }

/* ============================================================
   DANCE WORLD
   ============================================================ */
.dw-clan-name {
  font-size: 32px; font-weight: 900; color: #fff;
  letter-spacing: -.5px; margin-bottom: 8px;
  font-style: italic;
}
.dw-info-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 20px; }
.dw-info-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.dw-info-label { font-size: 10px; font-weight: 700; color: var(--dw-blue); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.dw-info-value { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; }

.primetime-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; margin-top: 10px; }
.pt-day {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 4px; text-align: center;
}
.pt-day.active { background: var(--dw-blue-dim); border-color: rgba(129,140,248,.25); }
.pt-day-name { font-size: 10px; font-weight: 700; color: var(--dim); margin-bottom: 4px; }
.pt-day.active .pt-day-name { color: var(--dw-blue); }
.pt-day-time { font-size: 10px; font-weight: 600; color: var(--dim); line-height: 1.4; }
.pt-day.active .pt-day-time { color: var(--text); }
.pt-msk { font-size: 9px; color: var(--dim); margin-top: 2px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 24px; }
.admin-card {
  background: #0e1420; border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
}
.admin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.admin-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px;
}
.admin-card-body { padding: 18px; }
.admin-field { margin-bottom: 14px; }
.admin-field:last-child { margin-bottom: 0; }
.admin-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--dim); margin-bottom: 6px;
}
.admin-input {
  width: 100%; background: #06080f; border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 500;
  padding: 10px 14px; font-family: var(--font); outline: none;
  transition: border-color .15s;
}
.admin-input:focus { border-color: rgba(124,58,237,.45); }
.admin-input.green:focus { border-color: rgba(34,197,94,.45); }
.admin-hint { font-size: 11px; color: var(--dim); margin-top: 5px; font-weight: 500; }
.admin-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.admin-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: rgba(255,255,255,.02);
  border-top: 1px solid rgba(255,255,255,.05);
}
.admin-status { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.admin-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }

/* Upload зона */
.upload-zone {
  border: 1.5px dashed rgba(255,255,255,.12); border-radius: 10px;
  height: 180px; position: relative; overflow: hidden; cursor: pointer;
  transition: border-color .2s;
}
.upload-zone:hover { border-color: rgba(180,40,40,.4); }
.upload-zone img { width: 100%; height: 100%; object-fit: cover; }
.upload-zone-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all .2s;
}
.upload-zone:hover .upload-zone-overlay { background: rgba(0,0,0,.5); opacity: 1; }
.upload-zone-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.upload-zone-placeholder i { font-size: 28px; color: var(--dim); }
.upload-zone-placeholder span { font-size: 12px; font-weight: 600; color: var(--dim); }

/* Таблица ввода очков */
.pts-table { width: 100%; border-collapse: collapse; }
.pts-table th {
  font-size: 10px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: .8px;
  padding: 0 12px 10px; text-align: left;
}
.pts-table th.right { text-align: right; }
.pts-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.pts-table tr:last-child td { border-bottom: none; }
.pts-table .player-cell { display: flex; align-items: center; gap: 10px; }
.pts-table .player-cell img { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; }
.pts-table .player-cell span { font-size: 13px; font-weight: 600; color: var(--text); }
.pts-input {
  width: 120px; background: #06080f; border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; color: #86efac; font-size: 14px; font-weight: 700;
  padding: 7px 12px; text-align: right; font-family: var(--font);
  outline: none; transition: border-color .15s; float: right;
}
.pts-input:focus { border-color: rgba(34,197,94,.4); }
.pts-calc { font-size: 13px; font-weight: 700; text-align: right; min-width: 70px; }
.pts-calc.pos  { color: #4ade80; }
.pts-calc.neg  { color: #f87171; }
.pts-calc.zero { color: var(--dim); }

/* Прайм-тайм редактор */
.pt-editor { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; }
.pt-editor-day { background: var(--bg2); border: 1px solid var(--border); border-radius: 9px; padding: 10px; }
.pt-editor-day-name { font-size: 11px; font-weight: 700; color: var(--dim); margin-bottom: 8px; text-align: center; }
.pt-editor-day label { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--dim); cursor: pointer; margin-bottom: 8px; }
.pt-editor-day input[type=time] {
  width: 100%; background: #06080f; border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; color: var(--text); font-size: 11px; font-weight: 600;
  padding: 5px 6px; margin-bottom: 4px; font-family: var(--font); outline: none;
}
.pt-editor-day input[type=time]:focus { border-color: rgba(129,140,248,.4); }
.pt-editor-day input[type=checkbox] { accent-color: var(--dw-blue); }

/* Toast */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #0f2a1a; border: 1px solid rgba(34,197,94,.3);
  color: #4ade80; font-size: 13px; font-weight: 700;
  padding: 11px 22px; border-radius: 9px;
  transition: transform .3s; z-index: 9999;
  pointer-events: none; white-space: nowrap;
  font-family: var(--font);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 768px) {
  .site-nav { padding: 0 16px; }
  .nav-links { display: none; }
  .game-cards { grid-template-columns: 1fr; }
  .discord-cta { flex-direction: column; margin: 0 16px 32px; padding: 24px; }
  .guild-table-header,
  .player-row { grid-template-columns: 32px 1fr 80px; }
  .player-row > :nth-child(4),
  .player-row > :nth-child(5),
  .guild-table-header > :nth-child(4),
  .guild-table-header > :nth-child(5) { display: none; }
  .dw-info-grid { grid-template-columns: 1fr; }
  .primetime-grid { grid-template-columns: repeat(4,1fr); }
  .pt-editor { grid-template-columns: repeat(4,1fr); }
  .admin-2col, .admin-3col { grid-template-columns: 1fr; }
}
