:root {
    color-scheme: dark;
    --background: #11161c;
    --surface: #1a232d;
    --line: rgba(255, 255, 255, .14);
    --accent: #46c2a8;
    --text: #f6f8fb;
    --muted: #aeb8c4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.client-shell {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.client-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    padding: 1rem clamp(1rem, 4vw, 2rem);
}

.client-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.eyebrow {
    margin: 0 0 .25rem;
    color: var(--accent);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.client-meta {
    display: grid;
    justify-items: end;
    gap: .25rem;
    color: var(--muted);
    font-size: .9rem;
}

.master-next,
.master-pause,
.sound-toggle {
    border: 0;
    border-radius: 999px;
    color: #fff;
    font: inherit;
    font-weight: 800;
    padding: .55rem .9rem;
    cursor: pointer;
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    border: 1px solid rgba(255, 255, 255, .28);
    background: transparent;
    box-shadow: none;
}

.sound-toggle.is-muted {
    border-color: #ff8a00;
    background: rgba(255, 138, 0, .16);
}

.sound-toggle-icon {
    font-size: 1.05em;
    line-height: 1;
}

.master-next {
    background: #ff8a00;
    box-shadow: 0 .22rem 0 rgba(86, 43, 0, .45);
}

.master-pause {
    background: #1e7bd8;
    box-shadow: 0 .22rem 0 rgba(5, 38, 74, .45);
}

.login-switch {
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 800;
    padding: .48rem .85rem;
    cursor: pointer;
}

.master-next:disabled,
.master-pause:disabled {
    cursor: progress;
    opacity: .7;
}

.client-meta code {
    max-width: min(22rem, 48vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frame-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
}

iframe {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: calc(100vh - 5.5rem);
    min-height: calc(100dvh - 5.5rem);
    display: block;
    border: 0;
    background: #101418;
}

.empty-state {
    min-height: calc(100vh - 5.5rem);
    min-height: calc(100dvh - 5.5rem);
    display: grid;
    place-content: center;
    padding: 2rem;
    text-align: center;
}

.empty-state h2 {
    margin: 0 0 .5rem;
    font-size: clamp(2rem, 7vw, 4rem);
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.hidden {
    display: none;
}

@media (max-width: 42rem) {
    .client-header {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .5rem;
        min-height: 3.25rem;
        padding: .45rem 6.4rem .45rem .7rem;
    }

    .client-header h1 {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1rem;
    }

    .eyebrow,
    .client-meta code {
        display: none;
    }

    .client-meta {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        min-width: 5.5rem;
        max-width: 58vw;
        font-size: .78rem;
    }

    .master-next,
    .master-pause,
    .sound-toggle,
    .login-switch {
        padding: .42rem .65rem;
        font-size: .78rem;
    }

    .sound-toggle {
        position: absolute;
        top: .45rem;
        right: .7rem;
        gap: .28rem;
    }

    #connectionStatus {
        display: none;
    }

    iframe,
    .empty-state {
        min-height: calc(100dvh - 3.25rem);
    }
}
