:root {
    color-scheme: dark;
    --bg: #050505;
    --panel: rgba(8, 12, 13, 0.78);
    --panel-border: rgba(255, 255, 255, 0.18);
    --text: #f8faf9;
    --muted: rgba(248, 250, 249, 0.45);
    --accent: #37e08b;
    --warn: #ffcf5a;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    color: var(--text);
}

button {
    font: inherit;
}

.stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 0%, rgba(55, 224, 139, 0.09), transparent 30%),
        linear-gradient(180deg, #090b0b 0%, #020202 100%);
}

.prompter {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: 8vh clamp(24px, 5vw, 92px) 18vh;
}

.prompter::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.spacer {
    height: 46vh;
}

.script {
    width: min(1780px, 100%);
    margin: 0 auto;
}

.caption-flow {
    margin: 0;
    color: rgba(248, 250, 249, 0.62);
    font-size: clamp(30px, 4.4vw, 78px);
    line-height: 1.16;
    font-weight: 850;
    letter-spacing: 0;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: pretty;
}

.caption-phrase {
    color: rgba(248, 250, 249, 0.62);
}

.caption-phrase.recent {
    color: rgba(248, 250, 249, 0.82);
}

.caption-phrase.current {
    color: var(--text);
    font-weight: 920;
    text-shadow: 0 0 28px rgba(255, 255, 255, 0.18);
}

.empty {
    margin: 0;
    color: var(--muted);
    font-size: clamp(36px, 6vw, 96px);
    line-height: 1.1;
    font-weight: 850;
    text-align: center;
}

.bottom-sentinel {
    height: 1px;
}

.toolbar {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.38);
}

.mode-control {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(76px, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
}

.mode-button {
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: rgba(248, 250, 249, 0.64);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0;
    cursor: pointer;
}

.mode-button:hover {
    color: rgba(248, 250, 249, 0.92);
    background: rgba(255, 255, 255, 0.09);
}

.mode-button.is-active {
    color: var(--text);
    background: rgba(55, 224, 139, 0.18);
    box-shadow: inset 0 0 0 1px rgba(55, 224, 139, 0.58);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 92px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 250, 249, 0.82);
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.icon-button.is-active {
    border-color: rgba(55, 224, 139, 0.62);
    background: rgba(55, 224, 139, 0.16);
    color: var(--text);
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    font-size: 20px;
    line-height: 1;
}

.status {
    min-width: 118px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
}

.status.live {
    color: var(--accent);
}

.status.offline {
    color: var(--warn);
}

@media (max-width: 700px) {
    .prompter {
        padding: 7vh 18px 20vh;
    }

    .spacer {
        height: 38vh;
    }

    .toolbar {
        right: 10px;
        left: 10px;
        justify-content: space-between;
    }

    .icon-button {
        min-width: 78px;
        padding: 0 10px;
    }

    .mode-control {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        flex: 1;
    }

    .mode-button {
        padding: 0 6px;
    }

    .status {
        min-width: 82px;
    }
}
