@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

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

/* Author-origin display rules below (.controls, .chat-panel, .modal-overlay,
   etc.) always beat the browser's default [hidden]{display:none} UA rule,
   regardless of selector specificity — so every element toggled via the
   `hidden` attribute in app.js needs this restated explicitly, or it stays
   visible no matter what JS sets. */
[hidden] { display: none !important; }

:root {
  --ink:        #0b0e14;
  --panel:      #12151f;
  --panel-2:    #171b28;
  --border:     #232838;
  --text:       #eef0f5;
  --muted:      #8a90a3;
  --accent:     #2dd4bf;
  --accent-d:   #14b8a6;
  --danger:     #f87171;
  --danger-soft:#3a1f24;
  --radius:     16px;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: none;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #04201c; }
.btn-primary:hover { background: var(--accent-d); }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--panel-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: var(--danger); color: #2a0a0a; }
.btn-danger:hover { opacity: .88; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1.5px solid rgba(248,113,113,.35); }
.btn-danger-outline:hover { background: var(--danger-soft); }

/* ── Brand ── */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand-tagline { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 18px; }

/* ── Consent gate ── */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 34px 30px; }
.gate-card h1 { font-size: 24px; font-weight: 800; margin: 18px 0 10px; letter-spacing: -.01em; }
.gate-sub { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 18px; }
.gate-rules { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.gate-rules li { font-size: 13.5px; line-height: 1.5; color: #c7cbd8; padding-left: 20px; position: relative; }
.gate-rules li::before { content: "•"; color: var(--accent); position: absolute; left: 0; font-weight: 800; }
.gate-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); margin-bottom: 18px; cursor: pointer; }
.gate-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── Doc page (Terms) ── */
.doc-page { max-width: 640px; margin: 0 auto; padding: 40px 24px 80px; }
.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: 20px; }
.doc-page h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.doc-updated { color: var(--muted); font-size: 12px; margin-bottom: 28px; }
.doc-page h2 { font-size: 15px; font-weight: 700; margin: 26px 0 8px; color: var(--accent); }
.doc-page p, .doc-page li { font-size: 14px; line-height: 1.7; color: #c7cbd8; }
.doc-page ul { padding-left: 20px; }

/* ── Friends & DMs ── */
.add-friend-form { display: flex; gap: 8px; margin-bottom: 8px; }
.add-friend-form input {
  flex: 1; background: var(--panel-2); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 13px; color: var(--text); font-family: inherit; font-size: 14px;
}
.add-friend-form input:focus { outline: none; border-color: var(--accent); }
.friend-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.friend-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.friend-actions { display: flex; align-items: center; gap: 12px; }

.dm-thread {
  display: flex; flex-direction: column; gap: 8px; margin: 20px 0;
  max-height: 55vh; overflow-y: auto; padding-right: 4px;
}
.dm-bubble {
  max-width: 75%; padding: 9px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  word-wrap: break-word;
}
.dm-mine { align-self: flex-end; background: var(--accent); color: #04201c; border-bottom-right-radius: 4px; }
.dm-theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.dm-form { display: flex; gap: 8px; }
.dm-form input {
  flex: 1; background: var(--panel-2); border: 1.5px solid var(--border); border-radius: 999px;
  padding: 11px 16px; color: var(--text); font-family: inherit; font-size: 14px;
}
.dm-form input:focus { outline: none; border-color: var(--accent); }

.history-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
}
.history-main { display: flex; flex-direction: column; gap: 3px; }
.history-name { font-size: 14px; font-weight: 600; }
.history-meta { font-size: 12px; color: var(--muted); text-transform: capitalize; }

/* ── App shell ── */
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: 0 20px; }
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.link-muted { color: var(--muted); font-size: 13px; text-decoration: none; font-weight: 600; }
.header-links { display: flex; align-items: center; gap: 18px; }
.inline-form { display: inline; }
.link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--text); }

/* ── Auth forms (register/login) ── */
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 34px 30px; }
.auth-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 22px; letter-spacing: -.01em; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.auth-field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-field input {
  background: var(--panel-2); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 13px; color: var(--text); font-family: inherit; font-size: 14px;
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-error { background: var(--danger-soft); color: var(--danger); font-size: 13px; padding: 10px 13px; border-radius: 10px; margin-bottom: 16px; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 20px 0 40px; }

.status-ring {
  width: 128px; height: 128px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1.5px solid var(--border);
  transition: border-color .3s, box-shadow .3s;
}
.status-ring-inner { color: var(--muted); transition: color .3s; }
.status-ring.ring-searching {
  border-color: var(--accent);
  animation: pulse-ring 1.6s ease-in-out infinite;
}
.status-ring.ring-searching .status-ring-inner { color: var(--accent); }
.status-ring.ring-live { border-color: var(--accent); box-shadow: 0 0 0 6px rgba(45,212,191,.12); }
.status-ring.ring-live .status-ring-inner { color: var(--accent); }
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45,212,191,.25); }
  50% { box-shadow: 0 0 0 14px rgba(45,212,191,0); }
}

.status-text { font-size: 17px; font-weight: 700; }
.status-sub { font-size: 13px; color: var(--muted); min-height: 18px; }

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

/* ── Match preferences (mode / country / interests) ── */
.prefs-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 6px; width: 100%; max-width: 420px; }

.mode-toggle { display: flex; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; }
.mode-btn {
  border: none; background: transparent; color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s;
}
.mode-btn.active { background: var(--accent); color: #04201c; }

.pref-select {
  width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; color: var(--text); font-family: inherit; font-size: 13.5px; outline: none;
}
.pref-select:focus { border-color: var(--accent); }

.pref-row { display: flex; gap: 10px; width: 100%; }
.pref-row .pref-select { width: auto; flex: 1; min-width: 0; }

.tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag-chip {
  border: 1.5px solid var(--border); background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.tag-chip.active { background: var(--accent); border-color: var(--accent); color: #04201c; }
.tag-chip:hover:not(.active) { border-color: var(--accent); color: var(--text); }

/* ── Chat panel ── */
.chat-panel { display: flex; flex-direction: column; height: 260px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-row { font-size: 13.5px; line-height: 1.5; }
.chat-who { font-weight: 700; color: var(--muted); margin-right: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.chat-row.mine .chat-who { color: var(--accent); }
.chat-text { color: var(--text); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; color: var(--text); font-family: inherit; font-size: 13.5px; outline: none;
}
.chat-form input:focus { border-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3,5,10,.7); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 20;
}
.modal-box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.modal-box h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.modal-sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.modal-box textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 13.5px; outline: none; resize: vertical;
  margin-bottom: 16px;
}
.modal-box textarea:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

@media (max-width: 480px) {
  .status-ring { width: 104px; height: 104px; }
  .controls { gap: 8px; }
  .btn { padding: 9px 16px; font-size: 13px; }
}
