@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --navy:        #0f1c47;
  --navy-2:      #0a1230;
  --accent:      #2563eb;
  --accent-bg:   #eff6ff;
  --ink:         #0e0e0d;
  --ink-soft:    #5c5c58;
  --line:        #e0deda;
  --off:         #f4f3f0;
  --white:       #fafaf8;
  --green:       #16a34a;
  --green-bg:    #f0fdf4;
  --f-head:      'DM Serif Display', Georgia, serif;
  --f-body:      'Plus Jakarta Sans', sans-serif;
  --radius-card: 18px;
  --radius-sm:   10px;
}

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

/* ══════════════════════════════
   WRAPPER
══════════════════════════════ */
.matches-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ══════════════════════════════
   ENCABEZADO MATCHES
══════════════════════════════ */
.matches-header { padding: 8px 0 24px; }

.matches-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.matches-header-title {
  font-family: var(--f-head);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 400;
}

/* ══════════════════════════════
   SECCIÓN
══════════════════════════════ */
.matches-section { margin-bottom: 32px; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* ══════════════════════════════
   TARJETA BASE
══════════════════════════════ */
.match-card {
  display: block;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px 44px 14px 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
  overflow: hidden;
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.09);
  border-color: rgba(37,99,235,0.25);
}

.match-card.upcoming {
  border-color: rgba(37,99,235,0.3);
  background: linear-gradient(160deg, #f0f4ff 0%, var(--white) 60%);
}

.match-card.finished {
  border-left: 3.5px solid var(--accent);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

/* ══════════════════════════════
   CUERPO TARJETA
══════════════════════════════ */
.match-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

/* ══════════════════════════════
   COLUMNA EQUIPO
══════════════════════════════ */
.team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  max-width: 100px;
}

.team-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--off);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.match-card:hover .team-logo-wrap { transform: scale(1.04); }

.team-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.logo-fallback {
  display: none;
  font-size: 24px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.team-logo-wrap.winner-glow {
  background: #fffbeb;
  border-color: #fcd34d;
  box-shadow: 0 0 0 3px rgba(252,211,77,0.2);
}

.team-logo-wrap.loser-dim { opacity: 0.5; }

.team-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  width: 100%;
}

.team-name.winner-name { color: #92400e; font-weight: 700; }
.team-name.loser-name  { color: var(--ink-soft); font-weight: 500; }

/* ══════════════════════════════
   CENTRO UPCOMING
══════════════════════════════ */
.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.vs-badge {
  font-family: var(--f-head);
  font-size: 22px;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
}

.match-date-label,
.match-time-label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ══════════════════════════════
   CENTRO FINISHED
══════════════════════════════ */
.score-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score {
  font-family: var(--f-head);
  font-size: 26px;
  color: var(--ink-soft);
  line-height: 1;
}

.score.winner-score { color: var(--accent); font-size: 30px; }

.score-sep {
  font-size: 22px;
  color: var(--line);
  font-weight: 300;
}

.sets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.set-chip {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--off);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════
   META INFO
══════════════════════════════ */
.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--off);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 100px;
  line-height: 1;
}

.meta-chip.accent {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: rgba(37,99,235,0.18);
  font-weight: 600;
}

/* ══════════════════════════════
   FLECHA DERECHA
══════════════════════════════ */
.card-arrow {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--line);
  transition: color 0.2s, transform 0.2s;
  pointer-events: none;
}

.match-card:hover .card-arrow {
  color: var(--accent);
  transform: translateY(-50%) translateX(3px);
}

/* ══════════════════════════════
   CALENDARIO DE ROLES
══════════════════════════════ */
.ref-calendar {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  font-family: var(--f-body);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.calendar-days .day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.2;
}

.calendar-days .day span {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.calendar-days .day:hover  { background: var(--off); }

.calendar-days .day.active {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  border-radius: 12px;
}

.calendar-days .day.active span { color: #ffffff; }

.calendar-body {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
}

.calendar-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.calendar-row:last-child { border-bottom: none; }

.calendar-hour {
  padding: 10px 8px 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  border-right: 1px solid var(--line);
  background: var(--off);
  text-align: right;
}

.calendar-slot {
  padding: 8px;
  background: var(--white);
  min-height: 72px;
}

.ref-calendar .match-card {
  all: unset;
  display: block;
  background: var(--navy);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.18s;
  text-decoration: none;
}

.ref-calendar .match-card:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.ref-calendar .match-category {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 5px;
}

.ref-calendar .match-vs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.ref-calendar .match-vs strong { color: #ffffff; font-weight: 700; }

.ref-calendar .match-vs span {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}

/* ══════════════════════════════
   ÁRBITRO — PARTIDOS POR ARBITRAR
══════════════════════════════ */
.ref-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  font-family: var(--f-body);
}

.ref-header {
  padding-bottom: 24px;
}

.ref-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  justify-content: space-between;
}

.ref-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 100px;
  font-family: var(--f-body);
}

