/* Watch Party — cinematic dark UI. Tokens first; components reference only tokens. */
:root {
  --bg: #0B0B10;
  --bg-raise: #111118;
  --surface: #16161F;
  --surface-2: #1E1E2A;
  --surface-3: #282836;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #F4F4F6;
  --muted: #A3A3B2;
  --faint: #6E6E80;
  --accent: #FF4D6D;
  --accent-2: #FFB547;
  --accent-ink: #1A0B10;
  --ok: #3DDC97;
  --warn: #FFB547;
  --danger: #FF5C5C;
  --marquee: linear-gradient(135deg, #FF4D6D 0%, #FF7A59 55%, #FFB547 100%);
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --side-w: 360px;
  --top-h: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 2px;
  font: 800 22px/1 var(--display); letter-spacing: -0.5px;
  color: var(--text); text-decoration: none;
}
.wordmark span:last-child {
  background: var(--marquee); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wm-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-right: 8px;
  background: var(--marquee); box-shadow: 0 0 16px rgba(255, 77, 109, 0.7);
}
.wordmark.small { font-size: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface-2); font-weight: 600; text-decoration: none;
  transition: transform 0.15s var(--ease-out), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.24); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--marquee); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.28);
}
.btn.primary:hover { box-shadow: 0 10px 32px rgba(255, 77, 109, 0.42); filter: brightness(1.05); }
.btn.big { min-height: 54px; font-size: 16px; width: 100%; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }
.btn.loading .btn-label::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--muted); transition: color 0.2s, background 0.2s, transform 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }

.round {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text);
  transition: background 0.2s, color 0.2s, transform 0.15s var(--spring);
}
.round:active { transform: scale(0.9); }
.round[aria-pressed="false"] { background: rgba(255, 92, 92, 0.14); border-color: rgba(255, 92, 92, 0.35); color: #FF8A8A; }
.round .i { width: 20px; height: 20px; }

/* ---------- inputs ---------- */
input {
  width: 100%; min-height: 48px; padding: 0 16px;
  background: var(--bg-raise); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder { color: var(--faint); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.18); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-error { margin: 0; min-height: 20px; color: #FF8A8A; font-size: 14px; }

/* ---------- avatar ---------- */
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; font: 700 13px/1 var(--font); color: #111;
  background: var(--c, var(--accent));
}
.avatar.big { width: 72px; height: 72px; font-size: 28px; }

/* ================= HOME ================= */
.home {
  position: relative; min-height: 100%; overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
  display: flex; flex-direction: column; align-items: center;
}
.spotlight {
  position: absolute; inset: -20% -10% auto; height: 90vh; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 30%, rgba(255, 77, 109, 0.22), transparent 70%),
    radial-gradient(35% 45% at 75% 20%, rgba(255, 181, 71, 0.14), transparent 70%);
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, 4%, 0) scale(1.05); } }

.home-top { width: 100%; max-width: 1100px; position: relative; }
.hero {
  position: relative; width: 100%; max-width: 1100px; margin-top: 56px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px 64px; align-items: center;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.03);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
h1 {
  margin: 0; font: 800 clamp(40px, 6vw, 72px)/1.02 var(--display); letter-spacing: -2px;
}
h1 em {
  font-style: normal; background: var(--marquee); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 0; max-width: 480px; font-size: 18px; color: var(--muted); }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)), var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.join-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; animation: rise 0.6s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.invite-banner { display: flex; gap: 14px; align-items: center; padding-bottom: 4px; }
.invite-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--marquee); color: var(--accent-ink); }
.invite-avatar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.invite-title { font: 700 18px/1.2 var(--display); }
.invite-sub { color: var(--muted); font-size: 14px; }
.invite-sub b { color: var(--text); letter-spacing: 2px; }

