/* Pure Vyb v2 — white join, dark call */

:root {
  --rose: #e85d75;
  --rose-dark: #d14461;
  --amber: #f4a261;
  --ink: #1a1a2e;
  --grey: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --green: #34c98e;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.view { display: none; min-height: 100dvh; }
.view.active { display: flex; align-items: center; justify-content: center; }

/* Join view scrolls, since SEO content sits below the form */
#view-join.active { display: block; align-items: unset; }
#view-join .join-card { margin: 0 auto; padding-top: 40px; }

.landing {
  max-width: 620px; margin: 0 auto; padding: 8px 24px 60px;
  border-top: 1px solid var(--line);
}
.landing h2 {
  font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600;
  margin: 34px 0 10px;
}
.landing h3 { font-size: 15px; margin: 18px 0 4px; }
.landing p { font-size: 15px; line-height: 1.65; color: #43445c; margin-bottom: 12px; }
.landing b { color: var(--ink); }
.steps { margin: 0 0 12px 20px; }
.steps li { font-size: 15px; line-height: 1.6; color: #43445c; margin-bottom: 9px; }
.landing-footer {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--grey); text-align: center;
}
.landing-footer a { color: var(--rose); }
.landing-footer p { font-size: 12.5px; color: var(--grey); margin-top: 8px; }

/* ============ JOIN (white) ============ */
.join-card { width: 100%; max-width: 420px; padding: 32px 24px; }
.logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 10px; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px; color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rose), var(--amber));
  box-shadow: 0 4px 18px rgba(232, 93, 117, .35);
}
.logo h1 { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 600; }
.tagline { text-align: center; color: var(--grey); font-size: 15px; line-height: 1.5; margin-bottom: 28px; }

