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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #333;
}


/* Estilos para la pantalla de login (PHP) */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.login-form h3 {
    color: #333;
    margin-bottom: 10px;
}

.login-form p {
    color: #666;
    margin-bottom: 20px;
}

#access-token {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
}

#access-token:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-button {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.login-error {
    color: #e53e3e;
    margin-top: 15px;
    font-weight: 500;
}

.login-error.hidden {
    display: none;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* En desktop, los 3 elementos alineados horizontalmente */
@media (min-width: 769px) {
    .input-section {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 40px !important;
        flex-wrap: nowrap !important;
        margin-bottom: 30px;
    }

    .player-input {
        flex: 0 0 auto !important;
        max-width: 500px;
        width: 500px;
    }

    .vs-divider {
        flex: 0 0 auto !important;
        font-size: 2.5rem !important;
    }
}

/* Móvil mantiene el layout vertical */
@media (max-width: 768px) {
    .input-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 30px;
    }

    .vs-divider {
        transform: rotate(90deg);
    }
}

.player-input {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    min-width: 250px;
}

.player-input h3 {
    margin-bottom: 15px;
    color: #4a5568;
    text-align: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group.horizontal {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}

.save-rival-btn {
    background: #fbbf24;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.save-rival-btn:hover {
    background: #f59e0b;
    transform: scale(1.1);
}

.save-rival-btn.saved {
    background: #10b981;
}

.saved-rivals {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rivals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.toggle-rivals-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.toggle-rivals-btn:hover {
    background: #5a67d8;
}

.toggle-rivals-btn.collapsed {
    transform: rotate(-90deg);
}

.rivals-list.collapsed {
    display: none;
}

.rivals-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* En desktop, limitar el ancho y expandir hacia abajo */
@media (min-width: 769px) {
    .rivals-list {
        max-width: 100%;
        width: 100%;
    }
}

.rival-item {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rival-item:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.rival-remove {
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.rival-remove:hover {
    color: #dc2626;
}

.input-group input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.vs-divider {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

.compare-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.compare-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    color: white;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stats-summary {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stats-summary h3 {
    margin-bottom: 15px;
    color: #4a5568;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-count {
    background: #667eea;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

.tab-btn.active .tab-count {
    background: #4c51bf;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}


.filters h4 {
    margin-bottom: 15px;
    color: #4a5568;
    text-align: center;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

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

.filter-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #667eea;
    color: white;
}

.filter-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.filter-btn.clear {
    background: #e53e3e;
}

.filter-btn.clear:hover {
    background: #c53030;
}

.tab-panel h4 {
    margin-bottom: 15px;
    color: #4a5568;
}

.songs-list {
    max-height: 800px;
    overflow-y: auto;
}

.song-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #e2e8f0; /* Borde izquierdo por defecto */
    transition: background-color 0.3s ease;
    min-height: 50px;
}

/* Bordes de colores para diferencias */
.song-item.border-positive {
    border-left-color: #48bb78; /* Verde para diferencia positiva */
}

.song-item.border-negative {
    border-left-color: #f56565; /* Rojo para diferencia negativa */
}

.song-item.border-neutral {
    border-left-color: #a0aec0; /* Gris para diferencia cero */
}

.song-item:hover {
    background: #e9ecef;
}

.song-info {
    flex: 1;
}

.song-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.song-difficulty {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.song-difficulty.type-singles {
    background-color: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.song-difficulty.type-doubles {
    background-color: #c6f6d5;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.song-difficulty.type-coop {
    background-color: #fef5e7;
    color: #d69e2e;
    border: 1px solid #fbd38d;
}

.song-difficulty.type-unknown {
    background-color: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.scores {
    display: flex;
    gap: 20px;
    align-items: center;
}

.scores-mobile {
    display: none;
}

.score {
    text-align: center;
    min-width: 80px;
}

.score-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}

.score-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.score-player1 {
    color: #667eea;
}

.score-player2 {
    color: #ff6b6b;
}

.difference {
    font-size: 0.9rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

.difference.positive {
    background: #d4edda;
    color: #155724;
}

.difference.negative {
    background: #f8d7da;
    color: #721c24;
}

.difference.equal {
    background: #d1ecf1;
    color: #0c5460;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .input-section {
        flex-direction: column;
        gap: 20px;
    }

    .vs-divider {
        transform: rotate(90deg);
    }

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

    .scores {
        display: none;
    }

    .scores-mobile {
        display: block;
    }

    .scores-mobile .scores-row {
        display: flex;
        gap: 20px;
        align-items: center;
        margin-bottom: 10px;
    }

    .scores-mobile .difference-row {
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }

    .scores-mobile .difference-row .score {
        min-width: auto;
    }

    /* Estilos responsive para dificultades */
    .song-difficulties {
        max-height: 100px;
        padding: 6px;
    }

    .difficulty-tags {
        gap: 3px;
    }

    .difficulty-tag {
        font-size: 11px;
        padding: 3px 6px;
    }

    .expand-button-container {
        margin-top: 4px;
        padding: 2px 0;
    }

    .expand-difficulties-btn {
        font-size: 11px;
        padding: 4px 8px;
        min-width: 30px;
        height: 24px;
        border-radius: 4px;
    }

    .song-item {
        padding: 6px 10px;
        margin-bottom: 4px;
        min-height: 45px;
    }
}

/* Estilos para posiciones de canciones */
.song-position {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

/* Estilos para estadísticas de posiciones */
.position-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.position-stats h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

/* Colores específicos para diferentes tipos de estadísticas */
.stat-item:nth-child(1) .stat-value {
    color: #28a745; /* Verde para canciones en BD */
}

.stat-item:nth-child(2) .stat-value {
    color: #007bff; /* Azul para promedio */
}

.stat-item:nth-child(3) .stat-value {
    color: #ffc107; /* Amarillo para mínimo */
}

.stat-item:nth-child(4) .stat-value {
    color: #dc3545; /* Rojo para máximo */
}

/* Responsive para estadísticas */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-item {
        padding: 8px 12px;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 0.9rem;
    }

    .song-position {
        font-size: 0.8rem;
    }
}

/* Modal styles */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    margin: 20px;
    -webkit-overflow-scrolling: touch;
    z-index: 10000;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e0e0e0;
}

.modal-body {
    padding: 20px;
}

.song-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

.position-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c5aa0;
}

#modal-song-name {
    font-weight: 600;
    color: #333;
}

#modal-song-difficulty {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Difficulty tag colors in modal */
.difficulty-tag.singles {
    background: #ffe8e1 !important;
    color: #ff6b35 !important; /* Rojo anaranjado para Singles */
    font-weight: bold;
}

.difficulty-tag.doubles {
    background: #e8f5e8 !important;
    color: #4CAF50 !important; /* Verde para Doubles */
    font-weight: bold;
}

.difficulty-tag.coop {
    background: #fffbf0 !important;
    color: #FFD700 !important; /* Amarillo para Coop */
    font-weight: bold;
}

#modal-version {
    color: #666;
    font-family: monospace;
}

/* Responsive para modal - simplificado */
@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px !important;
        max-height: 85vh !important;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .detail-label {
        min-width: auto;
        font-size: 0.9em;
    }
}

/* Modal móvil alternativo */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-modal.hidden {
    display: none !important;
}

.mobile-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.mobile-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 100000;
}

.mobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.mobile-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.mobile-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.mobile-close-btn:hover {
    background-color: #e0e0e0;
}

.mobile-modal-body {
    padding: 20px;
}

.mobile-song-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-detail-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-detail-row:last-child {
    border-bottom: none;
}

.mobile-detail-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.mobile-position-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c5aa0;
}

.mobile-difficulty-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
}

.mobile-difficulty-tag.singles {
    background: #ffe8e1 !important;
    color: #ff6b35 !important;
}

.mobile-difficulty-tag.doubles {
    background: #e8f5e8 !important;
    color: #4CAF50 !important;
}

.mobile-difficulty-tag.coop {
    background: #fffbf0 !important;
    color: #FFD700 !important;
}

.mobile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #666;
}

