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

:root {
  --cyan: #00f0ff;
  --purple: #a855f7;
  --pink: #ec4899;
  --blue: #3b82f6;
  --dark: #030812;
  --card-bg: rgba(8, 15, 35, 0.7);
  --glow-cyan: 0 0 20px rgba(0,240,255,0.3), 0 0 60px rgba(0,240,255,0.1);
  --glow-purple: 0 0 20px rgba(168,85,247,0.3), 0 0 60px rgba(168,85,247,0.1);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--dark);
  color: #c8d6e5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Animated background --- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

.bg-orbs {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}

.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
  animation: orb-float 15s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
  width: 500px; height: 500px; background: rgba(0,240,255,0.15);
  top: -10%; left: -5%; animation-duration: 18s;
}

.bg-orb:nth-child(2) {
  width: 400px; height: 400px; background: rgba(168,85,247,0.12);
  top: 50%; right: -10%; animation-duration: 22s; animation-delay: -5s;
}

.bg-orb:nth-child(3) {
  width: 300px; height: 300px; background: rgba(236,72,153,0.1);
  bottom: -5%; left: 30%; animation-duration: 25s; animation-delay: -10s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* --- Particles canvas --- */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* --- Container --- */
.container {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto; padding: 50px 20px;
}

/* --- Header --- */
.header { text-align: center; margin-bottom: 40px; }

.header h1 {
  font-family: 'Orbitron', monospace;
  font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
  text-transform: uppercase; letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(0,240,255,0.2);
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header .tagline {
  font-size: 13px; color: rgba(0,240,255,0.5); margin-top: 8px;
  font-family: 'Orbitron', monospace; letter-spacing: 3px; text-transform: uppercase;
}

.header .rotating-question {
  font-size: 15px; color: rgba(255,255,255,0.6); margin-top: 14px;
  font-weight: 500; min-height: 24px;
}

.header .rotating-question .rotating-name {
  display: inline-block;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 700;
  animation: name-swap 0.4s ease;
}

@keyframes name-swap {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Holographic divider --- */
.holo-line {
  height: 1px; margin: 30px auto; max-width: 400px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
  animation: holo-shimmer 3s ease infinite;
}

@keyframes holo-shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- Search panel --- */
.search-panel {
  background: var(--card-bg);
  border: 1px solid rgba(0,240,255,0.12);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 28px;
  backdrop-filter: blur(20px);
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0,240,255,0.08);
}

.search-panel::before {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 200%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scan-line 4s linear infinite;
}

@keyframes scan-line {
  0% { left: -100%; }
  100% { left: 100%; }
}

.input-row { display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-end; }

.input-group { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.input-group label {
  font-family: 'Orbitron', monospace;
  font-size: 10px; color: var(--cyan); text-transform: uppercase;
  letter-spacing: 2px; font-weight: 700; opacity: 0.7;
}

.input-group .input-wrap {
  position: relative; display: flex; align-items: center;
}

.input-group input {
  background: rgba(0,240,255,0.04);
  border: 1px solid rgba(0,240,255,0.15);
  border-radius: 12px;
  padding: 14px 18px;
  color: #fff; font-size: 15px; font-family: 'Inter', sans-serif;
  outline: none; transition: all 0.3s;
  width: 100%;
}

.input-group input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,240,255,0.15), inset 0 0 20px rgba(0,240,255,0.05);
}

.input-group input::placeholder { color: rgba(255,255,255,0.2); }

/* --- Swap button --- */
.swap-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.15);
  color: var(--cyan); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.4s; flex-shrink: 0; margin-bottom: 1px;
}

.swap-btn:hover {
  background: rgba(0,240,255,0.15); border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.2);
  transform: rotate(180deg);
}

.swap-btn:active { transform: rotate(180deg) scale(0.9); }

/* --- Dice button --- */
.dice-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.15);
  color: var(--cyan); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}

.dice-btn:hover {
  background: rgba(0,240,255,0.15); border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,240,255,0.2);
  transform: translateY(-50%) rotate(90deg);
}