.session-badge {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 auto 18px; padding: 9px 16px; width: max-content; max-width: 100%;
  border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: #f2f2f5; color: var(--grey);
}
.session-badge.live { background: #e8f9f1; color: #0d7a4f; }
.session-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.session-badge.live .dot { animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.join-form { display: flex; flex-direction: column; gap: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field em { color: var(--grey); font-weight: 400; font-style: normal; }
.field input {
  width: 100%; padding: 14px; font-size: 16px; border: 1.5px solid var(--line);
  border-radius: var(--radius); outline: none; font-family: inherit;
}
.field input:focus { border-color: var(--rose); }
.code-input { text-transform: uppercase; letter-spacing: 3px; font-weight: 700; text-align: center; }

.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-btn {
  padding: 14px; font-size: 15px; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer;
}
.gender-btn.selected { border-color: var(--rose); background: #fdf0f3; color: var(--rose-dark); }

.btn-primary {
  padding: 16px; font-size: 16px; font-weight: 700; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  border: none; border-radius: var(--radius); cursor: pointer;
  box-shadow: 0 4px 18px rgba(232, 93, 117, .35);
}
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  padding: 12px; font-size: 14px; font-weight: 600; font-family: inherit;
  background: none; border: none; color: var(--grey); cursor: pointer;
}
.privacy-note { text-align: center; font-size: 12.5px; color: var(--grey); }
/* Priming: people deny permissions that arrive without explanation. Saying what
   is about to happen, one beat before it happens, is the whole fix. */
.permission-note {
  text-align: center; font-size: 13px; line-height: 1.5; color: var(--grey);
  margin: -4px auto 0; max-width: 330px;
}
.permission-note b { color: var(--ink); }
.join-error {
  padding: 12px; border-radius: 10px; background: #fdecec; color: #c0392b;
  font-size: 14px; text-align: center;
}

.consent {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 13px; line-height: 1.45; color: var(--grey);
}
.consent input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--rose); }
.consent b { color: var(--ink); }
.consent a { color: var(--rose); }

/* ============ WAITING ============ */
.waiting-card { text-align: center; padding: 24px; max-width: 380px; }
.waiting-card h2 { font-size: 22px; margin-bottom: 10px; }
.queue-info { color: var(--grey); font-size: 14px; margin-bottom: 14px; }
.queue-position {
  display: inline-block; padding: 8px 18px; margin-bottom: 14px;
  background: #fdf0f3; color: var(--rose-dark); border-radius: 999px; font-size: 14px;
}
.queue-position b { font-size: 18px; }
.queue-tip {
  font-size: 13px; line-height: 1.5; color: var(--grey);
  max-width: 300px; margin: 0 auto 20px;
}

.room-roster {
  max-width: 340px; margin: 4px auto 20px;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left;
}
.room-roster h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--grey); font-weight: 600; margin-bottom: 10px;
}
.roster-people { display: flex; flex-wrap: wrap; gap: 6px; }
.roster-chip {
  font-size: 13.5px; padding: 6px 11px; border-radius: 999px;
  background: #fdf0f3; color: var(--rose-dark); font-weight: 600;
  animation: chipIn .25s ease;
}
.roster-chip span { font-weight: 400; opacity: .7; margin-left: 4px; }
.roster-chip.more { background: #f2f2f5; color: var(--grey); }
@keyframes chipIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.roster-chats { font-size: 12.5px; color: var(--grey); margin-top: 10px; }
.pulse-ring {
  width: 90px; height: 90px; margin: 0 auto 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fdf0f3; animation: pulse 1.6s ease-in-out infinite;
}
.pulse-heart { font-size: 34px; color: var(--rose); }

/* Aftercare: reporting has to be possible AFTER the chat, because that is when
   people reach for it - they hit Next first and think second. */
.aftercare {
  margin: 18px auto 6px; padding: 14px; max-width: 320px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.aftercare p { font-size: 13px; color: var(--grey); margin-bottom: 10px; }
.aftercare-actions { display: flex; gap: 8px; }
.btn-quiet {
  flex: 1; padding: 11px 8px; font-size: 13px; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); cursor: pointer;
}
.btn-quiet.danger { color: #c0392b; }
.btn-quiet:active { border-color: var(--rose); }
.aftercare.done { border-color: #bfe8d5; background: #f2fbf7; }
.aftercare.done p { color: #0d7a4f; font-weight: 600; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.12);} }

/* ============ CALL (dark) ============ */
.view-dark { background: #0d0d16; position: fixed; inset: 0; }
#view-call.active { display: block; }

#remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #14141f; }
#local-video {
  position: absolute; top: 76px; right: 14px; width: 104px; height: 140px;
  object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.25);
  background: #14141f; z-index: 5;
}

#local-video.cam-off { opacity: .15; }
.local-off-label {
  position: absolute; top: 76px; right: 14px; width: 104px; height: 140px; z-index: 6;
  display: none; align-items: center; justify-content: center; text-align: center;
  color: rgba(255,255,255,.75); font-size: 11px; font-weight: 600;
  border-radius: 12px; border: 2px solid rgba(255,255,255,.25); pointer-events: none;
}
.local-off-label.visible { display: flex; }

.call-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.partner-chip {
  color: #fff; font-weight: 600; font-size: 15px;
  background: rgba(0,0,0,.35); padding: 8px 14px; border-radius: 999px;
  backdrop-filter: blur(6px); display: flex; gap: 8px;
}
.partner-chip span:last-child { color: rgba(255,255,255,.65); font-weight: 400; }
.timer {
  color: #fff; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.35); padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(6px);
}
.timer.low { color: #ff6b6b; }

.icebreaker {
  position: absolute; top: 66px; left: 14px; right: 132px; z-index: 6;
  color: #fff; font-size: 13.5px; line-height: 1.4;
  background: rgba(232,93,117,.85); padding: 10px 14px; border-radius: 12px;
  backdrop-filter: blur(6px);
}
.extend-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 7;
  color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(0,0,0,.7); padding: 12px 18px; border-radius: 12px;
}

.chat-messages {
  position: absolute; bottom: 132px; left: 14px; right: 14px; z-index: 6;
  max-height: 32vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%);
}
.msg {
  align-self: flex-start; max-width: 80%; color: #fff; font-size: 14px; line-height: 1.35;
  background: rgba(0,0,0,.55); padding: 8px 12px; border-radius: 12px; backdrop-filter: blur(4px);
}
.msg.mine { align-self: flex-end; background: rgba(232,93,117,.8); }
.msg.system { align-self: center; background: rgba(255,180,0,.25); color: #ffd98a; font-size: 12.5px; }
.msg b { font-weight: 600; opacity: .8; font-size: 12px; display: block; }

.call-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 8;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,.65), transparent);
  display: flex; flex-direction: column; gap: 10px;
}
.chat-row { display: flex; gap: 8px; }
.chat-row input {
  flex: 1; padding: 12px 14px; font-size: 15px; border: none; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; outline: none; backdrop-filter: blur(8px);
}
.chat-row input::placeholder { color: rgba(255,255,255,.5); }
.btn-icon {
  width: 44px; border-radius: 50%; border: none; color: #fff; font-size: 16px; cursor: pointer;
  background: var(--rose);
}
.top-right { display: flex; align-items: center; gap: 8px; }
.top-btn {
  width: 38px; height: 38px; border: none; border-radius: 50%; cursor: pointer;
  color: #fff; font-size: 16px; background: rgba(0,0,0,.35); backdrop-filter: blur(6px);
}
.top-btn:active { background: rgba(232,93,117,.9); }

