:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b17;
  --bg-alt: #11172b;
  --surface: #121b33;
  --surface-strong: #1d2747;
  --text: #f5f8ff;
  --text-muted: #9db1d6;
  --accent: #FFD700;
  --accent-2: #ffa500;
  --accent-rgb: 255, 215, 0;
  --accent-soft: rgba(255, 215, 0, 0.18);
  --on-accent: #111;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #f1564a;
  --success: #3fd3a5;
  --glow: rgba(255, 204, 51, 0.08);
}

/* Карбон + красный — цветовая тема под лого Pulse */
[data-theme="carbon-red"] {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-alt: #121216;
  --surface: #17171d;
  --surface-strong: #22222a;
  --text: #f5f6f8;
  --text-muted: #a1a1ac;
  --accent: #E11D2A;
  --accent-2: #ff5252;
  --accent-rgb: 225, 29, 42;
  --accent-soft: rgba(225, 29, 42, 0.20);
  --on-accent: #fff;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #f1564a;
  --success: #3fd3a5;
  --glow: rgba(225, 29, 42, 0.12);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f2f5;
  --bg-alt: #e4e7ec;
  --surface: #ffffff;
  --surface-strong: #f0f2f5;
  --text: #1a1d26;
  --text-muted: #6b7280;
  --accent: #d4a800;
  --accent-2: #b8860b;
  --accent-rgb: 212, 168, 0;
  --accent-soft: rgba(212, 168, 0, 0.12);
  --on-accent: #fff;
  --border: rgba(0, 0, 0, 0.1);
  --danger: #dc3545;
  --success: #22a06b;
  --glow: rgba(212, 168, 0, 0.05);
}

/* Spoiler mode */
[data-spoiler="true"] .spoiler-hide {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  transition: filter .3s;
}
[data-spoiler="true"] .spoiler-hide:hover {
  filter: blur(3px);
}

/* Theme toggle icon switch */
[data-theme="light"] .theme-icon-dark { display: none !important; }
[data-theme="light"] .theme-icon-light { display: inline !important; }
[data-theme="dark"] .theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-icon-light { display: none; }

* {
  box-sizing: border-box;
}

/* ─── Page loading bar ─── */
.page-load-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ff8c00, var(--accent));
  z-index: 9999;
  transition: none;
  pointer-events: none;
}
.page-load-bar.loading {
  width: 85%;
  transition: width 8s cubic-bezier(0.1, 0.45, 0.1, 0.9);
}

/* ─── Skeleton loading ─── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-text {
  height: .85rem;
  margin-bottom: .5rem;
  border-radius: 4px;
}
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 65%; }
.skeleton-title {
  height: 1.2rem;
  width: 50%;
  margin-bottom: .75rem;
  border-radius: 4px;
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-card {
  height: 120px;
  border-radius: 12px;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body {
  margin: 0;
  background: radial-gradient(circle at top, var(--glow), transparent 25%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Override: no underline on cards, buttons, nav, icons ── */
.brand:hover,
.disc-pill:hover,
.nav-link:hover,
.footer-social:hover,
.button:hover,
.notif-dropdown a:hover {
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: #0a0e1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  flex-shrink: 0;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.brand-text {
  margin-left: 0.5rem;
  font-size: 1.15rem;
  line-height: 1;
}

.main-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  color: var(--accent);
}

/* Отдельный крупный логотип-ссылка «Лига МАДК» (турнирная лига колледжа).
   Стоит перед пунктом «Матчи», ведёт на турнир лиги. */
.nav-madk-item { display: inline-flex; align-items: center; margin-right: 0.15rem; }
.nav-madk-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding: 0;
  border-radius: 8px;
  transition: transform .2s ease, filter .2s ease;
}
.nav-madk-logo-img {
  width: 53px;
  height: 53px;
  object-fit: contain;
  display: block;
}
.nav-madk-logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px rgba(225, 29, 42, .35));
}

