:root {
    color-scheme: dark;
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    background: #101719;
    color: #f3f6f4;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --muted: #91a19d;
    --panel: #182123;
    --panel-border: rgba(218, 234, 228, .09);
    --mint: #a8e6c5;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    padding: 36px 24px;
    background:
        radial-gradient(ellipse at 50% -20%, rgba(81, 139, 112, .18), transparent 54%),
        #101719;
}

button,
a,
input {
    font: inherit;
}

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

.topbar,
.brand,
.config-button,
.show-heading,
.live-indicator,
.scene-caption,
.timeline-labels,
.timeline-markers,
.transport,
.status-bar {
    display: flex;
    align-items: center;
}

.topbar,
.show-heading,
.scene-caption,
.timeline-labels,
.timeline-markers,
.status-bar {
    justify-content: space-between;
}

.topbar {
    margin-bottom: 55px;
}

.brand {
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(168, 230, 197, .26);
    border-radius: 14px;
    background: rgba(168, 230, 197, .09);
    color: var(--mint);
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.06em;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-title {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
}

.brand-caption,
.eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.config-button {
    min-height: 42px;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    color: #d4ddda;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease;
}

.config-button:hover {
    border-color: rgba(168, 230, 197, .32);
    background: rgba(168, 230, 197, .06);
}

.config-button svg {
    width: 17px;
    fill: currentColor;
}

.show-heading {
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 10px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    margin-bottom: 0;
    font-family: inherit;
}

h1 {
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 700;
    letter-spacing: -.04em;
}

.live-indicator {
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid rgba(168, 230, 197, .16);
    border-radius: 999px;
    color: #b8c8c1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .13em;
}

.live-indicator span,
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #71827b;
}

.stage-card,
.timeline-card {
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(28, 40, 41, .95), rgba(22, 31, 33, .98));
    box-shadow: 0 18px 54px rgba(0, 0, 0, .16);
}

.stage-image {
    position: relative;
    display: grid;
    min-height: clamp(230px, 40vw, 370px);
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(34, 55, 53, .65), rgba(15, 22, 24, .55)),
        repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 1px, transparent 1px 12px),
        #1a292a;
}

.stage-image::before,
.stage-image::after {
    position: absolute;
    width: 450px;
    height: 450px;
    border: 1px solid rgba(168, 230, 197, .045);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.stage-image::after {
    width: 610px;
    height: 610px;
}

.stage-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stage-image img[hidden] {
    display: none;
}

.image-placeholder {
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 12px;
    color: #91a19d;
    font-size: 13px;
}

.placeholder-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 1px solid rgba(168, 230, 197, .14);
    border-radius: 18px;
    background: rgba(168, 230, 197, .06);
}

.placeholder-icon svg {
    width: 26px;
    fill: none;
    stroke: #a8c1b3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.scene-count {
    position: absolute;
    z-index: 2;
    top: 18px;
    left: 18px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    background: rgba(13, 20, 21, .65);
    color: #d6e1dc;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .13em;
    backdrop-filter: blur(8px);
}

.scene-caption {
    min-height: 88px;
    gap: 16px;
    padding: 18px 24px;
}

h2 {
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 600;
    letter-spacing: -.03em;
}

.scene-time {
    color: #bcc9c3;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.timeline-card {
    margin-top: 16px;
    padding: 19px 22px 16px;
}

.timeline-labels {
    margin-bottom: 13px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
}

.timeline-time {
    color: #dce5e1;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}

.time-separator {
    color: #72817b;
}

.timeline {
    display: block;
    width: 100%;
    height: 16px;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.timeline::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 99px;
    background: linear-gradient(to right, var(--mint) 0 var(--progress, 0%), #354241 var(--progress, 0%) 100%);
}

.timeline::-moz-range-track {
    height: 4px;
    border-radius: 99px;
    background: #354241;
}

.timeline::-moz-range-progress {
    height: 4px;
    border-radius: 99px;
    background: var(--mint);
}

.timeline::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -5px;
    appearance: none;
    border: 3px solid #17201f;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 2px var(--mint);
}

.timeline::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border: 3px solid #17201f;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 2px var(--mint);
}

.timeline:focus-visible {
    outline: 2px solid var(--mint);
    outline-offset: 5px;
}

.timeline-markers {
    margin-top: 8px;
    color: #73827d;
    font-size: 10px;
}

.transport {
    gap: 14px;
    margin: 26px 0 22px;
}

.transport-button {
    display: flex;
    min-height: 76px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    color: #e8efeb;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}

.transport-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.transport-button:active {
    transform: translateY(0);
}

.transport-button:focus-visible,
.config-button:focus-visible {
    outline: 2px solid var(--mint);
    outline-offset: 3px;
}

.transport-button:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.start-button {
    border-color: rgba(117, 208, 159, .28);
    background: linear-gradient(135deg, #326b51, #28583f);
}

.stop-button {
    border-color: rgba(232, 133, 119, .2);
    background: linear-gradient(135deg, #633f3d, #4d3334);
}

.reset-button {
    background: #202c2d;
}

.button-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: rgba(255,255,255,.09);
}

.button-icon svg {
    width: 17px;
    fill: currentColor;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.reset-button .button-icon svg {
    fill: none;
}

.status-bar {
    min-height: 52px;
    gap: 10px;
    padding: 0 15px;
    border: 1px solid var(--panel-border);
    border-radius: 13px;
    background: rgba(24, 33, 35, .78);
    color: #aab9b3;
    font-size: 12px;
}

.status-bar[data-state="connected"] .status-dot {
    background: #7bd6a1;
    box-shadow: 0 0 12px rgba(123, 214, 161, .6);
}

.status-bar[data-state="error"] .status-dot {
    background: #ef8d7f;
    box-shadow: 0 0 12px rgba(239, 141, 127, .45);
}

.status-detail {
    margin-left: auto;
    color: #75847f;
    font-size: 11px;
}

@media (max-width: 600px) {
    body {
        padding: 22px 15px;
    }

    .topbar {
        margin-bottom: 38px;
    }

    .show-heading {
        align-items: flex-end;
    }

    .scene-caption {
        min-height: 78px;
        padding: 16px;
    }

    .timeline-card {
        padding-right: 16px;
        padding-left: 16px;
    }

    .transport {
        gap: 8px;
    }

    .transport-button {
        min-height: 72px;
        flex-direction: column;
        gap: 5px;
        border-radius: 13px;
        font-size: 12px;
    }

    .button-icon {
        width: 29px;
        height: 29px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
