:root {
    --navy: #091A2E;
    --gold: #C6A15B;
    --gold-text: #6E5420;
    --ivory: #F5F2E9;
    --page: #F5F2E9;
    --surface: #FFFFFF;
    --ink: #091A2E;
    --steel: #738092;
    --steel-text: #3D4A58;
}

* { box-sizing: border-box; }

html {
    overflow-x: hidden;
    overflow-x: clip;
    max-width: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    display: flex;
    flex-direction: column;
    font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--page);
    color: var(--ink);
    line-height: 1.55;
}

a { color: var(--gold-text); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid rgba(9, 26, 46, 0.12);
    min-width: 0;
    max-width: 100%;
}

.brand {
    flex: 0 0 auto;
}

.brand img {
    display: block;
    height: 56px;
    width: auto;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: thin;
}

.topbar-nav > * {
    flex: 0 0 auto;
}

.who {
    color: var(--steel-text);
    font-size: 0.9rem;
}

main {
    flex: 1;
    width: 100%;
}

.hero {
    text-align: center;
    padding: 2.5rem 1.25rem 3rem;
    background: var(--page);
}

.hero-logo {
    display: block;
    width: min(38rem, 92%);
    height: auto;
    margin: 0 auto;
}

.motto {
    margin: 0.25rem 0 0.75rem;
    color: var(--gold-text);
    font-size: clamp(1.15rem, 2.4vw, 1.65rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
}

.lede {
    max-width: 36rem;
    margin: 0 auto;
    color: var(--ink);
    font-size: 1.05rem;
}

.hero-actions { margin: 1.75rem 0 0; }
.signed-in { margin-top: 1.25rem; color: var(--steel-text); }

.pitch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1.25rem 3.5rem;
}

.pitch article {
    background: var(--surface);
    border: 1px solid rgba(9, 26, 46, 0.12);
    border-top: 3px solid var(--gold);
    padding: 1.25rem 1.15rem 1.4rem;
}

.pitch h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-text);
}

.pitch p { margin: 0; color: var(--ink); }

.auth-panel {
    max-width: 26rem;
    margin: 2rem auto 3rem;
    padding: 0 1.25rem;
}

.auth-panel h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    color: var(--navy);
}

.auth-panel .lede { margin: 0 0 1.25rem; color: var(--steel-text); }

.flash {
    max-width: 40rem;
    margin: 1rem auto;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gold);
    background: var(--surface);
    color: var(--navy);
}

label { display: block; margin: 0.85rem 0 0.3rem; font-size: 0.9rem; }

select, textarea,
input[type=email],
input[type=password],
input[type=text],
input[type=file] {
    width: 100%;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--steel);
    background: var(--surface);
    color: var(--navy);
    font: inherit;
}
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.inline-actions .btn { margin-top: 0; padding: 0.4rem 0.7rem; font-size: 0.75rem; }
.queue-nav, .filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1rem;
}
.queue-nav a[aria-current="page"], .filter-tabs a[aria-current="page"] {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}
.queue-card { text-decoration: none; color: inherit; }
.queue-card:hover { text-decoration: none; border-color: var(--gold); }
.queue-card .meta {
    margin: 0 0 0.35rem;
    color: var(--gold-text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
}
.queue-card .count { margin: 0; font-size: 1.75rem; font-weight: 700; }
.stack-form { display: grid; gap: 0.45rem; }
.stack-form .meta {
    margin: 0;
    color: var(--gold-text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
}
.stack-form .btn { margin-top: 0; }
.invite-form { max-width: 28rem; margin-bottom: 1.5rem; }

.btn,
button {
    display: inline-block;
    margin-top: 1rem;
    background: var(--gold);
    color: var(--navy);
    border: 0;
    padding: 0.65rem 1.25rem;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover,
button:hover { filter: brightness(1.08); text-decoration: none; }

.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }

.btn-ghost {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--navy);
}

.topbar-nav .btn,
.topbar-nav button { margin-top: 0; }

footer {
    margin-top: auto;
    width: 100%;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid rgba(9, 26, 46, 0.12);
    color: var(--steel-text);
    font-size: 0.8rem;
    text-align: center;
}
footer p {
    margin: 0 auto 0.75rem;
    max-width: 52rem;
}
footer .copyright a { color: var(--gold-text); }
.legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin: 0 auto;
    max-width: none;
}
.legal-links a { color: var(--gold-text); }
.ack-list {
    margin: 1.25rem 0 0;
    padding: 0.85rem 1rem 1rem;
    border: 1px solid rgba(9, 26, 46, 0.12);
    background: var(--surface);
}
.ack-list legend {
    padding: 0 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-text);
    font-weight: 700;
}
.ack {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin: 0.65rem 0 0;
    font-size: 0.92rem;
}
.ack input[type=checkbox] {
    width: auto;
    margin-top: 0.3rem;
    flex: 0 0 auto;
}
.legal-doc { max-width: 42rem; }
.legal-body { line-height: 1.65; }
.legal-doc .meta { color: var(--steel-text); font-size: 0.85rem; }

