@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  --purple:      #6C63FF; /* Vibrant Purple */
  --purple-glow: rgba(108, 99, 255, 0.35);
  --purple-soft: rgba(108, 99, 255, 0.12);
  --blue:        #00F5D4; /* Teal Accent */
  --bg:          #000000; /* Pure Black */
  --bg-gradient: radial-gradient(circle at 0% 0%, rgba(108,99,255,0.08) 0%, transparent 50%), radial-gradient(circle at 100% 100%, rgba(0,245,212,0.05) 0%, transparent 50%), #000000;
  --panel-bg:    rgba(255, 255, 255, 0.03);
  --white:       #f0f0f5;
  --dark:        #f0f0f5;
  --dark-pure:   #000000;
  --gray:        #9ca3af;
  --gray-light:  #374151;
  --border:      rgba(255, 255, 255, 0.06);
  --video-far:   rgba(0,0,0,0.6);
  --video-near:  rgba(0,0,0,0.4);
  --radius-card: 24px;
  --radius-btn:  16px;
  --shadow-card: 0 24px 64px rgba(0,0,0,0.8);
  --shadow-btn:  0 8px 24px rgba(108, 99, 255, 0.35);
}

.light {
  --bg: #f8f9fa;
  --panel: rgba(255, 255, 255, 0.6);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.06);
  
  --primary: #5046E5;
  --primary-hover: #6C63FF;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.06);

  --accent-purple: #6C63FF;
  --accent-teal: #00B39F;
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(0, 0, 0, 0.08);
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
}

/* ── Blob decorations ── */
.blob {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
}

.blob-tr {
  top: -200px;
  right: -200px;
  width: 580px;
  height: 580px;
  background: radial-gradient(ellipse at 45% 45%,
    rgba(107,78,255,0.18) 0%,
    rgba(107,78,255,0.07) 48%,
    transparent 68%);
  border-radius: 55% 45% 35% 65% / 60% 30% 70% 40%;
}

.blob-bl {
  bottom: -220px;
  left: -220px;
  width: 620px;
  height: 620px;
  background: radial-gradient(ellipse at 55% 55%,
    rgba(107,78,255,0.15) 0%,
    rgba(107,78,255,0.05) 50%,
    transparent 68%);
  border-radius: 44% 56% 65% 35% / 50% 60% 40% 55%;
}

/* 4-point sparkle star */
.star {
  position: fixed;
  right: 7%;
  top: 38%;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 0;
}
.star::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #ff8fa3;
  clip-path: polygon(
    50% 0%, 56% 39%, 100% 50%, 56% 61%,
    50% 100%, 44% 61%, 0% 50%, 44% 39%
  );
}

/* ── Navbar ── */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 48px;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px var(--purple-glow);
}
.logo-icon svg { width: 22px; height: 22px; fill: white; }
.logo-text {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle {
  position: relative;
  width: 42px;
  height: 23px;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: #d8d8d8;
  border-radius: 12px;
  transition: background 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--purple); }
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle input:checked + .toggle-track::after { transform: translateX(19px); }

.online-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
}

/* ── LANDING PAGE ── */
.page-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 64px;
}

.landing-card {
  width: 100%;
  max-width: 680px;
  text-align: center;
  background: var(--panel-bg);
  padding: 48px 40px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.landing-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  font-size: 58px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 75%, #64748b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.landing-sub {
  font-size: 16px;
  line-height: 1.75;
  color: var(--gray);
  max-width: 540px;
  margin: 0 auto 36px;
}

.start-label {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 34px;
}

.btn-mode {
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 58px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#btn-text {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border: 1px solid var(--border);
  box-shadow: none;
}
#btn-text:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

#btn-video {
  background: linear-gradient(135deg, var(--purple) 0%, #5046E5 100%);
  color: white;
  box-shadow: var(--shadow-btn);
}
#btn-video:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(108, 99, 255, 0.5);
}

.btn-mode:active { transform: translateY(0); }

