:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    background: #0f172a;
    color: #f8fafc;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 50% -20%, #312e81 0, #172033 36%, #0f172a 72%); color: #f8fafc; min-height: 100vh; }
a { color: inherit; }
header { height: 72px; display: flex; align-items: center; border-bottom: 1px solid #475569; }
.brand { margin-left: max(24px, calc((100% - 1180px) / 2)); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.brand::before { content: "▶"; color: #c4b5fd; margin-right: 10px; }
.site-nav { margin-left: auto; margin-right: max(24px, calc((100% - 1180px) / 2)); }
.site-nav a, .terms-consent a { color: #ddd6fe; text-underline-offset: 3px; }
.container { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 48px 0 80px; }
.hero { max-width: 800px; margin: 32px auto 42px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.02; margin: 12px 0 24px; letter-spacing: -.05em; }
.eyebrow { color: #c4b5fd; letter-spacing: .18em; font-weight: 800; font-size: .8rem; }
.lead, .muted, small { color: #cbd5e1; }
.lead { font-size: 1.15rem; }
.card { background: #1e293bf2; color: #f8fafc; border: 1px solid #475569; border-radius: 18px; padding: 24px; box-shadow: 0 18px 60px #02061780; }
.create-card, .join-card { max-width: 620px; margin: auto; display: grid; gap: 12px; }
.terms { max-width: 860px; margin: auto; line-height: 1.7; }
.terms h2 { margin-top: 32px; font-size: 1.2rem; }
.terms li { margin-bottom: 8px; }
h1, h2, p { margin-top: 0; }
h1:focus { outline: none; }
h2 { font-size: 1.05rem; }
label { color: #e2e8f0; font-size: .9rem; margin-top: 4px; }
input { width: 100%; background: #111827; color: #f8fafc; border: 1px solid #64748b; border-radius: 10px; padding: 12px 14px; outline: none; }
input::placeholder { color: #94a3b8; opacity: 1; }
input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px #a78bfa33; }
button { border: 0; border-radius: 10px; padding: 12px 18px; color: #fff; font-weight: 700; background: linear-gradient(135deg, #6d28d9, #7e22ce); cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button.secondary { background: #334155; border: 1px solid #64748b; }
.error { color: #fecaca; }
.room-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.room-heading h1 { margin-bottom: 6px; }
.status { font-size: .85rem; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.status.online::before { background: #4ade80; }
.status.connecting::before { background: #facc15; }
.status.offline::before { background: #fb7185; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; }
.video-shell { position: relative; overflow: hidden; border-radius: 16px; background: #000; aspect-ratio: 16 / 9; box-shadow: 0 20px 70px #0009; }
video { width: 100%; height: 100%; display: block; }
.buffer-overlay { position: absolute; inset: auto 16px 16px; padding: 10px 14px; background: #0f172af2; border: 1px solid #64748b; border-radius: 9px; text-align: center; }
.playback-ready { inset: 50% auto auto 50%; width: min(420px, calc(100% - 32px)); display: grid; gap: 12px; transform: translate(-50%, -50%); }
.change-video { display: flex; gap: 10px; margin-top: 14px; }
.change-video button { white-space: nowrap; }
aside { display: grid; gap: 20px; align-content: start; }
.participants h2, .chat h2 { display: flex; justify-content: space-between; }
.participants h2 span { color: #c4b5fd; }
.participant { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.participant small { margin-left: auto; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #6d28d9; font-weight: 800; text-transform: uppercase; }
.chat { padding-bottom: 16px; }
.messages { height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.message { display: grid; gap: 2px; font-size: .92rem; overflow-wrap: anywhere; }
.message strong { color: #c4b5fd; font-size: .8rem; }
.chat-form { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.chat-form button { padding: 0; }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0; padding: 12px; background: #991b1b; z-index: 20; }
.loading-progress { position: absolute; display: block; width: 7rem; height: 7rem; inset: 30vh 0 auto; margin: auto; }
.loading-progress circle { fill: none; stroke: #475569; stroke-width: .6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: #a78bfa; stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; }
.loading-progress-text { position: absolute; text-align: center; inset: calc(30vh + 2.8rem) 0 auto; }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Loading"); }

@media (max-width: 850px) {
    .room-grid { grid-template-columns: 1fr; }
    aside { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .container { padding-top: 24px; }
    .room-heading, .change-video { align-items: stretch; flex-direction: column; }
    aside { grid-template-columns: 1fr; }
    .hero { margin-top: 8px; }
    .site-nav { margin-right: 16px; }
}
