/* PicMe Stage 1 mockup — "Neon Nightlife" design system */

:root {
  --bg: #0a0a0f;
  --bg-deep: #12030f;
  --purple-1: #1a0a2e;
  --purple-2: #3b0a52;
  --pink: #ff2d92;
  --violet: #7b2ff7;
  --accent-grad: linear-gradient(90deg, var(--pink), var(--violet));
  --score: #ff6fb5;
  --text: #ffffff;
  --text-muted: #8a8494;
  --card-bg: #15101c;
  --card-border: #2a1f35;
  --danger: #ff4d4d;
  --radius: 16px;
  --nav-h: 66px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

a { color: inherit; }

.logo-wordmark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-wordmark.small { font-size: 18px; }
.accent-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Screens / layout shell ---------- */
.screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen[hidden] { display: none; }

#app-shell { position: fixed; inset: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  z-index: 5;
}
.topbar-transparent {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0; left: 0; right: 0;
}
.screen-title { font-size: 17px; font-weight: 700; margin: 0; }

.icon-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ---------- Overlays: age gate / auth ---------- */
.screen-overlay {
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 50% 0%, var(--purple-2) 0%, var(--purple-1) 45%, var(--bg-deep) 100%);
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.gate-copy { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin: 0; }
.gate-checkbox {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; text-align: left; color: var(--text);
  background: rgba(255,255,255,0.06);
  padding: 12px 14px; border-radius: 12px;
}
.gate-checkbox.small { font-size: 12px; padding: 10px 12px; }
.gate-checkbox input { width: 18px; height: 18px; accent-color: var(--pink); }
.fine-print { font-size: 11px; color: var(--text-muted); margin: 6px 0 0; }

.auth-tabs { display: flex; gap: 8px; background: rgba(255,255,255,0.06); padding: 4px; border-radius: 12px; }
.auth-tab { flex: 1; background: none; border: none; padding: 9px; border-radius: 9px; color: var(--text-muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.auth-tab.active { background: var(--accent-grad); color: #fff; }

#auth-form { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  border: none;
  border-radius: 24px;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 20px rgba(255,45,146,0.35); }
.btn-primary:disabled { opacity: 0.4; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); }
.btn-secondary { background: var(--card-bg); border: 1px solid var(--card-border); color: var(--text); }

.input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}
.input::placeholder { color: var(--text-muted); }
.textarea { min-height: 90px; resize: vertical; }

/* ---------- Feed ---------- */
.feed-scroller {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed-scroller::-webkit-scrollbar { display: none; }

.post-card {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #000;
}
.post-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.post-bg.blurred { filter: blur(26px) brightness(0.55) saturate(1.1); transform: scale(1.15); }
.post-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.75) 100%);
}

.post-lock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px; z-index: 2;
}
.post-lock .lock-icon { font-size: 34px; }
.post-lock .lock-text { font-size: 13px; color: var(--text); opacity: 0.9; }

