@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --club-blue: #0f4e9b;
    --club-blue-dark: #0b376d;
    --club-blue-ink: #08284f;
    --club-red: #c7342f;
    --club-red-dark: #9f2429;
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #eef3f8;
    --ink: #162033;
    --ink-soft: #344054;
    --muted: #667085;
    --line: #d7dee8;
    --line-soft: #e8edf3;
    --primary: var(--club-blue);
    --primary-strong: var(--club-blue-dark);
    --primary-soft: #eaf2fb;
    --danger: var(--club-red);
    --danger-soft: #fff0f1;
    --success: #1f7a4d;
    --success-soft: #edf8f2;
    --warning: #a15c00;
    --warning-soft: #fff7e8;
    --radius: 8px;
    --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
    --shadow-soft: 0 4px 14px rgba(16, 24, 40, 0.06);
    --font:
        "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
        sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--club-blue-dark);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(
            180deg,
            rgba(15, 78, 155, 0.09) 0,
            rgba(15, 78, 155, 0) 220px
        ),
        linear-gradient(
            90deg,
            rgba(199, 52, 47, 0.06) 0,
            rgba(199, 52, 47, 0) 380px
        ),
        var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 28px;
    background:
        radial-gradient(
            circle at 18% 0%,
            rgba(255, 255, 255, 0.16),
            transparent 30%
        ),
        linear-gradient(
            120deg,
            var(--club-blue-dark) 0%,
            var(--club-blue) 62%,
            #155aa8 100%
        );
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 28px rgba(8, 40, 79, 0.2);
    backdrop-filter: blur(10px);
}

.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--club-red),
        #f06a5f 42%,
        rgba(255, 255, 255, 0.38)
    );
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 1px rgba(8, 40, 79, 0.25);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 10px 22px rgba(8, 40, 79, 0.22);
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar nav a {
    color: rgba(255, 255, 255, 0.9);
    padding: 9px 12px;
    border-radius: 7px;
    font-weight: 700;
    border: 1px solid transparent;
}

.topbar nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 28px;
}

.card,
.tournament-hero,
.stat-card,
.group-tile,
.match-card,
.draw-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.card {
    padding: 20px;
    margin-bottom: 18px;
    border-top: 3px solid transparent;
}

.card + .card {
    margin-top: 18px;
}

.card h2,
.card h3,
.card h4,
.modal h4 {
    margin: 0 0 14px;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: 0;
}

.card h2 {
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2::before {
    content: "";
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: var(--club-red);
    flex-shrink: 0;
}

.card h3 {
    font-size: 18px;
}

.card h4 {
    font-size: 15px;
}

.card p {
    color: var(--muted);
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.page-heading h1,
.page-heading h2 {
    margin: 0;
    color: var(--ink);
}

.page-heading p {
    margin: 5px 0 0;
    color: var(--muted);
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.tournament-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: end;
    padding: 24px;
    margin-bottom: 18px;
    border-left: 5px solid var(--club-blue);
    border-top: 3px solid var(--club-red);
    box-shadow: var(--shadow);
}

.tournament-hero h1 {
    margin: 6px 0 8px;
    color: var(--ink);
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: 0;
}

.tournament-hero p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-soft), #fff0f1);
    color: var(--club-blue-dark);
    border: 1px solid #d5e4f5;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-actions,
.quick-links,
.team-cloud {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-actions {
    justify-content: flex-end;
}

.hero-button,
.quick-links a,
.team-cloud a,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 7px;
    font-weight: 800;
    text-decoration: none;
}

.hero-button,
.quick-links a,
.team-cloud a {
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid #c8dcf2;
}

.hero-button.primary {
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--club-blue),
        var(--club-blue-dark)
    );
    border-color: var(--club-blue);
}

.hero-button:hover,
.quick-links a:hover,
.team-cloud a:hover,
.back-link:hover {
    text-decoration: none;
    border-color: var(--primary);
    box-shadow: 0 3px 12px rgba(15, 78, 155, 0.1);
}

.quick-links a:nth-child(4n),
.team-cloud a:nth-child(6n) {
    color: var(--club-red-dark);
    background: var(--danger-soft);
    border-color: #f0c1c4;
}

.back-link {
    margin-bottom: 10px;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--line);
}

.live-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 16px;
    border-top: 3px solid var(--club-red);
}

.stat-card strong {
    display: block;
    color: var(--club-blue-dark);
    font-size: 30px;
    line-height: 1;
}

.stat-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

.public-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.public-grid .card {
    margin-top: 0;
}

.live-panel {
    min-height: 100%;
}

.match-line,
.team-match,
.final-item {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}

.match-line {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) minmax(110px, 150px);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.match-line:hover {
    border-color: #b8cce4;
    box-shadow: 0 3px 12px rgba(15, 78, 155, 0.1);
    text-decoration: none;
}

.match-time {
    color: var(--primary);
    font-weight: 900;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
    font-weight: 700;
}

.match-teams small {
    color: var(--muted);
    font-weight: 600;
}

