/* fs-overview: see CLAUDE.md conventions - theme tokens (--dbn-*), --fs-live only for live / action-needed things. */

/* The event overview (Pages/Event/Index.cshtml): a race-day screen - a strip per competition, what needs attention. */

/* Head: the event's name, its date and place quiet beneath it. */
.fs-ov-head { align-items: flex-start; }
.fs-ov-title { min-width: 0; }
.fs-ov-title h1 { margin-bottom: 2px; }
.fs-ov-sub { margin: 0; font-size: .8125rem; color: var(--dbn-text-muted); }

/* Strips left, attention right; on a narrow screen attention comes first. */
.fs-ov { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 14px; align-items: start; }
.fs-ov-races { min-width: 0; }
.fs-ov-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.fs-ov-section-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.fs-ov-section-head a { font-size: .8125rem; }
@media (max-width: 991.98px) {
    .fs-ov { grid-template-columns: minmax(0, 1fr); }
    .fs-attention { order: -1; }
}

/* --- A competition ------------------------------------------------------------------------------------------------ */
.fs-races { display: grid; gap: 8px; }
.fs-race {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto minmax(0, auto);
    grid-template-areas: "id phase clock counts";
    align-items: center;
    gap: 6px 18px;
    padding: 12px 14px 14px;
    background: var(--dbn-raised);
    border: 1px solid var(--dbn-border);
    border-radius: var(--dbn-radius);
    overflow: hidden;
}
.fs-race[aria-current="true"] { border-color: var(--dbn-ink); box-shadow: inset 3px 0 0 var(--dbn-ink); }

.fs-race-id { grid-area: id; min-width: 0; }
.fs-race-name { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; font-weight: 600; font-size: 1rem; color: var(--dbn-text); text-decoration: none; }
.fs-race-name:hover { text-decoration: underline; color: var(--dbn-text); }
.fs-race-name:focus-visible { outline: 2px solid var(--dbn-accent); outline-offset: 2px; border-radius: var(--dbn-radius-sm, 4px); }
.fs-race-name .fs-swatch { flex: none; }
.fs-race-meta { margin-top: 2px; font-size: .78rem; color: var(--dbn-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fs-race-phase { grid-area: phase; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.fs-race-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
    color: var(--dbn-text-muted); background: var(--dbn-tint);
}
.fs-race-note { font-size: .78rem; color: var(--dbn-text-muted); }

.fs-race-clock { grid-area: clock; display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.fs-race-clock:empty { display: none; }
.fs-race-clock-label { font-size: .7rem; color: var(--dbn-text-muted); }
.fs-race-clock-value { font-size: 1.9rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--dbn-text-muted); }

.fs-race-counts { grid-area: counts; display: flex; gap: 14px; margin: 0; }
.fs-race-count { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.fs-race-count dt { font-size: .7rem; font-weight: 400; color: var(--dbn-text-muted); white-space: nowrap; }
.fs-race-count dd { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.2; color: var(--dbn-text); }

/* How far the field is: finished, out, on course - along the strip's foot. */
.fs-race-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; display: flex; background: var(--dbn-border-soft); }
.fs-race-bar span { display: block; height: 100%; }
.fs-race-bar-finished { background: var(--dbn-ink); }
.fs-race-bar-out { background: var(--dbn-text-dim, var(--dbn-text-muted)); opacity: .5; }
.fs-race-bar-onCourse { background: color-mix(in srgb, var(--dbn-ink) 30%, transparent); }

/* Phases: only a running clock and a closing in the live red. */
.fs-race[data-state="idle"] .fs-race-name { color: var(--dbn-text); }
.fs-race[data-state="running"] .fs-race-chip,
.fs-race[data-state="armed"] .fs-race-chip,
.fs-race[data-state="closed"] .fs-race-chip { color: var(--dbn-text); background: var(--dbn-tint); }
.fs-race[data-state="running"] .fs-race-chip::before,
.fs-race[data-state="closed"] .fs-race-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fs-live); }
.fs-race[data-state="running"] .fs-race-chip::before { animation: fs-ov-pulse 1.6s ease-in-out infinite; }
.fs-race[data-state="running"] .fs-race-clock-value,
.fs-race[data-state="armed"] .fs-race-clock-value,
.fs-race[data-state="closed"] .fs-race-clock-value { color: var(--fs-live); }
.fs-race[data-state="armed"] { border-color: var(--fs-live); box-shadow: inset 3px 0 0 var(--fs-live); background: color-mix(in srgb, var(--fs-live-soft) 60%, var(--dbn-raised)); }
.fs-race[data-state="armed"] .fs-race-chip { color: #fff; background: var(--fs-live); }
.fs-race[data-state="armed"][aria-current="true"] { box-shadow: inset 3px 0 0 var(--fs-live), 0 0 0 1px var(--dbn-ink); }
.fs-race[data-state="done"] .fs-race-chip { color: var(--dbn-ok); background: color-mix(in srgb, var(--dbn-ok) 13%, transparent); }
.fs-race[data-state="done"] .fs-race-count[data-count="onCourse"] dd,
.fs-race[data-state="idle"] .fs-race-count dd { color: var(--dbn-text-muted); }

@keyframes fs-ov-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
    .fs-race[data-state="running"] .fs-race-chip::before { animation: none; }
}

/* Tablet: the clock beside the name, phase and counts beneath. Phone: one column. */
@media (max-width: 1199.98px) {
    .fs-race { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id clock" "phase counts"; }
    .fs-race-phase { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
}
@media (max-width: 575.98px) {
    .fs-race { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "clock" "phase" "counts"; gap: 8px; }
    .fs-race-clock { align-items: flex-start; }
    .fs-race-counts { justify-content: space-between; }
    .fs-race-count { align-items: flex-start; }
}

/* --- Needs attention ---------------------------------------------------------------------------------------------- */
.fs-attention .dbn-panel-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.fs-attention-total { min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--dbn-text-muted); background: var(--dbn-tint); }
.fs-attention-total[data-tone="action"] { color: #fff; background: var(--fs-live); }

.fs-attention-list { list-style: none; margin: 0 calc(-1 * var(--fs-panel-px, 14px)); padding: 0; }
.fs-attention-list li + li { border-top: 1px solid var(--dbn-border-soft); }
.fs-attention-list a {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
    padding: 8px var(--fs-panel-px, 14px);
    color: var(--dbn-text); text-decoration: none; font-size: .875rem; line-height: 1.35;
}
.fs-attention-list a:hover { background: var(--dbn-hover); color: var(--dbn-text); }
.fs-attention-list a:hover .fs-attention-text { text-decoration: underline; }
.fs-attention-list a:focus-visible { outline: 2px solid var(--dbn-accent); outline-offset: -2px; }
.fs-attention-text { overflow-wrap: anywhere; }
.fs-attention-dot { width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); background: var(--dbn-text-muted); }
.fs-attention-go { font-size: .75rem; color: var(--dbn-text-muted); }
li[data-severity="action"] .fs-attention-dot { background: var(--fs-live); box-shadow: 0 0 0 3px var(--fs-live-soft); }
li[data-severity="action"] .fs-attention-text { font-weight: 600; }
li[data-severity="warn"] .fs-attention-dot { background: var(--dbn-warn); }
li[data-severity="info"] .fs-attention-text { color: var(--dbn-text-muted); }

.fs-attention-calm { margin: 0; padding: 4px 0; font-size: .875rem; color: var(--dbn-text-muted); }
.fs-attention-calm .fa { color: var(--dbn-ok); margin-right: 4px; }
