/* Importar Font Awesome para íconos */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

/* General Body and Font */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1d1b1a; /* Dark black from user request */
    color: #e6e6e6; /* Light gray for main text */
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styles (minimalist, darker) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #11100f; /* Even darker black */
}
::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555555;
}


/* Header Styling */
header {
    background-color: #11100f; /* Dark black for header */
    color: #fff;
    padding: 1.2rem 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #2a2a2a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.header-left {
    display: flex;
    align-items: center;
}

/* New style for the tournament banner image (in Hero Section) */
/* NOTA: Esta clase 'tournament-banner' se usa en el hero section para la imagen de 1500x500px,
   no confundir con el 'goat-logo' del header. */
.tournament-banner-hero { /* Usar el nombre que se usó en el HTML más reciente */
    width: 100%; /* Make it responsive */
    height: 500px; /* Fixed height for consistency, allows object-fit */
    object-fit: cover; /* Cover the area, cropping if necessary */
    border-radius: 10px; /* Slightly rounded corners for the banner */
    margin-bottom: 40px; /* Space below the banner */
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.banner-image-container { /* Contenedor para la imagen del banner */
    width: 100%;
    overflow: hidden; /* Asegura que la imagen respete los bordes */
    border-radius: 10px; /* Coincide con la imagen */
    margin-bottom: 40px; /* Espacio debajo del banner */
}


.goat-logo { /* Small logo in header */
    height: 50px;
    width: auto;
    margin-right: 25px;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
}
.goat-logo:hover {
    transform: scale(1.08);
}

.site-name {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
    color: #f0f0f0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline;
    margin: 0 30px;
}

nav ul li a {
    color: #b0b0b0;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.08rem;
    transition: color 0.3s ease;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -6px;
    left: 0;
    background-color: #db81b4; /* Pink accent */
    transition: width 0.3s ease-in-out;
}

nav ul li a:hover {
    color: #ffffff;
}
nav ul li a:hover::after {
    width: 100%;
}

/* Language Switcher */
#lang-switcher {
    position: absolute;
    top: 25px;
    right: 50px;
    display: flex;
    gap: 12px;
}

#lang-switcher button {
    background-color: transparent;
    color: #b0b0b0;
    border: 1px solid #404040;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#lang-switcher button:hover {
    background-color: #2a2a2a;
    color: #ffffff;
    border-color: #6a6a6a;
}
#lang-switcher button.active {
    background-color: #db81b4; /* Pink accent */
    color: #ffffff;
    border-color: #db81b4;
    font-weight: 600;
}


/* Main Content Area - RESTAURADO A LA ESTRUCTURA ANTERIOR */
main {
    padding: 60px; /* Mantiene el padding interno del Main */
    max-width: 1500px; /* Ancho máximo para que el contenido se centre */
    margin: 40px auto; /* Centra el Main en la página */
    background-color: #11100f; /* Fondo oscuro principal del Main */
    box-shadow: 0 0 35px rgba(0,0,0,0.6); /* Sombra para el Main */
    border-radius: 20px; /* Bordes redondeados del Main */
    border: 1px solid #2a2a2a; /* Borde del Main */
}

/* Hero Section (Home Page Top) - RESTAURADO A LA ESTRUCTURA ANTERIOR */
.hero-section {
    text-align: center;
    padding: 100px 50px; /* Padding interno de la sección Hero */
    background-color: #11100f; /* Mismo fondo que Main para continuidad */
    border-radius: 18px; /* Bordes redondeados */
    margin-bottom: 60px; /* Margen inferior */
    box-shadow: 0 8px 30px rgba(0,0,0,0.5); /* Sombra */
    border: 1px solid #2a2a2a; /* Borde */
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(219, 129, 180, 0.08) 0%, transparent 60%); /* Subtle pink glow */
    pointer-events: none;
    z-index: 0;
}