.match-field {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.matches-page {
    border-left: 5px solid var(--club-blue);
}

.matches-heading {
    align-items: center;
}

.match-filter {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.match-filter label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.match-filter select {
    min-width: 190px;
}

.match-agenda {
    display: grid;
    gap: 10px;
}

.match-slot-heading {
    position: sticky;
    top: 76px;
    z-index: 4;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 9px 12px;
    margin-top: 6px;
    border: 1px solid #c8dcf2;
    border-left: 4px solid var(--club-red);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.match-slot-heading strong {
    color: var(--club-blue-dark);
    font-size: 19px;
    line-height: 1;
    font-weight: 900;
}

.match-slot-heading span {
    color: var(--muted);
    font-weight: 700;
}

.match-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 96px;
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
}

.match-row-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-row-meta span {
    color: var(--club-blue-dark);
    font-weight: 900;
}

.match-row-meta small {
    color: var(--muted);
    font-weight: 700;
}

.match-row-teams {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.match-row-team {
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
}

.match-row-team .team-name-logo {
    max-width: 100%;
}

.match-row-team .team-name-logo > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-row-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 46px;
    padding: 8px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 900;
    text-align: center;
}

.match-row-score.played {
    background: var(--primary-soft);
    color: var(--club-blue-dark);
}

.match-row-score strong {
    font-size: 24px;
    line-height: 1;
}

.compact-match-agenda {
    gap: 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.match-day-heading {
    padding: 7px 24px;
    background: #eeeeef;
    color: #777f8b;
    font-size: 13px;
    font-weight: 700;
    text-transform: lowercase;
}

.match-phase-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    background: var(--primary-soft);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid #c8dcf2;
    color: var(--club-blue-dark);
}

.match-phase-heading strong {
    font-size: 15px;
    font-weight: 900;
}

.match-phase-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.match-phase-heading.phase-2 {
    background: var(--danger-soft);
    border-bottom-color: #f0c1c4;
    color: var(--club-red-dark);
}

.match-phase-heading.phase-final {
    background: var(--surface-strong);
    color: var(--ink);
}

.match-phase-heading:first-child {
    border-top: none;
}

.match-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 58px;
    row-gap: 4px;
    padding: 9px 16px 8px;
    background: #fff;
    border-bottom: 1px solid var(--line-soft);
}

.match-list-row:last-child {
    border-bottom: none;
}

.match-list-team {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
}

.match-list-team.home {
    justify-content: flex-end;
    text-align: right;
}

.match-list-team.away {
    justify-content: flex-start;
    text-align: left;
}

.match-list-team > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-list-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 2px;
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
    text-align: center;
}

.match-list-center > strong,
.match-list-center > span {
    line-height: 1;
}

.match-list-center.played {
    color: var(--club-blue-dark);
}

.match-score-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.match-score-inline strong {
    color: var(--ink);
    font-size: inherit;
}

.match-list-center.home-win .home-score,
.match-list-center.away-win .away-score {
    color: var(--success);
}

.match-list-center.home-win .away-score,
.match-list-center.away-win .home-score {
    color: var(--club-red-dark);
}

.match-list-center.draw .home-score,
.match-list-center.draw .away-score {
    color: var(--ink);
}

.match-list-field {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.empty-state {
    color: var(--muted);
    border: 1px dashed #bdc7d4;
    border-radius: 8px;
    padding: 14px;
    background: var(--surface-soft);
}

.team-name-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    vertical-align: middle;
}

.team-name-button {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    cursor: pointer;
}

.team-name-button:hover {
    background: transparent;
    box-shadow: none;
    color: var(--primary);
    text-decoration: none;
}

.team-name-button:focus-visible {
    outline: 3px solid rgba(21, 87, 157, 0.16);
    border-radius: 6px;
}

.team-display-name {
    display: inline;
}

.team-short-name {
    display: none;
}

.team-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, var(--primary-soft));
    border: 1px solid #c8dcf2;
    color: var(--primary-strong);
    font-weight: 900;
    letter-spacing: 0;
}

.team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.team-logo-sm {
    width: 26px;
    height: 26px;
    font-size: 10px;
}

.team-logo-xl {
    width: 66px;
    height: 66px;
    font-size: 18px;
    border: 3px solid #fff;
    box-shadow:
        0 0 0 2px var(--club-red),
        0 8px 18px rgba(13, 39, 76, 0.14);
}

.team-page-title {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
    line-height: 1;
}

.team-page-title,
.team-identity > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.team-hero {
    position: relative;
    display: block;
    align-items: stretch;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line-soft);
    border-left: 6px solid var(--club-blue);
    border-top: 3px solid var(--club-red);
    background: #fff;
}

.team-hero-content,
.team-hero-actions {
    position: relative;
    z-index: 1;
}

.team-hero-content {
    padding: 16px;
    background: linear-gradient(135deg, #fff, #f7fbff 62%, #fff3f4);
    color: var(--ink);
}

.team-hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.team-back-link {
    min-height: 32px;
    margin-bottom: 0;
    padding-inline: 10px;
    color: var(--club-blue-dark);
    background: #fff;
    border-color: #c8dcf2;
}

.team-identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.team-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.team-meta-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--club-blue-dark);
    background: #fff;
    border: 1px solid #c8dcf2;
    font-size: 12px;
    font-weight: 900;
}

.team-meta-row span:last-child {
    color: var(--club-red-dark);
    border-color: #f0c1c4;
    background: #fff4f5;
}

.team-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--line-soft);
}

.team-hero-actions .hero-button {
    min-height: 44px;
    width: 100%;
}

.team-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-match-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.planning-focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.planning-focus-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
}

.planning-focus-card.played {
    border-left: 5px solid var(--club-blue);
}

.planning-focus-card.upcoming {
    border-left: 5px solid var(--club-red);
}

.planning-focus-card h3 {
    margin: 4px 0 10px;
}

.planning-focus-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.planning-focus-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.planning-focus-main > span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 900;
}

.team-planning-card .team-name-logo {
    max-width: 100%;
}

.team-planning-card .team-name-logo > span:last-child,
.team-planning-card .team-display-name,
.team-planning-card .team-full-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-planning-card .team-full-name small {
    display: inline;
    margin-left: 4px;
    white-space: nowrap;
}

