:root {
  --bg: #12112a;
  --bg-2: #1a1938;
  --panel: #201f45;
  --panel-2: #2a2958;
  --line: rgba(255, 255, 255, .08);
  --text: #eceaff;
  --muted: #a6a3cf;
  --accent: #2f6bff;
  --accent-2: #4c82ff;
  --pink: #ff5f9e;
  --orange: #ff9a62;
  --danger: #ff4d6d;
  --ok: #34d399;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, #2b2766 0%, transparent 60%), var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.inline { width: 16px; height: 16px; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(18, 17, 42, .85);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.logo {
  font-size: 26px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -.5px;
  text-decoration: none;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.online-pill, .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  font-size: 14px;
}
.pill-btn:hover { background: rgba(255, 255, 255, .09); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px 20px;
  font-weight: 600;
  transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(47, 107, 255, .35); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: rgba(255, 255, 255, .08); }
.btn-lg { padding: 15px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: rgba(0, 0, 0, .3);
}
.icon-btn:hover { background: rgba(0, 0, 0, .5); }

/* ---------- Landing ---------- */
.landing main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 56px;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -1px; }
.lead { font-size: 18px; color: var(--muted); line-height: 1.6; max-width: 540px; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-points li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  font-size: 14px;
}
.hero-points .ico { width: 16px; height: 16px; color: var(--pink); }
.start-card {
  background: linear-gradient(160deg, #3a3886, #252359);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}
.start-card h2 { margin: 0 0 20px; font-size: 22px; }
.field { margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: rgba(0, 0, 0, .22); border: 1px solid var(--line);
}
.chip span .ico { width: 16px; height: 16px; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 16px; font-size: 14px; line-height: 1.5; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.form-error { color: var(--danger); font-size: 14px; margin: -6px 0 12px; }
.start-card .small { text-align: center; margin: 12px 0 0; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 24px 0 56px; }
.feature { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3 { margin: 14px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 15px; }
.feature-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 95, 158, .14); color: var(--pink); }
.rules { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 56px; }
.rules h2 { margin-top: 0; }
.rules li { margin: 8px 0; color: var(--muted); line-height: 1.5; }
.site-footer { text-align: center; color: var(--muted); padding: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.site-footer a { color: var(--muted); margin: 0 8px; }

/* Simple content pages (terms, privacy) */
.page { max-width: 820px; margin: 0 auto; padding: 48px 20px 64px; line-height: 1.7; }
.page h1 { font-size: 36px; margin-top: 0; }
.page p, .page li { color: var(--muted); }

/* Start card form (landing) */
.start-card h2 { font-size: 28px; margin-bottom: 6px; }
.start-sub { margin: 0 0 20px; line-height: 1.5; }
.text-input {
  display: block; width: 100%;
  padding: 14px 16px; margin-bottom: 12px;
  border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: #1a1938;
  font: inherit; font-size: 16px; text-align: center;
  outline: none;
}
.text-input:focus { box-shadow: 0 0 0 3px rgba(255, 95, 158, .45); }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: rgba(0, 0, 0, .3); color: var(--text);
}
.select-wrap select option { background: var(--panel); color: var(--text); }
.select-wrap .ico { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; width: 18px; height: 18px; }
.btn-start {
  background: linear-gradient(90deg, #ff4d6d, #ff6a52); color: #fff;
  box-shadow: 0 10px 26px rgba(255, 77, 109, .38); font-size: 19px;
}
.btn-start:hover { filter: brightness(1.07); }
.btn-start:disabled { opacity: .75; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Chat page ---------- */
.chat-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.chat-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; max-width: 1560px; width: 100%; margin: 0 auto; padding: 12px 20px 0; }
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background: #0d0e22;
  border: 1px solid var(--line);
  border-bottom: 0;
}
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .2s; }
[data-stage="connected"] .remote-video { opacity: 1; }
.stage-status {
  position: absolute; inset: 0 0 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  text-align: center; padding: 20px;
}
.spinner {
  position: relative;
  width: 124px; height: 124px; border-radius: 50%;
  border: 12px solid transparent;
  border-bottom-color: #26306e;
  border-left-color: #26306e;
  animation: spin 1.1s linear infinite;
}
.spinner::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 1px solid rgba(91, 108, 255, .22);
}
.spinner::after {
  content: ""; position: absolute; top: -16px; left: 50%; margin-left: -4px;
  width: 8px; height: 8px; border-radius: 50%; background: #7b6bff; box-shadow: 0 0 10px #7b6bff;
}
@keyframes spin { to { transform: rotate(360deg); } }