.dice-btn:active { transform: translateY(-50%) rotate(180deg) scale(0.9); }

/* --- Search + action buttons row --- */
.btn-row { display: flex; gap: 10px; }

button.search-btn {
  flex: 1; padding: 16px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border: none; border-radius: 14px;
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: 'Orbitron', monospace;
  text-transform: uppercase; letter-spacing: 2px;
  cursor: pointer; position: relative; overflow: hidden;
  transition: all 0.3s; box-shadow: var(--glow-cyan);
}

button.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,240,255,0.4), 0 0 80px rgba(0,240,255,0.15);
}

button.search-btn:active { transform: translateY(0) scale(0.98); }
button.search-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

button.search-btn::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: btn-sweep 3s ease infinite;
}

@keyframes btn-sweep {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* --- History button --- */
.history-btn {
  width: 52px; padding: 16px 0;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.15);
  border-radius: 14px; color: var(--cyan); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}

.history-btn:hover {
  background: rgba(0,240,255,0.12); border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.15);
}

/* --- Sound toggle --- */
.sound-toggle {
  position: fixed; top: 20px; right: 20px; z-index: 50;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.12);
  color: var(--cyan); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}

.sound-toggle:hover { background: rgba(0,240,255,0.12); border-color: var(--cyan); }
.sound-toggle.muted { opacity: 0.3; }

/* --- Social links --- */
.social-links {
  position: fixed; top: 14px; left: 14px; z-index: 100;
  display: flex; gap: 8px;
}

.social-links a {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan); transition: all 0.3s;
  text-decoration: none;
}

.social-links a svg {
  width: 18px; height: 18px;
}

.social-links a:hover {
  background: rgba(0,240,255,0.15); border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,240,255,0.2);
  transform: translateY(-2px);
}

/* --- History panel --- */
.history-panel {
  display: none; background: var(--card-bg);
  border: 1px solid rgba(0,240,255,0.1);
  border-radius: 16px; padding: 16px; margin-bottom: 20px;
  backdrop-filter: blur(20px);
  max-height: 250px; overflow-y: auto;
  animation: fade-in 0.3s ease;
}

.history-panel.active { display: block; }

.history-panel h3 {
  font-family: 'Orbitron', monospace; font-size: 11px;
  color: var(--cyan); letter-spacing: 2px; margin-bottom: 10px;
  text-transform: uppercase; opacity: 0.6;
}

.history-entry {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s; margin-bottom: 4px;
}

.history-entry:hover { background: rgba(0,240,255,0.06); }

.history-entry .he-path {
  font-size: 13px; color: #fff; font-weight: 600;
}

.history-entry .he-meta {
  font-size: 11px; color: rgba(200,214,229,0.4);
}

.history-entry .he-degrees {
  font-family: 'Orbitron', monospace; font-size: 14px;
  color: var(--cyan); font-weight: 700; flex-shrink: 0; margin-left: 12px;
}

.history-clear {
  background: none; border: 1px solid rgba(255,80,80,0.2); color: rgba(255,80,80,0.5);
  font-size: 10px; padding: 4px 12px; border-radius: 6px;
  cursor: pointer; margin-top: 8px; transition: all 0.2s;
  font-family: 'Orbitron', monospace; text-transform: uppercase; letter-spacing: 1px;
}

.history-clear:hover { border-color: #f05050; color: #f05050; background: rgba(255,80,80,0.08); }

/* --- Progress area --- */
.progress-area { display: none; margin-bottom: 28px; }
.progress-area.active { display: block; animation: fade-in 0.4s ease; }

@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.progress-bar-container {
  background: var(--card-bg);
  border: 1px solid rgba(0,240,255,0.1);
  border-radius: 16px; padding: 20px 24px; margin-bottom: 12px;
  backdrop-filter: blur(20px);
}

.progress-stats {
  display: flex; justify-content: space-between; margin-bottom: 14px;
}

.progress-stats .stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.progress-stats .stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 18px; font-weight: 700; color: var(--cyan);
}

.progress-stats .stat-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(0,240,255,0.4); font-family: 'Orbitron', monospace;
}