.mobile-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.mobile-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Estilos para dificultades colapsables */
.song-difficulties {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    /* Asegurar que el contenedor se expanda con su contenido */
    overflow: visible;
    min-height: fit-content;
}

.song-difficulties.expanded {
    max-height: none;
}

.difficulties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

@media (max-width: 768px) {
    .difficulties-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .difficulties-header .expand-difficulties-btn {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 24px;
        height: 20px;
    }
}

.expand-difficulties-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 28px;
    height: 24px;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.expand-difficulties-btn:hover {
    background: #5a67d8;
}

.expand-difficulties-btn.collapsed {
    transform: rotate(-90deg);
}

.difficulties-list {
    min-height: 30px;
}

.difficulties-list .loading {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

.difficulties-list .error {
    color: #dc3545;
    margin: 0;
}

.difficulties-list .no-difficulties {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

.difficulty-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hidden-difficulties {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.hidden-difficulties.show {
    display: flex;
}

.difficulty-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.difficulty-tag.singles {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.difficulty-tag.doubles {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.difficulty-tag.coop {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
}

.btn-remove-difficulty {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    margin-left: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-difficulty:hover {
    background: #d32f2f;
}

.add-difficulty-form {
    margin-top: 10px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 6px;
    border: 1px solid #b3d9ff;
}

.add-difficulty-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
}

.add-difficulty-form .form-group {
    display: flex;
    flex-direction: column;
}

.add-difficulty-form .form-group label {
    font-size: 12px;
    margin-bottom: 3px;
    color: #495057;
}

.add-difficulty-form .form-group input,
.add-difficulty-form .form-group select {
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
}

/* Botón de scroll al inicio - Sticky */
.scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

/* Responsive para el botón de scroll */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 18px;
    }
}

/* Mejoras específicas para móvil - botón de expandir */
@media (max-width: 480px) {
    .expand-button-container {
        margin-top: 3px;
        padding: 2px 0;
    }

    .expand-difficulties-btn {
        font-size: 12px;
        padding: 5px 10px;
        min-width: 35px;
        height: 28px;
        border-radius: 5px;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    }

    .difficulty-tags {
        gap: 4px;
    }

    .difficulty-tag {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Debug: Asegurar que el botón sea visible en móvil */
@media (max-width: 768px) {
    .expand-difficulties-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: #667eea !important;
        color: white !important;
        border: 1px solid #5a67d8 !important;
        font-size: 11px !important;
        padding: 4px 8px !important;
        min-width: 30px !important;
        height: 24px !important;
        border-radius: 4px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    }
}