/* FCOS public tournament hub (Module 14 step 6) */

.fcos-tournament-hub [hidden] {
    display: none !important;
}

.fcos-tournament-hub {
    margin: 0 0 2rem;
}

.fcos-tournament-hub-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fcos-tournament-hub-intro {
    width: 100%;
    text-align: center;
}

.fcos-tournament-hub-header-event-logo-link {
    display: block;
    width: fit-content;
    margin: 0 auto 0.5rem;
    text-decoration: none;
}

.fcos-tournament-hub-header-event-logo-link .fcos-tournament-hub-header-event-logo {
    margin-bottom: 0;
}

.fcos-tournament-hub-header-event-logo {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
}

.fcos-tournament-hub-dates {
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.fcos-tournament-hub-home-info {
    text-align: center;
    margin-bottom: 1rem;
}

.fcos-tournament-hub-venue {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.fcos-tournament-hub-venue a {
    text-decoration: none;
}

.fcos-tournament-hub-venue a:hover {
    text-decoration: underline;
}

.fcos-tournament-hub-traits {
    margin: 0.35rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.fcos-tournament-hub-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.fcos-tournament-hub-club-logo,
.fcos-tournament-hub-event-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    background: transparent;
}

.fcos-tournament-hub-landing {
    margin-bottom: 0.5rem;
    text-align: center;
}

.fcos-tournament-hub-landing .fcos-tournament-hub-logos {
    justify-content: center;
}

.fcos-tournament-hub-registration {
    margin: 1rem 0;
    text-align: center;
}

.fcos-tournament-hub-register-btn {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    border-radius: 0.35rem;
    background: #1e3a5f;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.fcos-tournament-hub-register-btn:hover {
    background: #152a45;
    color: #fff;
}

.fcos-tournament-hub-sponsors {
    text-align: center;
}

.fcos-tournament-sponsor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.fcos-tournament-sponsor-logo {
    max-height: 56px;
    max-width: 140px;
    object-fit: contain;
    background: transparent;
}

.fcos-tournament-sponsor-link {
    display: inline-flex;
    align-items: center;
}

.fcos-tournament-fixture-section + .fcos-tournament-fixture-section {
    margin-top: 1.25rem;
}

.fcos-tournament-hub-bracket {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.fcos-tournament-bracket-round-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}

/* Traditional columnar knockout bracket (Cup, then Plate). */
.fcos-bracket-tree {
    --fcos-bracket-line: #cbd5e1;
    --fcos-bracket-gap: 2rem;
    margin-top: 0.5rem;
}

.fcos-bracket-tree + .fcos-bracket-tree {
    margin-top: 1.75rem;
}

.fcos-bracket-tree-title {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.fcos-bracket-scroll {
    overflow-x: auto;
    /* Smooth finger swiping across the bracket on touch devices. */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 0.5rem;
}

.fcos-bracket-flow {
    display: flex;
    align-items: stretch;
    min-width: min-content;
}

.fcos-bracket-round {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 180px;
}

.fcos-bracket-round:not(:last-child) {
    margin-right: var(--fcos-bracket-gap);
}

.fcos-bracket-round-head {
    height: 1.6rem;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    text-align: center;
}

.fcos-bracket-matches {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.fcos-bracket-match {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    padding: 0.4rem 0;
}

/*
 * Connectors form a clean H-bracket in the gap between columns:
 *   feeder ─┐
 *          ├─ next
 *   feeder ─┘
 * Each feeder draws an elbow (horizontal arm + half the vertical bar) on ::after;
 * the next-round match draws the short incoming stub on ::before. Using separate
 * pseudo-elements avoids any clash for middle rounds that both feed and receive.
 */
.fcos-bracket-round:not(:last-child) .fcos-bracket-match::after {
    content: "";
    position: absolute;
    left: 100%;
    width: calc(var(--fcos-bracket-gap) / 2);
    border-right: 2px solid var(--fcos-bracket-line);
}

/* Top match of a pair: arm at its centre, bar drops down to the pair midpoint. */
.fcos-bracket-round:not(:last-child) .fcos-bracket-match:nth-child(odd)::after {
    top: 50%;
    height: 50%;
    border-top: 2px solid var(--fcos-bracket-line);
}

/* Bottom match of a pair: arm at its centre, bar rises up to the pair midpoint. */
.fcos-bracket-round:not(:last-child) .fcos-bracket-match:nth-child(even)::after {
    top: 0;
    height: 50%;
    border-bottom: 2px solid var(--fcos-bracket-line);
}

/* Incoming stub from the pair's vertical bar into the next match's left centre. */
.fcos-bracket-round:not(:first-child) .fcos-bracket-match::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: calc(var(--fcos-bracket-gap) / 2);
    height: 2px;
    background: var(--fcos-bracket-line);
}

.fcos-bracket-card {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.fcos-bracket-card.is-live {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #dc2626 inset;
}

.fcos-bracket-team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.45rem;
}

.fcos-bracket-team + .fcos-bracket-team {
    border-top: 1px solid #f1f5f9;
}

.fcos-bracket-team-badge {
    flex: 0 0 auto;
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.fcos-bracket-team-badge .fcos-tournament-team-badge-thumb {
    width: 18px;
    height: 18px;
}

.fcos-bracket-team-name {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Score group kept together and pushed to the right edge of the row. */
.fcos-bracket-team-scores {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fcos-bracket-team-score {
    flex: 0 0 auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Penalty-shootout tally shown before the full-time score, e.g. "(4)". */
.fcos-bracket-team-pens {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #64748b;
}

.fcos-bracket-team-pens::before {
    content: "(";
}

.fcos-bracket-team-pens::after {
    content: ")";
}

.fcos-bracket-team.is-winner .fcos-bracket-team-pens {
    color: #16a34a;
}

.fcos-bracket-decider {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.fcos-bracket-team.is-winner {
    background: #f0fdf4;
    font-weight: 700;
}

.fcos-bracket-team.is-winner .fcos-bracket-team-score {
    color: #16a34a;
}

/*
 * Followed team on the bracket: a small star just after the team name rather
 * than a background tint, so it never competes with the green "winner"
 * highlight. order:1 places it between the name (0) and the scores (2).
 */
.fcos-bracket-team.is-favourite-team::after {
    content: "\2605"; /* ★ */
    order: 1;
    flex: 0 0 auto;
    margin-left: 0.25rem;
    color: #f59e0b;
    font-size: 0.8rem;
    line-height: 1;
}

.fcos-bracket-meta {
    padding: 0.25rem 0.45rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.72rem;
    color: #64748b;
    text-align: center;
}

.fcos-bracket-thirdplace {
    max-width: 220px;
    margin-top: 1rem;
}

.fcos-bracket-thirdplace .fcos-bracket-round-head {
    text-align: left;
}

/*
 * On phones the bracket keeps its horizontal tree (with joining lines) and is
 * swiped left/right with a finger; the scroll container handles the overflow.
 * Slightly narrower columns fit more of the tree on small screens.
 */
@media (max-width: 640px) {
    .fcos-bracket-tree {
        --fcos-bracket-gap: 1.4rem;
    }

    .fcos-bracket-round {
        width: 150px;
    }
}

.fcos-tournament-hub-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    line-height: 1.2;
}

.fcos-tournament-hub-description {
    margin: 0 0 0.5rem;
}

.fcos-tournament-hub-meta {
    margin: 0;
    font-size: 0.9375rem;
}

.fcos-tournament-hub-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 0 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.fcos-tournament-hub-tab {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    color: #1e3a5f;
    font-weight: 600;
    font-size: 0.9375rem;
}

.fcos-tournament-hub-tab.is-active,
.fcos-tournament-hub-tab:hover {
    background: #1e3a5f;
    color: #fff;
}

.fcos-tournament-hub-subheading {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.05rem;
}

.fcos-tournament-hub-subheading:first-child {
    margin-top: 0;
}

.fcos-tournament-fixture-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fcos-tournament-fixture-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.45;
}

.fcos-tournament-fixture-item:last-child {
    border-bottom: 0;
}

.fcos-tournament-fixture-live {
    background: #fff8eb;
    margin: 0 -0.5rem;
    padding: 0.55rem 0.5rem;
    border-radius: 0.35rem;
}

.fcos-tournament-fixture-live-badge {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fcos-tournament-fixture-result {
    font-weight: 700;
    color: #1e3a5f;
}

.fcos-tournament-fixture-list:not(.fcos-tournament-result-list) {
    max-width: 40rem;
    margin: 0 auto;
}

.fcos-tournament-fixture-list:not(.fcos-tournament-result-list) .fcos-tournament-fixture-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fcos-tournament-fixture-matchup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.15rem;
    width: 100%;
    flex: 1 1 16rem;
}

.fcos-tournament-fixture-side-home {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    text-align: right;
}

.fcos-tournament-fixture-side-away {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
    text-align: left;
}

.fcos-tournament-fixture-day {
    font-weight: 600;
    color: #475569;
}

.fcos-tournament-fixture-matchup .fcos-tournament-fixture-pitch {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.2;
    text-align: center;
}

.fcos-tournament-fixture-kickoff-time {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #1e3a5f;
    white-space: nowrap;
    line-height: 1.2;
}

.fcos-tournament-result-list {
    max-width: 40rem;
    margin: 0 auto;
}

.fcos-tournament-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fcos-tournament-result-decider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    margin-top: 0.25rem;
    text-align: center;
}

.fcos-tournament-result-aet {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.fcos-tournament-result-pens {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.fcos-tournament-result-matchup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.75rem;
    width: 100%;
}

.fcos-tournament-result-side-home {
    justify-self: end;
    text-align: right;
}

.fcos-tournament-result-side-away {
    justify-self: start;
    text-align: left;
}

.fcos-tournament-result-scores {
    display: grid;
    grid-template-columns: 3.25rem 2px 3.25rem;
    column-gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.fcos-tournament-result-score-home {
    grid-column: 1;
    justify-self: end;
}

.fcos-tournament-result-score-divider {
    grid-column: 2;
    justify-self: center;
}

.fcos-tournament-result-score-away {
    grid-column: 3;
    justify-self: start;
}

.fcos-tournament-result-score {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #334155;
    text-align: center;
    white-space: nowrap;
}

.fcos-tournament-result-score-walkover {
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.fcos-tournament-result-score-forfeit {
    font-size: 1.1rem;
    color: #94a3b8;
}

.fcos-tournament-result-score-divider {
    display: inline-block;
    width: 2px;
    height: 1.35rem;
    background: #38bdf8;
    flex-shrink: 0;
}

.fcos-tournament-public-team {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    vertical-align: middle;
}

.fcos-tournament-team-badge-thumb {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
    background: transparent;
}

.fcos-tournament-standings-group + .fcos-tournament-standings-group {
    margin-top: 1.5rem;
}

.fcos-table-wrap {
    overflow-x: auto;
}

.fcos-tournament-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.fcos-tournament-standings-table th,
.fcos-tournament-standings-table td {
    padding: 0.45rem 0.35rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.fcos-tournament-standings-table th:nth-child(2),
.fcos-tournament-standings-table td:nth-child(2) {
    text-align: left;
}

.fcos-tournament-standings-table th {
    font-size: 0.8125rem;
    color: #6b7280;
}

.fcos-tournament-bracket-round + .fcos-tournament-bracket-round {
    margin-top: 1rem;
}

.fcos-tournament-hub-updated {
    margin: 1rem 0 0;
    font-size: 0.8125rem;
}

.fcos-public-empty {
    color: #6b7280;
}

.fcos-tournament-hub-back {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}

.fcos-tournament-hub-back a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 600;
}

.fcos-tournaments-index {
    margin: 0 0 2rem;
    text-align: center;
}

.fcos-tournaments-empty {
    text-align: center;
}

.fcos-tournaments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.fcos-tournaments-list-item {
    border-bottom: 1px solid #e5e7eb;
}

.fcos-tournaments-list-item:last-child {
    border-bottom: 0;
}

.fcos-tournaments-list-link {
    display: block;
    padding: 0.85rem 0;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.fcos-tournaments-list-link:hover .fcos-tournaments-list-name {
    color: #1e3a5f;
}

.fcos-tournaments-list-name {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.fcos-tournaments-list-date {
    display: block;
    font-size: 0.9375rem;
    line-height: 1.45;
    margin-bottom: 0.15rem;
}

.fcos-tournaments-list-event-logo {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
}

.fcos-tournaments-list-meta {
    display: block;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.fcos-tournaments-past-controls {
    margin: 1.25rem 0 0.75rem;
    text-align: center;
}

.fcos-tournaments-past-toggle {
    color: #1e3a5f;
    font-weight: 600;
    text-decoration: none;
}

.fcos-tournaments-past-heading {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #6b7280;
    text-align: center;
}

.fcos-tournaments-list-past .fcos-tournaments-list-name {
    font-weight: 600;
}

.fcos-muted {
    color: #6b7280;
}

.fcos-tournament-favourite-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin: 0.75rem 0 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    background: #f0f4f8;
    text-align: center;
}

.fcos-tournament-favourite-bar[hidden] {
    display: none;
}

.fcos-tournament-favourite-status {
    margin: 0;
    font-size: 0.9375rem;
}

.fcos-tournament-favourite-icon {
    color: #1e3a5f;
}

.fcos-tournament-favourite-toggle {
    background: none;
    border: 0;
    padding: 0;
    color: #1e3a5f;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.fcos-tournament-favourite-btn {
    padding: 0 0.15rem;
    border: 0;
    background: none;
    color: #9ca3af;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}

.fcos-tournament-favourite-btn.is-active,
.fcos-tournament-favourite-btn[aria-pressed="true"] {
    color: #f59e0b;
}

.fcos-tournament-day-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: safe center;
    gap: 0.375rem;
    margin: 0 0 1rem;
    padding: 0.35rem 0.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.fcos-tournament-day-bar::-webkit-scrollbar {
    display: none;
}

.fcos-tournament-day-bar[hidden] {
    display: none;
}

.fcos-tournament-day-pill {
    flex: 0 0 auto;
    padding: 0.2rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
}

.fcos-tournament-day-pill.is-active {
    border-color: #1e3a5f;
    background: #1e3a5f;
    color: #fff;
}

/* When the day switcher is on, per-row day labels are redundant. */
.fcos-tournament-day-switching .fcos-tournament-fixture-day {
    display: none;
}

.fcos-tournament-hub-teams {
    text-align: center;
}

.fcos-tournament-teams-hint {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}

.fcos-tournament-teams-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 32rem;
    text-align: left;
}

.fcos-tournament-teams-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid #e5e7eb;
}

.fcos-tournament-teams-item:last-child {
    border-bottom: 0;
}

.fcos-tournament-teams-item.is-favourite-team {
    background: #f0f4f8;
}

.fcos-tournament-teams-identity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.fcos-tournament-teams-names {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.fcos-tournament-teams-club {
    font-size: 0.85rem;
}

.fcos-tournament-standings-table tr.is-favourite-team {
    background: #f0f4f8;
    font-weight: 600;
}

.fcos-tournament-scorers-table {
  width: 100%;
  border-collapse: collapse;
}

.fcos-tournament-scorers-table th,
.fcos-tournament-scorers-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.fcos-tournament-awards-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fcos-tournament-awards-item {
  margin: 0.35rem 0;
}
