/* live.e1ulife.com: the recording, full screen, with a glass chat panel that slides in from the right. Tokens come from brand.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.live {
    background: #05060A;
    color: var(--tx);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    --glass: rgba(14, 16, 22, .72);
    --glass-line: rgba(255, 255, 255, .12);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- the screen */
.stage { position: fixed; inset: 0; background: #05060A center / cover no-repeat; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .5s; pointer-events: none; }
.stage.is-playing video { opacity: 1; }
/* Behind the join card the picture fills the screen, so a phone held upright is not a letterbox of blur. */
.stage.is-veiled video { object-fit: cover; }
/* The blurred, dimmed look behind the "Join the Call" card, and behind every waiting card. */
.veil { position: absolute; inset: 0; background: rgba(5, 6, 10, 0); transition: background .5s, backdrop-filter .5s; }
.stage.is-veiled .veil { background: rgba(5, 6, 10, .5); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.stage.is-dark .veil { background: radial-gradient(120% 90% at 50% 0%, #1b1442 0%, #0b0a18 60%, #05060A 100%); }

/* ---------------------------------------------------------------- top bar */
.hud {
    position: fixed; z-index: 5; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 28px calc(16px + env(safe-area-inset-left));
    background: linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
    transition: opacity .35s;
    pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud__name { font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud__count { color: var(--tx-2); font-size: 13px; white-space: nowrap; }
.hud__tools { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill--live { background: rgba(242, 73, 92, .9); color: #fff; }
.pill--live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: beat 1.6s infinite; }
@keyframes beat { 50% { opacity: .35; } }
body.is-quiet .hud, body.is-quiet .ctl { opacity: 0; }

.tool {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0; border: 1px solid var(--glass-line); border-radius: 12px;
    background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    cursor: pointer; transition: background .15s;
}
.tool:hover { background: rgba(40, 44, 58, .8); }
.tool--text { padding: 0 14px; font-size: 14px; font-weight: 600; }
.badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}

/* ---------------------------------------------------------------- the cards over the screen */
.card {
    position: fixed; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 32px)); padding: 34px 30px 30px; text-align: center;
    background: rgba(16, 18, 26, .74); border: 1px solid var(--glass-line); border-radius: var(--r-card);
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.card h1 { margin: 0 0 8px; text-transform: none; font-family: var(--disp); font-weight: 700; font-size: 22px; line-height: 1.25; letter-spacing: -.01em; }
.card p { margin: 0 0 6px; color: var(--tx-2); }
.card .big { margin: 14px 0 4px; font-family: var(--disp); font-weight: 600; font-size: 40px; letter-spacing: -.02em; color: var(--tx); font-variant-numeric: tabular-nums; }
.card .small { font-size: 13px; color: var(--tx-3); }
.card .go { margin-top: 20px; }
.card form { margin-top: 18px; }
.card label { display: block; margin-bottom: 8px; color: var(--tx-2); font-size: 14px; }
.card input[type=text] {
    width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--hairline-2); background: rgba(0, 0, 0, .35);
    color: var(--tx); font: inherit; font-size: 16px; text-align: center; outline: none;
}
.card input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
.card .err { margin: 10px 0 0; color: #ff8a97; font-size: 14px; }
.btn {
    display: inline-block; padding: 13px 32px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; transition: background .15s, transform .1s;
}
.btn:hover { background: #ff7424; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.card .link { margin-top: 14px; background: none; border: 0; color: var(--tx-3); cursor: pointer; font-size: 13px; text-decoration: underline; }

.card { transition: left .38s cubic-bezier(.22, .8, .25, 1); }
@media (min-width: 900px) { body.panel-open .card { left: calc(50% - 190px); } }

/* ---------------------------------------------------------------- bottom bar */
.ctl {
    position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
    padding: 28px calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); transition: opacity .35s;
}
.ctl__grow { flex: 1; }
.ctl__time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--tx-2); }
#vol { width: 90px; accent-color: var(--accent); }

.soundhint {
    position: fixed; z-index: 5; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    padding: 11px 22px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
@media (min-width: 900px) { body.panel-open .soundhint { left: calc(50% - 190px); } }

.stall {
    position: fixed; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: 12px;
    background: rgba(0, 0, 0, .65); color: var(--tx-2); font-size: 14px;
}

/* ---------------------------------------------------------------- the panel */
.panel {
    position: fixed; z-index: 6; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); display: flex; flex-direction: column;
    background: var(--glass); border-left: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
    transform: translateX(104%); visibility: hidden; transition: transform .38s cubic-bezier(.22, .8, .25, 1), visibility 0s .38s;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.panel.is-open { transform: none; visibility: visible; transition: transform .38s cubic-bezier(.22, .8, .25, 1), visibility 0s; }
.panel__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px 14px; }
.tabs { display: flex; gap: 4px; }
.tabs button {
    padding: 8px 13px; border: 0; border-radius: 10px; background: none; color: var(--tx-2); font-weight: 600; font-size: 14px; cursor: pointer;
}
.tabs button.is-on { background: rgba(255, 255, 255, .12); color: var(--tx); }
.tabs span { color: var(--tx-3); font-weight: 500; }
.panel .tool { min-width: 36px; height: 36px; background: none; border-color: transparent; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

.msgs { flex: 1; min-height: 0; margin: 0; padding: 6px 14px 10px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.msg { padding: 5px 0; overflow-wrap: anywhere; font-size: 14.5px; }
.msg b { font-weight: 700; margin-right: 6px; }
.msg.is-mine b { color: var(--tx-2); }
.msg.is-host b { color: var(--hot); }
.tag { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: rgba(var(--hot-rgb), .18); color: var(--hot); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.day { margin: 12px 0 6px; text-align: center; color: var(--tx-3); font-size: 12px; }
.empty { margin: auto; padding: 24px; text-align: center; color: var(--tx-3); }

.toasts { position: absolute; z-index: 2; top: 4px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, .7); color: var(--tx-2); font-size: 13px; animation: toast 4.5s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.say { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
.say__row { display: flex; gap: 8px; }
.say input {
    flex: 1; min-width: 0; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(0, 0, 0, .35);
    color: var(--tx); font: inherit; font-size: 16px; outline: none;
}
.say input:focus { border-color: rgba(var(--accent-rgb), .8); }
.send { width: 44px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.say__err { margin: 0 0 6px; color: #ff8a97; font-size: 13px; }

.filter { display: block; padding: 4px 14px 10px; }
.filter select {
    width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(0, 0, 0, .35);
    color: var(--tx); font: inherit; font-size: 15px; cursor: pointer;
}
.people { flex: 1; min-height: 0; margin: 0; padding: 0 8px 12px; list-style: none; overflow-y: auto; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 8px; border-radius: 10px; }
.person__av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.person__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.person.is-away .person__dot { background: rgba(255, 255, 255, .22); }
.person.is-away { color: var(--tx-3); }

/* ---------------------------------------------------------------- phones */
@media (max-width: 640px) {
    .hud__name { font-size: 12px; }
    .card { padding: 28px 22px 24px; }
    .card h1 { font-size: 19px; }
    .card .big { font-size: 34px; }
    #vol { display: none; }
    .tool { min-width: 44px; height: 44px; }
}
/* A phone held upright: the chat is a sheet from the bottom, so the picture stays in view above it. Held sideways it is the side panel again. */
@media (max-width: 640px) and (orientation: portrait) {
    .panel {
        top: auto; left: 0; right: 0; width: auto; height: 58vh; height: 58dvh;
        border-left: 0; border-top: 1px solid var(--glass-line); border-radius: 18px 18px 0 0;
        transform: translateY(104%);
    }
    .panel.is-open { transform: none; }
    .soundhint { bottom: calc(76px + env(safe-area-inset-bottom)); }
    body.panel-open .ctl { opacity: 0; pointer-events: none; }
    .stage video { transition: opacity .5s, height .38s cubic-bezier(.22, .8, .25, 1); }
    body.panel-open .stage:not(.is-veiled) video { height: 42vh; height: 42dvh; }
}
@media (prefers-reduced-motion: reduce) {
    .panel, .veil, .stage video { transition: none; }
    .pill--live i, .toast { animation: none; }
}
