/* style.css - Viva La Bonoloto */
:root {
    --bg-color: #ffffff;
    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    --card-bg: #ffffff;
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --neon-green: #00c853;
    --neon-green-dim: rgba(0, 200, 83, 0.2);
    --accent-green: #00c853;
    --accent-gold: #00c853;
    --accent-blue: #00c853;
    --danger: #ff4444;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #1a1a1a;
    border: none;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 50px;
    width: auto;
    background: #fff;
    padding: 5px;
    border-radius: 8px;
}

.logo-bonoloto {
    height: 40px;
    width: auto;
    margin-left: 0.5rem;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.logo-text h1 span {
    color: var(--neon-green);
}

.last-draw {
    font-size: 0.8rem;
    color: #aaa;
}

.jackpot-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-action {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Escrutinio Panel */
.escrutinio-panel {
    margin-bottom: 2rem;
}

.escrutinio-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.escrutinio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.custom-dates {
    display: flex;
    gap: 1rem;
    flex: 0 0 auto;
}

/* Selector de cliente */
.cliente-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0;
}

.cliente-selector label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 1.2rem;
    line-height: 1.2rem;
}

.cliente-selector label i {
    color: var(--accent-blue);
}

/* Asegurar que los labels de fecha también tengan la misma altura */
.custom-dates label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    height: 1.2rem;
    line-height: 1.2rem;
    display: block;
    margin-bottom: 0;
}

.custom-dates .date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.custom-dates input[type="date"] {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    color: #1a1a1a;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
    box-sizing: border-box;
}

.select-cliente {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    color: #1a1a1a;
    font-size: 0.95rem;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
}

.select-cliente:hover,
.select-cliente:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-escrutar {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
    margin-top: 1.7rem;
}

.btn-escrutar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Secciones Colapsables */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
}

.collapse-icon {
    font-size: 1rem;
    color: #666;
    transition: transform 0.3s ease;
}

.collapsible-content {
    overflow: hidden;
    max-height: 5000px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-card:hover {
    background: rgba(30, 41, 59, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-green);
}

.action-icon {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-green);
}

.card-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.card-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Results Section */
.results-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Lottery Balls */
.balls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    justify-items: center;
    margin-bottom: 2rem;
}

.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    background: #1a1a1a;
    border: 3px solid var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
    position: relative;
}

.ball::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 30%;
    height: 20%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    filter: blur(2px);
}

.ball.comp {
    background: #333;
    border-color: #fff;
    color: #fff;
}

.ball.reintegro {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #fff;
}

.extra-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Table */
.winners-table {
    width: 100%;
    border-collapse: collapse;
}

