:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f6f7fb;
    --brand: #6657d9;
    --surface: #fff;
    --border: #dfe2ee;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; line-height: 1.6; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem max(1rem, calc((100% - 960px) / 2)); background: #172033; }
.site-header a { color: #fff; text-decoration: none; }
.site-header .brand { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
.site-header .health-link { color: #cbd2e3; font-size: .875rem; }
.container { width: min(960px, calc(100% - 2rem)); margin: clamp(3rem, 8vw, 6rem) auto; }
.hero { max-width: 46rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.hero h1 { margin: .25rem 0; font-size: clamp(3rem, 10vw, 5.5rem); line-height: 1; letter-spacing: -.06em; }
.hero-copy { max-width: 38rem; margin: 1.25rem 0 0; color: #4b556b; font-size: clamp(1.15rem, 3vw, 1.5rem); }
.eyebrow { margin: 0; color: var(--brand); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.room-preview { display: grid; grid-template-columns: minmax(0, .9fr) minmax(18rem, 1.1fr); gap: 2rem; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: 0 1rem 3rem rgb(23 32 51 / 8%); }
.room-preview h2 { margin: .35rem 0 .5rem; line-height: 1.2; }
.room-preview p { color: #596176; }
.room-preview-controls { display: grid; align-content: center; gap: .75rem; }
.room-preview-controls label { font-weight: 700; }
input, button { min-height: 3rem; padding: .7rem .9rem; border-radius: .55rem; font: inherit; }
input { width: 100%; border: 1px solid #aab5c8; color: #172033; background: #fff; }
button { border: 0; color: #fff; font-weight: 700; background: var(--brand); }
button { cursor: pointer; }
button:hover { background: #5445c7; }
.flash { margin: 0 0 1.5rem; padding: .8rem 1rem; border-radius: .55rem; }
.flash-error { color: #7f1d1d; border: 1px solid #fecaca; background: #fee2e2; }
.card { padding: 1.5rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); box-shadow: 0 .5rem 1.5rem rgb(23 32 51 / 8%); }
.room-page { max-width: 46rem; }
.room-page h1 { margin: .25rem 0 2.5rem; font-size: clamp(2.75rem, 8vw, 4.5rem); line-height: 1; letter-spacing: -.05em; }
.room-code-label { margin: 0 0 .35rem; color: #596176; font-weight: 700; }
.room-code { margin: 0 0 2rem; color: var(--brand); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 800; letter-spacing: .12em; }
.room-join { max-width: 32rem; }
.room-join h2 { margin: 0 0 .35rem; line-height: 1.2; }
.room-join p { margin: 0 0 1rem; color: #596176; }
.room-join form { display: grid; gap: .75rem; }
.room-join label { font-weight: 700; }
.room-identity { margin: 0 0 1rem; color: #4b556b; }
.youtube-player-shell { position: relative; width: 100%; min-height: 200px; overflow: hidden; border-radius: 1rem; background: #0f172a; aspect-ratio: 16 / 9; box-shadow: 0 1rem 3rem rgb(23 32 51 / 12%); }
.youtube-player-shell iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.youtube-player-status { margin: .75rem 0 0; color: #596176; font-size: .925rem; }
.youtube-player-status-error { color: #991b1b; }
.room-presence { margin-top: 2rem; padding: clamp(1.25rem, 4vw, 1.75rem); border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: 0 .5rem 1.5rem rgb(23 32 51 / 8%); }
.room-presence h2 { margin: 0 0 .75rem; line-height: 1.2; }
.room-participant-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.room-participant-list li { padding: .65rem .8rem; overflow-wrap: anywhere; border-radius: .5rem; background: #f6f7fb; }
.room-presence-status { min-height: 1.5em; margin: .75rem 0 0; color: #596176; font-size: .925rem; }
.room-presence-status-error { color: #991b1b; }
.room-telemetry { margin-top: 2rem; padding: clamp(1.25rem, 4vw, 1.75rem); border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: 0 .5rem 1.5rem rgb(23 32 51 / 8%); }
.room-telemetry h2 { margin: 0 0 .35rem; line-height: 1.2; }
.room-telemetry > p { margin: 0 0 1rem; color: #596176; }
.room-telemetry-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.room-telemetry-list li { display: grid; gap: .15rem; min-width: 0; padding: .75rem .8rem; border-radius: .5rem; background: #f6f7fb; }
.room-telemetry-list strong, .room-telemetry-list span { overflow-wrap: anywhere; }
.room-telemetry-list span { color: #596176; font-variant-numeric: tabular-nums; }
.room-share { margin-top: 2rem; padding: clamp(1.25rem, 4vw, 1.75rem); border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: 0 .5rem 1.5rem rgb(23 32 51 / 8%); }
.room-share h2 { margin: 0 0 .35rem; line-height: 1.2; }
.room-share p { margin: 0 0 1rem; color: #596176; }
.room-share label { display: block; margin-bottom: .4rem; font-weight: 700; }
.room-share-url { overflow: hidden; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.room-share-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .9rem; }
.room-share-actions button { flex: 1 1 10rem; }
.room-share .room-share-status { min-height: 1.5em; margin: .75rem 0 0; font-size: .925rem; }
code { overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .container { margin-top: 2.5rem; }
    .room-preview { grid-template-columns: 1fr; gap: 1.25rem; }
    .room-share-actions { display: grid; }
    .room-share-actions button { width: 100%; }
}
