:root {
  --bg: #09090b;
  --accent: #9eff00;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.58);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.16);
  --shadow: rgba(0, 0, 0, 0.58);
  --radius: 0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--white);
  background:
    radial-gradient(circle at 50% -12%, rgba(158, 255, 0, 0.14), transparent 30rem),
    linear-gradient(180deg, rgba(9, 9, 11, 0.28) 0%, rgba(9, 9, 11, 0.56) 46%, rgba(5, 5, 6, 0.74) 100%),
    url("background.jpg") center / cover no-repeat,
    var(--bg);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at top, black 0%, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 0.6px, transparent 0.7px);
  background-size: 4px 4px;
  opacity: 0.08;
  mix-blend-mode: screen;
}

.page {
  width: min(1600px, calc(100% - 48px));
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(20px, 3vh, 42px) 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 2.2vh, 28px);
  overflow: hidden;
}

.page.is-loading {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  pointer-events: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(5, 5, 7, 0.62), rgba(5, 5, 7, 0.88)),
    radial-gradient(circle at 50% 45%, rgba(158, 255, 0, 0.16), transparent 24rem),
    url("background.jpg") center / cover no-repeat,
    rgba(5, 5, 7, 0.96);
}

.loading-logo {
  width: min(220px, 42vw);
  height: auto;
  filter: drop-shadow(0 0 34px rgba(158, 255, 0, 0.3));
  animation: loadingPulse 1.2s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.top-bar {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.68fr);
  align-items: center;
  gap: clamp(22px, 3vw, 54px);
}

.top-bar:has(.countdown[hidden]) {
  grid-template-columns: 1fr;
  justify-items: center;
}

.top-bar:has(.countdown[hidden]) .match-title {
  text-align: center;
}

.match-title {
  margin: 0;
  min-width: 0;
  color: var(--white);
  font-size: clamp(44px, 4.8vw, 72px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.075em;
  text-align: left;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 24px 72px rgba(0, 0, 0, 0.7);
}

.match-title .vs {
  color: var(--accent);
  letter-spacing: -0.035em;
  text-shadow:
    0 0 20px rgba(158, 255, 0, 0.58),
    0 0 52px rgba(158, 255, 0, 0.28);
}

.countdown {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 0.9vw, 14px);
}

.time-card {
  min-height: clamp(78px, 7vw, 112px);
  padding: 16px 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  display: grid;
  place-items: center;
  gap: 8px;
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.time-card:hover {
  transform: translateY(-4px);
  border-color: rgba(158, 255, 0, 0.68);
  background:
    linear-gradient(180deg, rgba(158, 255, 0, 0.12), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    0 24px 76px rgba(0, 0, 0, 0.45),
    0 0 44px rgba(158, 255, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.time-card strong {
  font-size: clamp(32px, 3.4vw, 54px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
}

.time-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.match-list-wrap {
  width: 100%;
  min-height: 0;
  align-self: stretch;
  display: grid;
  place-items: center;
  overflow: auto;
  padding-bottom: 8px;
}

.match-list {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.match-card {
  min-height: 86px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--line);
  color: var(--white);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.match-card:hover,
.match-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(158, 255, 0, 0.68);
  outline: none;
  box-shadow:
    0 24px 76px rgba(0, 0, 0, 0.45),
    0 0 44px rgba(158, 255, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.match-card[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

.match-card strong {
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.match-card-countdown {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 900;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-shadow: 0 0 20px rgba(158, 255, 0, 0.34);
}

.empty-state {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--glass);
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.player-wrap {
  width: 100%;
  min-height: 0;
  align-self: stretch;
  display: grid;
  place-items: start center;
  overflow: hidden;
}

.player {
  position: relative;
  width: min(1180px, 100%);
  height: min(100%, calc(min(1180px, 100vw - 48px) * 9 / 16));
  min-height: 0;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: #000;
  box-shadow:
    0 40px 110px rgba(0, 0, 0, 0.66),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 90px rgba(158, 255, 0, 0.1);
  isolation: isolate;
}

.player::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 16%),
    radial-gradient(circle at 50% 100%, rgba(158, 255, 0, 0.1), transparent 38%);
  opacity: 0.7;
}

.player iframe,
.poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.poster {
  object-fit: contain;
  opacity: 0.94;
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(circle at 50% -8%, rgba(158, 255, 0, 0.16), transparent 22rem),
      linear-gradient(180deg, rgba(9, 9, 11, 0.22) 0%, rgba(9, 9, 11, 0.5) 42%, rgba(5, 5, 6, 0.76) 100%),
      url("background.jpg") center top / cover no-repeat,
      var(--bg);
  }

  .page {
    width: min(100% - 28px, 1600px);
    padding: 18px 0;
    gap: 14px;
  }

  .top-bar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .match-title {
    font-size: clamp(34px, 8vw, 54px);
    letter-spacing: -0.065em;
    text-align: center;
  }

  .countdown {
    gap: 10px;
  }

  .time-card {
    min-height: 76px;
    padding: 12px 8px 10px;
  }

  .player-wrap {
    align-items: center;
  }

  .player {
    width: min(100%, calc((100dvh - 184px) * 16 / 9));
    height: auto;
  }
}

@media (max-width: 560px) {
  body {
    background:
      radial-gradient(circle at 50% -6%, rgba(158, 255, 0, 0.15), transparent 18rem),
      linear-gradient(180deg, rgba(9, 9, 11, 0.12) 0%, rgba(9, 9, 11, 0.44) 38%, rgba(5, 5, 6, 0.78) 100%),
      url("background.jpg") center center / cover no-repeat,
      var(--bg);
  }

  .page {
    width: min(100% - 20px, 1600px);
    padding: 72px 0 10px;
    gap: 10px;
  }

  .top-bar {
    gap: 10px;
  }

  .match-title {
    font-size: clamp(30px, 10vw, 44px);
    line-height: 0.92;
  }

  .countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .time-card {
    min-height: 62px;
    padding: 10px 4px 8px;
  }

  .time-card strong {
    font-size: clamp(24px, 8vw, 34px);
  }

  .time-card span {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .player {
    width: 100%;
    transform: translateY(2dvh);
  }

  .match-card {
    min-height: 74px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .match-card-countdown {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .page {
    width: min(100% - 16px, 1600px);
    padding: 62px 0 8px;
    gap: 8px;
  }

  .match-title {
    font-size: clamp(26px, 9vw, 36px);
  }

  .countdown {
    gap: 5px;
  }

  .time-card {
    min-height: 54px;
    padding: 8px 3px 6px;
  }

  .time-card strong {
    font-size: clamp(21px, 7vw, 28px);
  }

  .time-card span {
    font-size: 7px;
    letter-spacing: 0.08em;
  }

  .player {
    transform: translateY(3dvh);
  }
}