.planning-focus-main strong {
    color: var(--primary-strong);
    font-size: 24px;
    line-height: 1;
    white-space: nowrap;
}

.last-played-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.last-played-main > span {
    width: 100%;
}

.team-last-score {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--surface-soft);
}

.team-last-score span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.team-last-score strong {
    color: var(--primary-strong);
    font-size: 24px;
    line-height: 1;
    white-space: nowrap;
}

.team-last-score.win span {
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid #bfe1cf;
}

.team-last-score.draw span {
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid #f2d2a2;
}

.team-last-score.loss span {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #f0c1c4;
}

.next-match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    align-items: center;
    gap: 18px;
    border-left: 5px solid var(--club-red);
}

.next-match-card p {
    margin-bottom: 0;
}

.next-match-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #c8dcf2;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary-soft), #fff);
    color: var(--ink);
    font-weight: 900;
}

.next-match-teams > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.next-match-teams > div:last-child {
    text-align: right;
}

.next-match-teams > span {
    color: var(--club-red);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.team-match {
    display: grid;
    grid-template-columns: 76px 96px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
}

.team-match.played {
    background: #f5f9ff;
    border-color: #c8dcf2;
}

.team-match-meta span,
.team-match-main > small {
    display: block;
}

.team-match-meta,
.team-match small {
    color: var(--muted);
}

.team-match-meta strong,
.team-score {
    color: var(--primary-strong);
}

.team-match-main > span {
    display: block;
    min-width: 0;
    font-weight: 800;
}

.team-match-main .team-name-logo {
    max-width: 100%;
}

.team-match-main .team-name-logo > span:last-child,
.team-match-main .team-display-name,
.team-match-main .team-full-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-match-main .team-full-name small {
    display: inline;
    margin-left: 4px;
    white-space: nowrap;
}

.team-score {
    font-weight: 900;
    text-align: left;
}

.follow-card {
    border-left: 5px solid var(--club-blue);
}

.follow-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: min(320px, 100%);
}

.follow-search label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.follow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.follow-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
}

.follow-team[hidden],
.follow-empty-search[hidden] {
    display: none;
}

.follow-team:hover {
    text-decoration: none;
    border-color: var(--club-blue);
    background: var(--primary-soft);
    box-shadow: 0 4px 14px rgba(15, 78, 155, 0.12);
}

.visitor-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    background:
        linear-gradient(
            135deg,
            rgba(15, 78, 155, 0.08),
            rgba(199, 52, 47, 0.05)
        ),
        var(--surface);
}

.visitor-hero h1 {
    max-width: 920px;
    overflow-wrap: anywhere;
}

.visitor-count {
    display: grid;
    place-items: center;
    width: 112px;
    min-height: 92px;
    border: 1px solid #c8dcf2;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.visitor-count strong {
    color: var(--club-blue-dark);
    font-size: 36px;
    line-height: 1;
    font-weight: 900;
}

.visitor-count span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.visitor-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.visitor-tools .hero-button {
    min-height: 48px;
    font-size: 15px;
}

.visitor-live-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.visitor-match-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid #c8dcf2;
    border-left: 4px solid var(--club-red);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.visitor-live-strip strong {
    grid-row: span 2;
    color: var(--club-blue-dark);
    font-size: 20px;
    line-height: 1.1;
}

.visitor-live-strip span,
.visitor-live-strip small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.visitor-live-strip span {
    font-weight: 900;
}

.visitor-live-strip small {
    color: var(--muted);
    font-weight: 700;
}

.visitor-live-strip .team-name-logo {
    display: inline-flex;
    max-width: 100%;
}

.visitor-follow-card .page-heading {
    align-items: center;
}

.visitor-follow-card .follow-search input {
    min-height: 48px;
    font-size: 16px;
}

.visitor-follow-card .follow-team {
    min-height: 64px;
    font-size: 15px;
}

.visitor-follow-card .follow-team span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.highlight-row td {
    background: var(--primary-soft);
    font-weight: 800;
}

.selected-team-row td {
    background: var(--danger-soft);
    font-weight: 900;
}

.selected-team-row td:first-child {
    box-shadow: inset 4px 0 0 var(--club-red);
}

.selected-team-final {
    border-color: #f0c1c4;
    background: var(--danger-soft);
}

.section-nav {
    position: sticky;
    top: 76px;
    z-index: 8;
    display: flex;
    gap: 8px;
    padding: 8px;
    margin: 0 0 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.section-nav a {
    flex: 1 1 auto;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--ink-soft);
    font-weight: 800;
    text-align: center;
}

.section-nav a:hover {
    color: var(--primary);
    background: #fff;
    text-decoration: none;
}

.section-nav a.active {
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--club-blue),
        var(--club-blue-dark)
    );
    box-shadow: inset 0 -3px 0 var(--club-red);
}

.section-panel {
    display: none;
}

.section-panel.active {
    display: block;
}

form.inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

input,
select,
textarea {
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid #cfd8e3;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(21, 87, 157, 0.16);
    border-color: var(--primary);
}

textarea {
    width: 100%;
    margin-top: 8px;
    resize: vertical;
    line-height: 1.45;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--primary);
    border-radius: 7px;
    background: linear-gradient(
        135deg,
        var(--club-blue),
        var(--club-blue-dark)
    );
    color: #fff;
    font-family: var(--font);
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

button:hover,
.button:hover {
    background: linear-gradient(
        135deg,
        var(--club-blue-dark),
        var(--club-blue-ink)
    );
    border-color: var(--primary-strong);
    box-shadow: 0 4px 12px rgba(21, 87, 157, 0.18);
    text-decoration: none;
}

