/* ============================================ */
/* SIYNET — Premium Dark Design System          */
/* ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.08);
  --bg-glass: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-active: rgba(255,255,255,0.2);
  --text-primary: #f0f0f5;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;
  --accent-1: #7c3aed;
  --accent-2: #a855f7;
  --accent-3: #c084fc;
  --gradient-main: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #fde68a 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.15);
}

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

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; width: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* === Background Ambient Glow === */
body::before {
  content: '';
  position: fixed;
  top: -20%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%; right: -10%;
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* === Layout === */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  filter: drop-shadow(0 0 12px rgba(168,85,247,0.3));
}

.logo-text {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 30%, #06b6d4 60%, #a855f7 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.5px;
  font-size: 1.2rem;
  animation: logoShimmer 4s linear infinite;
}

@keyframes logoShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.logo-version {
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(168,85,247,0.5);
  letter-spacing: 1px;
  align-self: flex-start;
  margin-top: 2px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.free-counter {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.free-counter b { color: var(--accent-2); }

/* Telegram Auth */
.tg-login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0088cc, #00aaff);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
}
.tg-login-btn:hover { filter: brightness(1.15); transform: scale(1.03); }

.tg-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  padding: 5px 14px 5px 5px;
  border-radius: 24px;
  border: 1px solid var(--border);
}
.tg-profile img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.tg-profile-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.tg-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.tg-logout:hover { opacity: 1; color: #ef4444; }

/* === Glass Card === */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
}
.glass-card:hover { border-color: var(--border-active); box-shadow: var(--shadow-glow); }

/* === Input Section === */
.input-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.person-card { position: relative; }
.person-card .card-label {
  position: absolute;
  top: -10px; left: 20px;
  background: var(--accent-1);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  outline: none;
}
.form-group input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.form-group input::placeholder { color: var(--text-muted); }

/* Profile Select (Person A) */
.profile-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.profile-select {
  flex: 1;
  min-width: 0;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.profile-select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(168,85,247,0.15); }
.profile-select option { background: #1a1a2e; color: #e0e0e0; }
.profile-add-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-2);
  background: rgba(168,85,247,0.08);
  color: var(--accent-2);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-add-btn:hover { background: rgba(168,85,247,0.2); border-style: solid; }
.new-profile-form {
  animation: fadeUp 0.3s ease;
  margin-top: 8px;
}

/* === Profile Preview === */
.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(124,58,237,0.08);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  min-height: 48px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.profile-preview.active { color: var(--text-primary); }
.profile-preview .code {
  font-family: 'Outfit', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-3);
}

/* === Category Selector === */
.category-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.cat-selector-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.cat-select {
  min-width: 160px;
  padding: 10px 32px 10px 14px !important;
  border-radius: 30px !important;
  font-size: 0.9rem !important;
}

/* === Action Button === */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}
.btn-primary:hover::after { left: 100%; }

/* === Results === */
.results-section { display: none; margin-bottom: 40px; }
.results-section.visible { display: block; animation: fadeUp 0.5s ease; }

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

/* Gauge */
.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  margin-bottom: 24px;
}

.gauge-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 16px;
}

.gauge-ring canvas { width: 200px; height: 200px; }

.gauge-percent {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}
.gauge-percent small { font-size: 1.5rem; font-weight: 400; opacity: 0.6; }

.gauge-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.gauge-desc { font-size: 0.85rem; color: var(--text-secondary); text-align: center; max-width: 400px; }

/* Direction block header */
.direction-block { margin-bottom: 16px; }
.dir-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.dir-block-from, .dir-block-to {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.dir-block-arrow {
  font-size: 1.2rem;
  color: var(--accent-2);
}
.dir-block-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-left: auto;
}
.dir-block-tier {
  font-size: 0.8rem;
  color: var(--text-secondary);
}


/* Layers breakdown — full-width cards with descriptions */
.layers-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.layer-card-full {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all 0.3s ease;
}
.layer-card-full:hover { border-color: var(--border-active); box-shadow: var(--shadow-glow); }

.layer-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.layer-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.layer-card-info {
  flex: 1;
}
.layer-card-info .layer-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.layer-card-info .layer-name .layer-sub {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.layer-card-info .layer-type {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 2px;
}
.layer-card-header .layer-score {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
}
.layer-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Overall gauge description */
.gauge-overall-desc {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  max-width: 500px;
}

/* Radar Chart */
.radar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.radar-container canvas { max-width: 300px; max-height: 300px; }

/* Pros & Cons */
.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.pros-card, .cons-card { padding: 20px; }
.pros-card h3, .cons-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pros-card h3 { color: var(--green); }
.cons-card h3 { color: var(--red); }

.pros-card li, .cons-card li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
  list-style: none;
  padding-left: 20px;
  position: relative;
}
.pros-card li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.cons-card li::before { content: '✗'; position: absolute; left: 0; color: var(--red); font-weight: 700; }