.winners-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.winners-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.badge.win {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.pending-text {
    color: var(--accent-gold) !important;
    font-style: italic;
}

.prize-amount {
    font-weight: 700;
    color: var(--accent-gold);
    font-family: monospace;
    font-size: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-green);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

/* Detalle cliente en tabla */
.cliente-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cliente-nombre {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.cliente-numeros {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.cliente-numeros .numeros {
    color: var(--accent-blue);
}

.cliente-numeros .reintegro-num {
    color: var(--accent-gold);
}

.cliente-numeros .importe-apuesta {
    color: #888;
}

.desglose-col {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 300px;
}

/* Grid de Sorteos */
.sorteos-grid {
    display: grid;
    /* Usa un mínimo de 300px o el 100% del ancho si es menor, ideal para móviles pequeños */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
}

.sorteo-card {
    background: #fff;
    border: 2px solid var(--neon-green);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sorteo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sorteo-fecha {
    font-weight: 700;
    font-size: 1.1rem;
}

.sorteo-bote {
    color: var(--accent-gold);
    font-weight: 600;
}

.sorteo-numeros {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.sorteo-extras {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.extra-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 0.75rem;
}

.extra-label:first-child {
    margin-left: 0;
}

.ball-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: #1a1a1a;
    border: 2px solid var(--neon-green);
    color: #fff;
}

.ball-mini.comp {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 700;
}

.ball-mini.reint {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #fff;
    font-size: 0.7rem;
}

.sorteo-premios {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.premio-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.premio-cat {
    flex: 2;
    color: #333;
}

.premio-ganadores {
    flex: 1;
    text-align: center;
    color: var(--neon-green);
    font-weight: 600;
}

.premio-importe {
    flex: 1;
    text-align: right;
    color: #1a1a1a;
    font-weight: 700;
}

/* Premios sin ganadores */
.premio-ganadores.sin-ganadores {
    color: #999;
    font-weight: 400;
}

.premio-row.sin-ganadores-row {
    opacity: 0.6;
}

/* Bote destacado */
.sorteo-bote-destacado {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    animation: pulse-bote 2s ease-in-out infinite;
}

@keyframes pulse-bote {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6);
    }
}

.lugares-section {
    font-size: 0.8rem;
    color: #333;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.2);
    border-radius: 0.5rem;
}

.lugares-section p {
    margin: 0.25rem 0;
    color: #1a1a1a;
}

.lugares-section .map-btn {
    margin-top: 0.5rem;
    width: 100%;
}

.sorteo-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-small:hover {
    background: #2563eb;
}

.no-data {
    color: var(--text-secondary);
    font-style: italic;
}

/* Escrutinio Results */
.escrutinio-header-panel {
    margin-bottom: 1.5rem;
}

.escrutinio-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.escrutinio-summary h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.escrutinio-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.escrutinio-total {
    font-size: 1.1rem;
}

.escrutinio-total strong {
    color: var(--neon-green);
    font-size: 1.3rem;
}

.escrutinio-grid {
    display: grid;
    /* Ajuste responsive para cards de resultados */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.escrutinio-card {
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.escrutinio-card.has-prize {
    border-left: 4px solid var(--neon-green);
}

.escrutinio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.escrutinio-card-header .header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.escrutinio-card-header .cliente-nombre {
    font-weight: 700;
    font-size: 1.1rem;
}

.columna-tag {
    font-size: 0.75rem;
    background: var(--neon-green-dim);
    color: var(--neon-green);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.cliente-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
}

.cliente-total.ganador {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 200, 83, 0.2);
}

.cliente-apuesta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.5rem;
    border-radius: 6px;
}

.cliente-apuesta .numeros {
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.numero-apostado {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    transition: all 0.2s;
    font-weight: 600;
}

.numero-apostado.numero-acertado {
    background: var(--neon-green);
    color: #fff;
    border-color: var(--neon-green);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 200, 83, 0.3);
}

.numero-apostado.numero-complementario {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

.cliente-apuesta .reintegro {
    color: var(--text-secondary);
    font-weight: 600;
    background: #e5e7eb;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.cliente-apuesta .reintegro.reintegro-acertado {
    background: #8b5cf6;
    color: #fff;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.escrutinio-dias {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.escrutinio-dia {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid #ddd;
}

.escrutinio-dia.dia-premio {
    background: rgba(0, 200, 83, 0.05);
    border-left-color: var(--neon-green);
}

.dia-fecha {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dia-desglose {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Date Selector Panel */
.date-selector-panel {
    margin-bottom: 1.5rem;
}

.date-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.date-input {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    color: #1a1a1a;
    font-size: 1rem;
    min-width: 160px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-input:hover,
.date-input:focus {
    border-color: var(--neon-green);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.2);
}

.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.date-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 0.6rem 1rem;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    color: var(--accent-blue);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;

    /* Nuevos estilos para layout vertical */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    /* Botones más altos */
    gap: 0.2rem;
}

.btn-preset:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.btn-preset.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.preset-title {
    font-weight: 600;
}

.preset-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
    text-transform: capitalize;
    /* Para que el día de la semana empiece con mayúscula */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .date-selector-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .date-input {
        width: 100%;
    }

    .date-presets {
        justify-content: center;
    }
}

/* ============================================
   LA QUINIELA - ESTILOS ESPECÍFICOS
   ============================================ */

/* Header Quiniela */
.header-quiniela {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
}

.logo-quiniela {
    height: 40px;
    width: auto;
    margin-left: 0.5rem;
    border-radius: 4px;
}

/* Grid de Jornadas */
.jornadas-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card de Jornada */
.jornada-card {
    background: #fff;
    border: 2px solid #1a472a;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.jornada-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1a472a;
}

.jornada-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.jornada-num {
    font-weight: 700;
    font-size: 1.2rem;
    color: #1a472a;
}

.temporada {
    font-size: 0.85rem;
    color: #666;
}

.jornada-fecha {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    background: #f0f7f2;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

/* Lista de Partidos */
.partidos-list {
    margin-bottom: 1rem;
}

.partidos-header {
    display: grid;
    grid-template-columns: 30px 1fr 50px 1fr 70px;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #1a472a;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.partidos-header span:nth-child(2),
.partidos-header span:nth-child(4) {
    text-align: left;
}

.partidos-header span:nth-child(3),
.partidos-header span:nth-child(5) {
    text-align: center;
}

.partido-row {
    display: grid;
    grid-template-columns: 30px 1fr 50px 1fr 70px;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    align-items: center;
    font-size: 0.9rem;
}

.partido-row:hover {
    background: #f9f9f9;
}

.partido-row.pleno-15 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border-left: 3px solid #ffd700;
}

.partido-num {
    font-weight: 700;
    color: #666;
    text-align: center;
}

.equipo {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipo.local {
    text-align: right;
    padding-right: 0.5rem;
}

.equipo.visitante {
    text-align: left;
    padding-left: 0.5rem;
}

/* Badges de Signos */
.signo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 auto;
}

.signo-badge.signo-1 {
    background: #28a745;
    color: white;
}

.signo-badge.signo-X {
    background: #ffc107;
    color: #333;
}

.signo-badge.signo-2 {
    background: #dc3545;
    color: white;
}

.marcador {
    text-align: center;
    font-weight: 600;
    color: #333;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Pleno al 15 Section */
.pleno-15-section {
    background: linear-gradient(90deg, #ffd700, #ffed4a);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.pleno-15-section strong {
    color: #333;
}

.premio-pleno {
    margin-left: auto;
    font-weight: 700;
    color: #1a472a;
}

/* Premios Section */
.premios-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.premios-section h4 {
    margin: 0 0 0.75rem 0;
    color: #1a472a;
    font-size: 0.95rem;
}

/* Selector de Jornada */
.jornada-selector-container {
    padding: 0.5rem 0;
}

.select-jornada {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    color: #1a1a1a;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-jornada:hover,
.select-jornada:focus {
    border-color: #1a472a;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 71, 42, 0.2);
}

/* Responsive Quiniela */
@media (max-width: 768px) {

    .partidos-header,
    .partido-row {
        grid-template-columns: 25px 1fr 40px 1fr 50px;
        font-size: 0.8rem;
    }

    .signo-badge {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .jornada-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Premios sin ganadores o sin premio */
.premio-row.sin-ganadores {
    background: #f0f0f0;
    opacity: 0.7;
}

.premio-row.sin-ganadores .premio-cat {
    color: #999;
}

.premio-row.sin-ganadores .premio-ganadores {
    color: #cc4444;
    font-weight: 500;
}

.premio-row.sin-ganadores .premio-importe {
    color: #999;
}

.premio-row.sin-premio {
    background: #fafafa;
}

.premio-row.sin-premio .premio-cat {
    color: #888;
}

.premio-row.sin-premio .premio-ganadores {
    color: #888;
}

.premio-row.sin-premio .premio-importe {
    color: #aaa;
    font-weight: 400;
}

/* Escrutinio Quiniela - Selector específico */
.escrutinio-quiniela {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.selector-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selector-group label i {
    color: #1a472a;
}

.selector-group.separador {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.o-text {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
    padding-top: 1.5rem;
}

.select-temporada {
    padding: 0.6rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    color: #1a1a1a;
    font-size: 0.95rem;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-temporada:hover,
.select-temporada:focus {
    border-color: #1a472a;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 71, 42, 0.2);
}

/* Responsive para escrutinio quiniela */
@media (max-width: 768px) {
    .escrutinio-quiniela {
        flex-direction: column;
        align-items: stretch;
    }

    .selector-group.separador {
        display: none;
    }

    .select-temporada,
    .select-jornada {
        width: 100%;
    }
}

/* Geographic Stats Styles */
.stats-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input-small,
.select-small {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #fff;
    transition: all 0.2s ease;
    min-width: 140px;
}

.date-input-small:focus,
.select-small:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.radio-group {
    display: flex;
    gap: 1rem;
    background: #fff;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    text-transform: none;
    font-weight: 500;
    margin: 0;
}

.btn-action-small {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue), #1e40af);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.btn-action-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(59, 130, 246, 0.3);
}

/* Stats Table Premium Styles */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-top: 1rem;
}

.stats-table thead th {
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.stats-table thead th:nth-child(2) {
    width: 30%;
    /* Provincia wider */
}

.stats-table thead th:last-child {
    text-align: right;
}

.stats-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.stats-table thead th.sortable:hover {
    color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.02);
}

.stats-table tbody tr {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.stats-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
    background: linear-gradient(to right, #fff, #f8fafc);
}

.stats-table td {
    padding: 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-top: 1px solid rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    text-align: center;
}

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

.stats-table td:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
    border-left: 1px solid rgba(0, 0, 0, 0.02);
    font-weight: 700;
    color: var(--text-secondary);
    width: 60px;
    text-align: center;
    font-size: 1.2rem;
    /* Make emoji bigger */
}

.stats-table td:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
    border-right: 1px solid rgba(0, 0, 0, 0.02);
    text-align: right;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-weight: 600;
}

.provincia-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Top 3 Highlighting */
.stats-table tr:nth-child(1) td {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.05), rgba(255, 215, 0, 0.01));
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.stats-table tr:nth-child(1) td:first-child {
    border-left: 1px solid rgba(255, 215, 0, 0.2);
    color: #b45309;
    /* Gold text */
}

.stats-table tr:nth-child(1) td:last-child {
    border-right: 1px solid rgba(255, 215, 0, 0.2);
}


.stats-table tr:nth-child(2) td {
    background: linear-gradient(to right, rgba(192, 192, 192, 0.05), rgba(192, 192, 192, 0.01));
    border-top: 1px solid rgba(192, 192, 192, 0.2);
    border-bottom: 1px solid rgba(192, 192, 192, 0.2);
}

.stats-table tr:nth-child(2) td:first-child {
    border-left: 1px solid rgba(192, 192, 192, 0.2);
    color: #52525b;
    /* Silver text */
}

.stats-table tr:nth-child(2) td:last-child {
    border-right: 1px solid rgba(192, 192, 192, 0.2);
}

.stats-table tr:nth-child(3) td {
    background: linear-gradient(to right, rgba(205, 127, 50, 0.05), rgba(205, 127, 50, 0.01));
    border-top: 1px solid rgba(205, 127, 50, 0.2);
    border-bottom: 1px solid rgba(205, 127, 50, 0.2);
}

.stats-table tr:nth-child(3) td:first-child {
    border-left: 1px solid rgba(205, 127, 50, 0.2);
    color: #7c2d12;
    /* Bronze text */
}

.stats-table tr:nth-child(3) td:last-child {
    border-right: 1px solid rgba(205, 127, 50, 0.2);
}

/* Highlighted Cell based on sort */
.highlight-cell {
    color: var(--accent-blue) !important;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0.5rem;
}

/* Footer Total */
.stats-table tfoot td {
    padding: 1.5rem 1rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    background: transparent;
    border-radius: 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.btn-close-modal:hover {
    color: var(--danger);
}

/* Modal Table */
.modal-table {
    width: 100%;
    border-collapse: collapse;
}

.modal-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.modal-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.modal-table td.m-fecha {
    font-weight: 600;
    white-space: nowrap;
}

.modal-table td.m-importe {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    text-align: right;
    color: var(--accent-gold);
}

.modal-table td.m-cat {
    text-align: center;
}

.tag-cat-1 {
    background: rgba(255, 215, 0, 0.15);
    color: #b45309;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

.tag-cat-2 {
    background: rgba(192, 192, 192, 0.2);
    color: #52525b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Cursor pointer for clickable province cells */
.clickable-provincia {
    cursor: pointer;
    color: var(--accent-blue) !important;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
    transition: all 0.2s;
}

.clickable-provincia:hover {
    color: #1e40af !important;
    background: rgba(59, 130, 246, 0.05);
}

/* Map Styles */
#map-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    /* Ensure visibility */
}

#map-container svg {
    max-height: 80vh;
    max-width: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
    width: auto;
    /* Allow aspect ratio preservation */
}

#map-container path {
    fill: #ffffff !important;
    /* Force white base */
    stroke: #d1d5db;
    /* Light gray border */
    stroke-width: 0.5px;
    transition: all 0.3s ease;
    cursor: default;
    /* Non-winners are not clickable */
}

/* Hide all text labels by default as requested */
#map-container text {
    display: none !important;
}

#map-container path:hover {
    fill: #f9fafb !important;
    /* Extremely subtle hover for non-winners, or maybe nothing? User said "solo donde hay premio" */
    stroke: #9ca3af;
}

/* Winner province style */
#map-container path.province-winner {
    fill: var(--neon-green) !important;
    stroke: #00a040;
    stroke-width: 1px;
    filter: drop-shadow(0 0 8px rgba(0, 200, 83, 0.4));
    cursor: pointer;
    z-index: 10;
}

#map-container path.province-winner:hover {
    fill: #00e676 !important;
    /* Brighter green on hover */
    z-index: 20;
}

/* Map Tooltip - Fixed position inside modal */
.map-tooltip {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--neon-green);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10000;
    color: #333;
    min-width: 200px;
    max-width: 300px;
}

.map-tooltip.hidden {
    display: none;
}

.map-tooltip strong {
    display: block;
    color: #1a1a1a;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.tooltip-detail {
    color: #555;
    font-size: 0.85rem;
    margin-top: 2px;
}

/* === ESTADÍSTICAS DE NÚMEROS === */

.stats-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.stats-info strong {
    color: var(--neon-green);
}

.numeros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.numero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: #f5f5f5;
    border: 2px solid #ddd;
    cursor: default;
    transition: transform 0.2s;
}

.numero-stat:hover {
    transform: scale(1.1);
    z-index: 10;
}

.numero-stat.freq-high {
    background: rgba(0, 200, 83, 0.2);
    border-color: var(--neon-green);
}

.numero-stat.freq-medium {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
}

.numero-stat.freq-low {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.numero-valor {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.numero-freq {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stats-rankings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-ranking {
    background: #f9f9f9;
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid #eee;
}

.stats-ranking.wide {
    grid-column: 1 / -1;
}

.stats-ranking h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #333;
}

.ranking-list {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: decimal;
}

.ranking-list li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #555;
}

.ranking-list li strong {
    color: #1a1a1a;
    font-size: 1rem;
}

.retrasados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.retrasado-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 2px solid #ef4444;
    border-radius: 0.5rem;
}

.retrasado-num {
    font-weight: 700;
    font-size: 1.2rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.retrasado-sorteos {
    font-size: 0.85rem;
    color: #666;
}

/* Top Sorteos con Más Ganadores */
.top-ganadores-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ganadores-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    transition: transform 0.2s;
}

.ganadores-item:hover {
    transform: translateX(5px);
    border-color: var(--neon-green);
}

.ganadores-pos {
    font-size: 1.2rem;
    min-width: 2rem;
    text-align: center;
}

.ganadores-info {
    flex: 1;
}

.ganadores-fecha {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.ganadores-numeros {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.ganadores-cats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ganadores-cats .cat {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.ganadores-cats .cat1 {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.ganadores-cats .cat2 {
    background: rgba(249, 115, 22, 0.15);
    color: #ea580c;
}

.ganadores-cats .cat3 {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.ganadores-cats .cat4 {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.ganadores-cats .cat5 {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.ganadores-total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--neon-green);
    white-space: nowrap;
}

/* Premios en Top Ganadores */
.ganadores-premios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #ddd;
}

.premio-detalle {
    font-size: 0.8rem;
    color: #555;
    background: #f5f5f5;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

.premio-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-green);
    background: rgba(0, 200, 83, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

/* Récords de Ausencia */
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.records-table th {
    background: #f8f8f8;
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #eee;
}

.records-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.records-table tbody tr:hover {
    background: #f9fafb;
}

.number-mini {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: linear-gradient(135deg, var(--neon-green), #059669);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

.warning-row {
    background: rgba(220, 38, 38, 0.05) !important;
}

.record-panel {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0.75rem;
    padding: 1rem;
}

/* ========================================
   RESPONSIVE DESIGN - Mobile First
   ======================================== */

/* Botón hamburguesa - oculto por defecto */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Botón secundario */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ========================================
   TABLET (max-width: 1024px)
   ======================================== */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    .stats-controls {
        flex-wrap: wrap;
    }

    .numbers-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.4rem;
    }
}

/* ========================================
   MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    /* Header responsive */
    header {
        flex-wrap: wrap;
        padding: 1rem;
        gap: 1rem;
        position: relative;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1000;
        /* Force on top */
        background: rgba(255, 255, 255, 0.1);
        /* Slight background to see if it renders */
        border-radius: 4px;
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
        /* Border for visibility */
    }

    .header-actions {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-actions.active {
        display: flex;
    }

    .header-actions .btn-action {
        width: 100%;
        justify-content: center;
    }

    .logo {
        flex: 1;
    }

    .logo-img {
        height: 40px;
    }

    .logo-bonoloto {
        height: 30px;
    }

    .logo-text h1 {
        font-size: 1.2rem;
    }

    /* Panels */
    .glass-panel {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    .panel-header h2 {
        font-size: 1.1rem;
    }

    /* Preset buttons - grid en móvil */
    .preset-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .btn-preset {
        width: 100% !important;
        padding: 0.6rem 0.5rem !important;
        font-size: 0.75rem !important;
        text-align: center !important;
        white-space: normal !important;
    }

    /* Botón escrutar específico */
    #btn-escrutinio,
    .btn-escrutar {
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 0.5rem;
    }

    /* Controles apilados */
    .escrutinio-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    .custom-dates {
        flex-direction: column;
        width: 100% !important;
        gap: 0.75rem;
    }

    .date-input-group {
        width: 100% !important;
        display: flex;
        flex-direction: column;
    }

    .date-input-group label {
        margin-bottom: 0.25rem;
    }

    .date-input,
    input[type="date"] {
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    .cliente-selector {
        width: 100% !important;
        display: flex;
        flex-direction: column;
    }

    .cliente-selector label {
        margin-bottom: 0.25rem;
    }

    .select-cliente,
    select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .btn-escrutar,
    .btn-action {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Stats controls - todos los filtros */
    .stats-controls {
        flex-direction: column !important;
        gap: 0.75rem;
        align-items: stretch !important;
    }

    .stats-controls>* {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .stats-controls .custom-dates {
        flex-direction: column !important;
    }

    .stats-controls input[type="date"],
    .stats-controls select,
    .stats-controls input[type="number"] {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .control-group {
        width: 100% !important;
    }

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

    /* Sorteos controls */
    .sorteos-controls {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: stretch !important;
    }

    .sorteos-controls>* {
        width: 100% !important;
    }

    .sorteos-controls input[type="date"],
    .sorteos-controls select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ganadores controls */
    .ganadores-controls,
    .top-ganadores-controls {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
    }

    .ganadores-controls>*,
    .top-ganadores-controls>* {
        width: 100% !important;
    }

    .ganadores-controls input[type="date"],
    .ganadores-controls select,
    .top-ganadores-controls input[type="date"],
    .top-ganadores-controls select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Cards en columna */
    .sorteos-grid {
        grid-template-columns: 1fr;
    }

    .escrutinio-grid {
        grid-template-columns: 1fr;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Number grid mobile */
    .numbers-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.3rem;
    }

    .number-cell {
        padding: 0.4rem;
        font-size: 0.75rem;
    }

    .number-cell .num {
        font-size: 1rem;
    }

    /* Rankings */
    .stats-rankings {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Top ganadores */
    .ganadores-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ganadores-total {
        align-self: flex-end;
    }

    .ganadores-premios {
        flex-direction: column;
    }

    /* Tabla responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mapa responsive */
    .mapa-container {
        height: auto !important;
        min-height: 250px;
    }

    #map-container {
        min-height: 250px !important;
        height: auto !important;
    }

    #map-container svg {
        max-height: 300px !important;
        width: 100% !important;
        height: auto !important;
    }

    .provincias-panel {
        flex-direction: column;
    }

    .provincias-panel>* {
        width: 100% !important;
    }

    /* Records table responsive */
    .record-panel {
        overflow-x: auto;
    }

    .records-table {
        min-width: 400px;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    header {
        padding: 0.75rem;
    }

    .logo-text h1 span {
        display: none;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .last-draw {
        font-size: 0.7rem;
    }

    .btn-text {
        display: none;
    }

    /* Mostrar texto cuando el menú móvil está abierto */
    .header-actions.active .btn-text {
        display: inline-block !important;
        margin-left: 0.5rem;
    }

    .btn-action i {
        margin: 0;
    }

    .glass-panel {
        padding: 0.75rem;
    }

    .panel-header h2 {
        font-size: 1rem;
    }

    .btn-preset {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Numbers grid más compacto */
    .numbers-grid {
        gap: 0.2rem;
    }

    .number-cell {
        padding: 0.25rem;
    }

    .number-cell .num {
        font-size: 0.9rem;
    }

    .number-cell .freq {
        font-size: 0.6rem;
    }

    /* Sorteo card más compacta */
    .combinacion {
        gap: 0.3rem;
    }

    .number-ball {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    /* Escrutinio cards */
    .client-card {
        padding: 0.75rem;
    }

    .prize-badge {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }

    /* Ensure mobile login text is visible even on small screens */
    .btn-text-mobile {
        display: inline-block !important;
        margin-left: 0.5rem;
    }
}

/* Mobile Menu Groups */
@media (max-width: 768px) {

    .action-group,
    .admin-actions-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .admin-actions-group {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 0.5rem;
    }

    .btn-login-mobile {
        margin-top: 0.5rem;
        font-weight: 800;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        padding: 1rem !important;
    }
}