button.secondary,
.button.secondary {
    background: #fff;
    color: var(--primary);
    border-color: #bdd2ea;
    box-shadow: none;
}

button.secondary:hover,
.button.secondary:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.icon-button {
    width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 0;
    background: #fff;
    color: var(--muted);
    border-color: var(--line);
    border-radius: 7px;
    box-shadow: none;
}

.icon-button:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #bdd2ea;
}

.icon-button.save {
    color: var(--success);
    border-color: #bfe1cf;
}

.icon-button.save:hover {
    background: var(--success-soft);
    color: var(--success);
    border-color: #9bd0b6;
}

.icon-button.danger {
    color: var(--danger);
    border-color: #f0c1c4;
}

.icon-button.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #e7a4a8;
}

table {
    width: 100%;
    margin-top: 10px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

th,
td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    color: var(--ink-soft);
    font-family: var(--font);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    color: #fff;
    background: linear-gradient(90deg, var(--club-blue-dark), var(--club-blue));
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #fbfdff;
}

th.phase,
td.phase,
th.round,
td.round {
    width: 8%;
    text-align: center;
}

th.time,
td.time {
    width: 7%;
    text-align: center;
}

th.field,
td.field {
    width: 10%;
    text-align: center;
}

th.home,
td.home,
th.away,
td.away {
    width: 21%;
}

th.score,
td.score {
    width: 18%;
    min-width: 190px;
    text-align: center;
}

.match-table {
    min-width: 760px;
}

.admin-match-card .match-table {
    min-width: 680px;
}

.admin-calendar-card {
    padding: 18px;
}

.admin-calendar-card > form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-match-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(640px, 100%), 1fr));
    gap: 18px;
}

.admin-calendar-phase {
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fff;
}

.admin-calendar-phase + .admin-calendar-phase {
    margin-top: 18px;
}

.admin-calendar-phase-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
}

.admin-calendar-phase-heading h4 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
}

.admin-calendar-phase.phase-one {
    border-left: 5px solid var(--club-blue);
}

.admin-calendar-phase.phase-two {
    border-left: 5px solid var(--club-red);
    background: linear-gradient(135deg, #fff, #fffafa);
}

.admin-calendar-phase.phase-two .eyebrow {
    color: var(--club-red-dark);
    border-color: #f0c1c4;
    background: var(--danger-soft);
}

.admin-match-card {
    overflow: hidden;
    padding: 0;
    border-top: 0;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

.admin-match-card h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(135deg, #fff, #f7fbff);
    color: var(--club-blue-dark);
    font-size: 16px;
}

.admin-match-card h4::before {
    content: "";
    width: 4px;
    height: 20px;
    margin-right: 8px;
    border-radius: 999px;
    background: var(--club-blue);
}

.admin-match-card .table-wrapper {
    padding: 10px;
    background: var(--surface-soft);
}

.admin-match-card .match-table {
    margin-top: 0;
    border-color: #e0e8f2;
    box-shadow: none;
}

.admin-match-card .match-table th {
    padding: 10px 8px;
    background: var(--club-blue-dark);
    font-size: 10px;
    letter-spacing: 0.02em;
}

.admin-match-card .match-table td {
    height: 46px;
    padding: 8px 10px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 12px;
    vertical-align: middle;
}

.admin-match-card .match-table tbody tr:hover td {
    background: #f8fbff;
}

.admin-match-card td.home,
.admin-match-card td.away {
    color: var(--ink);
    font-weight: 750;
}

.admin-match-card td.time,
.admin-match-card td.field {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.admin-match-card th.time,
.admin-match-card td.time {
    width: 6%;
    padding-left: 6px;
    padding-right: 6px;
}

.admin-match-card th.home,
.admin-match-card td.home,
.admin-match-card th.away,
.admin-match-card td.away {
    width: 18%;
}

.admin-match-card th.field,
.admin-match-card td.field {
    width: 18%;
    text-align: left;
}

.admin-match-card th.score,
.admin-match-card td.score {
    width: 16%;
    min-width: 142px;
}

.admin-match-card td.score {
    padding: 6px 8px;
}

.standings-table th,
.standings-table td {
    padding: 9px 8px;
    text-align: center;
}

.standings-table th.standing-team,
.standings-table td.standing-team {
    width: 34%;
    text-align: left;
}

.standings-table th.standing-rank,
.standings-table td.standing-rank {
    width: 6%;
}

.standings-table th:not(.standing-team),
.standings-table td:not(.standing-team) {
    width: 8%;
}

.standing-mobile-meta {
    display: none;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.score-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: nowrap;
    padding: 3px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: var(--surface-soft);
}

.score-form input[type="number"] {
    width: 42px;
    min-width: 42px;
    height: 30px;
    padding: 4px 6px;
    border-radius: 7px;
    background: #fff;
    text-align: center;
    font-weight: 800;
    appearance: textfield;
    -moz-appearance: textfield;
}

.score-form input[type="number"]::-webkit-outer-spin-button,
.score-form input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.score-form .score-sep {
    display: inline-block;
    min-width: 7px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.score-form button {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 7px;
    white-space: nowrap;
}

.score-form .action-btn {
    min-width: 34px;
    background: var(--club-blue);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.js-score-autosave .score-form .action-btn {
    display: none;
}

.winner-text {
    color: var(--club-blue);
    font-weight: 800;
}

.flash-group {
    margin-bottom: 16px;
}

.flash {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    background: #fff;
}

.flash.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: #bfe5cf;
}

.flash.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #f0c1c4;
}

.flash.info {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #c8dcf2;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.split-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr));
    gap: 16px;
    align-items: start;
}

.split-two .card {
    margin-top: 0;
}

.admin-management-grid {
    grid-template-columns: minmax(760px, 1.7fr) minmax(320px, 0.7fr);
    gap: 18px;
}

.admin-manager-card {
    overflow: hidden;
    padding: 0;
    border-top: 0;
}

.admin-manager-card .card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(135deg, #fff, #f8fbff);
}

.admin-manager-card .card-title-row h3 {
    margin: 0 0 4px;
    font-size: 19px;
}

.admin-manager-card .card-title-row p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-add-team-form,
.field-add-form {
    display: grid;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-soft);
}

.admin-add-team-form {
    grid-template-columns:
        minmax(190px, 1.15fr) auto minmax(145px, 0.9fr)
        minmax(100px, 0.6fr) minmax(145px, 0.85fr) auto auto;
    align-items: center;
}

.field-add-form {
    grid-template-columns: minmax(0, 1fr) auto;
}

.form-separator {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    white-space: nowrap;
}

.checkbox-pill.compact {
    min-height: 34px;
    padding: 6px 9px;
}

.checkbox-pill input {
    margin: 0;
    accent-color: var(--club-blue);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid #c8dcf2;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 800;
}

.draw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.draw-tile {
    padding: 12px;
    background: #fff;
}

.draw-tile h4,
.group-tile strong {
    color: var(--ink);
}

.draw-tile ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.draw-tile li {
    padding: 5px 0;
    border-bottom: 1px solid var(--line-soft);
}

.draw-tile li:last-child {
    border-bottom: none;
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(620px, 100%), 1fr));
    gap: 16px;
}