/* Estilos de Título, Subtítulo y Acciones del Hero - TRAÍDOS DEL DISEÑO MODERNO */
.tournament-title {
    font-size: 5rem; /* Grande para impacto */
    color: #db81b4; /* Pink accent */
    margin-bottom: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    text-shadow: 0 0 20px rgba(219, 129, 180, 0.5); /* Intense pink shadow */
}

.tournament-subtitle {
    font-size: 2.2rem;
    color: #cccccc;
    margin-top: 0;
    margin-bottom: 60px;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

/* Estilos de botones CTA (call to action) - TRAÍDOS DEL DISEÑO MODERNO */
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 18px 40px;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(219, 129, 180, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.action-button:hover {
    background-color: #c0699c;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(219, 129, 180, 0.8);
}

.primary-button { /* Botón principal, ejemplo: Registrarse */
    background-color: #db81b4;
    color: #ffffff;
}

.secondary-button { /* Botón secundario, ejemplo: Compartir */
    background-color: #404040;
    box-shadow: none;
    border: 1px solid #606060;
    color: #ffffff;
}
.secondary-button:hover {
    background-color: #606060;
    transform: translateY(-3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}


.twitter-button { /* Este es un estilo específico que mantienes */
    background-color: #1da1f2; /* Twitter blue, keep for branding */
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.5);
    color: #fff;
}
.twitter-button:hover {
    background-color: #0d8dd8;
    box-shadow: 0 10px 30px rgba(29, 161, 242, 0.8);
}

.hosted-by {
    color: #b0b0b0;
    font-size: 1.05rem;
    margin-top: 50px;
}

.hosted-by a {
    color: #db81b4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}
.hosted-by a:hover {
    color: #c0699c;
    text-decoration: underline;
}

/* Info Overview Section (la sección de detalles, tarjetas y botones) */
.info-overview-section {
    background-color: #1a1a1a; /* Fondo más claro para esta sección */
    padding: 50px; /* Padding interno */
    border-radius: 15px; /* Bordes redondeados */
    box-shadow: 0 8px 30px rgba(0,0,0,0.5); /* Sombra prominente */
    border: 1px solid #2a2a2a; /* Borde sutil */
    position: relative;
    overflow: hidden;
    margin-bottom: 50px; /* Margen inferior */
}

/* Patrón sutil de fondo */
.info-overview-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><g fill="%23222"><rect width="2" height="2" transform="translate(0 0)"/><rect width="2" height="2" transform="translate(5 5)"/></g></svg>');
    background-size: 10px 10px;
    opacity: 0.05;
    z-index: 0;
}
.info-overview-section > * { position: relative; z-index: 1; } /* Asegura contenido sobre patrón */


.info-overview-section h3 {
    color: #ffffff;
    margin-top: 0;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 0 15px rgba(255,255,255,0.1); /* Sombra de texto suave */
}
.section-description { /* Párrafo editable del admin */
    color: #c0c0c0;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px auto;
    font-size: 1.1rem;
    line-height: 1.7;
}


/* Info Cards Grid - TRAÍDAS DEL DISEÑO MODERNO, ADAPTADAS */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Tarjetas flexibles */
    gap: 30px; /* Espacio entre tarjetas */
    margin-bottom: 60px;
    justify-content: center;
}

.info-card-item {
    background-color: #11100f; /* Fondo oscuro para tarjetas de info */
    border-radius: 15px;
    padding: 35px 25px; /* Padding interno */
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5); /* Sombra para profundidad */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease; /* Transición suave */
    border: 1px solid #2a2a2a;
    position: relative;
    overflow: hidden;
}

.info-card-item::before { /* Efecto de brillo sutil en hover */
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(219, 129, 180, 0.05), rgba(52, 168, 83, 0.05));
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
}

.info-card-item:hover {
    transform: translateY(-8px); /* Levantamiento sutil */
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
    background-color: #1a1a1a; /* Fondo un poco más claro en hover */
}
.info-card-item:hover::before {
    opacity: 1;
}