.post-caption {
  position: relative; z-index: 2;
  padding: 18px 78px 26px 16px;
  width: 100%;
}
.post-handle { font-weight: 800; font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.post-text { font-size: 13px; color: rgba(255,255,255,0.9); }

.post-sidebar {
  position: absolute; right: 10px; bottom: 90px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.post-sidebar button {
  background: none; border: none; color: #fff; font-size: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
}
.post-sidebar button span.count { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.post-sidebar .avatar-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--pink);
  background-size: cover; background-position: center;
  margin-bottom: 4px; cursor: pointer;
}

/* ---------- Rankings ---------- */
.rk-filters {
  display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
  flex-shrink: 0;
}
.rk-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.rk-chip.active { background: var(--accent-grad); border: none; color: #fff; }

.rk-list { flex: 1; overflow-y: auto; padding: 4px 16px 90px; }
.rk-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
}
.rk-row .rk-n { width: 22px; font-weight: 800; color: var(--text-muted); font-size: 14px; }
.rk-row .rk-avatar { width: 40px; height: 40px; border-radius: 50%; background-size: cover; background-position: center; }
.rk-row .rk-name { flex: 1; min-width: 0; }
.rk-row .rk-name .h { font-weight: 700; font-size: 14px; }
.rk-row .rk-name .loc { font-size: 11px; color: var(--text-muted); }
.rk-row .rk-score { color: var(--score); font-weight: 800; font-size: 14px; }

/* ---------- Profile ---------- */
.profile-cover { height: 130px; background: linear-gradient(120deg, var(--purple-2), var(--pink)); }
.profile-header { padding: 0 18px; margin-top: -36px; position: relative; z-index: 2; }
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  border: 4px solid var(--bg);
  background-size: cover; background-position: center;
}
.profile-name { font-size: 18px; font-weight: 800; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.profile-rank-badge {
  font-size: 11px; font-weight: 800; color: var(--score);
  background: rgba(255,45,146,0.15); padding: 3px 9px; border-radius: 8px;
}
.profile-bio { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile-stats { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.profile-stats strong { color: var(--text); font-size: 13px; }
.profile-actions { display: flex; gap: 8px; margin-top: 14px; }
.profile-actions .btn { flex: 1; padding: 11px; font-size: 13px; }

.profile-tabs { display: flex; gap: 4px; margin-top: 18px; padding: 0 18px; border-bottom: 1px solid var(--card-border); }
.profile-tab { flex: 1; text-align: center; padding: 10px 4px; background: none; border: none; color: var(--text-muted); font-weight: 700; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.profile-tab.active { color: var(--text); border-bottom-color: var(--pink); }

.profile-scroll { flex: 1; overflow-y: auto; padding-bottom: 90px; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 10px; }
.profile-grid .grid-item { position: relative; aspect-ratio: 3/4; background-size: cover; background-position: center; cursor: pointer; }
.profile-grid .grid-item.locked::after {
  content: "🔒";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,15,0.55);
  backdrop-filter: blur(6px);
  font-size: 18px;
}
.profile-grid .grid-item.ppv::before {
  content: attr(data-price);
  position: absolute; bottom: 4px; right: 4px; z-index: 2;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
}

/* ---------- Upload ---------- */
.upload-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-bottom: 90px; }
.upload-drop {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.upload-drop-icon { font-size: 30px; margin-bottom: 8px; }
.upload-drop.filled { border-color: var(--pink); color: var(--text); }

.upload-visibility { display: flex; flex-direction: column; gap: 8px; }
.visibility-option {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; cursor: pointer;
}
.visibility-option input { accent-color: var(--pink); width: 16px; height: 16px; }

/* ---------- Inbox ---------- */
.inbox-list { flex: 1; overflow-y: auto; padding: 4px 16px 90px; }
.inbox-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--card-border); }
.inbox-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: var(--card-bg); }
.inbox-icon.tip, .inbox-icon.purchase { background: rgba(255,45,146,0.18); }
.inbox-text { font-size: 13px; flex: 1; }
.inbox-time { font-size: 11px; color: var(--text-muted); }
.inbox-item.unread .inbox-text { font-weight: 700; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); flex-shrink: 0; }

/* ---------- Search ---------- */
.search-input { margin: 0; }
.search-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px 16px 90px; }
.search-card {
  border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 3/4;
  background-size: cover; background-position: center; cursor: pointer;
}
.search-card .sc-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
  padding: 20px 10px 8px; font-size: 11px; font-weight: 700;
}
.search-empty { grid-column: 1/-1; text-align: center; color: var(--text-muted); padding: 30px; font-size: 13px; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10,10,15,0.95);
  border-top: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.nav-item {
  background: none; border: none; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; cursor: pointer; flex: 1;
}
.nav-item span { font-size: 20px; }
.nav-item.active { color: var(--pink); }
.nav-fab {
  background: var(--accent-grad) !important;
  color: #fff !important;
  width: 46px; height: 46px; border-radius: 50%;
  margin-top: -22px;
  box-shadow: 0 6px 18px rgba(255,45,146,0.45);
  flex: 0 0 auto;
}
.nav-fab span { font-size: 24px; }

/* ---------- Paywall modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5,5,8,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px 22px 0 0;
  padding: 24px 20px max(20px, env(safe-area-inset-bottom));
  position: relative;
  text-align: center;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.08); border: none; color: var(--text);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
}
.modal-avatar { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 10px; background-size: cover; background-position: center; }
.modal-handle { font-weight: 800; margin-bottom: 16px; }
.modal-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.modal-option-btn {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--card-border);
  font-size: 13px; font-weight: 700;
}
.modal-option-btn.primary { background: var(--accent-grad); border: none; }
.modal-option-btn .price { color: var(--score); }
.modal-option-btn.primary .price { color: #fff; }
.tip-row { display: flex; gap: 8px; }
.tip-row .input { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px);
  transform: translateX(-50%);
  background: var(--accent-grad);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 12px 20px; border-radius: 20px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(255,45,146,0.4);
}
.toast[hidden] { display: none; }

/* ---------- Misc ---------- */
::selection { background: var(--pink); color: #fff; }
