/* ═══════════════════════════════════════════════════════════════════
   Room-Start Bottom Sheet — appears after the user clicks "Start a room"
   Mobile: slides up from bottom · Desktop: centered modal
   ═══════════════════════════════════════════════════════════════════ */

.rs-root {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
  pointer-events: none;
}
.rs-root.rs-open {
  display: block;
  pointer-events: auto;
}

.rs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 12, 0.72);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
  opacity: 0;
  animation: rs-fade-in 0.18s ease forwards;
}

@keyframes rs-fade-in {
  to { opacity: 1; }
}

.rs-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 0);
  width: 100%;
  max-width: 460px;
  padding: 14px 22px calc(28px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,0) 60%),
    #0e0e1c;
  border: 1px solid rgba(255,255,255,.09);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.6);
  animation: rs-slide-up 0.28s cubic-bezier(.22,1,.36,1) both;
  will-change: transform;
}

@keyframes rs-slide-up {
  from { transform: translate(-50%, 100%); }
  to   { transform: translate(-50%, 0); }
}

.rs-grabber {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  margin: 0 auto 14px;
}

.rs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #9aa3b8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.rs-close:hover { background: rgba(255,255,255,.08); color: #eef1f8; }

/* ── Head ── */
.rs-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 22px;
}

.rs-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(100,210,255,.22);
  background: rgba(100,210,255,.08);
  color: #64d2ff;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.rs-mode-emoji { font-size: 1rem; line-height: 1; }
.rs-mode-name { line-height: 1; }

.rs-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #eef1f8;
  line-height: 1.15;
}
.rs-sub {
  margin: 0;
  font-size: .92rem;
  line-height: 1.55;
  color: #9aa3b8;
}

/* ── Share box (room link + copy button) ── */
.rs-share-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid rgba(100,210,255,.18);
  background: rgba(100,210,255,.06);
}
.rs-share-url {
  flex: 1;
  min-width: 0;
  font-family: "Space Grotesk", "SF Mono", Menlo, monospace;
  font-size: .82rem;
  font-weight: 600;
  color: #cfe9ff;
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rs-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(100,210,255,.32);
  background: rgba(100,210,255,.14);
  color: #64d2ff;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .12s;
}
.rs-copy-btn:hover  { background: rgba(100,210,255,.22); }
.rs-copy-btn:active { transform: scale(.96); }

.rs-share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.rs-share-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: #cfd6e3;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}
.rs-share-btn:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
}

/* Pill variant for join sheet */
.rs-mode-pill-join {
  border-color: rgba(192,132,252,.28) !important;
  background: rgba(192,132,252,.1) !important;
  color: #c084fc !important;
}

/* ── Join-with-code input ── */
.jc-input-wrap {
  margin: 0 0 18px;
}
.jc-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #eef1f8;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -.005em;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.jc-input::placeholder { color: #4e5a72; }
.jc-input:focus {
  border-color: rgba(100,210,255,.45);
  box-shadow: 0 0 0 3px rgba(100,210,255,.12);
}
.jc-error {
  margin-top: 8px;
  font-size: .82rem;
  color: #fb7185;
  line-height: 1.4;
}

.rs-btn-paste {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #cfd6e3;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.rs-btn-paste:hover { background: rgba(255,255,255,.08); }


/* ── Actions ── */
.rs-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rs-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  width: 100%;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #64d2ff 0%, color-mix(in srgb, #64d2ff 50%, #7c3aed) 100%);
  color: #03060a;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .01em;
  box-shadow:
    0 8px 32px rgba(100,210,255,.4),
    inset 0 1px 0 rgba(255,255,255,.28);
  transition: filter .15s, transform .12s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.rs-btn-primary:hover {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 12px 40px rgba(100,210,255,.5),
    inset 0 1px 0 rgba(255,255,255,.28);
}
.rs-btn-primary:active { transform: translateY(0); transition-duration: 50ms; }

.rs-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4e5a72;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 4px 0 2px;
}
.rs-divider::before, .rs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.08);
}

.rs-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: #fff;
  color: #1f1f1f;
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .12s, box-shadow .15s;
}
.rs-btn-google:hover {
  background: #f5f6fa;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

.rs-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
  color: #4e5a72;
  font-size: .76rem;
}
.rs-foot svg { stroke: #34d399; flex-shrink: 0; }

/* ── Lock body scroll when sheet is open ── */
body.rs-locked { overflow: hidden; }

/* ── Mobile tighten ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .rs-sheet {
    padding: 12px 16px calc(22px + env(safe-area-inset-bottom));
  }
  .rs-title { font-size: 1.35rem; }
  .rs-sub   { font-size: .88rem; }
  .rs-share-box { padding: 6px 6px 6px 12px; }
  .rs-share-url { font-size: .76rem; }
  .rs-copy-btn  { padding: 7px 10px; font-size: .78rem; }
  .rs-copy-btn  span { display: none; }
  .rs-copy-btn  svg  { margin: 0; }
  .rs-share-btn { font-size: .8rem; height: 40px; }
  .rs-btn-primary { height: 52px; font-size: .96rem; }
  .rs-btn-google  { height: 48px; font-size: .9rem; }
  .jc-input { height: 50px; font-size: .96rem; }
}

/* ── Desktop: center as modal instead of bottom sheet ── */
@media (min-width: 720px) {
  .rs-sheet {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.09);
    padding: 28px 28px 26px;
    max-width: 440px;
    animation: rs-pop 0.22s cubic-bezier(.22,1,.36,1) both;
  }
  @keyframes rs-pop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
  .rs-grabber { display: none; }
  .rs-close { top: 16px; right: 16px; }
}