.progress-bar-track {
  width: 100%; height: 4px;
  background: rgba(0,240,255,0.08);
  border-radius: 2px; overflow: hidden; margin-bottom: 10px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  background-size: 200% 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-bar-fill.active {
  animation: bar-glow 2s ease-in-out infinite, gradient-shift 3s linear infinite;
}

@keyframes bar-glow {
  0%, 100% { box-shadow: 0 0 8px var(--cyan); }
  50% { box-shadow: 0 0 20px var(--cyan), 0 0 40px var(--purple); }
}

.progress-status {
  font-size: 11px; color: rgba(0,240,255,0.4);
  display: flex; justify-content: space-between;
  font-family: 'Orbitron', monospace; letter-spacing: 0.5px;
}

.progress-log {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0,240,255,0.08);
  border-radius: 12px; padding: 14px 18px;
  max-height: 180px; overflow-y: auto;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 11px; line-height: 1.7;
}

.progress-log::-webkit-scrollbar { width: 3px; }
.progress-log::-webkit-scrollbar-track { background: transparent; }
.progress-log::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.2); border-radius: 2px; }

.log-line { padding: 1px 0; }
.log-line .timestamp { color: rgba(0,240,255,0.3); margin-right: 8px; }
.log-line.info { color: #556; }
.log-line.fetch { color: rgba(0,240,255,0.5); }
.log-line.fetched { color: rgba(0,255,136,0.6); }
.log-line.warn { color: #f0a040; }
.log-line.error { color: #f05050; }
.log-line.proxy_switch { color: #f0a040; font-weight: 600; }
.log-line.found { color: #00ff88; font-weight: 700; text-shadow: 0 0 10px rgba(0,255,136,0.3); }
.log-line.depth_start { color: var(--cyan); font-weight: 600; }
.log-line.depth_end { color: rgba(0,240,255,0.4); }

/* --- Results --- */
.status { text-align: center; padding: 20px; color: #556; font-size: 14px; }
.status.error { color: #f05050; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(0,240,255,0.1); border-top-color: var(--cyan);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 8px;
}

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

.result-header {
  text-align: center; margin-bottom: 32px;
  animation: fade-in 0.6s ease;
}

.result-header .degrees {
  font-family: 'Orbitron', monospace;
  font-size: 72px; font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
  animation: number-glow 3s ease-in-out infinite;
}

@keyframes number-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(0,240,255,0.3)); }
  50% { filter: drop-shadow(0 0 30px rgba(0,240,255,0.5)) drop-shadow(0 0 60px rgba(168,85,247,0.3)); }
}

.result-header .degrees-label {
  font-family: 'Orbitron', monospace;
  font-size: 12px; color: rgba(0,240,255,0.5);
  margin-top: 6px; text-transform: uppercase; letter-spacing: 4px;
}

.result-header .visited-info {
  font-size: 11px; color: rgba(200,214,229,0.3); margin-top: 10px;
}

/* --- Share button --- */
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 8px 20px; border-radius: 10px;
  background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.15);
  color: var(--cyan); font-family: 'Orbitron', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; cursor: pointer; transition: all 0.3s;
}

.share-btn:hover {
  background: rgba(0,240,255,0.15); border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.15);
}

.share-btn svg { width: 14px; height: 14px; fill: var(--cyan); }

.path-card-link {
  text-decoration: none; color: inherit; display: block;
  width: 100%; max-width: 500px;
}

/* --- Path chain --- */
.path-chain { display: flex; flex-direction: column; align-items: center; }

.path-card {
  background: var(--card-bg);
  border: 1px solid rgba(0,240,255,0.1);
  border-radius: 18px;
  padding: 20px 22px;
  display: flex; gap: 16px;
  width: 100%; max-width: 500px;
  backdrop-filter: blur(20px);
  position: relative; overflow: visible;
  transition: all 0.3s;
  animation: card-appear 0.5s ease backwards;
}

