:root {
  --page-bg: #eef1f5;
  --panel: #ffffff;
  --line: #d8dde6;
  --text: #121826;
  --muted: #5f6b7a;
  --brand: #12c96b;
  --soft-panel: #f6f7f9;
  --table-cell: #f9fafb;
}

html[data-theme="dark"],
body[data-theme="dark"] {
  --page-bg: #1a222d;
  --panel: #212d3b;
  --line: #2d3d4f;
  --text: #ffffff;
  --muted: #a7b4c5;
  --soft-panel: #182637;
  --table-cell: #172331;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-type);
}

.match-longform {
  margin-top: 20px;
  font-size: 17px;
  text-align: justify;
  line-height: 2;
}

.match-longform-lead {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--soft-panel);
  border-inline-start: 4px solid var(--main-color);
}

.match-analysis-section {
  margin-bottom: 20px;
}

.match-analysis-section h2 {
  display: table;
  margin: 0 0 10px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--soft-panel);
  font-size: 18px;
  font-weight: 700;
}

.match-analysis-section p {
  margin: 0;
}

.match-related-block {
  margin-top: 20px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 0 4px rgba(0, 0, 0, .16);
}

.match-related-head h2 {
  margin: 0 0 20px;
  font-size: 20px;
}

.match-related-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.match-related-card {
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  transition: transform .2s ease, box-shadow .2s ease;
}

.match-related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
}

.match-related-card > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  background: var(--soft-panel);
}

.match-related-card > div {
  min-height: 110px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-related-card > div > div:first-child {
  font-size: 15px;
  line-height: 1.7;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.match-related-card > div > div:last-child {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.match-related-more {
  margin: 22px auto 0;
  padding: 9px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: block;
  background: var(--soft-panel);
  color: var(--text);
  cursor: pointer;
}

.match-related-more:hover {
  background: var(--main-color);
  color: #fff;
}
a {
  color: inherit;
}
.wrap {
  width: min(100% - 24px, 1050px);
  margin: 14px auto 28px;
}
.brand {
  display: inline-block;
  margin: 8px 0 16px;
  font-weight: 900;
  text-decoration: none;
  color: #111827;
  letter-spacing: 0;
}
h1 {
  margin: 0;
  font-size: clamp(18px, 3.3vw, 24px);
  line-height: 1.55;
  text-align: center;
}
h2 {
  margin: 0 0 14px;
  font-size: clamp(16px, 3vw, 20px);
  line-height: 1.55;
}
p {
  line-height: 2;
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}
.card strong {
  display: block;
  margin-bottom: 8px;
}
.meta {
  color: #64748b;
  font-size: 14px;
}
.top {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.teams img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.match-page {
  width: min(100% - 18px, 1000px);
  margin: 8px auto 30px;
}
.match-hero {
  min-height: 210px;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.42)),
    var(--match-stadium-bg);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: clamp(18px, 4vw, 34px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.match-team {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
}
.match-team-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.match-logo {
  width: clamp(62px, 12vw, 96px);
  height: clamp(62px, 12vw, 96px);
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.match-logo.is-national {
  border-radius: 50%;
  object-fit: cover;
}
.match-logo.is-club {
  border-radius: 0;
  object-fit: contain;
  padding: 0;
}
.versus {
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}
.match-info-ad {
  margin: 18px auto;
}
.match-floating-ads {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 950;
  display: grid;
  gap: 10px;
}
[dir="rtl"] .match-floating-ads {
  right: auto;
  left: 16px;
}
.match-floating-ad-card {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.match-floating-ad-card iframe,
.match-floating-ad-card img,
.match-floating-ad-card ins {
  max-width: 100%;
  max-height: 100%;
}
.content-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.match-heading {
  padding: 12px 16px;
  background: var(--soft-panel);
  border-bottom: 1px solid var(--line);
  font-weight: 900;
  text-align: center;
  font-size: clamp(16px, 2.6vw, 20px);
}
.match-body {
  padding: clamp(16px, 4vw, 28px);
}
.section-title {
  display: inline-block;
  margin: 18px 0 12px;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--soft-panel);
  font-size: 17px;
  font-weight: 900;
}
.match-body > .match-watch-box + .section-title {
  margin-top: 0;
}
.details-text {
  font-size: 17px;
  margin-bottom: 0;
}
.match-body > .match-table {
  margin-top: 0;
}
.match-watch-box {
  margin: 0 0 24px;
}
.match-watch-button,
.match-watch-unavailable,
.match-watch-countdown {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  font-size: clamp(17px, 3vw, 24px);
  font-weight: 900;
  line-height: 1.35;
}
.match-watch-button {
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #b91c1c, #ef4444, #991b1b);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 26px rgba(185, 28, 28, 0.42);
  animation: koraWatchPulse 1s ease-in-out infinite;
}
.match-watch-button:hover,
.match-watch-button:focus-visible {
  color: #fff;
  transform: translateY(-1px);
  outline: 3px solid rgba(239, 68, 68, 0.28);
  outline-offset: 3px;
}
.match-watch-unavailable {
  color: var(--muted);
  background: var(--soft-panel);
  border: 1px dashed var(--line);
}
.match-watch-countdown {
  color: #fff7ad;
  background: #171717;
  border: 1px solid rgba(255, 247, 173, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 173, 0.12);
  direction: ltr;
}
@keyframes koraWatchPulse {
  0%,
  100% {
    background: linear-gradient(135deg, #991b1b, #dc2626, #7f1d1d);
    box-shadow: 0 0 0 rgba(239, 68, 68, 0), 0 12px 26px rgba(185, 28, 28, 0.34);
    filter: brightness(1);
    transform: scale(1);
  }
  50% {
    background: linear-gradient(135deg, #ef4444, #ff1f1f, #b91c1c);
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.72), 0 16px 30px rgba(185, 28, 28, 0.48);
    filter: brightness(1.22);
    transform: scale(1.01);
  }
}
.match-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
}
.match-table th,
.match-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: middle;
}
.match-table th {
  width: 34%;
  background: var(--soft-panel);
  text-align: start;
  font-weight: 900;
}
.match-table td {
  background: var(--table-cell);
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .wrap {
    margin-top: 14px;
  }
  .top {
    padding: 16px;
  }
  .match-page {
    width: min(100% - 12px, 1000px);
  }
  .match-hero {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    min-height: 136px;
    aspect-ratio: 16 / 6.2;
    padding: 12px;
  }
  .match-team {
    gap: 7px;
  }
  .match-logo {
    width: clamp(48px, 16vw, 70px);
    height: clamp(48px, 16vw, 70px);
  }
  .match-team-name {
    font-size: clamp(11px, 3.3vw, 14px);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .versus {
    font-size: clamp(30px, 9vw, 46px);
  }
  .match-table {
    font-size: 15px;
  }
  .match-table th,
  .match-table td {
    padding: 9px;
  }
  .match-watch-button,
  .match-watch-unavailable,
  .match-watch-countdown {
    min-height: 54px;
    border-radius: 10px;
    padding: 12px 14px;
  }
  .match-floating-ads {
    right: 10px;
    bottom: 10px;
    gap: 7px;
  }
  [dir="rtl"] .match-floating-ads {
    right: auto;
    left: 10px;
  }
  .match-floating-ad-card {
    width: 52px;
    height: 52px;
    border-radius: 8px;
  }

  .match-longform {
    font-size: 16px;
    text-align: start;
  }

  .match-related-block {
    padding: 14px;
  }

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

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