:root {
    --ink: #06263b;
    --muted: #5d7180;
    --line: #d8e3ea;
    --paper: #ffffff;
    --wash: #f4f8fb;
    --blue: #336699;
    --cyan: #02a1ea;
    --green: #70c406;
    --gold: #f6c304;
    --orange: #fb5000;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--wash);
    font-family: "Segoe UI", Arial, sans-serif;
}

a {
    color: inherit;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    min-height: 76px;
}

.site-brand,
.site-header nav,
.hero-actions,
.community-actions,
.panel-heading,
.panel-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.site-brand {
    text-decoration: none;
    font-weight: 800;
}

.site-brand img {
    width: 44px;
    height: 44px;
}

.site-header nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-header nav a,
.site-footer a {
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

main {
    overflow: hidden;
}

.hero,
.section-grid,
.byte-band,
.community-strip,
.admin-shell,
.admin-panel,
.auth-panel,
.status-message {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
    align-items: center;
    min-height: calc(100vh - 148px);
    padding: 40px 0 72px;
    gap: 40px;
}

.hero-logo {
    width: clamp(112px, 18vw, 188px);
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 18px 32px rgba(6, 38, 59, .16));
}

.eyebrow {
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: .94;
    letter-spacing: 0;
    margin-bottom: 22px;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1;
    margin-bottom: 16px;
}

h3 {
    font-size: 1.15rem;
}

.hero-lede,
.section-copy,
.byte-heading p,
.community-strip p {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.65;
    max-width: 660px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: var(--blue);
    color: white;
    font-weight: 800;
    padding: 10px 16px;
    text-decoration: none;
}

.button.secondary {
    background: white;
    color: var(--blue);
}

.hero-emblem {
    display: grid;
    place-items: center;
    min-height: 420px;
    border-left: 1px solid var(--line);
}

.hero-emblem img {
    width: min(520px, 100%);
    filter: drop-shadow(0 24px 45px rgba(6, 38, 59, .18));
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
    gap: 36px;
    padding: 72px 0;
    border-top: 1px solid var(--line);
}

.leaderboard {
    display: grid;
    gap: 14px;
}

.leader-card,
.byte-card,
.admin-card,
.tally-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.leader-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) minmax(70px, auto);
    align-items: center;
    gap: 18px;
    padding: 18px;
}

.leader-card p,
.byte-card p {
    color: var(--muted);
    margin-bottom: 0;
}

.place {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    font-weight: 900;
}

.place-1 .place {
    background: var(--gold);
    color: var(--ink);
}

.place-2 .place {
    background: var(--cyan);
}

.place-3 .place {
    background: var(--orange);
}

.leader-card strong {
    font-size: 2rem;
}

.tally-section {
    padding-top: 36px;
}

.tally-list {
    display: grid;
    gap: 14px;
}

.tally-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.tally-card p {
    color: var(--muted);
    margin-bottom: 0;
}

.tally-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.tally-counts span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fbfd;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 800;
    padding: 6px 10px;
}

.tally-counts strong {
    color: var(--ink);
    font-size: 1.15rem;
}

.byte-band {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
    gap: 36px;
    padding: 72px 0;
}

.bytes-list {
    display: grid;
    gap: 14px;
}

.byte-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px;
}

.latest-pill {
    display: inline-flex;
    border-radius: 999px;
    background: #eaf7ff;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 900;
    margin-bottom: 10px;
    padding: 4px 10px;
}

.icon-button {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    font-size: .8rem;
    font-weight: 900;
    text-decoration: none;
}

.community-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 0 72px;
}

.site-footer {
    min-height: 72px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.site-footer div {
    display: grid;
    gap: 4px;
}

.admin-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 48px 0 20px;
}

.page-lede {
    color: var(--muted);
}

.status-message {
    margin-top: 12px;
    border: 1px solid #b5dfc8;
    border-radius: 8px;
    background: #effaf4;
    color: #10582c;
    padding: 12px 16px;
}

.admin-panel,
.auth-panel {
    margin-top: 24px;
    margin-bottom: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    padding: 24px;
}

.panel-heading {
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.month-field {
    max-width: 280px;
    margin-bottom: 18px;
}

.admin-grid,
.byte-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-card {
    padding: 16px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
}

input,
textarea,
input[type=file] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    padding: 10px 12px;
}

textarea {
    min-height: 96px;
}

.check-row {
    align-content: center;
    grid-template-columns: 20px minmax(0, 1fr);
}

.check-row input {
    width: 18px;
}

.full {
    grid-column: 1 / -1;
}

.table-wrap {
    margin-top: 24px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-decoration: underline;
}

#blazor-error-ui {
    display: none;
}

@media (max-width: 820px) {
    .site-header,
    .site-footer,
    .community-strip,
    .admin-shell {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .section-grid,
    .byte-band,
    .admin-grid,
    .byte-form {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 22px;
    }

    .hero-emblem {
        min-height: 240px;
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 28px;
    }

    .leader-card {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .leader-card strong {
        grid-column: 2;
        font-size: 1.5rem;
    }

    .hero-actions,
    .community-actions,
    .panel-actions,
    .tally-card {
        flex-wrap: wrap;
    }

    .tally-counts {
        justify-content: flex-start;
    }
}
