:root {
    --bg: #050810;
    --bg-alt: #111827;
    --card: #0b1020;
    --accent: #ffffff;
    --accent-soft: rgba(0,245,255,0.15);
    --accent-2: #ffffff;
    --accent-3: #ffffff;
    --text: #ffffff;
    --muted: #9ca3af;
    --danger: #ef4444;
    --shadow-soft: 0 24px 60px rgba(0,0,0,0.6);
    --radius-xl: 20px;
}

/* ============================================================
   BASE
============================================================ */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0f172a, #020617);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   TOPBAR
============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(to right, rgba(15,23,42,0.95), rgba(8,47,73,0.95));
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148,163,184,0.3);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1rem;
}
.logo span { color: var(--accent); }

.topbar nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}
.topbar nav a:hover { opacity: 1; }

/* ============================================================
   LAYOUT / SECCIONES
============================================================ */
.page {
    max-width: 1100px;
    margin: 1.5rem auto 2rem;
    padding: 0 1rem 2rem;
}

.section { margin-top: 1.5rem; }
.section-title { font-size: 1.8rem; margin-bottom: 0.2rem; }
.section-subtitle { color: var(--muted); margin-top: 0; }

/* ============================================================
   GRILLA DE CARDS
============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

/* ============================================================
   MATCH CARD
============================================================ */
.match-card {
    background: radial-gradient(circle at top left, rgba(56,189,248,0.15), var(--card));
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148,163,184,0.25);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Mini imagen estadio */
.stadium-row {
    display:flex;
    align-items:center;
    gap:10px;
}
.stadium-thumb {
    width:55px !important;
    height:55px !important;
    display:block;
    border-radius:4px;
    border:1px solid #333;
    object-fit:cover;
}

/* ============================================================
   ENCABEZADO DEL MATCH
============================================================ */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.match-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.match-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.match-phase { font-size: 0.8rem; color: var(--muted); }
.match-date { font-weight: 600; font-size: 0.95rem; }

/* ============================================================
   TEAMS
============================================================ */
.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    margin: 0.6rem 0;
}

.team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.flag {
    width: 28px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(148,163,184,0.6);
}

.flag.big { width: 48px; height: 34px; }

.vs { font-size: 0.9rem; color: var(--muted); }
.vs.big { font-size: 1.1rem; }

/* ============================================================
   LOCATION
============================================================ */
.match-location {
    border-top: 1px dashed rgba(148,163,184,0.4);
    margin-top: 0.6rem;
    padding-top: 0.4rem;
}

.stadium { font-size: 0.85rem; }
.stadium span { color: var(--muted); display:block; }

/* ============================================================
   BOTONES / ACCIONES
============================================================ */
.match-actions {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
    align-items:center;
}

.inline-form { display:inline-block; }

.btn {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
    background: rgba(15,23,42,0.7);
    color: var(--text);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.btn-primary { background: linear-gradient(to right, #22c55e, #0ea5e9); border-color: transparent; }
.btn-secondary { background: rgba(59,130,246,0.2); border-color: rgba(59,130,246,0.7); }
.btn-outline { background: transparent; }
.btn-success { background: rgba(22,163,74,0.2); border-color: #22c55e; }
.btn-warning { background: rgba(245,158,11,0.2); border-color: #f59e0b; }

.btn-small { padding:4px 8px; font-size:12px; }

/* ============================================================
   FILTROS
============================================================ */
.filter-box {
    margin:20px 0;
    padding:15px;
    background:#111;
    border-radius:8px;
}

.filter-row {
    display:flex;
    flex-wrap:wrap;
    gap:20px;
}

.filter-item {
    display:flex;
    flex-direction:column;
    gap:5px;
}

.filter-item label { font-size:0.85rem; color:#aaa; }

.filter-item select,
.filter-item input[type=date],
.filter-item input[type=number] {
    background:#222;
    border:1px solid #555;
    color:white;
    padding:6px 10px;
    border-radius:6px;
}

/* ============================================================
   FIX SEGIDOS.PHP BOTONES LARGOS
============================================================ */
.inline-form { display:inline-block !important; width:auto !important; }
.inline-form button.btn { width:auto !important; }

/* ============================================================
   MATCH.PHP – ESTADIO + SEATPLAN (TARJETAS IGUALES)
============================================================ */

.images-row-improved {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 35px !important;
    margin: 25px 0 40px 0 !important;
    width: 100% !important;
}



.uniform-card {
    background: rgba(11,16,32,0.9);
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 16px;
    padding: 14px;
    width: 450px;
    height: 360px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.img-label {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.uniform-card img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* AHORA SI: mismas proporciones sin recortar */
    transition: transform .25s ease;
}


.uniform-card:hover img {
    transform: scale(1.04);
    cursor: zoom-in;
}

/* MOBILE */
@media (max-width: 780px) {
    .images-row-improved {
        flex-direction: column;
        gap: 25px;
    }
    .uniform-card {
        width: 92%;
        height: 300px;
    }
}
/* ==========================
   SCHEDULE – PANZOOM FIX
========================== */
.panzoom-container {
    position: relative;
    overflow: hidden;
}

#panzoom-area {
    transform-origin: 0 0; /* CLAVE para Panzoom */
    will-change: transform;
}
.team a,
.stadium-info a {
    color: inherit;
    text-decoration: none;
}
.team a:hover span,
.stadium-info a:hover strong {
    text-decoration: underline;
}
/* =========================
   OVERRIDE LINKS FILTRO
   (EQUIPOS + ESTADIO)
========================= */

/* EQUIPOS (nombre) */
.match-card .match-teams .team a span {
    font-size: 0.82rem !important;     /* más chico */
    color: #5fd9ff !important;         /* celeste */
    font-weight: 600;
}

/* contenedor link equipo */
.match-card .match-teams .team a {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ESTADIO (nombre + ciudad) */
.match-card .stadium-info a {
    font-size: 0.8rem !important;
    color: #5fd9ff !important;
    line-height: 1.25;
}

/* hover suave */
.match-card .match-teams .team a:hover span,
.match-card .stadium-info a:hover {
    text-decoration: underline;
}

/* cursor en thumb */
.match-card .stadium-row a img {
    cursor: pointer;
}
/* =========================
   LINKS EQUIPO / ESTADIO
========================= */

/* Estado normal: BLANCO */
.match-card a.team-link,
.match-card a.stadium-link,
.match-card a.team-link span,
.match-card a.stadium-link strong,
.match-card a.stadium-link span {
    color: #ffffff !important;
    font-size: 0.82rem;
    text-decoration: none;
}

/* Hover: CELESTE */
.match-card a.team-link:hover,
.match-card a.team-link:hover span,
.match-card a.stadium-link:hover,
.match-card a.stadium-link:hover strong,
.match-card a.stadium-link:hover span {
    color: #00f5ff !important;
    text-decoration: underline;
}
/* Links de equipo y estadio */
.team-link,
.stadium-link {
    color: #ffffff !important;   /* BLANCO */
}

/* Hover celeste */
.team-link:hover,
.stadium-link:hover {
    color: var(--accent) !important; /* CELESTE */
}