.info-card-item .card-icon {
    font-size: 4rem; /* Iconos grandes */
    color: #db81b4; /* Rosado acento */
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(219, 129, 180, 0.4);
    z-index: 1;
}
.info-card-item .card-label {
    font-size: 1.1rem;
    color: #c0c0c0;
    margin-bottom: 8px;
    font-weight: 500;
    z-index: 1;
}
.info-card-item .card-value {
    font-size: 2.5rem; /* Valor prominente */
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 15px 0;
    z-index: 1;
}
.info-card-item .card-sub-info {
    font-size: 0.9rem;
    color: #9a9a9a;
    z-index: 1;
}


/* Info Buttons Main (grupo de enlaces de acción) */
.info-buttons-main {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 50px;
}

.info-button { /* General style for info buttons */
    background-color: transparent;
    color: #db81b4;
    padding: 14px 30px;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-weight: 500;
    font-size: 1.1rem;
    border: 1px solid #db81b4;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.info-button:hover {
    background-color: #db81b4;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(219, 129, 180, 0.4);
    border-color: #db81b4;
}

/* Colores específicos para los info-buttons (si se usan en el HTML) */
.primary-outline-button { /* Discord */
    border-color: #5865f2; color: #5865f2;
}
.primary-outline-button:hover {
    background-color: #5865f2; color: #fff; box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
}
.secondary-outline-button { /* View Excel Sheet */
    border-color: #34a853; color: #34a853;
}
.secondary-outline-button:hover {
    background-color: #34a853; color: #fff; box-shadow: 0 5px 15px rgba(52, 168, 83, 0.4);
}
.tertiary-outline-button { /* Rules, Twitch, YouTube, Instagram, Facebook */
    border-color: #e6007e; color: #e6007e; /* Rosado más oscuro */
}
.tertiary-outline-button:hover {
    background-color: #e6007e; color: #fff; box-shadow: 0 5px 15px rgba(230, 0, 126, 0.4);
}
.twitter-outline-button { /* Twitter */
    border-color: #1da1f2; color: #1da1f2;
}
.twitter-outline-button:hover {
    background-color: #1da1f2; color: #fff; box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
}


/* Common button styling (for buttons not specifically styled above) */
.button {
    display: inline-block;
    background-color: #db81b4;
    color: #ffffff;
    padding: 16px 35px;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.15rem;
    box-shadow: 0 4px 15px rgba(219, 129, 180, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.button:hover {
    background-color: #c0699c;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(219, 129, 180, 0.6);
}


/* Form Container (Registration Page) - Herencia general */
.form-container, .leaderboard-section, .rank-section {
    background-color: #1a1a1a; /* Fondo de la sección */
    padding: 50px;
    border-radius: 15px;
    margin-bottom: 50px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
}

.form-container h2, .leaderboard-section h2, .rank-section h2 {
    color: #ffffff;
    margin-top: 0;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Form Group styles */
.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #f0f0f0;
    font-size: 1.1rem;
}

.form-group input[type="text"],
.form-group textarea,
.form-group input[type="url"],
.form-group input[type="password"] {
    width: calc(100% - 30px);
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background-color: #0c0c0c;
    color: #f0f0f0;
    font-size: 1rem;
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.5);
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group input[type="url"]:focus,
.form-group input[type="password"]:focus {
    border-color: #db81b4;
    box-shadow: 0 0 0 2px rgba(219, 129, 180, 0.4);
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: #8a8a8a;
}


/* Botón de submit del formulario */
.form-container button[type="submit"] {
    background-color: #db81b4;
    color: #ffffff;
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(219, 129, 180, 0.4);
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 40px auto 25px auto;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-container button[type="submit"]:hover {
    background-color: #c0699c;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(219, 129, 180, 0.6);
}

/* Instrucciones de pago */
.payment-instructions {
    margin-top: 50px;
    padding: 40px;
    background-color: #11100f;
    border: 1px dashed #db81b4;
    border-radius: 12px;
    color: #f0f0f0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.payment-instructions h3 {
    color: #ffffff;
    margin-top: 0;
    font-size: 2.5rem;
    margin-bottom: 25px;
    font-weight: 600;
}

.payment-instructions p a {
    color: #db81b4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}
.payment-instructions p a:hover {
    color: #c0699c;
    text-decoration: underline;
}

/* Leaderboard Section */
.leaderboard-section {
    /* Styles inherited from .tournament-info-details */
}

/* Removed leaderboard-preview-section as per request */


.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 35px;
    gap: 20px;
    flex-wrap: wrap;
    background-color: #0c0c0c;
    border-radius: 12px;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}

.tab-button {
    background-color: transparent;
    color: #b0b0b0;
    padding: 15px 30px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    font-weight: 500;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
}

.tab-button:hover {
    background-color: #2a2a2a;
    color: #ffffff;
    border-color: #5a5a5a;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
}

.tab-button.active {
    background-color: #db81b4;
    border-color: #db81b4;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(219, 129, 180, 0.6);
    font-weight: 600;
}
.tab-button.active:hover {
    background-color: #c0699c;
    color: #ffffff;
}


/* Refresh Button for Leaderboard */
#refreshLeaderboard, #refreshLeaderboardPreview {
    background-color: #333333;
    color: #f0f0f0;
    padding: 14px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 30px;
    margin-bottom: 40px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

#refreshLeaderboard:hover, #refreshLeaderboardPreview:hover {
    background-color: #555555;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Mensaje de Última Actualización (estilo más discreto) */
#lastUpdatedMessage, #lastUpdatedMessagePreview {
    color: #8a8a8a;
    font-size: 0.95rem;
    margin-top: -30px;
    margin-bottom: 20px;
    text-align: center;
    background: none;
    border: none;
    box-shadow: none;
}


.leaderboard-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    margin-top: 40px;
    border-radius: 15px;
    background-color: #0c0c0c;
    padding: 30px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.7);
    border: 1px solid #1a1a1a;
}