.partner-badge {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); font-size: 15px; backdrop-filter: blur(6px);
}
.partner-badge img { border-radius: 3px; object-fit: cover; }
.badge-name { font-weight: 700; }
.badge-country { color: var(--muted); }
.fs-btn { position: absolute; top: 14px; right: 14px; z-index: 3; }

/* Left: messages, status, hide */
.left-dock {
  position: absolute; left: 20px; bottom: 22px; z-index: 2;
  width: min(400px, calc(50% - 160px));
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.messages {
  width: 100%;
  max-height: 34vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin;
}
.msg {
  align-self: flex-start;
  max-width: 100%;
  padding: 7px 12px; border-radius: 12px;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px);
  font-size: 14px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg b { font-weight: 700; }
.msg-me b { color: #8fb0ff; }
.msg-them b { color: var(--pink); }
.msg-sys { color: var(--muted); font-style: italic; background: rgba(0, 0, 0, .3); }
.msgs-hidden .messages { display: none; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 100%;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: rgba(20, 22, 52, .85); border: 1px solid rgba(123, 107, 255, .35);
  font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sdot { width: 8px; height: 8px; border-radius: 50%; background: #7b6bff; flex: none; box-shadow: 0 0 0 3px rgba(123, 107, 255, .25); }
.status-pill.is-searching .sdot, .status-pill.is-connecting .sdot { animation: blink 1.2s infinite; }
.status-pill.is-connected .sdot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.status-pill.is-idle .sdot { background: var(--muted); box-shadow: none; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 30px; border-radius: 10px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
}
.ghost-btn .ico { width: 16px; height: 16px; }
.msgs-hidden .hide-btn .ico { transform: rotate(180deg); }

.hearts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.float-heart { position: absolute; bottom: 140px; font-size: 42px; color: var(--pink); animation: floatUp 2.2s ease-out forwards; }
.float-heart.is-fire { font-size: 54px; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-320px) scale(1.3); opacity: 0; }
}

/* Centre: small actions + STOP / spark / Next */
.center-dock {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.stage-actions { display: flex; gap: 10px; }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: rgba(20, 22, 52, .85); color: #fff; backdrop-filter: blur(6px);
}
.round-btn:not(:disabled):hover { background: rgba(255, 255, 255, .16); }
#likeBtn:not(:disabled):hover { color: var(--pink); }
#reportBtn:not(:disabled):hover { color: var(--danger); }
.round-btn .off, .round-btn.is-off .on { display: none; }
.round-btn.is-off .off { display: block; }
.round-btn.is-off { background: var(--danger); border-color: var(--danger); }

.main-ctrls { display: flex; align-items: center; gap: 12px; }
.ctrl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 124px; justify-content: center;
  padding: 11px 24px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 17px; font-weight: 600;
  transition: transform .1s, background .15s;
}
.ctrl-btn:active { transform: scale(.97); }
.ctrl-btn .ico { width: 18px; height: 18px; }
.ctrl-stop { background: #3b3d63; }
.ctrl-stop:hover { background: #484a75; }
.ctrl-stop.is-start { background: var(--ok); border-color: var(--ok); color: #06281c; }
.ctrl-next { background: #2a2c4f; }
.ctrl-next:hover { background: #35385f; }
.ctrl-fire {
  width: 70px; height: 70px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #4c8dff, #1f5fff 70%);
  color: #fff; box-shadow: 0 8px 26px rgba(47, 107, 255, .5);
  transition: transform .1s;
}
.ctrl-fire .ico { width: 34px; height: 34px; stroke: none; }
.ctrl-fire:not(:disabled):hover { transform: scale(1.06); }
.ctrl-fire:disabled { opacity: .55; }

/* Self-view */
.pip {
  position: absolute; right: 22px; bottom: 22px; z-index: 2;
  width: min(380px, 24vw); aspect-ratio: 16 / 9;
  border-radius: 16px; overflow: hidden;
  background: #0a0b1d; border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  transition: width .2s;
}
.local-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; }
.pip.has-video .local-video { opacity: 1; }
.pip-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #3b8ed8; }
.pip-placeholder .ico { width: 42px; height: 42px; fill: currentColor; stroke: none; }
.pip.has-video .pip-placeholder { display: none; }
.pip-paused {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #0a0b1d; color: var(--muted); font-size: 13px;
}
.pip-paused .ico { width: 30px; height: 30px; }
.pip-min { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; z-index: 2; }
.pip-ctrls {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2;
  display: flex; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(20, 22, 52, .75);
}
.pip-ctrls .icon-btn { background: transparent; width: 36px; height: 36px; }
.pip-ctrls .icon-btn .off, .pip-ctrls .icon-btn.is-off .on { display: none; }
.pip-ctrls .icon-btn.is-off .off { display: block; color: var(--danger); }
.pip.mini { width: 140px; }
.pip.mini .pip-ctrls { display: none; }

/* Bottom bar */
.bottombar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px 18px;
  background: #11122a;
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 18px 18px;
  margin-bottom: 12px;
}
.filter-wrap { position: relative; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 200px; padding: 6px 18px 6px 6px;
  border-radius: 999px; border: 1px solid var(--line);
  background: #1b1c3c;
}
.filter-btn:hover { background: #24264d; }
.filter-btn .caret { width: 16px; height: 16px; color: var(--muted); }
.filter-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; }
.g-ico { background: linear-gradient(135deg, var(--pink), var(--orange)); color: #fff; }
.c-ico { background: linear-gradient(135deg, #0ea5a4, #2563eb); color: #fff; }
.c-ico img { width: 100%; height: 100%; object-fit: cover; }
.filter-val { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.popover {
  position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 180px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4); z-index: 30;
}
.popover button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; }
.popover button:hover { background: rgba(255, 255, 255, .08); }
.msg-form {
  flex: 1; display: flex; align-items: center;
  border-radius: 999px; background: #1b1c3c; border: 1px solid var(--line);
  padding: 4px 6px 4px 22px;
}
.msg-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 13px 0; outline: none; }
.msg-form input::placeholder { color: rgba(255, 255, 255, .3); }
.send-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; }

/* Text-only mode: hide video, make chat the main view */
.mode-text .pip, .mode-text .fs-btn, .mode-text .remote-video, .mode-text .hide-btn,
.mode-text #pauseBtn, .mode-text #camSwitchBtn { display: none !important; }
.mode-text .left-dock { left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 40px)); top: 70px; bottom: 170px; justify-content: flex-end; }
.mode-text .messages { max-height: none; flex: 1; }
.mode-text.msgs-hidden .messages { display: flex; }
.mode-text[data-stage="connected"] .stage-status { display: none; }
.mode-text[data-stage="searching"] .messages,
.mode-text[data-stage="idle"] .messages { opacity: .5; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(6, 5, 20, .7); backdrop-filter: blur(4px);
}
.modal-card {
  width: min(440px, 100%); max-height: 85vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}
.modal-card h3 { margin: 0 0 8px; font-size: 19px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.search-box input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; padding: 11px 0; outline: none; }
.search-box .ico { color: var(--muted); width: 18px; height: 18px; }
.country-list { margin-top: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.country-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.country-item:hover { background: rgba(255, 255, 255, .06); }
.country-item.active { background: rgba(47, 107, 255, .25); }
.country-item img { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; }
.flag-any { width: 28px; display: grid; place-items: center; color: var(--muted); }
.reason-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.reason-list button { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.reason-list button:hover { background: rgba(255, 77, 109, .15); border-color: rgba(255, 77, 109, .4); }

/* ---------- Admin ---------- */
.admin main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.admin table { width: 100%; border-collapse: collapse; background: var(--bg-2); border-radius: 12px; overflow: hidden; margin-bottom: 30px; font-size: 14px; }
.admin th, .admin td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.admin th { color: var(--muted); font-weight: 600; background: var(--panel); }
.admin .stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.admin .stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; min-width: 150px; }
.admin .stat b { display: block; font-size: 28px; }
.admin form.inline { display: inline; }
.admin .btn { padding: 6px 12px; font-size: 13px; }
.admin .login { max-width: 360px; margin: 80px auto; }
.admin input[type=password] { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--text); font: inherit; margin: 10px 0 14px; }
.alert { padding: 12px 16px; border-radius: 10px; background: rgba(255, 77, 109, .15); border: 1px solid rgba(255, 77, 109, .35); margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .left-dock { bottom: 168px; width: min(400px, calc(100% - 40px)); }
  .pip { width: min(300px, 26vw); }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 32px; }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; height: 54px; }
  .logo { font-size: 22px; }
  .online-pill { padding: 6px 10px; font-size: 13px; }
  .pill-btn { display: none; }
  .features { grid-template-columns: 1fr; }
  .chat-wrap { padding: 0; }
  .stage { border-radius: 0; border: 0; }
  .pip { top: 60px; right: 12px; bottom: auto; width: 32vw; aspect-ratio: 3 / 4; }
  .pip.mini { width: 90px; }
  .pip-ctrls { padding: 2px 4px; gap: 2px; }
  .pip-ctrls .icon-btn { width: 30px; height: 30px; }
  .partner-badge { top: 12px; left: 12px; max-width: calc(100% - 32vw - 40px); font-size: 14px; }
  .left-dock { left: 12px; bottom: 150px; width: calc(100% - 24px); gap: 8px; }
  .messages { max-height: 26vh; }
  .hide-btn { padding: 7px 16px; font-size: 14px; }
  .center-dock { bottom: 14px; gap: 10px; width: calc(100% - 24px); }
  .stage-actions { gap: 8px; }
  .round-btn { width: 40px; height: 40px; }
  .main-ctrls { gap: 8px; width: 100%; justify-content: center; }
  .ctrl-btn { min-width: 0; flex: 1; max-width: 140px; padding: 11px 12px; font-size: 15px; }
  .ctrl-fire { width: 60px; height: 60px; flex: none; }
  .ctrl-fire .ico { width: 28px; height: 28px; }
  .stage-status { inset: 0 0 160px; }
  .spinner { width: 84px; height: 84px; border-width: 8px; }
  .spinner::before { inset: -8px; }
  .spinner::after { top: -12px; }
  .bottombar { border-radius: 0; border: 0; margin: 0; gap: 8px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .filter-btn { min-width: 0; padding: 4px; }
  .filter-val, .filter-btn .caret { display: none; }
  .filter-ico { width: 40px; height: 40px; }
  .msg-form { padding-left: 14px; }
  .mode-text .left-dock { top: 60px; bottom: 150px; width: calc(100% - 24px); }
}

/* ---------- Recording badge & announcement ---------- */
.rec-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 700; letter-spacing: .06em;
}
.rec-badge span { width: 8px; height: 8px; border-radius: 50%; background: #ff3b5c; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.announce {
  text-align: center; padding: 10px 16px; font-size: 14px;
  background: linear-gradient(90deg, rgba(255, 95, 158, .22), rgba(47, 107, 255, .22));
  border-bottom: 1px solid var(--line);
}

