/* ==========================================================================
   DISEÑO WEB PREMIUM - MUNDIAL FIFA 2026
   Arquitectura CSS3 con variables y soporte responsive (Mobile-First)
   ========================================================================== */

/* Variables de Diseño (Tokens) */
:root {
    --bg-primary: #080c14;
    --bg-secondary: #0f1524;
    --bg-card: rgba(20, 29, 48, 0.65);
    --bg-card-hover: rgba(28, 41, 66, 0.85);
    --border-color: rgba(38, 55, 87, 0.4);
    --border-color-active: rgba(217, 119, 6, 0.5);
    
    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    
    /* Paleta de colores FIFA */
    --fifa-gold: #eab308;
    --fifa-gold-hover: #ca8a04;
    --fifa-blue: #2563eb;
    --fifa-cyan: #06b6d4;
    --fifa-live: #10b981;
    --fifa-red: #ef4444;
    
    /* Fuentes y bordes */
    --font-family: 'Outfit', sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Estilos Globales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--color-text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbars Personalizados Premium */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--fifa-cyan);
}

/* ==========================================================================
   Header de la Aplicación
   ========================================================================== */
.app-header {
    background: linear-gradient(135deg, #0b1120 0%, #060b13 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.logo-area h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(to right, #ffffff, var(--fifa-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area .subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.badge-live {
    background: var(--fifa-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.8rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--fifa-live);
    box-shadow: 0 0 8px var(--fifa-live);
}

.status-dot.offline {
    background-color: var(--fifa-red);
    box-shadow: 0 0 8px var(--fifa-red);
}

.status-text {
    font-weight: 600;
}

.update-time {
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

/* ==========================================================================
   Panel de Control y API
   ========================================================================== */
.api-control-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin: 1rem auto;
    width: 90%;
    max-width: 1200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.panel-header {
    background: rgba(30, 41, 59, 0.4);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.panel-header:hover {
    background: rgba(30, 41, 59, 0.7);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.panel-body {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.panel-body.hidden {
    display: none;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.input-group {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.input-group input {
    background: rgba(8, 12, 20, 0.8);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    outline: none;
    transition: var(--transition-fast);
}

.input-group input:focus {
    border-color: var(--fifa-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    border: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary { background: var(--fifa-blue); color: white; }
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary { background: rgba(51, 65, 85, 0.8); color: white; }
.btn-secondary:hover { background: rgb(71, 85, 105); }

.btn-success { background: var(--fifa-live); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--fifa-red); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-shortcut {
    background: rgba(30, 41, 59, 0.5);
    color: var(--color-text-muted);
    border: 1px solid var(--border-color);
}
.btn-shortcut.active, .btn-shortcut:hover {
    background: var(--fifa-gold);
    color: #080c14;
    border-color: var(--fifa-gold);
}

.panel-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

/* ==========================================================================
   Menú Navegación (Tabs)
   ========================================================================== */
.app-nav {
    display: flex;
    justify-content: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 73px;
    z-index: 99;
}

.nav-tab {
    flex: 1;
    max-width: 200px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    padding: 1rem 0.5rem;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition-fast);
}

.nav-tab:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.02);
}

.nav-tab.active {
    color: var(--fifa-gold);
    border-bottom-color: var(--fifa-gold);
    background: rgba(217, 119, 6, 0.04);
}

.tab-icon {
    font-size: 1.2rem;
}

/* ==========================================================================
   Contenedor de Contenido y Secciones
   ========================================================================== */
.app-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.view-section {
    display: none;
    animation: fadeIn var(--transition-smooth) forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    margin-bottom: 1.5rem;
}

.view-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.view-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   PESTAÑA 1: DASHBOARD
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.dash-card:hover {
    border-color: var(--border-color-active);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
}

.dash-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--fifa-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Progreso Torneo */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
}

.circular-progress {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--bg-secondary) 79%, transparent 80% 100%),
                conic-gradient(var(--fifa-cyan) 0%, var(--border-color) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: background 1s ease;
}

.progress-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Próximo Partido Destacado */
.next-match-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.next-match-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.65rem;
    font-weight: 800;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid var(--fifa-blue);
    color: #93c5fd;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.featured-match-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0 1.25rem 0;
}

.featured-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.featured-flag {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-team-name {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.featured-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.vs-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.featured-time {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--fifa-gold);
}

.featured-info {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Lista Equipos Clasificados */
.qualified-counter {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.qualified-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--fifa-gold);
}

.qualified-total {
    color: var(--color-text-muted);
    font-weight: 600;
    margin-left: 0.25rem;
}

.qualified-list-scroll {
    max-height: 110px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.qualified-teams-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.qualified-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.qualified-badge img {
    width: 16px;
    height: 11px;
    object-fit: cover;
    border-radius: 1px;
}

.empty-state-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    width: 100%;
    margin-top: 1rem;
}

/* Marquee de Estadios */
.stadium-marquee {
    width: 100%;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0;
    margin-top: 0.5rem;
}

.stadium-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 25s linear infinite;
}

.stadium-item {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
    padding: 0 2rem;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================================================
   PESTAÑA 2: FASE DE GRUPOS
   ========================================================================== */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.group-card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: var(--shadow-lg);
}

.group-title {
    background: rgba(30, 41, 59, 0.4);
    padding: 0.6rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-title span {
    font-size: 0.95rem;
    color: var(--fifa-gold);
}

.group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.group-table th {
    background: rgba(15, 23, 42, 0.2);
    color: var(--color-text-muted);
    font-weight: 700;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.group-table th.align-left, .group-table td.align-left {
    text-align: left;
    padding-left: 0.75rem;
}

.group-table td {
    padding: 0.5rem 0.25rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.group-table tr:last-child td {
    border-bottom: none;
}

/* Destacados clasificados */
.group-table tr.qualified-direct {
    background: rgba(16, 185, 129, 0.04);
}
.group-table tr.qualified-direct td.pos {
    color: var(--fifa-live);
    font-weight: 800;
}

.group-table tr.qualified-third {
    background: rgba(37, 99, 235, 0.04);
}
.group-table tr.qualified-third td.pos {
    color: var(--fifa-blue);
    font-weight: 800;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.team-flag-mini {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 1px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-name-cell {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.group-table td.pts-bold {
    font-weight: 800;
    color: var(--color-text-main);
}

/* Malla de Partidos de Grupo */
.group-matches-container {
    padding: 0.75rem;
    border-top: 1px dashed var(--border-color);
    background: rgba(15, 23, 42, 0.2);
}

.group-matches-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--fifa-gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

@media (min-width: 580px) {
    .group-matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.group-match-card {
    background: rgba(8, 12, 20, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.group-match-card:hover {
    border-color: var(--fifa-cyan);
    background: rgba(28, 41, 66, 0.55);
}

.group-match-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 0.15rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.group-match-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.25rem;
    font-size: 0.74rem;
    font-weight: 500;
}

.group-match-team-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 80%;
}

.group-match-flag {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 1px;
}

.group-match-score {
    font-weight: 800;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.18);
    padding: 0.05rem 0.3rem;
    border-radius: 2px;
    min-width: 16px;
    text-align: center;
}

.group-match-card.finished .group-match-score {
    color: var(--fifa-gold);
}

.group-match-card.live {
    border-color: var(--fifa-live);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
}

.group-match-card.live .group-match-header {
    color: var(--fifa-live);
}

/* ==========================================================================
   PESTAÑA 3: CALENDARIO DE PARTIDOS
   ========================================================================== */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.filters-bar input, .filters-bar select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    outline: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.filters-bar input {
    flex: 2 1 250px;
}

.filters-bar select {
    flex: 1 1 150px;
}

.filters-bar input:focus, .filters-bar select:focus {
    border-color: var(--fifa-cyan);
}

.matches-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.match-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--transition-fast);
    cursor: pointer;
}

.match-item:hover {
    border-color: var(--fifa-cyan);
    background: var(--bg-card-hover);
    transform: scale(1.01);
}

.match-meta-info {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.match-number {
    font-weight: 800;
    color: var(--fifa-gold);
    margin-bottom: 0.15rem;
}

.match-location {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.match-teams-score {
    flex: 3 1 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.team-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 40%;
}

.team-block.home { justify-content: flex-end; text-align: right; }
.team-block.away { justify-content: flex-start; text-align: left; }

.team-block .flag-match {
    width: 28px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

.team-block .name-match {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.score-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    min-width: 25px;
    text-align: center;
}

.score-divider {
    color: var(--color-text-muted);
}

.match-status-area {
    flex: 1 1 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.status-tag {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-tag.scheduled {
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-text-muted);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-tag.live {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid var(--fifa-live);
    animation: live-indicator 1.2s ease infinite;
}

@keyframes live-indicator {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-tag.finished {
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   PESTAÑA 4: CUADRO TIPO BRACKET
   ========================================================================== */
.bracket-nav-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.bracket-outer-container {
    width: 100%;
    overflow-x: auto;
    padding: 1.5rem 0.5rem;
    scroll-behavior: smooth;
}

.bracket-wrapper {
    display: flex;
    gap: 3.5rem; /* Separación horizontal entre rondas */
    min-width: 1200px;
    position: relative;
    padding: 0.5rem;
}

/* Columnas de Rondas */
.bracket-round-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1 1 240px;
    min-width: 240px;
    gap: 1.5rem;
}

.round-header-sticky {
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fifa-gold);
    margin-bottom: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

/* Caja de Match de Playoff */
.bracket-match-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.bracket-match-box:hover {
    border-color: var(--fifa-cyan);
    background: var(--bg-card-hover);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
    transform: scale(1.02);
}

.bracket-match-info {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.15rem;
}

.bracket-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.bracket-team-row.winner {
    background: rgba(16, 185, 129, 0.08);
    font-weight: 700;
}

.bracket-team-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 80%;
}

.bracket-flag {
    width: 20px;
    height: 13px;
    object-fit: cover;
    border-radius: 1px;
}

.bracket-score {
    font-weight: 800;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.18);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
}

.bracket-team-row.winner .bracket-score {
    color: var(--fifa-live);
    background: rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   Modales y Ventanas Emergentes
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn var(--transition-fast) forwards;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: scaleUp var(--transition-fast) forwards;
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    background: rgba(30, 41, 59, 0.6);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.15rem;
    color: var(--fifa-gold);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--color-text-main);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-match-details {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.modal-match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.modal-flag {
    width: 70px;
    height: 46px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-team span {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

.modal-team input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    width: 70px;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    outline: none;
}

.modal-team input:focus {
    border-color: var(--fifa-cyan);
}

.modal-vs {
    font-weight: 800;
    color: var(--color-text-muted);
}

.modal-match-status-selector {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.modal-match-status-selector label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.modal-match-status-selector select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    padding: 0.55rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    outline: none;
    cursor: pointer;
}

.modal-footer {
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==========================================================================
   Adaptabilidad Responsive (Media Queries)
   ========================================================================== */

/* Teléfonos pequeños/Medios */
@media (max-width: 480px) {
    .nav-tab .tab-label {
        display: none; /* En pantallas muy pequeñas ocultamos texto, dejamos icono */
    }
    .nav-tab {
        padding: 0.85rem 0.25rem;
        gap: 0;
    }
    .tab-icon {
        font-size: 1.5rem;
    }
    .logo-area h1 {
        font-size: 1.3rem;
    }
    .featured-team-name {
        font-size: 0.8rem;
    }
    .featured-flag {
        width: 45px;
        height: 30px;
    }
    .match-teams-score {
        padding: 0.5rem;
    }
    .team-block .name-match {
        font-size: 0.75rem;
    }
    .team-block .flag-match {
        width: 20px;
        height: 13px;
    }
    .score-block {
        font-size: 0.95rem;
    }
    .score-box {
        min-width: 20px;
    }
    .match-item {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .match-meta-info {
        flex: 1 1 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    .match-status-area {
        flex: 1 1 100%;
        align-items: center;
        margin-top: 0.25rem;
    }
    .stadium-marquee {
        padding: 0.4rem 0;
    }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .logo-area h1 {
        font-size: 1.5rem;
    }
    .nav-tab {
        font-size: 0.82rem;
    }
}

/* Pantallas grandes y Escritorio */
@media (min-width: 769px) {
    .app-content {
        padding: 2rem 1.5rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr 1.2fr 1fr;
    }
    .progress-container {
        flex-direction: row;
    }
}

/* Utilidades generales */
.mt-4 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* ==========================================================================
   Estilos del Perfil de Administrador
   ========================================================================== */
body:not(.admin-mode) .api-control-panel {
    display: none !important;
}

body:not(.admin-mode) .group-match-card,
body:not(.admin-mode) .match-item,
body:not(.admin-mode) .bracket-match-box {
    cursor: default !important;
    pointer-events: none;
}

.btn-admin-login {
    background: rgba(30, 41, 59, 0.4);
    color: var(--color-text-muted);
    border: 1px solid var(--border-color);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-admin-login:hover {
    color: var(--color-text-main);
    border-color: var(--fifa-gold);
    background: rgba(234, 179, 8, 0.1);
}

.btn-admin-login.logged-in {
    border-color: var(--fifa-live);
    color: var(--fifa-live);
    background: rgba(16, 185, 129, 0.1);
}

.btn-admin-login.logged-in:hover {
    border-color: var(--fifa-red);
    color: var(--fifa-red);
    background: rgba(239, 68, 68, 0.1);
}

.admin-profile-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid var(--fifa-gold);
    color: var(--fifa-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
