/* Scenes player + conductor. Builds on style.css: same tokens, same panels. */

:root {
    --ok: #3f8f4f;
    --ok-soft: rgba(63, 143, 79, 0.1);
    --warn: #b7791f;
    --warn-soft: rgba(183, 121, 31, 0.1);
    --bad: #b8432f;
    --bad-soft: rgba(184, 67, 47, 0.09);
}

.wrap.wide { max-width: 1100px; }

/* ---- status pills ---- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
    background: var(--panel-hi);
    border-radius: 999px;
    padding: 3px 10px 3px 8px;
    white-space: nowrap;
}

.pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cfc4b6;
    flex: none;
}

.pill.ok   { color: var(--ok);   background: var(--ok-soft); }
.pill.ok .dot   { background: var(--ok); }
.pill.wait { color: var(--warn); background: var(--warn-soft); }
.pill.wait .dot { background: var(--warn); }
.pill.bad  { color: var(--bad);  background: var(--bad-soft); }
.pill.bad .dot  { background: var(--bad); animation: blink 1s steps(2, start) infinite; }

@keyframes blink { to { visibility: hidden; } }

.log-time { color: #b9ad9f; }

/* ---- player: scene bar ---- */

.scenebar { margin-top: -12px; }

.scenebar .scorebar-row { margin-bottom: 4px; }

.scene-count {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 5px;
    padding: 2px 7px;
}

.scene-count:empty { display: none; }

.scene-name {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.scenebar .pill { margin-left: auto; }

.scene-notes {
    margin: 2px 0 12px;
    max-width: 70ch;
}

.scene-notes:empty { display: none; }

.scene-next { margin-top: 8px; }
.scene-next:empty { display: none; }

.scenebar .progress-fill { transition: width 120ms linear; }
.scenebar:not(.fading) .progress-fill { background: var(--accent-line); }

/* A new scene washes the bar in the accent, then settles. */
.scenebar.flash { animation: scene-flash 1.6s ease-out; }

@keyframes scene-flash {
    from { background: var(--accent-soft); border-color: var(--accent); }
    to   { background: var(--panel);       border-color: var(--line); }
}

.voice .tempo {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    margin: -6px 0 6px;
}

.voice .tempo:empty { display: none; }

button:disabled { opacity: 0.6; cursor: default; }

/* ---- conductor: transport ---- */

.admin-transport .live-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-right: auto;
}

.live-name {
    font-size: 19px;
    font-weight: 600;
}

#fadeOverride { width: 58px; }

#reloadScenesButton { padding: 4px 11px; font-size: 13px; }

/* ---- conductor: scene cards ---- */
/* A card is the big "send to all" button plus a row of 1-4 buttons under it
   (a button can't hold other buttons, so the card is the box). */

.scene-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.scene-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color 120ms ease, background 120ms ease;
}

.scene-card:hover { border-color: var(--accent-line); }

.scene-button {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    text-align: left;
    font-weight: 400;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 14px 16px 16px;
    min-height: 140px;
    transition: background 120ms ease;
}

.scene-button:hover:not(:disabled) { background: #fffdfa; }
.scene-button:active:not(:disabled) { background: var(--accent-soft); }
.scene-button:disabled { opacity: 1; }
.scene-button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }

.sb-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sb-num {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    background: var(--panel-hi);
    border-radius: 5px;
    padding: 1px 7px;
}

.sb-fade { font-size: 12px; color: var(--muted); }

.sb-name {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sb-summary { font-size: 12px; color: var(--muted); }

.sb-notes {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    opacity: 0.8;
}

.sb-state {
    position: absolute;
    top: 13px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    border-radius: 5px;
    padding: 2px 8px;
}

.sb-state:empty { display: none; }

.scene-card.is-live .sb-fade,
.scene-card.is-partial .sb-fade,
.scene-card.is-sending .sb-fade { visibility: hidden; }

.sb-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
}

.sb-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 120ms linear;
}

/* send to just one laptop */
.sb-targets {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px 11px 16px;
    border-top: 1px solid var(--line-soft);
}

.sb-just {
    font-size: 12px;
    color: var(--muted);
    margin-right: auto;
}

.sb-target {
    min-width: 36px;
    padding: 4px 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.sb-target:disabled { opacity: 1; }
.sb-target:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.sb-target.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.sb-target.is-on:hover:not(:disabled) { color: #fff; filter: brightness(1.08); }
.sb-target.is-sending { border-color: var(--accent); color: var(--accent); }

/* on every laptop */
.scene-card.is-live {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow);
}

.scene-card.is-live .sb-num { color: #fff; background: var(--accent); }
.scene-card.is-live .sb-targets { border-top-color: var(--accent-line); }

/* on some laptops */
.scene-card.is-partial { border-color: var(--accent-line); }
.scene-card.is-partial .sb-state { color: var(--accent); background: var(--accent-soft); }

.scene-card.is-sending .sb-state { color: #fff; background: var(--muted); }

.lp-cued {
    font-size: 15px;
    font-weight: 600;
    margin: -4px 0 4px;
}

/* ---- conductor: laptops ---- */

.laptops {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.laptop {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    transition: opacity 200ms ease;
}

.laptop.absent { opacity: 0.6; }

.lp-line {
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.lp-line:empty { display: none; }
.lp-line.warn { color: var(--bad); font-weight: 550; }

.minis {
    display: flex;
    gap: 4px;
    height: 34px;
    margin: 10px 0 6px;
    align-items: flex-end;
}

.laptop.absent .minis { display: none; }

.mini {
    flex: 1;
    height: 100%;
    background: var(--line-soft);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.mini-fill {
    display: block;
    width: 100%;
    height: 0%;
    background: var(--accent);
    transition: height 300ms linear;
}

@media (max-width: 520px) {
    .scene-buttons { grid-template-columns: 1fr; }
    .scene-button { min-height: 0; }
    .sb-target { min-width: 44px; padding: 7px 0; }
    .scenebar .pill { margin-left: 0; }
}

/* ---- player: camera ---- */

[hidden] { display: none !important; }

.camera-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    margin-bottom: 28px;
}

.camera-view {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    border-radius: 7px;
    overflow: hidden;
    background: var(--panel-hi);
}

#preview {
    display: block;
    width: 100%;
    height: 100%;
}

.camera-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 14px;
    background: var(--panel-hi);
}

#handsPill { align-self: center; }

.backup-note { margin: 0 0 10px; }

.backup-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

details > .backup-row:last-child { margin-bottom: 18px; }

#cameraSelect { max-width: 200px; }
