:root {
  --bg: #0a0a0a;
  --bg-panel: #111111;
  --cyan: #a78bfa;        /* soft purple (was teal/cyan) */
  --cyan-dim: #7c3aed;    /* deeper purple */
  --teal-bar: #8b5cf6;    /* purple top bar */
  --pink: #ff6b9d;
  --text: #ffffff;
  --text-dim: #9a9a9a;
  --border: #2a2a2a;
  --danger: #ff5563;
  --pane-bg: #1a1520;     /* slight purple tint */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* Visibility helpers */
.desktop-only { display: none !important; }
.mobile-only { display: flex; }

/* ========== PROFILE ========== */
#screen-profile {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.profile-wrap { width: 100%; max-width: 380px; }
.logo-top {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px; font-weight: 700; font-size: 20px;
}
#screen-profile h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: 10px; }
.sub { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin-bottom: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13px; color: var(--text-dim); }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font-size: 16px; outline: none; width: 100%;
}
input:focus { border-color: var(--cyan); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-dim); margin: 18px 0 24px; line-height: 1.4; }
.checkbox input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--cyan);
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  width: 20px;
  height: 20px;
  cursor: pointer;
  pointer-events: auto !important;
}
.btn-primary {
  width: 100%; background: var(--cyan); color: #1a0a2e; border: none; border-radius: 12px;
  padding: 15px 18px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.98); }

/* ========== MAIN SCREEN ========== */
.screen-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #000;
  position: relative;
}

/* Desktop topnav — hidden on mobile */
.desktop-topnav {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--teal-bar);
  padding: 0 24px;
  height: 52px;
  flex: none;
  z-index: 20;
}
.dtn-logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 20px;
}
.dtn-links { display: flex; align-items: center; gap: 22px; }
.dtn-links a {
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; opacity: 0.95;
}
.dtn-links a:hover { opacity: 1; text-decoration: underline; }
.dtn-join {
  background: #fff !important; color: #0a0a0a !important;
  padding: 8px 18px; border-radius: 6px; font-weight: 700 !important;
  opacity: 1 !important; text-decoration: none !important;
}

/* Mobile watermark logo — top left corner */
.mobile-watermark {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  opacity: 0.85;
}
.mobile-watermark span {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.2px;
}