.standings-section {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--club-blue);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.standings-section + .standings-section {
    margin-top: 18px;
}

.standings-section:nth-of-type(2) {
    border-left-color: var(--club-red);
}

.standings-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
}

.standings-section-heading h3 {
    margin: 8px 0 4px;
    color: var(--ink);
    font-size: 22px;
    line-height: 1.15;
}

.standings-section-heading p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.final-standings-section {
    border-left-color: var(--club-blue-dark);
    border-top: 3px solid var(--club-red);
}

.group-tile {
    padding: 12px;
    box-shadow: none;
    border-top: 3px solid var(--club-blue);
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(760px, 100%), 1fr));
    gap: 16px;
}

.match-card {
    padding: 12px;
    box-shadow: none;
    border-top: 3px solid var(--club-blue);
}

.list-panel {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.team-admin-list,
.field-admin-list {
    padding: 14px 16px 16px;
}

.team-admin-list.list-panel {
    max-height: 520px;
}

.field-admin-list.list-panel {
    max-height: 360px;
}

.pill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pill-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 9px 10px;
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    margin-bottom: 8px;
}

.team-admin-item {
    align-items: flex-start !important;
    padding: 12px !important;
    border-color: #dfe7f0 !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.team-admin-item:hover,
.field-admin-item:hover {
    border-color: #c8dcf2 !important;
    background: #fbfdff;
}

.team-admin-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 180px;
    max-width: 230px;
    padding-top: 4px;
    color: var(--ink);
    font-weight: 800;
}

.team-admin-summary .team-name-logo {
    max-width: 100%;
}

.team-admin-summary .team-name-logo > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-admin-summary small {
    display: block;
    margin: 2px 0 0 34px;
    font-size: 11px;
}

.team-admin-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.team-edit-form {
    display: grid;
    grid-template-columns:
        minmax(130px, 1.05fr) minmax(78px, 0.55fr) minmax(150px, 1fr)
        auto auto;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.team-edit-form input,
.admin-add-team-form input,
.admin-add-team-form select,
.field-add-form input {
    width: 100%;
}

.field-admin-item {
    min-height: 58px !important;
    padding: 10px 12px !important;
}

.field-admin-item > span {
    color: var(--ink-soft);
    font-weight: 700;
}

.pill-list small {
    color: var(--muted);
    margin-left: 6px;
}

.seed-label {
    color: var(--muted);
    font-weight: 700;
}

.seed-star {
    color: var(--danger);
    margin-left: 6px;
    font-size: 14px;
}

ul {
    color: var(--muted);
    padding-left: 18px;
}

ul li {
    margin-bottom: 6px;
}

.final-card {
    padding: 20px;
}

.final-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.final-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.final-item.pending {
    border-color: #f0c1c4;
    background: var(--danger-soft);
}

.final-rank {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        var(--club-blue),
        var(--club-blue-dark)
    );
    color: #fff;
    font-weight: 900;
    flex-shrink: 0;
}

.final-item.pending .final-rank {
    background: #fff;
    color: var(--danger);
    border: 1px solid #f0c1c4;
}

.final-team {
    min-width: 0;
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.rules-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 16px;
    align-items: stretch;
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--line-soft);
    border-left: 6px solid var(--club-blue);
    border-top: 3px solid var(--club-red);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, #f7fbff 62%, #fff4f5);
    box-shadow: var(--shadow-soft);
}

.rules-hero .back-link {
    margin-bottom: 12px;
}

.rules-hero h1 {
    margin: 8px 0;
    color: var(--ink);
    font-size: 30px;
    line-height: 1.05;
}

.rules-hero p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.rules-hero-panel {
    display: grid;
    align-content: center;
    padding: 16px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--club-blue-dark),
        var(--club-blue)
    );
}

.rules-hero-panel strong {
    font-size: 34px;
    line-height: 1;
}

.rules-hero-panel span,
.rules-hero-panel small {
    margin-top: 6px;
    font-weight: 800;
}

