/* Projector view. Sized for a room, not a laptop: bigger, higher contrast, and
   legible from the back row. */

body.live {
    overflow: hidden;
    background: radial-gradient(1300px 800px at 50% -15%, #16243f 0%, var(--bg) 60%);
    display: flex;
    flex-direction: column;
}

/* ---- header ---- */

.live-top {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 16px 34px;
    border-bottom: 1px solid var(--line);
    flex: none;
}

.live .runtime-note {
    padding: 10px 34px;
    font-size: 17px;
}

/* ---------------------------------------------------------------------------
 * The one line worth stopping the room for.
 *
 * Round 2 is the obvious moment: thirty people have just watched a saved
 * ticket reach nobody, and thirty seconds of everybody reading the same
 * sentence is worth more than any of them reading it alone. It lives on the
 * wall and nowhere else - nothing here reaches into anybody's editor.
 * ------------------------------------------------------------------------ */
.live .moment {
    margin: 0;
    padding: 16px 34px;
    background: rgba(255, 200, 87, .12);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--warn);
    color: var(--warn);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
}

.headline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 21px;
    font-weight: 600;
    white-space: nowrap;
}

.headline .mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-strong);
}

.big-stats {
    display: flex;
    gap: 44px;
    margin-left: auto;
}

.big {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

.big .value {
    font-size: 52px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.big .label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-top: 6px;
}

/* The rate is the number that leaps when the room runs together. */
#stat-rate { color: var(--accent); }

.live-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
    white-space: nowrap;
}

.dot-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bad);
}

.dot-pulse.on {
    background: var(--good);
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(61, 220, 151, .45); }
    50% { opacity: .75; box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); }
}

.bump { animation: bump .45s ease-out; }

@keyframes bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* ---- hero board + progress ---- */

.live-main {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 26px;
    padding: 18px 34px 8px;
    flex: 1;
    min-height: 0;
}

.hero {
    display: flex;
    align-items: center;
    border-radius: 18px;
    min-width: 0;
    transition: background .6s ease, box-shadow .6s ease;
}

/* When the whole room runs at once, the board itself should feel busy. */
.hero.busy {
    background: rgba(79, 195, 247, .05);
    box-shadow: inset 0 0 90px rgba(79, 195, 247, .09);
}

.live-board { width: 100%; }

.live .node-label { font-size: 15px; }
.live .node-role { font-size: 12px; }
.live .topic { font-size: 13px; }
.live .dot { filter: drop-shadow(0 0 10px currentColor); }

.live-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.live-side h2,
.wall-wrap h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin: 0 0 14px;
    font-weight: 600;
}

.wall-wrap h2 small {
    text-transform: none;
    letter-spacing: 0;
    opacity: .7;
}

.progress { list-style: none; margin: 0; padding: 0; }

.progress .waiting { color: var(--muted); font-size: 15px; }

.progress li { margin-bottom: 20px; }

.bar-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 7px;
}

.bar-name {
    font-size: 15px;
    color: #cfd9f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.bar-count {
    font-size: 26px;
    font-weight: 700;
    color: var(--good);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bar-count i {
    font-style: normal;
    font-size: 15px;
    font-weight: 400;
    color: var(--muted);
}

.bar {
    height: 10px;
    background: #1a2440;
    border-radius: 6px;
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-strong), var(--good));
    border-radius: 6px;
    transition: width .7s cubic-bezier(.2, .9, .3, 1);
}

/* ---- the wall ---- */

.wall-wrap {
    flex: none;
    padding: 10px 34px 22px;
    border-top: 1px solid var(--line);
    max-height: 38vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px 14px;
    overflow: hidden;
}

.tile {
    background: rgba(18, 26, 48, .66);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 9px 11px 7px;
    transition: border-color .5s ease, background .5s ease, transform .35s ease;
    animation: arrive .45s ease-out;
}

@keyframes arrive {
    from { opacity: 0; transform: scale(.9); }
    to { opacity: 1; transform: none; }
}

.tile .mini { width: 100%; height: 20px; display: block; }