.or-text {
  font-size: 14px;
  color: #bbb;
  font-weight: 500;
}

.interests-section { text-align: center; }

.interests-qs {
  font-size: 14px;
  color: #888;
  margin-bottom: 12px;
}

/* ── Tag input ── */
.tag-input-wrap {
  position: relative;
  text-align: left;
}

.tag-input-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 6px;
  border-bottom: 2px solid #ddd;
  min-height: 44px;
  cursor: text;
  transition: border-color 0.2s;
}
.tag-input-inner:focus-within { border-bottom-color: var(--purple); }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--purple-soft);
  color: var(--purple);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 8px 5px 12px;
  white-space: nowrap;
  animation: chipIn 0.15s ease;
}
@keyframes chipIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.tag-chip-x {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--purple);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity 0.1s;
}
.tag-chip-x:hover { opacity: 1; }

.tag-text {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--dark);
  outline: none;
  flex: 1;
  min-width: 100px;
  padding: 4px 2px;
}
.tag-text::placeholder { color: #ccc; }

.tag-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #12101e;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 100;
  display: none;
}
.tag-dropdown.open { display: block; }

.tag-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text, #f3f4f6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid var(--border);
}
.tag-option:last-child { border-bottom: none; }
.tag-option:hover,
.tag-option.focused { background: var(--purple-soft); color: #c084fc; }
.tag-option mark {
  background: none;
  color: #c084fc;
  font-weight: 700;
}

/* ── CHAT PAGE ── */
.page-chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.chat-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}

/* Text mode: left column hidden — collapse its grid track */
.chat-body.text-mode {
  grid-template-columns: 1fr;
  padding: 0;
  gap: 0;
}
.chat-body.text-mode .col-left  { display: none; }
.chat-body.text-mode .chat-content {
  border-radius: 0;
  border: none;
  box-shadow: none;
}

/* Left column — fills full grid-row height; videos split it 50/50 */
.col-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

/* Video panels — equal share of column height; video content covers via object-fit */
.vbox {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--video-far);
}
.vbox.near { background: var(--video-near); }

.vbox video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Status overlay (remote box) */
.vbox-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.88);
  transition: opacity 0.25s;
}
.vbox-overlay.hidden { opacity: 0; pointer-events: none; }
.vbox-overlay p {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-align: center;
  padding: 0 16px;
}
.vbox-overlay strong { color: white; }
.vbox-overlay .search-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 6px;
  font-style: normal;
  word-break: break-word;
}

/* Watermark */
.vbox-wm {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple);
  opacity: 0.8;
  pointer-events: none;
}

/* Report button */
.vbox-report {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  display: flex;
  transition: color 0.15s;
}
.vbox-report:hover { color: rgba(255,255,255,0.7); }

/* Local video: mirrored (selfie-cam feel) */
#local-video { transform: scaleX(-1); }

/* Webcam placeholder in near box */
.webcam-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.webcam-ph svg {
  width: 40px;
  height: 40px;
  color: rgba(255,255,255,0.2);
}

/* ── Face-not-detected warning overlay ── */
.face-warn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(8, 12, 30, 0.82);
  backdrop-filter: blur(3px);
  border-radius: inherit;
  z-index: 5;
  pointer-events: none;
}
.face-warn-icon {
  position: relative;
  color: #fbbf24; /* amber-400 */
  animation: facePulse 1.4s ease-in-out infinite;
}
.face-warn-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.4);
  animation: faceRipple 1.4s ease-out infinite;
}
.face-warn p {
  font-size: 11px;
  font-weight: 700;
  color: #fde68a; /* amber-200 */
  text-align: center;
  line-height: 1.4;
}
@keyframes facePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.93); }
}
@keyframes faceRipple {
  0%   { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.7);  opacity: 0; }
}