.path-card:hover {
  border-color: rgba(0,240,255,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 0 20px rgba(0,240,255,0.08);
}

.path-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 18px;
  background: linear-gradient(135deg, rgba(0,240,255,0.03), transparent, rgba(168,85,247,0.03));
  pointer-events: none; z-index: 0;
}

.path-card.start {
  border-color: rgba(0,240,255,0.25);
  box-shadow: var(--glow-cyan);
}

.path-card.end {
  border-color: rgba(168,85,247,0.25);
  box-shadow: var(--glow-purple);
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.avatar {
  width: 58px; height: 58px; border-radius: 14px;
  background: rgba(0,240,255,0.05); overflow: hidden; flex-shrink: 0;
  border: 2px solid rgba(0,240,255,0.15);
  box-shadow: 0 0 15px rgba(0,240,255,0.1);
  transition: all 0.3s;
}

.path-card:hover .avatar {
  border-color: rgba(0,240,255,0.3);
  box-shadow: 0 0 25px rgba(0,240,255,0.2);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { flex: 1; min-width: 0; }

.name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.name-row .name {
  font-size: 16px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.badges { display: flex; align-items: center; gap: 5px; flex-shrink: 0; position: relative; z-index: 5; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  transition: all 0.3s; cursor: help;
  position: relative;
}

.badge:hover { transform: scale(1.25); }
.badge svg { width: 18px; height: 18px; }

.badge-verified svg { filter: drop-shadow(0 0 6px rgba(0,102,255,0.6)); }
.badge-admin svg { fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,0.4)); }

/* Tooltip */
.badge::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) scale(0.8); opacity: 0;
  background: rgba(0,0,0,0.9); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  border: 1px solid rgba(0,240,255,0.2);
  pointer-events: none; transition: all 0.2s;
  z-index: 10;
}

.badge:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

.role-tag {
  font-family: 'Orbitron', monospace;
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  padding: 3px 8px; border-radius: 6px; text-transform: uppercase;
}

.role-tag.you { background: rgba(0,240,255,0.1); color: var(--cyan); border: 1px solid rgba(0,240,255,0.2); }
.role-tag.target { background: rgba(168,85,247,0.1); color: var(--purple); border: 1px solid rgba(168,85,247,0.2); }

.username-line {
  font-size: 12px; color: rgba(200,214,229,0.5); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.user-stats {
  display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}

.user-stat {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(0,240,255,0.04);
  border: 1px solid rgba(0,240,255,0.08);
  border-radius: 10px;
  padding: 6px 12px; min-width: 64px;
  transition: all 0.3s;
}

.user-stat:hover {
  border-color: rgba(0,240,255,0.2);
  background: rgba(0,240,255,0.08);
}

.user-stat .stat-num {
  font-family: 'Orbitron', monospace;
  font-size: 13px; font-weight: 700; color: var(--cyan); line-height: 1.2;
}

.user-stat .stat-lbl {
  font-size: 8px; color: rgba(200,214,229,0.35); text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}

.join-date {
  font-size: 11px; color: rgba(200,214,229,0.35); margin-top: 8px;
  font-style: italic;
}

/* --- Arrow connector --- */
.arrow-connector {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; position: relative;
}

.arrow-line {
  width: 2px; height: 24px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  position: relative; overflow: hidden;
}

.arrow-line::after {
  content: ''; position: absolute; top: -100%; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.8), transparent);
  animation: line-pulse 2s ease-in-out infinite;
}

@keyframes line-pulse {
  0% { top: -100%; }
  100% { top: 200%; }
}

.arrow-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple), 0 0 20px rgba(168,85,247,0.3);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* --- Profile popup --- */
.profile-popup {
  position: absolute; z-index: 100;
  background: rgba(8,15,35,0.95); backdrop-filter: blur(20px);
  border: 1px solid rgba(0,240,255,0.15); border-radius: 16px;
  padding: 20px; width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(0,240,255,0.08);
  animation: popup-in 0.2s ease;
  pointer-events: none;
}

@keyframes popup-in {
  from { opacity: 0; transform: scale(0.92) translateY(5px); }
  to { opacity: 1; transform: none; }
}