/* ── Выпадающие группы меню ── */
.nav-item-dd { position: relative; }
.nav-details { position: relative; }
.nav-dd-summary {
  display: inline-flex; align-items: center; gap: 0.25rem;
  cursor: pointer; list-style: none; user-select: none;
}
.nav-dd-summary::-webkit-details-marker { display: none; }
.nav-dd-summary::marker { content: ""; }
.nav-dd-arrow { font-size: 0.55rem; opacity: .7; transition: transform .2s; }
.nav-details[open] .nav-dd-arrow { transform: rotate(180deg); }
.nav-dd-menu {
  position: absolute; top: calc(100% + 12px); left: 0;
  min-width: 190px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.4rem;
  display: flex; flex-direction: column; gap: 1px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
/* невидимый «мост» через зазор, чтобы hover не терялся при переходе к меню */
.nav-dd-menu::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.nav-dd-menu a {
  padding: 0.5rem 0.7rem; border-radius: 7px;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  white-space: nowrap; text-decoration: none;
}
.nav-dd-menu a:hover { background: rgba(255, 255, 255, .05); color: var(--accent); }
.nav-dd-sep { height: 1px; background: var(--border); margin: 0.25rem 0.3rem; }

/* ─── Анимация появления выпадающего меню навигации ───
   Меню рендерится только при [open] (JS ставит его на hover),
   поэтому появление анимируем через animation, а не transition.
   Дефолт — «blur». Другие варианты выбираются в админке (data-nav-anim). */
.nav-details[open] .nav-dd-menu { animation: navdd-blur .3s ease-out; }

[data-nav-anim="slide"]   .nav-details[open] .nav-dd-menu { animation: navdd-slide .22s ease-out; }
[data-nav-anim="grow"]    .nav-details[open] .nav-dd-menu { transform-origin: top left; animation: navdd-grow .2s cubic-bezier(.2,.8,.3,1.1); }
[data-nav-anim="blur"]    .nav-details[open] .nav-dd-menu { animation: navdd-blur .3s ease-out; }
[data-nav-anim="curtain"] .nav-details[open] .nav-dd-menu { transform-origin: top; animation: navdd-curtain .28s cubic-bezier(.4,0,.2,1); }

/* Stagger — контейнер въезжает, пункты влетают слева по очереди */
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu { animation: navdd-slide .18s ease-out; }
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a { opacity: 0; animation: navdd-item .32s ease forwards; }
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a:nth-of-type(1) { animation-delay: .04s; }
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a:nth-of-type(2) { animation-delay: .10s; }
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a:nth-of-type(3) { animation-delay: .16s; }
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a:nth-of-type(4) { animation-delay: .22s; }
[data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a:nth-of-type(5) { animation-delay: .28s; }

@keyframes navdd-slide   { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes navdd-grow    { from { opacity: 0; transform: scale(.9) translateY(-6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes navdd-blur    { from { opacity: 0; filter: blur(10px); transform: translateY(-6px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }
@keyframes navdd-item    { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes navdd-curtain { from { opacity: .4; clip-path: inset(0 0 100% 0); transform: translateY(-4px); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .nav-details[open] .nav-dd-menu,
  [data-nav-anim] .nav-details[open] .nav-dd-menu,
  [data-nav-anim="stagger"] .nav-details[open] .nav-dd-menu a {
    animation: none !important; opacity: 1 !important;
    filter: none !important; transform: none !important; clip-path: none !important;
  }
}

.disc-pills {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.disc-pill {
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.disc-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.disc-pill.active {
  background: var(--accent);
  color: #000;
}

.mobile-disc-pills {
  display: none;
}

/* Discipline Dropdown */
.disc-dropdown {
  position: relative;
}

.disc-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
}

.disc-dropdown-btn:hover {
  border-color: var(--accent);
}

.disc-dropdown-arrow {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.disc-dropdown.open .disc-dropdown-arrow {
  transform: rotate(180deg);
}

.disc-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 100;
}

.disc-dropdown.open .disc-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.disc-dropdown-item {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 7px;
  transition: all 0.15s;
}

.disc-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.disc-dropdown-item.active {
  color: var(--accent);
  background: rgba(245, 197, 24, 0.08);
}

/* Discipline Scroll */
.disc-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 2px;
  flex-shrink: 0;
}

.disc-scroll::-webkit-scrollbar {
  display: none;
}

.disc-scroll-item {
  padding: 0.4rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.disc-scroll-item:hover {
  color: var(--text);
}

.disc-scroll-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ── User dropdown ── */
.user-dropdown-wrap {
  position: relative;
}
.user-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: .3rem .65rem .3rem .3rem;
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.user-dropdown-toggle:hover,
.user-dropdown-toggle.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,215,0,.08);
}
.user-dropdown-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-dropdown-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: .8rem;
}
.user-dropdown-name {
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.user-dropdown-toggle.active .user-dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  z-index: 300;
  overflow: hidden;
  animation: udDropIn .18s ease;
}
.user-dropdown-menu.show {
  display: block;
}
@keyframes udDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-dropdown-header {
  padding: .75rem 1rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.user-dropdown-header-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.user-dropdown-header-role {
  font-size: .65rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: .15rem 0;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}
.user-dropdown-item:hover {
  background: var(--surface-strong);
  text-decoration: none;
  color: var(--text);
}
.user-dropdown-icon {
  font-size: .9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.user-dropdown-logout {
  color: var(--danger);
}
.user-dropdown-logout:hover {
  color: var(--danger);
  background: rgba(241,86,74,.08);
}

.main-nav {
  flex: 1;
}

.main-nav .nav-list {
  justify-content: center;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 204, 51, 0.12);
}

/* ── Icon Buttons (header) ── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all .2s ease;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: rgba(255, 215, 0, .3);
  background: rgba(255, 215, 0, .08);
  transform: translateY(-1px);
}
.icon-btn:active {
  transform: translateY(0) scale(.95);
}
.icon-btn.active {
  color: var(--accent);
  border-color: rgba(255, 215, 0, .4);
  background: rgba(255, 215, 0, .1);
}
.icon-btn svg {
  flex-shrink: 0;
}
.icon-btn-badge {
  display: none;
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 50%;
  border: 2px solid #0a0e1a;
}

.nav-search-wrap,
.nav-notif-wrap {
  position: relative;
}

/* ── Header Dropdowns ── */
.header-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
  z-index: 200;
  overflow: hidden;
  animation: headerDropIn .2s ease;
}
.header-dropdown.show {
  display: block;
}
@keyframes headerDropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-dropdown {
  width: 340px;
}
.notif-dropdown {
  width: 320px;
}
.header-dropdown-input {
  width: 100%;
  padding: .7rem .85rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  outline: none;
  font-size: .88rem;
}
.header-dropdown-input::placeholder {
  color: var(--text-muted);
}
.header-dropdown-input:focus {
  border-bottom-color: var(--accent);
}
.header-dropdown-body {
  max-height: 300px;
  overflow-y: auto;
  padding: .25rem 0;
}
.header-dropdown-body::-webkit-scrollbar { width: 4px; }
.header-dropdown-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
/* Search results */
.search-empty {
  padding: .85rem;
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
}
.search-section {
  padding: .25rem 0;
}
.search-section + .search-section {
  border-top: 1px solid var(--border);
}
.search-section-title {
  padding: .4rem .75rem .25rem;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.search-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  color: var(--text);
  text-decoration: none;
  font-size: .84rem;
  border-radius: 6px;
  transition: background .15s;
}
.search-item:hover {
  background: var(--surface-strong);
  text-decoration: none;
  color: var(--text);
}
.search-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-strong);
}
.search-thumb-round {
  border-radius: 50%;
}
.search-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.search-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Турниры команды под результатом поиска — переход прямо в сетку */
.search-subitem {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem .3rem 2.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .78rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.search-subitem:hover {
  background: var(--surface-strong);
  color: var(--accent);
  text-decoration: none;
}
.search-subitem-arrow { opacity: .6; flex-shrink: 0; }
.search-subitem-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-subitem-hint {
  margin-left: auto;
  flex-shrink: 0;
  font-size: .7rem;
  opacity: .65;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 .3rem;
}

.header-dropdown-placeholder {
  padding: .85rem;
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
}
.header-dropdown-title {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.account-actions {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1224;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.button.compact {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.mobile-menu-toggle:hover {
  border-color: var(--accent);
  background: rgba(255,215,0,.06);
}

.burger-line {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease, width .3s ease;
}

.mobile-menu-toggle.active .burger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active .burger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ─── Toast / Flash Messages ─── */
.flash-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.toast-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 3rem);
}
.toast-container > * { pointer-events: auto; }

.flash, .toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.flash {
  animation: flashIn 0.3s ease-out, flashOut 0.4s ease-in 5s forwards;
}

.toast {
  animation: toastIn 0.35s cubic-bezier(0.21,1.02,0.73,1);
  transition: all .3s ease;
}
.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.flash-icon, .toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  margin-top: 1px;
}

.flash-text, .toast-text { flex: 1; }
.toast-title {
  font-weight: 700;
  font-size: .82rem;
  margin-bottom: .15rem;
  display: block;
}
.toast-msg {
  font-size: .78rem;
  opacity: .85;
  display: block;
}

.flash-close, .toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.4;
  padding: 0;
  line-height: 1;
  transition: opacity 0.15s;
  flex-shrink: 0;
  margin-top: 1px;
}
.flash-close:hover, .toast-close:hover { opacity: 1; }

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flashOut {
  from { opacity: 1; max-height: 80px; margin-bottom: 0; }
  to { opacity: 0; max-height: 0; padding: 0; margin-bottom: -0.5rem; overflow: hidden; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.96); }
}

.flash-success, .toast-success {
  background: rgba(68, 237, 166, 0.12);
  border-color: rgba(68, 237, 166, 0.25);
  color: #44eda6;
}
.flash-danger, .toast-danger, .toast-error {
  background: rgba(241, 86, 74, 0.12);
  border-color: rgba(241, 86, 74, 0.25);
  color: #f1564a;
}
.flash-warning, .toast-warning {
  background: rgba(255, 204, 51, 0.12);
  border-color: rgba(255, 204, 51, 0.25);
  color: #ffcc33;
}
.flash-info, .toast-info {
  background: rgba(72, 118, 255, 0.12);
  border-color: rgba(72, 118, 255, 0.25);
  color: #4876ff;
}

@media (max-width: 600px) {
  .toast-container {
    right: .75rem;
    left: .75rem;
    max-width: none;
    width: auto;
  }
}

.hero-panel,
.section-header,
.team-grid,
.card,
.auth-panel,
.error-panel {
  margin-bottom: 2rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero-panel h1,
.section-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 3.5vw, 3.8rem);
  line-height: 1.05;
}

.hero-panel p,
.section-header p,
.card p,
.player-card p,
.profile-card p {
  color: var(--text-muted);
  line-height: 1.75;
}

.news-card p {
  color: var(--text-muted);
  line-height: 1.75;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero-cards {
  display: grid;
  gap: 1rem;
}

.card {
  background: rgba(16, 24, 48, 0.9);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.accent-card {
  background: linear-gradient(180deg, rgba(255, 204, 51, 0.12), rgba(11, 17, 35, 0.95));
}

.cards-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.news-grid .cards-grid {
  margin-top: 1.5rem;
}

.news-list {
  gap: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.5rem;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
}

.match-table th,
.match-table td {
  padding: 1rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.match-table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.95rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table th {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.role-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.role-form select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.85rem;
  padding: 0.5rem 0.75rem;
  max-width: 140px;
  appearance: none;
}

.role-form select option {
  background: #0a0e1a;
  color: var(--text);
}

.users-table-card {
  padding: 1.5rem;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.table-wrapper::-webkit-scrollbar { height: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
.table-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.profile-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-controls h2 {
  margin: 0;
  font-size: 1.5rem;
}

.user-count {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
}

.search-input {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  padding: 0.65rem 1rem;
  min-width: 250px;
  font-size: 0.95rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: 1rem 0.85rem;
  transition: background 0.15s ease;
}

.sort-indicator {
  display: inline-block;
  margin-left: 0.4rem;
  opacity: 0.3;
  font-size: 0.9rem;
}

.sortable.sort-asc .sort-indicator {
  opacity: 1;
  color: var(--accent);
}

.sortable.sort-asc .sort-indicator::after {
  content: "↑";
}

.sortable.sort-desc .sort-indicator {
  opacity: 1;
  color: var(--accent);
}

.sortable.sort-desc .sort-indicator::after {
  content: "↓";
}

.sortable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.inactive-sort {
  color: var(--text-muted);
  cursor: default;
}

.inactive-sort .sort-indicator {
  display: none;
}

.matches-page {
  display: grid;
  gap: 1.25rem;
}

.match-day-group {
  display: grid;
  gap: 1rem;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.group-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.group-subtitle {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.group-count {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.match-list {
  display: grid;
  gap: 1rem;
}

.match-card {
  background: rgba(10, 14, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.match-card:hover {
  border-color: rgba(255, 215, 0, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.match-card__main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.team-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.team-block--reverse {
  justify-content: flex-end;
}

.team-logo {
  min-width: 3.2rem;
  min-height: 3.2rem;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(255, 215, 0, 0.08));
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem;
}

.team-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.match-score {
  display: grid;
  place-items: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
}

.score.vs {
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
}

.match-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge--live {
  color: #fff;
  background: rgba(241, 86, 74, 0.22);
  box-shadow: 0 0 0 rgba(241, 86, 74, 0.4);
  animation: pulse 2s infinite ease-in-out;
}

.badge--upcoming {
  color: var(--accent);
  background: rgba(255, 215, 0, 0.14);
}

.badge--completed {
  color: #3fd3a5;
  background: rgba(63, 211, 165, 0.12);
}

.meta-item {
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.55rem 0.85rem;
  border-radius: 0.95rem;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(241, 86, 74, 0.35);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(241, 86, 74, 0);
  }
}

.status {
  display: inline-flex;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status.live {
  background: rgba(241, 86, 74, 0.14);
  color: #f1564a;
}

.status.upcoming {
  background: rgba(78, 143, 255, 0.12);
  color: #8eb4ff;
}

.status.completed {
  background: rgba(63, 211, 165, 0.14);
  color: #3fd3a5;
}

.player-card {
  min-height: 180px;
}

.auth-panel,
.error-panel {
  display: grid;
  place-items: center;
  min-height: 65vh;
}

.auth-card,
.profile-card {
  width: min(520px, 100%);
  padding: 2rem;
}

.auth-card h1,
.profile-card h1 {
  margin-top: 0;
}

.auth-card form {
  display: grid;
  gap: 1rem;
}

.auth-card label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.auth-card input {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.small-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.profile-meta {
  display: grid;
  gap: 1rem;
}

.profile-meta div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
}

.profile-meta strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.5rem 0 0;
  margin-top: 3rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.footer-content {
  display: flex;
  flex-direction: column;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand { }

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

.footer-logo {
  height: 32px;
  width: auto;
}

.footer-logo-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--text);
}

.footer-about {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.footer-socials {
  display: flex;
  gap: .5rem;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all .2s;
}

.footer-social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.footer-heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  margin: 0 0 .9rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: .55rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: .82rem;
  text-decoration: none;
  transition: color .15s;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-bottom {
  margin-top: 2rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-copy {
  font-size: .72rem;
  color: var(--text-muted);
  opacity: .7;
}

@media (max-width: 900px) {
  .hero-panel,
  .split-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap;
    gap: .4rem;
    padding: .5rem 0;
    position: relative;
  }

  .header-left {
    flex: 1;
    min-width: 0;
    gap: .4rem;
  }

  .brand-logo {
    height: 36px;
  }

  .disc-pills,
  .disc-scroll,
  .disc-dropdown {
    display: none;
  }

  .header-right {
    gap: .3rem;
    flex-shrink: 0;
  }

  .header-right .button {
    padding: .4rem .7rem;
    font-size: .72rem;
    border-radius: 8px;
    white-space: nowrap;
  }

  .icon-button,
  .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .user-dropdown-toggle {
    padding: .2rem;
    border-radius: 50%;
    gap: 0;
  }

  .user-dropdown-name,
  .user-dropdown-arrow {
    display: none;
  }

  .user-dropdown-avatar {
    width: 28px;
    height: 28px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border-radius: .6rem;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .5rem;
    margin-top: .25rem;
  }

  .main-nav.active {
    display: block;
    animation: mobileMenuSlide .25s ease;
  }

  @keyframes mobileMenuSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .mobile-disc-pills {
    display: flex;
    gap: 4px;
    padding: .25rem .25rem .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .25rem;
  }

  .main-nav .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .main-nav .nav-list li {
    width: 100%;
  }

  .main-nav .nav-link {
    display: flex;
    align-items: center;
    padding: .65rem .75rem;
    font-size: .88rem;
    border-radius: 8px;
    transition: background .15s;
  }

  .main-nav .nav-link:hover {
    background: rgba(255,255,255,.05);
  }

  .main-nav .nav-link.active {
    background: rgba(255,215,0,.08);
  }

  /* Группы меню на мобиле — инлайн-аккордеон вместо всплывашки */
  .main-nav .nav-dd-summary { justify-content: space-between; width: 100%; }
  .main-nav .nav-dd-menu {
    position: static; box-shadow: none; border: none; background: transparent;
    min-width: 0; padding: .1rem 0 .35rem .9rem;
  }
  .main-nav .nav-dd-menu::before { display: none; }
  .main-nav .nav-dd-menu a {
    display: block; padding: .55rem .75rem; font-size: .85rem;
    color: var(--text-muted); border-radius: 8px;
  }
  .main-nav .nav-dd-menu a:hover { background: rgba(255,255,255,.05); color: var(--accent); }

  /* Search & notification dropdowns full-width on mobile */
  .header-dropdown {
    position: fixed !important;
    left: .75rem !important;
    right: .75rem !important;
    width: auto !important;
    top: 52px !important;
    border-radius: 12px;
  }
}

/* Ban functionality styles */
.actions-cell {
  display: flex;
  align-items: center;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ban-btn,
.unban-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ban-btn:hover {
  background: rgba(241, 86, 74, 0.15);
  border-color: rgba(241, 86, 74, 0.4);
}

.unban-btn:hover {
  background: rgba(63, 211, 165, 0.15);
  border-color: rgba(63, 211, 165, 0.4);
}

.banned-user {
  background: rgba(241, 86, 74, 0.08) !important;
  opacity: 0.8;
}

.banned-user td {
  color: rgba(255, 248, 240, 0.7);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.15s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  width: min(500px, 90vw);
  animation: slideIn 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
}

.button.danger {
  background: var(--danger);
  color: #fff;
  padding: 0.75rem 1.25rem;
}

.button.danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h1 {
  margin: 0 0 0.75rem;
}

.section-header p {
  max-width: 72ch;
}

.grid-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.team-card,
.tournament-card,
.player-row,
.rating-card {
  background: rgba(16, 24, 48, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.team-card h3,
.tournament-card h3 {
  margin: 0 0 0.75rem;
}

.team-card p,
.tournament-card p,
.rating-card p {
  color: var(--text-muted);
}

.team-card .meta,
.tournament-card .meta,
.player-row .player-meta,
.rating-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.team-card .badge,
.tournament-card .badge,
.player-row .status {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
}

.team-line,
.player-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.team-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 1.5rem;
}

.team-hero,
.tournament-summary,
.player-profile,
.rating-grid {
  display: grid;
  gap: 1rem;
}

.rating-grid > .card,
.team-overview > .card {
  min-width: 0;
  overflow: hidden;
}

.team-hero {
  padding: 1.5rem;
}

.team-avatar,
.tournament-avatar,
.player-avatar {
  width: 100%;
  min-height: 220px;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.team-avatar img,
.player-avatar img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  object-fit: contain;
}

.team-card .button,
.tournament-card .button,
.player-row .button {
  margin-top: 1rem;
}

.details-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.15rem;
  padding: 1.25rem;
}

.field-group {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

input[type="text"],
textarea,
select {
  width: 100%;
  min-height: 3rem;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

textarea {
  min-height: 160px;
  resize: vertical;
}

input[type="file"] {
  color: var(--text);
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-grid {
  display: grid;
  gap: 1.5rem;
}

.table-wrapper table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.table-wrapper th,
.table-wrapper td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.table-wrapper th {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.table-link {
  color: var(--accent);
}

.preview-file {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.preview-file img {
  max-width: 240px;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.stats-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.1rem;
  padding: 1rem;
}

.stats-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.stats-card strong {
  font-size: 1.5rem;
}

@media (max-width: 980px) {
  .team-overview,
  .rating-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .grid-cards,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Admin Panel — «HLTV Pro» × Carbon Red
   Локальный акцент = carbon-red: переопределяем переменные темы
   прямо на .admin-layout, поэтому весь var(--accent) внутри
   админки становится красным автоматически.
   ============================================================ */
.admin-layout {
  /* локальный carbon-red акцент только для админки */
  --accent: #E11D2A;
  --accent-2: #ff5252;
  --accent-rgb: 225, 29, 42;
  --accent-soft: rgba(225, 29, 42, 0.16);
  --on-accent: #fff;
  --glow: rgba(225, 29, 42, 0.14);
  --adm-red: #E11D2A;
  --adm-red2: #ff5252;
  --adm-bg: #0a0a0c;
  --adm-panel: #101014;
  --adm-panel2: #0c0c10;
  --adm-line: rgba(255, 255, 255, 0.06);
  --adm-muted: #6a6a74;

  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 80px);
  background: var(--adm-bg);
  font-size: 14px;
}

/* — Сайдбар — */
.admin-sidebar {
  background: linear-gradient(180deg, #0e0e12, #0a0a0c);
  border-right: 1px solid rgba(225, 29, 42, 0.16);
  padding: 14px 0;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 22px;
  color: #8a8a94;
  text-decoration: none;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  position: relative;
  transition: all 0.15s ease;
}

.admin-nav .nav-item:hover {
  color: #fff;
  background: rgba(225, 29, 42, 0.06);
}

.admin-nav .nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(225, 29, 42, 0.22), transparent);
}

.admin-nav .nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--adm-red);
  box-shadow: 0 0 10px var(--adm-red);
}

.admin-nav .nav-item .dic {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.admin-nav .nav-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  padding: 1px 7px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--adm-red) 18%, var(--adm-panel));
  border: 1px solid color-mix(in srgb, var(--adm-red) 45%, var(--adm-line));
  color: var(--adm-red2);
}

.admin-nav .nav-badge.warn {
  background: color-mix(in srgb, #ffcd4d 16%, var(--adm-panel));
  border-color: color-mix(in srgb, #ffcd4d 42%, var(--adm-line));
  color: #ffcd4d;
}

/* Заголовки групп меню — без подписи над «Панелью управления», она и так первая */
.admin-nav .nav-sec {
  padding: 14px 22px 6px;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--adm-muted);
  font-weight: 800;
}

.admin-nav .nav-sec--super {
  color: var(--adm-red2);
}

/* — Основная область — */
.admin-main {
  background: var(--adm-bg);
  padding: 24px 30px;
  min-width: 0; /* Prevent grid blowout */
  overflow: hidden; /* Let table-wrapper handle its own scroll */
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin: -24px -30px 26px;
  padding: 22px 30px;
  border-bottom: 1px solid var(--adm-line);
  background: linear-gradient(90deg, rgba(225, 29, 42, 0.10), transparent);
}

.admin-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* — Плитки статистики (HLTV, скошенный угол, красное свечение) — */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--adm-panel);
  border: 1px solid var(--adm-line);
  border-radius: 0;
  padding: 20px 22px;
  text-align: left;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(225, 29, 42, 0.16), transparent 70%);
  pointer-events: none;
}

.stat-number {
  display: block;
  font-size: 2.25rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -1px;
  color: var(--adm-red2);
  margin-bottom: 6px;
  position: relative;
}

.stat-label {
  color: var(--adm-muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  position: relative;
}

.filters {
  margin-bottom: 1.5rem;
}

.filter-form {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-form select {
  background: var(--adm-panel);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.4rem;
  padding: 0.5rem 1rem;
  min-width: 150px;
}

/* — Таблицы (HLTV: плоские, красная риска сверху) — */
.table-wrapper {
  background: var(--adm-panel);
  border: 1px solid var(--adm-line);
  border-radius: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.table-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--adm-red);
  box-shadow: 0 0 10px var(--adm-red);
  z-index: 1;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 13px 22px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.admin-table th {
  background: var(--adm-panel2);
  font-weight: 700;
  color: var(--adm-muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-table tbody tr:hover {
  background: rgba(225, 29, 42, 0.05);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-published {
  background: rgba(63, 211, 165, 0.2);
  color: #3fd3a5;
}

.status-draft {
  background: rgba(157, 177, 214, 0.2);
  color: #9db1d6;
}

.status-live {
  background: rgba(241, 86, 74, 0.2);
  color: #f1564a;
}

.status-live.pulsing {
  animation: pulse 2s infinite;
}

.status-черновик {
  background: rgba(157, 177, 214, 0.2);
  color: #9db1d6;
}

.status-регистрация-открыта {
  background: rgba(63, 211, 165, 0.2);
  color: #3fd3a5;
}

.status-идёт {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent);
}

.status-завершён {
  background: rgba(157, 177, 214, 0.2);
  color: #9db1d6;
}

.status-предстоящий {
  background: rgba(74, 144, 226, 0.2);
  color: #4a90e2;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 0.4rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s ease;
}

.btn-small:hover {
  transform: translateY(-1px);
}

.btn-success {
  background: rgba(63, 211, 165, 0.2);
  color: #3fd3a5;
}

.btn-danger {
  background: rgba(241, 86, 74, 0.2);
  color: #f1564a;
}

.btn-warning {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent);
}

.inline-form {
  display: inline;
}

.admin-form {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 800px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.registrations-section {
  margin-bottom: 2rem;
}

.registrations-section h2 {
  margin-bottom: 1rem;
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 1024px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  
  .admin-sidebar {
    order: 2;
    padding: 1rem 0;
  }
  
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 1rem;
  }
  
  .admin-nav .nav-item {
    white-space: nowrap;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* На узком экране меню — горизонтальная лента, подписям групп там негде
     аккуратно поместиться между пунктами, поэтому прячем их. */
  .admin-nav .nav-sec {
    display: none;
  }

  .admin-main {
    order: 1;
    padding: 1rem;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-form select {
    min-width: auto;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .form-actions {
    flex-direction: column;
  }

  .table-wrapper th,
  .table-wrapper td {
    padding: .65rem .5rem;
    font-size: .82rem;
  }

  .table-wrapper th {
    font-size: .65rem;
  }

  .section-header h1 {
    font-size: 1.6rem;
  }

  .section-header p {
    font-size: .85rem;
  }

  .rating-grid {
    gap: 1rem;
  }

  .rating-grid .card {
    padding: 1rem;
  }

  .rating-grid .card h3 {
    font-size: 1rem;
    margin-bottom: .75rem;
  }
}