.tile .who {
    display: block;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile .hop {
    fill: #2a3757;
    transition: fill .4s ease;
}

.tile .seg {
    stroke: #2a3757;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke .35s ease;
}

.tile .seg.lit { stroke: currentColor; }
.tile .seg-device-events.lit { color: var(--topic-device-events); }
.tile .seg-alarms.lit { color: var(--topic-alarms); }
.tile .seg-tickets.lit { color: var(--topic-tickets); }
.tile .seg-notifications.lit { color: var(--topic-notifications); }

/* ticket-service's database. Filled once anything has been written to it, and
   never lit like a segment, because nothing travels along it. */
.tile .saved {
    fill: none;
    stroke: var(--store);
    stroke-width: .8;
    opacity: .35;
}

.tile .saved.on {
    fill: var(--store);
    opacity: 1;
}

.tile.running {
    border-color: var(--accent);
    background: rgba(79, 195, 247, .09);
    transform: translateY(-2px);
}

.tile.running .hop { fill: var(--accent); }

.tile.won {
    border-color: var(--good);
    background: rgba(61, 220, 151, .11);
}

/* The device id, which is how you find yourself on the wall. Brighter than
   the alias on purpose: the alias is meaningless, this one is yours. */
.tile .case {
    display: block;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .02em;
    color: var(--text);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile.won .case { color: var(--good); }
.tile.won .who { color: var(--good); }
.tile.won .hop { fill: var(--good); }

.tile.failed {
    border-color: var(--bad);
    background: rgba(255, 107, 107, .09);
    animation: shake .35s ease;
}

@keyframes shake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* ---- celebration ---- */

.celebrate {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 20;
}

.celebrate .burst {
    background: rgba(61, 220, 151, .14);
    border: 1px solid var(--good);
    color: var(--text);
    padding: 26px 48px;
    border-radius: 18px;
    font-size: 32px;
    backdrop-filter: blur(7px);
    animation: pop .5s cubic-bezier(.2, 1.4, .4, 1);
}

.celebrate strong { color: var(--good); }
.celebrate span { color: var(--accent); }

@keyframes pop {
    from { opacity: 0; transform: scale(.86); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- activity from workshop runs -----------------------------------------
   The wall shows that something happened; this shows what. Finding your own
   device id in a stream of everyone else's is the moment fifty incidents
   were built for, so the device id is the brightest thing in the row. */

.feed-title {
    margin-top: 28px;
}

.feed-title small {
    color: var(--muted);
    font-weight: 400;
}

.feed {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--mono);
}

.feed .waiting { color: var(--muted); font-size: 15px; }

.feed-row {
    display: grid;
    grid-template-columns: 96px 118px 1fr;
    gap: 10px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    /* Arrives from the left, like everything else on this screen. */
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .25s ease, transform .25s ease;
}

.feed-row.in {
    opacity: 1;
    transform: none;
}

.feed-topic {
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-row.topic-device-events .feed-topic { color: var(--topic-device-events); }
.feed-row.topic-alarms .feed-topic { color: var(--topic-alarms); }
.feed-row.topic-tickets .feed-topic { color: var(--topic-tickets); }
.feed-row.topic-notifications .feed-topic { color: var(--topic-notifications); }

/* A ticket that has only been saved. Deliberately the dullest row on the wall:
   it is the one thing up there that has not gone anywhere. */
.feed-row.stored {
    border-left: 3px solid var(--store);
    padding-left: 7px;
    background: rgba(139, 148, 167, .10);
}

/* The last round produces no messages at all - it draws a screen. It gets a
   row of its own rather than a fabricated event, and says which it is. */
.feed-row.progress-row {
    border-left: 3px solid var(--good);
    padding-left: 7px;
    background: rgba(61, 220, 151, .08);
}

.feed-row.progress-row .feed-topic { color: var(--good); }

/* A tile rebuilt from the runner's summary rather than from a run this screen
   watched. Present, findable, and honestly not beating. */
.tile.idle { opacity: .78; }

.feed-row.stored .feed-topic { color: var(--store); }
.feed-row.stored .feed-body { color: var(--store); font-style: italic; }

/* A question asked of one named service over HTTP, which answered. Round 1
   spends its whole length establishing that this is not a published event, so
   it must not look like one from the back of the room. */
.feed-row.asked {
    border-left: 3px solid var(--call);
    padding-left: 7px;
    background: rgba(122, 162, 247, .08);
}

.feed-row.asked .feed-topic { color: var(--call); }
.feed-row.asked .feed-body { color: var(--call); font-style: italic; }

.feed-device {
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-body {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