.profile-popup .pp-header { display: flex; gap: 14px; margin-bottom: 12px; }
.profile-popup .pp-avatar { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; border: 2px solid rgba(0,240,255,0.2); }
.profile-popup .pp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-popup .pp-name { font-size: 16px; font-weight: 700; color: #fff; }
.profile-popup .pp-username { font-size: 12px; color: rgba(200,214,229,0.5); }
.profile-popup .pp-bio { font-size: 12px; color: rgba(200,214,229,0.5); margin-top: 8px; line-height: 1.5; max-height: 60px; overflow: hidden; }
.profile-popup .pp-stats { display: flex; gap: 8px; margin-top: 12px; }
.profile-popup .pp-stat { text-align: center; flex: 1; }
.profile-popup .pp-stat-num { font-family: 'Orbitron', monospace; font-size: 14px; font-weight: 700; color: var(--cyan); }
.profile-popup .pp-stat-lbl { font-size: 9px; color: rgba(200,214,229,0.35); text-transform: uppercase; }
.profile-popup .pp-age { font-size: 11px; color: rgba(200,214,229,0.3); margin-top: 10px; text-align: center; }

/* --- Account age timeline --- */
.timeline-container {
  margin-top: 36px; padding: 24px 28px;
  background: var(--card-bg); border: 1px solid rgba(0,240,255,0.1);
  border-radius: 18px; backdrop-filter: blur(20px);
  max-width: 500px; margin-left: auto; margin-right: auto;
  animation: fade-in 0.6s ease;
  position: relative; overflow: visible;
}

.timeline-title {
  font-family: 'Orbitron', monospace; font-size: 10px;
  color: var(--cyan); letter-spacing: 3px; opacity: 0.7;
  text-transform: uppercase; text-align: center; margin-bottom: 28px;
}

.timeline-track {
  position: relative; margin: 0 20px; padding-bottom: 12px;
}

.timeline-bar {
  position: relative; height: 3px;
  background: rgba(0,240,255,0.1); border-radius: 2px;
}

.timeline-bar .tl-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0,240,255,0.2);
}

.timeline-marker {
  position: absolute; top: -16px;
  width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; border: 2px solid rgba(0,240,255,0.3);
  transform: translateX(-50%);
  cursor: pointer; transition: all 0.3s;
  box-shadow: 0 0 12px rgba(0,240,255,0.15);
  background: #0c1631;
}

.timeline-marker:hover {
  transform: translateX(-50%) scale(1.3); z-index: 5;
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,240,255,0.3);
}

.timeline-marker img { width: 100%; height: 100%; object-fit: cover; }

.timeline-marker .tm-label {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(0.8); opacity: 0;
  background: rgba(0,0,0,0.9); color: #fff;
  font-size: 11px; font-weight: 500; font-family: 'Inter', sans-serif;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  border: 1px solid rgba(0,240,255,0.2);
  pointer-events: none; transition: all 0.2s; z-index: 10;
}

.timeline-marker:hover .tm-label {
  opacity: 1; transform: translateX(-50%) scale(1);
}

.timeline-labels {
  display: flex; justify-content: space-between;
  margin-top: 20px; padding: 0 0;
}

.timeline-labels span {
  font-size: 11px; color: rgba(0,240,255,0.6);
  font-family: 'Orbitron', monospace; font-weight: 700;
}

/* --- Overlap percentage pill --- */
.overlap-pct {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  font-family: 'Orbitron', monospace; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.12);
  color: rgba(0,240,255,0.5); white-space: nowrap;
  transition: all 0.3s; opacity: 0;
}