.rules-hero-panel small {
    color: rgba(255, 255, 255, 0.78);
}

.rules-team-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #c8dcf2;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.rules-team-strip > div,
.rules-team-strip span,
.rules-team-strip nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-team-strip span {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
}

.rules-team-strip strong {
    color: var(--ink);
}

.rules-team-strip small {
    color: var(--muted);
    font-weight: 800;
}

.rules-team-strip nav {
    flex-wrap: wrap;
}

.rules-team-strip nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #c8dcf2;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--club-blue-dark);
    font-weight: 900;
}

.rules-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.rules-summary-card {
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-top: 3px solid var(--club-red);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.rules-summary-card strong {
    display: block;
    color: var(--club-blue-dark);
    font-size: 28px;
    line-height: 1;
}

.rules-summary-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 800;
}

.rules-grid {
    display: grid;
    gap: 10px;
}

.rule-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.rule-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #fff;
    background: var(--club-blue);
    font-size: 12px;
    font-weight: 900;
}

.rule-card:nth-child(even) .rule-number {
    background: var(--club-red);
}

.rule-card p {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 700;
    line-height: 1.55;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.52);
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    width: min(360px, 100%);
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal p {
    margin: 0 0 14px;
    color: var(--muted);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    flex: 1;
}

.team-name-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.team-name-dialog::backdrop {
    background: rgba(8, 40, 79, 0.42);
    backdrop-filter: blur(2px);
}

.team-name-dialog-content {
    padding: 20px;
}

.team-name-dialog #team-name-dialog-value {
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.admin-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin: 16px 0 0;
}

.admin-metric {
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-left: 4px solid var(--club-red);
    border-radius: 8px;
    background: var(--surface-soft);
}

.admin-metric strong {
    display: block;
    color: var(--ink);
    font-size: 24px;
}

