:root {
    --primary: #1a2a6c;
    --accent: #fdbb2d;
    --local: #e74c3c;
    --visitor: #3498db;
    --bg: #121212;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --info: #3498db;
}

body.theme-futbol-sala {
    background: linear-gradient(135deg, #1a5276, #27ae60, #f39c12);
    color: white;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

body.theme-futbol-sala .container {
    width: 100%;
    max-width: 800px;
}

/* CABECERA ESPECÍFICA PARA FÚTBOL SALA */
.clock-container-futbol-sala {
    background: rgba(26, 42, 108, 0.8) !important;
    border: 2px solid var(--accent);
}

.game-rules-futbol-sala {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 10px 0;
    border-left: 4px solid var(--accent);
}

/* TIMER SECTION */
.timer-section {
    text-align: center;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--accent);
}

.main-timer {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(253, 187, 45, 0.6);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-timer {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-timer:hover {
    transform: scale(1.1);
    background: var(--accent);
}

.btn-reset {
    background: #e74c3c;
}

.btn-next {
    background: #2ecc71;
}

/* SCOREBOARD */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.team {
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.team:hover {
    transform: translateY(-5px);
}

.team-local { 
    background: linear-gradient(135deg, var(--local), #c0392b);
    border: 3px solid var(--local);
}

.team-visitor { 
    background: linear-gradient(135deg, var(--visitor), #2980b9);
    border: 3px solid var(--visitor);
}

.team-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.team-name:hover {
    background: rgba(0, 0, 0, 0.4);
}

.score {
    font-size: 6rem;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin: 20px 0;
    font-family: 'Arial Black', sans-serif;
}

.score-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.btn-score {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: bold;
}

.btn-score.add {
    background: #2ecc71;
    color: white;
}

.btn-score.sub {
    background: #e74c3c;
    color: white;
}

.btn-score:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-score:active {
    transform: scale(0.95);
}

/* TEAM STATS MEJORADO CON BOTONES DE CORRECCIÓN */
.team-stats {
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.stat-counter {
    font-size: 2rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    margin: 0 10px;
}

.correction-buttons {
    display: flex;
    gap: 5px;
}

.btn-stat {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-stat.add {
    background: var(--success);
}

.btn-stat.remove {
    background: var(--error);
}

.btn-stat.recover {
    background: var(--warning);
    color: #000;
}

.btn-stat:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.05);
}

.btn-stat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* CARD BUTTONS MEJORADO */
.card-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-card {
    font-size: 1.5rem;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.btn-card.yellow {
    background: #f1c40f;
    color: #000;
    flex: 1;
}

.btn-card.blue {
    background: #3498db;
    color: white;
    flex: 1;
}

.btn-card.remove {
    background: #7f8c8d;
    color: white;
    font-size: 1rem;
    padding: 10px;
    min-width: 40px;
    flex: 0.5;
}

.btn-card:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* EVENTS SECTION MEJORADO */
.events-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.events-section h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.events-section h3 .btn-clear-events {
    background: var(--error);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

.events-list {
    max-height: 250px;
    overflow-y: auto;
    background: #1e1e1e;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.event-item {
    border-bottom: 1px solid #333;
    padding: 10px 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.event-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.event-item:last-child {
    border-bottom: none;
}

.event-time {
    color: var(--accent);
    font-weight: bold;
    min-width: 70px;
    font-family: monospace;
}

.event-desc {
    flex: 1;
}

.btn-remove-event {
    background: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove-event:hover {
    opacity: 1;
    background: rgba(231, 76, 60, 0.2);
}

.empty-events {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* HISTORY SECTION MEJORADO */
.history {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
}

.history h2 {
    color: var(--accent);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    background: #1e1e1e;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent);
    transition: transform 0.2s ease;
}

.history-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.08);
}

.history-teams {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.winner-badge {
    background: #27ae60;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: normal;
}

.draw-badge {
    background: #f39c12;
    color: #000;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: normal;
}

.history-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    margin: 10px 0;
    text-align: center;
}

.history-info {
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
    align-items: center;
    justify-content: space-between;
}

.history-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.btn-small {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}

.btn-small:hover {
    opacity: 0.9;
}

.btn-small.btn-danger {
    background: var(--error);
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-history i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* EXPORT CONTROLS */
.export-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ACTION FOOTER */
.action-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.btn-action {
    padding: 15px 30px;
    border-radius: 10px;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.btn-action.share {
    background: #25D366;
    color: white;
}

.btn-action.save {
    background: var(--primary);
    color: white;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* NOTIFICACIONES - SUPERIOR DERECHA */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    animation: slideInRight 0.3s ease forwards;
}

.notification.show {
    display: flex;
}

.notification.success {
    background: #27ae60;
    color: white;
    border-left: 5px solid #2ecc71;
}

.notification.warning {
    background: #f39c12;
    color: black;
    border-left: 5px solid #e67e22;
}

.notification.error {
    background: #c0392b;
    color: white;
    border-left: 5px solid #e74c3c;
}

.notification.info {
    background: #3498db;
    color: white;
    border-left: 5px solid #2980b9;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* TIMEOUT DISPLAY */
#timeout-display {
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
}

/* FOOTER GENERAL */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 0 10px;
}

.footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .scoreboard {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .main-timer {
        font-size: 3.5rem;
    }
    
    .score {
        font-size: 4.5rem;
    }
    
    .btn-action {
        min-width: 160px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .timer-controls {
        gap: 10px;
    }
    
    .btn-timer {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .export-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .correction-buttons {
        justify-content: center;
    }
    
    .card-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-card {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .main-timer {
        font-size: 2.8rem;
    }
    
    .score {
        font-size: 3.5rem;
    }
    
    .team-name {
        font-size: 1.2rem;
    }
    
    .btn-score {
        width: 55px;
        height: 55px;
        font-size: 2rem;
    }
    
    .action-footer {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-action {
        width: 100%;
        max-width: 300px;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}
/* BOTONES DE CORRECCIÓN */
.correction-buttons {
    display: flex;
    gap: 5px;
}

.btn-stat {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    min-width: 40px;
}

.btn-stat.add {
    background: var(--success);
}

.btn-stat.remove {
    background: var(--error);
}

.btn-stat.recover {
    background: var(--warning);
    color: #000;
}

.btn-stat:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.05);
}

.btn-stat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* BOTONES DE TARJETAS CON CORRECCIÓN */
.card-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-card {
    font-size: 1.5rem;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.btn-card.yellow {
    background: #f1c40f;
    color: #000;
    flex: 1;
}

.btn-card.blue {
    background: #3498db;
    color: white;
    flex: 1;
}

.btn-card.remove {
    background: #7f8c8d;
    color: white;
    font-size: 1rem;
    padding: 10px;
    min-width: 40px;
    flex: 0.5;
}

.btn-card:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* BOTONES EN HISTORIAL */
.history-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.btn-small {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}

.btn-small:hover {
    opacity: 0.9;
}

.btn-small.btn-danger {
    background: var(--error);
}
/* BOTÓN FLOTANTE PWA */
.floating-pwa-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none; /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9997;
    transition: all 0.3s ease;
}

.floating-pwa-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
