/* ============================================================
   KazRange — главный CSS
   Тема: тёмная тактическая, строгая, профессиональная
   ============================================================ */

/* --- Шрифты --- */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

/* --- Переменные --- */
:root {
  --bg:         #0d0f12;
  --bg2:        #13161b;
  --bg3:        #1a1e25;
  --bg4:        #22272f;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.13);
  --text:       #e8eaed;
  --text2:      #9aa0ab;
  --text3:      #5a6070;
  --accent:     #1ecc8a;
  --accent-dim: #14a06d;
  --accent-bg:  rgba(30,204,138,0.1);
  --red:        #e85454;
  --red-bg:     rgba(232,84,84,0.12);
  --amber:      #f0a832;
  --amber-bg:   rgba(240,168,50,0.12);
  --blue:       #4a9eff;
  --blue-bg:    rgba(74,158,255,0.1);
  --purple:     #9b7fe8;
  --purple-bg:  rgba(155,127,232,0.1);
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --shadow:     0 2px 16px rgba(0,0,0,0.4);
  --font-head:  'Rajdhani', sans-serif;
  --font-body:  'Inter', sans-serif;
  --header-h:   58px;
}

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

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  background: rgba(13,15,18,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0;
}
.header-inner {
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head);
  font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: 0.04em;
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 18px; height: 18px; fill: #0d0f12; }
.logo span.kz { color: var(--accent); }

.main-nav { display: flex; gap: 2px; flex: 1; }
.nav-link {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text2);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--bg3); color: var(--text); }
.nav-link.live-link { color: var(--red); }
.nav-link.live-link::before {
  content: '';
  display: inline-block; width: 7px; height: 7px;
  background: var(--red); border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
  animation: blink 1.2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.header-right { display: flex; align-items: center; gap: 10px; }
.notif-btn {
  position: relative; background: none; border: none; cursor: pointer;
  color: var(--text2); padding: 6px; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.notif-btn:hover { background: var(--bg3); color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--text); }
.hamburger svg { width: 22px; height: 22px; }

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--bg4); border-color: var(--border2); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent); border-color: var(--accent);
  color: #0d0f12; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #0d0f12; }
.btn-danger  { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 2rem 0 4rem; }
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.two-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.card-title {
  font-family: var(--font-head);
  font-size: 18px; font-weight: 600; letter-spacing: 0.03em;
  margin-bottom: 1rem;
  color: var(--text);
}
.card-sm { padding: 1rem 1.25rem; border-radius: var(--radius); }

/* ============================================================
   МАТЧ-КАРТОЧКА
   ============================================================ */
.match-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex; gap: 1rem; align-items: flex-start;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none; color: inherit;
}
.match-card:hover { border-color: var(--border2); background: var(--bg3); text-decoration: none; }
.match-card.done { opacity: 0.6; }
.match-card + .match-card { margin-top: 8px; }

