:root {
  --bg: #0a0a0a;
  --fg: #f4f4f4;
  --muted: #8a8a8a;
  --line: #262626;
  --line-strong: #3a3a3a;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must win over component display rules (avatars, forms,
   etc. set display:block/flex, which would otherwise override [hidden]). */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
}

body {
  color: var(--fg);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.logo {
  font-weight: 900;
  letter-spacing: -0.03em;
}

.logo.big {
  font-size: 74px;
}

/* ---------- views ---------- */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* ---------- menu ---------- */
#view-menu.active {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(1100px 620px at 50% -8%, rgba(16, 185, 129, 0.22), transparent 62%),
    radial-gradient(820px 520px at 82% 108%, rgba(20, 184, 166, 0.15), transparent 60%),
    radial-gradient(700px 520px at 12% 88%, rgba(16, 185, 129, 0.1), transparent 60%), var(--bg);
}

/* ---------- phone + swiping-finger animation (home + auth) ---------- */
#scroll-decor {
  position: fixed;
  left: 40px;
  bottom: 36px;
  width: 244px;
  z-index: 0;
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.55));
}

#scroll-decor.on {
  display: block;
}

#swipe-phone {
  width: 100%;
  height: auto;
  display: block;
}

.feed {
  animation: feedStep 8s cubic-bezier(0.6, 0, 0.2, 1) infinite;
}

.finger {
  animation: fingerSwipe 2s cubic-bezier(0.6, 0, 0.2, 1) infinite;
}

.trail {
  animation: trailFade 2s ease-in-out infinite;
}

.mouth {
  transform-box: fill-box;
  transform-origin: center;
  animation: talk 0.4s ease-in-out infinite alternate;
}

.eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.2s ease-in-out infinite;
}

@keyframes feedStep {
  0%,
  16% {
    transform: translateY(0);
  }
  25%,
  41% {
    transform: translateY(-256px);
  }
  50%,
  66% {
    transform: translateY(-512px);
  }
  75%,
  91% {
    transform: translateY(-768px);
  }
  100% {
    transform: translateY(-1024px);
  }
}

@keyframes fingerSwipe {
  0%,
  14% {
    transform: translateY(46px);
    opacity: 0;
  }
  26% {
    transform: translateY(34px);
    opacity: 1;
  }
  46% {
    transform: translateY(-50px);
    opacity: 1;
  }
  60%,
  100% {
    transform: translateY(-60px);
    opacity: 0;
  }
}

@keyframes trailFade {
  0%,
  20% {
    opacity: 0;
  }
  38% {
    opacity: 0.85;
  }
  56%,
  100% {
    opacity: 0;
  }
}

@keyframes talk {
  from {
    transform: scaleY(0.45);
  }
  to {
    transform: scaleY(1.35);
  }
}

@keyframes blink {
  0%,
  93%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.1);
  }
}

@media (max-width: 900px) {
  #scroll-decor {
    width: 128px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
  }
}

/* ---------- mobile: card at top so the phone animation shows below ---------- */
@media (max-width: 640px) {
  #view-auth.active,
  #view-menu.active,
  #view-onboard.active {
    align-items: flex-start;
    padding-top: 20px;
  }
  .logo.big {
    font-size: 50px;
  }
  .logo-badge {
    width: 52px;
    height: 52px;
  }
  .logo-lockup {
    gap: 12px;
  }
  .tagline {
    font-size: 16px;
  }
  .menu {
    padding: 30px 26px 26px;
    gap: 18px;
  }
  .auth-btn {
    padding: 13px;
    font-size: 15px;
  }
}

