:root {
  color-scheme: dark;
  --bg: #07080b;
  --surface: #101218;
  --surface-2: #171a22;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f8fb;
  --muted: #a9afbd;
  --soft: #757d8d;
  --accent: #e50914;
  --accent-2: #ff3745;
  --blue: #22a8ff;
  --cyan: #10e2c6;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% -10%, rgba(229, 9, 20, 0.18), transparent 36%),
    radial-gradient(circle at 88% 3%, rgba(16, 226, 198, 0.09), transparent 28%),
    linear-gradient(180deg, #090a0e 0%, var(--bg) 52%, #050609 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

a {
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

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

.topbar,
.player-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1320px;
  padding: 18px clamp(16px, 4vw, 34px);
  position: relative;
  z-index: 10;
}

.app-topbar {
  background: #07080b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  max-width: none;
  position: sticky;
  top: 0;
}

.brand,
.back-link {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  gap: 10px;
}

.brand {
  font-size: 1rem;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #ff2d3d, #b40610);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.34);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 56px;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.filters {
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.filter-pill {
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  min-height: 38px;
  padding: 0 16px;
}

.filter-pill:hover {
  color: var(--text);
}

.filter-pill.is-active {
  background: #f7f8fb;
  color: #111318;
}

.telegram-cta {
  align-items: center;
  background: linear-gradient(135deg, #34b7ff, #0879d9);
  border: 1px solid rgba(200, 235, 255, 0.42);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(34, 168, 255, 0.26);
  color: #fff;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  white-space: nowrap;
}

.telegram-cta:hover {
  filter: brightness(1.08);
}

.telegram-cta svg {
  height: 17px;
  width: 17px;
}

.shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: 24px clamp(16px, 4vw, 34px) 64px;
}

.feature-stage,
.match-card {
  isolation: isolate;
}

.feature-stage {
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: clamp(360px, 48vw, 560px);
  overflow: hidden;
  position: relative;
}

.feature-stage::before {
  background:
    linear-gradient(90deg, rgba(7, 8, 11, 0.94) 0%, rgba(7, 8, 11, 0.76) 36%, rgba(7, 8, 11, 0.18) 72%),
    linear-gradient(180deg, rgba(7, 8, 11, 0.1), rgba(7, 8, 11, 0.88));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.feature-stage::after,
.match-card::before {
  content: none;
}

.match-card::before {
  content: none;
}

.feature-backdrop {
  background-position: center;
  background-size: cover;
  inset: 0;
  position: absolute;
}

.feature-content,
.feature-skeleton,
.feature-empty {
  bottom: clamp(28px, 7vw, 68px);
  left: clamp(20px, 5vw, 64px);
  max-width: min(700px, calc(100% - 40px));
  position: absolute;
  z-index: 2;
}

.feature-content h1,
.feature-skeleton h1,
.feature-empty h1 {
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.94;
  margin: 12px 0 16px;
}

.feature-content p,
.feature-empty p {
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.13rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.feature-kicker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-chip {
  align-items: center;
  background: rgba(16, 226, 198, 0.1);
  border: 1px solid rgba(16, 226, 198, 0.28);
  border-radius: 999px;
  color: var(--cyan);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 950;
  min-height: 32px;
  padding: 0 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.feature-meta {
  display: grid;
  gap: 12px;
}

.feature-content .feature-series {
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.13rem);
  line-height: 1.45;
  max-width: 760px;
  overflow-wrap: normal;
}

.feature-detail-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-detail-row span {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f7f8fb;
  display: inline-flex;
  font-size: clamp(0.86rem, 1.7vw, 0.98rem);
  font-weight: 850;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.feature-detail-row svg {
  color: var(--cyan);
  height: 15px;
  width: 15px;
}

.eyebrow {
  color: var(--cyan);
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-chip,
.badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  gap: 6px;
  padding: 7px 10px;
}

.status-chip.is-live,
.badge.is-live {
  background: linear-gradient(135deg, #f02c3a, #9e0811);
  border-color: rgba(255, 197, 201, 0.34);
  box-shadow: 0 14px 34px rgba(229, 9, 20, 0.28);
}

.status-chip svg,
.badge svg {
  height: 14px;
  width: 14px;
}

.feature-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.hero-watch-button,
.watch-button,
.quality-button {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  gap: 9px;
  justify-content: center;
}

.hero-watch-button {
  background: #f7f8fb;
  color: #0b0d12;
  min-height: 52px;
  min-width: 168px;
  padding: 0 18px;
}

.hero-watch-button[disabled] {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.64);
  cursor: not-allowed;
}

.hero-watch-button:not([disabled]):hover,
.watch-button:not([disabled]):hover,
.quality-button:hover {
  filter: brightness(1.08);
}

.hero-watch-button svg,
.watch-button svg,
.quality-button svg,
.back-link svg,
.icon-button svg {
  height: 18px;
  width: 18px;
}

.content-band {
  margin-top: 32px;
}

.section-head {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  line-height: 1;
  margin-top: 7px;
}

.stats {
  display: flex;
  gap: 10px;
}

.stats span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  min-width: 112px;
  padding: 12px 14px;
}

.stats strong {
  color: var(--text);
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

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

.match-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.024)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  min-height: 360px;
  overflow: hidden;
  position: relative;
}

.match-card:hover {
  border-color: rgba(255, 55, 69, 0.58);
}

.thumb {
  aspect-ratio: 16 / 9;
  background: #151821;
  overflow: hidden;
  position: relative;
}

.thumb::after {
  background: linear-gradient(180deg, transparent 40%, rgba(7, 8, 11, 0.78));
  content: "";
  inset: 0;
  position: absolute;
}

.thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.match-card:hover .thumb img {
  transform: none;
}

.badge {
  left: 12px;
  position: absolute;
  top: 12px;
  z-index: 2;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  padding: 17px;
}

.card-title {
  font-size: 1.12rem;
  line-height: 1.22;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.venue {
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.watch-button {
  background: linear-gradient(135deg, #ff3443, #b60914);
  color: #fff;
  margin-top: auto;
  min-height: 46px;
  padding: 0 16px;
  width: 100%;
}

.watch-button[disabled] {
  background: rgba(255, 255, 255, 0.08);
  color: #7d8493;
  cursor: not-allowed;
}

.empty-state {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
}

.modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.76);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 20;
}

.modal.is-open {
  display: flex;
}

.modal-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    #11141c;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 440px;
  padding: 24px;
  position: relative;
  width: 100%;
}

.modal-panel h2 {
  font-size: 1.55rem;
  margin: 6px 44px 20px 0;
}

.icon-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
}

.quality-list {
  display: grid;
  gap: 10px;
}

.quality-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  justify-content: space-between;
  min-height: 58px;
  padding: 0 16px;
  text-align: left;
}

.quality-button span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 4px;
}

.telegram-gate {
  align-items: center;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 40;
}

.telegram-gate.is-open {
  display: flex;
}

.telegram-gate-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    #10141d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 430px;
  min-width: 0;
  padding: 26px;
  text-align: center;
  width: min(100%, 430px);
}