#leaderboardTable, #leaderboardTablePreview {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    margin-top: 0;
    min-width: 1000px;
}

#leaderboardTable th, #leaderboardTable td,
#leaderboardTablePreview th, #leaderboardTablePreview td {
    border: none;
    padding: 18px 25px;
    text-align: center;
    color: #f0f0f0;
    font-size: 1rem;
    vertical-align: middle;
}

/* Encabezados de tabla */
#leaderboardTable th, #leaderboardTablePreview th {
    background-color: #1a1a1a;
    font-weight: 600;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #3a3a3a;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Esquinas redondeadas para encabezados de tabla */
#leaderboardTable thead th:first-child,
#leaderboardTablePreview thead th:first-child {
    border-top-left-radius: 10px;
}
#leaderboardTable thead th:last-child,
#leaderboardTablePreview thead th:last-child {
    border-top-right-radius: 10px;
}

/* Estilo base de filas */
#leaderboardTable tbody tr,
#leaderboardTablePreview tbody tr {
    border-radius: 10px;
    overflow: hidden;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#leaderboardTable tbody tr:nth-child(even),
#leaderboardTablePreview tbody tr:nth-child(even) {
    background-color: #1a1a1a;
}

#leaderboardTable tbody tr:nth-child(odd),
#leaderboardTablePreview tbody tr:nth-child(odd) {
    background-color: #0c0c0c;
}

#leaderboardTable tbody tr:hover,
#leaderboardTablePreview tbody tr:hover {
    background-color: #2a2a2a;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
}

/* Alineación específica para columnas de texto (Nombres) */
/* Columna de Rank (#1) siempre centrada */
#leaderboardTable:not(.detailed-table) td:nth-child(1),
#leaderboardTablePreview td:nth-child(1) {
    font-weight: 700;
    color: #db81b4;
    padding-right: 10px;
    padding-left: 30px;
    text-align: center;
}

/* Columna de Nombre de Equipo (segunda columna en Overall/Summary) */
#leaderboardTable:not(.detailed-table) th:nth-child(2),
#leaderboardTable:not(.detailed-table) td:nth-child(2),
#leaderboardTablePreview th:nth-child(2),
#leaderboardTablePreview td:nth-child(2) {
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    padding-left: 15px;
}

