:root {
    --bg: #0b0f14;
    --fg: #e8eef5;
    --muted: #7d8b9c;
    --accent: #F07C2E; /* onday orange */
    --error: #ff6b6b;
    --ok: #29c46a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    cursor: none; /* signage: hide cursor */
}

/* ---- Playback stage ---- */
#stage {
    position: fixed;
    inset: 0;
    background: #000;
}

.layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 600ms ease;
    background: #000;
}
.layer.show { opacity: 1; }

.layer img,
.layer video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain; /* letterbox — never crop signage content */
}

/* ---- Overlays ---- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
    background: radial-gradient(circle at 50% 40%, #16202c 0%, var(--bg) 70%);
}
.overlay.hidden,
.status.hidden,
.error.hidden { display: none; }

.brand-logo {
    height: clamp(56px, 9vw, 104px);
    width: auto;
}

.brand {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--fg);
}
.brand::after {
    content: "";
    display: inline-block;
    width: 0.35em;
    height: 0.35em;
    margin-left: 0.15em;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: baseline;
}

.standby-name {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--accent);
}

.muted { color: var(--muted); font-size: clamp(0.9rem, 2vw, 1.2rem); max-width: 28ch; }

/* ---- Pairing form ---- */
#pair-form { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }

#pair-code {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.4em;
    text-align: center;
    text-transform: uppercase;
    width: 8ch;
    padding: 0.4em 0.2em 0.4em 0.4em;
    color: var(--fg);
    background: #0e151d;
    border: 2px solid #24303e;
    border-radius: 12px;
    outline: none;
    cursor: text;
}
#pair-code:focus { border-color: var(--accent); }

#pair-btn {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.7em 1.6em;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
#pair-btn:disabled { opacity: 0.5; cursor: default; }

.error { color: var(--error); font-weight: 600; }

/* ---- Status chip ---- */
.status {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: var(--muted);
    background: rgba(11, 15, 20, 0.7);
    border: 1px solid #24303e;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    transition: opacity 400ms ease;
}
.status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--muted);
}
.status.online .dot { background: var(--ok); }
.status.offline .dot { background: var(--error); }