.telegram-gate-icon {
  align-items: center;
  background: linear-gradient(135deg, #34b7ff, #0879d9);
  border: 1px solid rgba(200, 235, 255, 0.42);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(34, 168, 255, 0.28);
  display: inline-flex;
  height: 54px;
  justify-content: center;
  margin-bottom: 16px;
  width: 54px;
}

.telegram-gate-icon svg {
  height: 24px;
  width: 24px;
}

.telegram-gate-panel h2 {
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.05;
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
}

.telegram-gate-panel p {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.telegram-gate-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.telegram-join-button,
.telegram-done-button {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  gap: 9px;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
}

.telegram-join-button {
  background: linear-gradient(135deg, #34b7ff, #0879d9);
  border: 1px solid rgba(200, 235, 255, 0.42);
  color: #fff;
}

.telegram-done-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
}

.telegram-join-button:hover,
.telegram-done-button:hover {
  filter: brightness(1.08);
}

.telegram-join-button svg,
.telegram-done-button svg {
  height: 18px;
  width: 18px;
}

.player-body {
  background:
    radial-gradient(circle at 50% -20%, rgba(34, 168, 255, 0.18), transparent 38%),
    #05070b;
}

.player-topbar {
  align-items: flex-start;
  max-width: 1180px;
}

.back-link {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
}

.player-topbar h1 {
  font-size: clamp(1.2rem, 4vw, 2rem);
  line-height: 1.15;
  margin-top: 4px;
  text-align: right;
}

.player-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(16px, 4vw, 32px) 40px;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(34, 168, 255, 0.42);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(34, 168, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.video-frame video {
  accent-color: var(--blue);
  display: block;
  height: 100%;
  width: 100%;
}

.quality-control {
  background:
    linear-gradient(180deg, rgba(34, 168, 255, 0.12), rgba(255, 255, 255, 0.035)),
    #0a1019;
  border: 1px solid rgba(34, 168, 255, 0.24);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.quality-control[hidden] {
  display: none;
}

.quality-control-head {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 28px;
}

.quality-control-head span {
  align-items: center;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 8px;
  text-transform: uppercase;
}

.quality-control-head svg {
  height: 16px;
  width: 16px;
}

.quality-control-head strong {
  color: #7fe7ff;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.quality-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quality-option {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  min-width: 82px;
  padding: 8px 12px;
  text-align: left;
}

.quality-option strong {
  font-size: 0.9rem;
  line-height: 1.1;
}

.quality-option span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 3px;
}

.quality-option.is-active {
  background:
    linear-gradient(135deg, rgba(34, 168, 255, 0.95), rgba(8, 121, 217, 0.9)),
    #0a65b8;
  border-color: rgba(180, 226, 255, 0.6);
  color: #fff;
}

.quality-option.is-active span {
  color: rgba(255, 255, 255, 0.8);
}

.player-state {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(34, 168, 255, 0.96), rgba(8, 91, 166, 0.95)),
    rgba(11, 93, 170, 0.92);
  border: 1px solid rgba(180, 226, 255, 0.42);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), 0 8px 22px rgba(34, 168, 255, 0.24);
  color: #fff;
  display: inline-flex;
  gap: 10px;
  justify-content: flex-start;
  line-height: 1;
  max-width: min(320px, calc(100% - 28px));
  min-height: 44px;
  opacity: 1;
  padding: 9px 12px 9px 10px;
  position: absolute;
  right: 14px;
  text-align: left;
  top: 14px;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  visibility: visible;
  z-index: 4;
}

.player-state::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  content: "";
  height: 1px;
  left: 12px;
  opacity: 0.8;
  position: absolute;
  right: 12px;
  top: 0;
}