.menu {
  width: 100%;
  max-width: 640px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 54px 54px 46px;
  background: rgba(19, 24, 22, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.logo-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.logo-badge {
  width: 74px;
  height: 74px;
  flex: none;
  filter: drop-shadow(0 4px 18px rgba(16, 185, 129, 0.4));
}

.menu .logo {
  text-align: center;
  margin: 0;
  background: linear-gradient(135deg, #fff 30%, #a7f3d0 62%, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 20px rgba(16, 185, 129, 0.3));
}

.tm {
  font-size: 0.32em;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: super;
  -webkit-background-clip: inherit;
  background-clip: inherit;
}

.tagline {
  text-align: center;
  color: var(--muted);
  font-size: 19px;
  margin: -14px 0 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 14px;
  color: var(--muted);
  padding-left: 2px;
}

.input {
  font: inherit;
  font-size: 17px;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--fg);
  width: 100%;
}

.input::placeholder {
  color: #5a5a5a;
}

.input:focus {
  outline: none;
  border-color: var(--line-strong);
  background: var(--surface-2);
}

textarea.input {
  min-height: 72px;
  resize: vertical;
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a8a8a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

/* tag chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}

.chips:empty {
  display: none;
}

/* clickable popular-tag suggestions */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}

.suggestion {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 13px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.suggestion:hover {
  color: var(--fg);
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.13);
}

/* labeled report pill in the chat top bar */
.report-btn {
  height: 42px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
}

.report-btn:hover {
  background: rgba(190, 24, 60, 0.8);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 999px;
  padding: 7px 8px 7px 13px;
  font-size: 14px;
}

.chip button {
  border: none;
  background: #333;
  color: #ddd;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.chip button:hover {
  background: #555;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
}

.check.invis {
  margin-top: 4px;
}

.check input {
  accent-color: #fff;
  width: 16px;
  height: 16px;
}

.note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* buttons */
.btn {
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--fg);
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.btn-big {
  padding: 20px;
  font-size: 19px;
  margin-top: 10px;
}

#start {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  box-shadow: 0 12px 34px rgba(16, 185, 129, 0.4);
  letter-spacing: 0.01em;
}

#start:hover {
  filter: brightness(1.08);
}

/* ---------- auth + onboarding ---------- */
#view-auth.active,
#view-onboard.active {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(1100px 620px at 50% -8%, rgba(16, 185, 129, 0.22), transparent 62%),
    radial-gradient(820px 520px at 82% 108%, rgba(20, 184, 166, 0.15), transparent 60%), var(--bg);
}

.auth-card,
.onboard-card {
  max-width: 500px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px;
  font-size: 16px;
  border-radius: 14px;
}

.auth-google {
  background: #fff;
  color: #1a1a1a;
  border-color: #fff;
}

.auth-tiktok {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.auth-tiktok:hover {
  background: #111111;
}

.auth-guest {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
}

.auth-guest:hover {
  color: var(--fg);
}

.auth-error {
  background: rgba(190, 24, 60, 0.18);
  border: 1px solid rgba(190, 24, 60, 0.5);
  color: #fda4af;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  text-align: center;
}

.note.center {
  text-align: center;
}

.onboard-title {
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
}

.avatar-wrap {
  position: relative;
  width: 108px;
  margin: 4px auto;
}

.avatar-big {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-strong);
  display: block;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  font-weight: 800;
  font-size: 40px;
  text-transform: uppercase;
}

.avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
}

.username-status {
  font-size: 13px;
  min-height: 18px;
  margin-top: -10px;
  padding-left: 2px;
  color: var(--muted);
}

.username-status.ok {
  color: #4ade80;
}

.username-status.bad {
  color: #fda4af;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -10px 0 -4px;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  font-size: 15px;
}

.me-name {
  font-weight: 700;
}

.profile-row .link {
  margin-left: auto;
  font-size: 13px;
}

.avatar-xs {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

/* Partner pfp shown on the match screen (photo or initial fallback). */
.avatar-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.avatar-pill.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #34d399, #059669);
  color: #04120d;
  font-weight: 800;
  font-size: 14px;
}
.partner-name[hidden] .avatar-pill,
.avatar-pill[hidden] {
  display: none;
}

.partner-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.partner-name[hidden] {
  display: none;
}