.ref-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.ref-title {
  font-family: var(--f-head);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 400;
}

.ref-subtitle {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ref-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

/* 3 columnas verticales */
.ref-card-inner {
  display: flex;
  align-items: stretch;
}

/* Col 1: fecha + hora */
.ref-col-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 12px;
  background: var(--navy);
  min-width: 52px;
  flex-shrink: 0;
  border-right: none;
}

.ref-day {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.ref-month {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.ref-time {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* Col 2: chips + hero */
.ref-col-mid {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--line);
}

/* Chips arriba */
.ref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--off);
  background: var(--off);
}

.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1.4;
}

.ref-chip.accent {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: rgba(37,99,235,0.2);
  font-weight: 600;
}

/* Hero equipos */
.ref-match-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  padding: 10px;
  flex: 1;
}

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

.ref-logo-sm {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--off);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ref-team-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ref-team-initials {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-team-name-sm {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
}

.ref-vs-sm {
  font-family: var(--f-head);
  font-size: 13px;
  font-style: italic;
  color: var(--accent);
  flex-shrink: 0;
}

/* Col 3: botón */
.ref-col-action {
  display: flex;
  flex-direction: column; 
  gap: 8px;              
  justify-content: center;
  align-items: center;
  min-width: 10px;       
  padding: 10px;
}

.ref-play-btn {
  display: flex;
  flex-direction: row;   
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;         
  height: auto;         
  padding: 10px 8px;     
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 10px;       
  font-weight: 600;
  font-family: var(--f-body);
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  text-decoration: none;  /* Por si son etiquetas <a> */
}

.ref-play-btn:hover {
  background: var(--accent);
  transform: scale(1.05);
}

.ref-play-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Empty state */
.ref-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  text-align: center;
}

.ref-empty-icon { font-size: 36px; }
.ref-empty p { font-size: 14px; color: var(--ink-soft); }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (min-width: 600px) {
  .matches-wrapper,
  .ref-wrapper,
  .ref-calendar  { padding: 32px 24px 80px; }

  .team-logo-wrap { width: 64px; height: 64px; border-radius: 16px; }
  .team-logo      { width: 44px; height: 44px; }
  .team-name      { font-size: 14px; max-width: 100px; }
  .score          { font-size: 38px; }
  .score.winner-score { font-size: 44px; }
  .match-card     { padding: 22px 20px 16px; }
  .set-chip       { font-size: 11px; padding: 3px 8px; }

  .calendar-days .day  { font-size: 12px; padding: 10px 6px; }
  .calendar-days .day span { font-size: 17px; }
  .calendar-hour  { padding: 12px 10px 0; font-size: 11px; width: 64px; }
  .calendar-row   { grid-template-columns: 64px 1fr; min-height: 80px; }

  /* Árbitro — desktop */
  .ref-col-date  { min-width: 60px; padding: 16px 14px; }
  .ref-day       { font-size: 22px; }
  .ref-logo-sm   { width: 44px; height: 44px; }
  .ref-team-name-sm { font-size: 11px; max-width: 80px; }
  .ref-vs-sm     { font-size: 15px; }
  .ref-play-btn  { width: 100%; height: auto; padding: 12px; }
  .ref-play-text { font-size: 9px; }
}

@media (min-width: 900px) {
  .matches-wrapper,
  .ref-wrapper,
  .ref-calendar  { padding: 40px 0 80px; }
}


/* ══════════════════════════════
   TARJETA ÁRBITRO V2
══════════════════════════════ */
.ref-card2 {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ref-card2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

/* Fila superior */
.ref2-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--off);
  border-bottom: 1px solid var(--line);
}

.ref2-categoria {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ref2-fecha {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
}

.ref2-cancha {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}

/* Fila central */
.ref2-body {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.ref2-team {
  flex-shrink: 0;
}

.ref2-logo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--off);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ref2-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ref2-initials {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Centro VS */
.ref2-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ref2-vs {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ref2-jornada {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--off);
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

/* Footer botón */
.ref2-footer {
  padding: 10px 16px 14px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.ref2-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--f-body);
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}

.ref2-start-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

/* Responsive */
@media (min-width: 600px) {
  .ref2-logo  { width: 72px; height: 72px; }
  .ref2-vs    { font-size: 14px; }
  .ref2-top   { padding: 12px 20px; }
  .ref2-body  { padding: 18px 20px; }
  .ref2-footer { padding: 12px 20px 16px; }
}