/* === RANKING MODERNO - CRACK TOTAL === */

/* Variables CSS */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-bg: #1a202c;
    --card-bg: #2d3748;
    --card-hover: #3d4852;
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-gold: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --gradient-silver: linear-gradient(135deg, #c9d6ff 0%, #e2e2e2 100%);
    --gradient-bronze: linear-gradient(135deg, #d2691e 0%, #cd853f 100%);
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Contenedor principal */
.ranking-page-body {
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'Montserrat', sans-serif;
}

/* Header del ranking */
.ranking-title {
    text-align: center;
    font-size: 2.5em;
    font-weight: 700;
    margin: 2rem 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.ranking-title-icon {
    color: #f6d365;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

/* Botones de navegación */
.navigation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    padding: 0 1rem;
}

.nav-button {
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

.nav-button.quiensabemas {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
}

.nav-button.mentiroso {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #2c3e50;
}

.nav-button.crackrapido {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #2c3e50;
}

/* Contenedor de la tabla */
.ranking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.table-responsive-wrapper {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--border-color);
}

/* Tabla de ranking */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.ranking-table th {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ranking-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.ranking-row {
    transition: all 0.3s ease;
}

.ranking-row:hover {
    background: var(--card-hover);
    transform: scale(1.01);
}

/* Posiciones especiales */
.ranking-row.top-three {
    position: relative;
}

.ranking-row:nth-child(1) {
    background: linear-gradient(90deg, rgba(246, 211, 101, 0.1) 0%, transparent 100%);
}

.ranking-row:nth-child(2) {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, transparent 100%);
}

.ranking-row:nth-child(3) {
    background: linear-gradient(90deg, rgba(205, 133, 63, 0.1) 0%, transparent 100%);
}

/* Estilos específicos de celdas */
.position {
    font-weight: 700;
    font-size: 1.2em;
    text-align: center;
    width: 80px;
}

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

.total-score {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.1em;
}

.wins {
    color: var(--success-color);
    font-weight: 600;
}

.losses {
    color: var(--danger-color);
}

.accuracy {
    font-weight: 600;
}

/* Estados de carga */
.loading-state, .no-data, .error-state {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 1.1em;
    animation: pulse 2s infinite;
}

.loading-state {
    color: var(--primary-color);
}

.no-data {
    color: var(--warning-color);
}

.error-state {
    color: var(--danger-color);
}

/* Historial */
.history-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.history-title {
    text-align: center;
    font-size: 2em;
    font-weight: 600;
    margin: 2rem 0;
    color: var(--text-primary);
}

.history-title-icon {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.history-list {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(var(--accent-rgb), 0.3);
    opacity: 0.6;
}

.history-item.victory::before {
    background: rgba(40, 167, 69, 0.25);
}

.history-item.defeat::before {
    background: rgba(220, 53, 69, 0.25);
}

.history-item.draw::before {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
}

.history-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: rgba(var(--accent-rgb), 0.3);
}

/* Header de la partida */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.match-result-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.result-icon {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--text-primary);
}

.result-icon.victory {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.result-icon.defeat {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.result-icon.draw {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

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

.player-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.match-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.8;
}

.match-date-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.date {
    font-weight: 500;
}

.time {
    opacity: 0.7;
    font-size: 0.75rem;
}

/* Estadísticas de la partida */
.match-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(var(--accent-rgb), 0.03);
    border-radius: 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.08);
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
}

.stat-item.primary {
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.15);
    padding-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.8;
}

.stat-value {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.stat-value.score {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 700;
}

.stat-value.accuracy.excellent {
    color: rgba(40, 167, 69, 0.8);
}

.stat-value.accuracy.good {
    color: rgba(255, 193, 7, 0.8);
}

.stat-value.accuracy.poor {
    color: rgba(220, 53, 69, 0.8);
}

.stat-value.correct {
    color: rgba(40, 167, 69, 0.7);
}

.stat-value.errors {
    color: rgba(220, 53, 69, 0.7);
}

.stat-value.time {
    color: rgba(var(--accent-rgb), 0.8);
    font-family: system-ui, sans-serif;
}

/* Footer de la partida */
.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.performance-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid;
    background: rgba(var(--accent-rgb), 0.05);
    color: var(--text-primary);
    border-color: rgba(var(--accent-rgb), 0.2);
}

.performance-badge.crack-total {
    background: rgba(255, 215, 0, 0.1);
    color: #b8860b;
    border-color: rgba(255, 215, 0, 0.3);
}

.performance-badge.expert {
    background: rgba(40, 167, 69, 0.1);
    color: #1e7e34;
    border-color: rgba(40, 167, 69, 0.3);
}

.performance-badge.intermediate {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    border-color: rgba(0, 123, 255, 0.3);
}

.performance-badge.progress {
    background: rgba(255, 193, 7, 0.1);
    color: #e0a800;
    border-color: rgba(255, 193, 7, 0.3);
}

.performance-badge.beginner {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
    border-color: rgba(108, 117, 125, 0.3);
}

.badge-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.badge-text {
    font-weight: 500;
}

.match-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    opacity: 0.7;
}

.summary-text {
    font-style: italic;
}

/* Estado sin datos mejorado */
.no-data-enhanced {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px dashed rgba(var(--accent-rgb), 0.2);
}

.no-data-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-data-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.8;
}

.play-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    opacity: 0.9;
}

.play-now-btn:hover {
    transform: translateY(-1px);
    opacity: 1;
    text-decoration: none;
    color: white;
}