/* Multiplier badge */
.multiplier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.multiplier-badge.golden { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.multiplier-badge.redflag { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* Result Action Buttons */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}
.action-btn:hover { border-color: var(--accent-2); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.action-pdf { border-color: rgba(239,68,68,0.3); }
.action-pdf:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.5); }
.action-share { border-color: rgba(124,58,237,0.3); }
.action-share:hover { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.5); }
.action-support { border-color: rgba(16, 185, 129, 0.3); }
.action-support:hover { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.5); }

/* === History Sidebar === */
.history-section {
  margin-bottom: 40px;
}
.history-section h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}
.history-item:hover { border-color: var(--accent-2); background: var(--bg-card-hover); }

.history-percent {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 45px;
  text-align: right;
}
.history-names { color: var(--text-primary); font-weight: 500; }
.history-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.history-delete {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
}
.history-delete:hover { color: var(--red); }

/* === Ranking Table === */
.ranking-section { margin-bottom: 40px; }
.ranking-section h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.ranking-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
.ranking-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.ranking-table tr { transition: background 0.2s; }
.ranking-table tbody tr:hover { background: var(--bg-card-hover); }

.rank-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-card);
  overflow: hidden;
  min-width: 80px;
}
.rank-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}
.footer p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }

/* === Paywall Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.visible { display: flex; }

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  max-width: 380px;
  width: 92%;
  text-align: center;
  animation: fadeUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
}
.modal-content .btn-primary {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.modal-content .modal-close {
  display: inline-block;
  margin-top: 8px;
}
.modal-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.modal-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.6;
}
.modal-price {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}
.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 12px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* === Edit Name Button (pencil in ranking) === */
.edit-name-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.4;
  transition: all 0.2s;
}
.edit-name-btn:hover { opacity: 1; background: var(--bg-card-hover); }

/* Clickable ranking rows */
.rank-row-clickable { cursor: pointer; }
.rank-row-clickable:hover { background: rgba(124,58,237,0.08) !important; }

/* Combined profile column */
.profile-compact {
  font-family: 'Outfit', monospace;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent-3);
  cursor: help;
  white-space: nowrap;
}

/* === Report Popup === */
.report-popup-content {
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  text-align: left;
}
.report-popup-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 2;
  padding: 4px 8px;
}
.report-popup-close:hover { color: var(--text-primary); }

.popup-direction {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.popup-dir-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.popup-dir-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}
.popup-dir-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}
.popup-dir-tier {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.popup-layer {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.04);
}
.popup-layer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.popup-layer-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Popup Category Tabs */
.popup-cat-tab {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.popup-cat-tab:hover { border-color: var(--accent-2); color: var(--text-primary); }
.popup-cat-tab.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
}

/* Ranking title */
.ranking-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .input-section { grid-template-columns: 1fr; }
  .proscons { grid-template-columns: 1fr; }
  .header { flex-direction: column; gap: 12px; }
  .logo { font-size: 1.5rem; }
  .gauge-ring { width: 160px; height: 160px; }
  .gauge-ring canvas { width: 160px; height: 160px; }
  .gauge-percent { font-size: 2.8rem; }
  .ranking-table { font-size: 0.7rem; }
  .ranking-table th, .ranking-table td { padding: 8px 6px; }
  .layer-card-full { padding: 16px; }
  .layer-card-header .layer-score { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .category-tabs { justify-content: center; }
  .glass-card { padding: 16px; }
  .layer-card-header { gap: 10px; }
  .layer-card-icon { font-size: 1.2rem; }
  .layer-card-header .layer-score { font-size: 1.3rem; }
}

/* Calculation Overlay */
.calc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,10,26,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}
.calc-overlay.visible { opacity: 1; }
.calc-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(168,85,247,0.2);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.calc-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.calc-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Rank category selector */
.rank-cat-select {
  border-radius: 20px !important;
}
.rank-tier-label {
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 2px;
  opacity: 0.85;
}
.rank-cat-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px dashed var(--accent-2);
  background: transparent;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
  transition: all 0.2s ease;
}
.rank-cat-plus:hover { background: rgba(168,85,247,0.15); border-style: solid; }
.rank-cat-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeUp 0.2s ease;
}
.rank-cat-option {
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
}
.rank-cat-option:hover { background: rgba(168,85,247,0.15); }

/* Grouped rows (same person, multiple categories) */
.rank-group-first td { border-bottom: none !important; padding-bottom: 4px !important; }
.rank-group-cont td { border-top: none !important; padding-top: 4px !important; }
.rank-group-cont { opacity: 0.9; }
.rank-group-cont td:first-child { border-left: 2px solid var(--accent-2); }
.rank-group-last td { border-bottom: 2px solid rgba(168,85,247,0.3) !important; }

/* Ranking Filter Bar */
.rank-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rank-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.rank-filter-btn:hover {
  border-color: var(--accent-2);
  color: var(--text-primary);
}
.rank-filter-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(99,102,241,0.25));
  border-color: var(--accent-2);
  color: #fff;
  font-weight: 600;
}

/* Hide name/profile in grouped rows */
.name-hidden > * { visibility: hidden; height: 0; overflow: hidden; }
.name-hidden { padding-top: 0 !important; padding-bottom: 0 !important; }

