
/* ═══ DESIGN SYSTEM ═══ */
:root {
  --bg: #0a0a0a;
  --sf: #111111;
  --sf2: #181818;
  --sf3: #1f1f1f;
  --sf4: #282828;
  --sf5: #333333;
  --t1: #f0f0f0;
  --t2: #a0a0a0;
  --t3: #707070;
  --t4: #505050;
  --border: #1f1f1f;
  --border2: #2a2a2a;
  --rose: #ef4444;
  --green: #22c55e;
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 9999px;
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
  --font: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.22,1,.36,1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: var(--font); background: var(--bg); color: var(--t1);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--t1); text-decoration: none; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
::selection { background: rgba(239,68,68,0.2); }
::-webkit-scrollbar { width: 0; }

/* ═══ SPLASH ═══ */
.splash {
  position: fixed; inset: 0; z-index: 99999;
  background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-logo {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.splash-mark {
  width: 72px; height: 72px; border-radius: 20px;
  background: #1a1a1a; border: 2px solid #2a2a2a;
  display: flex; align-items: center; justify-content: center;
}
.splash-mark svg {
  width: 36px; height: 36px; color: #fff;
}
.splash-text {
  font-family: 'Great Vibes', cursive;
  font-size: 48px; font-weight: 400; color: #fff;
  margin-top: 4px;
}

/* ═══ APP ═══ */
.app {
  display: flex; flex-direction: column;
  height: 100dvh; position: relative; overflow: hidden;
}

/* ═══ TOPBAR ═══ */
.topbar {
  background: rgba(10,10,10,0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px; padding-top: calc(var(--st) + 6px);
  height: 50px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: transparent; border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3); transition: all 0.12s;
}
.icon-btn:hover { background: var(--sf3); color: var(--t1); }
.icon-btn.liked { color: var(--rose); }

/* ═══ SEARCH MODAL ═══ */
.search-modal {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); display: none; flex-direction: column;
}
.search-modal.on { display: flex; }
.search-bar {
  padding: calc(var(--st) + 8px) 12px 8px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.search-wrap {
  position: relative; flex: 1;
}
.search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--t4);
}
.search-input {
  width: 100%; height: 36px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--sf2);
  color: var(--t1); font-size: 14px; padding: 0 14px 0 36px; outline: none;
}
.search-input:focus { border-color: var(--sf5); }
.search-input::placeholder { color: var(--t4); }
.search-cancel {
  background: none; border: none; color: var(--t2); font-size: 14px;
  font-weight: 500; white-space: nowrap; padding: 4px 8px;
}
.search-cancel:hover { color: var(--t1); }
.search-results {
  flex: 1; overflow-y: auto;
}
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer; transition: background 0.1s;
}
.search-item:hover { background: var(--sf2); }
.search-item-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; background: var(--sf3);
  display: flex; align-items: center; justify-content: center;
}
.search-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.search-item-info { flex: 1; min-width: 0; }
.search-item-name { font-size: 14px; font-weight: 600; color: var(--t1); display: flex; align-items: center; gap: 4px; }
.search-item-handle { font-size: 12px; color: var(--t3); margin-top: 1px; }
.search-empty { padding: 30px 16px; text-align: center; color: var(--t4); font-size: 14px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.logo span { font-family: 'Great Vibes', cursive; font-size: 26px; font-weight: 400; }
.logo-mark {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  background: var(--sf4); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: var(--t1);
}




/* ═══ MAIN CONTENT ═══ */
.main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 600px; margin: 0 auto; width: 100%;
}



/* ═══ FEED ═══ */
.feed-header {
  padding: 14px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.feed-title { font-size: 18px; font-weight: 800; color: var(--t1); }
.feed-count { font-size: 12px; color: var(--t3); font-weight: 500; }

.feed-post {
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.feed-post:hover { background: rgba(255,255,255,0.02); }
.feed-post:active { background: rgba(255,255,255,0.04); }

.feed-post-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 8px;
  cursor: pointer;
}
.feed-post-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; background: var(--sf3);
  display: flex; align-items: center; justify-content: center;
}
.feed-post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-post-info { flex: 1; min-width: 0; }
.feed-post-name { font-size: 14px; font-weight: 600; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.verified { flex-shrink: 0; }
.feed-post-handle { font-size: 12px; color: var(--t3); }

.feed-post-photo { width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--sf); }
.feed-post-photo img { width: 100%; height: 100%; object-fit: cover; }

