:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7f7f8;
  background: #0b0c10;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #1b1e27 0, #0b0c10 42%); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.shell { width: min(1500px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.landing { display: grid; place-items: center; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.brand { font-weight: 800; letter-spacing: -0.03em; font-size: 22px; }
.card { border: 1px solid #2b2f3a; background: rgba(20,22,29,.9); border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.32); }
.hero { max-width: 760px; padding: 54px; text-align: center; }
.hero h1 { font-size: clamp(38px, 7vw, 72px); line-height: .98; letter-spacing: -.055em; margin: 14px 0 18px; }
.hero p { color: #a9afbd; font-size: 18px; line-height: 1.65; max-width: 620px; margin: 0 auto 30px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; font-weight: 800; color: #9ca3af; }
.grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 20px; }
.video-card, .room-card, .viewer-card { padding: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1, h2 { margin: 4px 0 0; letter-spacing: -.035em; }
h1 { font-size: 30px; }
h2 { font-size: 25px; }
.video-wrap { position: relative; overflow: hidden; border-radius: 16px; background: #050608; aspect-ratio: 16/9; border: 1px solid #292d36; display: grid; place-items: center; }
.video-wrap video { width: 100%; height: 100%; object-fit: contain; background: #050608; }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #666d7c; pointer-events: none; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.actions.wrap { justify-content: flex-start; flex-wrap: wrap; }
.button, .icon-button { border: 0; border-radius: 12px; padding: 12px 17px; cursor: pointer; font-weight: 750; transition: transform .12s ease, opacity .12s ease; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button:disabled, .icon-button:disabled { opacity: .42; cursor: default; transform: none; }
.primary { background: #f4f4f5; color: #0b0c10; }
.secondary { background: #242833; color: #f7f7f8; }
.danger { background: #382026; color: #ffcad3; }
.icon-button { background: #292d36; color: #fff; white-space: nowrap; }
.pill { font-size: 12px; padding: 7px 10px; border-radius: 999px; background: #262a34; color: #c0c5d0; }
.pill.ok { background: #183127; color: #92e6b8; }
.pill.muted { color: #b2b7c2; }
label { display: block; margin: 20px 0 8px; color: #838a99; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; }
.code { font-size: 34px; font-weight: 850; letter-spacing: .08em; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { min-width: 0; flex: 1; border: 1px solid #333744; background: #0f1117; color: #f4f4f5; padding: 12px 13px; border-radius: 12px; outline: none; }
.muted-text { color: #9096a4; line-height: 1.5; }
.status-list { margin-top: 22px; border-top: 1px solid #292d36; border-bottom: 1px solid #292d36; }
.status-list div { display: flex; justify-content: space-between; padding: 14px 0; }
.status-list div + div { border-top: 1px solid #242833; }
.status-list span { color: #9096a4; }
.notice { margin-top: 20px; color: #9198a7; background: #11141b; border-radius: 14px; padding: 14px; font-size: 13px; line-height: 1.55; }
.viewer-card { max-width: 1180px; margin: 0 auto; }
.join-panel { margin-bottom: 18px; max-width: 620px; }
.join-panel p { color: #9ea4b1; }
.viewer-video { width: 100%; }
.error { background: #351c22; color: #ffc3ce; border-radius: 12px; padding: 12px 14px; }

.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: stretch; }
.app-layout > .grid { min-width: 0; }
.chat-card { min-height: 520px; display: flex; flex-direction: column; padding: 18px; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #292d36; padding-bottom: 12px; }
.chat-header h2 { margin: 0; }
.chat-header span { color: #9da4b4; font-size: .85rem; }
.chat-messages { flex: 1; min-height: 260px; max-height: 620px; overflow-y: auto; padding: 12px 2px; }
.chat-message { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.chat-meta { display: flex; align-items: center; gap: 7px; font-size: .82rem; }
.chat-meta time { margin-left: auto; color: #777f90; }
.chat-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.host-badge { border-radius: 999px; padding: 2px 6px; background: #6d5dfc; color: white; font-size: .65rem; font-weight: 700; }
.chat-system { color: #8c94a6; font-size: .82rem; font-style: italic; text-align: center; padding: 7px; }
.chat-compose { display: flex; gap: 8px; margin-top: 10px; }
.chat-compose input { min-width: 0; flex: 1; border: 1px solid #333744; background: #0f1117; color: #f4f4f5; padding: 12px 13px; border-radius: 12px; outline: none; }
.name-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3,4,8,.86); backdrop-filter: blur(8px); }
.name-overlay[hidden] { display: none; }
.name-dialog { width: min(100%, 390px); display: grid; gap: 14px; padding: 24px; }
.name-dialog h2 { margin: 0; }
.name-dialog input { border: 1px solid #333744; background: #0f1117; color: #f4f4f5; padding: 12px 13px; border-radius: 12px; outline: none; }
.identity-bar { position: fixed; right: 18px; bottom: 14px; z-index: 20; display: flex; gap: 8px; align-items: center; border: 1px solid #292d36; border-radius: 999px; padding: 6px 10px; background: #11141bcc; backdrop-filter: blur(8px); font-size: .82rem; }
.text-button { border: 0; padding: 0; color: #a99cff; background: transparent; cursor: pointer; }

@media (max-width: 1000px) {
  .app-layout { grid-template-columns: 1fr; }
  .chat-card { min-height: 420px; }
  .chat-messages { max-height: 360px; }
}

@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 34px 22px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .copy-row { flex-direction: column; }
  .actions { flex-direction: column; }
  .actions .button { text-align: center; }
}