body.home .topbar {
    position: relative;
    background: var(--page);
    border-bottom: 1px solid rgba(9, 26, 46, 0.08);
}

body.auth .topbar-nav > a.btn { display: none; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.topbar-nav a {
    color: var(--navy);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
    text-decoration: none;
}
.topbar-nav a:hover { color: var(--gold-text); text-decoration: none; }

.page {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}
.kicker {
    margin: 0 0 0.4rem;
    color: var(--gold-text);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
}
.page h1 {
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.conf-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) {
    .conf-grid { grid-template-columns: 1fr 1fr; }
}
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
table.standings {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}
.standings caption {
    text-align: left;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.65rem 0.75rem;
    color: var(--gold-text);
    font-weight: 700;
}
.standings th, .standings td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(9, 26, 46, 0.12);
    text-align: left;
}
.standings th { color: var(--steel-text); font-size: 0.72rem; letter-spacing: 0.1em; }
.standings .num { text-align: right; }
.matchups { display: grid; gap: 0.75rem; }
.match {
    background: var(--surface);
    border: 1px solid rgba(9, 26, 46, 0.12);
    border-left: 3px solid var(--gold);
    padding: 0.85rem 1rem;
}
.match .meta { color: var(--steel-text); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.4rem; }
.team-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 700; }
.team-line .pts { font-size: 1.4rem; }
.cards { display: grid; gap: 0.75rem; }
@media (min-width: 768px) {
    .cards { grid-template-columns: 1fr 1fr; }
}
.card {
    background: var(--surface);
    border: 1px solid rgba(9, 26, 46, 0.12);
    padding: 1rem;
}
.club-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.club-mark .club-name {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}
.club-mark a.club-name:hover { color: var(--gold-text); text-decoration: none; }
.club-logo,
.club-monogram {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--ivory);
}
.club-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #F5F2E9;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0;
}
.club-mark-sm { white-space: nowrap; }
.club-mark-sm .club-logo,
.club-mark-sm .club-monogram { width: 28px; height: 28px; font-size: 0.85rem; }
.club-mark-lg .club-logo,
.club-mark-lg .club-monogram { width: 56px; height: 56px; font-size: 1.35rem; }
.club-mark-xl .club-logo,
.club-mark-xl .club-monogram { width: 88px; height: 88px; font-size: 2rem; }
.club-mark-xl .club-name { font-size: clamp(1.75rem, 4vw, 2.6rem); text-transform: uppercase; letter-spacing: 0.02em; }
.meta-inline { color: var(--steel-text); font-weight: 600; font-size: 0.78rem; }
.conference-heading {
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 1.05rem;
}
.franchise-directory .cards { grid-template-columns: 1fr; }
.franchise-card {
    display: block;
    color: inherit;
    text-decoration: none;
    border-top: 3px solid var(--gold);
}
.franchise-card:hover { text-decoration: none; border-color: var(--navy); }
.franchise-card .meta {
    margin: 0.45rem 0 0;
    color: var(--gold-text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
}
.franchise-card .card-links { margin: 0.35rem 0 0; color: var(--steel-text); font-size: 0.85rem; }
.profile-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
    padding: 1.25rem 0 1.5rem;
    border-top: 4px solid var(--gold);
    margin-bottom: 1.5rem;
}
.profile-record .label {
    color: var(--steel-text);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.72rem;
}
.profile-record .record { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.franchise-profile h2 { margin: 1.75rem 0 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; font-size: 1rem; }
.identity-form {
    display: grid;
    gap: 1rem;
    max-width: 36rem;
    margin: 0 0 2rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid rgba(9, 26, 46, 0.12);
}
.identity-preview { margin-bottom: 0.25rem; }
.identity-fields .btn { margin-top: 0.85rem; }

.player-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    align-items: flex-end;
    margin: 1.25rem 0 1rem;
}
.player-filters label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--steel-text);
    font-weight: 700;
}
.player-filters input,
.player-filters select {
    min-width: 12rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(9, 26, 46, 0.18);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}
.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    margin: 0 0 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.letter-nav a {
    color: var(--navy);
    text-decoration: none;
}
.letter-nav a:hover,
.letter-nav a[aria-current="page"] {
    color: var(--gold-text);
    text-decoration: none;
}

@media (max-width: 800px) {
    .pitch { grid-template-columns: 1fr; }
    .brand img { height: 44px; }
    .topbar { flex-wrap: wrap; }
    .topbar-nav {
        flex: 1 1 100%;
        width: 100%;
        margin: 0 -1.5rem;
        padding: 0.2rem 1.5rem 0.45rem;
    }
}