.feed-post-msg { padding: 8px 16px 10px; font-size: 14px; line-height: 1.4; color: var(--t2); }

.feed-post-actions {
  display: flex; gap: 20px; padding: 4px 16px 10px;
}
.feed-action {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--t3); background: none; border: none;
  padding: 4px 0; cursor: pointer; transition: color 0.1s;
}
.feed-action:hover { color: var(--t1); }
.feed-action-liked { color: var(--rose); }

.feed-more {
  padding: 20px; display: flex; align-items: center;
  justify-content: center; gap: 8px; color: var(--t3); font-size: 13px;
}
.feed-more-spinner {
  width: 16px; height: 16px; border: 2px solid var(--sf4);
  border-top-color: var(--t3); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.feed-bottom { padding: 40px 16px; text-align: center; }
.feed-bottom-text { font-size: 12px; color: var(--t4); }

/* ═══ PROFILE VIEW ═══ */
.prof-view { padding-bottom: 20px; }

.prof-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--t2); cursor: pointer;
  padding: 10px 16px; background: none; border: none;
  transition: color 0.1s;
}
.prof-back:hover { color: var(--t1); }

.prof-carousel {
  position: relative; width: 100%; aspect-ratio: 3/4;
  background: var(--sf); overflow: hidden; touch-action: pan-y;
}
.prof-carousel-track {
  display: flex; height: 100%;
  transition: transform 0.35s var(--ease);
}
.prof-slide { flex: 0 0 100%; height: 100%; }
.prof-slide img { width: 100%; height: 100%; object-fit: cover; }

.prof-arr {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.4); border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; cursor: pointer; z-index: 2;
  opacity: 0.8; transition: opacity 0.15s;
}
.prof-arr:hover { opacity: 1; }
.prof-arr-l { left: 8px; }
.prof-arr-r { right: 8px; }

.prof-dots {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%); display: flex; gap: 4px; z-index: 2;
}
.prof-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.3); transition: all 0.2s;
}
.prof-dot.on { background: #fff; width: 18px; }

.prof-counter {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.5); padding: 3px 10px;
  border-radius: var(--r-full); font-size: 11px; color: rgba(255,255,255,0.8); z-index: 2;
}

.prof-main-name {
  padding: 16px 16px 4px;
  font-size: 22px; font-weight: 700; color: var(--t1);
  display: flex; align-items: center; gap: 6px;
}
.prof-main-name span { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.prof-copy-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--sf2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--t3); cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.prof-copy-btn:hover { background: var(--sf3); color: var(--t1); }
.prof-copy-btn.copied { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #22c55e; }

.prof-more-names {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 8px 16px 0; padding: 6px 14px;
  background: var(--sf3); border: 1px solid var(--border2);
  border-radius: var(--r-full); color: var(--t2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.12s;
}
.prof-more-names:hover { background: var(--sf4); color: var(--t1); }

.prof-names-list.hidden { display: none; }
.prof-names-list {
  padding: 0 16px; margin-top: 8px;
}
.prof-name-item {
  padding: 6px 0; font-size: 13px; color: var(--t2);
  border-bottom: 1px solid var(--border);
}

.prof-post {
  padding: 14px 16px; font-size: 14px; line-height: 1.6;
  color: var(--t2); word-break: break-word; white-space: pre-wrap;
}
.prof-post a { color: var(--t1); text-decoration: underline; }

.prof-write-btn {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  padding: 8px 16px; padding-bottom: calc(10px + var(--sb));
}
.prof-write-btn::after {
  display: none;
}
.prof-write-btn-inner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px; border-radius: var(--r-full);
  background: var(--rose); color: #fff; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
.prof-write-btn-inner:hover { background: #dc2626; }







/* Empty */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 12px; padding: 40px; text-align: center;
}
.empty svg { color: var(--t4); opacity: 0.15; }
.empty h3 { font-size: 16px; font-weight: 600; color: var(--t2); }
.empty p { font-size: 12px; color: var(--t4); }

/* Likes page */
.likes-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--t2); cursor: pointer;
  padding: 10px 16px; background: none; border: none;
  transition: color 0.1s;
}
.likes-back:hover { color: var(--t1); }
.likes-title {
  padding: 0 16px 12px; font-size: 18px; font-weight: 700;
}
.likes-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2px; padding: 0 0 20px;
}
.likes-cell { aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--sf); position: relative; }
.likes-cell img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.1s; }
.likes-cell:hover img { opacity: 0.8; }
.likes-cell-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding: 16px 8px 6px; font-size: 12px; font-weight: 600; color: #fff;
  cursor: pointer; z-index: 2;
}
.likes-cell-name:hover { text-decoration: underline; }

