:root {
  --bg: #1a0f1f;
  --card: #2a1830;
  --text: #fbeff5;
  --muted: #c9a9bd;
  --pink: #ff4f8b;
  --pink2: #ff8fb3;
  --line: #4a2d52;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }

/* ---------- home + lobby card ---------- */
body.home {
  min-height: 100%;
  display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #4a1d3f 0, var(--bg) 60%);
}
.card {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.logo { display: block; width: 140px; height: 140px; margin: -8px auto 0; filter: drop-shadow(0 8px 20px rgba(255,79,139,.35)); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(1); } 45% { transform: scale(1.04); } }
.lobby .logo { width: 110px; height: 110px; }
h1 { margin: 6px 0 4px; font-size: 26px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.field { display: block; text-align: left; margin: 14px 0; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input {
  width: 100%; padding: 13px 14px; border-radius: 12px; font-size: 16px;
  border: 1px solid var(--line); background: #1f1224; color: var(--text); outline: none;
}
input:focus { border-color: var(--pink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 18px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; color: var(--text);
}
.btn.primary { width: 100%; background: linear-gradient(135deg, var(--pink), #c2185b); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { padding: 10px 14px; font-size: 14px; background: var(--line); flex-shrink: 0; }
.share { margin-top: 22px; text-align: left; }
.share p { color: var(--muted); margin: 0 0 8px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-size: 14px; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1; width: auto; }
.err { color: #ff9aa2; font-size: 14px; min-height: 1em; }

/* ---------- call screen ---------- */
body.call { background: #000; overflow: hidden; height: 100dvh; }
video { background: #111; object-fit: cover; }
.mirror { transform: scaleX(-1); }
.big { position: fixed; inset: 0; width: 100%; height: 100%; }
.pip {
  position: fixed; z-index: 3; right: 14px; top: calc(14px + env(safe-area-inset-top));
  width: 110px; height: 160px; border-radius: 16px; border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 20px rgba(0,0,0,.5); cursor: pointer;
}
@media (min-width: 768px) { .pip { width: 220px; height: 150px; } }
/* before the other person connects, show yourself full screen */
body.call:not(.live) #local { inset: 0; width: 100%; height: 100%; top: 0; right: 0; border: 0; border-radius: 0; }
body.call:not(.live) #remote { display: none; }

.status {
  position: fixed; z-index: 4; left: 50%; top: 40%; transform: translateX(-50%);
  max-width: 88%; text-align: center; white-space: pre-line;
  background: rgba(0,0,0,.55); padding: 12px 18px; border-radius: 14px; font-size: 16px;
  backdrop-filter: blur(6px);
}
.lobby {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(to top, rgba(26,15,31,.95), rgba(26,15,31,.55));
}
.lobby h1 { font-size: 22px; }

.controls {
  position: fixed; z-index: 5; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 999px;
  background: rgba(20,10,25,.6); backdrop-filter: blur(10px);
}
.ctl {
  width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 21px; background: rgba(255,255,255,.16);
}
.ctl.off { background: rgba(255,255,255,.9); filter: grayscale(1); position: relative; }
.ctl.off::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 3px; background: #e53935; transform: rotate(-45deg); }
.ctl.end { background: #e53935; transform: rotate(135deg); }
@media (max-width: 380px) { .controls { gap: 6px; padding: 8px; } .ctl { width: 44px; height: 44px; font-size: 18px; } }

.again { position: fixed; z-index: 6; left: 50%; bottom: 25%; transform: translateX(-50%); width: auto !important; padding: 13px 28px; }

.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
.hearts span { position: absolute; bottom: -40px; animation: floatUp 3s ease-in forwards; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-105vh) scale(1.3) rotate(20deg); opacity: 0; }
}
