* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg-1: #0b0f1a;
  --bg-2: #111729;
  --bg-glow: #1c2240;
  --accent: #6c5ce7;
  --accent-2: #00d4ff;
  --danger: #ff5470;
  --text: #f2f4ff;
  --muted: #8a90a8;
}

/* Themes: dark is the default (:root). Light flips the whole palette; ocean
   and sunset are dark bases with different accent colors. */
[data-theme="light"] {
  --bg-1: #eef1f9;
  --bg-2: #ffffff;
  --bg-glow: #dde4f5;
  --accent: #6c5ce7;
  --accent-2: #0086b3;
  --text: #1a2033;
  --muted: #5a617a;
}

[data-theme="ocean"] {
  --bg-1: #03151f;
  --bg-2: #072330;
  --bg-glow: #0a3648;
  --accent: #00b4d8;
  --accent-2: #90e0ef;
}

[data-theme="sunset"] {
  --bg-1: #1a0b14;
  --bg-2: #2a1220;
  --bg-glow: #3d1a2e;
  --accent: #ff6b6b;
  --accent-2: #ffa94d;
}

html {
  -webkit-text-size-adjust: 100%;
}
html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% -10%, var(--bg-glow) 0%, var(--bg-1) 55%);
  color: var(--text);
  overflow-x: hidden;
}
/* Scroll the whole page from anywhere, with iOS momentum. Deliberately no
   scroll-behavior:smooth (it makes wheel/drag scrolling feel like it sticks)
   and no overscroll lock, so vertical scrolling is never swallowed. */
body {
  -webkit-overflow-scrolling: touch;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* The brand dot doubles as the network indicator: green online, red offline. */
.brand-dot.is-online {
  background: #2ed47a;
  box-shadow: 0 0 8px #2ed47a;
  animation: dotPulse 1.8s ease-in-out infinite;
}

.brand-dot.is-offline {
  background: #ff5470;
  box-shadow: 0 0 8px #ff5470;
  animation: dotPulse 1s ease-in-out infinite;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Forces a flex line break on mobile only (see @media block below); invisible and inert on desktop. */
.topbar-break {
  display: none;
}

/* App settings side panel */
.side-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 59;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.side-panel-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-2);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 60;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 20px 0 40px rgba(0,0,0,0.3);
}

.side-panel.open {
  transform: translateX(0);
}

.side-panel-right {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  transform: translateX(100%);
  box-shadow: -20px 0 40px rgba(0,0,0,0.3);
}

.side-panel-right.open {
  transform: translateX(0);
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.side-panel-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Plain-language, high-contrast status pill: a big bright dot + the word
   "Online" + a count, rather than a small icon glyph — reads clearly on
   low-res/old screens without requiring the viewer to parse an icon. */
.online {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(46, 212, 122, 0.4);
}

.online-label {
  color: var(--text);
}

.online-count {
  color: #2ed47a;
  font-weight: 800;
}

.icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

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

.icon-btn:active {
  transform: scale(0.88);
  background: rgba(255,255,255,0.26);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.avatar-initial {
  font-weight: 700;
  font-size: 14px;
  color: #2ed47a;
}

/* Account row inside the left Settings panel */
.settings-account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 6px 16px;
  margin-bottom: 8px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.settings-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Grey while signed out; turns green via the logged-in rule below. */
  color: var(--muted);
  overflow: hidden;
}

.settings-account-avatar .topbar-svg-icon {
  width: 20px;
  height: 20px;
}

.settings-account-row.logged-in .settings-account-avatar {
  border: 2px solid #2ed47a;
  box-shadow: 0 0 10px rgba(46, 212, 122, 0.6);
  background: rgba(46, 212, 122, 0.08);
  color: #2ed47a;
}

.settings-account-label {
  flex: 1;
}

.settings-account-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.topbar-svg-icon {
  width: 23px;
  height: 23px;
}

/* Keep the small chevron/avatar glyphs inside the Settings panel at their
   intended size — the bigger topbar icon size is only for tappable buttons. */
.settings-account-avatar .topbar-svg-icon {
  width: 20px;
  height: 20px;
}

.friends-btn {
  position: relative;
  color: #4da6ff;
}

.online-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2ed47a;
  box-shadow: 0 0 8px #2ed47a;
  flex-shrink: 0;
  animation: dotPulse 1.6s ease-in-out infinite;
}

/* --- Live network status pill (green Online / red Offline) --- */
.net-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.net-status .net-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.net-status.is-online {
  color: #2ed47a;
  background: rgba(46, 212, 122, 0.1);
  border-color: rgba(46, 212, 122, 0.4);
}

.net-status.is-online .net-dot {
  background: #2ed47a;
  box-shadow: 0 0 8px #2ed47a;
  animation: dotPulse 1.6s ease-in-out infinite;
}

.net-status.is-offline {
  color: #ff5470;
  background: rgba(255, 84, 112, 0.12);
  border-color: rgba(255, 84, 112, 0.45);
}

.net-status.is-offline .net-dot {
  background: #ff5470;
  box-shadow: 0 0 8px #ff5470;
  animation: dotPulse 1s ease-in-out infinite;
}

/* --- Big chat button, top-right corner --- */
.chat-fab {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.chat-fab:hover {
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.6);
}

.chat-fab:active {
  transform: scale(0.94);
}

.chat-fab-icon {
  width: 26px;
  height: 26px;
}

/* --- Secondary navigation bar: the tool buttons, centered. --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 18px 14px;
  margin: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.navbar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Language picker moved into the Settings panel: fill its row. */
.settings-lang-wrap { width: 100%; }
.settings-lang-wrap .lang-select { max-width: none; width: 100%; }

/* Live people-count indicator (right): pulsing dot + group icon + number. */
.people-count {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(46, 212, 122, 0.1);
  border: 1px solid rgba(46, 212, 122, 0.35);
}

.people-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ed47a;
  box-shadow: 0 0 8px #2ed47a;
  flex-shrink: 0;
  animation: dotPulse 1.6s ease-in-out infinite;
}

.people-icon {
  width: 18px;
  height: 18px;
  color: #2ed47a;
  flex-shrink: 0;
}

.people-count-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.orb-wrap {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.orb {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-core {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent-2), var(--accent) 70%);
  box-shadow: 0 0 40px rgba(108, 92, 231, 0.55);
  transition: all 0.4s ease;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(108, 92, 231, 0.35);
  inset: 0;
}

.orb.idle .orb-core {
  opacity: 0.5;
  box-shadow: none;
}

.orb.waiting .orb-ring {
  animation: pulse 1.8s ease-out infinite;
}
.orb.waiting .r2 { animation-delay: 0.6s; }

.orb.connected .orb-core {
  animation: breathe 2.2s ease-in-out infinite;
}

.orb.speaking .orb-core {
  box-shadow: 0 0 70px rgba(0, 212, 255, 0.85);
}

.orb.muted-self .orb-core,
.orb.muted-remote .orb-core {
  box-shadow: 0 0 0 3px var(--danger), 0 0 20px rgba(255, 84, 112, 0.6);
}

.orb.connected .orb-ring {
  transition: transform 0.12s ease-out, opacity 0.12s ease-out, border-color 0.12s ease-out;
  transform: scale(1);
  opacity: 0.4;
}