/* Columnas de Puntos por Mapa (3ª a 10ª columna en Overall/Summary) */
#leaderboardTable:not(.detailed-table) td:nth-child(n+3):nth-child(-n+10),
#leaderboardTablePreview td:nth-child(n+3):nth-child(-n+10) {
    color: #b0b0b0;
    font-size: 0.95rem;
    text-align: center;
}

/* Columna de Puntuación Total (11ª columna en Overall/Summary) */
#leaderboardTable:not(.detailed-table) td:nth-child(11),
#leaderboardTablePreview td:nth-child(11) {
    font-weight: 700;
    color: #34a853;
    text-align: right;
    padding-left: 20px;
    padding-right: 30px;
}

/* --- ESTILOS ESPECÍFICOS PARA LA TABLA DETALLADA (#leaderboardTable.detailed-table) --- */
/* Los estilos generales de th/td aplicarán primero, luego estos los sobrescribirán según necesidad */

/* Encabezados de tabla detallada */
#leaderboardTable.detailed-table th {
    text-align: center;
}
#leaderboardTable.detailed-table th:nth-child(1) {
    text-align: left;
}

/* Filas de la tabla detallada */
#leaderboardTable.detailed-table .team-header-row {
    background-color: #db81b4;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 3px solid #c0699c;
    box-shadow: 0 2px 8px rgba(219, 129, 180, 0.3);
    border-radius: 8px 8px 0 0;
}

#leaderboardTable.detailed-table .team-header-row td {
    padding-top: 20px;
    padding-bottom: 15px;
    background-color: inherit;
    color: inherit;
    text-align: left;
}
#leaderboardTable.detailed-table .team-header-row td:first-child {
    padding-left: 20px;
}

#leaderboardTable.detailed-table .player-row {
    background-color: #1a1a1a;
    font-size: 1rem;
    border-bottom: 1px solid #2a2a2a;
}
#leaderboardTable.detailed-table .player-row:hover {
    background-color: #2a2a2a;
    transform: none;
    box-shadow: none;
}
#leaderboardTable.detailed-table .player-row td:nth-child(1) {
    padding-left: 40px;
    font-weight: 500;
    color: #e6e6e6;
    text-align: left;
}


#leaderboardTable.detailed-table .team-summary-row {
    background-color: #2a2a2a;
    font-weight: 600;
    color: #ffffff;
    border-top: 1px dashed #3a3a3a;
    border-bottom: 2px solid #db81b4;
    border-radius: 0 0 8px 8px;
}
#leaderboardTable.detailed-table .team-summary-row td {
    padding-top: 12px;
    padding-bottom: 12px;
    background-color: inherit;
    color: inherit;
    text-align: center;
}
#leaderboardTable.detailed-table .team-summary-row td:nth-child(1) {
    text-align: left;
    font-weight: 700;
    color: #ff6000;
}

/* Columnas de estadísticas en tabla detallada */
/* Name (S - 1st child), Game1(T - 2nd), Game2(U - 3rd) ... Game8(AA - 9th), Overall Stats(AB - 10th), Total Kills(AC - 11th) */
#leaderboardTable.detailed-table td:nth-child(n+2):nth-child(-n+9) {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-align: center;
    min-width: 75px;
}

#leaderboardTable.detailed-table td:nth-child(10),
#leaderboardTable.detailed-table td:nth-child(11) {
    font-weight: 600;
    color: #db81b4;
    text-align: right;
    padding-right: 25px;
    padding-left: 15px;
    min-width: 120px;
}

#leaderboardTable.detailed-table .team-summary-row td:nth-child(10),
#leaderboardTable.detailed-table .team-summary-row td:nth-child(11) {
    color: #34a853;
    font-weight: 700;
}