/* Right column — width comes from 1fr grid track, height fills grid row */
.col-right {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Scrollable content area */
.chat-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 16px;
  scroll-behavior: smooth;
  background: var(--panel-bg);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
}
.chat-content::-webkit-scrollbar { width: 4px; }
.chat-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Rules view */
.rules-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 18px;
}
.age-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.age-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff4d6d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.age-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
}
.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}
.rules-list li {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

/* Messages view */
.msgs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg {
  max-width: 72%;
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  word-break: break-word;
}
.msg.you {
  align-self: flex-end;
  background: linear-gradient(135deg, #6C63FF, #5046E5);
  color: white;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}
.msg.stranger {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  border-bottom-left-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}
.msg.system {
  align-self: center;
  background: none;
  color: #6b7280;
  font-size: 12.5px;
  font-style: italic;
  max-width: 100%;
  padding: 4px 0;
}

.msg.system.location {
  font-style: normal;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid rgba(94, 92, 230, 0.25);
  border-radius: 20px;
  padding: 6px 18px;
  margin: 8px auto;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bottom bar */
.chat-bar {
  flex-shrink: 0;
  height: 80px;
  display: flex;
  align-items: stretch;
  gap: 12px;
}

/* Start / Stop / Skip column */
.start-wrap {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.btn-start {
  flex: 1;
  background: linear-gradient(135deg, var(--purple), #5046E5);
  color: white;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  min-width: unset;
  box-shadow: var(--shadow-btn);
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.btn-start:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.5);
}
.btn-start:active:not(:disabled) {
  transform: translateY(0);
}
.btn-start:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.btn-skip {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid rgba(94, 92, 230, 0.3);
  border-radius: 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-skip:hover {
  background: rgba(94, 92, 230, 0.2);
  border-color: var(--purple);
  transform: translateY(-1px);
}
.btn-skip:active {
  transform: translateY(0);
}

.esc-hint { display: none; }

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 20px;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.msg-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--white);
  outline: none;
  min-width: 0;
}
.msg-input::placeholder { color: #d0d0d0; }
.msg-input:disabled { cursor: not-allowed; }

.send-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #ccc;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}
.send-btn:hover:not(:disabled) { color: var(--purple); }
.send-btn:disabled { cursor: not-allowed; }

/* ── Typing indicator ── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 20px 5px;
  font-size: 12px;
  color: #aaa;
  font-style: italic;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.2s;
}
.typing-indicator.hidden { display: none; }

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0);   opacity: 0.35; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ── Search hint ── */
.search-hint {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
  font-style: normal;
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */

.tag-dropdown { max-height: 240px; overflow-y: auto; }

/* ── Tablet: 769px – 1024px ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat-body  { grid-template-columns: 340px 1fr; gap: 10px; padding: 0 10px 10px; }
  .chat-bar   { height: 72px; }
  .start-wrap { width: 150px; }
  .btn-skip   { flex: 0 0 32px; }
  .landing-title { font-size: 36px; }
  .star { display: none; }
}

/* ── Mobile: 320px – 768px ── */
@media (max-width: 768px) {

  /* ── Page shell ── */
  .page-chat {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* ── Navbar ── */
  .nav {
    height: 44px;
    padding: 0 12px;
    flex-shrink: 0;
    border-bottom: 1px solid transparent;
  }
  .logo-text  { font-size: 14px; }
  .logo-icon  { width: 28px; height: 28px; border-radius: 7px; }
  .logo-icon svg { width: 20px; height: 20px; }
  .online-label  { font-size: 12px; }

  /* ── Main chat body ── */
  .chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  /* ── Left column: main video area with self-preview overlay ── */
  .col-left {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    padding: 10px 10px 0 10px;
    aspect-ratio: 4 / 3;
  }

  /* Main (stranger) video — full width with 4:3 aspect ratio */
  #remote-box {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
  }

  /* Local video — self-preview overlay positioned top-right */
  #local-box {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 90px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    z-index: 30;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    flex-shrink: 0;
  }
  #local-box .webcam-ph svg { width: 22px; height: 22px; }

  .vbox-wm {
    font-size: 9px;
    bottom: 6px;
    left: 8px;
  }
  .vbox-report {
    bottom: 4px;
    right: 4px;
    padding: 4px;
  }

  /* ── Right column: chat content ── */
  .col-right {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
  }

  /* Chat messages area */
  .chat-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 14px;
  }

  .typing-indicator {
    padding: 6px 14px;
    font-size: 11px;
    border-top: 1px solid var(--border);
    background: var(--panel-bg);
  }

  .msg {
    font-size: 13px;
    padding: 8px 12px;
  }

  .rules-heading { font-size: 15px; }

  /* ── Bottom control bar ── */
  .chat-bar {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 10px;
    height: auto;
    min-height: 100px;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: rgba(10, 12, 26, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
  }

  /* Start/Stop/Skip buttons — stacked vertically on left (40%) */
  .start-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
  }

  .btn-start {
    flex: 1;
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
  }

  .btn-skip {
    flex: 0 0 auto;
    min-height: 44px;
    border-radius: 10px;
    font-size: 12px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .btn-skip svg { display: none; }
  .esc-hint { display: none; }

  /* Input area — full width on right (60%) */
  .input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    min-height: 44px;
    border-radius: 14px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
  }

  .msg-input {
    flex: 1;
    font-size: 16px;
    min-width: 0;
    padding: 8px 0;
  }

  .send-btn {
    flex-shrink: 0;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .send-btn svg {
    width: 20px;
    height: 20px;
  }

  /* ── Text mode on mobile ── */
  .chat-body.text-mode {
    gap: 0;
    padding: 0;
  }
  .chat-body.text-mode .col-left {
    display: none;
  }
  .chat-body.text-mode .col-right {
    padding: 0;
  }
  .chat-body.text-mode .chat-content {
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 12px 14px;
  }

  /* ── Landing page mobile ── */
  .landing-title {
    font-size: 26px;
    letter-spacing: -0.6px;
    margin-bottom: 12px;
  }
  .landing-sub {
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
  }
  .landing-main {
    padding: 16px 14px 40px;
  }
  .start-label { margin-bottom: 12px; }
  .mode-row { gap: 12px; margin-bottom: 24px; }
  .btn-mode { padding: 14px 32px; font-size: 15px; }
  .star { display: none; }
  .blob { display: none; }

  /* ── Tag input ── */
  .tag-input-inner { min-height: 48px; }
  .tag-text { font-size: 16px; }
  .tag-dropdown {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    border-radius: 12px;
    max-height: 200px;
  }
  .tag-chip { font-size: 12px; padding: 4px 8px 4px 10px; }
}

/* ── Small phones: 320px – 480px ── */
@media (max-width: 480px) {
  .nav { height: 40px; padding: 0 10px; }
  .logo-icon { width: 26px; height: 26px; }
  .logo-icon svg { width: 18px; height: 18px; }
  .logo-text { font-size: 14px; }
  .online-label { font-size: 11px; }

  .col-left {
    padding: 8px 8px 0 8px;
  }

  #local-box {
    top: 14px;
    right: 14px;
    width: 80px;
    height: 62px;
  }
  #local-box .webcam-ph svg { width: 18px; height: 18px; }

  .chat-content {
    padding: 10px 12px;
  }

  .chat-bar {
    gap: 8px;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 96px;
  }

  .start-wrap {
    gap: 6px;
  }

  .btn-start {
    font-size: 13px;
    min-height: 42px;
  }

  .input-wrap {
    padding: 0 12px;
    gap: 6px;
  }

  .msg-input { font-size: 16px; }
  .send-btn svg { width: 18px; height: 18px; }

  .landing-main { padding: 14px 12px 36px; }
  .landing-title { font-size: 22px; }
  .btn-mode { padding: 12px 24px; font-size: 14px; }
}

/* ── Extra small: ≤ 360px ── */
@media (max-width: 360px) {
  .nav { height: 38px; }
  .logo-icon { width: 24px; height: 24px; }
  .logo-icon svg { width: 16px; height: 16px; }
  .logo-text { font-size: 13px; }

  .col-left { padding: 6px 6px 0 6px; }

  #local-box {
    top: 12px;
    right: 12px;
    width: 72px;
    height: 56px;
  }
  #local-box .webcam-ph svg { width: 16px; height: 16px; }

  .vbox-wm { font-size: 8px; }

  .chat-content { padding: 8px 10px; }

  .typing-indicator { padding: 4px 10px; }
  .msg { font-size: 12px; padding: 6px 10px; }
  .rules-heading { font-size: 14px; }

  .chat-bar {
    gap: 6px;
    padding: 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    min-height: 90px;
  }

  .start-wrap { gap: 4px; }

  .btn-start {
    font-size: 12px;
    min-height: 40px;
    border-radius: 12px;
  }

  .btn-skip { font-size: 10px; }

  .input-wrap {
    padding: 0 10px;
    gap: 4px;
    border-radius: 12px;
  }

  .msg-input { font-size: 16px; }
  .send-btn svg { width: 16px; height: 16px; }

  .landing-main { padding: 12px 10px 32px; }
  .landing-title { font-size: 20px; margin-bottom: 10px; }
  .landing-sub { font-size: 13px; margin-bottom: 20px; }
  .btn-mode { padding: 10px 20px; font-size: 13px; }
}

/* ── Light Theme Variables ── */
body.light-theme {
  --purple:      #0284c7; /* Light mode primary (Teal-ish blue) */
  --purple-glow: rgba(2, 132, 199, 0.25);
  --purple-soft: rgba(2, 132, 199, 0.12);
  --blue:        #64748b; /* Secondary */
  --bg:          #f8fafc;
  --bg-gradient: radial-gradient(at 0% 0%, #e0f2fe 0px, transparent 50%), radial-gradient(at 50% 0%, #e0e7ff 0px, transparent 50%), radial-gradient(at 100% 0%, #faf5ff 0px, transparent 50%), #f8fafc;
  --panel-bg:    rgba(255, 255, 255, 0.45);
  --white:       #0f172a;
  --dark:        #1e293b;
  --dark-pure:   #f1f5f9;
  --gray:        #475569;
  --gray-light:  #cbd5e1;
  --border:      rgba(255, 255, 255, 0.6);
  --shadow-card: 0 20px 50px rgba(15, 23, 42, 0.06);
  --shadow-btn:  0 6px 20px rgba(2, 132, 199, 0.2);
}

body.light-theme .landing-title {
  background: linear-gradient(135deg, #0f172a 30%, #334155 75%, #64748b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .msg.stranger {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

body.light-theme .input-wrap {
  background: rgba(15, 23, 42, 0.03);
}

body.light-theme .logo-text {
  color: #0f172a;
}

/* ── Privacy Modal ── */
.landing-footer {
  margin-top: 24px;
}
.footer-btn {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}
.footer-btn:hover {
  color: var(--purple);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 24px;
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 32px;
  color: var(--white);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gray);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close-btn:hover {
  color: var(--purple);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 8px;
  text-align: left;
}
.modal-body::-webkit-scrollbar {
  width: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.3);
  border-radius: 2px;
}
.modal-body p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: var(--gray);
}
.modal-body h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--white);
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}
.btn-confirm {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-confirm:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-btn);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Face warning toast */
.face-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245, 158, 11, 0.95);
  color: #080c1e;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  backdrop-filter: blur(8px);
  animation: slideDownIn 0.3s ease-out forwards;
}

.toast-emoji {
  font-size: 16px;
  animation: bounce 1s infinite;
}

@keyframes slideDownIn {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

body.light-theme .face-toast {
  background: rgba(217, 119, 6, 0.95);
  color: #ffffff;
  border: 1px solid #d97706;
}
