:root {
  color-scheme: dark;
  --bg: #07130e;
  --bg-2: #0b2118;
  --panel: rgba(248, 250, 245, 0.96);
  --panel-ink: #102019;
  --panel-muted: #607068;
  --ink: #f8fbf4;
  --muted: #afbeb5;
  --line: rgba(255, 255, 255, 0.14);
  --dark-line: rgba(16, 32, 25, 0.12);
  --green: #1bb56f;
  --green-dark: #0c6b45;
  --gold: #f2c14e;
  --red: #e94343;
  --blue: #4aa6c8;
  --surface: rgba(255, 255, 255, 0.08);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  font-family: "Noto Sans Arabic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 8%, rgba(242, 193, 78, 0.15), transparent 28rem),
    linear-gradient(145deg, #081912 0%, #06100c 45%, #0d281d 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.pitch-lines {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.14) 50%, transparent 50.2%),
    radial-gradient(circle at 50% 32%, transparent 0 8rem, rgba(255, 255, 255, 0.12) 8.08rem 8.18rem, transparent 8.25rem),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 86px);
}

.topbar,
.site-shell,
.footer {
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(242, 193, 78, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--gold), #fff0ae);
  color: #192016;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 0.76rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.nav-links a {
  min-width: 72px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.nav-links a:hover {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.icon-button:hover {
  border-color: rgba(242, 193, 78, 0.55);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-shell {
  padding-bottom: 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 18px;
  align-items: stretch;
  min-height: 360px;
}

.cover-photo {
  position: relative;
  grid-column: 1 / -1;
  min-height: clamp(360px, 48vw, 620px);
  overflow: hidden;
  border: 1px solid rgba(242, 193, 78, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(3, 16, 10, 0.05), rgba(3, 16, 10, 0.72)),
    radial-gradient(circle at 50% 22%, rgba(242, 193, 78, 0.18), transparent 32rem),
    #07130e;
  box-shadow: var(--shadow);
}

.cover-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 18, 12, 0.8), rgba(5, 18, 12, 0.28) 44%, rgba(5, 18, 12, 0.72)),
    linear-gradient(0deg, rgba(5, 18, 12, 0.82), transparent 44%, rgba(5, 18, 12, 0.34));
}

.cover-photo::after {
  content: "";
  position: absolute;
  inset: 18px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}

.cover-flags {
  position: absolute;
  inset: -18px;
  display: grid;
  grid-template-columns: repeat(12, minmax(68px, 1fr));
  gap: 10px;
  padding: 28px;
  opacity: 0.78;
  transform: rotate(-2deg) scale(1.04);
}

.cover-flag {
  display: grid;
  min-height: 78px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.cover-flag img {
  width: 58px;
  height: 40px;
  object-fit: contain;
}

.cover-content {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: inherit;
  align-content: center;
  justify-items: center;
  padding: clamp(34px, 7vw, 92px);
  text-align: center;
}

.cover-content h1 {
  display: grid;
  justify-items: center;
  gap: 0.02em;
  max-width: 1120px;
  color: white;
  font-size: clamp(3.4rem, 9vw, 9.5rem);
  text-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.cover-content h1 span {
  display: block;
}

.cover-content p {
  max-width: 760px;
  margin-top: 18px;
  color: #eaf4ef;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  font-weight: 700;
  line-height: 1.9;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.48);
}

.hero-copy,
.featured-match,
.control-panel,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding: clamp(26px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgba(8, 31, 22, 0.94), rgba(8, 31, 22, 0.76)),
    linear-gradient(145deg, rgba(27, 181, 111, 0.28), transparent 55%);
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% 12%;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 900px;
  font-family: "Noto Naskh Arabic", serif;
  font-size: clamp(3rem, 7vw, 6.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy h2 {
  position: relative;
  z-index: 1;
  max-width: 820px;
  font-family: "Noto Naskh Arabic", serif;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  font-weight: 700;
  line-height: 1.12;
}

.hero-copy p {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-top: 18px;
  color: #d6e3db;
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  line-height: 2;
}

.source-strip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  color: #dfe9e3;
  font-size: 0.86rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(242, 193, 78, 0.16);
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(27, 181, 111, 0.18);
}

.featured-match {
  display: grid;
  align-content: stretch;
  min-height: 360px;
  overflow: hidden;
  background: var(--panel);
  color: var(--panel-ink);
}

.feature-inner {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  padding: 22px;
}

.feature-label,
.micro-label,
.match-meta,
.team-meta,
.table-caption {
  color: var(--panel-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.feature-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--dark-line);
}

.scoreboard {
  display: grid;
  align-items: center;
  gap: 18px;
  padding: 24px 0;
}

.score-team {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.score-team img,
.team-card img {
  width: 46px;
  height: 32px;
  object-fit: contain;
  border: 1px solid var(--dark-line);
  border-radius: 4px;
  background: white;
}

.score-team strong {
  display: block;
  overflow: hidden;
  font-size: 1.12rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  min-width: 54px;
  color: var(--green-dark);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1;
  text-align: left;
}

.feature-footer {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-line);
  color: var(--panel-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.stat-card {
  min-height: 108px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.085);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  font-size: 2.35rem;
  line-height: 1;
}

.control-panel {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 220px;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-width: 360px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented button {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.segmented button:last-child {
  border-left: 0;
}

.segmented button.active {
  background: var(--gold);
  color: #172015;
}

.search-field,
.select-field {
  display: grid;
  gap: 6px;
}

.search-field span,
.select-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(3, 13, 9, 0.72);
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.16);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 14px;
  align-items: start;
}

.panel {
  background: var(--panel);
  color: var(--panel-ink);
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--dark-line);
}

.panel-heading.compact {
  padding-bottom: 12px;
}

.panel-heading h2 {
  font-family: "Noto Naskh Arabic", serif;
  font-size: clamp(1.55rem, 2.3vw, 2.1rem);
  line-height: 1.25;
}

.panel-heading p {
  margin-top: 4px;
  color: var(--panel-muted);
  font-size: 0.88rem;
}

.count-chip,
.status-chip,
.group-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.count-chip {
  background: #102019;
  color: white;
}

.match-list {
  display: grid;
  max-height: 840px;
  overflow: auto;
}

.match-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 112px;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--dark-line);
}

