:root {
    --green: #08783d;
    --green-dark: #04552c;
    --green-light: #e9f5ee;
    --white: #ffffff;
    --black: #101010;
    --gray: #6b6b6b;
    --light-gray: #f4f5f4;
    --border: #e2e6e3;
    --ascend-bg: #d3f4cc;
    --descend-bg: #f1c9b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
    color: var(--black);
    line-height: 1.6;
    padding-bottom: 70px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================
   HEADER
   ========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 3px solid var(--green);
}

.header-inner {
    height: 72px;
    padding: 8px 18px;
    background-color: #006600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-ke img {
    max-height: 40px;
    width: auto;
}

.menu-button {
    width: 44px;
    height: 44px;
    background: var(--green);
    border: 0;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.menu-button span {
    width: 22px;
    height: 2px;
    background: white;
    transition: .2s;
}

.menu-button.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-button.active span:nth-child(2) {
    opacity: 0;
}

.menu-button.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    background: var(--green-dark);
}

.mobile-menu.open {
    display: flex;
    flex-direction: column;
}

.mobile-menu a {
    color: white;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    font-weight: bold;
}

.menu-secondary {
    background: rgba(0, 0, 0, 0.15);
}

/* =========================
   SECCIÓN RESULTADOS Y CLASIFICACIÓN
   ========================= */

.section {
    padding: 20px 12px;
    max-width: 800px;
    margin: 0 auto;
}

#resultados_cont {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,.04);
}

.torneo-intro h2 {
    color: #006600;
    font-size: 22px;
    text-align: center;
    margin-bottom: 12px;
    font-family: 'Montserrat', sans-serif;
}

.torneo-img-container {
    text-align: center;
    margin-bottom: 15px;
}

.torneo-img-container img {
    border-radius: 6px;
    max-height: 300px;
    object-fit: contain;
}

.torneo-intro p {
    margin-bottom: 15px;
    text-align: justify;
    font-size: 14px;
}

.torneo-subtitulo {
    font-size: 16px;
    color: var(--green-dark);
    margin: 20px 0 10px 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-align: center;
}

.torneo-texto-espaciado {
    margin: 20px 0 10px 0;
}

/* --- TABLAS MODERNAS PARA TORNEOS --- */
.tabla-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 15px;
}

.torneo-tabla {
    width: 100%;
    border-collapse: collapse;
    background: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
    border: 1px solid var(--border);
    text-align: center;
}

.torneo-tabla th {
    background-color: var(--green);
    color: white;
    padding: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
}

.torneo-tabla td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--black);
}

.torneo-tabla tr:last-child td {
    border-bottom: none;
}

.torneo-tabla tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.liga-logo {
    text-align: center;
    margin-bottom: 15px;
}

.tablas-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* --- ESTILOS MODERNOS PARA LA PLANTILLA --- */
.plantilla-card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.plantilla-header {
    background-color: var(--green-dark);
    color: white;
    text-align: center;
    font-size: 15px;
    padding: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.plantilla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 15px;
}

.jugador-item {
    background: var(--light-gray);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.jugador-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}

.jugador-num {
    font-size: 12px;
    font-weight: bold;
    text-align: left;
    width: 100%;
    color: var(--black);
}

.jugador-pos {
    font-size: 11px;
    color: var(--gray);
    text-align: center;
    margin-top: 2px;
}

/* Tablas Jornadas */
.jornadas-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tbljornada {
    width: 100%;
    border-collapse: collapse;
    background: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
    border: 1px solid var(--border);
}

.tbljornada th {
    background-color: var(--green);
    color: white;
    padding: 10px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.tbljornada th h3 {
    font-size: 14px;
    margin: 0;
    color: white;
}

.tbljornada td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
}

.tbljornada tr:last-child td {
    border-bottom: none;
}

/* =========================
   FOOTER
   ========================= */

.footer {
    background: #073b21;
    color: white;
    text-align: center;
    padding: 35px 20px 70px;
}

.footer .footer-logo {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.footer p {
    margin-top: 4px;
    font-size: 12px;
    opacity: .7;
}

.footer-publicidad {
    margin: 20px 0;
}

.footer-publicidad span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    display: block;
    margin-bottom: 8px;
}

.footer-sponsors-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.publicidad2 img {
    max-height: 40px;
    object-fit: contain;
}

.social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.social a {
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.footer-bottom {
    margin-top: 20px;
    font-size: 11px;
    opacity: 0.6;
}

/* =========================
   RESPONSIVE MÓVIL (Vista tipo app)
   ========================= */

@media (min-width: 700px) {
    body {
        max-width: 480px;
        margin: auto;
        box-shadow: 0 0 30px rgba(0,0,0,.12);
    }

    .header {
        max-width: 480px;
        margin: 0 auto;
    }
}