/* fixed corner Terms button */
.corner-btn {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 20;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.corner-btn:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

/* TOS modal body */
.modal-card.tos {
  max-width: 520px;
}

.tos-body {
  max-height: 60vh;
  overflow-y: auto;
  margin: 4px 0 16px;
}

.tos-body p {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.tos-body strong {
  color: #fff;
}

.modal-card.tos .btn {
  width: 100%;
}

.menu-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.menu-links .dot {
  color: var(--muted);
}

.link {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
}

.link:hover {
  color: var(--fg);
}

/* ---------- chat (fullscreen) ---------- */
#view-chat.active {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10;
  overflow: hidden;
  touch-action: none;
}

/* ---------- side-by-side camera tiles (default) ---------- */
.stage-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: #000;
}

.cam-tile {
  position: relative;
  overflow: hidden;
  background: #0a0f0d;
  min-width: 0;
  min-height: 0;
}

.cam-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0a0f0d;
}

.tile-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
}

/* mobile: stack top / bottom */
@media (max-width: 760px) {
  .stage-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}

/* ---------- facetime mode (fullscreen partner + small self overlay) ---------- */
#view-chat.facetime .stage-grid {
  display: block;
}

#view-chat.facetime .partner-tile {
  position: absolute;
  inset: 0;
}

#view-chat.facetime .self-tile {
  position: absolute;
  right: 16px;
  bottom: 84px;
  width: 168px;
  height: auto;
  aspect-ratio: 3 / 4;
  z-index: 6;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

#view-chat.facetime .self-tile .tile-tag {
  display: none;
}

@media (max-width: 640px) {
  #view-chat.facetime .self-tile {
    width: 116px;
    bottom: 78px;
  }
}

.partner-name {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 14px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 12px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.icon-btn.dark {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* Skip-to-next — the primary in-call action, so it gets the emerald accent. */
.skip-btn {
  background: linear-gradient(160deg, #34d399, #059669);
  color: #04120d;
}
.skip-btn:hover {
  background: linear-gradient(160deg, #4ade9f, #06a172);
}

/* ---------- searching / connecting-to-a-person overlay ---------- */
#searching-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: radial-gradient(circle at 50% 38%, #12664f 0%, #0b3d30 45%, #082a22 100%);
}

.connect-avatar {
  position: relative;
  width: 270px;
  height: 270px;
  max-width: 62vw;
  max-height: 62vw;
}

.connect-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #34d399, #059669);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 36px rgba(16, 185, 129, 0.5);
  animation: corePulse 2s ease-in-out infinite;
}

.connect-face svg {
  width: 100%;
  height: 100%;
  display: block;
}

.connect-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(52, 211, 153, 0.7);
  border-radius: 50%;
  animation: ping 2.4s ease-out infinite;
}

.connect-ring:nth-child(2) {
  animation-delay: 1.2s;
}

#searching-overlay[hidden] {
  display: none;
}

.radar {
  position: relative;
  width: 178px;
  height: 178px;
}

.radar .ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(52, 211, 153, 0.7);
  border-radius: 50%;
  animation: ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.radar .ring:nth-child(2) {
  animation-delay: 0.87s;
}

.radar .ring:nth-child(3) {
  animation-delay: 1.74s;
}

.radar .orbit {
  position: absolute;
  inset: 0;
  animation: spin 3.4s linear infinite;
}

.radar .sat {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a7f3d0;
  box-shadow: 0 0 14px 2px rgba(52, 211, 153, 0.9);
}

.radar .core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.55);
  animation: corePulse 2s ease-in-out infinite;
}

.radar .core svg {
  width: 100%;
  height: 100%;
  display: block;
}

.searching-text {
  color: #fff;
  font-weight: 800;
  font-size: 28px;
  text-align: center;
  padding: 0 26px;
}

.searching-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  margin-top: -8px;
  min-height: 38px;
  text-align: center;
  padding: 0 26px;
  max-width: 400px;
  line-height: 1.5;
}