/* === Date Selects === */
.date-selects { display:flex; gap:8px; }
.date-input {
  flex:1; padding:12px 8px; border-radius:10px; border:1px solid rgba(255,255,255,0.15);
  background:var(--card-bg); color:var(--text-primary); font-size:1.1rem;
  text-align:center; font-family:'Inter',sans-serif; font-weight:500;
  transition: border-color 0.2s; width:100%; min-width:0;
}
.date-input-year { flex:1.5; }
.date-input:focus { border-color:var(--accent); outline:none; box-shadow: 0 0 0 2px rgba(168,85,247,0.2); }
.date-input::placeholder { color:var(--text-muted); font-weight:400; font-size:0.9rem; }

/* === Extra Fields (collapsible) === */
.extra-fields { margin-top:8px; }
.extra-fields summary {
  cursor:pointer; color:var(--text-muted); font-size:0.8rem;
  padding:4px 0; user-select:none;
}
.extra-fields summary:hover { color:var(--accent); }

/* === Gender Toggle === */
.gender-toggle { display:flex; gap:4px; }
.gender-btn {
  flex:1; padding:6px 0; border:1px solid rgba(255,255,255,0.15); border-radius:8px;
  background:transparent; color:var(--text-muted); font-size:0.95rem; font-weight:500; cursor:pointer;
  transition: all 0.2s;
}
.gender-btn.active { background:rgba(168,85,247,0.25); border-color:#a855f7; color:#fff; }
.gender-btn:hover { border-color:#a855f7; }

/* === Mobile Responsive === */
@media (max-width: 600px) {
  .header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
  }
  .header-meta {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: center;
  }
  .logo {
    font-size: 1.2rem;
    gap: 5px;
  }
  .logo-text {
    font-size: 0.95rem;
    letter-spacing: 0.8px;
  }
  .logo-version {
    font-size: 0.45rem;
  }
  .tg-login-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
  }
  .free-counter {
    font-size: 0.7rem;
    padding: 4px 10px;
  }
  .rank-filter-bar {
    gap: 4px;
  }
  .rank-filter-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  .ranking-title {
    font-size: 1.1rem !important;
  }
  .glass-card {
    padding: 12px !important;
  }
}

/* === About Method Button === */
.about-method-btn {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: #c084fc;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.about-method-btn:hover {
  background: rgba(124,58,237,0.3);
  border-color: rgba(124,58,237,0.6);
}
.install-btn {
  background: rgba(0,200,83,0.15);
  border: 1px solid rgba(0,200,83,0.3);
  color: #69f0ae;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.install-btn:hover {
  background: rgba(0,200,83,0.3);
  border-color: rgba(0,200,83,0.6);
}

/* === About Modal === */
.about-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.about-modal {
  background: #16161e;
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  position: relative;
  margin: 20px auto;
  animation: aboutSlideIn 0.3s ease;
}
@keyframes aboutSlideIn {
  from { opacity:0; transform: translateY(30px); }
  to { opacity:1; transform: translateY(0); }
}
.about-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}
.about-modal-close:hover {
  background: rgba(255,82,82,0.2);
  color: #ff5252;
}
.about-modal-content {
  padding: 32px 24px 24px;
}
.about-modal-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  color: #c084fc;
  margin: 0 0 8px;
}
.about-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0 0 24px;
  line-height: 1.5;
}
.about-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.about-section.about-final {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.2);
}
.about-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.about-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  color: #e2e8f0;
  margin: 0 0 8px;
}
.about-section p {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 6px;
}
.about-source {
  font-size: 0.75rem !important;
  color: #64748b !important;
  font-style: italic;
}
.about-modal-close-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--gradient-main);
  border: none;
  border-radius: 12px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.about-modal-close-btn:hover {
  opacity: 0.85;
}

@media (max-width: 600px) {
  .about-modal {
    border-radius: 16px;
    margin: 10px;
  }
  .about-modal-content {
    padding: 24px 16px 16px;
  }
  .about-modal-content h2 {
    font-size: 1.2rem;
  }
}

.buy-pro-btn { background: linear-gradient(135deg,#a855f7,#6366f1); color: #fff; border: none; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(168,85,247,0.3); white-space: nowrap; }
.buy-pro-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(168,85,247,0.4); }

/* === Timeline Graph === */
.timeline-container {
  width: 100%;
  height: 200px;
  position: relative;
  margin-top: 10px;
}
.timeline-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.timeline-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.timeline-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.timeline-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-cs::before { background: #8b5cf6; }
.legend-mission::before { background: #ec4899; }
.legend-current::before { background: #fbbf24; border-radius: 2px !important; width: 4px !important; height: 12px !important; }

/* === Astro Synergy === */
.astro-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.astro-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.astro-emoji {
  font-size: 1.5rem;
}
.astro-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.astro-aspect {
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.astro-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Blur Overlay Styles */
.blurred-layers-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-top: 12px;
}
.blurred-content {
  filter: blur(5px);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}
.blur-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.7);
  padding: 20px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.blur-overlay .blur-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}
.blur-overlay .blur-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.blur-overlay .blur-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 16px;
  line-height: 1.4;
}