/* Sheet */
.sheet-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: flex-end; justify-content: center;
}
.sheet-bg.on { display: flex; }
.sheet {
  background: var(--sf); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 12px 16px 20px; padding-bottom: calc(20px + var(--sb));
  width: 100%; max-width: 500px;
  transform: translateY(100%); transition: transform 0.3s var(--ease);
  border: 1px solid var(--border); border-bottom: none;
}
.sheet-bg.on .sheet { transform: translateY(0); }
.sheet-bar { width: 36px; height: 4px; border-radius: 2px; background: var(--sf5); margin: 0 auto 14px; }
.sheet-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.sheet-reply {
  background: var(--sf2); border-radius: var(--r-md);
  padding: 14px; font-size: 14px; line-height: 1.5;
  color: var(--t1); margin-bottom: 14px; word-break: break-word;
  border: 1px solid var(--border);
}
.sheet-reply a { text-decoration: underline; }
.sheet-btns { display: flex; flex-direction: column; gap: 8px; }
.sheet-btn {
  width: 100%; height: 40px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.1s;
}
.sheet-btn-p { background: var(--rose); color: #fff; }
.sheet-btn-p:hover { background: #dc2626; }
.sheet-btn-s { background: var(--sf3); color: var(--t1); }
.sheet-btn-s:hover { background: var(--sf4); }

/* Lightbox */
.lb {
  display: none; position: fixed; inset: 0;
  background: rgba(10,10,10,0.97); z-index: 300;
  flex-direction: column; align-items: center; justify-content: center;
}
.lb.on { display: flex; }
.lb-sl { display: flex; width: 100%; height: 100%; transition: transform 0.3s var(--ease); pointer-events: none; }
.lb-s { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 0 70px; }
.lb-s img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; pointer-events: auto; }
.lb-x { position: absolute; top: calc(var(--st) + 12px); right: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--sf3); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--t3); z-index: 2; border: none; }
.lb-x:hover { background: var(--sf4); color: var(--t1); }
.lb-a { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--sf3); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--t3); z-index: 2; border: none; }
.lb-a:hover { background: var(--sf4); color: var(--t1); }
.lb-al { left: 8px; }
.lb-ar { right: 8px; }
.lb-n { position: absolute; bottom: calc(var(--sb) + 20px); left: 50%; transform: translateX(-50%); background: var(--sf3); padding: 4px 12px; border-radius: var(--r-full); font-size: 12px; color: var(--t3); font-weight: 500; z-index: 2; }
.lb-like {
  position: absolute; bottom: max(24px, calc(var(--sb) + 16px)); right: 16px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.lb-like:hover { background: rgba(0,0,0,0.65); }
.lb-like:active { transform: scale(0.85); }

/* Age gate */
.age-gate { position: fixed; inset: 0; z-index: 9999; background: rgba(10,10,10,0.97); display: flex; align-items: center; justify-content: center; padding: 20px; }
.age-gate.hidden { display: none; }
.age-card { background: var(--sf2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px 24px; max-width: 360px; width: 100%; text-align: center; }
.age-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--sf3); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; color: var(--rose); }
.age-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.age-text { font-size: 14px; line-height: 1.5; color: var(--t2); margin-bottom: 24px; }
.age-buttons { display: flex; flex-direction: column; gap: 10px; }
.age-confirm { width: 100%; height: 44px; border-radius: var(--r-full); background: var(--rose); color: #fff; border: none; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.12s; }
.age-confirm:hover { background: #dc2626; }
.age-deny { width: 100%; height: 44px; border-radius: var(--r-full); background: transparent; color: var(--t2); border: 1px solid var(--sf5); font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.12s; }
.age-deny:hover { background: var(--sf3); color: var(--t1); }

/* Blocked */
.blocked { position: fixed; inset: 0; z-index: 9999; background: rgba(10,10,10,0.98); display: flex; align-items: center; justify-content: center; padding: 20px; }
.blocked.hidden { display: none; }
.blocked-card { background: var(--sf2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 40px 24px; max-width: 340px; width: 100%; text-align: center; }
.blocked-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--sf3); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; color: var(--t4); }
.blocked-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.blocked-text { font-size: 14px; line-height: 1.5; color: var(--t2); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 380px) {
  .lb-a { display: none; }
}