/* ------------------------------ */
/* GLOBAL BASE STYLES             */
/* ------------------------------ */

body {
    text-align: center;
    background-color: black;
    color: white;
    margin: 0;
    overflow-x: hidden;
}

/* Header */
header {
    display: flex;
    align-items: center;
    border-bottom: 3px solid darkgreen;
    padding: 10px 20px;
    background-color: black;
    position: sticky;
    top: 0;
    z-index: 50;
}

header img {
    height: 50px;
}

nav {
    margin-left: auto;
    display: flex;
    gap: 40px;
}

a {
    text-decoration: none;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

a:hover {
    color: lime;
}

/* Panel wrapper */
.panel {
    background: linear-gradient(to bottom, #013220, #006400);
    padding: 30px;
    border-radius: 20px;
    margin: 20px;
    color: black;
}

/* ------------------------------ */
/* LEAGUE TABLE WRAPPER           */
/* ------------------------------ */

.league-wrapper {
    max-width: 1100px;
    margin: 0 auto;
}

/* Table base */
#league-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 15px;
    background: transparent;
    table-layout: fixed;
}

/* Header row */
#league-table thead th {
    background-color: black;
    color: white;
    padding: 10px 6px;
    text-align: center;
    font-weight: bold;
    border-bottom: 3px solid white;
    position: sticky;
    top: 60px;
    z-index: 40;
    height: 40px;
}

/* Table rows */
#league-table tbody tr {
    transition: background-color 0.15s ease;
}

#league-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

#league-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Table cells */
#league-table td {
    padding: 8px 6px;
    color: white;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Position column */
.col-pos {
    font-weight: bold;
    width: 40px;
}

/* TEAM COLUMN — FIXED WIDTH */
.col-team {
    text-align: left !important;
    font-weight: 600;
    width: 240px;
    max-width: 240px;
    min-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Team logo */
.team-logo {
    height: 18px;
    width: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ------------------------------ */
/* FORM COLUMN                    */
/* ------------------------------ */

.col-form {
    text-align: center !important;
    width: 90px;
    max-width: 90px;
    min-width: 90px;
}

.form-track {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.form-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.form-win { background-color: #00c853; }
.form-draw { background-color: #9e9e9e; }
.form-loss { background-color: #d50000; }

/* ------------------------------ */
/* UCL / UEL / RELEGATION TABS    */
/* ------------------------------ */

#league-table tbody tr.ucl td.col-pos { border-left: 4px solid #00b2ff; }
#league-table tbody tr.uel td.col-pos { border-left: 4px solid #ffd700; }
#league-table tbody tr.rel td.col-pos { border-left: 4px solid #ff4b4b; }

/* ------------------------------ */
/* LEAGUE KEY                     */
/* ------------------------------ */

.league-key {
    margin-top: 12px;
    color: white;
    font-size: 13px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.key-tab {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    display: inline-block;
}

.key-ucl { background-color: #00b2ff; }
.key-uel { background-color: #ffd700; }
.key-rel { background-color: #ff4b4b; }

/* ------------------------------ */
/* RESPONSIVE COLUMN ORDER        */
/* ------------------------------ */

/* 1 — HIDE FORM FIRST */
@media (max-width: 950px) {
    .col-form, th.col-form { display: none; }
}

/* 2 — THEN HIDE GF GA GD */
@media (max-width: 850px) {
    .col-gf, .col-ga, .col-gd,
    th.col-gf, th.col-ga, th.col-gd { display: none; }
}

/* 3 — THEN HIDE D + L */
@media (max-width: 750px) {
    .col-d, .col-l,
    th.col-d, th.col-l { display: none; }
}

/* 4 — THEN HIDE W */
@media (max-width: 650px) {
    .col-w, th.col-w { display: none; }
}