/* Mobile header */
.app-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex: none;
  z-index: 10;
}
.icon-btn {
  background: transparent; border: none; color: #ccc; padding: 6px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: #fff; }
.brand-right {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 17px;
}

/* Main layout: column on mobile, row on desktop */
.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.video-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Partner area */
.partner-area {
  flex: 1 1 42%;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1518;
  overflow: hidden;
}
.partner-status {
  display: flex; flex-direction: column; align-items: center; gap: 16px; z-index: 2;
}
.gender-circle {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(167, 139, 250, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.status-main {
  font-size: 14px; color: #bbb; text-align: center; max-width: 260px; line-height: 1.4;
}
.remote-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000; z-index: 1;
}
.noise-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; mix-blend-mode: screen; opacity: 0.45;
}
.noise-canvas.flicker { animation: flicker 0.6s steps(6) infinite; }
@keyframes flicker {
  0% { opacity: 0.12; } 20% { opacity: 0.5; } 35% { opacity: 0.18; }
  50% { opacity: 0.55; } 65% { opacity: 0.22; } 80% { opacity: 0.45; } 100% { opacity: 0.15; }
}
.pane-logo {
  position: absolute; top: 10px; right: 12px; z-index: 5;
  display: flex; align-items: center; gap: 4px; opacity: 0.7;
  font-size: 12px; font-weight: 600; color: var(--cyan); pointer-events: none;
}

/* Status bar (mobile) */
.status-bar {
  flex: none;
  display: none; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: #0a0a0a;
  border-top: 1px solid #1a1a1a; border-bottom: 1px solid #1a1a1a;
  min-height: 40px;
}
.status-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #ccc; }
.status-emoji { font-size: 16px; }
.flag-btn { color: #888; }
.flag-btn:hover { color: var(--danger); }

/* Self area */
.self-area {
  flex: 1 1 44%;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1518;
  overflow: hidden;
}
.local-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000; z-index: 1;
}
.local-video.mirrored { transform: scaleX(-1); }
.camera-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 18px; z-index: 2;
}
.self-gender { background: rgba(167, 139, 250, 0.1); }
.btn-start-camera {
  background: transparent; color: var(--cyan);
  border: 1.5px solid var(--cyan); border-radius: 10px;
  padding: 10px 22px; font-weight: 600; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.btn-start-camera:hover { background: rgba(167, 139, 250, 0.12); }
.btn-start-camera:active { transform: scale(0.97); }

.gender-fab {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: #ccc;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; cursor: pointer; z-index: 5; padding: 6px;
}
.gender-fab:hover { color: #fff; }
.gender-fab span { color: #aaa; }

/* Mobile Back / Next — fixed above bottom nav so always visible */
.nav-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  z-index: 95;
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(10, 10, 12, 0.96);
  border-top: 1px solid #1a1a1a;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #161616;
  color: #eee;
  border: 1.5px solid #3a3a3a;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn-nav:hover:not(:disabled) {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(167, 139, 250, 0.1);
}
.btn-nav:disabled {
  opacity: 0.4;
  cursor: default;
}
/* Leave room in video layout for fixed back/next + bottom nav */
@media (max-width: 899px) {
  #screen-video .main-layout {
    padding-bottom: calc(56px + 64px + env(safe-area-inset-bottom));
  }
}

/* Mobile bottom nav — fixed so it stays visible over Shorts */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-around;
  padding: 6px 4px max(10px, env(safe-area-inset-bottom));
  background: rgba(10, 10, 12, 0.96);
  border-top: 1px solid #1a1a1a;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* Space for fixed bottom nav + back/next row on mobile */
#screen-video {
  padding-bottom: 0;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none; color: #888; font-size: 10px;
  cursor: pointer; padding: 4px 8px; min-width: 52px;
}
.nav-item:hover { color: #ccc; }
.nav-item.nav-plus { color: var(--cyan); }

/* Chat column — hidden on mobile by default */
.chat-column {
  display: none;
  flex-direction: column;
  background: #0a0a0a;
  min-height: 0;
  border-left: 1px solid #1a1a1a;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #1a1a1a; flex: none;
}
.chat-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #ddd; }
.gender-select-btn {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1.5px solid var(--cyan); border-radius: 20px;
  padding: 6px 12px; color: #fff; font-size: 13px; cursor: pointer;
}
.gender-select-btn:hover { background: rgba(167, 139, 250, 0.1); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; min-height: 0;
}
.chat-msg {
  margin-bottom: 10px; font-size: 14px; line-height: 1.4;
  padding: 8px 12px; border-radius: 10px; max-width: 85%;
}
.chat-msg.me { background: rgba(167, 139, 250, 0.15); margin-left: auto; text-align: right; }
.chat-msg.them { background: #1a1a1a; }
.chat-msg.system {
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #c4b5fd;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  max-width: 100%;
  margin: 0 auto 8px;
}
.chat-footer {
  flex: none; padding: 10px 12px 14px; border-top: 1px solid #1a1a1a;
  display: flex; flex-direction: column; gap: 10px;
}
.btn-next-desk {
  display: block;

  align-self: flex-start;
  background: #3a3a3a; color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-weight: 600; font-size: 13px; cursor: pointer;
  letter-spacing: 0.5px;
}
.btn-next-desk:hover { background: #4a4a4a; }
.btn-next-desk:disabled { opacity: 0.4; cursor: default; }
.chat-input-row {
  display: flex; align-items: center; gap: 6px;
  background: #151515; border: 1px solid #2a2a2a; border-radius: 24px;
  padding: 6px 8px 6px 16px;
}
.chat-input-row input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 14px; padding: 6px 0;
}
.chat-icon-btn {
  background: transparent; border: none; color: #888; cursor: pointer;
  padding: 4px; font-size: 16px; display: flex; align-items: center;
}
.chat-icon-btn:hover { color: #ccc; }
.chat-send-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--cyan); color: #1a0a2e; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-send-btn:hover { opacity: 0.9; }

.btn-tap-audio {
  position: absolute; bottom: 140px; left: 50%; transform: translateX(-50%);
  z-index: 20; background: rgba(167, 139, 250, 0.15); color: var(--cyan);
  border: 1.5px solid var(--cyan); border-radius: 10px;
  padding: 10px 20px; font-weight: 600; font-size: 13px; cursor: pointer;
}

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; border: 1px solid #333; color: #fff;
  padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 50;
  max-width: 90vw; text-align: center;
}

@media (max-height: 640px) {
  .gender-circle { width: 56px; height: 56px; }
  .status-main { font-size: 13px; }
  .btn-start-camera { padding: 8px 18px; font-size: 14px; }
}

/* ================================================================
   DESKTOP (≥ 900px) — Camgo split layout
   ================================================================ */
@media (min-width: 900px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: flex !important; }
  .mobile-watermark { display: none !important; }

  .desktop-topnav { display: flex; }

  .screen-main { background: #0a0a0a; }

  .main-layout {
    flex-direction: row;
    flex: 1;
    min-height: 0;
  }

  .video-column {
    flex: 0 0 42%;
    max-width: 480px;
    border-right: 1px solid #1a1a1a;
  }

  .partner-area {
    flex: 1 1 50%;
    background: #1a2a2e;
    border-bottom: 1px solid #0d1518;
  }
  .self-area {
    flex: 1 1 50%;
    background: #1a2a2e;
  }

  .chat-column {
    display: flex;
    flex: 1;
    min-width: 0;
  }

  .status-main { color: #a0c0c0; }
  .gender-circle {
    background: rgba(167, 139, 250, 0.15);
    width: 80px; height: 80px;
  }

  .btn-tap-audio { bottom: 80px; }
}

/* Extra wide desktops */
@media (min-width: 1200px) {
  .video-column { flex: 0 0 38%; max-width: 520px; }
}

/* ================= Connected-with badge (top-right of partner video) ============= */
.connected-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  max-width: 70%;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.5);
  color: #eafffb;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.connected-badge::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #a78bfa; box-shadow: 0 0 8px #a78bfa; flex: none;
}
@media (min-width: 900px) {
  .connected-badge { top: 12px; right: 14px; font-size: 13px; }
}