.match-date {
  min-width: 52px; text-align: center;
  border-right: 1px solid var(--border);
  padding-right: 1rem;
}
.match-date-day {
  font-family: var(--font-head);
  font-size: 28px; font-weight: 700; line-height: 1;
  color: var(--text);
}
.match-date-month { font-size: 12px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

.match-body { flex: 1; min-width: 0; }
.match-name {
  font-family: var(--font-head);
  font-size: 17px; font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.match-location { font-size: 12px; color: var(--text3); }
.match-location svg { vertical-align: middle; width: 12px; height: 12px; margin-right: 3px; }

.match-right { text-align: right; flex-shrink: 0; }
.slots-text { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.slots-bar { width: 64px; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; margin-left: auto; }
.slots-fill { height: 100%; border-radius: 2px; }
.slots-ok   .slots-fill { background: var(--accent); }
.slots-warn .slots-fill { background: var(--amber); }
.slots-full .slots-fill { background: var(--red); }

/* ============================================================
   БЕЙДЖИ / ДИСЦИПЛИНЫ
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  line-height: 1.4; white-space: nowrap;
}
.disc-pistol    { background: rgba(74,158,255,0.15); color: #4a9eff; border: 1px solid rgba(74,158,255,0.25); }
.disc-shotgun   { background: rgba(240,168,50,0.15); color: #f0a832; border: 1px solid rgba(240,168,50,0.25); }
.disc-carbine   { background: rgba(155,127,232,0.15); color: #9b7fe8; border: 1px solid rgba(155,127,232,0.25); }
.disc-pcc       { background: rgba(30,204,138,0.15); color: #1ecc8a; border: 1px solid rgba(30,204,138,0.25); }
.disc-actionair { background: rgba(30,204,138,0.1); color: #14c27a; border: 1px solid rgba(30,204,138,0.2); }
.disc-sniper    { background: rgba(232,84,84,0.15); color: #e85454; border: 1px solid rgba(232,84,84,0.25); }
.disc-seminar   { background: rgba(90,96,112,0.3); color: #9aa0ab; border: 1px solid var(--border2); }
.badge-level    { background: var(--bg4); color: var(--text2); border: 1px solid var(--border2); }
.badge-done     { background: var(--bg4); color: var(--text3); border: 1px solid var(--border); }
.badge-reg      { background: var(--accent-bg); color: var(--accent); border: 1px solid rgba(30,204,138,0.3); }
.badge-open     { background: rgba(30,204,138,0.1); color: var(--accent); }
.badge-closed   { background: var(--red-bg); color: var(--red); }
.badge-live     { background: var(--red-bg); color: var(--red); animation: blink 1.2s infinite; }
.badge-kz { background: rgba(0,170,104,0.12); color: #00aa68; border: 1px solid rgba(0,170,104,0.2); }

/* ============================================================
   ФИЛЬТРЫ
   ============================================================ */
.filters-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 1.5rem;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.filter-label { font-size: 11px; color: var(--text3); margin-right: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.filter-chip {
  background: none; border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 99px;
  font-size: 12px; color: var(--text2);
  cursor: pointer; transition: all 0.15s;
}
.filter-chip:hover { background: var(--bg3); border-color: var(--border2); color: var(--text); }
.filter-chip.on { background: var(--accent-bg); border-color: rgba(30,204,138,0.4); color: var(--accent); font-weight: 500; }

/* ============================================================
   СЕКЦИЯ / ЗАГОЛОВОК
   ============================================================ */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text3); letter-spacing: 0.08em; text-transform: uppercase; }

/* ============================================================
   ФОРМЫ
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 5px; font-weight: 500; }
.form-label span.req { color: var(--red); margin-left: 2px; }
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: var(--text3); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0ab' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: var(--bg3); }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text3); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.rank-1 { background: rgba(240,168,50,0.2); color: #f0a832; }
.rank-2 { background: rgba(180,180,200,0.15); color: #b4b4c8; }
.rank-3 { background: rgba(200,120,80,0.2); color: #c87850; }
.rank-n { background: var(--bg4); color: var(--text3); font-size: 11px; }

/* ============================================================
   ФЛЭШ-СООБЩЕНИЯ
   ============================================================ */
.flash {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 1rem; font-size: 14px;
  border: 1px solid;
}
.flash-success { background: var(--accent-bg); border-color: rgba(30,204,138,0.3); color: var(--accent); }
.flash-error   { background: var(--red-bg);    border-color: rgba(232,84,84,0.3);   color: var(--red); }
.flash-warning { background: var(--amber-bg);  border-color: rgba(240,168,50,0.3);  color: var(--amber); }
.flash-info    { background: var(--blue-bg);   border-color: rgba(74,158,255,0.3);  color: var(--blue); }

/* ============================================================
   МЕТРИКИ
   ============================================================ */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.metric-card { background: var(--bg3); border-radius: var(--radius); padding: 12px 16px; }
.metric-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.metric-value { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.metric-value.accent { color: var(--accent); }

/* ============================================================
   ПАГИНАЦИЯ
   ============================================================ */
.pagination { display: flex; gap: 4px; margin-top: 1.5rem; }
.page-btn {
  min-width: 34px; height: 34px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 13px;
  text-decoration: none; transition: all 0.15s;
}
.page-btn:hover { background: var(--bg4); color: var(--text); text-decoration: none; }
.page-btn.active { background: var(--accent-bg); border-color: rgba(30,204,138,0.4); color: var(--accent); font-weight: 600; }

/* ============================================================
   ПУСТОЕ СОСТОЯНИЕ
   ============================================================ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text3); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: 0.3; }
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   СТРАНИЦА МАТЧА
   ============================================================ */
.match-hero {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.match-hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.match-hero-title {
  font-family: var(--font-head);
  font-size: 32px; font-weight: 700; letter-spacing: 0.03em;
  margin: 10px 0 8px;
}
.match-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-top: 1.5rem; }
.match-info-cell { background: var(--bg3); border-radius: var(--radius); padding: 10px 14px; }
.match-info-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.match-info-value { font-size: 15px; font-weight: 600; }

/* ============================================================
   LIVE
   ============================================================ */
.live-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
.live-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.pct-bar { width: 80px; height: 5px; background: var(--bg4); border-radius: 3px; display: inline-block; vertical-align: middle; overflow: hidden; }
.pct-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* ============================================================
   ПРОФИЛЬ
   ============================================================ */
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-bg);
  border: 2px solid rgba(30,204,138,0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 22px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.tabs-nav { display: flex; gap: 2px; background: var(--bg3); border-radius: var(--radius); padding: 4px; margin-bottom: 1.5rem; border: 1px solid var(--border); }
.tab-btn {
  flex: 1; padding: 8px; border: none; background: none;
  border-radius: 7px; font-size: 14px; color: var(--text2);
  cursor: pointer; transition: all 0.15s;
}
.tab-btn.active { background: var(--bg2); color: var(--text); font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 13px; color: var(--text3);
}
.footer a { color: var(--text3); }
.footer a:hover { color: var(--accent); }

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column;
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem; z-index: 199; gap: 4px;
  }
  .hamburger { display: flex; }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .match-hero-title { font-size: 22px; }
  .filters-bar { padding: 8px 1rem; }
  .page-wrap { padding: 0 1rem; }
  .header-inner { padding: 0 1rem; }
}
@media (max-width: 480px) {
  .three-col { grid-template-columns: 1fr; }
  .two-equal { grid-template-columns: 1fr; }
  .match-card { flex-wrap: wrap; }
  .match-right { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; }
  .slots-bar { margin-left: 0; }
}

/* ============================================================
   QUIZ ПОДМОДУЛЬ
   ============================================================ */
.quiz-progress { background: var(--bg3); border-radius: 99px; height: 6px; overflow: hidden; margin-bottom: 1.5rem; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.4s ease; }
.quiz-q { font-size: 17px; font-weight: 500; line-height: 1.6; margin-bottom: 1.5rem; color: var(--text); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
  display: flex; gap: 12px; align-items: flex-start;
  text-align: left; width: 100%;
  color: var(--text);
}
.quiz-option:hover { border-color: var(--accent); background: var(--accent-bg); }
.quiz-option.correct { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.quiz-option.wrong   { border-color: var(--red);   background: var(--red-bg);   color: var(--red); }
.quiz-option.disabled { cursor: default; }
.quiz-opt-letter {
  min-width: 28px; height: 28px; border-radius: 6px;
  background: var(--bg4); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.quiz-option.correct .quiz-opt-letter { background: var(--accent); color: #0d0f12; border-color: var(--accent); }
.quiz-option.wrong   .quiz-opt-letter { background: var(--red);   color: #fff;   border-color: var(--red); }
.quiz-rule-ref { font-size: 12px; color: var(--text3); margin-top: 12px; }
.cert-block { background: var(--bg2); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 2rem; text-align: center; }
.cert-icon { font-size: 48px; margin-bottom: 1rem; }

/* ============================================================
   УТИЛИТЫ
   ============================================================ */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-center { text-align: center; }
.font-head   { font-family: var(--font-head); }
.fw-700      { font-weight: 700; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.gap-2       { gap: 0.5rem; }
.gap-3       { gap: 1rem; }
.flex-1      { flex: 1; }