.searching-dots {
  display: flex;
  gap: 7px;
}

.searching-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: sdot 1.2s ease-in-out infinite;
}

.searching-dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.searching-dots i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes ping {
  0% {
    transform: scale(0.34);
    opacity: 0.75;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes corePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes sdot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

.stage-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 0 30px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.swipe-hint {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

#view-chat.live .swipe-hint {
  opacity: 1;
  animation: hintfade 2.6s ease 1.5s forwards;
}

@keyframes hintfade {
  to {
    opacity: 0;
  }
}

/* floating messages, TikTok-style */
.live-feed {
  position: absolute;
  left: 12px;
  bottom: 128px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 70%;
  max-height: 38vh;
  overflow: hidden;
  pointer-events: none;
}

.live-feed .msg {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 7px 12px;
  border-radius: 14px;
  font-size: 14px;
  max-width: 100%;
  word-break: break-word;
}

.live-feed .msg.me {
  background: rgba(255, 255, 255, 0.92);
  color: #000;
}

/* Chat dock (emoji reactions + text input) — only visible once matched, so
   nobody types into a dead box while still searching. */
.chat-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex; /* visible during search too; input is disabled until matched */
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 12px) 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
}
/* Emoji reactions only appear once you're actually matched. */
.chat-dock .emoji-bar {
  display: none;
}
#view-chat.live .chat-dock .emoji-bar {
  display: flex;
}
.chat-bar .input:disabled {
  opacity: 0.5;
  cursor: default;
}

.emoji-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.emoji-opt {
  border: none;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, background 0.15s ease;
}
.emoji-opt:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
.emoji-opt:active {
  transform: scale(0.9);
}

.chat-bar {
  margin: 0;
}
.chat-bar .input {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  caret-color: #34d399;
}
.chat-bar .input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- subviews (history / messages) ---------- */
.subview {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.subhead {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.subhead h2 {
  margin: 0;
  letter-spacing: -0.02em;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
}

.card .grow {
  flex: 1;
  min-width: 0;
}

.card .name {
  font-weight: 700;
}

.card .sub {
  font-size: 12px;
  color: var(--muted);
}

.tag-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 4px 4px 0 0;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  padding: 30px 0;
  text-align: center;
}

.messenger {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  margin-top: 12px;
  min-height: 340px;
}

.threads {
  margin-top: 0;
}

.thread-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}

.thread-item.active {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.thread-view {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.thread-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.thread-messages .msg {
  padding: 7px 11px;
  border-radius: 12px;
  max-width: 78%;
  font-size: 14px;
  word-break: break-word;
}

.thread-messages .msg.me {
  align-self: flex-end;
  background: #fff;
  color: #000;
}

.thread-messages .msg.them {
  align-self: flex-start;
  background: var(--surface-2);
}

.chat-form {
  display: flex;
  gap: 8px;
}

.row.buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ---------- modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 420px;
  width: 100%;
}

.modal-card h1 {
  margin-top: 0;
}

.modal-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.modal-card .check {
  margin: 14px 0;
}

.modal-card .btn {
  width: 100%;
}

.stars {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}

.stars button {
  font-size: 28px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--line-strong);
  padding: 0;
}

.stars button.on {
  color: #fff;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .messenger {
    grid-template-columns: 1fr;
  }
}

/* ================= BRIGHT MENU / AUTH THEME (Monkey-style) ================= */
#view-menu.active,
#view-auth.active,
#view-onboard.active {
  background: url("/logos/pattern.svg") repeat,
    radial-gradient(1000px 620px at 50% -6%, rgba(16, 185, 129, 0.22), transparent 60%),
    radial-gradient(820px 520px at 84% 112%, rgba(20, 184, 166, 0.16), transparent 60%),
    linear-gradient(160deg, #0d3229 0%, #0a231d 58%, #08191500 100%), #081613;
}