/* Responsive para historial */
@media (max-width: 768px) {
    .match-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .match-date-time {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .match-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-group {
        gap: 0.4rem;
    }
    
    .match-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .performance-badge {
        justify-content: center;
    }
    
    .match-summary {
        text-align: center;
    }
    
    .history-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .no-data-enhanced {
        padding: 2rem 1rem;
    }
    
    .no-data-icon {
        font-size: 2.5rem;
    }
    
    .no-data-title {
        font-size: 1.2rem;
    }
}

/* Animaciones sutiles para el historial */
.history-item {
    animation: historyFadeIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.history-item:nth-child(1) { animation-delay: 0.05s; }
.history-item:nth-child(2) { animation-delay: 0.1s; }
.history-item:nth-child(3) { animation-delay: 0.15s; }
.history-item:nth-child(4) { animation-delay: 0.2s; }
.history-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes historyFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animaciones */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

.ranking-row {
    animation: fadeInUp 0.5s ease forwards;
}

.ranking-row:nth-child(1) { animation-delay: 0.1s; }
.ranking-row:nth-child(2) { animation-delay: 0.2s; }
.ranking-row:nth-child(3) { animation-delay: 0.3s; }

/* Responsive */
@media (max-width: 768px) {
    .ranking-title {
        font-size: 2em;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .hide-mobile {
        display: none;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.5rem;
        font-size: 0.9em;
    }
    
    .position {
        width: 50px;
        font-size: 1em;
    }
    
    .match-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .history-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .ranking-title {
        font-size: 1.8em;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.4rem;
        font-size: 0.8em;
    }
    
    .total-score {
        font-size: 1em;
    }
}

/* Estilos específicos por juego para performance badges - Versión Sutil */

/* Mentiroso */
.performance-badge.master-deception {
    background: rgba(142, 68, 173, 0.1);
    color: #6c3483;
    border-color: rgba(142, 68, 173, 0.3);
}

.performance-badge.expert-detective {
    background: rgba(44, 62, 80, 0.1);
    color: #2c3e50;
    border-color: rgba(44, 62, 80, 0.3);
}

.performance-badge.strategist {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border-color: rgba(231, 76, 60, 0.3);
}

.performance-badge.trickster {
    background: rgba(243, 156, 18, 0.1);
    color: #d68910;
    border-color: rgba(243, 156, 18, 0.3);
}

/* Quién Sabe Más */
.performance-badge.grandmaster {
    background: rgba(255, 215, 0, 0.12);
    color: #b8860b;
    border-color: rgba(255, 215, 0, 0.3);
}

.performance-badge.knowledgeable {
    background: rgba(52, 152, 219, 0.1);
    color: #2471a3;
    border-color: rgba(52, 152, 219, 0.3);
}

.performance-badge.competent {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border-color: rgba(39, 174, 96, 0.3);
}

.performance-badge.apprentice {
    background: rgba(149, 165, 166, 0.1);
    color: #566573;
    border-color: rgba(149, 165, 166, 0.3);
}

.performance-badge.student {
    background: rgba(189, 195, 199, 0.1);
    color: #5d6d7e;
    border-color: rgba(189, 195, 199, 0.3);
}

/* Crack Rápido */
.performance-badge.supreme-speedster {
    background: rgba(255, 107, 107, 0.12);
    color: #dc3545;
    border-color: rgba(255, 107, 107, 0.3);
}

.performance-badge.golden-bolt {
    background: rgba(255, 211, 42, 0.12);
    color: #e6ac00;
    border-color: rgba(255, 211, 42, 0.3);
}

.performance-badge.speed-master {
    background: rgba(78, 205, 196, 0.1);
    color: #138d75;
    border-color: rgba(78, 205, 196, 0.3);
}

.performance-badge.agile-runner {
    background: rgba(116, 185, 255, 0.1);
    color: #2874a6;
    border-color: rgba(116, 185, 255, 0.3);
}

.performance-badge.progressing {
    background: rgba(162, 155, 254, 0.1);
    color: #5b2c87;
    border-color: rgba(162, 155, 254, 0.3);
}

/* Valores específicos con colores más sutiles */
.stat-value.opponents {
    color: rgba(142, 68, 173, 0.8);
}

.stat-value.lies {
    color: rgba(231, 76, 60, 0.8);
}

.stat-value.detected {
    color: rgba(39, 174, 96, 0.8);
}

.stat-value.deception {
    color: rgba(243, 156, 18, 0.8);
}

.stat-value.opponent-score {
    color: rgba(142, 68, 173, 0.7);
}

.stat-value.difference.positive {
    color: rgba(39, 174, 96, 0.8);
    font-weight: 600;
}

.stat-value.difference.negative {
    color: rgba(231, 76, 60, 0.8);
    font-weight: 600;
}

.stat-value.difference.neutral {
    color: rgba(149, 165, 166, 0.8);
}

.stat-value.elo.positive {
    color: rgba(39, 174, 96, 0.8);
    font-weight: 600;
}

.stat-value.elo.negative {
    color: rgba(231, 76, 60, 0.8);
    font-weight: 600;
}

.stat-value.elo.neutral {
    color: rgba(149, 165, 166, 0.8);
}

.stat-value.efficiency {
    color: rgba(243, 156, 18, 0.8);
    font-family: system-ui, sans-serif;
}

/* Diseño sutil y elegante - sin animaciones llamativas */

/* Mejoras adicionales para móviles - más sutiles */
@media (max-width: 600px) {
    .stat-value {
        font-size: 0.85rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .performance-badge {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .match-summary {
        font-size: 0.75rem;
    }
    
    .result-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
} 