.overlap-pct:not(:empty) { opacity: 1; }
.overlap-pct.high { color: #00ff88; border-color: rgba(0,255,136,0.2); background: rgba(0,255,136,0.06); }
.overlap-pct.mid { color: #f0a040; border-color: rgba(240,160,64,0.2); background: rgba(240,160,64,0.06); }
.overlap-pct.low { color: rgba(200,214,229,0.3); }

/* --- Modal overlay --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.2s ease;
}

.modal-content {
  background: rgba(8,15,35,0.95); border: 1px solid rgba(0,240,255,0.15);
  border-radius: 20px; padding: 0; width: 90%; max-width: 520px; max-height: 80vh;
  overflow: hidden; box-shadow: 0 20px 80px rgba(0,0,0,0.5), 0 0 40px rgba(0,240,255,0.08);
  animation: popup-in 0.3s ease;
}

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

.modal-title {
  font-family: 'Orbitron', monospace; font-size: 12px;
  color: var(--cyan); letter-spacing: 2px; text-transform: uppercase;
}

.modal-close {
  background: none; border: none; color: rgba(200,214,229,0.4);
  font-size: 24px; cursor: pointer; transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover { color: #fff; }

.modal-body {
  padding: 20px 24px; overflow-y: auto; max-height: 60vh;
}

.mutual-stats {
  font-size: 13px; color: rgba(200,214,229,0.5); margin-bottom: 16px;
  text-align: center;
}

.mutual-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
}

.mutual-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; padding: 10px 6px; border-radius: 12px;
  transition: all 0.2s;
}

.mutual-card:hover { background: rgba(0,240,255,0.06); }

.mutual-avatar {
  width: 48px; height: 48px; border-radius: 12px; overflow: hidden;
  border: 2px solid rgba(0,240,255,0.12); background: #0c1631;
}

.mutual-avatar img { width: 100%; height: 100%; object-fit: cover; }

.mutual-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--cyan); font-size: 18px; font-family: 'Orbitron', monospace; opacity: 0.4;
}

.mutual-name {
  font-size: 11px; color: rgba(200,214,229,0.6); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 80px;
}

/* --- Rich profile modal --- */
.profile-modal { max-width: 580px; }

.pm-hero {
  display: flex; gap: 24px; margin-bottom: 20px;
}

.pm-avatar-full {
  width: 180px; height: 180px; flex-shrink: 0;
  border-radius: 16px; overflow: hidden;
  background: rgba(0,240,255,0.03);
  border: 1px solid rgba(0,240,255,0.1);
}

.pm-avatar-full img { width: 100%; height: 100%; object-fit: cover; }

.pm-details { flex: 1; min-width: 0; }

.pm-name { font-size: 22px; font-weight: 700; color: #fff; }

.pm-username { font-size: 13px; color: rgba(200,214,229,0.5); margin-top: 2px; }

.pm-bio {
  font-size: 12px; color: rgba(200,214,229,0.45); margin-top: 10px;
  line-height: 1.5; max-height: 60px; overflow: hidden;
}

.pm-meta-row {
  display: flex; gap: 16px; margin-top: 14px;
}

.pm-meta-item { display: flex; flex-direction: column; }

.pm-meta-val {
  font-family: 'Orbitron', monospace; font-size: 13px;
  font-weight: 700; color: var(--cyan);
}

.pm-meta-lbl {
  font-size: 9px; color: rgba(200,214,229,0.3);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.pm-profile-link {
  display: inline-block; margin-top: 14px;
  padding: 8px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff; font-size: 12px; font-weight: 700;
  font-family: 'Orbitron', monospace; text-decoration: none;
  letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.3s;
}

.pm-profile-link:hover {
  box-shadow: 0 0 20px rgba(0,240,255,0.3);
  transform: translateY(-1px);
}

.pm-section-title {
  font-family: 'Orbitron', monospace; font-size: 10px;
  color: var(--cyan); letter-spacing: 2px; opacity: 0.6;
  text-transform: uppercase; margin-bottom: 12px;
  border-top: 1px solid rgba(0,240,255,0.08);
  padding-top: 16px;
}

.pm-groups-scroll {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 200px; overflow-y: auto;
}

.pm-groups-scroll::-webkit-scrollbar { width: 3px; }
.pm-groups-scroll::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.15); border-radius: 2px; }

.pm-group {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(0,240,255,0.03);
  border: 1px solid rgba(0,240,255,0.06);
  transition: all 0.2s;
}

.pm-group:hover {
  border-color: rgba(0,240,255,0.15);
  background: rgba(0,240,255,0.06);
}

.pm-group-icon {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(0,240,255,0.1); flex-shrink: 0;
  background: #0c1631;
}

.pm-group-icon img { width: 100%; height: 100%; object-fit: cover; }

.pm-group-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--cyan); font-size: 16px; opacity: 0.3; font-family: 'Orbitron', monospace;
}