/* Mensajes (Loading, Success, Error, Info) */
.message {
    margin-top: 25px;
    padding: 20px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.message.success {
    background-color: #28a745;
    color: #fff;
    border-color: #218838;
}

.message.error {
    background-color: #dc3545;
    color: #fff;
    border-color: #c82333;
}

.message.info {
    background-color: #17a2b8;
    color: #fff;
    border-color: #138496;
}

.view-full-leaderboard {
    margin-top: 35px;
    background-color: #333333;
    color: #f0f0f0;
    border: 1px solid #555555;
    border-radius: 50px;
    padding: 14px 30px;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.view-full-leaderboard:hover {
    background-color: #555555;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background-color: #0a0a0a;
    color: #888;
    margin-top: 50px;
    font-size: 0.9rem;
    border-top: 1px solid #1a1a1a;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    main {
        padding: 30px;
    }
    .hero-section {
        padding: 40px 20px;
    }
    .tournament-title {
        font-size: 3rem;
    }
    .tournament-subtitle {
        font-size: 1.5rem;
    }
    .info-cards-section {
        gap: 20px;
    }
    .info-card {
        padding: 25px;
    }
    .card-icon {
        font-size: 3rem;
    }
    .card-value {
        font-size: 2rem;
    }
    .tournament-info-details, .form-container, .leaderboard-section, .rank-section {
        padding: 30px;
    }
    .tournament-info-details h3, .form-container h2, .leaderboard-section h2, .rank-section h2 {
        font-size: 2.2rem;
    }
    /* CORRECCIÓN: rank-grid-container para pantallas medianas */
    .rank-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas para tablets */
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem 15px;
        text-align: center;
    }
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }
    nav ul {
        margin-top: 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    nav ul li {
        margin: 0;
    }
    #lang-switcher {
        position: static;
        margin-top: 15px;
        justify-content: center;
    }
    main {
        padding: 20px;
        margin: 15px auto;
    }
    .hero-section {
        padding: 30px 15px;
    }
    .tournament-title {
        font-size: 2.5rem;
    }
    .tournament-subtitle {
        font-size: 1.3rem;
    }
    .hero-actions {
        flex-direction: column;
        gap: 15px;
    }
    .action-button {
        width: 90%;
        max-width: 350px;
    }
    .info-cards-section {
        grid-template-columns: 1fr;
    }
    .info-card {
        padding: 20px;
    }
    .card-icon {
        font-size: 2.8rem;
    }
    .card-value {
        font-size: 1.8rem;
    }
    .tournament-info-details, .form-container, .leaderboard-section, .rank-section {
        padding: 25px;
    }
    .tournament-info-details h3, .form-container h2, .leaderboard-section h2, .rank-section h2 {
        font-size: 2rem;
    }
    .info-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .info-button {
        width: 90%;
        max-width: 350px;
    }
    .form-group input[type="text"],
    .form-group textarea {
        padding: 10px;
        font-size: 0.95rem;
    }
    .form-container button[type="submit"] {
        padding: 12px 25px;
        font-size: 1rem;
    }
    .payment-instructions {
        padding: 20px;
    }
    .payment-instructions h3 {
        font-size: 1.6rem;
    }
    .tabs {
        gap: 10px;
        padding: 8px;
    }
    .tab-button {
        padding: 10px 15px;
        font-size: 0.95rem;
        min-width: unset;
    }
    #refreshLeaderboard, #refreshLeaderboardPreview {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    .leaderboard-table-container {
        padding: 15px;
    }
    #leaderboardTable th, #leaderboardTable td,
    #leaderboardTablePreview th, #leaderboardTablePreview td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    .view-full-leaderboard {
        padding: 12px 25px;
        font-size: 1rem;
    }
    footer {
        padding: 20px;
    }
    /* CORRECCIÓN: rank-grid-container para móviles */
    .rank-grid-container {
        grid-template-columns: 1fr; /* 1 columna para móviles */
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .tournament-title {
        font-size: 2rem;
    }
    .tournament-subtitle {
        font-size: 1.1rem;
    }
    .action-button, .info-button, .form-container button[type="submit"], .view-full-leaderboard {
        width: 100%;
        max-width: 280px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .info-cards-section, .info-buttons {
        gap: 15px;
    }
    .rank-grid-container {
        grid-template-columns: 1fr; /* Asegura 1 columna incluso en pantallas muy pequeñas */
    }
}

/* Admin Toggle Switch Specific Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-left: 10px;
    vertical-align: middle;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #db81b4;
}
input:focus + .slider {
    box-shadow: 0 0 1px #db81b4;
}
input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}
.auto-fetch-status {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-top: 5px;
}

/* ALINEACIÓN GLOBAL DE CELDAS (PARA TODAS LAS TABLAS) */
#leaderboardTable th,
#leaderboardTable td,
#leaderboardTablePreview th,
#leaderboardTablePreview td,
#fullRankTable th,
#fullRankTable td {
    text-align: center;
}

