/* ===== Tokens (fácil de retocar) ===== */
:root {
  --bg-0: #0a0014;
  --bg-1: #150028;
  --bg-2: #1f0040;
  --neon-cyan: #00e5ff;
  --neon-pink: #ff2bd6;
  --neon-yellow: #ffd400;
  --neon-purple: #7a2bff;
  --neon-magenta: #c100ff;
  --text-0: #ffffff;
  --text-1: #c8b9e0;
  --card-grad: linear-gradient(135deg, #4b0082 0%, #ff2bd6 100%);
  --card-grad-2: linear-gradient(135deg, #1b3aff 0%, #00e5ff 100%);
  --btn-grad: linear-gradient(180deg, #ffffff 0%, #d8d8ff 100%);
  --max-w: 100%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100%;
}

body {
  background:
    radial-gradient(ellipse at 10% 20%, rgba(193, 0, 255, 0.18), transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(0, 229, 255, 0.15), transparent 40%),
    var(--bg-0);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* lightning bolts decorativos en los lados */
body::before, body::after {
  content: "";
  position: fixed;
  top: 0; bottom: 0;
  width: 80px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 80px;
  background-image:
    linear-gradient(135deg, transparent 45%, var(--neon-cyan) 45% 55%, transparent 55%),
    linear-gradient(135deg, transparent 45%, var(--neon-pink) 45% 55%, transparent 55%);
  background-position: 0 20%, 0 70%;
  opacity: 0.25;
  z-index: 0;
}
body::before { left: 0; }
body::after { right: 0; transform: scaleX(-1); }

main, section, header, footer { position: relative; z-index: 1; }

/* ===== Header ===== */
.topbar {
  padding: 12px 16px;
  background: linear-gradient(180deg, #000 0%, #15001f 100%);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  display: grid;
  grid-template-columns: 13fr 7fr;
  align-items: center;
  gap: 12px;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  min-width: 0;
}
.brand img {
  width: max(180px, 50vw);
  height: auto;
  max-width: 100%;
  display: block;
}
.header-actions {
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10%;
}
.btn-quees {
  background: #1f1133;
  color: var(--text-0);
  border: 2px solid var(--neon-purple);
  padding: clamp(6px, 1vw, 18px) clamp(10px, 1.6vw, 32px);
  border-radius: 999px;
  font-size: clamp(10px, 1.2vw, 22px);
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
  white-space: nowrap;
}
.btn-quees:hover { filter: brightness(1.3); }

@media (max-width: 600px) {
  .btn-quees {
    font-size: 0;
    padding: 0;
    width: clamp(32px, 8vw, 40px);
    height: clamp(32px, 8vw, 40px);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
  }
  .btn-quees::before {
    content: "?";
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 700;
    color: var(--text-0);
  }
}

.btn-menu {
  background: var(--neon-yellow);
  border: none;
  width: clamp(40px, 4vw, 80px);
  height: clamp(40px, 4vw, 80px);
  border-radius: clamp(8px, 0.8vw, 14px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: clamp(4px, 0.45vw, 10px);
  cursor: pointer;
}
.btn-menu span {
  width: clamp(18px, 1.8vw, 36px);
  height: clamp(2px, 0.2vw, 4px);
  background: #000;
  border-radius: 2px;
}
.dropdown {
  position: absolute;
  top: clamp(52px, 5.6vw, 112px);
  right: 16px;
  background: #1f1133;
  border: 1px solid var(--neon-purple);
  border-radius: 12px;
  padding: 8px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 30;
}
.dropdown a {
  display: block;
  padding: 10px 12px;
  color: var(--text-0);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.dropdown a:hover { background: var(--neon-purple); }

/* ===== Banner carousel ===== */
.banner-carousel {
  margin: 16px auto;
  max-width: var(--max-w);
  aspect-ratio: 1920 / 800;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1b0040, #4b0082);
  box-shadow: 0 0 28px rgba(193, 0, 255, .35);
}
.banner-carousel .slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .6s ease;
}
.banner-carousel .slide.fit-contain { background-size: contain; }
.banner-carousel .slide.active { opacity: 1; }
.banner-carousel .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 2px dashed rgba(255,255,255,.2);
  border-radius: 14px;
}
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 0, 20, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 900;
  z-index: 5;
  backdrop-filter: blur(4px);
  transition: background .15s, transform .15s;
}
.carousel-nav:hover { background: rgba(0, 229, 255, 0.35); transform: translateY(-50%) scale(1.08); }
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

/* ===== Cuerpo página ===== */
.cuerpo-pagina {
  max-width: var(--max-w);
  margin: 24px auto;
  padding: 0 16px;
}
.cuerpo-pagina img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

/* ===== Parrilla ===== */
.parrilla {
  max-width: var(--max-w);
  margin: 0 auto 80px;
  padding: 0 12px;
}
.parrilla-locked {
  max-width: 560px;
  margin: 40px auto 80px;
  padding: 28px 24px;
  text-align: center;
  border: 1px dashed rgba(255, 212, 0, .4);
  border-radius: 18px;
  background: rgba(21, 0, 40, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.parrilla-locked p {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.parrilla-locked p strong { color: var(--neon-yellow); }

.parrilla-status {
  text-align: center;
  color: var(--text-1);
  padding: 24px;
}
.league-block {
  margin-bottom: 22px;
}
.league-header {
  font-size: clamp(13px, 1.6vw, 24px);
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--neon-yellow);
  margin: 0 4px 10px;
  text-transform: uppercase;
  text-align: center;
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 700px));
  justify-content: center;
  gap: 14px;
  align-items: start;
}
.match-card { margin-bottom: 0; }

/* card */
.match-card {
  --home-rgb: 80, 80, 80;
  --away-rgb: 80, 80, 80;
  container-type: inline-size;
  background: linear-gradient(180deg, #0a0e2a 0%, #050818 100%);
  border-radius: 22px;
  padding: 14px 14px 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
  color: var(--text-0);
  isolation: isolate;
}
.match-card::before, .match-card::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 200px;
  pointer-events: none;
  z-index: -1;
}
/* slashes home (izquierda): outer (al borde) brillante, inner (cerca del logo) opaca */
.match-card::before {
  left: 0;
  background: linear-gradient(
    115deg,
    rgba(var(--home-rgb), 0.95) 0%,
    rgba(var(--home-rgb), 0.95) 26%,
    transparent 26%,
    transparent 38%,
    rgba(var(--home-rgb), 0.45) 38%,
    rgba(var(--home-rgb), 0.45) 52%,
    transparent 52%
  );
  filter: drop-shadow(0 0 14px rgba(var(--home-rgb), 0.45));
}
/* slashes away (derecha): mirror */
.match-card::after {
  right: 0;
  background: linear-gradient(
    -115deg,
    rgba(var(--away-rgb), 0.95) 0%,
    rgba(var(--away-rgb), 0.95) 26%,
    transparent 26%,
    transparent 38%,
    rgba(var(--away-rgb), 0.45) 38%,
    rgba(var(--away-rgb), 0.45) 52%,
    transparent 52%
  );
  filter: drop-shadow(0 0 14px rgba(var(--away-rgb), 0.45));
}

.match-league {
  text-align: center;
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.85);
  margin-bottom: 6px;
}
.match-league b { color: var(--neon-yellow); }

.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.match-team {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 0;
}
.team-logo-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.team-logo {
  width: clamp(73px, 16cqi, 110px);
  height: clamp(73px, 16cqi, 110px);
  border-radius: 50%;
  background: var(--neon-cyan);
  padding: 5px;
  object-fit: contain;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(0, 229, 255, 0.45),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18);
}

/* Tarjetas rojas: hasta 2 sobrepuestas en el lado derecho del escudo,
   sobre la circunferencia. La 2da queda corrida abajo-derecha respecto a la 1ra. */
.team-reds {
  position: absolute;
  top: 8%;
  right: -6%;
  width: clamp(28px, 7cqi, 42px);
  height: clamp(38px, 9cqi, 56px);
  pointer-events: none;
  z-index: 3;
}
.red-card {
  position: absolute;
  width: clamp(14px, 3.6cqi, 22px);
  aspect-ratio: 7 / 10;
  background: linear-gradient(180deg, #ff2a2a 0%, #b50000 100%);
  border: 1.5px solid #1a0033;
  border-radius: 2px;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  top: calc(var(--i) * 28%);
  left: calc(var(--i) * 35%);
}
.team-name {
  font-size: clamp(13px, 2.76cqi, 17px);
  font-weight: 700;
  text-align: center;
  max-width: clamp(110px, 26cqi, 190px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.match-center {
  text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.match-minute {
  font-size: clamp(28px, 6cqi, 44px);
  font-weight: 900;
  color: var(--neon-yellow);
  line-height: 1;
}
.match-score {
  font-size: clamp(28px, 6cqi, 44px);
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
}

/* odds buttons */
.odds-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.odd-btn {
  flex: 1 1 0;
  min-width: clamp(72px, 18cqi, 120px);
  background: var(--btn-grad);
  color: #1a0033;
  border: none;
  border-radius: 11px;
  padding: clamp(6px, 1.4cqi, 10px) clamp(8px, 2cqi, 14px);
  cursor: pointer;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.1);
}
.odd-value {
  font-weight: 900;
  font-size: clamp(14px, 3.08cqi, 22px);
  color: #1a0033;
}
.odd-label {
  font-size: clamp(12px, 2.55cqi, 18px);
  font-weight: 600;
  color: #5b3aa6;
}
.odd-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* Botón "fuerte": cuota proviene de regla R4 o R5 (favorito pre-match ≤ 1.5).
   Borde dorado + estrella en la esquina superior derecha. */
.odd-btn.fuerte {
  position: relative;
  box-shadow:
    inset 0 0 0 2px var(--neon-yellow),
    inset 0 -2px 0 rgba(0,0,0,.1),
    0 0 14px rgba(255, 212, 0, .85);
}
.odd-btn.fuerte::before {
  content: "★";
  position: absolute;
  top: 1px;
  right: 5px;
  font-size: clamp(12px, 3.2cqi, 18px);
  line-height: 1;
  color: var(--neon-yellow);
  text-shadow:
    0 0 6px rgba(255, 212, 0, .95),
    0 1px 2px rgba(0, 0, 0, .5);
  pointer-events: none;
}

/* card overrides para viewports muy angostos (Z Fold y similares). El @container
   referencia .match-card (que tiene container-type: inline-size) — se activa
   cuando el card es más chico que 380px, sin importar el viewport. */
@container (max-width: 380px) {
  .team-logo {
    width: clamp(40px, 18cqi, 73px);
    height: clamp(40px, 18cqi, 73px);
    padding: 3px;
  }
  .team-name {
    font-size: clamp(10px, 3.2cqi, 13px);
    max-width: clamp(60px, 32cqi, 110px);
  }
  .match-minute, .match-score {
    font-size: clamp(18px, 7cqi, 28px);
  }
  .odd-btn {
    min-width: clamp(44px, 22cqi, 72px);
    padding: clamp(4px, 1.4cqi, 6px) clamp(5px, 2cqi, 8px);
    border-radius: 8px;
  }
  .odd-value {
    font-size: clamp(11px, 3.6cqi, 14px);
  }
  .odd-label {
    font-size: clamp(9px, 3cqi, 12px);
    line-height: 1.1;
  }
  .odd-btn.fuerte::before {
    font-size: clamp(9px, 3.6cqi, 12px);
    top: 1px;
    right: 3px;
  }
  .team-reds {
    width: clamp(20px, 8cqi, 30px);
    height: clamp(28px, 11cqi, 40px);
  }
  .red-card {
    width: clamp(10px, 4cqi, 16px);
  }
  .match-row { gap: 6px; }
  .odds-row { gap: 6px; margin-top: 8px; }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 18px 16px 32px;
  font-size: 11px;
  color: var(--text-1);
  position: relative;
}
.footer a { color: var(--neon-cyan); text-decoration: none; }
.footer-btn {
  position: fixed;
  right: 16px; bottom: 16px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--neon-yellow);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 212, 0, .5);
  z-index: 40;
}
.footer-btn img,
.footer-btn svg { width: 28px; height: 28px; }

/* ===== Modal ===== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  border-radius: clamp(12px, 3vw, 18px);
  background:
    linear-gradient(rgba(10, 5, 30, 0.55), rgba(10, 5, 30, 0.55)),
    url("/images/banners/BARRA.jpg") center/cover no-repeat;
  color: var(--text-0);
  padding: clamp(14px, 4vw, 22px);
  max-width: 576px;
  width: min(92%, 576px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  overflow-wrap: anywhere;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.modal[open] {
  display: flex;
  flex-direction: column;
}
.modal-scroll {
  min-height: 0;
  overflow-y: auto;
}
.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(135deg, #39ff14 0%, #c8ff00 50%, #ffd400 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 14px);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--neon-cyan);
}
.modal-warn {
  width: clamp(28px, 7vw, 40px);
  height: clamp(28px, 7vw, 40px);
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.modal h3 {
  color: var(--neon-cyan);
  margin: 0;
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.modal #modal-body p {
  font-size: clamp(11px, 2.8vw, 13px);
  line-height: 1.5;
  margin-bottom: 8px;
  color: var(--text-0);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.modal #modal-body h4 { font-size: clamp(11px, 2.8vw, 13px); color: var(--neon-yellow); margin: 14px 0 6px; }

.modal-wrap { display: flow-root; }

.modal-fox {
  float: right;
  width: clamp(102px, 36%, 202px);
  height: auto;
  shape-outside: url("/images/banners/Zorro%20guapo%20bottom.png");
  shape-margin: 10px;
  shape-image-threshold: 0.5;
  margin: 0 0 0 12px;
  pointer-events: none;
  user-select: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 16px;
  flex-wrap: wrap;
  clear: both;
}
.modal-btn {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--neon-purple);
  transition: filter .15s;
  white-space: nowrap;
  overflow-wrap: normal;
}
.modal-btn:hover { filter: brightness(1.2); }
.modal-btn.danger {
  background: transparent;
  border: 1px solid #ff5577;
  color: #ff5577;
}
.modal-btn.danger:hover { background: rgba(255, 85, 119, 0.15); filter: none; }

@media (max-width: 480px) {
  .modal {
    padding: clamp(10px, 3.5vw, 16px);
  }
  .modal-title-row {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }
  .modal-fox {
    width: clamp(94px, 32%, 153px);
  }
}
@media (max-width: 320px) {
  .modal-fox {
    width: clamp(77px, 26%, 119px);
  }
}

.modal-warn[hidden] { display: none; }

/* ===== Responsive (desktop) ===== */
@media (min-width: 720px) {
  .parrilla { padding: 0 24px; }
  .match-card { padding: 18px 18px 14px; }
}
