:root {
    --bg-dark: #0a0e17;
    --card-bg: rgba(23, 31, 48, 0.85);
    --border-glow: rgba(16, 185, 129, 0.25);
    --accent-color: #10b981;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --win-glow: #10b981;
    --win-bg: rgba(16, 185, 129, 0.15);
    --loss-glow: #ef4444;
    --pending-bg: rgba(148, 163, 184, 0.1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding: 15px 12px 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    max-width: 600px;
}

.header img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    margin-bottom: 6px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* ==========================================
   BARRA Y MENÚ CIRCULAR INFERIOR FLOTANTE
   ========================================== */
.bottom-nav-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 40px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    width: auto; /* Se ajusta exactamente al espacio de los botones sin dejar huecos */
    min-width: 200px;
    box-sizing: border-box;
}

.nav-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-back-btn:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.15);
}

.circular-menu-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-main-toggle-btn {
    background: var(--accent-color, #10b981);
    color: #0f172a;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.88rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 1002;
}

.menu-main-toggle-btn:hover {
    transform: scale(1.05);
}

/* EXTENSIÓN DIRECTA DESDE EL BOTÓN MENÚ */
.circular-options-container {
    position: absolute;
    bottom: 100%;
    right: 0; /* Lo alinea exactamente al borde derecho, justo encima del botón Menú */
    transform: translateY(10px) scaleY(0);
    transform-origin: bottom right;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 12px 10px;
    margin-bottom: 6px; /* Conexión visual directa */
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
    opacity: 0;
    pointer-events: none;
    z-index: 1001;
    width: max-content; /* Se ajusta al tamaño de sus opciones de forma limpia */
    min-width: 160px;
    box-sizing: border-box;
}

/* Puente invisible para que no se cierre al pasar el ratón por PC */
.circular-options-container::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

.circular-menu-wrapper.active .circular-options-container {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    pointer-events: auto;
}

.circular-option-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.circular-option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.circular-option-btn.active-section {
    background: rgba(255, 255, 255, 0.12);
    font-weight: 800;
}

.bottom-nav-bar.categoria-senior { border-color: rgba(16, 185, 129, 0.4); }
.bottom-nav-bar.categoria-femenino { border-color: rgba(236, 72, 153, 0.4); }
.bottom-nav-bar.categoria-infantil { border-color: rgba(139, 92, 246, 0.4); }
.bottom-nav-bar.categoria-cadete { border-color: rgba(245, 158, 11, 0.4); }

/* Menú 2x2 */
.selector-screen {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.3s ease-in-out;
}

.selector-title {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #34d399);
}

.category-card.femenino::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.category-card.infantil::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.category-card.cadete::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.category-card:hover {
    transform: translateY(-3px);
    border-color: #10b981;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-card.femenino .category-icon { background: rgba(236, 72, 153, 0.12); color: #f472b6; border-color: rgba(236, 72, 153, 0.3); }
.category-card.infantil .category-icon { background: rgba(139, 92, 246, 0.12); color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }
.category-card.cadete .category-icon { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }

.category-card h2 {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}

.category-card p {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 6px;
}

.category-card .category-badge-action {
    font-size: 0.68rem;
    font-weight: 700;
    color: #34d399;
}
.category-card.femenino .category-badge-action { color: #f472b6; }
.category-card.infantil .category-badge-action { color: #a78bfa; }
.category-card.cadete .category-badge-action { color: #fbbf24; }

/* Mini Previews (Próximos Encuentros) */
.global-preview-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.global-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #34d399);
}

.global-preview-card.femenino::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.global-preview-card.infantil::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.global-preview-card.cadete::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.global-preview-card:hover {
    border-color: #10b981;
    transform: translateY(-2px);
}

.gp-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-team-name {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #34d399;
}

.global-preview-card.femenino .gp-team-name { color: #f472b6; }
.global-preview-card.infantil .gp-team-name { color: #a78bfa; }
.global-preview-card.cadete .gp-team-name { color: #fbbf24; }

.gp-matchup {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
}

/* Contenedores de vistas */
.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.3s ease-in-out;
}

/* Tarjetas de partidos (Jornadas) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

/* Colores Dinámicos y Brillos por Categoría */
.card.categoria-senior { border-left: 4px solid #10b981; }
.card.categoria-senior .jornada-badge { color: #34d399 !important; }
.card.categoria-senior.next-match { border-color: #10b981 !important; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important; }
.standings-table.categoria-senior th { background: rgba(16, 185, 129, 0.2) !important; color: #34d399 !important; }
.team.highlight.categoria-senior { color: #34d399 !important; }
.standings-table.categoria-senior tr.biarense-row { background: rgba(16, 185, 129, 0.2) !important; }

.card.categoria-femenino { border-left: 4px solid #ec4899; }
.card.categoria-femenino .jornada-badge { color: #f472b6 !important; }
.card.categoria-femenino.next-match { border-color: #ec4899 !important; box-shadow: 0 0 20px rgba(236, 72, 153, 0.4) !important; }
.standings-table.categoria-femenino th { background: rgba(236, 72, 153, 0.2) !important; color: #f472b6 !important; }
.team.highlight.categoria-femenino { color: #f472b6 !important; }
.standings-table.categoria-femenino tr.biarense-row { background: rgba(236, 72, 153, 0.2) !important; }

.card.categoria-infantil { border-left: 4px solid #8b5cf6; }
.card.categoria-infantil .jornada-badge { color: #a78bfa !important; }
.card.categoria-infantil.next-match { border-color: #8b5cf6 !important; box-shadow: 0 0 20px rgba(139, 92, 246, 0.4) !important; }
.standings-table.categoria-infantil th { background: rgba(139, 92, 246, 0.2) !important; color: #a78bfa !important; }
.team.highlight.categoria-infantil { color: #a78bfa !important; }
.standings-table.categoria-infantil tr.biarense-row { background: rgba(139, 92, 246, 0.2) !important; }

.card.categoria-cadete { border-left: 4px solid #f59e0b; }
.card.categoria-cadete .jornada-badge { color: #fbbf24 !important; }
.card.categoria-cadete.next-match { border-color: #f59e0b !important; box-shadow: 0 0 20px rgba(245, 158, 11, 0.4) !important; }
.standings-table.categoria-cadete th { background: rgba(245, 158, 11, 0.2) !important; color: #fbbf24 !important; }
.team.highlight.categoria-cadete { color: #fbbf24 !important; }
.standings-table.categoria-cadete tr.biarense-row { background: rgba(245, 158, 11, 0.2) !important; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.jornada-badge {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-victoria { background: var(--win-bg); color: var(--win-glow); border: 1px solid var(--win-glow); }
.status-derrota { background: rgba(239, 68, 68, 0.15); color: var(--loss-glow); border: 1px solid var(--loss-glow); }
.status-pendiente { background: var(--pending-bg); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.1); }

.match-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
    border-radius: 12px;
}

.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.team {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.score-pill {
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

.parciales-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.sets-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #a7f3d0;
}

.details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
}

.actions-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.calendar-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
    transition: transform 0.2s, background 0.2s;
}

.calendar-btn:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.08);
}

.location-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
    color: #a7f3d0;
}

.maps-btn {
    background: #10b981;
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
}

/* Estilos de la Tabla de Clasificación */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 10px;
    backdrop-filter: blur(10px);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: center;
    white-space: nowrap;
}

.standings-table th {
    padding: 10px 6px;
    font-weight: 800;
    text-transform: uppercase;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
    text-align: left;
}

.standings-table td {
    padding: 9px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.descanso-card {
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.descanso-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin: 8px 0 4px;
}

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

.category-card.senior:hover, .category-card.senior:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
    background: rgba(16, 185, 129, 0.15) !important;
}

.category-card.femenino:hover, .category-card.femenino:focus {
    border-color: #ec4899 !important;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4) !important;
    background: rgba(236, 72, 153, 0.15) !important;
}

.category-card.infantil:hover, .category-card.infantil:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4) !important;
    background: rgba(139, 92, 246, 0.15) !important;
}

.category-card.cadete:hover, .category-card.cadete:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4) !important;
    background: rgba(245, 158, 11, 0.15) !important;
}

.category-card.senior { border: 1px solid rgba(16, 185, 129, 0.4) !important; }
.category-card.femenino { border: 1px solid rgba(236, 72, 153, 0.4) !important; }
.category-card.infantil { border: 1px solid rgba(139, 92, 246, 0.4) !important; }
.category-card.cadete { border: 1px solid rgba(245, 158, 11, 0.4) !important; }