.preview {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #22222E, #101016);
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview-off { position: absolute; inset: 0 0 56px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.preview-controls { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 12px; }
.preview-controls .round { backdrop-filter: blur(12px); background: rgba(20, 20, 28, 0.7); }
.preview-controls .round[aria-pressed="false"] { background: rgba(255, 92, 92, 0.25); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-row { display: flex; gap: 10px; }
.code-row input { text-transform: uppercase; letter-spacing: 3px; font-weight: 600; }
.code-row input::placeholder { letter-spacing: 0; text-transform: none; font-weight: 400; }

.how {
  position: relative; width: 100%; max-width: 1100px; margin-top: 72px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.how-step { padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.how-step h3 { margin: 12px 0 4px; font: 700 18px var(--display); }
.how-step p { margin: 0; color: var(--muted); font-size: 14px; }
.how-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); font-weight: 700; font-size: 13px; }
.home-foot { position: relative; margin-top: 40px; color: var(--faint); font-size: 13px; text-align: center; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; margin-top: 28px; gap: 20px; }
  .how { grid-template-columns: 1fr; margin-top: 40px; }
  .lede { font-size: 16px; }
}

/* ================= ROOM ================= */
.room {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 1fr var(--side-w);
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "top top" "stage side";
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #000;
}

.topbar {
  grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.status-chip.ok .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status-chip.bad .dot { background: var(--danger); }
.status-chip.busy .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.avatars {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { width: 28px; height: 28px; font-size: 12px; margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatars .count { font-weight: 600; font-size: 14px; }

/* ---------- stage ---------- */
.stage { grid-area: stage; position: relative; overflow: hidden; background: #000; display: grid; }
.player { position: absolute; inset: 0; display: grid; }
.player video, .player iframe, .player > div { width: 100%; height: 100%; border: 0; background: #000; }
.player video { object-fit: contain; }

.picker, .waiting {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  background:
    radial-gradient(50% 60% at 50% 35%, rgba(255, 77, 109, 0.12), transparent 70%),
    var(--bg);
}
.picker h2, .waiting h2 { margin: 0; font: 800 clamp(26px, 3.4vw, 40px)/1.1 var(--display); letter-spacing: -1px; }
.picker > p, .waiting > p { margin: 0; max-width: 440px; }

.tabs {
  display: flex; gap: 4px; padding: 4px; margin-top: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.pick-pane { display: flex; gap: 10px; width: 100%; max-width: 520px; animation: rise 0.35s var(--ease-out) both; }
.pick-pane.col { flex-direction: column; align-items: center; }
.file-drop {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 20px; cursor: pointer; text-align: left;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover { border-color: var(--accent); background: rgba(255, 77, 109, 0.06); }
.file-drop .i { width: 28px; height: 28px; color: var(--accent); }
.file-drop small { color: var(--muted); }

.reel { display: flex; gap: 8px; }
.reel span { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s var(--ease-out) infinite; }
.reel span:nth-child(2) { background: #FF7A59; animation-delay: 0.15s; }
.reel span:nth-child(3) { background: var(--accent-2); animation-delay: 0.3s; }
@keyframes bounce { 40% { transform: translateY(-10px); } 80% { transform: none; } }

.netflix-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px;
  padding: 18px 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-strong);
}
.netflix-card .clock { font: 800 44px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.netflix-card .state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.tap-sync {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  border: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px); font-weight: 600; font-size: 17px; z-index: 5;
}
.tap-ring { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--marquee); animation: pulse-ring 1.6s infinite; }
.tap-ring svg { width: 34px; height: 34px; fill: var(--accent-ink); margin-left: 4px; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6); } 80%, 100% { box-shadow: 0 0 0 26px rgba(255, 77, 109, 0); } }

.change-src {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(12, 12, 18, 0.7); backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 0.25s;
}
.stage:hover .change-src, .change-src:focus-visible { opacity: 1; }
@media (hover: none) { .change-src { opacity: 0.85; } }

/* toasts over the video */
.stage-toasts { position: absolute; left: 16px; bottom: 16px; z-index: 6; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: min(420px, 80%); }
.stage-toast {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  border-radius: 999px; background: rgba(12, 12, 18, 0.78); backdrop-filter: blur(14px);
  border: 1px solid var(--line); font-size: 14px; box-shadow: var(--shadow);
  animation: toast-in 0.35s var(--spring) both;
}
.stage-toast .avatar { width: 26px; height: 26px; font-size: 11px; }
.stage-toast.out { animation: toast-out 0.25s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

/* floating reactions */
.reactions-layer { position: absolute; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
.float-react {
  position: absolute; bottom: 8%; display: flex; flex-direction: column; align-items: center;
  animation: float-up 3.2s var(--ease-out) forwards;
}
.float-react .emoji { font-size: 44px; line-height: 1; animation: wobble 1.2s ease-in-out infinite alternate; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.float-react .who { margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #111; background: var(--c, var(--accent)); }
@keyframes float-up {
  0% { opacity: 0; transform: translateY(20px) scale(0.6); }
  12% { opacity: 1; transform: translateY(0) scale(1.1); }
  20% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-55vh); }
}
@keyframes wobble { from { transform: translateX(-10px) rotate(-8deg); } to { transform: translateX(10px) rotate(8deg); } }

/* ---------- side ---------- */
.side {
  grid-area: side; display: flex; flex-direction: column; min-height: 0;
  background: var(--bg); border-left: 1px solid var(--line);
}
.cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 12px 0; }
.cam {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-s); overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #23232F, #121218);
  box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.2s;
  animation: pop 0.4s var(--spring) both;
}
@keyframes pop { from { opacity: 0; transform: scale(0.9); } }
.cam.speaking { box-shadow: 0 0 0 2px var(--ok), 0 0 18px rgba(61, 220, 151, 0.35); }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam.self video { transform: scaleX(-1); }
.cam .cam-off { position: absolute; inset: 0; display: grid; place-items: center; }
.cam .cam-off .avatar { width: 48px; height: 48px; font-size: 20px; }
.cam .tag {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px;
  max-width: calc(100% - 12px); padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cam .tag .i { width: 12px; height: 12px; color: #FF8A8A; }
.cam .crown { color: var(--accent-2); }

.media-bar { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.react-bar { display: flex; gap: 2px; margin-left: auto; }
.react {
  width: 36px; height: 44px; border: 0; background: transparent; font-size: 22px; border-radius: 10px;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.react:hover { background: var(--surface-2); transform: translateY(-3px) scale(1.15); }
.react:active { transform: scale(0.85); }

.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.chat-empty { margin: auto; text-align: center; color: var(--faint); font-size: 14px; padding: 20px; }
.chat-empty b { display: block; color: var(--muted); font: 700 16px var(--display); margin-bottom: 4px; }
.msg-group { display: flex; gap: 10px; margin-top: 10px; animation: rise 0.3s var(--ease-out) both; }
.msg-group .avatar { width: 30px; height: 30px; font-size: 12px; margin-top: 2px; }
.msg-body { min-width: 0; flex: 1; }
.msg-name { font-size: 13px; font-weight: 600; color: var(--c, var(--text)); }
.msg-name time { margin-left: 6px; color: var(--faint); font-weight: 400; font-size: 11px; }
.msg-text { margin-top: 2px; word-wrap: break-word; overflow-wrap: anywhere; color: #E6E6EC; }
.msg-group.mine .msg-name { color: var(--muted); }
.sys { align-self: center; margin: 10px 0 2px; padding: 3px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; text-align: center; animation: rise 0.3s var(--ease-out) both; }
.typing { min-height: 22px; padding: 0 14px; font-size: 12px; color: var(--muted); }
.typing:not(:empty)::after { content: ""; display: inline-block; width: 16px; animation: dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.composer { display: flex; gap: 8px; padding: 0 12px 12px; }
.composer input { border-radius: 999px; min-height: 46px; background: var(--surface); }
.send {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%;
  background: var(--marquee); color: var(--accent-ink); transition: transform 0.15s var(--spring);
}
.send:active { transform: scale(0.88); }

/* ---------- sheets ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); animation: fade 0.2s both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; width: 100%; max-width: 420px; padding: 28px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-l);
  box-shadow: var(--shadow); animation: rise 0.35s var(--spring) both;
  display: flex; flex-direction: column; gap: 14px;
}
.sheet h2 { margin: 0; font: 800 26px var(--display); letter-spacing: -0.5px; }
.sheet p { margin: 0; }
.sheet-close { position: absolute; top: 14px; right: 14px; }
.qr { align-self: center; width: 200px; height: 200px; padding: 12px; background: #fff; border-radius: var(--radius); }
.qr svg { width: 100%; height: 100%; display: block; }
.link-row { display: flex; gap: 8px; }
.link-row input { font-size: 14px; color: var(--muted); }
.code-hint { text-align: center; font-size: 13px; color: var(--faint); }
.code-hint b { color: var(--text); letter-spacing: 2px; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-s); }
.people li:hover { background: var(--surface-2); }
.people .who { flex: 1; font-weight: 600; }
.people .who small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.people .flags { display: flex; gap: 6px; color: var(--muted); }
.people .flags .off { color: #FF8A8A; }

.global-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  padding: 10px 18px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: toast-in 0.3s var(--spring) both;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tablet portrait & phones: stage on top, party below ---------- */
@media (max-width: 900px) {
  .room {
    grid-template-columns: 1fr;
    grid-template-rows: var(--top-h) auto 1fr;
    grid-template-areas: "top" "stage" "side";
  }
  .stage { aspect-ratio: 16 / 9; max-height: 56vh; }
  .side { border-left: 0; }
  .cams { display: flex; overflow-x: auto; padding: 10px 12px 0; scroll-snap-type: x mandatory; }
  .cam { flex: 0 0 132px; scroll-snap-align: start; }
  .topbar { gap: 10px; padding: 0 12px; }
  .status-chip #statusText { display: none; }
  .status-chip { padding: 8px; }
  #inviteBtn span { display: none; }
  #inviteBtn { width: 44px; padding: 0; }
  .picker h2, .waiting h2 { font-size: 24px; }
  .picker { gap: 10px; }
}
@media (max-width: 420px) {
  .wordmark.small { font-size: 0; gap: 0; }
  .wordmark.small .wm-dot { margin: 0; width: 14px; height: 14px; }
  .react { width: 32px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .float-react { animation: fade 0.2s both; }
}

/* ---------- host controls: knock requests, switches, kick ---------- */
.knocks { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
.knocks:not(:empty) { padding-top: 12px; }
.knock {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid rgba(255, 181, 71, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 181, 71, 0.08); animation: pop 0.35s var(--spring) both;
}
.knock .who { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.knock .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knock .who span { color: var(--muted); font-size: 12px; }
.knock .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }

.wait-note {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-strong);
  animation: rise 0.35s var(--ease-out) both;
}
.wait-note > div:nth-child(2) { flex: 1; font-size: 14px; }
.wait-note b { display: block; }
.wait-note span { color: var(--muted); font-size: 13px; }
.wait-note .reel span { width: 8px; height: 8px; }

.controls { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.controls h3 { margin: 0 0 4px; font: 700 13px var(--font); letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius-s); cursor: pointer; }
.switch-row:hover { background: var(--surface-2); }
.switch-row > span:first-child { flex: 1; }
.switch-row b { display: block; font-size: 15px; }
.switch-row small { color: var(--muted); font-size: 12px; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line-strong); transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.25s var(--spring);
}
.switch-row input:checked + .switch { background: var(--marquee); border-color: transparent; }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.rules-note { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); color: var(--muted); font-size: 13px; }

.kick {
  min-height: 32px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255, 92, 92, 0.35); background: rgba(255, 92, 92, 0.1); color: #FF8A8A;
  transition: background 0.2s;
}
.kick:hover { background: rgba(255, 92, 92, 0.2); }
.lock-badge { display: inline-flex; color: var(--accent-2); }
.lock-badge .i { width: 14px; height: 14px; }
.kick[data-armed] { background: var(--danger); border-color: var(--danger); color: #1A0B10; }

/* Prime Video companion: one-time setup for the Safari sync bookmark */
.sync-help { width: 100%; max-width: 420px; margin-top: 6px; text-align: left; font-size: 13px; color: var(--muted); }
.sync-help summary { cursor: pointer; color: var(--accent-2); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.sync-help ol { margin: 8px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.sync-help .btn { min-height: 38px; font-size: 13px; }

/* A round button whose "off" state is not a warning (for example Share screen). */
.round.neutral[aria-pressed="false"] { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.round.neutral[aria-pressed="true"] { background: var(--marquee); border-color: transparent; color: var(--accent-ink); }
.waiting { overflow-y: auto; }
.waiting:has(details[open]) { justify-content: flex-start; }

.people .who small.call-line { color: var(--faint); font-size: 11px; line-height: 1.35; margin-top: 2px; }
.cam audio { display: none; }