.match-card:hover {
  background: rgba(15, 100, 65, 0.07);
}

.match-number {
  color: var(--panel-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.match-body {
  display: grid;
  gap: 8px;
}

.match-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.match-row img {
  width: 30px;
  height: 22px;
  object-fit: contain;
  border: 1px solid var(--dark-line);
  border-radius: 4px;
}

.match-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score {
  min-width: 28px;
  color: var(--green-dark);
  font-size: 1.38rem;
  font-weight: 900;
  text-align: left;
}

.match-meta {
  line-height: 1.6;
}

.status-chip.complete {
  background: rgba(12, 107, 69, 0.12);
  color: var(--green-dark);
}

.status-chip.upcoming {
  background: rgba(74, 166, 200, 0.15);
  color: #11607b;
}

.status-chip.live {
  background: rgba(233, 67, 67, 0.12);
  color: var(--red);
}

.side-stack {
  display: grid;
  gap: 14px;
}

.standings {
  display: grid;
  gap: 16px;
  padding: 0 14px 16px;
}

.group-table {
  overflow: hidden;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
}

.table-caption {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(16, 32, 25, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th,
td {
  padding: 8px 9px;
  border-top: 1px solid var(--dark-line);
  text-align: right;
}

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

td:first-child,
th:first-child {
  width: 42%;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding: 0 14px 16px;
}

.team-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  background: white;
  color: var(--panel-ink);
  padding: 10px;
  text-align: right;
}

.team-card.active {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(12, 107, 69, 0.1);
}

.team-card strong,
.team-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-card strong {
  font-size: 0.9rem;
}

.team-card span {
  margin-top: 3px;
  color: var(--panel-muted);
  font-size: 0.76rem;
}

.squad-panel {
  margin-top: 14px;
}

.squad-shell {
  min-height: 220px;
  padding: 18px;
}

.squad-empty,
.loading-state,
.error-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  border: 1px dashed var(--dark-line);
  border-radius: var(--radius);
  color: var(--panel-muted);
  text-align: center;
  line-height: 1.8;
  padding: 18px;
}

.squad-team-head {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.squad-team-head img {
  width: 70px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
}

.squad-team-head h3 {
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.8rem;
  line-height: 1.2;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.player-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  min-height: 92px;
  align-items: center;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  background: white;
  padding: 10px;
}

.player-photo {
  display: grid;
  width: 50px;
  height: 62px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #e9f1ec;
  color: var(--green-dark);
  font-weight: 900;
}

.player-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-card strong,
.player-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card strong {
  font-size: 0.9rem;
}

.player-card span {
  margin-top: 3px;
  color: var(--panel-muted);
  font-size: 0.76rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.8;
}

.footer a {
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}

.empty-list {
  padding: 44px 18px;
  color: var(--panel-muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .hero,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .featured-match {
    min-height: 300px;
  }

  .players-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
  }

  .nav-links {
    display: none;
  }

  .stats-grid,
  .control-panel {
    grid-template-columns: 1fr 1fr;
  }

  .segmented {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .select-field {
    grid-column: auto;
  }

  .match-card {
    grid-template-columns: 1fr;
  }

  .match-card > .status-chip {
    width: fit-content;
  }

  .players-grid,
  .teams-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    display: grid;
  }
}

@media (max-width: 560px) {
  .topbar,
  .site-shell,
  .footer {
    width: min(100% - 20px, 1420px);
  }

  .hero-copy,
  .feature-inner {
    padding: 18px;
  }

  h1 {
    font-size: 2.7rem;
  }

  .stats-grid,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .score-team {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .score {
    font-size: 2.15rem;
  }

  .panel-heading {
    display: grid;
  }
}