.pm-group-info { flex: 1; min-width: 0; }

.pm-group-name {
  font-size: 13px; font-weight: 600; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pm-group-meta {
  font-size: 11px; color: rgba(200,214,229,0.35); margin-top: 2px;
}

/* --- Famous distance results --- */
.famous-results {
  max-width: 500px; margin: 16px auto;
}

.famous-entry {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid rgba(0,240,255,0.08);
  margin-bottom: 8px; transition: all 0.2s;
}

.famous-entry:hover {
  border-color: rgba(0,240,255,0.2);
  background: rgba(0,240,255,0.04);
}

.famous-avatar {
  width: 42px; height: 42px; border-radius: 10px; overflow: hidden;
  border: 2px solid rgba(0,240,255,0.12); flex-shrink: 0;
  background: #0c1631;
}

.famous-avatar img { width: 100%; height: 100%; object-fit: cover; }

.famous-info { flex: 1; min-width: 0; }

.famous-name {
  font-size: 14px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.famous-username { font-size: 11px; color: rgba(200,214,229,0.4); }

.famous-degrees {
  font-family: 'Orbitron', monospace; font-size: 28px; font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.famous-degrees span { font-size: 14px; }

/* --- 3D Graph inline card --- */
.graph3d-card {
  background: var(--card-bg);
  border: 1px solid rgba(0,240,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  animation: fade-in 0.4s ease;
  margin-top: 20px;
}

.graph3d-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(0,240,255,0.08);
}

.graph3d-title {
  font-family: 'Orbitron', monospace; font-size: 12px;
  color: var(--cyan); letter-spacing: 3px;
}

.graph3d-controls { display: flex; align-items: center; gap: 10px; }

.graph3d-info {
  font-family: 'Orbitron', monospace; font-size: 11px;
  color: rgba(0,240,255,0.4);
}

.graph3d-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.12);
  color: var(--cyan); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.graph3d-btn:hover {
  background: rgba(0,240,255,0.12); border-color: var(--cyan);
}

.graph3d-card-desc {
  padding: 12px 20px 0;
}

.graph3d-card-desc p {
  font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.5;
  margin: 0 0 10px;
}

.graph3d-legend {
  display: flex; flex-wrap: wrap; gap: 14px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,240,255,0.06);
}

.graph3d-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
}

.graph3d-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}

.graph3d-card-canvas {
  width: 100%;
  height: 400px;
  overflow: hidden;
  cursor: grab;
}

.graph3d-card-canvas canvas { display: block; }

