:root {
  --bg: #0b0a0e;
  --bg-elev: #151319;
  --card: #18161d;
  --card-hover: #201d26;
  --border: #2a2731;
  --text: #f2eee8;
  --text-dim: #a39ea8;
  --accent: #f5a623;
  --accent-2: #ff6b6b;
  --accent-dim: #3a2a10;
  --live: #ff3b56;
  --focus: #7aa2ff;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

body { min-height: 100vh; position: relative; }
body.modal-open { overflow: hidden; }

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

/* ---------- Animated backdrop ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .28;
}

.bg-blobs span:nth-child(1) {
  width: 420px; height: 420px;
  background: var(--accent);
  top: -120px; left: -80px;
  animation: drift1 22s ease-in-out infinite alternate;
}

.bg-blobs span:nth-child(2) {
  width: 380px; height: 380px;
  background: var(--accent-2);
  bottom: -140px; right: -100px;
  animation: drift2 26s ease-in-out infinite alternate;
}

.bg-blobs span:nth-child(3) {
  width: 300px; height: 300px;
  background: #5da3ff;
  top: 40%; right: 20%;
  animation: drift1 30s ease-in-out infinite alternate-reverse;
}

@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-50px, -30px) scale(1.1); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp .45s ease both;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(11, 10, 14, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  white-space: nowrap;
  letter-spacing: -.01em;
}

.brand .camel { font-size: 22px; }

.brand .brand-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand .live-pip {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 10px var(--live);
  animation: pulse 1.6s infinite;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elev);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  background: linear-gradient(90deg, var(--accent), #ffcf6b);
  color: #1a1204;
}

.search-wrap {
  margin-left: auto;
  position: relative;
  min-width: 220px;
  flex: 1 1 240px;
  max-width: 380px;
}

.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--focus);
}

.search-wrap::before {
  content: "🔍";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: .6;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 8px;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 640px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Layout ---------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 60px;
}

.status-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: #2a1414;
  border: 1px solid #4a1f1f;
  color: #ff9b9b;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}

.status-banner.show { display: flex; }

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}

.chip:hover { color: var(--text); border-color: #46414f; transform: translateY(-1px); }

.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Event / fixture cards ---------- */
.event-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.fixture-card {
  background: #ffffff;
  color: #141419;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.5);
  transition: transform .15s ease, box-shadow .15s ease;
}

.fixture-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(0,0,0,.6); }

.fixture-card.is-live {
  border-color: var(--live);
  animation: liveGlow 1.8s infinite;
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 10px 30px -14px rgba(255,59,86,.35); }
  50% { box-shadow: 0 10px 30px -14px rgba(255,59,86,.75); }
}

.fx-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.fx-sport {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8b8b96;
}

.fx-time {
  font-size: 12.5px;
  font-weight: 700;
  color: #5a5a66;
  font-variant-numeric: tabular-nums;
}

.fx-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fx-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.fx-flag-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f0f3;
  border: 1px solid #e4e4ea;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.fx-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fx-flag-fallback {
  font-size: 13px;
  font-weight: 800;
  color: #6a6a76;
}

.fx-team-name {
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 60px;
}

.fx-score {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #141419;
}

.fx-vs {
  font-size: 13px;
  font-weight: 700;
  color: #9a9aa5;
}

.fx-minute {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--live);
}

.fx-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.fx-live-pip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--live);
}

.fx-live-pip::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s infinite;
}

.fx-ft-pip {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #9a9aa5;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,86,.5); }
  50% { box-shadow: 0 0 0 5px rgba(255,59,86,0); }
}

.watch-btn {
  border: none;
  background: #17c974;
  color: #05170c;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s ease;
  margin-left: auto;
}

.watch-btn:hover {
  background: #1fe387;
  box-shadow: 0 4px 16px -4px rgba(23,201,116,.7);
}

.watch-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  background: #d8d8de;
  color: #8b8b96;
  box-shadow: none;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 14px;
}

/* ---------- Channels grid ---------- */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.channel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
  text-align: center;
}

.channel-card:hover,
.channel-card:focus-visible {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px rgba(245,166,35,.5);
  outline: none;
}

.channel-flag { font-size: 26px; }

.channel-lang {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .05em;
}

.channel-play {
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- Popup modal (in-page, no separate page) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 6, 9, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 100%;
  max-width: 980px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transform: scale(.96);
  transition: transform .18s ease;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
}

.modal-overlay.open .modal-box { transform: scale(1); }

.modal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.modal-bar #modal-title {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-lang {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.modal-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s ease;
}

.modal-close:hover { color: var(--text); border-color: var(--accent); }

.modal-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-stage iframe {
  width: 100%; height: 100%; border: 0; display: block;
}

.modal-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
  text-align: center;
  color: #ff9b9b;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- SEO content ---------- */
.seo-content {
  max-width: 1180px;
  margin: 50px auto 0;
  padding: 30px 24px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
}

.seo-content h2 {
  color: var(--text);
  font-size: 20px;
  margin: 0 0 10px;
}

.seo-content h3 {
  color: var(--text);
  font-size: 15px;
  margin: 22px 0 8px;
}

.seo-content p {
  font-size: 13.5px;
  line-height: 1.75;
  margin: 0 0 10px;
}

.seo-content strong { color: var(--text); }

footer.disclaimer {
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 16px 24px 30px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  main { padding: 8px 14px 40px; }
  .hero { padding: 30px 14px 4px; }
  .search-wrap { max-width: none; order: 3; }
  .channels-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
