/* ============================================================
   IPTV MUNDIAL · Sistema de diseño futurista
   ============================================================ */
:root {
  /* Fondos */
  --bg-0: #05070f;
  --bg-1: #0a0f1e;
  --panel: rgba(18, 25, 43, 0.55);
  --panel-2: rgba(30, 40, 66, 0.55);
  --panel-solid: #0f1626;

  /* Bordes */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Texto */
  --text: #eaf0fb;
  --muted: #8a96ad;

  /* Acentos neón */
  --cyan: #00e5ff;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --accent: #3b9bff;
  --danger: #ff4d6a;
  --ok: #22d3a7;
  --gold: #ffd24a;

  /* Degradados */
  --grad: linear-gradient(120deg, #00e5ff, #3b82f6, #8b5cf6);
  --grad-soft: linear-gradient(120deg, rgba(0,229,255,.18), rgba(139,92,246,.18));

  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px var(--border-strong), 0 8px 30px rgba(0, 229, 255, 0.08);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-0);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Fondo animado con orbes de neón */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(0, 229, 255, 0.10), transparent 60%),
    radial-gradient(55vw 55vw at 100% 0%, rgba(139, 92, 246, 0.12), transparent 55%),
    radial-gradient(50vw 50vw at 50% 120%, rgba(59, 130, 246, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
/* Rejilla técnica sutil */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 90%);
  pointer-events: none;
}

::selection { background: rgba(0, 229, 255, 0.3); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.35); }

