/* TESSIRVE Theme 5.17.310. Escopo mínimo: copas y contraste.
 * Respeta menú full-screen, pastito y estructura nativa de tres niveles. */
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-flag-310 {
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 20px!important;width:20px!important;height:14px!important;overflow:hidden!important;
}
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-flag-310 .ms-menu-country-flag {
  display:block!important;object-fit:contain!important;width:20px!important;min-width:20px!important;
  max-width:20px!important;height:14px!important;max-height:14px!important;
  border:0!important;box-shadow:none!important;background:transparent!important;border-radius:2px!important;
}
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-label-310 {
  min-width:0;overflow-wrap:normal;line-height:1.2;
}
@media (max-width:1180px) {
  /* Solo el grupo de Copas cambia; los accesos de liga conservan el formato original. */
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner > .ms-cup-group-308 {
    width:100%!important;min-width:0!important;max-width:100%!important;display:block!important;
    margin:3px 0 7px!important;padding:0!important;box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 > .ms-country-toggle {
    display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
    width:100%!important;min-height:48px!important;text-align:center!important;
    color:#fff!important;font-weight:850!important;
    border:1px solid rgba(242,255,244,.43)!important;border-radius:13px!important;
    background:linear-gradient(110deg,rgba(5,30,19,.25),rgba(5,36,20,.40)),
      linear-gradient(120deg,color-mix(in srgb,var(--theme-primary,#178340) 70%,transparent),
      color-mix(in srgb,var(--theme-secondary,#0d5634) 68%,transparent))!important;
    text-shadow:0 1px 2px rgba(0,0,0,.55)!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 > .ms-country-toggle > span {
    flex:0 0 auto!important;text-align:center!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 > .ms-country-toggle svg:last-child {
    position:static!important;margin-left:2px!important;flex:0 0 auto!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 > .ms-country-competitions:not([hidden]) {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;gap:8px!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:8px 0 0!important;padding:0!important;
    background:none!important;border:0!important;box-shadow:none!important;
    border-radius:0!important;box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 > .ms-country-competitions[hidden] {
    display:none!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .ms-country-competition-link {
    display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
    min-width:0!important;width:100%!important;height:auto!important;min-height:56px!important;
    margin:0!important;padding:9px 7px!important;box-sizing:border-box!important;
    background:linear-gradient(135deg,rgba(255,255,255,.14),rgba(255,255,255,.08))!important;
    color:#fff!important;border:1px solid rgba(225,250,227,.43)!important;
    border-radius:14px!important;box-shadow:inset 0 1px 1px rgba(255,255,255,.08)!important;
    font-size:clamp(11px,2.85vw,13px)!important;font-weight:750!important;
    text-shadow:0 1px 2px rgba(0,0,0,.68)!important;white-space:normal!important;text-align:center!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .ms-country-competition-link:where(:hover,:focus-visible) {
    background:rgba(255,255,255,.22)!important;border-color:rgba(255,255,255,.8)!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .ms-country-competition-link .tsv-cup-label-310 {
    display:block!important;flex:0 1 auto!important;max-width:100%!important;overflow-wrap:break-word!important;
  }
}
@media (max-width:355px) {
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .ms-country-competition-link {gap:4px!important;padding:8px 4px!important;font-size:10.5px!important}
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-flag-310,
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-flag-310 .ms-menu-country-flag {width:17px!important;min-width:17px!important;height:12px!important}
}
/* Oscuro con profundidad cromática, nunca un rectángulo negro liso.
 * No cambiamos geometría, altura, menús ni el pastito del tema Canchero. */
html[data-tessirve-color-mode="dark"][data-tessirve-theme="neutral"] body.tessirve-theme .ms-site-header {
  background:linear-gradient(115deg,#122a47 0%,#162c46 54%,#20354e 100%)!important;
  border-color:#3b596f!important;
}
html[data-tessirve-color-mode="dark"] body.tessirve-theme .ms-site-header .ms-header-submenu-inner,
html[data-tessirve-color-mode="dark"] body.tessirve-theme .ms-site-header .ms-site-menu {
  background-color:color-mix(in srgb,var(--theme-secondary,#144b38) 22%,transparent)!important;
}
/* El minutero del marcador debe contrastar con fondo oscuro y con el color elegido. */
html[data-tessirve-color-mode="dark"] body.tessirve-theme .ms-app.ms-match-detail .ms-score-main > span[data-ms-live-status-label] {
  background:linear-gradient(120deg,color-mix(in srgb,var(--theme-primary,#185c46) 23%,#28374b),#28384b)!important;
  color:#fff!important;border:1px solid rgba(215,237,242,.48)!important;
  text-shadow:none!important;opacity:1!important;box-shadow:none!important;
}
/* Otros colores personalizados en modo oscuro: oscurecer la paleta sin aplanarla a negro. */
html[data-tessirve-color-mode="dark"]:not([data-tessirve-theme="neutral"]):not([data-tessirve-theme="canchero"]) body.tessirve-theme .ms-site-header {
  background:linear-gradient(115deg,
    color-mix(in srgb,var(--theme-primary,#27704b) 43%,#152a3b),
    color-mix(in srgb,var(--theme-secondary,#1d5b4a) 47%,#192e3f))!important;
  border-color:color-mix(in srgb,var(--theme-primary,#267b55) 35%,#5c7180)!important;
}

/* 5.17.311: Corrección de ancho del grupo Copas en móvil.
 * El contenedor general es una grid de DOS columnas, por eso width:100%
 * ocupa una SOLA columna. El grupo debe abarcar ambas columnas.
 * No modifica el layout de los accesos de otras competiciones. */
@media (max-width:1180px) {
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner > .ms-country-group.ms-cup-group-308 {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner > .ms-country-group.ms-cup-group-308 > .ms-country-toggle {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner > .ms-country-group.ms-cup-group-308 > .ms-country-competitions:not([hidden]) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 8px !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner > .ms-country-group.ms-cup-group-308 > .ms-country-competitions > .ms-country-competition-link {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* 5.17.312 — identidad real de la competición, proporciones iguales a las ligas. */
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-312 {
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 21px!important;width:21px!important;height:21px!important;min-width:21px!important;
  overflow:hidden!important;line-height:1!important;
}
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-img-312,
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-fallback-312 {
  display:block!important;object-fit:contain!important;width:20px!important;height:20px!important;
  max-width:20px!important;max-height:20px!important;border:0!important;
  background:transparent!important;box-shadow:none!important;filter:none!important;
}
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-fallback-312 {
  width:17px!important;height:17px!important;color:inherit!important;opacity:.85!important;
}
html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-label-310 {
  min-width:0!important;flex:0 1 auto!important;overflow-wrap:normal!important;
  word-break:normal!important;line-height:1.15!important;
}
@media (max-width:1180px) {
  /* Las competiciones ordinarias ya tienen min-height:29-30px; se comparte escala. */
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner
  >.ms-cup-group-308>.ms-country-competitions>.ms-country-competition-link {
    display:flex!important;align-items:center!important;justify-content:center!important;
    height:auto!important;min-height:30px!important;
    padding:6px 6px!important;margin:0!important;
    font-size:.65rem!important;font-weight:760!important;line-height:1.12!important;
    gap:5px!important;box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-312 {
    flex-basis:18px!important;width:18px!important;min-width:18px!important;height:18px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-img-312,
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-fallback-312 {
    width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important;
  }
}
@media (max-width:355px) {
  html body.tessirve-theme .ms-site-header .ms-mobile-submenu-inner
  >.ms-cup-group-308>.ms-country-competitions>.ms-country-competition-link {
    font-size:.62rem!important;padding:5px 3px!important;gap:3px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-312 {
    flex-basis:16px!important;width:16px!important;min-width:16px!important;height:16px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-cup-group-308 .tsv-cup-logo-img-312 {
    width:16px!important;height:16px!important;max-width:16px!important;max-height:16px!important;
  }
}
