/*
 * Admin Tournament History styles.
 *
 * Owns the styling for views/tournament-history.js (list + the details
 * modal). Token-driven light charter; the list bits are scoped under
 * `.main` and the details-modal bits under `.modal--light` (the modal
 * renders in #modal-root, OUTSIDE `.main`, and re-scopes the light
 * palette onto itself — so the kit `.main .data-table` rules do NOT reach
 * inside it; the mini-tables are styled explicitly here).
 *
 * Loaded globally from index.html, so
 * every selector is scoped to `.main` / `.modal--light` / a `th-*` class.
 * The `.tournament-*` classes used to live (dark dialect) in history.css,
 * shared with this view; they moved here, reskinned, when this section
 * got its own stylesheet.
 */

/* ─── List: stats row + mono id pill ──────────────────────────────── */
.main .th-stats {
    margin-bottom: var(--space-base, 16px);
}
.main .th-stats:empty {
    display: none;
}
.main .th-id {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--color-text-secondary, #475467);
    background: var(--surface-sunken, #F4F5F7);
    border: 1px solid var(--color-border, #E4E7EC);
    border-radius: 6px;
    padding: 2px 7px;
    letter-spacing: 0.01em;
}

/* ════════════════════════════════════════════════════════════════════
 * DETAILS MODAL — light reskin (scoped under .modal--light so it doesn't
 * leak and gets the modal's light palette). The dialog is
 * `.modal--light .modal--form .modal--wide` (kit shell: pinned header +
 * scrolling body + pinned footer).
 * ════════════════════════════════════════════════════════════════════ */

/* Header heading cluster: title + status badge inline. */
.modal--light .th-details__heading {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 10px);
    flex-wrap: wrap;
    min-width: 0;
}
.modal--light .th-details__heading .modal__title {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Body: a stack of light section cards. */
.modal--light .tournament-details {
    display: grid;
    gap: var(--space-base, 14px);
}
.modal--light .tournament-details__section {
    border: 1px solid var(--color-border, #E4E7EC);
    border-radius: var(--radius-md, 10px);
    padding: var(--space-base, 14px);
    background: var(--surface-sunken, #F9FAFB);
}
.modal--light .tournament-details__section-title {
    margin: 0 0 var(--space-sm, 10px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted, #667085);
}

/* Fact rows (definition lists). */
.modal--light .tournament-details__facts {
    display: grid;
    gap: 8px;
    margin: 0;
}
.modal--light .tournament-details__fact {
    display: grid;
    grid-template-columns: minmax(128px, 0.35fr) minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
}
.modal--light .tournament-details__fact dt {
    color: var(--color-text-muted, #667085);
    font-size: 12px;
}
.modal--light .tournament-details__fact dd {
    margin: 0;
    color: var(--color-text, #101828);
    overflow-wrap: anywhere;
}

/* Winner section — sparing accent spotlight (never colour alone: it has
 * the "Winner" title + the trophy glyph + the name). */
.modal--light .tournament-details__winner {
    border-color: rgba(245, 200, 66, 0.55);
    background: rgba(245, 200, 66, 0.10);
}
.modal--light .tournament-winner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.modal--light .tournament-winner-card__icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(245, 200, 66, 0.18);
    border: 1px solid rgba(245, 200, 66, 0.55);
    color: var(--color-warning, #B54708);
}
.modal--light .tournament-winner-card__body {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.modal--light .tournament-winner-card__name {
    color: var(--color-text, #101828);
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* Mini-tables (standings / podium / payouts). `.data-table` base styling
 * is `.main`-scoped and does NOT reach the modal, so style fully here. */
.modal--light .tournament-details__table-scroll,
.modal--light .tournament-details__mini-table {
    margin-top: 10px;
    overflow-x: auto;
}
.modal--light .tournament-details__table-scroll {
    max-height: 430px;
    overflow-y: auto;
    border: 1px solid var(--color-border, #E4E7EC);
    border-radius: var(--radius-md, 8px);
}
.modal--light .tournament-details__table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--color-surface, #FFFFFF);
}
.modal--light .tournament-details__table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-sunken, #F4F5F7);
    color: var(--color-text-muted, #667085);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--color-border, #E4E7EC);
}
.modal--light .tournament-details__table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--hairline, #EAECF0);
    color: var(--color-text, #101828);
}
.modal--light .tournament-details__table tbody tr:last-child td {
    border-bottom: 0;
}
.modal--light .tournament-details__table .muted {
    color: var(--color-text-muted, #667085);
}

/* Timeline. */
.modal--light .tournament-timeline {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.modal--light .tournament-timeline__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hairline, #EAECF0);
}
.modal--light .tournament-timeline__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.modal--light .tournament-timeline__item span {
    color: var(--color-text-muted, #667085);
    font-size: 12px;
}
.modal--light .tournament-timeline__item strong {
    color: var(--color-text, #101828);
    font-weight: 600;
    text-align: right;
}

@media (max-width: 640px) {
    .modal--light .tournament-details__fact,
    .modal--light .tournament-timeline__item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .modal--light .tournament-timeline__item {
        display: grid;
    }
    .modal--light .tournament-timeline__item strong {
        text-align: left;
    }
}
