:root {
  color-scheme: light;
  --bg: #eef1f5;
  --card: #ffffff;
  --soft: #f0f2f5;
  --line: #dfe4ea;
  --text: #202631;
  --muted: #677282;
  --brand: #660000;
  --brand-2: #9b120a;
  --blue: #12507f;
  --gold: #8a6d00;
  --navy: #26394d;
  --shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
  --shell: 1000px;
  --shell-gutter: 48px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101923;
  --card: #1b2a39;
  --soft: #233344;
  --line: #31465b;
  --text: #ffffff;
  --muted: #b9c3cf;
  --brand: #660000;
  --brand-2: #a3150c;
  --blue: #1b6f99;
  --gold: #9a7a00;
  --navy: #32475e;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

body,
button,
input,
select,
textarea {
  font-family: "Cairo", Tahoma, Arial, sans-serif;
}

img,
iframe,
video {
  max-width: 100%;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 10px 0;
}

.site-header.compact {
  margin-bottom: 12px;
}

.header-inner {
  position: relative;
  width: min(calc(100% - var(--shell-gutter)), var(--shell));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  direction: ltr;
}

.brand {
  order: 3;
}

.brand {
  display: grid;
  justify-items: center;
  min-width: 190px;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  line-height: 1.25;
}

.brand strong {
  font-size: 28px;
  letter-spacing: 0;
}

.brand span {
  font-size: 16px;
  opacity: 0.92;
}

.header-title {
  order: 2;
  display: none;
  min-width: 0;
  flex: 1 1 auto;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  direction: rtl;
  text-align: start;
  overflow-wrap: anywhere;
}

.header-social {
  order: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  margin-inline-end: auto;
}

.icon-btn,
.social-btn {
  width: 35px;
  height: 35px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 650;
  cursor: pointer;
  line-height: 1;
}

.icon-btn {
  background: #424242;
  font-size: 22px;
}

.telegram,
.facebook,
.x-twitter {
  background-color: #2aabee;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: #fff;
  font-size: 0;
}

.telegram {
  background-image: none;
}
.facebook {
  background-color: #3b5998;
  background-image: none;
}
.x-twitter {
  background-color: #111111;
  background-image: none;
}
.social-btn i,
.icon-btn i {
  font-size: 16px;
  line-height: 1;
}
.google-news {
  background: #f14336;
}
.twitter {
  background: #55acee;
}
.theme-btn,
.theme-mobile {
  background: #424242;
}

.google-news::before,
.twitter::before {
  content: "";
  display: block;
  background: #fff;
}

.google-news::before {
  width: 25px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 2px;
  background:
    linear-gradient(#f14336 0 0) 50% 42% / 17px 2px no-repeat,
    linear-gradient(#f14336 0 0) 50% 68% / 17px 2px no-repeat,
    #fff;
  box-shadow:
    -5px -4px 0 -1px rgba(255, 255, 255, 0.75),
    5px -7px 0 -2px rgba(255, 255, 255, 0.55);
}

.twitter::before {
  width: 24px;
  height: 19px;
  clip-path: polygon(
    100% 11%,
    88% 13%,
    96% 4%,
    82% 9%,
    71% 0,
    57% 2%,
    48% 11%,
    50% 20%,
    25% 8%,
    33% 23%,
    20% 19%,
    31% 32%,
    20% 32%,
    36% 43%,
    20% 53%,
    37% 56%,
    23% 65%,
    44% 65%,
    30% 77%,
    53% 71%,
    70% 59%,
    80% 42%,
    83% 28%
  );
}

.menu-btn {
  display: none;
  font-size: 16px;
}

.theme-mobile {
  display: none;
}

.drawer,
.drawer-backdrop {
  display: none;
}

.page-shell {
  width: min(calc(100% - var(--shell-gutter)), var(--shell));
  margin: 22px auto 28px;
}

.matches-panel,
.news-panel,
.seo-panel,
.admin-card,
.content-page,
.article-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.matches-panel {
  position: relative;
  padding: 100px 14px 16px;
}

.matches-panel {
  margin-top: 85px;
}

.panel-tabs {
  position: absolute;
  top: 18px;
  right: 18px;
  left: 390px;
  display: block;
  align-items: center;
  gap: 12px;
  margin: 0;
  pointer-events: none;
}

.panel-tabs h1,
.panel-tabs span {
  margin: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 650;
}

.panel-tabs h1 {
  width: max-content;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
}

.timezone-badge {
  position: absolute;
  top: -50px;
  right: 18px;
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 19px;
  font-weight: 630;
  z-index: 2;
}

.date-tabs {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-bottom: 0;
}

.date-tab {
  min-width: 112px;
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  padding: 8px 14px;
  white-space: nowrap;
}

.date-tab.active {
  background: var(--brand-2);
}

.date-tab:first-child {
  background: var(--blue);
}

.date-tab:last-child {
  background: var(--gold);
}

.ad-banner {
  width: 100%;
  min-height: 90px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  font-weight: 650;
  overflow: hidden;
}

.matches-list {
  display: grid;
  gap: 12px;
min-height: 608px;
  contain: layout paint;
}

.match-card {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.45fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  min-height: 146px;
contain: layout paint;
}

.match-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.team-side,
.match-center {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 15px 8px;
}

.team-side {
  grid-template-rows: 52px minmax(24px, auto);
}

.team-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.team-logo.club-logo,
.hero-team img.club-logo {
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.team-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  min-height: 24px;
}

.match-time {
  font-size: 18px;
  font-weight: 650;
  direction: ltr;
}

.match-score {
  font-size: 20px;
  font-weight: 700;
  direction: ltr;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #34495e;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.status-live {
  background: #b51616;
  animation: k365-status-blink 1s ease-in-out infinite;
}
.status-halftime {
  background: #d5ad00;
  color: #fff;
}
.status-finished {
  background: #444;
}
.status-soon {
  background: #008451;
}

@keyframes k365-status-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.match-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.match-meta span {
  min-width: 0;
  padding: 9px 8px;
  background: color-mix(in srgb, var(--soft) 78%, var(--card));
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.match-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.play-btn {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  transform: scale(0.86);
  transition: transform 0.22s ease;
}

.play-btn::before {
  content: "";
  width: 0;
  height: 0;
  margin-inline-start: 5px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 0;
  border-left: 22px solid #222;
}

.match-card:hover .match-overlay,
.match-card:focus-visible .match-overlay {
  opacity: 1;
}

.match-card:hover .play-btn,
.match-card:focus-visible .play-btn {
  transform: scale(1);
}

.news-panel,
.seo-panel {
  margin-top: 18px;
  padding: 18px;
}

.block-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: #4a4a4a;
  color: #fff;
  font-weight: 650;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
min-height: 198px;
}

.news-card {
  overflow: hidden;
  border-radius: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
min-height: 186px;
}

.news-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.news-card h3 {
  margin: 0;
  padding: 10px;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
min-height: 62px;
  overflow-wrap: anywhere;
}

.load-more,
.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 8px 16px;
  font-weight: 650;
  cursor: pointer;
}

.load-more {
  width: 180px;
  min-height: 40px;
  margin: 16px auto 0;
  background: var(--brand-2);
  color: #fff;
  display: flex;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
}
.ghost-btn {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}
.danger-btn {
  background: #b91c1c;
  color: #fff;
}

.seo-panel h2 {
  display: inline-block;
  margin: 0 0 18px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #4a4a4a;
  color: #fff;
  font-size: 18px;
  line-height: 1.6;
}

.seo-panel p {
  margin: 0;
  font-size: 18px;
  line-height: 2;
}

.site-footer {
  width: 100%;
  max-width: 100%;
  margin: 24px 0 0;
  padding: 28px 20px;
  background: var(--card);
  border-top: 1px solid var(--line);
  color: var(--text);
  box-sizing: border-box;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.site-footer nav {
  display: flex;
  gap: 26px;
}

.match-page,
.article-page,
.content-page,
.admin-shell {
  width: min(calc(100% - var(--shell-gutter)), var(--shell));
  margin: 0 auto 28px;
}

.match-hero {
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.54)),
    url("../img/match-stadium-bg.jpg") center / cover;
  color: #fff;
  overflow: hidden;
}

.hero-team {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 650;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hero-team img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
}

.versus {
  font-size: 48px;
  font-weight: 650;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}

.details-panel,
.article-card {
  margin-top: 14px;
  overflow: hidden;
}

.details-panel h1,
.article-card h1 {
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 18px;
  line-height: 1.7;
}

.details-body,
.article-body {
  padding: 22px;
}

.section-chip {
  display: inline-flex;
  margin: 16px 0 10px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--soft);
  font-weight: 650;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 14px;
}