/* Excepciones para encabezados y celdas que contienen nombres (alinear a la izquierda) */
/* En leaderboard.html y index.html, la columna B (segunda) es el nombre del equipo */
#leaderboardTable:not(.detailed-table) th:nth-child(2),
#leaderboardTablePreview th:nth-child(2),
#leaderboardTable.detailed-table th:nth-child(1),
#fullRankTable th:nth-child(1) {
    text-align: left;
}

#leaderboardTable:not(.detailed-table) td:nth-child(2),
#leaderboardTablePreview td:nth-child(2),
#leaderboardTable.detailed-table td:nth-child(1),
#fullRankTable td:nth-child(1) {
    text-align: left;
}

/* Adjust padding for first and last columns for better visualization */
#leaderboardTable th:first-child,
#leaderboardTablePreview th:first-child,
#leaderboardTable td:first-child,
#leaderboardTablePreview td:first-child,
#fullRankTable th:first-child,
#fullRankTable td:first-child {
    padding-left: 25px;
}

#leaderboardTable th:last-child,
#leaderboardTablePreview th:last-child,
#leaderboardTable td:last-child,
#leaderboardTablePreview td:last-child,
#fullRankTable th:last-child,
#fullRankTable td:last-child {
    padding-right: 25px;
}

/* Rank specific styles */
.rank-section .rank-result {
    padding: 20px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.rank-result.PRO, .rank-player-entry.PRO { background-color: #dc3545; } /* Red */
.rank-result.AM, .rank-player-entry.AM { background-color: #17a2b8; } /* Blue */
.rank-result.DETRI, .rank-player-entry.DETRI { background-color: #28a745; } /* Green */
.rank-result.NEWBI, .rank-player-entry.NEWBI { background-color: #6c757d; } /* Gray */
.rank-player-entry.no-players { /* Style for "No players" message in column */
    background-color: #2a2a2a;
    color: #b0b0b0;
    font-style: italic;
    font-size: 0.9rem;
    padding: 10px;
}


.rank-form {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.rank-form input {
    width: 300px;
    max-width: 70%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #3a3a3a;
    background-color: #0c0c0c;
    color: #f0f0f0;
}

.rank-form button {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    background-color: #db81b4;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.rank-form button:hover {
    background-color: #c0699c;
}

/* Checkbox group styles for registration */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px; /* Más padding para que se vea el highlight */
    border: 2px solid transparent; /* Borde por defecto transparente */
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.checkbox-group.error-highlight {
    border-color: #dc3545; /* Borde rojo en error */
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.6); /* Resplandor rojo */
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    accent-color: #db81b4;
    transform: scale(1.1); /* Ligeramente más grande */
}
.checkbox-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(219, 129, 180, 0.4); /* Anillo de foco al checkbox */
}

.checkbox-group label {
    margin-bottom: 0; font-size: 1rem; color: #e6e6e6;
}
.checkbox-group label a {
    color: #db81b4; text-decoration: underline; transition: color 0.3s ease;
}
.checkbox-group label a:hover {
    color: #c0699c; text-decoration: underline;
}

/* New styles for the 4-column rank display */
.rank-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns, equal width */
    gap: 20px; /* Space between grid items */
    margin-top: 30px;
    padding: 20px;
    background-color: #0c0c0c;
    border-radius: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.7);
}

.rank-column {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Space between players in a column */
    background-color: #1a1a1a; /* Slightly lighter background for the column itself */
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.rank-column h4 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3a3a;
}

.rank-player-entry {
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default; /* Not clickable */
}

.rank-player-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Specific colors are defined via the .PRO, .AM, .DETRI, .NEWBI classes */
/* These also apply to rank-player-entry */

/* Removed the specific #fullRankTable styles as it's no longer a traditional table */
#fullRankTable { /* Hide the old table element, it's no longer used for rendering */
    display: none;
}
/* Estilos específicos para la página OBS Fraggers */
.obs-body {
    background-color: transparent; /* Fondo transparente para OBS */
    font-family: 'Poppins', sans-serif;
    color: #e6e6e6; /* Color de texto predeterminado */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinea arriba para OBS */
    min-height: 100vh; /* Asegura que ocupe al menos la altura de la vista */
    padding: 20px; /* Algo de padding para que no esté pegado al borde */
    overflow: hidden; /* Evita barras de scroll en OBS */
}

.obs-table-container {
    background-color: rgba(13, 12, 11, 0.8); /* Fondo semi-transparente y oscuro */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    width: fit-content; /* Se ajusta al contenido */
    max-width: 100%;
    margin: 0; /* Asegura que no haya márgenes que afecten el posicionamiento */
}

.obs-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #db81b4; /* Rosado acento */
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 8px rgba(219, 129, 180, 0.5);
}