@keyframes pulse {
  0% { transform: scale(0.65); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

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

/* Call timer, centered inside the blue orb. Sits above the core, follows the
   breathing scale visually but stays crisp/legible. */
.orb-timer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* Duration colour milestones: the orb core + glow warm up over a long call.
   The 0.4s transition on .orb-core already makes these shifts gradual/elegant. */
.orb.phase-purple .orb-core {
  background: radial-gradient(circle at 35% 30%, #c8a2ff, #7c3aed 72%);
  box-shadow: 0 0 55px rgba(124, 58, 237, 0.7);
}
.orb.phase-orange .orb-core {
  background: radial-gradient(circle at 35% 30%, #ffca8a, #f97316 72%);
  box-shadow: 0 0 55px rgba(249, 115, 22, 0.7);
}
.orb.phase-pink .orb-core {
  background: radial-gradient(circle at 35% 30%, #ffb3d9, #ec4899 72%);
  box-shadow: 0 0 60px rgba(236, 72, 153, 0.75);
}
.orb.phase-purple.speaking .orb-core { box-shadow: 0 0 80px rgba(124, 58, 237, 0.9); }
.orb.phase-orange.speaking .orb-core { box-shadow: 0 0 80px rgba(249, 115, 22, 0.9); }
.orb.phase-pink.speaking .orb-core { box-shadow: 0 0 82px rgba(236, 72, 153, 0.92); }

/* Milestone emoji that briefly fades in and out over the orb. */
.orb-emoji-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  z-index: 4;
  font-size: 64px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.orb-emoji-flash.playing {
  animation: orbEmojiFlash 2.4s ease-in-out forwards;
}
@keyframes orbEmojiFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  18% { opacity: 1; transform: translate(-50%, -95%) scale(1.15); }
  30% { transform: translate(-50%, -110%) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -120%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(0.9); }
}

/* Report dialog: quick-reason chips + optional detail box */
.report-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 6px;
}
.report-reason {
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: var(--card, rgba(255, 255, 255, 0.04));
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.report-reason:hover { border-color: var(--danger); }
.report-reason:active { transform: scale(0.96); }
.report-reason.selected {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.report-custom {
  width: 100%;
  resize: vertical;
  min-height: 44px;
  margin-bottom: 12px;
  font-family: inherit;
}

/* Conversation guide — friendly tips, scrollable, below the call area. */
.convo-guide {
  width: min(560px, 92%);
  margin: 8px auto 26px;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: var(--card, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.convo-guide-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.convo-guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.convo-guide-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.convo-guide-list .cg-emoji {
  flex: 0 0 auto;
  font-size: 20px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft, rgba(108, 92, 231, 0.14));
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8a90a8;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.connection-dot.green {
  background: #2ed47a;
  box-shadow: 0 0 8px #2ed47a;
  animation: none;
}

.connection-dot.orange {
  background: #ffb84d;
  box-shadow: 0 0 8px #ffb84d;
  animation: dotPulse 1.2s ease-in-out infinite;
}

.connection-dot.red {
  background: #ff5470;
  box-shadow: 0 0 8px #ff5470;
  animation: none;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-text {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
}

.sub-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 36px;
  opacity: 1;
  transition: opacity 1.2s ease;
}

.sub-text-fade-out {
  opacity: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.btn-danger {
  background: rgba(255, 84, 112, 0.15);
  color: var(--danger);
}

.btn-save {
  background: #2ed47a;
  color: #06210f;
  box-shadow: 0 0 14px rgba(46, 212, 122, 0.4);
}

.btn-save:hover {
  box-shadow: 0 0 20px rgba(46, 212, 122, 0.65);
}

.btn-icon {
  background: rgba(255,255,255,0.08);
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.btn-icon-lg {
  width: 64px;
  height: 64px;
}

.simple-icon {
  width: 22px;
  height: 22px;
}

.simple-icon-lg {
  width: 32px;
  height: 32px;
}

.simple-icon-text {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: white;
}

.btn-icon-danger {
  background: rgba(255, 84, 112, 0.15);
  color: var(--danger);
}

/* Mic: grey icon, red diagonal slash overlay when muted */
.mute-slash {
  position: absolute;
  width: 3px;
  height: 40px;
  background: var(--danger);
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 4px rgba(255, 84, 112, 0.8);
}

.mute-slash.hidden {
  display: none;
}

.btn-icon.added {
  background: rgba(46, 212, 122, 0.25) !important;
}

.btn-icon.muted {
  background: rgba(255, 84, 112, 0.2);
}

.hidden { display: none !important; }

/* Screen-reader-only: visible to assistive tech and crawlers, hidden visually. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Crawlable SEO content region below the app. Kept subtle and out of the way
   of the call UI, but fully readable when scrolled to. */
.seo-section {
  border-top: 1px solid var(--line, rgba(255,255,255,0.08));
  padding: 44px 20px 64px;
  color: var(--muted);
}
.seo-inner { max-width: 820px; margin: 0 auto; line-height: 1.7; }
.seo-inner h2 { color: var(--text); font-size: 1.5rem; margin: 0 0 14px; }
.seo-inner h3 { color: var(--text); font-size: 1.15rem; margin: 28px 0 10px; }
.seo-inner p { margin: 0 0 14px; }
.seo-inner strong { color: var(--text); }
.seo-list { padding-left: 20px; margin: 0 0 14px; }
.seo-list li { margin: 8px 0; }
.seo-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.seo-links a {
  padding: 9px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.seo-links a:hover { border-color: var(--accent-2); color: var(--accent-2); }
.seo-faq p { margin: 0 0 10px; }

.error-text {
  margin-top: 22px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 84, 112, 0.12);
  border: 1px solid rgba(255, 84, 112, 0.4);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  max-width: 420px;
}

.quick-guide {
  width: 100%;
  max-width: 480px;
  margin: 32px auto 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 18px 20px;
}

.quick-guide ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-guide li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(242, 244, 255, 0.85);
  text-align: left;
}

.qg-icon {
  flex-shrink: 0;
  line-height: 1.3;
  display: flex;
  padding-top: 1px;
}

.qg-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}

/* One guide list serves both screens: before a call it shows the full rules
   (18+ line, long report line); during a call (.in-call) those swap for a
   shorter report line to save vertical space next to the call controls. */
.quick-guide .qg-call-only {
  display: none;
}

.quick-guide.in-call .qg-call-only {
  display: flex;
}

.quick-guide.in-call .qg-setup-only {
  display: none;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer p {
  margin: 0;
}

.footer .link-btn {
  font-size: 12px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .topbar {
    padding: 12px 14px;
    column-gap: 8px;
    justify-content: space-between;
  }

  .navbar {
    padding: 6px 8px 12px;
    margin: 0 4px;
    gap: 8px;
  }

  .navbar-actions {
    gap: 14px;
  }

  .people-count {
    padding: 6px 9px;
  }

  .people-count-num { font-size: 14px; }

  .chat-fab {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .chat-fab-icon {
    width: 24px;
    height: 24px;
  }

  .icon-btn {
    width: 50px;
    height: 50px;
  }

  .topbar-svg-icon {
    width: 24px;
    height: 24px;
  }

  .online {
    font-size: 14px;
    padding: 6px 12px;
  }

  .stage {
    padding: 16px;
  }

  .modal-box {
    max-height: 90vh;
    border-radius: 16px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .tap-orb {
    width: 142px;
    height: 142px;
  }

  .tap-orb .phone-icon {
    width: 36px;
    height: 36px;
  }

  .tap-orb-label {
    font-size: 14px;
  }

  .orb-wrap {
    width: 170px;
    height: 170px;
    margin-bottom: 24px;
  }

  .orb {
    width: 110px;
    height: 110px;
  }

  .status-text {
    font-size: 17px;
  }

  .setup-panel,
  .filters-panel,
  .chat-panel,
  .partner-card {
    max-width: 100%;
    width: 100%;
  }

  .filters-panel {
    padding: 18px;
  }

  .pill {
    font-size: 12px;
    padding: 9px 14px;
  }

  .controls {
    gap: 8px;
  }

  .btn {
    padding: 12px 18px;
    font-size: 13px;
  }

  .btn-icon {
    width: 50px;
    height: 50px;
  }

  .btn-icon-lg {
    width: 58px;
    height: 58px;
  }

  .chat-panel {
    height: 260px;
  }

  .country-search-wrap {
    min-width: 120px;
  }
}

@media (max-width: 360px) {
  .controls {
    gap: 6px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* Setup panel */
.setup-panel {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.tap-to-talk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.tap-orb {
  position: relative;
  overflow: hidden;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  animation: tapBreathe 3s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Ripple that expands from the tap point for instant press feedback. */
.tap-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  opacity: 0.6;
  pointer-events: none;
  animation: tapRipple 0.6s ease-out forwards;
}
@keyframes tapRipple {
  to { transform: scale(2.4); opacity: 0; }
}

/* Connecting state: freeze the breathing, dim the label, and spin a ring so the
   user sees work happening and further taps are visibly inert. */
.tap-orb.is-connecting {
  animation: none;
  cursor: progress;
  pointer-events: none;
}
.tap-orb.is-connecting .phone-icon,
.tap-orb.is-connecting .tap-orb-label {
  opacity: 0.55;
}
.tap-orb.is-connecting::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: tapSpin 0.85s linear infinite;
}
@keyframes tapSpin {
  to { transform: rotate(360deg); }
}

.call-btn-green {
  background: radial-gradient(circle at 35% 30%, #4ade80, #16a34a 75%);
  box-shadow: 0 0 60px rgba(22, 163, 74, 0.55);
}

.call-btn-green:hover {
  box-shadow: 0 0 80px rgba(22, 163, 74, 0.75);
}

.tap-orb:active {
  transform: scale(0.96);
}

.phone-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.phone-icon-rotated {
  transform: rotate(135deg);
}

.tap-orb-label {
  font-size: 17px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.2px;
}

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

/* Primary call actions: Next and Hang Up, equal visual weight, Next slightly larger */
.primary-controls {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  margin: 24px 0 8px;
}

.call-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.call-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.call-btn:active {
  transform: scale(0.94);
}

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

.call-btn-red {
  background: radial-gradient(circle at 35% 30%, #ff7a8a, #e21f3e 75%);
  box-shadow: 0 4px 16px rgba(226, 31, 62, 0.35);
}

.call-btn-red:hover {
  box-shadow: 0 4px 20px rgba(226, 31, 62, 0.5);
}

.call-btn-next {
  background: radial-gradient(circle at 35% 30%, #ffcf5c, #ff9500 75%);
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

.call-btn-next:hover {
  box-shadow: 0 4px 20px rgba(255, 149, 0, 0.45);
}

.call-btn .phone-icon {
  width: 30px;
  height: 30px;
}

.skip-icon {
  width: 32px;
  height: 32px;
}

.call-btn-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.call-btn-label-next {
  color: #ff9500;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  display: inline-block;
}

.secondary-controls {
  margin-top: 4px;
}

/* Call timer */
.call-timer {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 700;
}

/* Shared interest callout */
.shared-interest-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 600;
}

/* Quick reactions */
.reaction-bar {
  display: flex;
  gap: 10px;
  margin: 6px 0 10px;
}

.reaction-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.reaction-btn svg {
  width: 22px;
  height: 22px;
}

.reaction-btn[data-reaction="heart"] {
  color: var(--danger);
}

.reaction-btn:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.08);
}

.reaction-btn:active {
  transform: scale(0.9);
}

.reaction-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.reaction-float {
  position: absolute;
  bottom: 20%;
  color: var(--text);
  animation: floatUp 1.8s ease-out forwards;
}

.reaction-float svg {
  width: 34px;
  height: 34px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.reaction-float[data-reaction="heart"] {
  color: var(--danger);
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { transform: translateY(-20px) scale(1); opacity: 1; }
  100% { transform: translateY(-220px) scale(1.1); opacity: 0; }
}

.btn-text {
  margin-left: 2px;
}

.consent-line {
  font-size: 12px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.5;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

/* These confirmations can be raised over the Ludo overlay (z-index 500), so
   they must sit above it. */
#ludoEndConfirmModal,
#confirmModal { z-index: 700; }

.modal-box {
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-box-wide {
  max-width: 620px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
}

.settings-save {
  width: 100%;
  margin-top: 4px;
}

.filters-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
  text-align: center;
}

.filters-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.filters-action-btn {
  flex: 1;
  text-align: center;
}

.policy-body h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 28px 0 10px;
  color: var(--accent-2);
}

.policy-body h3:first-child {
  margin-top: 0;
}

.policy-body p,
.policy-body li {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(242, 244, 255, 0.85);
}

.policy-body p {
  margin: 0 0 14px;
}

.policy-body ul {
  list-style: none;
  margin: 0 0 14px;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.policy-body li {
  margin-bottom: 0;
}

.policy-body strong {
  color: #fff;
  font-weight: 600;
}

/* Standalone privacy policy page */
.policy-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.policy-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.policy-page-header .brand,
.policy-page-header .brand:visited {
  color: var(--text);
  text-decoration: none;
}

.policy-page-body {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 22px 40px;
}

.policy-page-body h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.policy-updated {
  font-size: 12px !important;
  color: var(--muted) !important;
  margin: 0 0 20px !important;
}

.policy-page-body a {
  color: var(--accent-2);
}

.policy-page-footer {
  text-align: center;
  padding: 16px;
}

.filters-panel {
  margin-top: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 22px;
  text-align: left;
}

.pill-row {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill-row:last-child {
  margin-bottom: 0;
}

.pill-label {
  font-size: 13px;
  color: var(--muted);
}

.pill-label-strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.pill-label .hint {
  font-size: 11px;
  opacity: 0.7;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-group.scrollable {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.pill-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.pill.selected {
  background: rgba(108, 92, 231, 0.18);
  border-color: var(--accent);
}

.pill.selected .pill-dot {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 6px rgba(108, 92, 231, 0.8);
}

/* Always-on category colors so meaning doesn't depend on reading text */
.pill-dot-male {
  background: #4da6ff;
  border-color: transparent;
}

.pill-dot-female {
  background: #ff6fb5;
  border-color: transparent;
}

.pill-dot-neutral {
  background: linear-gradient(135deg, #ffb84d, #4da6ff, #ff6fb5);
  border-color: transparent;
}

.pill.selected .pill-dot-male {
  box-shadow: 0 0 8px #4da6ff;
}

.pill.selected .pill-dot-female {
  box-shadow: 0 0 8px #ff6fb5;
}

.pill.selected .pill-dot-neutral {
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

/* Auto Call checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #2ed47a;
  cursor: pointer;
  flex-shrink: 0;
}

.auto-call-row {
  justify-content: center;
  margin: 4px auto 0;
  width: fit-content;
  max-width: 320px;
  text-align: left;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-tags:not(:empty) {
  margin-bottom: 10px;
}

.interest-tags .tag.removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.interest-tags .tag.removable .tag-remove {
  cursor: pointer;
  opacity: 0.7;
  font-weight: 700;
}

.interest-tags .tag.removable .tag-remove:hover {
  opacity: 1;
}

/* Country multi-select (Interested / Non Interested Countries) */
.country-multiselect {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.country-search-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.search-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
}

.search-input:focus {
  outline: 1px solid var(--accent);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #161c33;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  z-index: 20;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.search-result-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.active {
  background: rgba(108, 92, 231, 0.2);
}

.search-result-item.selected {
  background: rgba(46, 212, 122, 0.15);
  font-weight: 600;
}

.search-result-empty {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
}

/* Interests picker */
.interest-input-wrap {
  max-width: 320px;
}

.tag {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.tag.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.setup-panel .btn-primary {
  width: 100%;
  margin-top: 6px;
}

.call-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Partner card */
.partner-card {
  background: transparent;
  border: none;
  padding: 4px 0;
  margin-bottom: 24px;
  text-align: center;
}

.partner-name {
  font-weight: 700;
  font-size: 16px;
}

.partner-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.flag-icon {
  vertical-align: middle;
  border-radius: 2px;
}

.partner-interests {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.partner-interests .tag {
  cursor: default;
  font-size: 11px;
  padding: 4px 10px;
}

/* Chat panel */
.chat-panel {
  width: 100%;
  max-width: 420px;
  margin: 18px auto 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: 280px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chat-msg {
  max-width: 82%;
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 16.5px;
  line-height: 1.45;
  word-break: break-word;
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  /* Composited entrance: no layout thrash, smooth 60fps. */
  will-change: transform, opacity;
  transition: transform 180ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

/* Entrance start-frame — removed on the next rAF to animate into place. */
.chat-msg.chat-msg-enter {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

/* Sent messages land with weight — a solid WhatsApp-style "thunk" pop from the
   bottom-right corner. Paired with the send sound + haptic in app.js. */
@keyframes chatSendPop {
  0%   { transform: translateY(12px) scale(0.78); opacity: 0; }
  55%  { transform: translateY(-2px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.chat-msg.me.chat-msg-pop {
  animation: chatSendPop 0.34s cubic-bezier(.2,.85,.25,1) both;
}

.chat-msg-text { min-width: 0; }

.chat-msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  transform-origin: bottom right;
}

.chat-msg.them {
  align-self: flex-start;
  background: rgba(255,255,255,0.07);
  transform-origin: bottom left;
}

.chat-msg.system {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  background: none;
  display: block;
}

/* WhatsApp-style delivery ticks on sent messages. */
.chat-msg-ticks {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  transform: translateY(2px);
}
.chat-msg-ticks svg {
  width: 15px;
  height: 11px;
  fill: rgba(255,255,255,0.55);
  transition: fill 200ms ease;
}
.chat-msg-ticks.sending svg { opacity: 0.5; }
.chat-msg-ticks.sent svg { fill: rgba(255,255,255,0.9); opacity: 1; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.chat-form input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 16px; /* >=16px prevents iOS input zoom */
}

.chat-form input:focus {
  outline: 1px solid var(--accent);
}

.chat-send {
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 999px;
  flex-shrink: 0;
}


/* Chat notification badge */
.chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff2d55;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--bg-1);
  box-shadow: 0 0 8px rgba(255, 45, 85, 0.8);
  animation: badgePop 0.25s ease;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

#chatToggleBtn {
  position: relative;
}

.chat-badge.hidden {
  display: none;
}

/* Typing indicator inside the chat panel */
.typing-indicator {
  font-size: 12px;
  color: var(--muted);
  padding: 0 14px 6px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.typing-dots span {
  animation: typingBounce 1.2s infinite;
  display: inline-block;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

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

/* Account modal */
.google-signin-btn {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

.account-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.account-divider::before,
.account-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.account-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.account-tab {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-tab.selected {
  background: rgba(108, 92, 231, 0.18);
  border-color: var(--accent);
  color: var(--text);
}

.account-input {
  width: 100%;
  margin-bottom: 10px;
}

.account-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

.account-status {
  font-size: 13px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
}

.account-status.error {
  background: rgba(255, 84, 112, 0.12);
  color: var(--danger);
}

.account-status.success {
  background: rgba(46, 212, 122, 0.12);
  color: #2ed47a;
}

.account-welcome {
  font-size: 14px;
  margin-bottom: 14px;
}

.consent-modal-text {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
  text-align: left;
}

.age-badge-icon {
  width: 26px;
  height: 26px;
  vertical-align: -7px;
  color: var(--accent-2);
  margin-right: 2px;
}

#ageAgreeBtn {
  width: 100%;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.account-section-title {
  font-size: 13px;
  color: var(--accent-2);
  margin: 4px 0 10px;
}

.account-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.account-label-spaced {
  margin-top: 16px;
}

.account-logout {
  width: 100%;
  margin-top: 18px;
}

/* Call history */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.history-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
}

.history-item-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-item-duration {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.history-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Small, classic green "call back" button next to a history entry */
.call-back-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #2ed47a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(46, 212, 122, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.call-back-btn:hover {
  box-shadow: 0 0 10px rgba(46, 212, 122, 0.8);
  transform: scale(1.08);
}

.call-back-btn:active {
  transform: scale(0.92);
}

.call-back-btn svg {
  width: 13px;
  height: 13px;
}

/* Notification bell badge */
.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
}

/* Dropdown anchored under the bell icon, instead of a centered floating modal */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: min(90vw, 360px);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 100;
}

.notif-dropdown.hidden {
  display: none;
}

/* Smooth pop-in for every toolbar dropdown (history / friends / requests) so
   the menus spring open from under their icon instead of snapping in place. */
.notif-dropdown:not(.hidden) {
  transform-origin: top right;
  animation: dropdownIn 0.2s cubic-bezier(.2,.85,.25,1);
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .notif-dropdown:not(.hidden) { animation: none; }
}

.notif-dropdown .modal-header {
  padding: 14px 16px;
}

.notif-dropdown .modal-body {
  padding: 14px 16px;
}

@media (max-width: 480px) {
  .notif-dropdown {
    position: fixed;
    top: 62px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px var(--danger);
}

.notif-badge.hidden {
  display: none;
}

/* Friends modal tabs */
.friends-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.friends-tab {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.friends-tab.selected {
  background: rgba(108, 92, 231, 0.18);
  border-color: var(--accent);
  color: var(--text);
}

.tab-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-count.hidden {
  display: none;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px var(--danger);
}

/* Friends / friend requests list */
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.friend-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
  cursor: pointer;
}

.friend-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a5068;
  flex-shrink: 0;
}

.friend-online-dot.online {
  background: #2ed47a;
  box-shadow: 0 0 6px #2ed47a;
}

.friend-item-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.friend-badge.temp {
  background: rgba(255, 184, 77, 0.15);
  color: #ffb84d;
}

.friend-badge.account {
  background: rgba(46, 212, 122, 0.15);
  color: #2ed47a;
}

.friend-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-chip {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-chip svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  margin-right: 4px;
}

.btn-chip:hover {
  background: rgba(255,255,255,0.12);
}

.btn-chip-accept {
  background: rgba(46, 212, 122, 0.18);
  border-color: rgba(46, 212, 122, 0.4);
  color: #2ed47a;
}

/* Notifications list */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-item {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 14px;
}

.notif-clickable {
  cursor: pointer;
}

.notif-clickable:hover {
  background: rgba(255,255,255,0.07);
}

.notif-item-icon {
  flex-shrink: 0;
  line-height: 1.3;
  color: var(--accent-2);
}

.notif-item-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-item-text {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.notif-item-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.notif-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notif-item-actions:empty {
  display: none;
}

/* Friend chat modal */
.friend-chat-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 60vh;
  max-height: 480px;
}

.friend-chat-messages {
  flex: 1;
  padding: 16px;
}

/* Incoming "call me back" banner */
.callback-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: #131930;
  border: 1px solid rgba(46, 212, 122, 0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(46, 212, 122, 0.25);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 90vw;
  animation: callBackSlideIn 0.3s ease-out;
}

.callback-banner-text {
  font-size: 14px;
  font-weight: 600;
}

.callback-banner-text svg {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  color: #2ed47a;
  margin-right: 4px;
}

.callback-banner {
  flex-direction: column;
  text-align: center;
  justify-content: center;
}

.callback-banner-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.callback-accept,
.callback-decline {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
}

/* Answer = green, Decline = red. */
.callback-accept {
  background: #2ed47a;
  color: #06210f;
  box-shadow: 0 0 14px rgba(46, 212, 122, 0.45);
}

.callback-decline {
  background: #ff3b52;
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 59, 82, 0.4);
}

@keyframes callBackSlideIn {
  0% { transform: translate(-50%, -20px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

@media (max-width: 480px) {
  .callback-banner {
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
  }

  @keyframes callBackSlideIn {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
  }
}

/* Tighter mobile layout so mic/chat controls don't require scrolling */
@media (max-width: 600px) {
  .orb-wrap {
    width: 120px;
    height: 120px;
    margin-bottom: 12px;
  }

  .orb {
    width: 90px;
    height: 90px;
  }

  .status-text {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .sub-text {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .partner-card {
    padding: 10px 16px;
    margin-bottom: 10px;
  }

  .primary-controls {
    margin: 12px 0 6px;
    gap: 20px;
  }

  .call-btn {
    width: 72px;
    height: 72px;
  }

  .call-btn .phone-icon,
  .skip-icon {
    width: 26px;
    height: 26px;
  }

  .reaction-bar {
    margin: 4px 0 8px;
  }

  .reaction-btn {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .secondary-controls {
    margin-top: 2px;
  }

  .quick-guide {
    margin-top: 18px;
  }
}

/* Green "connected" parallax flash */
.connect-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  background: radial-gradient(circle at 50% 40%, rgba(46, 212, 122, 0.35), rgba(46, 212, 122, 0) 65%);
}

.connect-flash.playing {
  animation: connectFlash 1.1s ease-out;
}

@keyframes connectFlash {
  0% { opacity: 0; transform: scale(0.85); }
  25% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* ---------------------------------------------------------------------------
   Accessibility & internationalization additions
   --------------------------------------------------------------------------- */

/* Let native form controls (language select, checkboxes, scrollbars) render
   in dark mode so their popups aren't blinding white on the dark theme. */
:root {
  color-scheme: dark;
}

/* Strong, consistent keyboard-focus indicator on every interactive element. */
:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

/* Hidden "skip to main content" link for keyboard/screen-reader users;
   becomes visible when focused. */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 1000;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* Language picker: globe icon + native select, styled as a topbar pill.
   A native <select> is used on purpose — it's the most accessible and most
   familiar picker on every device, and each option shows the language's own
   native name so non-English speakers can find theirs. */
.lang-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--accent-2);
  pointer-events: none;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  max-width: 130px;
}

.lang-select:hover {
  background: rgba(255,255,255,0.1);
}

[dir="rtl"] .lang-icon {
  left: auto;
  right: 10px;
}

[dir="rtl"] .lang-select {
  padding: 8px 32px 8px 12px;
}

/* Visible text labels under the in-call icon buttons (mute/chat/add
   friend/report), so their meaning doesn't depend on decoding an icon.
   Each label hides together with its (JS-toggled) button. */
.ctl-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ctl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ctl-wrap > .btn.hidden + .ctl-label {
  display: none;
}

/* Add button next to the interest input — on many mobile keyboards there is
   no obvious Enter key, so typing-then-Enter alone was a dead end. */
.interest-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.interest-add-btn {
  padding: 8px 16px;
  font-size: 13px;
  flex-shrink: 0;
}

/* Bigger tap targets for small controls (WCAG target-size). */
.modal-close {
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background: rgba(255,255,255,0.08);
}

.interest-tags .tag.removable .tag-remove {
  padding: 4px 6px;
  margin: -4px -6px -4px 0;
  font-size: 14px;
}

/* Stronger focus ring on text inputs (the old 1px outline was barely visible). */
.search-input:focus,
.chat-form input:focus {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}

/* RTL (Arabic/Urdu): re-anchor the notifications dropdown under the bell,
   which sits mirrored on the other side of the topbar. */
[dir="rtl"] .notif-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .side-panel {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  transform: translateX(100%);
}

[dir="rtl"] .side-panel-right {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(255,255,255,0.08);
  transform: translateX(-100%);
}

[dir="rtl"] .side-panel.open,
[dir="rtl"] .side-panel-right.open {
  transform: translateX(0);
}

[dir="rtl"] .settings-account-chevron {
  transform: scaleX(-1);
}

/* Respect the user's reduced-motion preference: kill decorative animation
   (pulsing orb, floating reactions, flashes) for vestibular-safe browsing. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile sizing for the language picker (its topbar order lives with the
   other topbar order rules in the main mobile media block above). */
@media (max-width: 600px) {
  .lang-select {
    max-width: 96px;
    font-size: 12px;
    padding: 7px 8px 7px 26px;
  }

  [dir="rtl"] .lang-select {
    padding: 7px 28px 7px 10px;
  }
}

/* =============================================================
   Main Call/Hang-Up button: one button that smoothly crossfades
   between green "Call" and red "Hang Up" (gradients can't be
   transitioned, so two stacked layers swap opacity instead). */
/* =============================================================
   Call action row: four equal-sized buttons. First is the single
   Call button, the other three are the in-call actions. */
.call-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  margin: 20px 0 8px;
}

.call-action-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.action-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.action-btn:active {
  transform: scale(0.94);
}

/* Neutral (mute / add friend / report): translucent surface, dimmed when
   disabled (before a call is connected) but still visible at full size. */
.action-btn-neutral {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.action-btn-neutral:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.action-btn.added {
  background: rgba(46, 212, 122, 0.25) !important;
}

.action-btn.muted {
  background: rgba(255, 84, 112, 0.2);
}

.action-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2px;
}

/* --- The single Call / Loading / Hang Up / Confirm button ---
   Three stacked gradient layers (green / red / yellow) crossfade by opacity,
   since CSS gradients can't be transitioned directly. */
.call-main-btn {
  position: relative;
  background: none;
}

.call-main-btn::before,
.call-main-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity 0.35s ease;
}

/* green (call) base layer */
.call-main-btn::before {
  background: radial-gradient(circle at 35% 30%, #4ade80, #16a34a 75%);
}

/* red (hang up) layer */
.call-main-btn::after {
  background: radial-gradient(circle at 35% 30%, #ff7a8a, #e21f3e 75%);
  opacity: 0;
}

/* yellow (are-you-sure) layer, added on top */
.call-main-btn .call-main-confirm-layer {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe07a, #f5a300 78%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.call-main-btn.is-hangup::before { opacity: 0; }
.call-main-btn.is-hangup::after { opacity: 1; }

/* loading: keep the green layer but overlay the spinner (icon hidden) */
.call-main-btn.is-loading::after { opacity: 0; }

.call-main-btn.is-confirm::before { opacity: 0; }
.call-main-btn.is-confirm::after { opacity: 0; }
.call-main-btn.is-confirm .call-main-confirm-layer { opacity: 1; }

.call-main-btn .call-main-icon {
  position: relative;
  z-index: 1;
  transition: transform 0.35s ease, opacity 0.2s ease;
}

.call-main-btn.is-hangup .call-main-icon,
.call-main-btn.is-confirm .call-main-icon {
  transform: rotate(135deg);
}

/* Spinner shown only while loading (searching / connecting) */
.action-spinner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.call-main-btn.is-loading .call-main-icon { opacity: 0; }
.call-main-btn.is-loading .action-spinner {
  opacity: 1;
  animation: callSpin 0.8s linear infinite;
}

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

/* Continuous slow pulsing glow while idle (pre-connection) */
.call-main-btn.is-call {
  animation: callPulseGlow 2.8s ease-in-out infinite;
}

.call-main-btn.is-hangup {
  animation: none;
  box-shadow: 0 4px 16px rgba(226, 31, 62, 0.35);
}

.call-main-btn.is-loading {
  animation: none;
  box-shadow: 0 0 22px rgba(46, 212, 122, 0.5);
}

.call-main-btn.is-confirm {
  animation: confirmPulse 0.9s ease-in-out infinite;
  box-shadow: 0 4px 18px rgba(245, 163, 0, 0.5);
}

@keyframes callPulseGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(46, 212, 122, 0.35); }
  50% { box-shadow: 0 0 38px rgba(46, 212, 122, 0.85); }
}

@keyframes confirmPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(245, 163, 0, 0.45); }
  50% { box-shadow: 0 0 34px rgba(245, 163, 0, 0.9); }
}

.call-main-label {
  color: #2ed47a;
  transition: color 0.35s ease;
}

.call-main-label.is-hangup {
  color: var(--danger);
}

.call-main-label.is-loading {
  color: #2ed47a;
}

.call-main-label.is-confirm {
  color: #f5a300;
}

/* Reassurance line kept visible during an active call */
.reassure-line {
  max-width: 420px;
  margin: 0 auto 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 9px 14px;
}

/* Searching entertainment ticker */
.search-ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto 18px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 12px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.25);
  font-size: 13px;
  color: var(--text);
}

.search-ticker-loader {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.search-ticker-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: tickerBounce 1.2s ease-in-out infinite;
}

.search-ticker-loader span:nth-child(2) { animation-delay: 0.15s; }
.search-ticker-loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes tickerBounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-5px); opacity: 1; }
}

.search-ticker-text.ticker-fade-in {
  animation: tickerFadeIn 0.6s ease;
}

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

/* Live connection quality indicator */
.quality-indicator {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  margin-left: 6px;
}

.quality-bar {
  width: 3px;
  border-radius: 1.5px;
  background: rgba(255,255,255,0.18);
}

.quality-bar.q1 { height: 5px; }
.quality-bar.q2 { height: 8px; }
.quality-bar.q3 { height: 11px; }
.quality-bar.q4 { height: 14px; }

.quality-indicator[data-level="1"] .q1 { background: #ff5470; }
.quality-indicator[data-level="2"] .q1,
.quality-indicator[data-level="2"] .q2 { background: #ffb84d; }
.quality-indicator[data-level="3"] .q1,
.quality-indicator[data-level="3"] .q2,
.quality-indicator[data-level="3"] .q3 { background: #2ed47a; }
.quality-indicator[data-level="4"] .q1,
.quality-indicator[data-level="4"] .q2,
.quality-indicator[data-level="4"] .q3,
.quality-indicator[data-level="4"] .q4 { background: #2ed47a; }

.quality-label {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
  align-self: center;
}

/* Toggle switches (App Settings) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(128, 134, 160, 0.35);
  transition: background 0.2s ease;
  pointer-events: none;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.switch input:checked + .switch-slider {
  background: #2ed47a;
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

[dir="rtl"] .switch input:checked + .switch-slider::before {
  transform: translateX(-18px);
}

.app-settings-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-section-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.theme-dot-dark { background: #0b0f1a; border: 1px solid rgba(255,255,255,0.4); }
.theme-dot-light { background: #f4f6fb; }
.theme-dot-ocean { background: #00b4d8; }
.theme-dot-sunset { background: #ff6b6b; }

/* Toast: brief bottom-center confirmations */
.tl-toast {
  position: fixed;
  left: 50%;
  /* Top of the screen so it's visible even with a settings panel / keyboard open. */
  top: calc(16px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -20px);
  z-index: 800;
  max-width: 88vw;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 24, 40, 0.96);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.tl-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Temporary username editor + permanent User ID at the top of Settings */
.temp-name-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.temp-name-hint { margin: 0; }
.temp-name-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.temp-name-row .search-input { flex: 1; min-width: 0; }
.temp-name-save { white-space: nowrap; flex: 0 0 auto; }
.user-id-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.user-id-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-2);
  background: var(--accent-soft, rgba(108, 92, 231, 0.14));
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.user-id-value:hover { background: rgba(108, 92, 231, 0.22); }

/* One-tap expanding settings categories (accordion) */
.settings-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-item {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.acc-header:hover { background: rgba(255,255,255,0.03); }
.acc-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.25s ease;
}
.acc-item.open .acc-chevron { transform: rotate(180deg); }
/* Smooth 0fr→1fr height animation with no fixed max-height guesswork */
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.acc-item.open .acc-body { grid-template-rows: 1fr; }
.acc-body-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px;
}
.acc-item.open .acc-body-inner { padding: 2px 14px 14px; }

/* Sign in / Register at the bottom of the left side panel */
.side-panel-auth {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.side-auth-btn {
  width: 100%;
}

/* Friends dropdown rows: avatar (tap → profile), dot + flag + name (tap →
   chat), small green call button on the right */
.friends-wrap,
.history-wrap {
  position: relative;
}

.friends-dropdown .friend-item {
  flex-wrap: nowrap;
}

.friend-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.friend-avatar-btn svg {
  width: 18px;
  height: 18px;
}

.friend-avatar-btn .avatar-svg {
  width: 32px;
  height: 32px;
}

/* In-place spinner that replaces the friend call icon while a callback is
   pending (rule 11) — the menu stays open, the icon just spins. */
.friend-call-btn.is-loading { cursor: default; opacity: 0.9; }
.callback-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: callbackSpin 0.7s linear infinite;
}
@keyframes callbackSpin { to { transform: rotate(360deg); } }

/* Gender symbol shown in the friends list instead of an avatar image. */
.gender-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 700;
}
.gender-icon.gender-male { color: #2f80ff; }
.gender-icon.gender-female { color: #ff5fa2; }
.gender-icon.gender-neutral { color: var(--muted); }
.gender-icon.gender-neutral svg { width: 1em; height: 1em; }

.friend-row-main {
  flex: 1;
  min-width: 0;
}

.friend-call-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #4ade80, #16a34a 75%);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.friend-call-btn:hover {
  box-shadow: 0 0 16px rgba(22, 163, 74, 0.7);
}

.friend-call-btn:active {
  transform: scale(0.92);
}

.friend-call-btn svg {
  width: 16px;
  height: 16px;
}

/* Offline friend: the green call button goes grey with a small red dot so it
   reads as "unavailable right now" without dropping off the panel. */
.friend-call-btn.is-offline {
  position: relative;
  background: radial-gradient(circle at 35% 30%, #9aa3ad, #6b7280 75%);
  box-shadow: none;
  opacity: 0.85;
}
.friend-call-btn.is-offline:hover { box-shadow: 0 0 8px rgba(107, 114, 128, 0.5); }
.friend-call-offline-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--panel, #1b1e27);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* "Send request for later" chip shown next to an offline friend's call button. */
.friend-call-later-btn {
  flex-basis: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.friend-call-later-btn:hover { background: rgba(239, 68, 68, 0.2); }
.friend-call-later-btn.sent {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  cursor: default;
}

/* Call-gated friend chat: dim the composer while texting is locked. */
#friendChatForm.locked { opacity: 0.75; }
#friendChatForm.locked input:disabled {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.04);
}

/* Friend profile view */
.friend-profile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.friend-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.friend-profile-avatar svg {
  width: 40px;
  height: 40px;
}

.friend-profile-avatar .avatar-svg {
  width: 72px;
  height: 72px;
}

.friend-profile-name {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-profile-status {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.friend-profile-actions .btn {
  width: 100%;
}

/* Avatar picker (Account Settings) */
.avatar-cat-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
}

.avatar-cat {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.avatar-cat.selected {
  background: rgba(108, 92, 231, 0.18);
  border-color: var(--accent);
  color: var(--text);
}

.avatar-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.avatar-option {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.avatar-option:hover {
  transform: scale(1.08);
}

.avatar-option.selected {
  border-color: #2ed47a;
  box-shadow: 0 0 12px rgba(46, 212, 122, 0.55);
}

.avatar-svg {
  border-radius: 50%;
  display: block;
}

/* System notes inside chat (e.g. blocked link warning) */
.chat-msg.system {
  align-self: center;
  background: rgba(255, 84, 112, 0.12);
  border: 1px solid rgba(255, 84, 112, 0.4);
  color: var(--text);
  font-size: 12px;
  border-radius: 10px;
}

/* Light theme: lift the translucent-white surfaces to translucent-dark so
   controls stay visible on a light background. */
[data-theme="light"] .btn-secondary,
[data-theme="light"] .btn-icon,
[data-theme="light"] .action-btn-neutral,
[data-theme="light"] .icon-btn,
[data-theme="light"] .reaction-btn,
[data-theme="light"] .btn-chip,
[data-theme="light"] .friend-item,
[data-theme="light"] .notif-item,
[data-theme="light"] .history-item,
[data-theme="light"] .search-input,
[data-theme="light"] .lang-select,
[data-theme="light"] .pill,
[data-theme="light"] .avatar-cat,
[data-theme="light"] .friend-avatar-btn,
[data-theme="light"] .tag,
[data-theme="light"] .chat-msg.them,
[data-theme="light"] .quick-guide,
[data-theme="light"] .reassure-line,
[data-theme="light"] .settings-account-avatar,
[data-theme="light"] .friend-profile-avatar {
  background: rgba(20, 30, 70, 0.07);
  color: var(--text);
  border-color: rgba(20, 30, 70, 0.15);
}

[data-theme="light"] .modal-box,
[data-theme="light"] .notif-dropdown,
[data-theme="light"] .side-panel {
  border-color: rgba(20, 30, 70, 0.12);
}

[data-theme="light"] .icon-btn:hover,
[data-theme="light"] .modal-close:hover {
  background: rgba(20, 30, 70, 0.12);
}

[data-theme="light"] .quality-bar {
  background: rgba(20, 30, 70, 0.18);
}

/* =============================================================
   Call screen fits the viewport with no page scroll, on every phone.
   Scoped to when the call panel is active so the setup/landing view
   is unaffected. */
.stage.call-live {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  justify-content: center;
  padding: 8px 12px;
  gap: 0;
}

/* The call panel is the only visible child; it centers its contents and never
   spills over anything else (this was the source of the icon/text overlap). */
.stage.call-live .call-panel {
  flex: 0 1 auto;
  width: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;           /* contained safety net; layout below fits without it */
  overscroll-behavior: contain;
  justify-content: center;
  gap: 2px;
}

/* The rules list and the reassurance line are setup-screen guidance — during a
   call they only push the mic/chat controls off-screen, so hide them. Hiding
   the guide also removes the element that was overlapping the controls. */
.stage.call-live #quickGuide,
#quickGuide.in-call,
.stage.call-live #convoGuide,
.stage.call-live .reassure-line {
  display: none !important;
}

/* Proportionally shrink the four call-action buttons. */
.stage.call-live .action-btn {
  width: 60px;
  height: 60px;
}
.stage.call-live .call-actions {
  gap: 14px;
  margin: 10px 0 6px;
}
.stage.call-live .orb-wrap {
  width: 150px;
  height: 150px;
  margin-bottom: 8px;
}
/* Keep the orb within its (now smaller) wrap so rings never spill. */
.stage.call-live .orb { width: 110px; height: 110px; }
.stage.call-live .orb-core { width: 74px; height: 74px; }
@media (max-height: 740px) {
  .stage.call-live .orb { width: 92px; height: 92px; }
  .stage.call-live .orb-core { width: 60px; height: 60px; }
}
@media (max-height: 620px) {
  .stage.call-live .orb { width: 72px; height: 72px; }
  .stage.call-live .orb-core { width: 46px; height: 46px; }
}
/* Tighten the vertical rhythm so everything through the mic/chat row fits. */
.stage.call-live .partner-card { margin: 4px 0 6px; }
.stage.call-live .reaction-bar { margin: 4px 0; }
.stage.call-live .auto-call-row { margin: 6px auto; }
.stage.call-live .call-actions { margin-top: 6px; }

/* Short viewports (most phones in-call): tighten everything further. */
@media (max-height: 740px) {
  .stage.call-live .orb-wrap {
    width: 116px;
    height: 116px;
    margin-bottom: 4px;
  }
  .stage.call-live .action-btn {
    width: 54px;
    height: 54px;
  }
  .stage.call-live .call-actions { gap: 12px; margin: 6px 0 4px; }
}

/* Very short viewports (compact phones, landscape-ish): last squeeze. */
@media (max-height: 620px) {
  .stage.call-live .orb-wrap {
    width: 90px;
    height: 90px;
    margin-bottom: 2px;
  }
  .stage.call-live .action-btn {
    width: 50px;
    height: 50px;
  }
  .stage.call-live .action-label,
  .stage.call-live .call-main-label { font-size: 11px; }
}

/* =============================================================
   Chat panel as a right-side sliding sheet. */
.chat-side-panel {
  width: 380px;
  max-width: 90vw;
  padding: 0;
  gap: 0;
}

/* Mobile: the chat is a full-screen sheet — full width so there is no dead
   strip on the side and the Send button can never be pushed off-screen. */
@media (max-width: 767px) {
  .chat-side-panel {
    width: 100%;
    max-width: 100%;
  }
  .chat-side-panel .chat-form {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .chat-side-panel .chat-send {
    padding: 13px 18px;
  }
}

.chat-side-panel .side-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.chat-side-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-side-body .chat-messages {
  flex: 1;
  min-height: 0;
}

.chat-side-panel .typing-indicator {
  padding: 0 14px 6px;
}

/* Desktop: Facebook-Messenger-web-style chat docked at the bottom-right corner
   — a floating rounded window that pops up (not a full-height drawer), so the
   call stays fully visible behind it. It's non-modal: no dimming overlay, and
   it stays open until explicitly closed. Placed after the base .chat-side-panel
   block so these values win without needing extra specificity. */
@media (min-width: 768px) {
  #chatOverlay { display: none !important; }

  .chat-side-panel {
    top: auto;
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: min(620px, calc(100vh - 120px));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    box-shadow: 0 26px 70px rgba(0,0,0,0.5);
    backdrop-filter: blur(14px);
    /* Pop up from the corner with a slight scale; hidden state is offset +
       faded so the transition reads as a spring, not a slide. */
    transform: translateY(28px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(.2,.9,.25,1), opacity 0.22s ease;
  }
  .chat-side-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .chat-side-panel .chat-msg { font-size: 16px; }
  .chat-side-panel .chat-messages { padding: 16px; gap: 10px; }
}

/* The action spinner sits centered inside the round Call button. */
.action-btn .action-spinner { top: 50%; left: 50%; margin: -17px 0 0 -17px; }

/* Consent line under the call buttons on the idle screen. */
.consent-line {
  margin: 6px auto 0;
  text-align: center;
}
.stage.call-live .consent-line { display: none; }

/* RTL: the chat sheet slides in from the left instead (mirrors side panels). */
[dir="rtl"] .chat-fab { order: -1; }

/* =============================================================
   Touch response: a light, quick press-in on every interactive control
   so nothing feels dead. Deliberately subtle (no bounce/overshoot). The
   main Call button is intentionally left to its own styling. */
.btn,
.icon-btn,
.chat-fab,
.action-btn-neutral,
.reaction-btn,
.pill,
.modal-close,
.account-tab,
.avatar-cat,
.friend-avatar-btn,
.btn-chip,
.tag.removable,
.lang-select,
.settings-account-row {
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.reaction-btn:active,
.pill:active,
.modal-close:active,
.account-tab:active,
.avatar-cat:active,
.friend-avatar-btn:active,
.btn-chip:active,
.settings-account-row:active,
.lang-select:active {
  transform: scale(0.92);
}

.link-btn:active { opacity: 0.55; }

/* =============================================================
   Chat panel header: shows the partner's name, flag and status. */
.chat-side-header {
  align-items: center;
  gap: 10px;
}

.chat-peer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-peer-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.chat-peer-name #chatPeerName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.chat-peer-flag img,
.chat-peer-flag .flag-img {
  width: 22px;
  height: auto;
  border-radius: 3px;
  vertical-align: middle;
}

.chat-peer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.chat-peer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.chat-peer-status.is-online { color: #2ed47a; }
.chat-peer-status.is-online .chat-peer-status-dot {
  background: #2ed47a;
  box-shadow: 0 0 6px #2ed47a;
}

.chat-peer-status.is-offline { color: #ff6b7d; }
.chat-peer-status.is-offline .chat-peer-status-dot { background: #ff6b7d; }

/* =============================================================
   Ludo mini-game
   ============================================================= */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.game-overlay.hidden { display: none; }

.game-modal {
  background:
    radial-gradient(120% 80% at 50% -10%, #2a6bd4 0%, #1a4fb0 42%, #0f3a8c 100%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  width: min(94vw, 440px);
  max-height: 96vh;
  overflow-y: auto;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.game-modal .game-title,
.game-modal .game-status { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.game-modal .modal-close { color: rgba(255,255,255,0.85); }

.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.game-title { margin: 0; font-size: 20px; font-weight: 800; }

.game-status {
  margin: 0;
  text-align: center;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  min-height: 20px;
}

/* --- Player status bar: avatar · name · turn · live activity --- */
.ludo-players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ludo-players.hidden { display: none; }
.ludo-player {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ludo-player[data-side="opp"] { flex-direction: row-reverse; text-align: right; }
.ludo-player.active {
  border-color: #ffd54a;
  background: rgba(255, 213, 74, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
}
.ludo-player-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  border: 2.5px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0,0,0,0.3);
}
.ludo-player-avatar.p0 { background: radial-gradient(circle at 35% 28%, #ff7076, #e5484d 70%); }
.ludo-player-avatar.p1 { background: radial-gradient(circle at 35% 28%, #ffdd6b, #f4c025 70%); color: #4a3a00; }
.ludo-player.active .ludo-player-avatar { animation: ludoAvatarPulse 1.1s ease-in-out infinite; }
@keyframes ludoAvatarPulse {
  0%, 100% { box-shadow: inset 0 3px 5px rgba(255,255,255,0.4), 0 0 0 0 rgba(255,213,74,0.6); }
  50% { box-shadow: inset 0 3px 5px rgba(255,255,255,0.4), 0 0 0 6px rgba(255,213,74,0); }
}
/* A little die badge appears on whoever's turn it is. */
.ludo-player.active .ludo-player-avatar::after {
  content: '🎲';
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6));
}
.ludo-player[data-side="opp"].active .ludo-player-avatar::after { right: auto; left: -4px; }
.ludo-player-info { display: flex; flex-direction: column; min-width: 0; }
.ludo-player-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ludo-player-activity {
  font-size: 11px;
  color: #ffe08a;
  font-weight: 600;
  min-height: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ludo-vs {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.65);
  letter-spacing: 1px;
}

/* --- Board area wrapper (for grayscale on disconnect) + banner --- */
.ludo-board-area { position: relative; }
.ludo-board-area.is-dead .ludo-board {
  filter: grayscale(1) brightness(0.7);
  pointer-events: none;
}
.ludo-board-area.is-dead .ludo-token { pointer-events: none !important; }
.ludo-disconnect-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  max-width: 84%;
  text-align: center;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(20, 10, 14, 0.92);
  color: #ff5470;
  font-weight: 800;
  font-size: 15px;
  border: 1px solid rgba(255, 84, 112, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.ludo-disconnect-banner.hidden { display: none; }

/* Narrow confirm dialog (end game / end call) */
.modal-box-narrow { max-width: 360px; }
.confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.confirm-actions .btn { flex: 1; }

/* --- The board: a 15x15 grid on a warm "board" background --- */
.ludo-board-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.ludo-board {
  position: relative;
  width: min(84vw, 380px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  background: #f7f4ea;
  border-radius: 12px;
  overflow: hidden;
  /* Warm wooden frame — a border (no padding) so token % positions stay exact. */
  border: solid clamp(8px, 3vw, 14px);
  border-image: linear-gradient(145deg, #e7b877, #c68a3f 45%, #a4692a) 1;
  box-shadow:
    0 10px 26px rgba(0,0,0,0.45),
    inset 0 0 0 1.5px rgba(0,0,0,0.15);
  --lred: #e5484d;
  --lgreen: #2fbf71;
  --lyellow: #f4c025;
  --lblue: #3d7bfd;
}

.lc { position: relative; }
.lc-path { background: #ffffff; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.15); }

.lc-base-red { background: color-mix(in srgb, var(--lred) 92%, #000); }
.lc-base-green { background: color-mix(in srgb, var(--lgreen) 92%, #000); }
.lc-base-blue { background: color-mix(in srgb, var(--lblue) 92%, #000); }
.lc-base-yellow { background: color-mix(in srgb, var(--lyellow) 92%, #000); }
.lc-yard {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
/* round the inner yard corners a touch */
.lc-yard-tl { border-top-left-radius: 10px; }
.lc-yard-tr { border-top-right-radius: 10px; }
.lc-yard-bl { border-bottom-left-radius: 10px; }
.lc-yard-br { border-bottom-right-radius: 10px; }

.lc-home-red { background: var(--lred); }
.lc-home-green { background: var(--lgreen); }
.lc-home-blue { background: var(--lblue); }
.lc-home-yellow { background: var(--lyellow); }

.lc-start-red { background: color-mix(in srgb, var(--lred) 45%, #fff); }
.lc-start-green { background: color-mix(in srgb, var(--lgreen) 45%, #fff); }
.lc-start-blue { background: color-mix(in srgb, var(--lblue) 45%, #fff); }
.lc-start-yellow { background: color-mix(in srgb, var(--lyellow) 55%, #fff); }

.lc-safe::after {
  content: '★';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62em;
  color: rgba(0,0,0,0.4);
}

/* Entry arrows on the coloured start squares — point the way tokens travel. */
.lc-start-red, .lc-start-green, .lc-start-blue, .lc-start-yellow { position: relative; }
.lc-start-red::before, .lc-start-green::before,
.lc-start-blue::before, .lc-start-yellow::before {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 900;
  color: rgba(0,0,0,0.55);
  line-height: 1;
}
.lc-start-red::before { content: '→'; }
.lc-start-green::before { content: '↓'; }
.lc-start-yellow::before { content: '←'; }
.lc-start-blue::before { content: '↑'; }

.lc-center {
  background: #e9e2cf;
}
.lc-center-mark {
  grid-row: 7 / 10;
  grid-column: 7 / 10;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(6vw, 26px);
  pointer-events: none;
  background:
    conic-gradient(from 45deg,
      var(--lgreen) 0deg 90deg,
      var(--lyellow) 90deg 180deg,
      var(--lblue) 180deg 270deg,
      var(--lred) 270deg 360deg);
}

/* --- Tokens --- */
.ludo-token {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: left 0.25s ease, top 0.25s ease;
  pointer-events: none;
}
.ludo-token-dot {
  width: 74%;
  height: 74%;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.35);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.45),
    inset 0 -2px 3px rgba(0,0,0,0.28),
    inset 0 2px 3px rgba(255,255,255,0.7);
}
.ludo-token.p0 .ludo-token-dot { background: radial-gradient(circle at 34% 28%, #ff8388, #e5484d 62%, #b8272c); }
.ludo-token.p1 .ludo-token-dot { background: radial-gradient(circle at 34% 28%, #ffe27a, #f4c025 62%, #c99a10); }
.ludo-token.movable {
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
  animation: ludoTokenPulse 1s ease-in-out infinite;
}
/* Enlarge the tap target on small screens without moving the visible piece. */
.ludo-token.movable::before {
  content: '';
  position: absolute;
  inset: -55%;
  border-radius: 50%;
}
.ludo-token.movable .ludo-token-dot {
  border-color: #111;
  box-shadow: 0 0 0 2px #fff, 0 0 10px 3px rgba(255,255,255,0.9);
}
@keyframes ludoTokenPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* --- Controls --- */
.game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ludo-die {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(145deg, #ffffff, #dfe6f0);
  color: #16233b;
  font-size: 26px;
  font-weight: 800;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 12px rgba(0,0,0,0.4), inset 0 2px 3px rgba(255,255,255,0.9), inset 0 -3px 5px rgba(0,0,0,0.12);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}
/* Real dice pips: a 3x3 grid of dots, lit per face. */
.ludo-die-pips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  width: 62%;
  height: 62%;
}
.ludo-die-pips .pip { border-radius: 50%; }
.ludo-die-pips .pip.on {
  background: radial-gradient(circle at 35% 30%, #3a4a66, #16233b 70%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35);
}
.ludo-die-glyph { display: flex; align-items: center; justify-content: center; }
.ludo-die.active {
  cursor: pointer;
  border-color: #2ed47a;
  box-shadow: 0 0 0 3px rgba(46,212,122,0.35), 0 4px 10px rgba(0,0,0,0.35);
  animation: ludoDieGlow 1.1s ease-in-out infinite;
}
.ludo-die.active:active { transform: scale(0.9); }
.ludo-die.rolling { animation: ludoDieRoll 0.5s ease; }
@keyframes ludoDieGlow {
  0%,100% { box-shadow: 0 0 0 3px rgba(46,212,122,0.3), 0 4px 10px rgba(0,0,0,0.35); }
  50% { box-shadow: 0 0 0 5px rgba(46,212,122,0.55), 0 4px 14px rgba(0,0,0,0.4); }
}
@keyframes ludoDieRoll {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.game-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}
.game-accept {
  background: #2ed47a;
  color: #06210f;
  font-weight: 700;
}
.game-decline {
  background: #ff3b52;
  color: #fff;
  font-weight: 700;
}

/* A little "!" nudge on the game button when you're invited */
#gameBtn { position: relative; }
#gameBtn .notif-badge { background: #2ed47a; }

/* Nav tool buttons that require a live call (e.g. Ludo) dim when unavailable. */
.icon-btn:disabled,
.icon-btn.nav-btn-off {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* "🎲 your move" nudge on the game button: a floating dice, not a count pill. */
#gameBtn .notif-badge.is-move {
  top: -9px;
  right: -9px;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
  animation: ludoNudge 0.9s ease-in-out infinite;
}
@keyframes ludoNudge {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-2px) rotate(8deg); }
}

/* Periodic "come play Ludo" attention wiggle on the game button during a call. */
#gameBtn.game-nudge {
  animation: gameNudge 1.2s ease-in-out;
  color: var(--accent-2);
}
@keyframes gameNudge {
  0%   { transform: scale(1) rotate(0); box-shadow: 0 0 0 0 rgba(0,212,255,0.5); }
  15%  { transform: scale(1.18) rotate(-12deg); box-shadow: 0 0 0 6px rgba(0,212,255,0); }
  30%  { transform: scale(1.12) rotate(12deg); }
  45%  { transform: scale(1.15) rotate(-9deg); box-shadow: 0 0 0 8px rgba(0,212,255,0); }
  60%  { transform: scale(1.1) rotate(7deg); }
  80%  { transform: scale(1.06) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); box-shadow: 0 0 0 0 rgba(0,212,255,0); }
}
@media (prefers-reduced-motion: reduce) {
  #gameBtn.game-nudge { animation: none; }
  .ludo-player.active .ludo-player-avatar,
  .ludo-token.movable,
  .ludo-die.active,
  .ludo-die.rolling { animation: none; }
  .ludo-token { transition: none; }
}