/* ---------- Pre-recorded model videos ---------- */
.is-model .remote-video { opacity: 1; }
.is-model .stage-status { display: none; }
/* "Pre-recorded video · not live": a small watermark on the video (kept readable) */
.model-label {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, .35); color: rgba(255, 255, 255, .85);
  font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6); pointer-events: none;
}
.model-label .ico { width: 12px; height: 12px; }
.badge-tag { padding: 2px 8px; border-radius: 999px; background: rgba(255, 170, 60, .9); color: #2a1600; font-size: 12px; font-weight: 700; }
@media (max-width: 760px) {
  .model-label { bottom: 230px; left: 10px; font-size: 11px; }
}

/* ---------- Camera / microphone picker ---------- */
.device-wrap { position: relative; }
.device-menu {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 40;
  width: 280px; max-height: 50vh; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); text-align: left;
}
.device-menu .menu-head { padding: 8px 10px 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.device-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 10px 9px 30px; border: 0; border-radius: 8px;
  background: transparent; font-size: 14px; position: relative;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.device-menu button:hover { background: rgba(255, 255, 255, .08); }
.device-menu button.active::before { content: "✓"; position: absolute; left: 10px; color: var(--ok); font-weight: 700; }

/* Start page camera check */
.cam-check video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transform: scaleX(-1); background: #000; border-radius: 12px; margin-bottom: 12px; display: block; }
.cam-check .dev-label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; text-align: left; }
.mic-meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: -4px 0 14px; }
.mic-meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; margin-top: 10px; }
@media (max-width: 760px) { .device-menu { width: min(280px, 90vw); } }

