/* ============================================================
   Competition hub — extends main.css. Site design language:
   Courier, flat squares, navy #2c3e50 / #34495e, blue #3498db.
   Section conventions mirror the World Cup hub.
   ============================================================ */

/* === TOP BAR (title + picker/follow controls) === */
.comp-header {
    background: #fff;
    border: 1px solid #ddd;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
}
.comp-head-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.comp-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}
.comp-state {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    padding: 0.25rem 0.5rem;
}
.comp-state[hidden] { display: none; }
.comp-state.active { background: #27ae60; }
.comp-state.upcoming { background: #3498db; }
.comp-state.offseason, .comp-state.concluded { background: #7f8c8d; }

/* Season label chip — which season the whole page is showing (never ambiguous). */
.comp-season {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.2rem 0.5rem;
}
.comp-season[hidden] { display: none; }

.comp-controls { display: flex; gap: 0.5rem; }
.comp-picker {
    background: #34495e;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 44px;
}
.comp-picker option { text-transform: uppercase; }
.comp-follow {
    background: #34495e;
    color: #fff;
    border: none;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.15rem;
    cursor: pointer;
    font-family: inherit;
}
.comp-follow:hover { background: #3498db; }
.comp-follow.on { color: #d4af37; }

/* === OFF-SEASON POINTER === */
.comp-livenow {
    background: #fff;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
}
.comp-livenow a { color: #3498db; font-weight: 700; text-decoration: none; }
.comp-livenow a:hover { text-decoration: underline; }

/* === FORMAT EXPLAINER === */
.comp-explainer {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 3px solid #3498db;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.comp-explainer h3 {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #2c3e50;
}
.comp-explainer p { margin: 0; color: #333; }

/* === SECTIONS (white bar head, uppercase letterspaced title) === */
.comp-sec { margin-top: 2rem; margin-bottom: 1rem; }
.comp-sec-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
}
.comp-sec-head h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}
.comp-subhead {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
    margin: 1.25rem 0 0.5rem;
}

/* === STANDINGS TABLE (navy thead + cell borders come from main.css) === */
table.comp-table { width: 100%; border-collapse: collapse; }
.comp-table th, .comp-table td { text-align: center; }
.comp-table th.l, .comp-table td.team { text-align: left; }
.comp-table td.team { font-weight: 600; }
.comp-table td.team img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
}
.comp-table td.pts { font-weight: 700; background: #ecf0f1; }

/* === FIXTURES / LEADERBOARD ROWS === */
.comp-fix {
    background: #fff;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.comp-fix .side {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    font-weight: 600;
}
.comp-fix .side.away { justify-content: flex-end; text-align: right; }
.comp-fix img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.comp-fix .sc { font-weight: 700; font-size: 1rem; padding: 0 0.75rem; white-space: nowrap; }
.comp-fix .dt {
    font-size: 0.8rem;
    color: #666;
    font-weight: 700;
    padding: 0 0.75rem;
    white-space: nowrap;
}

/* === KNOCKOUT BRACKET === */
.comp-round { margin-bottom: 1.25rem; }
.comp-round-h {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 0.5rem;
}
.comp-ties {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 0.5rem;
}
.comp-tie { background: #fff; border: 1px solid #ddd; }
.comp-tie-side {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}
.comp-tie-side + .comp-tie-side { border-top: 1px solid #eee; }
.comp-tie-side img { width: 20px; height: 20px; object-fit: contain; }
.comp-tie-side .nm {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comp-tie-side .agg { font-weight: 700; font-variant-numeric: tabular-nums; }
.comp-tie-side.win { background: #f8f9fa; font-weight: 700; }
.comp-tie-side.win .agg { color: #27ae60; }
.comp-tie-legs {
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.4rem 0.75rem;
    border-top: 1px dashed #ddd;
}

/* === EMPTY / LOADING STATES === */
.comp-empty {
    background: #fff;
    border: 1px solid #ddd;
    padding: 1.5rem;
    text-align: center;
    color: #999;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* === RESPONSIVE === */
@media (max-width: 968px) {
    .comp-header { flex-direction: column; align-items: stretch; text-align: center; }
    .comp-head-left { justify-content: center; }
    .comp-controls { justify-content: center; }
}
@media (max-width: 600px) {
    .comp-title { font-size: 1.2rem; }
    .comp-controls { width: 100%; }
    .comp-picker { flex: 1; min-width: 0; }
    .comp-sec-head h2 { font-size: 0.95rem; }
    .comp-fix .side span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
