/* ═══════════════════════════════════════════════════════
   Match Center — PM5 Dark Theme Stylesheet
   Pages: match_center.php, competition.php, match.php, match_submit.php
   ═══════════════════════════════════════════════════════ */

/* ── 1. CSS Variables ──
   Токены приезжают из css/pm5-theme.css (подключается в topheader.php):
   свой набор здесь был копией и со временем разъезжался с общим. */

/* ── 2. Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-display);
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-main); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

/* ── 3. Ambient Background ── */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient::before {
  content: '';
  position: absolute;
  top: -30vh; left: -20vw;
  width: 80vw; height: 80vh;
  background: radial-gradient(ellipse, rgba(181,255,59,0.04) 0%, transparent 70%);
  animation: mc-drift 18s ease-in-out infinite alternate;
}
@keyframes mc-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.08); }
}

/* ── 4. Layout ── */
.page { position: relative; z-index: 2; min-height: 100vh; }
.mc-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px;
  animation: mc-fadeUp .5s var(--ease-out) both;
}
.mc-container--narrow { max-width: 800px; }
.mc-container--mid { max-width: 900px; }
.mc-container--xs { max-width: 640px; }

@keyframes mc-fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 5. Card ── */
.card {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
}

/* ── 6. Typography ── */
h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
h3 i { margin-right: 4px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* ── 7. Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass-strong);
  color: var(--text-main);
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-display);
  text-decoration: none;
}
.btn:hover {
  border-color: var(--border-glow);
  transform: translateY(-1px);
  color: var(--text-main);
}
.btn-primary {
  background: linear-gradient(135deg, rgba(181,255,59,0.2), rgba(120,200,30,0.15));
  border-color: var(--border-glow);
  color: var(--accent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(181,255,59,0.3), rgba(120,200,30,0.2));
}
.btn-danger { border-color: rgba(255,92,92,0.3); color: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 8. Notices ── */
.notice { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.notice-success { background: rgba(62,187,129,0.12); border: 1px solid rgba(86,220,155,0.3); color: #b6f0ce; }
.notice-error { background: rgba(255,92,92,0.1); border: 1px solid rgba(255,92,92,0.3); color: #ff8a8a; }
.notice-info { background: rgba(181,255,59,0.06); border: 1px solid var(--border-glow); color: var(--accent); }
.notice-warn { background: rgba(255,200,50,0.08); border: 1px solid rgba(255,200,50,0.25); color: #ffd866; }

/* ── 8b. Notification Items ── */
.notif-item { padding: 10px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-club { font-weight: 600; color: var(--accent); }
.notif-time { color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }

/* ── 9. Badges ── */
.comp-badge { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.badge-active { background: var(--accent); box-shadow: 0 0 6px var(--accent-soft); }
.badge-finished { background: rgba(255,255,255,0.25); }

/* ── 10. Form Inputs ── */
input[type="number"], input[type="text"], input[type="url"], input[type="date"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(7,10,15,0.8);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 14px;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ══════════════════════════════════════════════════════
   MATCH CENTER HUB (match_center.php)
   ══════════════════════════════════════════════════════ */

/* Competitions grid */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 28px; }
.comp-grid.show-only-mine .comp-card[data-mine="0"] { display: none; }
.comp-grid.hide-finished .comp-card[data-status="finished"] { display: none; }

/* Comp filter toggle */
.comp-filter-bar { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.comp-filter-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,13,24,0.6);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer;
  transition: all .2s var(--ease-out);
}
.comp-filter-btn i { color: var(--accent); font-size: 11px; }
.comp-filter-btn:hover { border-color: rgba(181,255,59,0.4); background: rgba(181,255,59,0.06); }
.comp-filter-btn .cf-label-mine { display: none; }
.comp-filter-btn.active {
  background: rgba(181,255,59,0.14);
  border-color: rgba(181,255,59,0.5);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(181,255,59,0.15);
}
.comp-filter-btn.active .cf-label-all { display: none; }
.comp-filter-btn.active .cf-label-mine { display: inline; }

/* Заголовок страны/федерации внутри сетки соревнований.
   Живёт как элемент грида во всю строку — так фильтры «мои»/«завершённые»
   продолжают работать на том же контейнере. */
.comp-group-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 -2px;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-main);
}
.comp-group-head:first-child { margin-top: 0; }
.comp-group-head i { color: var(--accent); font-size: 12px; }
.comp-group-flag { flex: 0 0 auto; display: block; }
.comp-group-head::after {
  content: ''; flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg, rgba(181,255,59,0.25), transparent);
}
.comp-group-head.is-empty { display: none; }

/* Архив завершённых соревнований по сезонам (кнопка «Архив») */
.mc-archive { display: none; margin: -16px 0 28px; }
.mc-archive.is-open { display: block; }
.mc-arch-season { margin-bottom: 20px; }
.mc-arch-season:last-child { margin-bottom: 0; }
.mc-arch-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.mc-arch-title i { color: var(--accent); font-size: 11px; }
.mc-arch-title span:first-of-type { color: var(--text-main); }
.mc-arch-now {
  padding: 2px 8px; border-radius: var(--radius-pill);
  border: 1px solid rgba(181,255,59,0.35); color: var(--accent);
  font-size: 9px; letter-spacing: 0.06em;
}
.mc-arch-count {
  margin-left: auto; padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.05); font-size: 10px;
}
.mc-arch-grid { margin-bottom: 14px; }
.mc-arch-grid:last-child { margin-bottom: 0; }
.mc-arch-group {
  display: flex; align-items: center; gap: 7px; margin: 0 0 8px;
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.mc-arch-group i { color: var(--accent); font-size: 10px; }
.comp-winner {
  margin-top: 4px; font-size: 11px; color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comp-winner i { font-size: 10px; margin-right: 2px; }
.comp-winner-none { color: var(--text-muted); font-style: italic; }
.comp-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: all .25s var(--ease-out);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.comp-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 30px rgba(181,255,59,0.06);
}
.comp-card .comp-icon {
  font-size: 18px; color: var(--accent);
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
}
.comp-card .comp-body { flex: 1 1 auto; min-width: 0; }
.comp-card .comp-name {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 14px; margin-bottom: 3px;
}
.comp-card .comp-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-card .comp-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-card .comp-progress { margin-top: 6px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.06); }
.comp-card .comp-progress-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .3s; }

/* Match rows (shared: hub, competition) */
.match-list { display: flex; flex-direction: column; gap: 3px; }
.match-row {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all .15s;
}
/* колонку под значок резервируем только когда он реально есть */
.match-row.has-notif { grid-template-columns: auto auto auto 1fr 24px; }
.match-row:hover { background: rgba(181,255,59,0.03); border-color: rgba(181,255,59,0.1); }
.match-row .team { display: flex; align-items: center; flex: 0 0 auto; }
.match-row .score { font-family: var(--font-mono); font-weight: 700; font-size: 15px; text-align: center; min-width: 50px; letter-spacing: 1px; }
.match-row .score.tech { color: var(--danger); font-size: 12px; }
.match-row .match-info { font-size: 11px; line-height: 1.35; color: var(--text-muted); text-align: right; }
.mc-round { color: var(--accent); font-weight: 600; }
.mc-deadline { color: #ffd866; font-weight: 600; }
.match-row .highlight { color: var(--accent); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Competition switcher for match lists */
.mc-comp-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.mc-cs-label { color: var(--text-muted); font-size: 12px; margin-right: 2px; }
.mc-cs-chip {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,13,24,0.6);
  color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: all .15s var(--ease-out);
}
.mc-cs-chip:hover { border-color: rgba(181,255,59,0.4); color: var(--text-main); }
.mc-cs-chip.active {
  background: rgba(181,255,59,0.14);
  border-color: rgba(181,255,59,0.5);
  color: var(--accent);
}
.mc-list-empty { color: var(--text-muted); font-size: 13px; padding: 4px 2px; }

/* Main + sidebar layout */
.mc-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.mc-with-sidebar.no-sidebar { grid-template-columns: 1fr; }
.mc-with-sidebar .two-col { margin-bottom: 0; }
@media (max-width: 1100px) {
  .mc-with-sidebar { grid-template-columns: 1fr; }
}

/* Free clubs sidebar */
.free-clubs-card {
  position: sticky;
  top: 20px;
}
.free-clubs-card h2 i { color: #ff9f43; }
.free-clubs-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 520px; overflow-y: auto;
  margin: 0; padding: 4px 4px 0 0; list-style: none;
}
.free-clubs-list::-webkit-scrollbar { width: 4px; }
.free-clubs-list::-webkit-scrollbar-track { background: transparent; }
.free-clubs-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.free-club-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  background: rgba(10,13,24,0.6);
  border: 1px solid rgba(255,255,255,0.05);
  text-decoration: none; color: var(--text-main);
  transition: all .2s var(--ease-out);
}
.free-club-item:hover {
  border-color: rgba(255,159,67,0.45);
  background: rgba(255,159,67,0.08);
  transform: translateX(2px);
}
.free-club-item .fc-info {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
}
.free-club-item .fc-name {
  font-size: 13px; font-weight: 600; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.free-club-item .fc-league {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 0.04em;
}
.free-clubs-empty {
  padding: 14px; border-radius: var(--radius-md);
  background: rgba(10,13,24,0.5); border: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-muted); font-size: 12px; text-align: center;
}
.free-clubs-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--radius-pill);
  background: rgba(255,159,67,0.14);
  border: 1px solid rgba(255,159,67,0.35);
  color: #ff9f43; font-size: 11px; font-weight: 700;
  margin-left: 8px;
}

