/* The camera page's look: always dark, as a camera's own screen is in the
   apps. Status colours are the apps' own and the same everywhere: live red,
   online green, warning orange. No page of it scrolls at the usual text
   sizes; a very short window scrolls the lit panel alone. */

:root {
    color-scheme: dark;
    --text: #fff;
    --soft: rgba(255, 255, 255, 0.62);
    --faint: rgba(255, 255, 255, 0.5);
    --card: #1c1c1e;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #d97719;
    --on-accent: #1a1206;
    --live: #ff453a;
    --online: #30d158;
    --warning: #ff9f0a;
}

html, body {
    margin: 0;
    height: 100%;
    background: #000;
    color: var(--text);
    font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    -webkit-text-size-adjust: 100%;
    overflow: hidden;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

#page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(20px + env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(22px + env(safe-area-inset-left));
    box-sizing: border-box;
}

.sheet {
    width: 100%;
    max-width: 420px;
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.center {
    text-align: center;
    align-items: center;
}

.words {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.soft {
    margin: 0;
    color: var(--soft);
    font-size: 15px;
}

.warn {
    margin: 0;
    color: var(--warning);
    font-size: 15px;
}

.code {
    margin: 0;
    font-size: 52px;
    font-weight: 300;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.primary {
    align-self: stretch;
    padding: 15px 18px;
    border-radius: 14px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

.primary[disabled] {
    opacity: 0.55;
    cursor: default;
}

.quiet {
    align-self: stretch;
    padding: 13px 18px;
    border-radius: 14px;
    background: var(--card);
    font-weight: 600;
}

.danger {
    color: var(--live);
}

/* ---- The camera's own look at its picture: one element, never moved, so
   the stream keeps playing. Lit, it's what a person aims the camera by;
   dark, it's a pixel nobody sees. ---- */

#look {
    position: fixed;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    background: #000;
    object-fit: cover;
}

body.lit #look {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 30vh;
    opacity: 1;
    border-radius: 12px;
    order: 2;
}

/* ---- Lit: the camera's controls ---- */

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--online);
    flex: none;
}

.dot.watched { background: var(--live); }
.dot.stopped { background: var(--warning); }

.status.stopped { color: var(--warning); }

.whose {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.watching {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--live);
    font-size: 15px;
    font-weight: 600;
}

.eye {
    width: 18px;
    height: 12px;
    flex: none;
}

.head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    order: 1;
}

.rows {
    order: 3;
    border-radius: 12px;
    background: var(--card);
    overflow: hidden;
}

.row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    box-sizing: border-box;
}

.row + .row, .row + .choices, .choices + .row {
    border-top: 1px solid var(--line);
}

.row .name {
    color: var(--soft);
    text-align: right;
    overflow-wrap: anywhere;
}

.choices {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.04);
}

.choice {
    padding: 11px 14px 11px 28px;
    text-align: left;
    color: var(--soft);
}

.choice + .choice { border-top: 1px solid var(--line); }
.choice.current { color: var(--text); font-weight: 600; }

.notes {
    order: 4;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes .quiet { padding: 11px 14px; }

.foot {
    order: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asks {
    margin: 0;
    font-weight: 600;
    text-align: center;
}

.pair {
    display: flex;
    gap: 10px;
}

.pair > * { flex: 1; }

/* ---- Dark: black, with a faint clock that moves ---- */

.dark {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    cursor: default;
}

.rest {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: 82vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: left 2s ease, top 2s ease;
}

.clock {
    margin: 0 0 4px;
    font-size: 44px;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.18);
}

.rest .line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--faint);
    text-align: center;
}

.rest .dot { width: 7px; height: 7px; }
.rest .watching { font-size: 13px; opacity: 0.8; }
.rest .stopped { color: var(--warning); opacity: 0.8; }

@media (orientation: landscape) and (max-height: 520px) {
    body.lit #page { align-items: flex-start; }
    body.lit #look { max-height: 34vh; }
    .sheet { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .rest { transition: none; }
}