.match-table th,
.match-table td {
  border: 1px solid var(--line);
  padding: 11px;
  text-align: start;
  overflow-wrap: anywhere;
}

.match-table th {
  width: 36%;
  background: var(--soft);
}

.share-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.share-row a {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.share-row a:nth-child(1) {
  background: #2aabee;
}
.share-row a:nth-child(2) {
  background: #25d366;
}
.share-row a:nth-child(3) {
  background: #55acee;
}
.share-row a:nth-child(4) {
  background: #3b5998;
}

.article-card img {
  display: block;
  width: min(100%, 760px);
  margin: 18px auto;
  border-radius: 6px;
}

.article-meta {
  margin: 0;
  padding: 8px 16px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.article-body p {
  margin: 0 0 16px;
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-card {
  padding: 18px;
}

.admin-card h1,
.admin-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-weight: 650;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  padding: 8px 10px;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form .is-hidden {
  display: none;
}

.admin-form input[type="file"] {
  padding: 7px;
  background: color-mix(in srgb, var(--soft) 70%, var(--card));
}

.admin-form .wide,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.admin-row strong,
.admin-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-section-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.admin-section-tab {
  min-width: 150px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

.admin-section-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.admin-section-panel {
  display: none;
}

.admin-section-panel.active {
  display: block;
}

.admin-subsection {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-subsection:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.manual-match-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-row.single-row {
  grid-template-columns: minmax(0, 1fr);
}

.admin-match-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.admin-match-tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.admin-match-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid var(--line);
  background: var(--card);
}

.admin-data-table th,
.admin-data-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.admin-data-table th {
  background: color-mix(in srgb, var(--soft) 82%, var(--card));
  font-size: 12px;
  font-weight: 650;
}

.admin-data-table td {
  font-size: 12px;
}

.match-edit-row {
  display: none;
}

.match-edit-row.active {
  display: table-row;
}

.match-edit-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--soft) 72%, var(--card));
  text-align: initial;
}

.match-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.match-edit-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-weight: 650;
}