.menu {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 26px 70px rgba(0, 44, 34, 0.35);
}

.menu .logo {
  background: none;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
  filter: drop-shadow(0 3px 10px rgba(0, 40, 30, 0.35));
}

.logo-badge {
  filter: drop-shadow(0 4px 14px rgba(0, 40, 30, 0.4));
}

.tagline {
  color: rgba(255, 255, 255, 0.94);
}

.menu .field > span {
  color: #ffffff;
  font-weight: 600;
}

.menu .input {
  background: rgba(255, 255, 255, 0.96);
  color: #0b3b30;
  border: 1px solid transparent;
}

.menu .input::placeholder {
  color: #6b968b;
}

.menu .input:focus {
  background: #ffffff;
  border-color: #ffffff;
}

.menu select.input {
  background-color: rgba(255, 255, 255, 0.96);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230b3b30' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}

#start {
  background: #ffffff;
  color: #05603a;
  border: none;
  box-shadow: 0 14px 30px rgba(0, 40, 30, 0.3);
}

#start:hover {
  filter: none;
  background: #ecfdf5;
}

.chip {
  background: #ffffff;
  color: #05603a;
  border-color: transparent;
}

.chip button {
  background: #059669;
  color: #fff;
}

/* suggestions: white pills on ONE line; fade the right edge so overflow reads
   as "scroll for more" instead of a hard cut-off */
.suggestions {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 2px 2px 0;
  -webkit-mask-image: linear-gradient(to right, #000 84%, transparent 100%);
  mask-image: linear-gradient(to right, #000 84%, transparent 100%);
}

.suggestions::-webkit-scrollbar {
  display: none;
}

.suggestion {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #ffffff;
  padding: 6px 11px;
  font-size: 12.5px;
}

.suggestion:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #ffffff;
  color: #ffffff;
}

/* History link — bolder + bright */
.menu-links .link {
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
}

.menu-links .link:hover {
  color: #ecfdf5;
  text-decoration: underline;
}

/* profile row: sign-out UNDER the name, online badge top-right */
.profile-row {
  align-items: flex-start;
}

.profile-id {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 1px;
}

.profile-id .me-name {
  color: #ffffff;
  font-weight: 800;
}

.profile-id .link {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  padding: 2px 0;
  margin: 0;
}

.profile-id .link:hover {
  text-decoration: underline;
}

.profile-id .link:hover {
  color: #ffffff;
}

.online-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px 2px rgba(34, 197, 94, 0.9);
  animation: onlinePulse 1.8s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ---------- premium (paywall + gated filters) ---------- */
.btn-premium {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #241a00;
  border: none;
  font-weight: 800;
}
.btn-premium:hover {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
}
.premium-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #241a00;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  white-space: nowrap;
}
.premium-badge[hidden] {
  display: none;
}
.premium-tag {
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  margin-left: 6px;
}
/* Locked premium fields: dimmed, non-interactive, padlocked. */
.premium-field {
  position: relative;
}
.premium-field[data-locked="1"] .gender-seg,
.premium-field[data-locked="1"] .dropdown {
  opacity: 0.5;
  filter: saturate(0.5);
  pointer-events: none;
}
.premium-field[data-locked="1"]::after {
  content: "🔒";
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 15px;
  pointer-events: none;
}

