:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: #0a1220;
  color: #edf4ff;
  --panel: #111e32;
  --panel-soft: #162640;
  --line: #293d59;
  --muted: #a6b6cc;
  --accent: #63e6ce;
  --accent-strong: #21c7ad;
  --danger: #ff8d9b;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% -15%, #203854 0, #0a1220 54rem); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #f2c66d; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; top: -5rem; right: 1rem; z-index: 3; background: white; color: #111; padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.site-header, .site-footer { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; }
.site-header { padding: 1.5rem 0; border-bottom: 1px solid rgba(166, 182, 204, .14); }
.brand { display: flex; align-items: center; gap: .85rem; }
.brand-mark { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; background: rgba(99, 230, 206, .12); color: var(--accent); border: 1px solid rgba(99, 230, 206, .28); border-radius: 1.1rem; }
.brand-mark svg { width: 2.1rem; height: 2.1rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.35rem; margin-bottom: 0; letter-spacing: .01em; }
.eyebrow { color: var(--accent); font-size: .78rem; letter-spacing: .04em; margin-bottom: .25rem; }
.server-pill { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); background: rgba(17, 30, 50, .8); border: 1px solid var(--line); border-radius: 999px; padding: .5rem .8rem; font-size: .85rem; }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .25rem rgba(99, 230, 206, .12); }
.layout { width: min(1100px, calc(100% - 2rem)); margin: 3rem auto; }
.join-panel, .room-panel { background: linear-gradient(145deg, rgba(22, 38, 64, .98), rgba(14, 25, 42, .98)); border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .28); border-radius: 1.5rem; }
.join-panel { max-width: 620px; margin: 0 auto; padding: clamp(1.4rem, 4vw, 2.5rem); }
.panel-heading { margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.55rem, 4vw, 2rem); margin-bottom: .55rem; }
.intro, .notice p, .room-meta { color: var(--muted); line-height: 1.7; }
.join-form { display: grid; gap: .6rem; }
.join-form label { margin-top: .55rem; font-weight: 650; }
input { min-width: 0; width: 100%; color: #f2f7ff; background: #0b1627; border: 1px solid #344a68; border-radius: .75rem; padding: .9rem 1rem; }
input::placeholder { color: #8195ae; }
small { color: var(--muted); line-height: 1.5; }
.button { border: 1px solid transparent; border-radius: .75rem; padding: .82rem 1rem; font-weight: 700; transition: transform .15s ease, filter .15s ease, background .15s ease; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: #06251f; background: var(--accent); }
.button-primary:hover { background: #8cf0de; }
.join-form .button-primary { margin-top: .85rem; }
.button-secondary { color: #f4d7dc; background: #351f2a; border-color: #633442; }
.button-mic { color: #08271f; background: var(--accent); min-width: 13rem; }
.button-mic[data-muted="true"] { color: #fff0f1; background: #8e3345; border-color: #b95868; }
.button-send { padding-inline: 1.1rem; }
.status-message { min-height: 1.4rem; color: var(--muted); margin: .4rem 0 0; line-height: 1.5; }
.status-message[data-error="true"] { color: var(--danger); }
.notice { margin-top: 1.8rem; padding: 1rem 1.1rem; border-inline-start: 3px solid var(--accent); background: rgba(8, 18, 32, .55); border-radius: .5rem; }
.notice strong { display: block; margin-bottom: .35rem; }
.notice p { margin-bottom: 0; font-size: .92rem; }
.room-panel { padding: clamp(1.2rem, 3vw, 2rem); }
.room-header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.room-header { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.room-header h2 { margin-bottom: .15rem; }
.room-meta { margin-bottom: 0; font-size: .95rem; }
.room-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1rem; margin-top: 1.2rem; }
.people-card, .chat-card { border: 1px solid var(--line); background: rgba(8, 18, 32, .46); border-radius: 1rem; padding: 1.1rem; min-width: 0; }
.people-card h3, .chat-card h3 { font-size: 1.05rem; margin-bottom: .9rem; }
.count-badge { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--panel-soft); color: var(--accent); }
.people-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; min-height: 4rem; }
.person { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem; background: var(--panel); border: 1px solid rgba(41, 61, 89, .8); border-radius: .75rem; }
.person-name { overflow-wrap: anywhere; }
.person-state { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.person-state.is-live { color: var(--accent); }
.mic-controls { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.chat-card { display: flex; flex-direction: column; min-height: 22rem; }
.chat-log { flex: 1; min-height: 12rem; max-height: 26rem; overflow: auto; list-style: none; padding: .25rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-item { max-width: 92%; padding: .65rem .8rem; border: 1px solid var(--line); background: var(--panel); border-radius: .8rem; overflow-wrap: anywhere; line-height: 1.55; }
.chat-item.is-self { align-self: flex-start; background: #153a3a; border-color: #28766d; }
.chat-author { display: block; color: var(--accent); font-size: .78rem; margin-bottom: .2rem; }
.chat-form { display: flex; align-items: center; gap: .55rem; }
.chat-form input { flex: 1; }
.site-footer { padding: 1.25rem 0 2rem; color: #8498b2; font-size: .83rem; justify-content: center; text-align: center; }
.site-footer p { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .layout { margin: 1.3rem auto; }
  .room-grid { grid-template-columns: 1fr; }
  .room-header { align-items: flex-start; }
  .room-header .button { font-size: .86rem; }
  .chat-card { min-height: 18rem; }
}
@media (max-width: 440px) {
  .site-header, .site-footer, .layout { width: min(100% - 1rem, 1100px); }
  .site-header { padding: 1rem 0; }
  .server-pill { font-size: .75rem; padding: .4rem .55rem; }
  .room-header { flex-direction: column; }
  .room-header .button { width: 100%; }
  .chat-form { align-items: stretch; flex-direction: column; }
  .chat-form .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