/* ================= Chat message name + body ============= */
.chat-msg { display: flex; flex-direction: column; gap: 2px; }
.chat-name {
  font-size: 11px; font-weight: 700; letter-spacing: .2px; opacity: .85;
  color: var(--cyan);
}
.chat-msg.me .chat-name { color: #7fe9df; }
.chat-body { font-size: 14px; line-height: 1.4; word-break: break-word; }

/* Unread dot on the mobile Chat button */
.nav-item.has-unread { position: relative; }
.nav-item.has-unread::after {
  content: ""; position: absolute; top: 2px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 6px var(--pink);
}

/* ================= Mobile chat overlay popup ============= */
.chat-overlay {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 150;
  height: 72vh;
  height: 72dvh;
  display: flex;
  flex-direction: column;
  background: #0b0b0b;
  border-top: 1px solid #1f1f1f;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .6);
  animation: chatSlideUp .22s ease-out;
}
@keyframes chatSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.chat-overlay-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #1a1a1a;
}
.chat-overlay-name {
  font-size: 15px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.chat-overlay-name::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #a78bfa; box-shadow: 0 0 8px #a78bfa;
}
.chat-overlay-close {
  background: transparent; border: none; color: #999; cursor: pointer; padding: 4px;
  display: flex; align-items: center;
}
.chat-overlay-close:hover { color: #fff; }
.chat-overlay-messages {
  flex: 1; overflow-y: auto; padding: 14px 16px; min-height: 0;
  display: flex; flex-direction: column;
}
.chat-overlay-messages .chat-msg {
  margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; max-width: 85%;
}
.chat-overlay-messages .chat-msg.me { background: rgba(167, 139, 250, 0.16); margin-left: auto; }
.chat-overlay-messages .chat-msg.them { background: #1a1a1a; }
.chat-overlay-messages .chat-msg.system {
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #c4b5fd;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  max-width: 100%;
  margin: 0 auto 8px;
}
.chat-overlay-input-row {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #1a1a1a; background: #0b0b0b;
}
.chat-overlay-input-row input {
  flex: 1; background: #161616; border: 1px solid #2a2a2a; border-radius: 22px;
  padding: 12px 16px; color: #fff; font-size: 15px; outline: none;
}
.chat-overlay-input-row input:focus { border-color: var(--cyan); }

/* The overlay is a mobile affordance; never show it on the desktop split layout. */
@media (min-width: 900px) {
  .chat-overlay { display: none !important; }
}

/* VIP + Tip link badges on partner video */
.partner-vip-badge {
  position: absolute;
  bottom: 14px;
  right: 12px;
  left: auto;
  top: auto;
  z-index: 12;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.45);
  pointer-events: none;
}
.partner-tip {
  position: absolute;
  bottom: 48px;
  right: 12px;
  left: auto;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid rgba(251, 191, 36, 0.55);
  backdrop-filter: blur(6px);
}
.partner-tip:hover {
  background: rgba(251, 191, 36, 0.22);
  border-color: #fbbf24;
}
.partner-tip svg { flex: none; }


/* Partner avatar chip on video (opens profile) */
.partner-avatar-chip {
  position: absolute;
  bottom: 14px;
  left: 12px;
  top: auto;
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  max-width: min(70%, 220px);
}
.partner-avatar-chip:hover {
  border-color: #a78bfa;
  background: rgba(124, 58, 237, 0.35);
}
.partner-avatar-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #222;
}
.partner-avatar-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
input[type="file"] {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 13px;
  width: 100%;
}


