/* The archive: the grid of finished events, and one of them in full.
   The strip at the top of a single archive is the same component the landing
   page uses, so only what is new to this page lives here. */

.archive-main {
    width: min(980px, 100% - 2rem);
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.archive-head { margin-bottom: 1.6rem; }
.archive-head h1 { margin: 0 0 0.35rem; font-size: clamp(1.7rem, 5vw, 2.4rem); }

.archive-lede {
    margin: 0;
    max-width: 60ch;
    color: var(--muted, #a0a2ab);
    line-height: 1.55;
}

.archive-state { color: var(--muted, #a0a2ab); }

/* ----- the grid of finished events ------------------------------------- */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.archive-card {
    --cs-accent: #c0392b;
    position: relative;
    display: block;
    padding: 1.15rem 1.2rem 1.1rem;
    border: 1px solid color-mix(in srgb, var(--cs-accent) 40%, transparent);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    background:
        radial-gradient(110% 130% at 15% -15%,
                        color-mix(in srgb, var(--cs-accent) 24%, transparent) 0%,
                        transparent 60%),
        var(--panel, #14161c);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.archive-card:hover {
    border-color: var(--cs-accent);
    transform: translateY(-2px);
}

.archive-card:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 3px; }

.archive-card h2 { margin: 0 0 0.3rem; font-size: 1.15rem; line-height: 1.2; }

.archive-when,
.archive-counts {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted, #a0a2ab);
}

.archive-winner {
    margin: 0.6rem 0 0.4rem;
    font-size: 0.9rem;
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
}

.archive-winner span { color: var(--muted, #a0a2ab); font-size: 0.8rem; }
.archive-winner strong { color: var(--cs-accent); }

/* ----- one of them ------------------------------------------------------ */
.archive-back {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--muted, #a0a2ab);
    text-decoration: none;
    font-size: 0.9rem;
}

.archive-back:hover { color: var(--text, #e8e8ea); }

.archive-section {
    margin: 2rem 0 0.8rem;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

/* ----- the final table -------------------------------------------------- */
.standings {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.standing {
    display: grid;
    grid-template-columns: 2.2rem 1fr auto;
    align-items: center;
    gap: 0.2rem 0.75rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--line, #262a33);
    border-radius: 12px;
    background: var(--panel, #14161c);
}

.standing.is-empty { display: block; color: var(--muted, #a0a2ab); }

.standing.is-first { border-color: color-mix(in srgb, #e8b64c 55%, transparent); }

.standing-place {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--muted, #a0a2ab);
    text-align: center;
}

.standing.is-first .standing-place { color: #e8b64c; }

.standing-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* The team's own colour, as a dot rather than as the text -- some of them are
   dark enough that coloured text would be unreadable on this panel. */
.standing-name::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--team, transparent);
    flex: none;
}

.standing-points {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    grid-row: 1;
    grid-column: 3;
}

.standing-members,
.standing-lines {
    grid-column: 2 / 4;
    font-size: 0.82rem;
    color: var(--muted, #a0a2ab);
}

.standing-lines { font-style: italic; }

/* ----- what there was to do -------------------------------------------- */
.archive-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.archive-task {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line, #262a33);
    border-radius: 10px;
    background: var(--panel, #14161c);
}

.task-day {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted, #a0a2ab);
}

.task-points {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted, #a0a2ab);
    white-space: nowrap;
}

@media (max-width: 560px) {
    .standing { grid-template-columns: 2rem 1fr auto; }
    .archive-task { grid-template-columns: 1fr auto; }
    .task-day { grid-column: 1 / 3; }
}
