/*
 * Streaming Stats — components that are genuinely this app's own.
 *
 * Everything general lives in shared/ui (tokens.css + system.css); everything
 * here is a shape the design system does not have because no other app needs
 * it. The one hard rule carries over: reference tokens, never raw values.
 */

/* ── Small shared bits ─────────────────────────────────────────────────── */

.sub { color: var(--muted); font-size: 0.85rem; }

/* shared/ui styles the flash itself but not a dismiss control. */
.flash-close {
    margin-left: auto;
    padding: 0 0.2rem;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}
.flash-close:hover { opacity: 1; }

/* ── Ranked lists ──────────────────────────────────────────────────────── */

/* The core shape of the whole app: a numbered list with artwork, a name, a
   second line, and a figure on the right. Artists and tracks share it. */
.rank-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-row {
    display: grid;
    grid-template-columns: 2rem 2.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.5rem;
    border-radius: var(--r-s);
}
.rank-row:hover { background: var(--card-2); }

.rank-position {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    color: var(--muted);
    text-align: right;
}
/* The top three carry the accent — the only decoration in the list, and it
   encodes rank rather than being applied for its own sake. */
.rank-row:nth-child(-n + 3) .rank-position { color: var(--primary); font-weight: 700; }

.rank-art {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--r-s);
    object-fit: cover;
    background: var(--card-2);
}
/* Artwork is optional in every payload; the placeholder keeps the column from
   collapsing and the rows from jittering. */
.rank-art-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.rank-body { min-width: 0; }
.rank-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.rank-name:hover { color: var(--primary); text-decoration: underline; }
.rank-meta {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-figure {
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── Export links ──────────────────────────────────────────────────────── */

/* Sits in a card foot: two small links, visually quieter than a button row,
   because exporting is an occasional action next to a primary one. */
.export-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--muted);
}
.export-links a { color: var(--text-2); text-decoration: none; }
.export-links a:hover { color: var(--primary); text-decoration: underline; }

/* ── Connection page ───────────────────────────────────────────────────── */

.scope-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--text-2);
}
.scope-list code { font-family: var(--font-mono); font-size: 0.85em; }

/* A connection can be linked, linked-but-broken, or absent, and the three need
   to be distinguishable at a glance rather than by reading the paragraph. */
.link-state {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}
.link-state-ok { color: var(--pos); }
.link-state-broken { color: var(--warn); }
.link-state-off { color: var(--muted); }

/* ── Landing page ──────────────────────────────────────────────────────── */

.landing-lead {
    max-width: 34rem;
    margin: 0 auto 1.5rem;
    text-align: center;
    color: var(--text-2);
}
.landing-lead h1 { font-family: var(--font-display); margin-bottom: 0.5rem; }

@media (max-width: 560px) {
    /* The figure is the first thing to go: rank, art and name all outrank it. */
    .rank-row { grid-template-columns: 1.6rem 2.2rem minmax(0, 1fr); }
    .rank-figure { display: none; }
}