/* ══════════════════════════════════════════════════════
   COMPETITION PAGE (competition.php)
   ══════════════════════════════════════════════════════ */

/* Competition header */
.comp-header { text-align: center; margin-bottom: 8px; }
.comp-header h1 { font-size: 26px; font-weight: 800; }
.comp-header .meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.comp-header .badge { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 600; margin-left: 6px; }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all .15s;
  text-decoration: none;
}
.tab:hover { border-color: var(--border-glow); color: var(--text-main); }
.tab.active { background: var(--accent-soft); border-color: var(--border-glow); color: var(--accent); }

/* Standings table */
.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings th { text-align: left; padding: 8px 6px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border-subtle); }
.standings td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,0.03); vertical-align: middle; }
.standings tr:hover td { background: rgba(181,255,59,0.02); }
.standings .pos { font-family: var(--font-mono); font-weight: 700; width: 48px; text-align: left; white-space: nowrap; }
.standings .pos .zone-slot { display: inline-block; width: 19px; text-align: center; }
.standings .pos .pos-num { display: inline-block; min-width: 18px; text-align: right; }
.standings .euro-zone { height: 15px; width: auto; vertical-align: middle; }
.standings .pos .zone-direct { color: #7fffb0; font-size: 12px; vertical-align: middle; }
.standings .pos .zone-playin { color: #ffd866; font-size: 12px; vertical-align: middle; }
.standings .club-name { font-weight: 600; }
/* Отступ между флагом/лого и названием. У клубного лого свой inline-margin (3px,
   не перебивается), у флага сборной inline-отступа нет — задаём здесь. */
.standings .club-name img { margin-right: 5px; }
.standings .num { font-family: var(--font-mono); text-align: center; min-width: 28px; }
.standings .pts { font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.standings .form-cell .form-W,
.standings .form-cell .form-D,
.standings .form-cell .form-L { display: inline-block; width: 16px; height: 16px; border-radius: 3px; text-align: center; font-size: 10px; font-weight: 700; line-height: 16px; margin-right: 1px; }
.standings .form-cell a.form-W,
.standings .form-cell a.form-D,
.standings .form-cell a.form-L { text-decoration: none; cursor: pointer; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.standings .form-cell a.form-W:hover,
.standings .form-cell a.form-D:hover,
.standings .form-cell a.form-L:hover { transform: scale(1.25); box-shadow: 0 0 0 1px rgba(255,255,255,0.2), 0 2px 8px rgba(0,0,0,0.4); position: relative; z-index: 2; }
.standings .form-cell .form-W, .form-W { background: rgba(62,187,129,0.3); color: #7fffb0; }
.standings .form-cell .form-D, .form-D { background: rgba(255,200,50,0.2); color: #ffd866; }
.standings .form-cell .form-L, .form-L { background: rgba(255,92,92,0.2); color: #ff8a8a; }
.standings .form-cell a.form-W:hover { color: #7fffb0; }
.standings .form-cell a.form-D:hover { color: #ffd866; }
.standings .form-cell a.form-L:hover { color: #ff8a8a; }

/* Дисквалификации тура (под списком матчей в Расписании) */
.round-disq {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255,92,92,0.04);
  border: 1px solid rgba(255,92,92,0.18);
  border-radius: var(--radius-sm);
}
.round-disq-title { font-size: 11px; font-weight: 700; color: #ff8a8a; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.round-disq-title i { margin-right: 4px; }
.round-disq-list { display: flex; flex-direction: column; gap: 4px; }
.round-disq-club { font-size: 13px; line-height: 1.5; color: var(--text-main); }
.round-disq-club .rdq-club { font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.round-disq-club .rdq-club img { vertical-align: middle; margin-right: 4px; }
.round-disq-club .rdq-player { color: var(--text-main); text-decoration: none; }
.round-disq-club .rdq-player:hover { color: var(--accent); }
.round-disq-club .rdq-reason { color: var(--text-muted); font-size: 11px; margin-left: 2px; }

/* Form badge hover-card (match preview) */
.form-badge-wrap { position: relative; display: inline-block; }
.form-badge-wrap:hover { z-index: 20; }
.form-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  display: grid;
  gap: 6px;
  min-width: 260px;
  padding: 10px 12px;
  background: var(--surface-elevated, #15181d);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--elev-2);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out), visibility 0s linear .15s;
  z-index: 30;
  white-space: nowrap;
}
.form-badge-wrap:hover .form-tooltip,
.form-badge-wrap:focus-within .form-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  visibility: visible;
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out), visibility 0s linear 0s;
}
.form-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--border-subtle);
}
.form-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  margin-top: -1px;
  border: 5px solid transparent;
  border-top-color: var(--surface-elevated, #15181d);
  z-index: 1;
}
.form-tooltip .ft-round { font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.form-tooltip .ft-venue { color: var(--text-muted); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 2px; }
.form-tooltip .ft-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.form-tooltip .ft-team { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-main); }
.form-tooltip .ft-team.home { justify-content: flex-end; }
.form-tooltip .ft-team.away { justify-content: flex-start; }
.form-tooltip .ft-team.me { color: var(--accent); }
.form-tooltip .ft-team img { width: 20px; height: 20px; object-fit: contain; }
.form-tooltip .ft-score { font-family: var(--font-mono); font-weight: 700; font-size: 15px; letter-spacing: 1px; text-align: center; min-width: 56px; }
.form-tooltip .ft-score.tech { color: var(--danger); font-size: 12px; letter-spacing: 0; }
.form-tooltip .ft-meta { font-size: 11px; color: var(--text-muted); text-align: center; }

/* Competition match rows (3-col variant, 4-col with notification) */
.comp-match-row { grid-template-columns: 1fr 70px 1fr; gap: 6px; position: relative; }
.comp-match-row .tp-mark { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .5px; padding: 2px 6px; border-radius: var(--radius-pill); background: rgba(255,92,92,0.14); color: var(--danger); pointer-events: none; }
.comp-match-row.has-notif { grid-template-columns: 1fr 70px 1fr; }
.comp-match-row .notif-badge { position: absolute; right: 10px; top: 50%; margin-top: -11px; }
.comp-match-row .team { font-size: 13px; }
/* Домашняя команда прижата к счёту справа, гостевая — слева: строка по центру */
.comp-match-row .team.home { justify-content: flex-end; text-align: right; }
/* У домашней логотип стоит ПОСЛЕ названия — зеркалим отступ к названию */
.comp-match-row .team.home img { margin-right: 0; margin-left: 3px; }
.comp-match-row .score { font-size: 15px; }

/* Stat table (scorers, assists, discipline, mvp) */
.stat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stat-table th { text-align: left; padding: 6px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border-subtle); }
.stat-table td { padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.stat-table .num { font-family: var(--font-mono); font-weight: 600; text-align: center; }

/* Bracket */
.bracket { display: flex; gap: 30px; overflow-x: auto; padding: 10px 0; }
.bracket-round { display: flex; flex-direction: column; gap: 12px; min-width: 200px; }
.bracket-round h4 { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 4px; }
.bracket-match { background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; }
.bracket-match .bm-team { display: flex; justify-content: space-between; padding: 2px 0; }
.bracket-match .bm-team.winner { font-weight: 700; color: var(--accent); }
.bracket-match .bm-score { font-family: var(--font-mono); }

.group-select { margin-bottom: 14px; }
.group-select select { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: rgba(7,10,15,0.8); color: var(--text-main); font-family: var(--font-display); font-size: 14px; }

/* ══════════════════════════════════════════════════════
   MATCH PAGE (match.php)
   ══════════════════════════════════════════════════════ */

/* Score header */
.score-header { text-align: center; padding: 28px 20px; }
.score-comp { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.score-comp a { color: var(--accent); font-weight: 600; }
.score-teams { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 12px 0 8px; }
.score-teams .team-name { font-size: 20px; font-weight: 800; min-width: 120px; }
.score-teams .team-name.home { text-align: right; }
.score-teams .team-name.away { text-align: left; }
/* Отступ между флагом сборной и названием (у клубного лого свой inline 3px). */
.score-teams .team-name img { margin-right: 6px; }
/* Домашняя: логотип ПОСЛЕ названия (зеркально гостевой) — отступ слева. */
.score-teams .team-name.home img { margin-right: 0; margin-left: 6px; }
.score-teams .score-box { font-family: var(--font-mono); font-size: 36px; font-weight: 800; min-width: 100px; text-align: center; letter-spacing: 2px; }
.score-teams .score-box.tech { color: var(--danger); font-size: 28px; }
.score-pen { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.score-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.score-status { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 600; margin-top: 6px; }
.status-played { background: rgba(62,187,129,0.15); color: #7fffb0; }
.status-scheduled { background: rgba(255,200,50,0.1); color: #ffd866; }
.status-tech { background: rgba(255,92,92,0.12); color: #ff8a8a; }
.highlight-name { color: var(--accent); }

/* Events timeline */
.event-list { display: flex; flex-direction: column; gap: 4px; }
.event-row { display: grid; grid-template-columns: 1fr 36px 1fr; gap: 4px; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); }
.event-row:hover { background: rgba(255,255,255,0.02); }
.event-home { text-align: right; font-size: 13px; }
.event-mid { text-align: center; }
.event-away { text-align: left; font-size: 13px; }
.event-minute { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.event-player { font-weight: 600; }
.event-type { font-size: 11px; color: var(--text-muted); }
.mvp-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 10px 4px; border-top: 1px solid rgba(255,255,255,0.06); }
.mvp-label { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.mvp-side { font-size: 13px; font-weight: 600; }
.mvp-home { text-align: right; }
.mvp-away { text-align: left; }
.mvp-side a { color: var(--text-primary); text-decoration: none; }
.mvp-side a:hover { color: var(--accent); }

/* Lineups */
.lineup-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lineup-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle); }
.lineup-player { padding: 4px 0; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.lineup-player .pos { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); min-width: 30px; }
.lineup-player a { font-weight: 500; }
.lineup-sub-label { font-size: 11px; color: var(--text-muted); margin-top: 8px; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Stats bars */
.stat-row { display: grid; grid-template-columns: 60px 1fr 60px; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.stat-row .val { font-family: var(--font-mono); font-weight: 600; }
.stat-row .val.home { text-align: right; }
.stat-row .val.away { text-align: left; }
.stat-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.06); }
.stat-bar .home-bar { background: var(--accent); border-radius: 3px 0 0 3px; }
.stat-bar .away-bar { background: rgba(255,255,255,0.2); border-radius: 0 3px 3px 0; }

/* Screenshots grid */
.screenshots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.screenshots img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.screenshots img:hover { transform: scale(1.03); box-shadow: var(--elev-2); }

/* Edit log */
.edit-log { font-size: 12px; color: var(--text-muted); }
.edit-log .log-entry { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.edit-log .log-time { font-family: var(--font-mono); font-size: 11px; }

/* ══════════════════════════════════════════════════════
   MATCH SUBMIT WIZARD (match_submit.php)
   ══════════════════════════════════════════════════════ */

/* Match header */
.match-header { text-align: center; margin-bottom: 8px; }
.match-teams { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 20px; font-weight: 700; }
.match-vs { color: var(--text-muted); font-size: 14px; }
.match-meta { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* Steps progress bar */
.steps-bar { display: flex; gap: 4px; margin-bottom: 24px; }
.step-pill {
  flex: 1;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all .25s var(--ease-out);
  position: relative;
}
.step-pill.active { background: var(--accent-soft); border-color: var(--border-glow); color: var(--accent); }
.step-pill.done { background: rgba(62,187,129,0.12); border-color: rgba(86,220,155,0.3); color: #b6f0ce; }
.step-pill:hover { border-color: var(--border-glow); }

/* Step panels */
.step-panel { display: none; }
.step-panel.active { display: block; animation: mc-fadeIn .3s var(--ease-out); }
@keyframes mc-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Lineup section */
.lineup-section { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lineup-section .lineup-col h4 { font-size: 15px; margin-bottom: 8px; border-bottom: none; padding-bottom: 0; }
.player-pool {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: rgba(7,10,15,0.5);
}
.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s;
}
.player-row:hover { background: rgba(181,255,59,0.06); }
.player-row input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.player-row .pos { color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }
.starter-badge { font-size: 10px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sub-badge { font-size: 10px; padding: 1px 6px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.06); color: var(--text-muted); font-weight: 600; }

/* Events form */
.evt-row { display: grid; grid-template-columns: 130px 100px 1fr 60px 1fr 28px; gap: 4px; align-items: center; margin-bottom: 6px; }
.evt-row select, .evt-row input { padding: 6px; font-size: 12px; }
.remove-btn { background: none; border: none; color: var(--danger); font-size: 16px; cursor: pointer; }

/* Stats pair */
.stat-pair { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 6px; margin-bottom: 8px; align-items: center; }
.stat-pair .stat-label { text-align: center; font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.stat-pair input { text-align: center; }

/* Upload zone */
.upload-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: rgba(181,255,59,0.03); }
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.upload-preview img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-subtle); }

/* Preview table */
.preview-table { width: 100%; border-collapse: collapse; }
.preview-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
.preview-table td:first-child { color: var(--text-muted); width: 180px; }

/* ══════════════════════════════════════════════════════
   8.3 — SCREENSHOT LIGHTBOX
   ══════════════════════════════════════════════════════ */
.mc-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  animation: mc-fadeIn .2s ease-out;
}
.mc-lightbox.active { display: flex; }
.mc-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: var(--elev-5);
  object-fit: contain;
}
.mc-lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 32px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s;
  background: none;
  border: none;
  font-family: var(--font-display);
  z-index: 10000;
}
.mc-lightbox-close:hover { color: var(--text-main); }
.mc-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  background: rgba(0,0,0,0.4);
  border: none;
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.mc-lightbox-nav:hover { color: var(--text-main); background: rgba(0,0,0,0.6); }
.mc-lightbox-prev { left: 16px; }
.mc-lightbox-next { right: 16px; }
.mc-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════
   8.35 — NOTIFICATION INDICATOR (match rows)
   ══════════════════════════════════════════════════════ */
.notif-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,200,50,0.12);
  color: #ffd866;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid rgba(255,200,50,0.25);
  transition: background .15s, transform .15s;
  z-index: 10;
}
.notif-badge:hover { background: rgba(255,200,50,0.22); transform: scale(1.1); }
.notif-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: -8px;
  min-width: 220px;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(14,22,37,0.96);
  border: 1px solid rgba(255,200,50,0.25);
  box-shadow: var(--elev-2);
  font-size: 12px;
  color: var(--text-main);
  z-index: 100;
  line-height: 1.5;
}
.notif-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: rgba(255,200,50,0.25);
}
.notif-badge.open .notif-popup { display: block; }
.notif-popup-club { font-weight: 600; color: #ffd866; }
.notif-popup-reason { color: var(--text-muted); margin-top: 2px; }
.notif-popup-time { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; margin-top: 4px; }
.notif-popup-entry { padding: 4px 0; }
.notif-popup-entry + .notif-popup-entry { border-top: 1px solid rgba(255,255,255,0.06); }

/* ══════════════════════════════════════════════════════
   8.4 — RESPONSIVE / MOBILE
   ══════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .mc-container { padding: 20px 14px 40px; }

  h1 { font-size: 22px; }
  h2 { font-size: 17px; }

  .score-teams .team-name { font-size: 16px; min-width: 80px; }
  .score-teams .score-box { font-size: 28px; min-width: 70px; }
  .score-teams { gap: 10px; }

  .lineup-cols { grid-template-columns: 1fr; }
  .lineup-section { grid-template-columns: 1fr; }

  .stat-row { grid-template-columns: 50px 1fr 50px; }

  .match-row { grid-template-columns: 1fr 60px 1fr; padding: 8px 10px; }
  .match-row.has-notif { grid-template-columns: 1fr 60px 1fr 22px; }
  .match-row .team { font-size: 12px; }
  .match-row .score { font-size: 14px; min-width: 50px; }
  .match-row .match-info { display: none; }

  .standings td, .standings th { padding: 4px 3px; font-size: 11px; }
  .standings .form-cell { display: none; }

  .evt-row { grid-template-columns: 1fr 1fr; gap: 4px; }
  .stat-pair { grid-template-columns: 1fr 70px 1fr; }
  .steps-bar { flex-wrap: wrap; }

  .event-row { grid-template-columns: 1fr 30px 1fr; gap: 2px; padding: 4px 6px; }
  .event-home, .event-away { font-size: 12px; }

  .tabs { gap: 3px; }
  .tab { padding: 6px 10px; font-size: 12px; }

  .bracket { gap: 16px; }
  .bracket-round { min-width: 170px; }

  .mc-lightbox-nav { width: 36px; height: 36px; font-size: 24px; }
}

@media (max-width: 400px) {
  .score-teams { flex-direction: column; gap: 6px; }
  .score-teams .team-name { text-align: center !important; min-width: auto; }

  .match-row { grid-template-columns: 1fr 50px 1fr; gap: 4px; padding: 6px 8px; }
  .match-row.has-notif { grid-template-columns: 1fr 50px 1fr 20px; }
}

/* ══════════════════════════════════════════════════════
   8.5 — ANIMATIONS
   ══════════════════════════════════════════════════════ */

/* Fade-in for cards when they enter view */
.mc-fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
}
.mc-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.mc-stagger > * {
  opacity: 0;
  transform: translateY(10px);
  animation: mc-fadeUp .4s var(--ease-out) both;
}
.mc-stagger > *:nth-child(1) { animation-delay: 0s; }
.mc-stagger > *:nth-child(2) { animation-delay: .05s; }
.mc-stagger > *:nth-child(3) { animation-delay: .1s; }
.mc-stagger > *:nth-child(4) { animation-delay: .15s; }
.mc-stagger > *:nth-child(5) { animation-delay: .2s; }
.mc-stagger > *:nth-child(6) { animation-delay: .25s; }
.mc-stagger > *:nth-child(7) { animation-delay: .3s; }
.mc-stagger > *:nth-child(8) { animation-delay: .35s; }

/* Table row hover glow */
.standings tbody tr { transition: background .15s; }
.stat-table tbody tr { transition: background .15s; }
.stat-table tbody tr:hover td { background: rgba(181,255,59,0.02); }

/* Score pulse on match page */
@keyframes mc-scorePulse {
  0%   { text-shadow: 0 0 0 transparent; }
  50%  { text-shadow: 0 0 20px rgba(181,255,59,0.3); }
  100% { text-shadow: 0 0 0 transparent; }
}
.score-box-glow { animation: mc-scorePulse 2s ease-in-out 1; }

/* Smooth progress bar fill */
.comp-progress-fill { transition: width .6s var(--ease-out); }

/* Bracket match hover */
.bracket-match { transition: border-color .15s, transform .15s; }
.bracket-match:hover { border-color: var(--border-glow); transform: translateX(2px); }

/* Tab switch underline effect */
.tab { position: relative; overflow: hidden; }
.tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--accent);
  transition: all .2s var(--ease-out);
  transform: translateX(-50%);
}
.tab:hover::after { width: 60%; }
.tab.active::after { width: 80%; }