.controls { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.media-controls { display: flex; gap: 6px; }
.action-controls { display: flex; gap: 8px; }
.ctl-icon {
  width: 46px; height: 46px; border: none; border-radius: 50%; cursor: pointer;
  font-size: 18px; background: rgba(255,255,255,.14); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; position: relative;
}
/* "off" state: red tint + diagonal slash, readable at a glance */
.ctl-icon.off { background: rgba(220,50,60,.85); }
.ctl-icon.off::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px;
  background: #fff; transform: rotate(-45deg); border-radius: 2px;
}
.ctl {
  padding: 12px 16px; font-size: 14px; font-weight: 700; font-family: inherit;
  border: none; border-radius: 999px; color: #fff; cursor: pointer; backdrop-filter: blur(8px);
}
.ctl-extend { background: rgba(255,255,255,.14); }
.ctl-extend.voted { background: var(--amber); color: #4a2e00; }
.ctl-like { background: rgba(255,255,255,.14); font-size: 18px; padding: 12px 20px; }
.ctl-like.liked { background: var(--rose); }
.ctl-next { background: rgba(255,255,255,.22); }

.overlay-msg {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8); font-size: 16px; background: rgba(13,13,22,.6);
}

/* ============ MODALS ============ */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px; text-align: center;
}
.modal-card h3 { font-size: 20px; }
.modal-sub { color: var(--grey); font-size: 14px; line-height: 1.45; margin-bottom: 6px; }
.report-reason {
  padding: 13px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
}
.report-reason:active { border-color: var(--rose); }
.match-hearts { font-size: 40px; color: var(--rose); animation: pulse 1.2s infinite; }
.match-card input {
  padding: 13px; font-size: 15px; border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.their-contact {
  padding: 13px; border-radius: 12px; background: #ecfbf4; color: #0d7a4f;
  font-size: 14.5px; font-weight: 600; word-break: break-word;
}

/* ============ DESKTOP ============
   Phone gets the full-screen treatment. On a monitor that reads as a takeover,
   so the call becomes a self-contained card floating on a clean white page -
   the same visual language as the rest of the app. Every overlay below is
   positioned against the card, not the viewport. */
@media (min-width: 768px) {

  #view-call.view-dark {
    inset: auto;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(1040px, 92vw);
    height: min(660px, 86vh);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(26, 26, 46, .28), 0 2px 8px rgba(26, 26, 46, .08);
    background: #0d0d16;
  }

  /* Partner video: contain, not cover. Most people are on a phone in portrait,
     and cropping that to a landscape card blows it up into a blurry mess. */
  #remote-video { object-fit: contain; background: #08080f; }

  .call-top { padding: 16px 18px; }

  #local-video {
    top: auto; bottom: 108px; right: 18px;
    width: 168px; height: 126px;
    z-index: 8;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
  }
  .local-off-label {
    top: auto; bottom: 108px; right: 18px;
    width: 168px; height: 126px;
    z-index: 9;
  }

  .icebreaker {
    left: 50%; right: auto;
    transform: translateX(-50%);
    top: 72px;
    max-width: 600px; width: max-content;
    font-size: 15px; padding: 11px 18px;
    text-align: center;
  }

  .chat-messages {
    left: 24px; right: auto;
    width: 380px;
    bottom: 128px; max-height: 40%;
    z-index: 8;
  }

  .call-bottom { padding: 12px 18px 18px; gap: 12px; }
  .chat-row { max-width: 560px; margin: 0 auto; width: 100%; }
  .controls { justify-content: center; gap: 26px; }
  .media-controls, .action-controls { gap: 10px; }
  .ctl { padding: 13px 20px; font-size: 15px; }
  .ctl-icon { width: 48px; height: 48px; }

  /* Ended / waiting screens sit on white, so they should not be full-bleed either */
  #view-waiting.active, #view-ended.active { min-height: 100dvh; }
}