.match-edit-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
}

.match-edit-grid .full-row {
  grid-column: 1 / -1;
}

.match-edit-save-actions {
  display: flex;
  justify-content: flex-start;
}

.admin-meta-cell {
  line-height: 1.9;
}

.admin-match-cell {
  display: grid;
  justify-items: center;
  gap: 4px;
  line-height: 1.55;
}

.versus-mark {
  color: var(--muted);
  font-weight: 650;
}

.score-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.score-form input {
  width: 52px;
  min-height: 34px;
  text-align: center;
  padding: 4px;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text);
  font-weight: 650;
}

.compact-actions {
  justify-content: center;
}

.compact-actions .primary-btn,
.compact-actions .ghost-btn,
.compact-actions .danger-btn,
.match-link-actions .primary-btn,
.match-link-actions .danger-btn {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.stream-editor {
  display: grid;
  gap: 8px;
  text-align: start;
}

.match-link-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 650;
}

.match-link-field input,
.match-link-field select,
.match-link-field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
}

.stream-fields {
  display: grid;
  gap: 8px;
}

.stream-fields.is-hidden {
  display: none;
}

.match-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.content-page {
  margin-top: 26px;
  padding: 24px;
}

.content-page h1 {
  margin: 0 0 14px;
}

.content-page p {
  margin: 0 0 14px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  width: min(100% - 24px, 420px);
  margin: 0 auto;
  padding: 28px 0;
}

.login-card {
  width: 100%;
  display: grid;
  justify-items: stretch;
  gap: 16px;
}

.login-brand {
  justify-self: center;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
}

.login-form {
  grid-template-columns: 1fr;
}

.login-message {
  min-height: 24px;
  margin: 0;
  color: #b91c1c;
  text-align: center;
  font-weight: 650;
}