.player-state-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.player-state-icon svg {
  height: 16px;
  width: 16px;
}

.player-state-copy {
  display: block;
  font-size: 0.84rem;
  font-weight: 900;
  overflow-wrap: anywhere;
  padding-right: 2px;
  padding-top: 1px;
}

.player-state[data-tone="loading"] .player-state-icon svg {
  opacity: 0.9;
}

.player-state[data-tone="ready"] {
  background:
    linear-gradient(135deg, rgba(16, 226, 198, 0.96), rgba(8, 121, 217, 0.92)),
    rgba(8, 121, 217, 0.92);
}

.player-state[data-tone="error"] {
  background:
    linear-gradient(135deg, rgba(34, 168, 255, 0.98), rgba(83, 38, 145, 0.96)),
    rgba(8, 91, 166, 0.94);
}

.player-state.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  visibility: hidden;
}

@media (max-width: 1040px) {
  .match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .player-topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .app-topbar {
    position: relative;
  }

  .top-actions {
    align-items: stretch;
    align-self: stretch;
    flex-direction: column;
    max-width: 340px;
    width: min(100%, 340px);
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: auto;
  }

  .filter-pill {
    font-size: 0.88rem;
    min-width: 0;
    overflow: hidden;
    padding: 0 8px;
    text-overflow: ellipsis;
  }

  .telegram-cta {
    justify-content: center;
    width: 100%;
  }

  .shell {
    max-width: 100vw;
    overflow: hidden;
    padding-left: 20px;
    padding-right: 20px;
  }

  .feature-stage,
  .content-band,
  .match-grid {
    max-width: calc(100vw - 40px);
  }

  .feature-stage {
    min-height: 440px;
  }

  .feature-stage::before {
    background:
      linear-gradient(180deg, rgba(7, 8, 11, 0.16), rgba(7, 8, 11, 0.94)),
      linear-gradient(90deg, rgba(7, 8, 11, 0.72), rgba(7, 8, 11, 0.16));
  }

  .feature-content,
  .feature-skeleton,
  .feature-empty {
    bottom: 24px;
    left: 18px;
  }

  .feature-content h1,
  .feature-skeleton h1,
  .feature-empty h1 {
    font-size: clamp(2.35rem, 12vw, 3.35rem);
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .feature-content p,
  .feature-empty p {
    max-width: min(310px, 100%);
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .player-topbar h1 {
    text-align: left;
  }

  .player-state {
    left: 12px;
    max-width: calc(100% - 24px);
    right: 12px;
    top: 12px;
  }

  .telegram-gate {
    padding: 16px;
  }

  .telegram-gate-panel {
    padding: 24px 18px;
    width: min(100%, calc(100vw - 32px));
  }
}

@media (max-width: 480px) {
  .topbar,
  .player-topbar {
    padding-left: 20px;
    padding-right: 20px;
  }

  .filter-pill {
    font-size: 0.8rem;
  }

  .telegram-gate-panel h2 {
    font-size: 1.45rem;
  }

  .telegram-join-button,
  .telegram-done-button {
    padding: 0 12px;
  }
}
