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

:root {
  --bg: #0f0f1a;
  --card: #1a1a2e;
  --card2: #16213e;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --text: #e2e8f0;
  --sub: #94a3b8;
  --border: rgba(255,255,255,0.08);
  --radius: 14px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, 'Noto Sans KR', sans-serif; }

#app { display: flex; flex-direction: column; height: 100vh; max-width: 480px; margin: 0 auto; }

.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.user-handle { font-size: 0.8rem; color: var(--sub); }

.content { flex: 1; overflow-y: auto; padding-bottom: 80px; }
.tab-panel { display: none; padding: 20px 16px; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.onboarding-header { margin-bottom: 20px; }
.sub-label { font-size: 0.85rem; color: var(--sub); margin-bottom: 12px; }
.progress-area { margin-top: 8px; }
.progress-text { font-size: 0.85rem; color: var(--sub); margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.4s ease; }

.add-form { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.75rem; color: var(--sub); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 0.9rem; outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
select option { background: #1a1a2e; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-btn { display: flex; align-items: center; gap: 4px; font-size: 0.82rem; cursor: pointer; padding: 5px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); transition: all 0.15s; }
.radio-btn:has(input:checked) { background: var(--accent); border-color: var(--accent); color: white; }
.radio-btn input { display: none; }

.btn-primary { width: 100%; padding: 12px; background: var(--accent); color: white; border: none; border-radius: 10px; font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s; margin-top: 4px; }
.btn-primary:hover { opacity: 0.85; }

.places-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.place-card { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--border); }
.place-info { flex: 1; min-width: 0; }
.place-name { font-size: 0.9rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { font-size: 0.7rem; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,0.07); color: var(--sub); }
.tag.cat { background: rgba(124,58,237,0.2); color: #a78bfa; }
.tag.time { background: rgba(6,182,212,0.2); color: #67e8f9; }
.tag.freq { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.btn-delete { background: none; border: none; color: var(--sub); cursor: pointer; font-size: 1rem; padding: 4px; }
.btn-delete:hover { color: var(--red); }

.btn-match { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-match:disabled { background: var(--border); color: var(--sub); cursor: not-allowed; }
.btn-match:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124,58,237,0.3); }

/* Radius Tab */
.radius-summary { background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(6,182,212,0.2)); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; font-size: 0.95rem; font-weight: 600; color: var(--text); border: 1px solid rgba(124,58,237,0.3); }
.radius-section { margin-bottom: 20px; }
.radius-section h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sub); margin-bottom: 12px; }
.neighborhood-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.neighborhood-tag { padding: 6px 12px; border-radius: 99px; background: rgba(6,182,212,0.15); border: 1px solid rgba(6,182,212,0.3); color: #67e8f9; font-size: 0.82rem; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label { font-size: 0.82rem; width: 90px; flex-shrink: 0; color: var(--sub); }
.bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar-track.sm { height: 6px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; transition: width 0.5s ease; }
.bar-fill.cat { background: linear-gradient(90deg, var(--accent), #a855f7); }
.bar-fill.purple { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.bar-pct { font-size: 0.75rem; color: var(--sub); width: 36px; text-align: right; }

/* Match Tab */
.match-lock { text-align: center; padding: 60px 20px; }
.lock-icon { font-size: 3rem; margin-bottom: 16px; }
.match-lock p { color: var(--sub); font-size: 0.95rem; line-height: 1.6; }
.match-lock strong { color: var(--accent); }
.loading { text-align: center; padding: 40px; color: var(--sub); }
.match-card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; border: 1px solid var(--border); transition: border-color 0.2s; }
.match-card:hover { border-color: rgba(124,58,237,0.3); }
.match-card.acted { opacity: 0.7; }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.match-handle { font-size: 0.95rem; font-weight: 600; }
.match-score-big { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.match-score-big span { font-size: 0.9rem; color: var(--sub); }
.match-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.match-bar-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--sub); }
.match-bar-row > span:first-child { width: 55px; flex-shrink: 0; }
.match-bar-row > span:last-child { width: 34px; text-align: right; }
.shared-hoods { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.match-actions { display: flex; gap: 8px; }
.btn-interest, .btn-pass { flex: 1; padding: 10px; border: none; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-interest { background: rgba(124,58,237,0.2); color: #a78bfa; border: 1px solid rgba(124,58,237,0.4); }
.btn-interest:hover { background: rgba(124,58,237,0.4); }
.btn-pass { background: rgba(255,255,255,0.05); color: var(--sub); }
.btn-pass:hover { background: rgba(255,255,255,0.1); }
.acted-label { font-size: 0.82rem; color: var(--sub); padding: 8px 0; }
.acted-label.passed { color: var(--red); opacity: 0.6; }

/* Interest Tab */
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.interest-card { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 10px; padding: 14px 16px; margin-bottom: 8px; border: 1px solid var(--border); }
.interest-handle { font-weight: 600; }
.interest-label { font-size: 0.82rem; color: #a78bfa; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: var(--card); border-top: 1px solid var(--border); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0; background: none; border: none; color: var(--sub); cursor: pointer; font-size: 0.68rem; transition: color 0.15s; }
.nav-btn.active { color: var(--accent); }
.nav-icon { font-size: 1.3rem; }

/* Toast */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 10px 20px; border-radius: 99px; font-size: 0.85rem; z-index: 99; transition: opacity 0.3s; white-space: nowrap; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.hidden { opacity: 0; pointer-events: none; }

.empty-msg { color: var(--sub); font-size: 0.9rem; text-align: center; padding: 30px 0; line-height: 1.6; }
