/* ============================================================
   Live control tower — real-time team progress dashboard.
   Dark, dense, legible from a regie screen. Black/yellow theme.
   ============================================================ */

body {
    display: block;
    align-items: unset;
    justify-content: unset;
    padding: 0;
}

/* --- Header ------------------------------------------------- */

.live-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.2rem;
    background: #111;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

.live-header h1 {
    font-size: 1rem;
    font-weight: normal;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0;
}

.live-header__back {
    color: #aaa;
    text-decoration: none;
    font-size: 1.3rem;
    line-height: 1;
}
.live-header__back:hover { color: #fff; }

.live-header__filters {
    display: flex;
    gap: 0.4rem;
}

.live-filter {
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
    border: 1px solid #444;
    background: #1c1c1c;
    color: #999;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.live-filter:hover { background: #262626; color: #ddd; }
.live-filter.is-active {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: #2a2600;
}

.live-header__meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.live-clock {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: #ddd;
}

.live-conn {
    font-size: 0.7rem;
    color: #4caf50;
    transition: color 0.3s;
}
.live-conn.is-stale { color: #b9402f; }

/* --- Board -------------------------------------------------- */

.live-board {
    width: 100%;
    margin: 0 auto;
    padding: 1.2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    align-items: start;
}

/* Two heats per row on wide screens (regie / PC). */
@media (min-width: 1100px) {
    .live-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.live-empty {
    grid-column: 1 / -1;
    color: var(--color-muted);
    text-align: center;
    padding: 3rem 1rem;
}

/* --- Heat block --------------------------------------------- */

.live-heat {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #141414;
}

.live-heat.is-stopped { opacity: 0.55; }

.live-heat__head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    background: #1b1b1b;
    border-bottom: 1px solid #2a2a2a;
}

.live-heat__dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    flex: none;
    box-shadow: 0 0 0 1px #00000088 inset;
}

.live-heat__name {
    font-size: 0.95rem;
    color: #f0f0f0;
    letter-spacing: 0.04em;
}

.live-heat__clock {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.live-heat__sched {
    font-size: 0.72rem;
    color: var(--color-muted);
}

.live-heat__timer {
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    color: #ddd;
}
.live-heat__timer.is-running { color: var(--color-accent); }
.live-heat__timer.is-waiting { color: #888; }

.live-heat__tag {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid #444;
    color: #999;
}
.live-heat__tag.is-stopped { color: #b9402f; border-color: #5a241c; }
.live-heat__tag.is-hidden  { color: #777; }

/* --- Team row ----------------------------------------------- */

.live-team {
    display: grid;
    grid-template-columns: 2.2rem minmax(7rem, 1fr) auto minmax(8rem, 11rem);
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid #202020;
}
.live-team:last-child { border-bottom: none; }
.live-team.state-not_started { opacity: 0.6; }
.live-team { cursor: pointer; }
.live-team:hover { background: #1b1b1b; }

.live-team__line {
    font-size: 0.8rem;
    color: #777;
    text-align: center;
}

.live-team__name {
    font-size: 0.9rem;
    color: #e8e8e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-team__div {
    font-size: 0.68rem;
    color: var(--color-muted);
    text-transform: uppercase;
    margin-left: 0.4rem;
}

/* Station strip — kept on a single line (board widens to fit). */
.live-strip {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
}

.live-cell {
    flex: none;
    cursor: help;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    color: #555;
    background: #1f1f1f;
    border: 1px solid #2c2c2c;
}
.live-cell.is-run { border-radius: 50%; }
.live-cell.is-done {
    background: #1d3a22;
    border-color: #2f6b3a;
    color: #7fd99a;
}
.live-cell.is-current {
    background: #2a2600;
    border-color: var(--color-accent);
    color: var(--color-accent);
    animation: live-pulse 1.4s ease-in-out infinite;
}
.live-cell.is-pause {
    background: #07313a;
    border-color: #1f9fb8;
    color: #5fd6ec;
    animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* Status badge */
.live-badge {
    justify-self: end;
    text-align: right;
    font-size: 0.78rem;
    line-height: 1.2;
}
.live-badge__label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
}
.live-badge__sub {
    display: block;
    font-size: 0.72rem;
    color: #999;
}

.live-badge.state-not_started .live-badge__label { color: #666; }
.live-badge.state-running     .live-badge__label { color: var(--color-accent); }
.live-badge.state-paused      .live-badge__label { color: #5fd6ec; }
.live-badge.state-finished    .live-badge__label { color: #6fd98a; }
.live-badge.state-abandon     .live-badge__label { color: #c66; }
.live-badge.state-dns         .live-badge__label { color: #777; }

@media (max-width: 640px) {
    .live-team {
        grid-template-columns: 1.8rem 1fr auto;
        grid-template-areas:
            "line name badge"
            "strip strip strip";
        row-gap: 0.45rem;
    }
    .live-team__line  { grid-area: line; }
    .live-team__name  { grid-area: name; }
    .live-badge       { grid-area: badge; }
    .live-strip       { grid-area: strip; }
}

/* --- Hover tooltip (station details for a team) ------------- */

.live-tip {
    position: fixed;
    z-index: 9999;
    min-width: 12rem;
    max-width: 22rem;
    padding: 0.5rem 0.7rem;
    background: #0d0d0d;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.65);
    font-size: 0.78rem;
    color: #ddd;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.08s ease-out;
}
.live-tip.is-visible { opacity: 1; }

.live-tip__title {
    color: var(--color-accent);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.live-tip__row {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 0.08rem 0;
}
.live-tip__k { color: var(--color-muted); }
.live-tip__v { color: #f0f0f0; text-align: right; }