@media (min-width: 801px) {
  .match-card {
    grid-template-columns: 40% 20% 40%;
    min-height: 118px;
  }

  .team-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
  }

  /* الفريق الموجود يمين الوقت */
  .match-card > .team-side:first-child {
    justify-content: flex-end;
  }

  .match-card > .team-side:first-child .team-name {
    order: 1;
  }

  .match-card > .team-side:first-child .team-logo {
    order: 2;
  }

  /* الفريق الموجود يسار الوقت */
  .match-card > .team-side:nth-child(3) {
    justify-content: flex-start;
  }

  .match-card > .team-side:nth-child(3) .team-logo {
    order: 1;
  }

  .match-card > .team-side:nth-child(3) .team-name {
    order: 2;
  }

  .team-logo {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
  }

  .team-name {
    min-height: auto;
    width: 150px;
    font-size: 18px;
    font-weight: 650;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .match-center {
    padding: 18px 6px;
  }
}

@media (max-width: 800px) {
  .site-header {
    min-height: 88px;
    padding: 10px 0;
  }

  .header-inner {
    width: min(100% - 20px, 700px);
    justify-content: center;
    gap: 0;
    direction: rtl;
  }

  .header-title {
    display: none;
  }

  .brand {
    min-width: 170px;
    padding: 8px 14px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand span {
    font-size: 17px;
  }

  .header-social {
    display: none;
  }

  .menu-btn,
  .theme-mobile {
    position: absolute;
    display: inline-grid;
    width: 35px;
    height: 35px;
    border-radius: 12px;
  }

  .menu-btn {
    right: 0;
  }
  .theme-mobile {
    left: 0;
  }

  .drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 80;
    display: block;
    width: min(74vw, 360px);
    padding: 26px 18px;
    background: var(--card);
    box-shadow: -10px 0 28px rgba(15, 23, 42, 0.25);
    transform: translateX(105%);
    transition: transform 0.25s ease;
  }

  body.drawer-open .drawer {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    background: rgba(0, 0, 0, 0.42);
  }

  body.drawer-open .drawer-backdrop {
    display: block;
  }

  .drawer-close {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 10px;
    background: #4a4a4a;
    color: #fff;
    font-size: 22px;
    line-height: 1;
  }

  .drawer-title,
  .drawer-link {
    display: block;
    margin-top: 22px;
    padding: 12px;
    border-radius: 8px;
    background: #4a4a4a;
    color: #fff;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.7;
  }

  .drawer-social {
    display: flex;
    gap: 12px;
    margin-top: 26px;
  }

  .drawer-social .social-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 18px;
  }

  .page-shell {
    width: 100%;
    margin-top: 24px;
  }

  .matches-panel {
    padding: 30px;
    overflow: hidden;
  }

  .matches-panel {
    margin-top: 25px;
  }

  .panel-tabs {
    position: static;
    display: block;
    margin: 0 0 14px;
    pointer-events: auto;
    max-width: 100%;
    overflow: hidden;
  }

  .panel-tabs h1,
  .panel-tabs span {
    width: 60%;
    max-width: 100%;
    min-height: 50px;
    margin: auto;
    font-size: 16px;
    border-radius: 8px;
    display: block;
  }

  .panel-tabs span {
    position: static;
    display: grid;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
  }

  .timezone-badge {
    position: static;
    width: 60%;
    max-width: 100%;
    min-height: 50px;
    margin: 0 auto 10px;
    font-size: 15px;
    border-radius: 8px;
    display: grid;
  }

  .date-tabs {
    position: static;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 0 14px;
  }

  .date-tab {
    min-width: 0;
    min-height: 48px;
    padding: 7px 2px;
    font-size: 13px;
    white-space: normal;
    line-height: 1.35;
    overflow: hidden;
  }

  .ad-banner {
    min-height: 66px;
    margin: 14px 0;
  }

  .match-card {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 0.62fr) minmax(0, 1fr);
    border-radius: 10px;
  min-height: 112px;
  }

  .team-side,
  .match-center {
    padding: 18px 6px;
  }

  .team-side {
    grid-template-rows: 62px 54px;
    align-content: center;
    gap: 8px;
  }

  .team-logo {
    width: 58px;
    height: 58px;
  aspect-ratio: 1 / 1;
  }

  .team-name {
    font-size: 14px;
    min-height: 54px;
    display: grid;
    place-items: center;
    line-height: 1.35;
  }

  .match-time {
    font-size: 18px;
  }

  .status-pill {
    min-width: 82px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .match-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-meta span {
    font-size: 15px;
    padding: 12px 8px;
  }

  .match-meta span:nth-child(2) {
    display: none;
  }

  .news-panel {
    padding: 18px 14px;
  }

  .block-label {
    font-size: 18px;
    border-radius: 10px;
    padding: 8px 18px;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  min-height: 388px;
  }

  .news-card {
    display: grid;
    grid-template-columns: 36% 1fr;
    direction: rtl;
    min-height: 92px;
    border-radius: 10px;
  }

  .news-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .news-card h3 {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 8px;
    font-size: 15px;
  }

  .seo-panel h2 {
    font-size: 18px;
  }

  .seo-panel p {
    font-size: 14px;
  }

  .site-footer {
    width: 100%;
    max-width: 100%;
    margin: 24px 0 0;
    padding: 28px 20px;
    font-size: 15px;
    box-sizing: border-box;
  }

  .match-page,
  .article-page,
  .content-page,
  .admin-shell {
    width: 100%;
  }

  .match-hero {
    min-height: 150px;
    aspect-ratio: 16 / 6.4;
    gap: 10px;
    padding: 12px;
  }

  .hero-team img {
    width: 62px;
    height: 62px;
  }

  .versus {
    font-size: 28px;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-section-tabs {
    grid-template-columns: 1fr 1fr;
    display: grid;
    gap: 8px;
  }

  .admin-section-tab {
    min-width: 0;
    font-size: 14px;
  }

  .admin-table-wrap {
    overflow-x: hidden;
  }

  .admin-data-table,
  .admin-data-table thead,
  .admin-data-table tbody,
  .admin-data-table tr,
  .admin-data-table th,
  .admin-data-table td {
    display: block;
    width: 100%;
  }

  .admin-data-table {
    border: 0;
    background: transparent;
  }

  .admin-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .admin-data-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    overflow: hidden;
  }

  .admin-data-table td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    text-align: start;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-data-table td:last-child {
    border-bottom: 0;
  }

  .admin-data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 650;
  }

  .match-edit-row.active {
    display: block;
  }

  .match-edit-row td {
    display: block;
    width: 100%;
  }

  .match-edit-row td::before {
    display: none;
  }

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

  .admin-match-cell,
  .compact-actions,
  .score-form,
  .admin-check {
    justify-content: flex-start;
    justify-items: start;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding-inline: 0;
  }

  .brand {
    min-width: 148px;
    padding-inline: 12px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand span {
    font-size: 15px;
  }

  .menu-btn,
  .theme-mobile {
    width: 48px;
    height: 48px;
  }

  .date-tabs {
    gap: 4px;
  }

  .date-tab {
    min-height: 44px;
    padding-inline: 1px;
    font-size: 13px;
  }

  .team-logo {
    width: 50px;
    height: 50px;
  }

  .team-name,
  .match-time {
    font-size: 13px;
  }

  .status-pill {
    min-width: 78px;
    font-size: 12px;
  }

  .match-meta span {
    font-size: 14px;
  }

  .news-card h3 {
    font-size: 16px;
  }

  .share-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* صفحة تفاصيل المباراة فقط */

.match-page .hero-team {
  font-size: 28px !important;
}

.match-page .versus {
  font-size: 50px !important;
}

.match-page .details-panel h1 {
  font-size: 30px !important;
}

.match-page .details-body {
  font-size: 22px !important;
}

.match-page .section-chip {
  font-size: 22px !important;
}

.match-page .match-table th,
.match-page .match-table td {
  font-size: 22px !important;
}

.match-page .share-row a {
  font-size: 17px !important;
}


.home-ad-banner {
  min-height: 110px;
  padding: 5px;
  background: #f2f3f5;
}

.home-ad-slot {
  width: min(100%, 728px);
  min-height: 90px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.drawer[inert] {
  pointer-events: none;
}