.admin-metric span {
    color: var(--muted);
    font-weight: 700;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

@media (max-width: 980px) {
    .container {
        padding: 18px;
    }

    .tournament-hero,
    .page-heading {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .team-hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .hero-actions,
    .toolbar {
        justify-content: flex-start;
    }

    .public-grid,
    .live-stats,
    .rules-hero,
    .visitor-live-strip {
        grid-template-columns: 1fr;
    }

    .visitor-tools {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-nav {
        top: 0;
        overflow-x: auto;
    }

    .section-nav a {
        min-width: 150px;
    }
}

@media (max-width: 1180px) {
    .admin-management-grid {
        grid-template-columns: 1fr;
    }

    .admin-add-team-form {
        grid-template-columns:
            minmax(220px, 1fr) auto minmax(180px, 1fr)
            minmax(120px, 0.6fr);
    }

    .admin-add-team-form input[name="logo_url"],
    .admin-add-team-form .checkbox-pill,
    .admin-add-team-form button {
        grid-column: auto;
    }

    .team-edit-form {
        grid-template-columns:
            minmax(150px, 1fr) minmax(90px, 0.55fr) minmax(170px, 1fr)
            auto auto;
    }
}

@media (max-width: 980px) {
    .admin-add-team-form,
    .team-edit-form {
        grid-template-columns: 1fr 1fr;
    }

    .admin-add-team-form .club-select,
    .admin-add-team-form input[name="logo_url"],
    .admin-add-team-form button,
    .team-edit-form input[name="logo_url"] {
        grid-column: 1 / -1;
    }

    .form-separator {
        display: none;
    }

    .team-admin-item,
    .team-admin-actions {
        flex-direction: column;
        align-items: stretch !important;
    }

    .team-admin-summary {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .visitor-mode .team-display-name .team-full-name {
        display: none;
    }

    .visitor-mode .team-display-name .team-short-name {
        display: inline;
    }

    .visitor-mode .final-standings-section .team-display-name .team-full-name,
    .visitor-mode .final-ranking-card .team-display-name .team-full-name,
    .visitor-mode .team-planning-card .team-display-name .team-full-name,
    .visitor-mode .visitor-follow-card .team-display-name .team-full-name {
        display: inline;
    }

    .visitor-mode .final-standings-section .team-display-name .team-short-name,
    .visitor-mode .final-ranking-card .team-display-name .team-short-name,
    .visitor-mode .team-planning-card .team-display-name .team-short-name,
    .visitor-mode .visitor-follow-card .team-display-name .team-short-name {
        display: none;
    }

    .topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }

    .topbar nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar nav a {
        background: rgba(255, 255, 255, 0.12);
    }

    .container {
        padding: 12px;
    }

    .card,
    .tournament-hero {
        padding: 14px;
    }

    .tournament-hero h1 {
        font-size: 24px;
    }

    .team-hero {
        gap: 16px;
    }

    .team-hero-topline {
        margin-bottom: 14px;
    }

    .team-page-title {
        font-size: 30px;
    }

    .visitor-hero {
        grid-template-columns: 1fr;
    }

    .visitor-count {
        width: 100%;
        min-height: 72px;
        grid-template-columns: auto auto;
        justify-content: center;
        gap: 8px;
    }

    .visitor-tools {
        grid-template-columns: 1fr;
    }

    .visitor-tools .hero-button {
        min-height: 52px;
    }

    .visitor-follow-card .page-heading {
        align-items: stretch;
    }

    .follow-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    }

    form.inline {
        align-items: stretch;
    }

    form.inline > * {
        width: 100%;
    }

    .matches-heading {
        gap: 12px;
    }

    .match-filter {
        align-items: stretch;
        justify-content: stretch;
        width: 100%;
    }

    .match-filter label,
    .match-filter select,
    .match-filter button,
    .match-filter .button {
        width: 100%;
    }

    .match-slot-heading {
        position: static;
        margin-top: 10px;
    }

    .match-row {
        grid-template-columns: 1fr auto;
        gap: 10px;
        min-height: 0;
        padding: 10px;
    }

    .match-row-meta {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--line-soft);
    }

    .match-row-teams {
        gap: 8px;
    }

    .match-row-team {
        font-size: 15px;
    }

    .match-row-score {
        align-self: stretch;
        width: 66px;
        min-height: 62px;
        flex-direction: column;
        gap: 0;
    }

    .match-row-score strong {
        font-size: 22px;
    }

    .match-row-score span {
        font-size: 12px;
    }

    .compact-match-agenda {
        margin-left: -2px;
        margin-right: -2px;
        border-radius: 8px;
    }

    .match-day-heading {
        padding: 6px 12px;
        font-size: 12px;
    }

    .match-phase-heading {
        padding: 9px 11px;
    }

    .match-list-row {
        grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
        min-height: 52px;
        padding: 8px 8px 7px;
    }

    .match-list-team {
        gap: 5px;
        font-size: 13px;
        font-weight: 800;
    }

    .match-list-team .team-logo-sm {
        width: 22px;
        height: 22px;
        font-size: 8px;
    }

    .match-list-center {
        font-size: 12px;
    }

    .match-score-inline {
        font-size: 15px;
    }

    .match-list-field {
        font-size: 9px;
    }

    .match-line {
        grid-template-columns: 72px 1fr;
    }

    .match-field {
        grid-column: 2;
        text-align: left;
    }

    .team-match {
        grid-template-columns: 1fr;
    }

    .planning-focus-grid,
    .planning-focus-main {
        grid-template-columns: 1fr;
    }

    .planning-focus-main strong {
        font-size: 22px;
    }

    .next-match-card,
    .next-match-teams {
        grid-template-columns: 1fr;
    }

    .next-match-teams > div:last-child {
        text-align: left;
    }

    .team-score {
        text-align: left;
        font-size: 18px;
    }

    .rules-summary-grid {
        grid-template-columns: 1fr;
    }

    .rules-team-strip,
    .rules-team-strip nav,
    .rules-team-strip nav a {
        width: 100%;
    }

    .rules-team-strip nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rules-team-strip nav a {
        justify-content: center;
    }

    .table-wrapper {
        overflow-x: visible;
    }

    .match-table,
    .standings-table,
    .card > table {
        min-width: 0;
        table-layout: auto;
    }

    .match-table thead,
    .standings-table thead,
    .card > table thead {
        display: none;
    }

    .match-table tbody,
    .match-table tr,
    .match-table td,
    .standings-table tbody,
    .standings-table tr,
    .standings-table td,
    .card > table tbody,
    .card > table tr,
    .card > table td {
        display: block;
        width: 100% !important;
    }

    .match-table tr,
    .standings-table tr,
    .card > table tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        margin: 0 0 10px;
        overflow: hidden;
        background: #fff;
    }

    .match-table td,
    .standings-table td,
    .card > table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 10px;
        border-bottom: 1px solid var(--line-soft);
        text-align: right !important;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .match-table td:last-child,
    .standings-table td:last-child,
    .card > table td:last-child {
        border-bottom: none;
    }

    .match-table td::before,
    .standings-table td::before,
    .card > table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: var(--muted);
        font-weight: 800;
        text-align: left;
    }

    .football-standings {
        display: table;
        width: 100%;
        border: none;
        border-radius: 0;
        background: #fff;
        border-collapse: collapse;
        table-layout: auto;
    }

    .football-standings thead {
        display: table-header-group;
    }

    .football-standings tbody {
        display: table-row-group;
    }

    .football-standings tr {
        display: table-row !important;
        width: auto !important;
        min-height: 0;
        margin: 0;
        border: none;
        border-radius: 0;
        background: #fff;
        background-image: linear-gradient(var(--line-soft), var(--line-soft));
        background-repeat: no-repeat;
        background-position: left bottom;
        background-size: 100% 1px;
    }

    .football-standings tr:nth-child(-n + 3) {
        background-color: #fff;
    }

    .football-standings tbody tr:last-child {
        background-image: none;
    }

    .football-standings tr.selected-team-row {
        background-color: var(--danger-soft);
    }

    .football-standings tr.selected-team-row .standing-rank {
        color: var(--club-red-dark);
    }

    .football-standings tr.selected-team-row td:first-child {
        box-shadow: inset 3px 0 0 var(--club-red);
    }

    .football-standings th,
    .football-standings td {
        display: table-cell !important;
        width: auto !important;
        padding: 13px 4px;
        border-bottom: none;
        text-align: center !important;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .football-standings th {
        color: var(--muted);
        background: #fff;
        font-size: 13px;
        font-weight: 700;
        text-transform: none;
    }

    .football-standings td::before {
        content: none;
    }

    .football-standings .standing-rank {
        width: 30px !important;
        color: #8a94a3;
        font-size: 15px;
        font-weight: 900;
    }

    .football-standings .standing-team {
        width: auto !important;
        text-align: left !important;
    }

    .football-standings th.standing-rank,
    .football-standings th.standing-team {
        color: transparent;
        font-size: 0;
    }

    .football-standings .standing-team a,
    .football-standings .standing-team .team-name-button {
        display: block;
        min-width: 0;
        color: var(--ink);
        font-size: 18px;
        font-weight: 900;
        text-decoration: none;
    }

    .football-standings .team-logo {
        display: inline-flex;
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    .football-standings .team-name-logo {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        gap: 7px;
    }

    .football-standings .team-name-logo > span:last-child {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .football-standings .standing-points {
        width: 40px !important;
        color: var(--ink);
        font-size: 20px;
        font-weight: 900;
    }

    .football-standings .standing-played,
    .football-standings .standing-extra,
    .football-standings .standing-loss,
    .football-standings .standing-goals,
    .football-standings .standing-diff {
        width: 28px !important;
        color: var(--ink-soft);
        font-size: 16px;
        font-weight: 700;
    }

    .football-standings .standing-diff {
        width: 38px !important;
    }

    .football-standings .standing-goals {
        display: none !important;
    }

    .standings-section {
        padding: 14px;
        border: 1px solid var(--line);
        border-left: 5px solid var(--club-blue);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: var(--shadow-soft);
    }

    .standings-section-heading {
        padding: 2px 0 12px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--line-soft);
    }

    .standings-section-heading h3 {
        font-size: 23px;
    }

    .standings-section:nth-of-type(2) {
        border-left-color: var(--club-red);
    }

    .final-standings-section {
        border-left-color: var(--club-blue-dark);
        border-top: 3px solid var(--club-red);
    }

    .group-grid {
        gap: 20px;
    }

    .group-tile {
        padding: 0 0 6px;
        border: 1px solid var(--line-soft);
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
    }

    .group-tile strong {
        display: block;
        padding: 11px 12px;
        color: var(--club-blue-dark);
        background: var(--surface-soft);
        border-bottom: 1px solid var(--line-soft);
        font-size: 16px;
        font-weight: 900;
    }

    .standings-section:nth-of-type(2) .group-tile strong {
        color: var(--club-red-dark);
        background: var(--danger-soft);
    }

    .group-tile + .group-tile {
        margin-top: 4px;
    }

    .group-tile .football-standings {
        margin-top: 0;
    }

    .group-tile .football-standings th:first-child,
    .group-tile .football-standings td:first-child {
        padding-left: 12px;
    }

    .group-tile .football-standings th:last-child,
    .group-tile .football-standings td:last-child {
        padding-right: 12px;
    }

    .score-form {
        justify-content: flex-end;
    }

    .pill-list li {
        align-items: stretch;
        flex-direction: column;
    }

    .pill-list li > div,
    .pill-list form.inline {
        width: 100%;
    }

    .pill-list input[type="text"],
    .pill-list input[type="url"] {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .brand {
        font-size: 14px;
    }

    .section-nav {
        display: grid;
        grid-template-columns: 1fr;
    }

    .section-nav a,
    .hero-actions,
    .hero-button,
    .quick-links a,
    button {
        width: 100%;
    }

    .team-hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .visitor-match-card {
        grid-template-columns: 1fr;
    }

    .rules-team-strip nav {
        grid-template-columns: 1fr;
    }

    .rule-card {
        grid-template-columns: 1fr;
    }

    .visitor-live-strip strong {
        grid-row: auto;
    }

    .visitor-follow-card .follow-team {
        min-height: 60px;
        padding: 11px;
    }

    .score-form button,
    .icon-button {
        width: auto;
    }
}

/* Club catalog admin */
.club-admin-layout {
    display: grid;
    gap: 18px;
}

.compact-heading {
    align-items: center;
}

.club-form {
    display: grid;
    grid-template-columns:
        minmax(260px, 1.4fr) minmax(120px, 0.45fr) minmax(260px, 1fr)
        auto;
    gap: 14px;
    align-items: end;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label,
.club-search label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.form-actions {
    display: flex;
    align-items: end;
}

.inline-alert {
    margin: 14px 0 0;
    padding: 11px 13px;
    border-radius: 8px;
    font-weight: 700;
}

.inline-alert.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #ffd0d3;
}

.club-search {
    min-width: 260px;
}

.club-search input {
    width: 100%;
}

.club-table {
    table-layout: auto;
}

.club-table th:nth-child(1),
.club-table td:nth-child(1) {
    width: 62%;
}

.club-table th:nth-child(2),
.club-table td:nth-child(2) {
    width: 16%;
}

.club-table th:nth-child(3),
.club-table td:nth-child(3) {
    width: 22%;
}

.club-table td {
    height: 72px;
    vertical-align: middle;
}

.club-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.club-identity strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-identity small,
.muted-text {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.club-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    color: var(--club-blue-dark);
    background: var(--primary-soft);
    border: 1px solid #d5e4f5;
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
}

.club-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.club-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--ink-soft);
    font-weight: 800;
}

.club-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.club-row-actions form {
    margin: 0;
}

.danger-button {
    color: var(--danger) !important;
    border-color: #f2b8bc !important;
}

.danger-button:hover {
    background: var(--danger-soft) !important;
    border-color: var(--danger) !important;
}

.club-dialog {
    width: min(760px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.club-dialog::backdrop {
    background: rgba(8, 40, 79, 0.42);
    backdrop-filter: blur(2px);
}

.club-edit-form {
    padding: 20px;
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);
}

.dialog-heading h3 {
    margin: 0 0 4px;
    color: var(--ink);
}

.dialog-heading p {
    margin: 0;
    color: var(--muted);
}

.edit-grid {
    grid-template-columns: minmax(260px, 1.2fr) minmax(120px, 0.45fr) minmax(
            260px,
            1fr
        );
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 980px) {
    .club-form,
    .edit-grid {
        grid-template-columns: 1fr;
    }

    .club-search {
        width: 100%;
    }

    .club-table-wrapper {
        overflow-x: auto;
    }

    .club-table {
        min-width: 780px;
    }
}