/* ---------- Typing indicator, emoji picker, unsent messages ---------- */
.typing {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .45); font-size: 13px; color: var(--muted);
}
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typingDot 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.typing em { font-style: normal; margin-left: 4px; }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.msg-failed { opacity: .55; text-decoration: line-through; }
.emoji-wrap { position: relative; }
.emoji-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; margin-right: 4px; }
.emoji-btn:hover { background: rgba(255, 255, 255, .08); }
.emoji-menu {
  position: absolute; bottom: calc(100% + 12px); right: -40px; z-index: 40;
  width: 296px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.emoji-menu button { border: 0; background: transparent; font-size: 20px; padding: 5px 0; border-radius: 8px; }
.emoji-menu button:hover { background: rgba(255, 255, 255, .1); }
@media (max-width: 760px) {
  .emoji-btn { width: 34px; height: 34px; font-size: 18px; margin-right: 2px; }
  .emoji-menu { right: -48px; width: min(296px, 92vw); }
}

/* ---------- FAQ and error pages ---------- */
.faq { margin-bottom: 56px; }
.faq h2 { margin: 0 0 16px; }
.faq details { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--pink); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.not-found { text-align: center; padding: 40px 0; }

/* ---------- Language picker ---------- */
.lang-pick select {
  appearance: none; -webkit-appearance: none;
  background: rgba(255, 255, 255, .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6a3cf' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 30px 8px 14px; font: inherit; font-size: 14px; max-width: 170px; cursor: pointer;
}
.lang-pick select option { background: var(--panel); color: var(--text); }
.translate-note { padding: 10px 14px; border-radius: 10px; background: rgba(47, 107, 255, .15); border: 1px solid rgba(47, 107, 255, .35); font-size: 14px; }
@media (max-width: 760px) { .lang-pick select { max-width: 110px; padding: 6px 26px 6px 10px; font-size: 13px; } }

/* ---------- Chat: translate, interests, block, nudity cover ---------- */
.dock-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#autoTrBtn.is-on { background: rgba(47, 107, 255, .35); border-color: rgba(47, 107, 255, .6); }
.tr-btn { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12px; color: var(--muted); }
.tr-btn:hover { color: var(--text); }
.msg-tr { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(255, 255, 255, .15); color: #cfd8ff; }
.msg-tr::before { content: "⇄ "; color: var(--muted); }
.t-ico { background: linear-gradient(135deg, #8b5cf6, #ec4899); color: #fff; }
.filter-tags { min-width: 0; max-width: 220px; }
.filter-tags .filter-val { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 4px; }
.tag-box { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 999px; background: rgba(139, 92, 246, .22); border: 1px solid rgba(139, 92, 246, .45); color: var(--text); font-size: 14px; }
.tag-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .25); line-height: 1; }
.tag-form { display: flex; gap: 8px; }
.tag-form input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; }
#blockBtn:not(:disabled):hover { color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.nsfw-blur .remote-video { filter: blur(48px) saturate(.4); }
.nsfw-cover {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; padding: 20px; background: rgba(10, 8, 30, .55); backdrop-filter: blur(6px);
}
.nsfw-cover .ico { width: 44px; height: 44px; color: var(--muted); }
.nsfw-cover p { max-width: 360px; margin: 0; font-size: 16px; }
.nsfw-cover div { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 760px) {
  .filter-tags { max-width: none; }
  .filter-tags .filter-val { display: none; }
}

/* Start page: interests field and preset country */
#userInterests { margin-top: 12px; }
.preset-country { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.preset-country .link-btn { margin: 0; }

/* ---------- Country pages ---------- */
.country-links { margin-bottom: 56px; }
.country-links p, .country-inline { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.country-links a, .country-inline a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px;
}
.country-links a:hover, .country-inline a:hover, .country-grid a:hover { border-color: var(--accent-2); }
.country-links img { border-radius: 2px; }
.country-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.country-grid a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.country-grid img { border-radius: 3px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.h1-flag { width: 40px; height: 30px; border-radius: 4px; vertical-align: -3px; object-fit: cover; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.facts { list-style: none; padding: 14px 18px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.facts li { margin: 4px 0; }
.faq-item { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 18px; }
.faq-item summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--text); }
.faq-item p { margin: 0 0 14px; }

/* ---------- Right-to-left languages (Arabic, Urdu) ---------- */
/* The chat screen keeps its left/right layout; text inside it follows each message's own direction. */
[dir="rtl"] .chat-page { direction: ltr; }
[dir="rtl"] .chat-page .modal-card, [dir="rtl"] .chat-page .status-pill { direction: rtl; }
[dir="rtl"] .select-wrap .ico { right: auto; left: 14px; }
[dir="rtl"] .lang-pick select { background-position: left 10px center; padding: 8px 14px 8px 30px; }
[dir="rtl"] .check { text-align: right; }

/* Topic landing page grid (/chat/) */
.topic-grid { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.topic-grid a { display: block; padding: 16px 18px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; text-decoration: none; color: inherit; background: rgba(255,255,255,.03); transition: border-color .15s, transform .15s; }
.topic-grid a:hover { border-color: var(--accent, #2f6bff); transform: translateY(-2px); }
.topic-grid b { display: block; font-size: 17px; margin-bottom: 4px; }
.topic-grid span { font-size: 13px; opacity: .72; }

/* VC (virtual chat) partner: tag in the badge and a card where the video would be */
.badge-vc { background: #6c5ce7; color: #fff; font-weight: 700; letter-spacing: .04em; cursor: help; }
.vc-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 80%; z-index: 2; pointer-events: none; }
.vc-ava { position: relative; width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 10px 40px rgba(108, 92, 231, .5); }
.vc-ava img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.vc-ava-tag { position: absolute; right: 2px; bottom: 6px; padding: 3px 9px; border-radius: 999px; background: #6c5ce7; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .05em; border: 2px solid rgba(255, 255, 255, .85); }
/* Text mode: the avatar sits faintly behind the messages */
.mode-text .vc-card { opacity: .3; transform: translate(-50%, -50%); }
.mode-text .vc-card .vc-sub { display: none; }
.vc-card b { font-size: 20px; }
.vc-sub { font-size: 13px; color: var(--muted); background: rgba(0, 0, 0, .35); padding: 4px 10px; border-radius: 999px; }

/* Join line: round logo + name when a person or VC joins */
.msg-join { display: flex; align-items: center; gap: 8px; background: rgba(108, 92, 231, .22); border: 1px solid rgba(255, 255, 255, .12); font-weight: 600; }
.join-ava { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; overflow: hidden; }
.join-ava img { width: 100%; height: 100%; display: block; }
.join-vc { flex: none; padding: 1px 7px; border-radius: 999px; background: #6c5ce7; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .05em; cursor: help; }
/* Translate fallback link */
.tr-link { margin-left: 8px; font-size: 12px; color: #8fb0ff; white-space: nowrap; }

/* Accounts (start page) */
.acc-box { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.acc-hint { margin: 0 0 8px; }
.acc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-btns .btn { flex: 1 1 180px; justify-content: center; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f6f8fc; }
.acc-email { margin-top: 10px; display: grid; gap: 8px; }
.acc-row { display: flex; gap: 8px; }
.acc-row .text-input { flex: 1; min-width: 0; margin: 0; }
.acc-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-in .link-btn { margin-left: auto; }
.acc-msg { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Friends (chat room) */
#friendBtn.is-on { background: rgba(108, 92, 231, .55); }
.msg-actions { display: inline-flex; gap: 6px; margin-left: 8px; font-style: normal; }
.msg-act { border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: var(--text); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.msg-act.is-primary { background: #6c5ce7; border-color: #6c5ce7; color: #fff; }
.friends-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.fr-dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex: none; }
.fr-dot.is-on { background: #2ecc71; }
.fr-dot.is-busy { background: #f5a623; }
.fr-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fr-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
#friendsBtn .ico { width: 16px; height: 16px; }

/* Google's sign-in button */
.gsi-wrap { flex: 1 1 200px; min-height: 44px; display: flex; justify-content: center; align-items: center; }

/* Sign-in box highlighted after the free guest chats */
.acc-box.acc-attn { border-color: #6c5ce7; box-shadow: 0 0 0 3px rgba(108, 92, 231, .35); }

/* Sign-in pop-up in the chat room */
#signinModal .gsi-wrap { margin: 6px 0 2px; }
#signinModal .acc-email { margin-top: 0; }
.fr-out { margin-top: 6px; justify-self: start; font-size: 13px; }

/* Partner video: no picture message + "Tap for sound" */
.no-video { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; color: var(--muted); pointer-events: none; z-index: 1; }
.no-video[hidden] { display: none; }
.no-video .ico { width: 44px; height: 44px; opacity: .6; }
.no-video span { max-width: 340px; font-size: 15px; line-height: 1.4; }
.sound-hint { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 3; border: 0; border-radius: 999px; padding: 8px 16px; background: rgba(0, 0, 0, .65); color: #fff; font: inherit; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.sound-hint[hidden] { display: none; }
.mode-text .no-video, .mode-text .sound-hint { display: none; }

/* VC messages: smaller text */
.msg.msg-vc { font-size: 12px; line-height: 1.35; padding: 5px 10px; }
