/* Global */
/* =========================================
   PANTALLA DE CARGA (LOADER)
   ========================================= */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg); /* Usa el fondo de tu app */
    z-index: 99999; /* Por encima de todo */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

/* El ícono de ajedrez (usamos un carácter unicode para no cargar imágenes) */
.chess-loader {
    font-size: 4rem;
    color: var(--accent);
    animation: pulse-chess 1.1s infinite ease-in-out;
    text-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.loader-text {
    margin-top: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    animation: blink 1.5s infinite;
}

/* Animación de latido/rebote suave */
@keyframes pulse-chess {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 20px rgba(47, 82, 62, 0.4); }
    100% { transform: scale(0.9); opacity: 0.7; }
}

@keyframes blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Clase para ocultarlo cuando termine de cargar */
.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
:root{
  --bg: #f3faf2;
  --card: #fff;
  --text: #0f3b2e;
  --muted:  #dfbb2d;
  --miniM:#000;
  --accent: #2f523e;
  --accent-dark: #044621;
  --danger: #c62828;
  --glass: rgba(31,166,90,0.06);

  /* Variables para el Bye (Modo Claro) */
  --bye-bg: #f0f4f2;
  --bye-text: var(--muted);
  --bye-border: #dbeeda;
}
/* =========================================
   TRANSICIONES SUAVES (MODO CLARO A OSCURO)
   ========================================= */
body, 
.card, 
.player-form, 
.table-card,
.styled-table tbody tr,
.styled-table th, 
.styled-table td,
.form-control,
h2,
p {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  background-color: #aabfdb;
}

/* Header */

/* =========================================
   ESTILOS DEL HEADER PRINCIPAL
   ========================================= */
.chess-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.4rem 2.5rem;
    
    /* Imagen de fondo de ajedrez con un gradiente oscuro encima para legibilidad */
    background-image: 
        linear-gradient(to right, rgba(28, 49, 78, 0.95), rgba(28, 49, 78, 0.75)),
        url('https://images.unsplash.com/photo-1528819622765-d6bcf132f793?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    
    /* Sombra para separar el header del contenido */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid #fbbc04; /* Línea de acento sutil inferior */
}

/* Contenedor izquierdo (Logo + Textos) */
.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* =========================================
ESTILOS DEL LOGO
   ========================================= */