.obs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Espacio entre filas */
}

.obs-table th, .obs-table td {
    padding: 10px 15px;
    text-align: left;
    font-size: 1rem;
    border: none;
}

.obs-table th {
    background-color: rgba(26, 26, 26, 0.9); /* Encabezado semi-transparente */
    color: #b0b0b0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky; /* Sticky header para la tabla OBS también */
    top: 0;
    z-index: 1;
}

.obs-table tbody tr {
    background-color: rgba(29, 27, 26, 0.7); /* Filas semi-transparentes */
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.obs-table tbody tr:hover {
    background-color: rgba(29, 27, 26, 0.9); /* Más opaco en hover */
}

.obs-table td {
    color: #f0f0f0;
}

.obs-table td:nth-child(1) { /* Columna de Rango */
    font-weight: 700;
    color: #00ffff; /* Cian neón para Rank */
}
.obs-table td:nth-child(2) { /* Columna de Jugador */
    font-weight: 500;
}
.obs-table td:nth-child(3) { /* Columna de Kills */
    font-weight: 600;
    color: #ffe740; /* Amarillo neón para Kills */
}

.obs-message {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 15px;
}
.obs-message.info { color: #00ffff; }
.obs-message.success { color: #34a853; }
.obs-message.error { color: #dc3545; }

/* REGLAS PARA LA VISTA MÓVIL DE RANGOS - CORREGIDAS */
@media (max-width: 1024px) {
    /* Aquí se aplican los estilos SÓLO para rank.html si main tiene padding por defecto */
    /* El rank-grid-container es afectado por el padding del main y se adapta a 2fr para tablets */
    .rank-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas para tablets */
        gap: 15px;
        padding: 15px;
    }

    .rank-column {
        width: 100%;
        margin: 0;
    }

    .rank-column h4 {
        font-size: 1.5rem;
    }

    .rank-player-entry {
        font-size: 1rem;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    /* Para móviles más pequeños, volvemos a 1 columna */
    .rank-grid-container {
        grid-template-columns: 1fr; /* 1 columna para móviles */
        gap: 15px;
        padding: 15px;
    }
}

/* Reglas adicionales para móviles muy pequeños (si es necesario, ya cubierto por 768px) */
@media (max-width: 480px) {
    /* Si necesitas ajustes específicos aquí para rank-grid-container, puedes agregarlos. */
    /* Por ahora, la regla de 768px ya establece 1fr */
}