:root {
  --bg: #0b1c2d;
  --panel: #0f2236;
  --panel2: #102b46;
  --line: #1c3f63;
  --gold: #d4af37;
  --gold-strong: #ffe27a;
  --red: #b22222;
  --green: #2f7d32;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.03), transparent 30%),
    linear-gradient(180deg, #0b1c2d 0%, #091726 100%);
  color: var(--white);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: #fff;
  color: #000;
  padding: 10px 14px;
  border-radius: 0 0 10px 10px;
}

.skip-link:focus {
  left: 12px;
}

.site-header {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    var(--panel2);
  border-bottom: 1px solid var(--line);
  padding: 20px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.headerInner {
  max-width: 1200px;
  margin: 0 auto;
}

.headerText {
  max-width: 820px;
  margin: 0 auto;
}

.brandBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(22px, 4.8vw, 32px);
  font-weight: 900;
  letter-spacing: 0.2px;
}

.site-header .sub {
  margin: 8px auto 0;
  opacity: 0.95;
  font-size: 14px;
  max-width: 680px;
  line-height: 1.45;
}

.pageShell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 14px 24px;
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}

.heroCard {
  margin-top: 0;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.heroTop {
  align-items: flex-start;
}

.actionsRight {
  justify-content: flex-end;
}

.adminAccessBtn {
  white-space: nowrap;
}

.muted {
  opacity: 0.85;
}

.small {
  font-size: 12px;
  opacity: 0.85;
}

.topText {
  margin-top: 6px;
  line-height: 1.5;
}

.mt10 {
  margin-top: 10px;
}

.msg {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.04);
}

.btn,
button {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.btn:hover,
button:hover {
  filter: brightness(1.08);
}

.btn:active,
button:active {
  transform: translateY(1px);
}

.btn:focus-visible,
button:focus-visible,
.tabBtn:focus-visible,
.teamCell:focus-visible,
.matchRow:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.btn2 {
  background: var(--line);
}

.btn3 {
  background: var(--green);
}

.btnGold {
  background: var(--gold);
  color: #0b1c2d;
}

.hidden {
  display: none !important;
}

.filterGrid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.filterBlock {
  margin-top: 0;
}

.filterTitle {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.2px;
}

.categoryTabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phaseTabs {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.tabBtn {
  border: none;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  transition:
    filter 0.12s ease,
    transform 0.08s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.tabBtn:hover {
  filter: brightness(1.06);
}

.tabBtn:active {
  transform: scale(0.99);
}

.categoryTabs .tabBtn {
  width: 100%;
  background: var(--gold);
  color: #0b1c2d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  justify-content: center;
  text-align: center;
}

.categoryTabs .tabBtn.active {
  background: var(--gold-strong);
  color: #0b1c2d;
  box-shadow: 0 0 0 2px #ffffff inset;
}

.phaseTabs .tabBtn {
  flex: 1;
  background: var(--green);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.phaseTabs .tabBtn.active {
  background: #49a84d;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9) inset;
}

.tableWrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(28, 63, 99, 0.55);
  background: rgba(255, 255, 255, 0.02);
}

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

th,
td {
  border-bottom: 1px solid rgba(28, 63, 99, 0.6);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--gold);
  font-weight: 900;
}

tr:last-child td {
  border-bottom: none;
}

.num {
  text-align: center;
}

.teamCell {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  border-radius: 12px;
  padding: 4px;
}

.teamText {
  min-width: 0;
}

.badge {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}

.teamName {
  font-weight: 900;
  line-height: 1.1;
}

.pos {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 900;
  font-size: 12px;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.04);
}

.groupHeader {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.groupHeader h2 {
  margin: 0;
  color: var(--gold);
}

.groupMeta {
  margin-top: 6px;
}

.groupSectionLabel {
  font-weight: 900;
  color: var(--gold);
  font-size: 18px;
}

.exportBtns {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.matchesList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.matchRow {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease, background 0.12s ease;
}

.matchRow:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.045);
}

.matchTop {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.matchMeta {
  font-size: 12px;
  opacity: 0.9;
  min-width: 0;
  line-height: 1.4;
}

.matchStatusWrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.matchStatus,
.matchStage {
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.matchStatus {
  color: var(--gold);
}

.matchStage {
  color: #fff;
}

.matchScoreLine {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: nowrap;
}

.sideTeam {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0;
}

.sideTeam.right {
  justify-content: flex-end;
  text-align: right;
}

.sideTeam .badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.sideTeam .t {
  font-weight: 900;
  font-size: clamp(12px, 3.4vw, 14px);
  line-height: 1.12;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.scoreMid {
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 1000;
  color: var(--gold);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.matchesEmpty {
  margin-top: 10px;
}

.rankLine {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(28, 63, 99, 0.65);
}

.rankLine:last-child {
  border-bottom: none;
}

.rankName {
  font-weight: 900;
}

.rankMeta {
  opacity: 0.85;
  font-size: 12px;
  margin-top: 4px;
}

.rankGoals {
  font-weight: 1000;
  color: var(--gold);
  min-width: 44px;
  text-align: right;
}

.cardRankingNumbers {
  text-align: right;
  min-width: 110px;
}

.sectionTitle {
  color: var(--gold);
  margin: 0 0 8px 0;
  font-size: 20px;
}

.subSectionTitle {
  color: var(--gold);
  margin: 0 0 6px 0;
  font-size: 18px;
}

.knockoutStageBlock + .knockoutStageBlock {
  margin-top: 18px;
}

.noscriptBox {
  max-width: 1200px;
  margin: 16px auto;
  background: #fff3cd;
  color: #5c4400;
  border: 1px solid #e6cc7b;
  border-radius: 12px;
  padding: 12px 14px;
}

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

@media (max-width: 520px) {
  .pageShell {
    padding: 12px;
  }

  button,
  .btn {
    width: 100%;
  }

  .actionsRight {
    width: 100%;
  }

  .actionsRight .btn,
  .actionsRight button {
    width: 100%;
  }

  .exportBtns .btn2 {
    width: auto;
  }

  .card {
    padding: 12px;
  }

  th,
  td {
    padding: 9px;
  }

  .matchRow {
    padding: 12px;
  }

  .sideTeam .t {
    font-size: 13px;
  }

  .scoreMid {
    font-size: 20px;
  }

  .categoryTabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .phaseTabs {
    display: flex;
    flex-direction: row;
    gap: 10px;
  }

  .phaseTabs .tabBtn {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 10px 8px;
  }
}