:root {
  color-scheme: dark;
  --ink: #f7f0e8;
  --muted: #aca4b5;
  --surface: #211c2b;
  --surface-2: #2c2538;
  --accent: #f0a56b;
  --accent-ink: #25160e;
  --danger: #e56b6f;
  --line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -20%, rgba(132, 88, 144, 0.45), transparent 40rem),
    radial-gradient(circle at 90% 110%, rgba(211, 116, 83, 0.24), transparent 36rem),
    #17141f;
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, .button { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; }

main { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 24px 0 48px; }

header, .room-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
header { min-height: 52px; }
.brand { color: var(--ink); font-weight: 800; letter-spacing: -0.03em; text-decoration: none; font-size: 1.25rem; }
#identity { color: var(--muted); font-size: 0.9rem; }

.panel {
  width: min(760px, 100%);
  margin: clamp(64px, 12vh, 140px) auto 0;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(33, 28, 43, 0.8);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.panel.compact { margin: 24px auto; padding: 28px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; }
h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 5rem); line-height: 0.98; letter-spacing: -0.055em; }
.room-bar h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.lede { max-width: 620px; margin: 28px 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); }
.fine, #room-status { color: var(--muted); }
.fine { margin: 24px 0 0; font-size: 0.84rem; }

button, .button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.primary { background: var(--accent); color: var(--accent-ink); }
.secondary, .control { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
.danger { background: var(--danger); color: #21090a; }
button:hover, .button:hover { filter: brightness(1.08); }
button:focus-visible, .button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: 0.6; }

#room { margin-top: 52px; }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-top: 28px; }
.video-card { position: relative; min-height: 260px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #09080c; }
.video-card video { width: 100%; height: 100%; min-height: 260px; display: block; object-fit: cover; }
.video-card.local video { transform: scaleX(-1); }
.video-card span { position: absolute; bottom: 12px; left: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.66); font-size: 0.82rem; }

.controls { position: sticky; bottom: 20px; display: flex; width: fit-content; max-width: 100%; margin: 28px auto 0; padding: 8px; gap: 8px; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; background: rgba(23, 20, 31, 0.92); backdrop-filter: blur(18px); }
.control { white-space: nowrap; }
.notice { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 14px 18px; border-radius: 14px; background: var(--ink); color: #17141f; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.hidden { display: none !important; }

@media (max-width: 640px) {
  main { width: min(100% - 20px, 1180px); padding-top: 12px; }
  .room-bar { align-items: flex-start; flex-direction: column; }
  .panel { border-radius: 22px; }
  .controls { border-radius: 18px; }
  .control { padding: 0 15px; }
}

@media (prefers-reduced-motion: no-preference) {
  .panel, #room { animation: arrive 400ms ease-out both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(12px); } }
}