/* ----------------------------- Topbar ----------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(8, 12, 22, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.search-wrap { display: flex; gap: 10px; flex: 1; justify-content: center; }
input, select, .btn { font-family: var(--font-body); }
.search-wrap input,
.search-wrap select {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap input:focus,
.search-wrap select:focus {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}
#search { width: min(340px, 50vw); }
select option { background: var(--panel-solid); }

.admin-link {
  text-decoration: none;
  font-size: 18px;
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.admin-link:hover { border-color: rgba(0, 229, 255, 0.5); transform: translateY(-1px); }
.nav-mundial {
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 12px;
  color: #06121f;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--gold), #ffb020);
  box-shadow: 0 6px 20px rgba(255, 176, 32, 0.25);
  transition: transform .2s, box-shadow .2s;
}
.nav-mundial:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(255, 176, 32, 0.4); }

/* ----------------------------- Layout ----------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  padding: 22px;
  max-width: 1480px;
  margin: 0 auto;
}
.player-area { min-width: 0; }

.video-shell {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), 0 0 50px rgba(0, 229, 255, 0.07);
}
#video { width: 100%; height: 100%; display: block; background: #000; }
.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 17px;
  background: radial-gradient(circle at 50% 50%, rgba(0,229,255,.06), transparent 70%);
}
.now-playing {
  margin-top: 16px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  min-height: 24px;
  letter-spacing: 0.3px;
}

/* ------------------------- Lista de canales ------------------------ */
.channel-list {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.list-header {
  padding: 14px 16px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}
.list-header span { color: var(--muted); font-weight: 400; }
#channels { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.channel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .12s;
}
.channel:hover { background: var(--panel-2); border-color: var(--border); transform: translateX(2px); }
.channel.active {
  background: var(--grad-soft);
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12) inset;
}
.channel img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #05070f;
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-shrink: 0;
}
.channel .meta { min-width: 0; flex: 1; }
.channel .name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel .group { font-size: 12px; color: var(--muted); }
.ch-del {
  flex-shrink: 0;
  background: rgba(255, 77, 106, 0.10);
  border: 1px solid rgba(255, 77, 106, 0.35);
  color: var(--danger);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity .15s, background .15s, transform .12s;
}
.channel:hover .ch-del { opacity: 1; }
.ch-del:hover { background: var(--danger); color: #fff; transform: scale(1.05); }
.empty { padding: 26px; color: var(--muted); text-align: center; }

/* ------------------------------ Admin ----------------------------- */
.admin-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px;
}
.admin-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow);
  position: relative;
}
.admin-card.wide { max-width: 920px; }
.admin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: var(--grad);
  opacity: 0.4;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.admin-card h1 {
  margin: 0 0 20px;
  font-family: var(--font-head);
  font-size: 23px;
  letter-spacing: 0.4px;
}
.admin-card h2 { font-family: var(--font-head); letter-spacing: 0.3px; }
.form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.form label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.form input {
  background: rgba(5, 8, 16, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form input:focus {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0; }
.btn {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--grad);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(0, 229, 255, 0.3); }
.btn.danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.status {
  background: rgba(5, 8, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.status small { color: var(--muted); }
.flash { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; }
.flash.error { background: rgba(255, 77, 106, .12); border: 1px solid rgba(255, 77, 106, .4); }
.flash.ok { background: rgba(34, 211, 167, .12); border: 1px solid rgba(34, 211, 167, .4); }
.sep { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Depurar canales (admin) */
.depurar { margin: 8px 0 18px; }
.depurar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.depurar-head h2 { font-size: 16px; margin: 0; }
#filterChannels {
  background: rgba(5, 8, 16, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  flex: 1;
  max-width: 240px;
  outline: none;
}
.admin-channels {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
}
.admin-channel:last-child { border-bottom: none; }
.ac-meta { min-width: 0; display: flex; flex-direction: column; }
.ac-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-group { font-size: 12px; color: var(--muted); }
.btn-del {
  background: rgba(255, 77, 106, 0.08);
  border: 1px solid rgba(255, 77, 106, 0.3);
  color: var(--danger);
  border-radius: 9px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}
.btn-del:hover { background: var(--danger); color: #fff; }
.admin-footer { display: flex; justify-content: space-between; margin-top: 18px; }
.back { color: var(--cyan); text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }

/* --------------------------- Navegación --------------------------- */
.nav-links { display: flex; gap: 10px; flex: 1; justify-content: center; }
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.nav-links a:hover { background: var(--panel-2); }
.nav-links a.active {
  background: var(--grad-soft);
  border-color: rgba(0, 229, 255, 0.4);
  color: #fff;
}

/* ------------------------- Mundial: título ------------------------ */
.mundial-body { padding-bottom: 50px; }
.mundial-title-wrap { display: flex; justify-content: center; margin: 34px 0 22px; }
.mundial-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: 2px;
  padding: 14px 40px;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.7);
  backdrop-filter: blur(10px);
  position: relative;
  text-transform: uppercase;
}
.mundial-title::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(90deg, #00e5ff, #3b82f6, #8b5cf6, #ff4dd2, #00e5ff);
  background-size: 300% 100%;
  animation: borderflow 5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.mundial-title::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00e5ff, #8b5cf6, #ff4dd2);
  filter: blur(22px);
  opacity: 0.35;
  z-index: -1;
}
@keyframes borderflow { to { background-position: 300% 0; } }

/* --------------------- Mundial: pestañas grupos ------------------- */
.group-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  padding: 6px 22px 18px;
  max-width: 1080px;
  margin: 0 auto;
}
.tab {
  white-space: nowrap;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.tab:hover { background: var(--panel-2); transform: translateY(-1px); }
.tab.active {
  background: linear-gradient(120deg, var(--gold), #ffb020);
  border-color: transparent;
  color: #06121f;
  box-shadow: 0 6px 20px rgba(255, 176, 32, 0.3);
}
.tab-count { opacity: .7; font-weight: 500; }

/* --------------------- Mundial: buscador ------------------------- */
.mundial-search { display: flex; justify-content: center; margin: 4px 0 26px; }
.mundial-search input {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  width: min(440px, 82vw);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.mundial-search input:focus {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

/* --------------------- Mundial: secciones ------------------------ */
#matchGrid {
  display: flex;
  flex-direction: column;
  gap: 38px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 22px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.section-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.match-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 20px;
}

/* --------------------- Mundial: tarjetas ------------------------- */
.match-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.match-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.12);
}
.group-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(120deg, var(--gold), #ffb020);
  color: #06121f;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  z-index: 3;
  letter-spacing: .6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.status-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.status-tag.finished {
  background: rgba(8, 12, 22, 0.8);
  color: var(--muted);
  border: 1px solid var(--border-strong);
}
.status-tag.live {
  background: rgba(255, 77, 106, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: livepulse 1.6s ease-in-out infinite;
}
@keyframes livepulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 106, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 77, 106, 0); }
}
.flags {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 132px;
}
.flag-box { overflow: hidden; position: relative; }
.flag-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 7, 15, 0.55));
}
.flag-box .flag { width: 100%; height: 100%; object-fit: cover; display: block; }
.flags .center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(8, 12, 22, 0.85);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.35), inset 0 0 12px rgba(0, 229, 255, 0.15);
  z-index: 2;
}
.teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 14px 6px;
  text-align: center;
}
.teams .t { font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.teams .vs {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 99px;
}
.teams .score {
  font-family: var(--font-head);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  font-size: 18px;
}
.match-date { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 12px 16px; }

/* CTA "Ver resumen" en tarjetas finalizadas */
.match-card.clickable { cursor: pointer; }
.card-cta {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--cyan);
  padding: 0 12px 14px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.match-card.clickable:hover .card-cta { opacity: 1; transform: translateY(0); }

/* --------------------- Modal de resumen -------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 11, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: min(860px, 96vw);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 60px rgba(0, 229, 255, 0.12);
  animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(8, 12, 22, 0.7);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); }
.modal-head {
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
  border-bottom: 1px solid var(--border);
}
.ms-stage {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 14px;
}
.ms-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.ms-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 200px;
  text-align: center;
}
.ms-team img {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ms-team span { font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.ms-score {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.ms-meta { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
/* Cuerpo del modal: detalles, estadisticas e incidencias */
.modal-body {
  padding: 20px 22px 26px;
  max-height: 60vh;
  overflow-y: auto;
}
.md-loading, .md-note {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 26px 10px;
  line-height: 1.5;
}
.md-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.md-item {
  background: rgba(5, 8, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.md-k { font-size: 12px; color: var(--muted); }
.md-v { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.md-title {
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: .4px;
  margin: 22px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Barras de estadisticas */
.stat { margin-bottom: 14px; }
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
}
.stat-h, .stat-a { font-family: var(--font-head); font-weight: 600; min-width: 42px; }
.stat-a { text-align: right; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-bar {
  display: flex;
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.sb-h { background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.sb-a { background: linear-gradient(90deg, var(--violet), #ff4dd2); }

/* Incidencias / eventos */
.md-events { list-style: none; margin: 0; padding: 0; }
.md-events li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.md-events li:last-child { border-bottom: none; }
.ev-min { min-width: 34px; color: var(--cyan); font-weight: 700; font-size: 13px; }
.ev-ic { font-size: 15px; }
.ev-pl { font-weight: 600; }
.ev-tm { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ===================== Mundial: sub-navegación ===================== */
.sub-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 auto 22px;
  padding: 0 18px;
}
.sub-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  transition: background .2s, border-color .2s;
}
.sub-nav a:hover { background: var(--panel-2); }
.sub-nav a.active {
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  border-color: transparent;
  color: #06121f;
}

/* ===================== Calendario: modos y posiciones ============== */
.cal-modes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 22px;
}
.cal-mode {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s, border-color .2s;
}
.cal-mode:hover { background: var(--panel-2); }
.cal-mode.active {
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  border-color: transparent;
  color: #06121f;
}

.standings-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 22px;
}
.standings-group {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.standings-group h3 {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-size: 17px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
table.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
table.standings th {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}
table.standings th:nth-child(2) { text-align: left; }
table.standings td { text-align: center; padding: 8px 4px; border-bottom: 1px solid var(--border); }
table.standings tr:last-child td { border-bottom: none; }
.st-pos { color: var(--muted); font-weight: 700; width: 22px; }
.st-team { text-align: left !important; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.st-team img { width: 26px; height: 18px; object-fit: cover; border-radius: 3px; border: 1px solid var(--border); flex-shrink: 0; }
.st-pts { font-family: var(--font-head); font-weight: 700; color: var(--cyan); }
table.standings tr.qualify .st-pos {
  color: #06121f;
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  border-radius: 5px;
}

/* ===================== Mundial: reproductor principal ============== */
.watch { max-width: 1280px; margin: 0 auto; padding: 0 18px 50px; }
.live-now {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px;
}
.ln-item {
  background: rgba(255, 77, 106, 0.12);
  border: 1px solid rgba(255, 77, 106, 0.4);
  color: var(--text);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
}
.ln-item:first-letter { color: var(--danger); }

.server-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.server-dd { position: relative; }
.server-dd-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, var(--accent-2), var(--violet));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: var(--font-head);
  transition: filter .15s, transform .12s;
}
.server-dd-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.server-dd-btn.embed-btn { background: linear-gradient(120deg, var(--violet), #ff4dd2); }
.sdd-icon { font-size: 18px; }
.sdd-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; font-weight: 700; font-size: 15px; }
.sdd-text small { font-weight: 400; font-size: 11px; opacity: .8; }
.sdd-caret { margin-left: 4px; transition: transform .2s; }
.server-dd.open .sdd-caret { transform: rotate(180deg); }
.server-dd.open .server-dd-btn { box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.4); }

.server-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 300px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow), 0 0 30px rgba(0, 229, 255, 0.1);
}
.server-dd.open .server-dd-menu { display: block; }
.dd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.dd-row:last-child { border-bottom: none; }
.dd-name { font-size: 14px; font-weight: 600; }
.dd-play {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .4px;
  color: #06121f;
  background: linear-gradient(120deg, var(--gold), #ffb020);
  padding: 7px 14px;
  border-radius: 999px;
  transition: transform .12s, filter .15s;
}
.dd-play:hover { transform: scale(1.04); filter: brightness(1.05); }

.watch-notice {
  background: linear-gradient(90deg, rgba(245, 197, 24, 0.16), rgba(245, 197, 24, 0.08));
  border: 1px solid rgba(245, 197, 24, 0.4);
  color: #ffe08a;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.watch-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 50px rgba(0, 229, 255, 0.06);
}
.watch-video video,
.watch-video iframe { width: 100%; height: 100%; display: block; background: #000; border: 0; }
.sm-chip.is-embed {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.5);
}

/* Indicador de "Cargando…" sobre el reproductor */
.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(3, 5, 11, 0.55);
  backdrop-filter: blur(2px);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .4px;
  z-index: 4;
  pointer-events: none;
}
.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ocultar la barra de tiempo/segundos y evitar interacción con ella */
video::-webkit-media-controls-timeline,
video::-webkit-media-controls-current-time-display,
video::-webkit-media-controls-time-remaining-display,
video::-webkit-media-controls-seek-back-button,
video::-webkit-media-controls-seek-forward-button {
  display: none !important;
}

/* Selector de calidad */
.quality-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}
.q-label { font-size: 13px; color: var(--muted); font-weight: 600; }
#qualitySel {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Partido en vivo destacado */
.featured {
  background: var(--panel);
  border: 1px solid rgba(255, 77, 106, 0.35);
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 77, 106, 0.08);
  position: relative;
  overflow: hidden;
}
.feat-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.feat-badge.live-badge { background: var(--danger); animation: livepulse 1.6s ease-in-out infinite; }
.feat-badge.next-badge { background: linear-gradient(120deg, var(--cyan), var(--blue)); color: #06121f; }
.feat-vs {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  min-width: 90px;
}
.feat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.feat-team {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 280px;
}
.feat-team:first-child { justify-content: flex-end; }
.feat-team:last-child { justify-content: flex-start; }
.feat-team img {
  width: 54px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.feat-team span { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.feat-score {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  min-width: 90px;
}
.feat-sub { color: var(--muted); font-size: 13px; margin-top: 10px; }
.feat-more { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Miniatura del resumen (modal de detalles) */
.md-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  text-decoration: none;
}
.md-thumb img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.6); transition: filter .2s, transform .3s; }
.md-thumb:hover img { filter: brightness(.45); transform: scale(1.03); }
.md-playbtn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 70px; height: 70px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; padding-left: 5px;
  background: rgba(255, 77, 106, 0.92); box-shadow: 0 0 28px rgba(255, 77, 106, .5);
  transition: transform .2s;
}
.md-thumb:hover .md-playbtn { transform: translate(-50%, -50%) scale(1.08); }
.md-thumb-note {
  position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
  color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.8);
}

/* Espacios de publicidad */
.ad-slot {
  margin: 14px auto;
  max-width: 1280px;
  text-align: center;
  overflow: hidden;
}
.ad-slot:empty { display: none; }

/* Panel admin: controles de medida de anuncios */
.ad-size {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.ad-size-lbl { font-weight: 600; }
.ad-size select, .ad-size input {
  background: rgba(5, 8, 16, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.ad-size input.ad-w, .ad-size input.ad-h { width: 80px; }
.ad-preview { margin: 4px 0 14px; }
.ad-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 180px;
  min-height: 40px;
  background: repeating-linear-gradient(45deg, rgba(0,229,255,.05), rgba(0,229,255,.05) 10px, transparent 10px, transparent 20px);
  border: 1px dashed rgba(0, 229, 255, 0.4);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}

/* Anuncios laterales del reproductor */
.watch-wrap {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
  max-width: 1640px;
  margin: 0 auto;
}
.ad-side {
  flex-shrink: 0;
  margin-top: 60px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  overflow: hidden;
}
.ad-side:empty { display: none; }
@media (max-width: 1100px) {
  .ad-side { display: none; }   /* en móvil/tablet se ocultan los laterales */
  .watch-wrap { display: block; }
}

/* Panel admin: pestañas */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.admin-tab {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.admin-tab:hover { border-color: rgba(0, 229, 255, .4); }
.admin-tab.active {
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  border-color: transparent;
  color: #06121f;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.astat {
  background: rgba(5, 8, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.astat .num { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--cyan); }
.astat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.form textarea {
  background: rgba(5, 8, 16, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-family: monospace;
  resize: vertical;
  min-height: 90px;
  outline: none;
}
.form textarea:focus { border-color: rgba(0, 229, 255, .5); box-shadow: 0 0 0 3px rgba(0, 229, 255, .12); }
.switch-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.secret-url {
  background: rgba(0, 229, 255, 0.08);
  border: 1px dashed rgba(0, 229, 255, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
}

/* Boton de YouTube en el modal de detalles */
.btn-youtube {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(120deg, #ff0033, #cc0000);
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(255, 0, 51, 0.25);
  transition: transform .15s, box-shadow .2s;
}
.btn-youtube:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 0, 51, 0.4); }

/* ----- Admin: lista de servidores ----- */
.server-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.server-match {
  background: rgba(5, 8, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.sm-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.sm-title small { color: var(--muted); font-weight: 400; }
.sm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-soft);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 13px;
}
.chip-x {
  background: rgba(255, 77, 106, 0.15);
  border: none;
  color: var(--danger);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}
.chip-x:hover { background: var(--danger); color: #fff; }

/* ----- En Vivo: botones de servidores en tarjetas ----- */
.live-card { display: flex; flex-direction: column; }
.status-tag.today {
  background: rgba(0, 229, 255, 0.9);
  color: #06121f;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.srv-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 16px;
  margin-top: auto;
}
.srv-pill {
  flex: 1;
  min-width: 110px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: var(--grad-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.srv-pill:hover { background: linear-gradient(120deg, var(--cyan), var(--blue)); color: #06121f; transform: translateY(-1px); }
.srv-none { color: var(--muted); font-size: 13px; }

/* ----- Reproductor integrado (modal En Vivo) ----- */
.player-modal { width: min(960px, 96vw); }
.pm-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.pm-stage {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--danger);
  margin-bottom: 6px;
}
.pm-teams {
  text-align: center;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}
.pm-teams span { color: var(--muted); font-size: 13px; margin: 0 6px; }
.pm-video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.pm-video video { width: 100%; height: 100%; display: block; }
.pm-servers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 22px;
}
.srv-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.srv-group-name {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  min-width: 92px;
}
.srv-btn {
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.srv-btn:hover { border-color: rgba(0, 229, 255, 0.5); }
.srv-btn.active {
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  border-color: transparent;
  color: #06121f;
}

/* Admin: form para añadir canal a un servidor */
.add-chan-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.add-chan-form select {
  flex: 1;
  min-width: 0;
  background: rgba(5, 8, 16, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.add-chan-form .btn { white-space: nowrap; padding: 8px 14px; }

/* ----------------------------- Responsive ------------------------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .channel-list { height: 52vh; }
  .search-wrap { flex-wrap: wrap; }
  #search { width: 100%; }
  .nav-links { order: 3; width: 100%; }
  .topbar { flex-wrap: wrap; }
}