.premium-card {
  max-width: 440px;
  position: relative;
  text-align: center;
  background: radial-gradient(120% 120% at 50% 0%, #14231d 0%, var(--surface) 55%);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  font-size: 15px;
  cursor: pointer;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.premium-spark {
  font-size: 34px;
  line-height: 1;
}
.premium-head h2 {
  margin: 8px 0 6px;
  letter-spacing: -0.02em;
}
.premium-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 340px;
}
.premium-perks {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 18px;
}
.premium-perks span {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
}
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.plan-card {
  position: relative;
  text-align: center;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px 12px 16px;
  cursor: pointer;
  color: var(--fg);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.plan-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.plan-card.featured {
  border-color: #34d399;
  box-shadow: 0 0 0 1px #34d399 inset;
}
.plan-card.loading {
  opacity: 0.6;
  pointer-events: none;
}
.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #34d399, #059669);
  color: #04120d;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.plan-name {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}
.plan-price b {
  font-size: 30px;
  letter-spacing: -0.02em;
}
.plan-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.premium-note {
  min-height: 18px;
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #a7f3d0;
}
.premium-fine {
  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.5;
  margin: 12px 0 0 !important;
}

/* ---------- custom region dropdown with flag images ---------- */
.dropdown {
  position: relative;
}

.dd-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
}

.dd-flag {
  width: 22px;
  height: 22px;
  flex: none;
  display: block;
}

.dd-chev {
  width: 13px;
  height: 9px;
  margin-left: auto;
  color: #0b3b30;
  flex: none;
}

.dd-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #ffffff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 18px 50px rgba(0, 20, 15, 0.45);
  max-height: 320px;
  overflow-y: auto;
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: #0b3b30;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.dd-item:hover {
  background: #d1fae5;
}

.dd-item.sel {
  background: #10b981;
  color: #ffffff;
}

/* ---------- gender segmented control (menu) ---------- */
.gender-seg {
  display: flex;
  gap: 8px;
}

.gender-opt {
  flex: 1;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.gender-opt:hover {
  background: rgba(255, 255, 255, 0.16);
}

.gender-opt.sel {
  background: #ffffff;
  color: #05603a;
  border-color: #ffffff;
}

/* partner gender badge (in-call) */
.pn-gender {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.pn-gender:empty {
  display: none;
}

/* ---------- History / Messages pages match the homepage ---------- */
#view-history.active,
#view-messages.active {
  min-height: 100dvh;
  background: url("/logos/pattern.svg") repeat,
    radial-gradient(1000px 620px at 50% -6%, rgba(16, 185, 129, 0.22), transparent 60%),
    radial-gradient(820px 520px at 84% 112%, rgba(20, 184, 166, 0.16), transparent 60%),
    linear-gradient(160deg, #0d3229 0%, #0a231d 58%, #081915 100%), #081613;
}

#view-history .subview,
#view-messages .subview {
  padding-top: 40px;
}

.subhead h2 {
  color: #ffffff;
  font-weight: 900;
}

#view-history .muted,
#view-messages .muted,
#view-messages .note {
  color: rgba(255, 255, 255, 0.82);
}

.icon-btn.dark {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.icon-btn.dark:hover {
  background: rgba(255, 255, 255, 0.26);
}

.card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card .name {
  color: #ffffff;
  font-weight: 800;
}

.card .sub {
  color: rgba(255, 255, 255, 0.72);
}

.tag-pill {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.28);
}

.card .btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.card .btn:hover {
  background: #ffffff;
  color: #05603a;
}

#view-history .empty,
#view-messages .empty {
  color: rgba(255, 255, 255, 0.78);
}

.thread-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.thread-item.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.thread-item .sub {
  color: rgba(255, 255, 255, 0.7);
}

.thread-view {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.thread-messages .msg.them {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.thread-messages .msg.me {
  background: #10b981;
  color: #ffffff;
}

#view-messages .thread-view .input {
  background: rgba(255, 255, 255, 0.96);
  color: #0b3b30;
  border: none;
}

/* auth + onboarding text on the bright bg */
.auth-guest {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.auth-guest:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.note.center {
  color: rgba(255, 255, 255, 0.85);
}

.corner-btn {
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.45);
}

.corner-btn:hover {
  color: #ffffff;
  border-color: #ffffff;
}

.onboard-title {
  color: #ffffff;
}

.username-status {
  color: rgba(255, 255, 255, 0.9);
}

.username-status.ok {
  color: #d1fae5;
}

.username-status.bad {
  color: #fecdd3;
}