/* Edit profile modal */
.edit-profile-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.78);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.edit-profile-sheet {
  width: 100%; max-width: 440px;
  background: #121212;
  border-radius: 20px 20px 0 0;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid #2a2a2a;
  max-height: min(88dvh, 100% - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
}
.edit-profile-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.edit-profile-head h2 { font-size: 18px; font-weight: 700; }
.edit-profile-close {
  background: transparent; border: none; color: #999;
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.edit-photo-row {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.ep-photo {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; background: #222;
  border: 2px solid var(--cyan);
}
.ep-photo-btn {
  background: rgba(167,139,250,0.12);
  color: var(--cyan);
  border: 1px solid rgba(167,139,250,0.35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
@media (min-width: 900px) {
  .edit-profile-modal { align-items: center; padding: 24px; }
  .edit-profile-sheet { border-radius: 16px; max-height: 80vh; }
}

.partner-block-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 13;
  background: rgba(255, 85, 99, 0.15);
  color: #ff5563;
  border: 1px solid rgba(255, 85, 99, 0.5);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.partner-block-btn:hover {
  background: rgba(255, 85, 99, 0.3);
}

/* Tokens */
.token-balance-badge {
  position: fixed; top: 12px; right: 12px; z-index: 40;
  background: rgba(0,0,0,0.75); border: 1px solid rgba(167,139,250,0.45);
  color: #fff; border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 700;
  backdrop-filter: blur(8px);
}
@media (min-width: 900px) {
  .token-balance-badge { top: 64px; right: 24px; }
}

.send-gift-btn {
  position: absolute; top: 12px; right: 80px; z-index: 13;
  background: rgba(167,139,250,0.15); color: #c4b5fd;
  border: 1px solid rgba(167,139,250,0.5); border-radius: 20px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.send-gift-btn:hover { background: rgba(167,139,250,0.3); }

.gift-modal {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: flex-end; justify-content: center;
}
.gift-sheet {
  width: 100%; max-width: 440px; background: #121212;
  border-radius: 20px 20px 0 0; padding: 18px 16px max(20px, env(safe-area-inset-bottom));
  max-height: 80dvh; overflow-y: auto;
}
.gift-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gift-head h2 { font-size: 17px; }
.gift-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.gift-item {
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 14px;
  padding: 12px 8px; text-align: center; cursor: pointer; color: #fff;
}
.gift-item:hover { border-color: var(--cyan); }
.gift-item img { width: 48px; height: 48px; object-fit: contain; margin-bottom: 6px; }
.gift-item .g-name { font-size: 12px; font-weight: 600; }
.gift-item .g-cost { font-size: 11px; color: #a78bfa; margin-top: 4px; }

.gift-toast {
  position: fixed; left: 50%; top: 20%; transform: translateX(-50%);
  z-index: 120; background: rgba(20,10,30,0.92);
  border: 1px solid rgba(167,139,250,0.5); border-radius: 16px;
  padding: 12px 18px; color: #fff; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(124,58,237,0.35);
  pointer-events: none;
}
.gift-toast img { width: 36px; height: 36px; object-fit: contain; }

/* Shorts */
.shorts-screen {
  /* above Back/Next (95) and bottom-nav (100) when open — see z-index below */
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: 0;
  z-index: 140;
  background: #000;
  display: flex;
  flex-direction: column;
  /* leave space for bottom nav on mobile */
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
.shorts-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: rgba(0,0,0,0.88);
  z-index: 2;
  font-weight: 700;
  font-size: 15px;
}
.back-btn-inline {
  background: transparent; border: 1px solid #333; color: #fff;
  border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shorts-bal { font-size: 13px; color: #c4b5fd; }
.shorts-feed {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.short-card {
  position: relative;
  height: calc(100dvh - 52px - 56px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  min-height: calc(100dvh - 52px - 56px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.short-card video, .short-card .short-thumb {
  width: 100%; height: 100%; object-fit: cover;
  background: #000;
}
.short-card .short-thumb.blurred {
  filter: blur(18px) brightness(0.55); transform: scale(1.08);
}
.short-lock {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: rgba(0,0,0,0.4); z-index: 2;
  padding: 20px;
}
.short-lock button {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff; border: none; border-radius: 14px;
  padding: 14px 22px; font-weight: 700; font-size: 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  max-width: 90%;
}
.short-meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 20px;
  z-index: 3;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.short-meta .sm-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 2px solid rgba(167,139,250,0.7);
  background: #222;
}
.short-meta .sm-text { min-width: 0; flex: 1; }
.short-meta .sm-name { font-weight: 700; font-size: 15px; }
.short-meta .sm-title { font-size: 13px; opacity: 0.9; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Desktop: no bottom nav padding */
@media (min-width: 900px) {
  .shorts-screen { padding-bottom: 0; }
  .short-card {
    height: calc(100dvh - 52px);
    min-height: calc(100dvh - 52px);
  }
}

/* Prevent iOS input zoom + tight mobile (do NOT strip checkbox appearance) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  font-size: 16px !important;
  border-radius: 12px;
}
select {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input[type="checkbox"] {
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--cyan);
  pointer-events: auto !important;
  opacity: 1 !important;
  position: relative;
  z-index: 2;
}
.checkbox {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}
.checkbox span {
  pointer-events: none;
}
* { -webkit-tap-highlight-color: transparent; }


@media (min-width: 900px) {
  .gift-modal { align-items: center; }
  .gift-sheet { border-radius: 16px; }
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  opacity: 0.75;
}
.password-toggle:hover { opacity: 1; }

.nav-item.active { color: var(--cyan); }
.nav-item.active svg path,
.nav-item.active svg rect { stroke: var(--cyan); }

/* Desktop header tokens + profile */
.dtn-tokens {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dtn-tokens:hover { background: rgba(255,255,255,0.2); }
.dtn-profile {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.dtn-profile:hover { background: rgba(255,255,255,0.18); }
.dtn-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; background: #333;
}
.token-balance-badge {
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.token-buy-label {
  font-size: 11px; opacity: 0.85; font-weight: 600;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 8px; margin-left: 2px;
}

/* Reels-style shorts */
.short-card video {
  pointer-events: auto;
  -webkit-touch-callout: none;
  user-select: none;
}
.short-play-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  cursor: pointer;
  transition: opacity 0.2s;
}
.short-play-overlay.hidden-ov {
  opacity: 0; pointer-events: none;
}
.short-play-btn {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 2px solid rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.short-play-btn svg { margin-left: 3px; }
.short-card .short-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
.short-card video.reel-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  background: #000;
}
.short-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: rgba(255,255,255,0.15); z-index: 4;
}
.short-progress > i {
  display: block; height: 100%; width: 0%;
  background: #fff;
}

.btn-logout {
  width: 100%; margin-top: 12px;
  background: transparent;
  border: 1px solid #444;
  color: #f87171;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.btn-logout:hover { border-color: #f87171; background: rgba(248,113,113,0.08); }

.paywall-overlay {
  position: fixed; inset: 0; z-index: 180;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.paywall-card {
  width: 100%; max-width: 360px;
  background: #141414;
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(124,58,237,0.25);
}
.paywall-ico { font-size: 40px; margin-bottom: 10px; }
.paywall-card h2 { font-size: 22px; margin-bottom: 10px; color: #fff; }
.paywall-card p { color: #a3a3a3; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.paywall-btn { display: block; text-align: center; text-decoration: none; margin-bottom: 12px; }
.paywall-dismiss {
  background: transparent; border: none; color: #888;
  font-size: 14px; cursor: pointer; padding: 8px;
}
.paywall-dismiss:hover { color: #ccc; }

/* Hide Back/Next when chat or shorts is open so they don't block input */
body.shorts-open .nav-row,
body.chat-open .nav-row {
  display: none !important;
  pointer-events: none !important;
}
body.shorts-open .bottom-nav {
  z-index: 145;
}
body.chat-open .bottom-nav {
  z-index: 155;
}
.chat-overlay {
  /* ensure input area is above everything in the sheet */
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