.logo {
    background: linear-gradient(135deg, #2b5c38, #1a3c24); /* Verde elegante */
    color: #ffffff;
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    
    /* Transición suave */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Efecto hover del logo */
.logo:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(43, 92, 56, 0.5);
}

/* =========================================
   ESTILOS DE LA TIPOGRAFÍA (TÍTULOS)
   ========================================= */
.title-container h1 {
    font-size: 1.7rem;
    color: #fbbc04; /* Amarillo similar al tuyo, pero más brillante */
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
}

.title-container p {
    font-size: 1.1rem;
    color: #e8eaed; /* Blanco grisáceo para diferenciarlo del título */
    font-weight: 400;
    margin-top: 0.2rem;
}
.toggleTheme {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    
    /* Fondo oscuro muy elegante y sutil */
    background: rgba(15, 23, 42, 0.65); 
    color: #e2e8f0; /* Blanco suave, no puro, para no cansar la vista */
    
    /* Borde fino semitransparente */
    border: 1px solid rgba(255, 255, 255, 0.12);
    
    padding: 0.55rem 1.25rem;
    border-radius: 8px; /* Bordes ligeramente redondeados, más serios que una píldora */
    
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    
    /* Efecto Glassmorphism refinado */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    
    /* Transición premium usando cubic-bezier para más fluidez */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animación separada para el icono */
.toggleTheme .icon {
    font-size: 1.1rem;
    transition: transform 0.4s ease;
}

/* =========================================
   EFECTO HOVER (Al pasar el ratón)
   ========================================= */
.toggleTheme:hover {
    /* Se aclara ligeramente el fondo */
    background: rgba(255, 255, 255, 0.1);
    
    /* El borde toma el color amarillo del título (#fbbc04) de forma sutil */
    border-color: rgba(251, 188, 4, 0.6); 
    color: #ffffff;
    
    /* Se eleva muy sutilmente */
    transform: translateY(-2px);
    
    /* Sombra que combina profundidad y un ligero brillo amarillo */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25), 0 0 12px rgba(251, 188, 4, 0.15);
}

/* El icono de la luna hace un pequeño movimiento */
.toggleTheme:hover .icon {
    transform: rotate(-15deg) scale(1.1); 
}

/* Efecto al hacer clic */
.toggleTheme:active {
    transform: translateY(0) scale(0.98);
}
/* Layout */
/* =========================================
   CONTENEDORES BASE
   ========================================= */
.container {
    max-width: 1400px;
    margin: 18px auto;
    padding: 0 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}


.card {
    max-width: 1400px;
    margin: 18px auto;
    padding: 0 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    background: var(--card, white); /* Usa tu variable si existe, si no usa blanco */
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(10,10,10,0.05);
}

.card h2 { margin-top: 0; margin-bottom: 15px; color: #0f172a; font-size: 1.4rem; }

.center-action { display: flex; justify-content: center; margin: 30px 0; }

/* =========================================
   SISTEMA DE BOTONES MODERNOS
   ========================================= */
/* =========================================
   SISTEMA DE BOTONES MODERNOS Y COHERENTES
   ========================================= */
.btn {
    padding: 10px 17px;
    border-radius: 8px;
    border: 1px solid transparent; /* Preparado para bordes sutiles */
    font-family: inherit;
    font-size: 0.99rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(0,0,0,0.15); 
}

/* 1. Botón Principal (Azul Marino del fondo del header) */
.btn-primary { 
    background: #122642; 
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-primary:hover:not(:disabled) { background: #2a476d; }

/* 2. Botón Éxito / Excel (Verde elegante del logo) */
.btn-success { 
    background: #368d4d;  
    color: white; 
}
.btn-success:hover:not(:disabled) { background: #1a3c24; }

/* 3. Botón Agregar (Verde más oscuro con texto dorado para resaltar en el formulario) */
.btn-success-dark { 
    background: #1a3c24; 
    color: #fbbc04; 
    border: 1px solid rgba(251, 188, 4, 0.3);
}
.btn-success-dark:hover:not(:disabled) { 
    background: #2b5c38; 
    border-color: #fbbc04;
}

/* 4. Botones Secundarios (Gris pizarra para no robar atención) */
.btn-secondary { background: #475569; color: white; }
.btn-secondary:hover:not(:disabled) { background: #334155; }

/* 5. Botones de Peligro (Rojo oscuro/ladrillo, más serio) */
.btn-danger { background: #991b1b; color: white; }
.btn-danger:hover:not(:disabled) { background: #7f1d1d; }

/* 6. Guardar Torneo (Reemplaza el morado por el Azul Marino para mantener cohesión) */
.btn-purple { background: #1c314e; color: white; }
.btn-purple:hover:not(:disabled) { background: #12223a; }

/* 7. Botones Neutros/Oscuros (Estilo cristal oscuro del header) */
.btn-dark { 
    background: #0f172af9; 
    color: #b2a8a8; 
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 15px 29px;
    font-size: 1.1rem;
}
.btn-dark:hover:not(:disabled) { 
    background: #121686; 
    color: #fbbc04; /* Cambia a oscuro si el fondo de la página es claro */
}

/* 8. Botón Estrella: Finalizar Inscripción (Mismo estilo exacto que el "Modo Oscuro" en Hover) */
.btn-dark-accent {
    background: #0f172a !important; 
    color: #fbbc04 !important; /* Amarillo del header */
    border: 1px solid rgba(251, 188, 4, 0.4) !important;
}
.btn-dark-accent:hover:not(:disabled) {
    background: #1e293b !important;
    border-color: #fbbc04 !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25), 0 0 15px rgba(251, 188, 4, 0.2) !important;
}

/* Tamaños Especiales */
.btn-xl { padding: 14px 28px; font-size: 1.1rem; border-radius: 10px; }

/* Botón de Eliminar Fila (Tabla) */
.btn-delete {
    background-color: #991b1b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}
.btn-delete:hover { background-color: #7f1d1d; transform: scale(1.05); }

/* Deshabilitados */
button:disabled, input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    filter: grayscale(40%);
}
/* =========================================
   ESTILOS PREMIUM PARA LOS SELECT DE RESULTADOS
   ========================================= */

/* Seleccionamos todos los dropdowns dentro del contenedor de rondas */
#roundsContainer select {
    width: 100%;
    min-width: 110px; /* Evita que se hagan muy pequeños */
    padding: 8px 35px 8px 12px; /* Espacio extra a la derecha para la flecha */
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600; /* Texto en negrita sutil para que el resultado destaque */
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    
    /* Ocultamos la flecha fea por defecto del navegador */
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* Dibujamos una flecha minimalista y elegante en código (SVG) */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 10px auto;
}

/* Efecto al pasar el ratón */
#roundsContainer select:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Efecto al hacer clic / elegir resultado (Halo amarillo) */
#roundsContainer select:focus {
    border-color: #fbbc04;
    box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.2);
}

/* =========================================
   SELECT DE RESULTADOS EN MODO OSCURO
   ========================================= */
body.dark-mode #roundsContainer select {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
    
    /* Cambiamos el color de la flecha SVG a un gris claro para que se vea en fondo oscuro */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23cbd5e1%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

body.dark-mode #roundsContainer select:hover {
    background-color: #0f172a;
    border-color: #475569;
}

body.dark-mode #roundsContainer select:focus {
    border-color: #fbbc04;
    box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.15);
}
/* =========================================
   FORMULARIO E INPUTS
   ========================================= */
.player-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: var(--card, white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.9rem;}

.form-control {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    color: inherit;
}
.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.input-small { width: 90px; }
.dropdown-torneo { min-width: 200px; }

/* =========================================
   DISEÑO DE TABLA (Integrada al Header)
   ========================================= */
.table-card {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow-x: auto;
    background: var(--card, white);
    border: 1px solid rgba(28, 49, 78, 0.1); /* Borde sutil azul marino */
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    border-radius: 10px;
    overflow: hidden;
}

.styled-table thead tr {
    /* Mismo gradiente verde del logo H.H */
    background: linear-gradient(135deg, #2b5c38, #1a3c24);
    color: white;
    border-bottom: 3px solid #fbbc04; /* Línea de acento amarilla debajo de los títulos */
}

.styled-table th, .styled-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.styled-table th {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.styled-table tbody tr { transition: background 0.2s ease; }
.styled-table tbody tr:nth-child(even) { background: #f8fafc; }
.styled-table tbody tr:hover { background: #eef2f6; } /* Azul-gris muy tenue al pasar el ratón */

/* =========================================
   CONTROLES (Filas)
   ========================================= */
.controls-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.controls-row-card { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }


/* =========================================
   REGLAS DEL USUARIO CONSERVADAS (Modo oscuro e Impresión)
   ========================================= */
@media print {
    .chess-title {
        border: 1px solid #000;
        color: #000 !important;
        font-weight: bold;
    }
}

/* =========================================
   MODO OSCURO (.dark-mode)
   ========================================= */

/* 1. Fondo y Textos Generales */
body.dark-mode {
    background-color: #0f172a; /* Azul marino muy oscuro */
    color: #e2e8f0; /* Texto gris muy claro */
}

body.dark-mode h2, 
body.dark-mode .card h2 {
    color: #f8fafc; /* Blanco puro para títulos */
}

body.dark-mode .miniM.small {
    color: #94a3b8 !important; /* Texto secundario apagado */
}

/* 2. Tarjetas (Cards) y Contenedores */
body.dark-mode .card,
body.dark-mode .player-form,
body.dark-mode .table-card {
    background-color: #1e293b; /* Un tono más claro que el fondo para dar profundidad */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Sombra más pronunciada para modo oscuro */
}

/* 3. Inputs y Formularios */
body.dark-mode .form-control {
    background-color: #0f172a;
    border: 1px solid #334155;
    color: #f8fafc;
}

body.dark-mode .form-control:focus {
    border-color: #fbbc04; /* El borde brilla en amarillo/dorado al escribir */
    box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.15);
}

/* Para que los placeholder no se vean tan blancos */
body.dark-mode .form-control::placeholder {
    color: #64748b;
}

/* 4. Diseño de la Tabla en Modo Oscuro */
body.dark-mode .styled-table thead tr {
    /* El título de la tabla mantiene la esencia, pero un poco más oscuro */
    background: linear-gradient(135deg, #1f4228, #122918); 
    border-bottom: 3px solid #fbbc04;
}

body.dark-mode .styled-table th, 
body.dark-mode .styled-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

/* Alternancia de color en las filas para modo oscuro */
body.dark-mode .styled-table tbody tr:nth-child(odd) {
    background: #1e293b; /* Mismo color de la tarjeta */
}

body.dark-mode .styled-table tbody tr:nth-child(even) {
    background: #0f172a; /* Fondo más oscuro */
}

body.dark-mode .styled-table tbody tr:hover {
    background: #334155; /* Iluminación suave al pasar el ratón */
}

/* 5. Ajustes de Botones para Modo Oscuro */
body.dark-mode .btn-secondary {
    background: #334155;
    color: #f8fafc;
}

body.dark-mode .btn-secondary:hover:not(:disabled) {
    background: #475569;
}

/* El botón oscuro principal se invierte ligeramente para que destaque sobre fondo oscuro */
body.dark-mode .btn-dark {
    background: #334155;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .btn-dark:hover:not(:disabled) {
    background: #475569;
}/* =========================================
   CLASIFICACIÓN FINAL (Medallas y Tablas)
   ========================================= */

/* Cabecera específica para la tabla final (Alineada al gradiente del header) */
.final-table thead tr {
    background: linear-gradient(135deg, #2b5c38, #1a3c24) !important;
    border-bottom: 3px solid #fbbc04 !important;
}

.final-table tbody td {
    text-align: center !important;
}

/* 1. ESTILOS DE LA FILA (TR) - Colores Metálicos Premium */
.styled-table tbody tr.gold {
    background: linear-gradient(135deg, #fef08a, #facc15) !important; /* Dorado vivo */
    color: #422006 !important; /* Texto marrón muy oscuro para contraste perfecto */
    font-weight: 700;
}

.styled-table tbody tr.silver {
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1) !important; /* Plateado pulido */
    color: #0f172a !important; /* Azul oscuro/Pizarra */
    font-weight: 700;
}

.styled-table tbody tr.bronze {
    background: linear-gradient(135deg, #fed7aa, #f97316) !important; /* Bronce brillante */
    color: #431407 !important; /* Texto rojizo oscuro */
    font-weight: 700;
}

/* 2. ESTILOS DE LA CELDA (TD) - Hereda el color */
.styled-table tbody tr.gold td,
.styled-table tbody tr.silver td,
.styled-table tbody tr.bronze td {
    background-color: transparent !important; 
    color: inherit !important; 
    border-bottom-color: rgba(0, 0, 0, 0.05) !important; /* Borde muy sutil para no cortar el gradiente */
}

/* 3. REGLAS DE HOVER - Levante elegante sin romper el color */
.styled-table tbody tr.gold:hover,
.styled-table tbody tr.silver:hover,
.styled-table tbody tr.bronze:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    position: relative;
}



/* =========================================
   PODIO ANIMADO Y PROFESIONAL (MEDALLAS)
   ========================================= */
#medals {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Alinea hacia abajo para crear el efecto podio */
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
    min-height: 140px; /* Da espacio para que el oro sobresalga hacia arriba */
}

.medal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border-radius: 12px;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    
    /* Animación de entrada suave */
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efecto Hover general */
.medal:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    z-index: 10;
}

/* Tamaño del Icono de medalla */
.medal .icon {
    font-size: 32px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* --- 1. ORO (Centro y más grande) --- */
.medal.gold {
    order: 2; /* CSS Flexbox lo mueve al centro visualmente */
    background: linear-gradient(135deg, #fef08a, #facc15);
    color: #422006;
    border: 2px solid #eab308;
    transform: scale(1.15) translateY(-10px);
    z-index: 3;
}
.medal.gold:hover { transform: scale(1.22) translateY(-15px); }

/* --- 2. PLATA (Izquierda) --- */
.medal.silver {
    order: 1; /* A la izquierda del oro */
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    color: #0f172a;
    border: 2px solid #94a3b8;
    z-index: 2;
}
.medal.silver:hover { transform: scale(1.05) translateY(-5px); }

/* --- 3. BRONCE (Derecha) --- */
.medal.bronze {
    order: 3; /* A la derecha del oro */
    background: linear-gradient(135deg, #fed7aa, #f97316);
    color: #431407;
    border: 2px solid #c2410c;
    z-index: 1;
}
.medal.bronze:hover { transform: scale(1.05) translateY(-5px); }

/* =========================================
   ANIMACIONES (Brillo y Entrada)
   ========================================= */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; }
}

/* Efecto de rayo de luz (Shine) pasando sobre las medallas */
.medal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shineSweep 4s infinite;
}

@keyframes shineSweep {
    0% { left: -150%; }
    20% { left: 200%; }
    100% { left: 200%; } /* Pausa entre pasadas de luz */
}

/* =========================================
   PODIO EN MODO OSCURO
   ========================================= */
body.dark-mode .medal.gold {
    background: linear-gradient(135deg, #ca8a04, #854d0e);
    color: #fef08a;
    border-color: #a16207;
}

body.dark-mode .medal.silver {
    background: linear-gradient(135deg, #475569, #334155);
    color: #f8fafc;
    border-color: #1e293b;
}

body.dark-mode .medal.bronze {
    background: linear-gradient(135deg, #9a3412, #7c2d12);
    color: #fed7aa;
    border-color: #7c2d12;
}

body.dark-mode .medal {
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
/* =========================================
   FOOTER PREMIUM Y ANIMADO
   ========================================= */
.footer {
    /* Gradiente oscuro que coincide con el Header y Partida Estelar */
    background: linear-gradient(to right, #0f172a, #1c314e, #0f172a);
    background-size: 200% auto;
    
    /* Línea dorada sutil en la parte superior para separar del contenido */
    border-top: 1px solid rgba(251, 188, 4, 0.15);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    
    padding: 25px 15px;
    margin-top: 40px; /* Separación del contenido de arriba */
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    
    /* Animación continua y muy suave del fondo */
    animation: footerGlow 15s linear infinite;
}

@keyframes footerGlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.footer-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #94a3b8; /* Gris pizarra elegante, no cansa la vista */
    letter-spacing: 1px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

/* Pequeño salto al pasar el ratón por el texto */
.footer-content:hover {
    transform: translateY(-3px);
}

.author-name {
    color: #fbbc04; /* Amarillo/Dorado del torneo */
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.accent-dot {
    color: #fbbc04;
    opacity: 0.6;
    font-size: 1.2rem;
}

.rights-text {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* =========================================
   FOOTER EN MODO OSCURO
   ========================================= */
body.dark-mode .footer {
    /* En modo oscuro lo hacemos un poco más profundo */
    background: linear-gradient(to right, #090e17, #0f172a, #090e17);
    background-size: 200% auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .author-name {
    color: #fbbc04; /* Mantiene el brillo dorado */
}

/* Small text */
.small{font-size:13px;color:var(--muted)}

/* Dark mode */
body.dark-mode{
  background:#0b1a12;color:#d5dbd7
}
body.dark-mode .card{background:#122017}
body.dark-mode .styled-table thead tr{background:#043806}
body.dark-mode .styled-table tbody tr:nth-child(even){background:#132218}
body.dark-mode .final-table thead tr{background:#008421be}

/* --- SECCIÓN CORREGIDA: Estilos Dark Mode --- */

/* Añadir variables del Bye para Modo Oscuro */
body.dark-mode {
    /* ... (tus otros estilos dark-mode) ... */
    --bye-bg: #1a2c22;
    --bye-text: var(--muted);
    --bye-border: #1f3d2b;
}

/* Colores por posición (Modo Oscuro) */
/* ¡AÑADIDO !important PARA FORZAR EL ESTILO */
/* --- MODO OSCURO (MISMO PRINCIPIO) --- */
body.dark-mode .styled-table tbody tr.gold { 
    background-color: #d0b100 !important; 
    color: #000 !important; 
}
body.dark-mode .styled-table tbody tr.silver { 
    background-color: #6d6d6d !important; 
    color: #000 !important; 
}
body.dark-mode .styled-table tbody tr.bronze { 
    background-color: #b87633 !important; 
    color: #fff !important; 
}

/* 4. CELDAS EN MODO OSCURO */
body.dark-mode .styled-table tbody tr.gold td,
body.dark-mode .styled-table tbody tr.silver td,
body.dark-mode .styled-table tbody tr.bronze td {
    background-color: transparent !important; /* ¡¡LA SOLUCIÓN!! */
    color: inherit !important; 
}
/* --- FIN SECCIÓN CORREGIDA --- */


/* --- SECCIÓN CORREGIDA: Animaciones --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Clases para la animación (reemplaza 'tr { animation: ... }') */
.fila-animada {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.fila-animada.mostrar {
    opacity: 1;
    transform: translateY(0);
}
/* --- FIN SECCIÓN CORREGIDA --- */



body.dark-mode.dropdown{color: #fff !important;}
.tournament-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.tournament-card {
  background: var(--accent-light, #f0f0f0);
  color: var(--text-dark, #222);
  border-radius: 10px;
  padding: 12px;
  width: 200px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.tournament-card.dark-mode {
  background: #333;
  color: #fff;
}

.tournament-card h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

#printFinalBtn {
  margin-top: 20px; /* separa de las medallas */
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  background-color: #0c032e;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#printFinalBtn:hover {
  background-color: #272069;
  transform: translateY(-2px);
}
/* --- ESTILOS PARA LA ANIMACIÓN / SECCIÓN DE PODIO --- */

/* Estilo base para los elementos del podio */
.podium-item { 
    border-radius: 8px; /* Bordes redondeados para un mejor look */
    padding: 15px; 
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-align: center;
}

/* --- MODO OSCURO (Ajustar si tu sistema tiene un selector body.dark-mode) --- */
body.dark-mode .podium-item.gold { 
    background: linear-gradient(145deg, #d4af37, #997800); 
    color: #fff; 
}
body.dark-mode .podium-item.silver { 
    background: linear-gradient(145deg, #5a5a5a, #808080);
    color: #fff;
}
body.dark-mode .podium-item.bronze { 
    background: linear-gradient(145deg, #996515, #8B4513);
    color: #fff;
}
/* --- ESTILOS PARA CELDAS DE PIEZAS EN TABLAS DE RONDA --- */

/* Jugador de PIEZAS BLANCAS */
.styled-table td.player-white {
    background-color: #f7f7f7 !important; /* Fondo Blanco suave */
    color: #333; /* Texto oscuro */
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
}

/* Jugador de PIEZAS NEGRAS */
.styled-table td.player-black {
    background-color: #232323 !important; /* Fondo Negro/Gris oscuro */
    color: #fff; /* Texto blanco */
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
}

/* --- ESTILO PARA LA FILA COMPLETA DE DESCANSO --- */

/* Aplicar fondo a la fila (TR) */
.styled-table tbody tr.fila-descanso {
    /* Un color azul claro suave o un amarillo pálido */
    background-color: #e6f7ff !important; /* Azul muy claro */
    border: 1px solid #b3e0ff !important;
}

/* Asegurar que las celdas (TD) dentro de esa fila no tengan un fondo que oculte el color de la fila */
.styled-table tbody tr.fila-descanso td {
    background-color: transparent !important; /* CRUCIAL: Se asegura de que la celda sea transparente */
    color: #004085 !important; /* Texto de la fila azul oscuro */
    font-style: italic;
}

/* Estilo para el modo oscuro */
body.dark-mode .styled-table tbody tr.fila-descanso {
    background-color: #1a3045 !important; /* Azul oscuro para modo oscuro */
}
body.dark-mode .styled-table tbody tr.fila-descanso td {
    color: #99c2ff !important; /* Texto más claro */
}
/* --- MODO OSCURO --- */
body.dark-mode .styled-table td.player-white {
    background-color: #cccccc !important; /* Blanco más claro en modo oscuro */
    color: #333;
}

body.dark-mode .styled-table td.player-black {
    background-color: #222222 !important; /* Negro más oscuro */
    color: #fff;
}
/*-----barra de estadisticas----*/
/* Dashboard Container */
.dashboard-container {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
}

body.dark-mode .dashboard-container {
    background: #2d2d2d;
    color: #fff;
}

/* Partida Estelar */
.featured-match-card {
    background: linear-gradient(135deg, #152b54 0%, #314e81 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}
.match-versus {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
    font-size: 1.2em;
}
.versus-badge {
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 50%;
    font-weight: bold;
}
.rival-elo {
    display: block;
    font-size: 0.8em;
    opacity: 0.8;
}
/* =========================================
   DASHBOARD ESTADÍSTICAS (ANIMADO Y PREMIUM)
   ========================================= */
.dashboard-container {
    animation: fadeInUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

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

/* --- Partida Estelar --- */
.featured-match-card {
    background: linear-gradient(135deg, #1c314e, #0f172a);
    color: white;
    border-radius: 16px;
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid #fbbc04;
}

.featured-match-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: rotateGlow 20s linear infinite;
    pointer-events: none;
}

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

.featured-title {
    color: #fbbc04;
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.match-versus {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3vw;
    margin: 1.5rem 0;
    position: relative;
    z-index: 2;
}

.rival { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.rival-name { font-size: 1.8rem; font-weight: 800; color: #ffffff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.rival-elo { font-size: 0.95rem; color: #94a3b8; background: rgba(255,255,255,0.1); padding: 4px 12px; border-radius: 20px; margin-top: 8px; }

.versus-badge {
    background: linear-gradient(135deg, #fbbc04, #d97706);
    color: #0f172a;
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: 900; font-size: 1.2rem;
    box-shadow: 0 0 0 0 rgba(251, 188, 4, 0.7);
    animation: pulseVS 2s infinite;
}

@keyframes pulseVS {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 188, 4, 0.6); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 15px rgba(251, 188, 4, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 188, 4, 0); }
}

.match-context { color: #cbd5e1; font-size: 0.95rem; font-style: italic; margin-bottom: 0; position: relative; z-index: 2; }

/* --- Stats Grid (Tarjetas Flotantes) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    padding: 24px 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.stat-card:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); }
.stat-card h4 { margin: 0 0 10px 0; font-size: 0.9rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-card p { margin: 0; font-size: 1.8rem; font-weight: 800; color: #1c314e; }

.stat-card.special-card { border-bottom: 4px solid #ff17b6; }
.stat-subtitle { color: #94a3b8; font-size: 0.85rem; display: block; margin-top: 5px; }

/* --- Contenedor del Gráfico --- */
.chart-container {
    position: relative;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    height: 300px;
    width: 100%;
    color: #f0f0f0;
}

/* =========================================
   TABLA DE RENDIMIENTO Y RACHAS (RESTAURADO Y MEJORADO)
   ========================================= */
.stats-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Suavizado para encajar con el grid */
    overflow: hidden;
    margin-top: 25px;
    border: 1px solid #f1f5f9;
}

.stats-header {
    /* Cambiado para coincidir con tu Header y la Partida Estelar */
    background: linear-gradient(135deg, #1c314e, #0f172a); 
    color: #fcfcfc;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #fbbc04; /* Acento dorado */
}

.pro-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.pro-table th {
    background-color: #f8fafc; /* Gris muy limpio */
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .87em;
    letter-spacing: 1px;
    padding: 12px 15px;
    border-bottom: 2px solid #e2e8f0;
}

.pro-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    font-size: 1.04em;
}

.pro-table tr:hover { background-color: #f8fafc; }
.pro-table tr:last-child td { border-bottom: none; }

/* Badges de Racha */
.streak-container { display: flex; gap: 5px; }

.streak-badge {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 10px; font-weight: 800;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.streak-badge:hover { transform: scale(1.15); }

.bg-win { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.bg-draw { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.bg-loss { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.bg-bye { background: linear-gradient(135deg, #17a2b8, #138496); }

/* Género */
.gender-icon { font-size: 1.1em; margin-left: 5px; vertical-align: middle; }

/* Champion Overlay */
.champion-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9); /* Oscuridad estilo premium */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =========================================
   MODO OSCURO PARA EL DASHBOARD
   ========================================= */
body.dark-mode .stat-card,
body.dark-mode .chart-container,
body.dark-mode .stats-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Grid oscuro */
body.dark-mode .stat-card h4 { color: #94a3b8; }
body.dark-mode .stat-card p { color: #f8fafc; }
body.dark-mode .stat-card.special-card { border-bottom-color: #fbbc04; }

/* Tabla oscura */
body.dark-mode .pro-table td { color: #e2e8f0; border-bottom-color: #334155; }
body.dark-mode .pro-table th { background-color: #0f172a; color: #94a3b8; border-bottom-color: #334155; }
body.dark-mode .pro-table tr:hover { background-color: #334155; }

/* Tarjeta del Ganador */
.champion-card {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
    border: 4px solid #ffd700;
    position: relative;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.trophy-icon { font-size: 80px; margin-bottom: 10px; }
.champion-name { color: #d4af37; font-size: 2.5em; margin: 10px 0; text-shadow: 1px 1px 2px rgba(0,0,0,0.1); }
.champion-stats { font-size: 1.2em; color: #555; font-weight: bold; }

/* Lista del recorrido */
.champion-path {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}
.champion-path h3 { margin-top: 0; font-size: 1em; color: #666; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.champion-path ul { list-style: none; padding: 0; margin: 0; }
.champion-path li { padding: 8px 0; border-bottom: 1px solid #f9f9f9; font-size: 0.9em; display: flex; justify-content: space-between; }
.result-win { color: green; font-weight: bold; }
.result-draw { color: orange; font-weight: bold; }
.result-loss { color: red; font-weight: bold; }

.close-modal-btn {
    position: absolute; top: 10px; right: 15px;
    background: none; border: none; font-size: 24px; cursor: pointer; color: #999;
}

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

.special-awards-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.award-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    width: 300px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: transform 0.2s;
}

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

/* Estilo Fuego (Rojo/Naranja) */
.award-fire { border-color: #ff4500; background: linear-gradient(to bottom, #fff, #fff5f0); }
.award-fire .award-icon { font-size: 40px; margin-bottom: 10px; }

/* Estilo Escudo (Azul/Acero) */
.award-shield { border-color: #4682b4; background: linear-gradient(to bottom, #fff, #f0f8ff); }
.award-shield .award-icon { font-size: 40px; margin-bottom: 10px; }

.award-desc { font-size: 0.9em; color: #424242; margin-bottom: 15px; }
.award-info { font-weight: bold; font-size: 1.1em; color: #333; }
.vs-badge { background: #333; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; margin: 0 5px; }
body.dark-mode .award-desc{
    color: #373737 !important;
}
/* --- ESTILOS DE IMPRESIÓN --- */
@media print {
    /* 1. FORZAR IMPRESIÓN DE COLORES */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 2. Ocultar botones y cosas que no sirven en papel */
    button, 
    .btn, 
    #registrationControls, 
    #tournamentControls, 
    #championControls,
    select { 
        display: none !important; 
    }

    /* Asegurar que las tablas se vean bien */
    table { width: 100% !important; border-collapse: collapse; }
    th, td { border: 1px solid #000 !important; color: #000 !important; }

    /* --- A. COLORES PARA LA TABLA DE CLASIFICACIÓN (STANDINGS) --- */
    /* Asumiendo que tu tabla de posiciones tiene ID 'finalStandingsTable' o 'standingsTable' */
    
    /* 1er Lugar - ORO */
    #finalStandingsTable tbody tr:nth-child(1) {
        background-color: #fff3cd !important; /* Amarillo claro */
        font-weight: bold;
    }
    #finalStandingsTable tbody tr:nth-child(1) td:first-child::before {
        content: "🥇 "; 
    }

    /* 2do Lugar - PLATA */
    #finalStandingsTable tbody tr:nth-child(2) {
        background-color: #e2e3e5 !important; /* Gris claro */
    }
    #finalStandingsTable tbody tr:nth-child(2) td:first-child::before {
        content: "🥈 "; 
    }

    /* 3er Lugar - BRONCE */
    #finalStandingsTable tbody tr:nth-child(3) {
        background-color: #f8d7da !important; /* Rojizo/Bronce claro */
    }
    #finalStandingsTable tbody tr:nth-child(3) td:first-child::before {
        content: "🥉 "; 
    }

    /* --- B. COLORES PARA LA TABLA DE PAREO (BLANCAS VS NEGRAS) --- */
    /* Esto asume que la estructura de tu tabla de pareo es: 
       Mesa | Blancas | Resultado | Negras */

    /* Columna de Jugador BLANCAS (Columna 2) */
    .rounds-container table td:nth-child(2) {
        background-color: #ffffff !important; /* Blanco puro */
        position: relative;
    }
    /* Agregamos un peón blanco visual */
    .rounds-container table td:nth-child(2)::before {
        content: "⚪ ";
        font-size: 1.2em;
    }

    /* Columna de Jugador NEGRAS (Columna 4) */
    .rounds-container table td:nth-child(4) {
        background-color: #d1d1d1 !important; /* Gris notable para simular negras */
        font-weight: bold;
        color: #000 !important;
    }
    /* Agregamos un peón negro visual */
    .rounds-container table td:nth-child(4)::before {
        content: "⚫ ";
        font-size: 1.2em;
    }
}