/* 3D Graph tooltip */
.graph3d-tooltip {
  position: fixed; z-index: 500;
  background: rgba(6, 12, 24, 0.95);
  border: 1px solid rgba(0,240,255,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  pointer-events: none;
  backdrop-filter: blur(12px);
  min-width: 140px;
  max-width: 220px;
  animation: fade-in 0.15s ease;
}

.g3t-role {
  font-family: 'Orbitron', monospace; font-size: 9px; letter-spacing: 2px;
  margin-bottom: 4px; font-weight: 700;
}
.g3t-role.start { color: #00f0ff; }
.g3t-role.end { color: #a855f7; }
.g3t-role.path { color: #00ff88; }
.g3t-role.friend { color: #556; }
.g3t-role.mutual { color: #f59e0b; }

.g3t-name {
  font-size: 14px; font-weight: 700; color: #fff;
}

.g3t-username {
  font-size: 11px; color: rgba(255,255,255,0.35); margin-bottom: 6px;
}

.g3t-stat {
  font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.6;
}

.g3t-desc {
  font-size: 11px; color: rgba(255,255,255,0.35); line-height: 1.4;
}

.graph3d-privacy-notice {
  padding: 10px 20px;
  background: rgba(245, 158, 11, 0.06);
  border-left: 3px solid rgba(245, 158, 11, 0.4);
  margin: 0;
}

.graph3d-privacy-notice span {
  display: block;
  font-size: 11px;
  color: rgba(245, 158, 11, 0.8);
  line-height: 1.5;
  padding: 4px 0;
}

.graph3d-privacy-notice strong {
  color: rgba(245, 158, 11, 1);
}

.graph3d-loading {
  text-align: center; padding: 8px;
  font-size: 11px; color: rgba(0,240,255,0.4);
  font-family: 'Orbitron', monospace; letter-spacing: 1px;
  animation: pulse-glow 1.5s ease infinite;
}

/* --- Footer links --- */
.footer-links {
  display: flex; justify-content: center; gap: 20px;
  padding: 30px 0 10px;
}

.footer-links a {
  font-size: 11px; color: rgba(255,255,255,0.2);
  text-decoration: none; transition: color 0.2s;
}

.footer-links a:hover { color: var(--cyan); }

.copyright {
  text-align: center; padding: 8px 0 20px;
  font-size: 10px; color: rgba(255,255,255,0.12);
  letter-spacing: 0.5px;
}

/* --- Ad Gate Overlay --- */
.ad-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(3, 8, 18, 0.95);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fade-in 0.3s ease;
  backdrop-filter: blur(10px);
}

.ad-overlay-header {
  text-align: center; margin-bottom: 16px;
}

.ad-overlay-title {
  font-family: 'Orbitron', monospace; font-size: 13px;
  color: var(--cyan); letter-spacing: 4px;
  display: block; margin-bottom: 6px;
}

.ad-overlay-sub {
  font-size: 12px; color: rgba(255,255,255,0.3);
}

.ad-overlay-player {
  width: 90%; max-width: 700px;
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.06);
}

/* Override AppLixir player to stay inside our wrapper */
#applixir-video-container {
  width: 100%;
  min-height: 400px;
  background: #0a0f1a;
  position: relative;
}

/* Force AppLixir backdrop into our container instead of fixed fullscreen */
.applixir-backdrop,
#videoplayer-container {
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
  border-radius: 0 0 14px 14px;
}

/* Our overlay must be above everything */
.ad-overlay {
  z-index: 2000 !important;
}

/* --- Ad Blocker Notice --- */
.adblocker-notice {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(3, 8, 18, 0.95);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.3s ease;
  backdrop-filter: blur(10px);
}

.adblocker-modal {
  text-align: center; padding: 40px;
  background: var(--card-bg);
  border: 1px solid rgba(240, 80, 80, 0.2);
  border-radius: 18px;
  max-width: 400px;
  box-shadow: 0 0 40px rgba(240, 80, 80, 0.08);
}

.adblocker-icon { font-size: 48px; margin-bottom: 16px; }

.adblocker-title {
  font-family: 'Orbitron', monospace; font-size: 16px;
  color: #f05050; letter-spacing: 2px; margin-bottom: 12px;
}

.adblocker-text {
  font-size: 13px; color: rgba(255,255,255,0.5);
  line-height: 1.6; margin-bottom: 24px;
}

.adblocker-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border: none; border-radius: 12px;
  color: #fff; font-family: 'Orbitron', monospace;
  font-size: 12px; letter-spacing: 2px;
  cursor: pointer; transition: all 0.3s;
}

.adblocker-btn:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.adblocker-bug-link {
  display: block; margin-top: 16px;
  font-size: 11px; color: rgba(255,255,255,0.2);
  text-decoration: underline;
  transition: color 0.2s;
}

.adblocker-bug-link:hover {
  color: rgba(255,255,255,0.4);
}

@media (max-width: 500px) {
  .input-row { flex-direction: column; }
  .swap-btn { align-self: center; transform: rotate(90deg); }
  .swap-btn:hover { transform: rotate(270deg); }
  .path-card { max-width: 100%; }
  .header h1 { font-size: 22px; }
  .profile-popup { width: 260px; }
}
