/* ═══════════════════════════════════════
   STYLE.CSS — J Social TikTok-style UI
═══════════════════════════════════════ */
:root {
  --red: #ff0050; --cyan: #00f2ea;
  --bg: #0a0a0a; --bg2: #111; --bg3: #1a1a1a; --bg4: #222; --bg5: #2a2a2a;
  --border: rgba(255,255,255,0.08); --border2: rgba(255,255,255,0.13);
  --white: #fff; --muted: rgba(255,255,255,0.45); --faint: rgba(255,255,255,0.18);
  --nav-h: 62px; --safe-bot: env(safe-area-inset-bottom, 0px);
  --font: 'DM Sans', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; overflow: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--white); height: 100%; overflow: hidden; overscroll-behavior: none; }

/* ── SPLASH ── */
#splash { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .5s ease; }
#splash.hidden { opacity: 0; pointer-events: none; }
.sp-logo { font-size: 52px; font-weight: 900; letter-spacing: -2px; background: linear-gradient(110deg,var(--red),var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: spPop .7s cubic-bezier(.34,1.56,.64,1) .1s both; }
.sp-sub { font-size: 11px; letter-spacing: 5px; text-transform: uppercase; color: var(--muted); margin-top: 8px; animation: spUp .4s ease .7s both; }
.sp-bar { width: 120px; height: 2px; background: rgba(255,255,255,.08); border-radius: 2px; margin-top: 32px; overflow: hidden; animation: spUp .3s ease .9s both; }
.sp-bar-fill { height: 100%; background: linear-gradient(90deg,var(--red),var(--cyan)); animation: spLoad 1.1s ease 1s both; }
@keyframes spPop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spLoad { from { width: 0; } to { width: 100%; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── AUTH ── */
#auth { position: fixed; inset: 0; z-index: 8000; background: var(--bg); display: none; align-items: center; justify-content: center; padding: 24px; }
#auth.show { display: flex; animation: fadeIn .4s ease; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg2); border: 0.5px solid var(--border2); border-radius: 24px; padding: 36px 28px; text-align: center; }
.auth-logo { font-size: 34px; font-weight: 900; background: linear-gradient(110deg,var(--red),var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 4px; }
.auth-sub { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; }
.atabs { display: flex; background: rgba(255,255,255,.05); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 22px; }
.atab { flex: 1; padding: 9px; border-radius: 9px; border: none; background: none; color: rgba(255,255,255,.38); font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s; }
.atab.on { background: var(--bg3); color: var(--white); }
input.afield { width: 100%; background: rgba(255,255,255,.05); border: 0.5px solid rgba(255,255,255,.1); border-radius: 14px; padding: 13px 16px; color: var(--white); font-family: var(--font); font-size: 14px; margin-bottom: 10px; outline: none; transition: border-color .2s; display: block; }
input.afield::placeholder { color: rgba(255,255,255,.25); }
input.afield:focus { border-color: rgba(255,0,80,.5); }
.abtn { width: 100%; padding: 15px; border-radius: 14px; border: none; background: linear-gradient(135deg,var(--red),#ff6a35); color: #fff; font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; margin-top: 4px; transition: transform .18s, box-shadow .2s; box-shadow: 0 6px 24px rgba(255,0,80,.3); }
.abtn:hover { transform: scale(1.02); box-shadow: 0 8px 32px rgba(255,0,80,.45); }
.abtn:active { transform: scale(.98); }
.aerr { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 18px; }
.askip { color: rgba(255,255,255,.28); font-size: 12px; margin-top: 16px; cursor: pointer; transition: color .18s; }
.askip:hover { color: var(--cyan); }
.aavatar-pick { width: 80px; height: 80px; border-radius: 50%; background: var(--bg3); border: 2px dashed var(--border2); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 20px; cursor: pointer; position: relative; overflow: hidden; transition: border-color .2s; }
.aavatar-pick:hover { border-color: var(--red); }
.aavatar-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.aavatar-pick i { font-size: 22px; color: var(--muted); }
.aavatar-pick span { font-size: 9px; color: var(--muted); margin-top: 3px; }

/* ── APP SHELL ── */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); opacity: 0; transition: opacity .4s ease; }
#app.show { opacity: 1; }

/* ── BOTTOM NAV ── */
#nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; height: calc(var(--nav-h) + var(--safe-bot)); background: rgba(10,10,10,.96); border-top: 0.5px solid var(--border); display: flex; align-items: flex-start; padding-top: 6px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; cursor: pointer; padding: 6px 0; position: relative; transition: transform .15s; }
.nb:active { transform: scale(.88); }
.nb i { font-size: 24px; color: rgba(255,255,255,.38); transition: color .2s; }
.nb span { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.35); letter-spacing: .3px; transition: color .2s; }
.nb.on i { color: var(--white); }
.nb.on span { color: var(--white); }
.nb-post-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding-top: 4px; }
.nb-post { background: var(--white); border-radius: 10px; width: 44px; height: 30px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; transition: transform .18s; }
.nb-post::before,.nb-post::after { content: ''; position: absolute; top: 0; bottom: 0; width: 6px; }
.nb-post::before { left: 0; background: var(--red); }
.nb-post::after { right: 0; background: var(--cyan); }
.nb-post i { font-size: 18px; color: var(--bg); z-index: 1; }
.nb-post:hover { transform: scale(1.08); }

/* ── PAGES ── */
.page { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--nav-h) + var(--safe-bot)); overflow: hidden; display: none; flex-direction: column; }
.page.on { display: flex; }

/* ══ HOME / FEED ══ */
#pg-home { background: var(--bg); }
#feed-area { flex: 1; position: relative; overflow: hidden; touch-action: pan-y; }

#feed-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 20; height: 52px; background: linear-gradient(to bottom,rgba(0,0,0,.7),transparent); display: flex; align-items: center; justify-content: center; gap: 20px; padding: 0 50px; }
.ftab { font-size: 15px; font-weight: 700; color: rgba(255,255,255,.38); cursor: pointer; padding-bottom: 4px; border-bottom: 2.5px solid transparent; transition: all .2s; white-space: nowrap; }
.ftab.on { color: var(--white); border-color: var(--white); }
#feed-search-btn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* video cards */
.vcard { position: absolute; inset: 0; display: flex; align-items: flex-end; will-change: transform,opacity; transition: transform .45s cubic-bezier(.76,0,.18,1), opacity .3s; }
.vcard.state-active { transform: translateY(0); opacity: 1; pointer-events: all; }
.vcard.state-above { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.vcard.state-below { transform: translateY(100%); opacity: 0; pointer-events: none; }
.vbg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.v-emoji { font-size: clamp(90px,22vw,180px); user-select: none; animation: bobFloat 6s ease-in-out infinite; }
@keyframes bobFloat { 0%,100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.1) rotate(3deg); } }
.vgrad { position: absolute; inset: 0; background: linear-gradient(to top,rgba(0,0,0,.92) 0%,rgba(0,0,0,.18) 50%,rgba(0,0,0,.06) 70%,rgba(0,0,0,.55) 100%); }
.vscan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(255,255,255,.011) 2px,rgba(255,255,255,.011) 4px); }

/* video info */
.vinfo { position: relative; z-index: 5; padding: 12px 70px 18px 14px; width: 100%; }
.vuser-row { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.vav { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.28); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.vav img { width: 100%; height: 100%; object-fit: cover; }
.vusername { font-size: 14px; font-weight: 800; cursor: pointer; }
.vusername:hover { color: var(--cyan); }
.vhandle-small { font-size: 11px; color: rgba(255,255,255,.45); }
.vfollow-btn { font-size: 11px; font-weight: 700; padding: 4px 12px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 5px; cursor: pointer; transition: all .18s; user-select: none; }
.vfollow-btn:hover,.vfollow-btn.on { background: var(--red); border-color: var(--red); }
.vdesc { font-size: 13px; line-height: 1.65; color: rgba(255,255,255,.9); margin-bottom: 10px; max-width: min(78%,320px); }
.vtag { color: var(--cyan); font-weight: 700; }
.vsound-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,.58); cursor: pointer; }
.vsound-row:hover { color: var(--white); }
.vsound-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.vdisc { width: 28px; height: 28px; border-radius: 50%; background: var(--bg3); border: 2px solid #3a3a3a; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; animation: discSpin 3s linear infinite; }
@keyframes discSpin { to { transform: rotate(360deg); } }
.vsound-bars { display: flex; align-items: center; gap: 2px; }
.vsbar { width: 3px; border-radius: 2px; background: linear-gradient(180deg,var(--cyan),var(--red)); animation: sbarAnim .75s ease-in-out infinite alternate; }
.vsbar:nth-child(1) { height: 6px; animation-delay: 0s; } .vsbar:nth-child(2) { height: 13px; animation-delay: .1s; } .vsbar:nth-child(3) { height: 8px; animation-delay: .2s; } .vsbar:nth-child(4) { height: 17px; animation-delay: .15s; } .vsbar:nth-child(5) { height: 7px; animation-delay: .05s; }
@keyframes sbarAnim { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

/* action buttons */
.vactions { position: absolute; right: 12px; bottom: 20px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.vact { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; user-select: none; }
.vact-btn { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.1); backdrop-filter: blur(10px); border: 0.5px solid rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--white); transition: transform .18s cubic-bezier(.34,1.56,.64,1), background .18s; }
.vact:hover .vact-btn,.vact:active .vact-btn { transform: scale(1.2); }
.vact.liked .vact-btn { background: rgba(255,0,80,.22); border-color: rgba(255,0,80,.4); }
.vact.liked .vact-btn i { color: var(--red); animation: heartBeat .38s cubic-bezier(.34,1.56,.64,1); }
.vact.saved .vact-btn { background: rgba(0,242,234,.15); border-color: rgba(0,242,234,.4); }
.vact.saved .vact-btn i { color: var(--cyan); }
@keyframes heartBeat { 0% { transform: scale(1); } 40% { transform: scale(1.7); } 70% { transform: scale(.85); } 100% { transform: scale(1); } }
.vact-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.65); }

/* progress */
.vprog { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: rgba(255,255,255,.07); z-index: 7; }
.vprog-fill { height: 100%; background: linear-gradient(90deg,var(--red),var(--cyan)); transition: width .1s linear; }
.vprog-time { position: absolute; right: 8px; top: -18px; font-size: 9px; color: rgba(255,255,255,.35); }

/* dots */
#vdots-wrap { position: absolute; right: 10px; top: 60px; z-index: 8; display: flex; flex-direction: column; gap: 5px; }
.vdot { width: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.18); transition: all .3s; }
.vdot.on { height: 15px; background: var(--white); }

/* particles */
.fheart { position: fixed; pointer-events: none; z-index: 999; font-size: 24px; animation: heartRise 1.1s ease forwards; }
@keyframes heartRise { 0% { opacity: 1; transform: translateY(0) scale(1) rotate(-15deg); } 100% { opacity: 0; transform: translateY(-130px) scale(.4) rotate(15deg); } }
#dbl-heart { position: fixed; pointer-events: none; z-index: 20; font-size: 80px; opacity: 0; transform: translate(-50%,-50%) scale(0); }
#dbl-heart.pop { animation: dblPop .65s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes dblPop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(0); } 40% { opacity: 1; transform: translate(-50%,-50%) scale(1.3); } 70% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(.7); } }
.spark { position: fixed; border-radius: 50%; pointer-events: none; z-index: 998; animation: sparkFly linear forwards; }
@keyframes sparkFly { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--tx),var(--ty)) scale(0); } }

/* swipe hint */
#swipe-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 10; pointer-events: none; opacity: 0; animation: hintIn .4s ease 3.2s forwards, hintOut .4s ease 5.4s forwards; }
@keyframes hintIn { to { opacity: 1; } } @keyframes hintOut { to { opacity: 0; } }
.sh-arrow { font-size: 28px; color: rgba(255,255,255,.6); animation: shBounce .8s ease infinite alternate; }
@keyframes shBounce { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.sh-text { font-size: 11px; color: rgba(255,255,255,.4); letter-spacing: 2px; text-transform: uppercase; }

/* ══ COMMENT SHEET ══ */
#csheet-wrap { position: fixed; inset: 0; z-index: 500; pointer-events: none; }
#csheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .3s; }
#csheet { position: absolute; bottom: calc(var(--nav-h) + var(--safe-bot)); left: 0; right: 0; height: 72vh; max-height: 640px; background: #161616; border-radius: 20px 20px 0 0; border-top: 0.5px solid rgba(255,255,255,.08); transform: translateY(100%); transition: transform .38s cubic-bezier(.32,.72,0,1); display: flex; flex-direction: column; }
#csheet-wrap.open { pointer-events: all; }
#csheet-wrap.open #csheet-bg { opacity: 1; }
#csheet-wrap.open #csheet { transform: translateY(0); }
.csh-handle { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); margin: 10px auto 0; flex-shrink: 0; }
.csh-head { padding: 10px 16px; border-bottom: 0.5px solid rgba(255,255,255,.06); font-size: 14px; font-weight: 800; color: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.csh-close { font-size: 22px; cursor: pointer; color: rgba(255,255,255,.35); }
#clist { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 14px; }
#clist::-webkit-scrollbar { width: 3px; }
#clist::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 2px; }
.cm { display: flex; gap: 10px; animation: cmSlide .35s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes cmSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.cm-av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.cm-av img { width: 100%; height: 100%; object-fit: cover; }
.cm-body { flex: 1; }
.cm-name { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.85); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.cm-you { font-size: 9px; background: linear-gradient(110deg,var(--red),var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.cm-text { font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.55; }
.cm-meta { font-size: 10px; color: rgba(255,255,255,.22); margin-top: 4px; display: flex; align-items: center; gap: 12px; }
.cm-lbtn { cursor: pointer; display: flex; align-items: center; gap: 3px; transition: color .18s; }
.cm-lbtn:hover { color: var(--red); }
.cinput-row { padding: 10px 14px; border-top: 0.5px solid rgba(255,255,255,.06); display: flex; gap: 9px; align-items: center; flex-shrink: 0; padding-bottom: max(12px,var(--safe-bot)); }
.cinput-av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
#cinput { flex: 1; background: rgba(255,255,255,.06); border: 0.5px solid rgba(255,255,255,.1); border-radius: 22px; padding: 10px 16px; color: var(--white); font-size: 13px; font-family: var(--font); outline: none; transition: border-color .2s; }
#cinput::placeholder { color: rgba(255,255,255,.25); }
#cinput:focus { border-color: rgba(255,0,80,.45); }
#csend { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,var(--red),#ff7a40); border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; font-size: 15px; transition: transform .18s; }
#csend:active { transform: scale(.9); }

/* ══ EXPLORE ══ */
#pg-explore { background: var(--bg); overflow: hidden; }
.pg-topbar { flex-shrink: 0; padding: 14px 14px 10px; border-bottom: 0.5px solid var(--border); background: var(--bg); }
.pg-title { font-size: 18px; font-weight: 900; margin-bottom: 10px; }
.searchbox { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border: 0.5px solid rgba(255,255,255,.1); border-radius: 14px; padding: 10px 14px; }
.searchbox i { font-size: 17px; color: var(--muted); flex-shrink: 0; }
.searchbox input { flex: 1; background: none; border: none; color: var(--white); font-family: var(--font); font-size: 13px; outline: none; }
.searchbox input::placeholder { color: rgba(255,255,255,.3); }
.ex-tags { display: flex; gap: 6px; padding: 10px 14px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ex-tags::-webkit-scrollbar { display: none; }
.ex-tag { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 20px; background: rgba(255,255,255,.05); border: 0.5px solid rgba(255,255,255,.1); color: rgba(255,255,255,.55); cursor: pointer; transition: all .18s; }
.ex-tag:hover,.ex-tag.on { background: rgba(255,0,80,.15); border-color: rgba(255,0,80,.4); color: var(--white); }
#explore-content { flex: 1; overflow-y: auto; }
.ex-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; padding: 2px; }
.ex-cell { aspect-ratio: 9/16; position: relative; border-radius: 5px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.ex-cell:hover { transform: scale(1.04); z-index: 2; }
.ex-cell-foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px; background: linear-gradient(to top,rgba(0,0,0,.7),transparent); display: flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.85); }

/* Search results */
#ex-search-results { padding: 10px 14px; display: none; }
.search-sec-title { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; padding: 12px 0 8px; }
.search-user-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 0.5px solid var(--border); cursor: pointer; transition: background .18s; border-radius: 8px; }
.search-user-row:hover { background: rgba(255,255,255,.03); }
.search-uname { font-size: 14px; font-weight: 800; }
.search-uhandle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.search-ubio { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 2px; }
.search-follow-btn { padding: 7px 16px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,.4); background: transparent; color: var(--white); font-family: var(--font); font-size: 12px; font-weight: 800; cursor: pointer; transition: all .18s; flex-shrink: 0; }
.search-follow-btn:hover,.search-follow-btn.on { background: var(--red); border-color: var(--red); }
.search-clips-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; margin-bottom: 8px; }
.search-clip-cell { aspect-ratio: 9/16; border-radius: 6px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; transition: transform .18s; }
.search-clip-cell:hover { transform: scale(1.04); }
.search-clip-foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px; background: linear-gradient(to top,rgba(0,0,0,.7),transparent); font-size: 10px; color: rgba(255,255,255,.85); font-weight: 700; }
.search-clip-desc { position: absolute; top: 0; left: 0; right: 0; padding: 6px; background: linear-gradient(to bottom,rgba(0,0,0,.5),transparent); font-size: 9px; color: rgba(255,255,255,.7); }
.search-tag-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 0.5px solid var(--border); cursor: pointer; }
.search-empty { text-align: center; padding: 50px 20px; color: rgba(255,255,255,.3); font-size: 14px; }

/* ══ INBOX ══ */
#pg-inbox { background: var(--bg); overflow: hidden; }
.inbox-tabs { display: flex; border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
.inbox-tab-btn { flex: 1; padding: 14px 0; font-family: var(--font); font-size: 14px; font-weight: 700; color: rgba(255,255,255,.35); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all .2s; }
.inbox-tab-btn.on { color: var(--white); border-color: var(--white); }
#inbox-content { flex: 1; overflow-y: auto; }
#inbox-list { }
.inbox-section-header { padding: 12px 16px 6px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.inbox-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background .18s; position: relative; }
.inbox-item:hover { background: rgba(255,255,255,.03); }
.inbox-item.unread { background: rgba(255,0,80,.04); }
.inbox-av-wrap { position: relative; flex-shrink: 0; }
.inbox-type-badge { position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bg); display: flex; align-items: center; justify-content: center; font-size: 9px; }
.inbox-type-badge.type-like { background: #ff0050; }
.inbox-type-badge.type-follow { background: #0891b2; }
.inbox-type-badge.type-comment,.inbox-type-badge.type-mention { background: #7c3aed; }
.inbox-type-badge.type-system { background: #ca8a04; }
.inbox-type-badge.type-duet { background: #16a34a; }
.inbox-body { flex: 1; min-width: 0; }
.inbox-name { font-size: 13px; font-weight: 800; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.inbox-new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.inbox-msg { font-size: 12px; color: var(--muted); }
.inbox-time { font-size: 10px; color: rgba(255,255,255,.25); }
.inbox-thumb { width: 44px; height: 58px; border-radius: 6px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-left: 4px; }
.inbox-followback-btn { display: inline-block; margin-top: 6px; padding: 5px 14px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.4); background: transparent; color: var(--white); font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .18s; }
.inbox-followback-btn:hover { background: var(--red); border-color: var(--red); }

/* DM list */
#inbox-dms { display: none; }
.dm-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; transition: background .18s; border-bottom: 0.5px solid var(--border); }
.dm-row:hover { background: rgba(255,255,255,.03); }
.dm-online-dot { position: absolute; bottom: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--bg); }
.dm-info { flex: 1; min-width: 0; }
.dm-name { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.dm-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-meta { text-align: right; flex-shrink: 0; }
.dm-time { font-size: 10px; color: rgba(255,255,255,.25); }

/* DM Thread modal */
#dm-thread-modal { position: fixed; inset: 0; z-index: 3000; background: var(--bg); display: none; flex-direction: column; }
#dm-thread-modal.open { display: flex; animation: fadeIn .25s ease; }
.dm-thread-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
.dm-thread-back { font-size: 24px; cursor: pointer; color: var(--muted); margin-right: 4px; }
.dm-thread-name { font-size: 15px; font-weight: 900; }
.dm-thread-handle { font-size: 11px; color: var(--muted); }
#dm-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dm-bubble-row { display: flex; flex-direction: column; }
.dm-bubble-row.me { align-items: flex-end; }
.dm-bubble-row.them { align-items: flex-start; }
.dm-bubble { max-width: 72%; padding: 10px 14px; border-radius: 20px; font-size: 14px; line-height: 1.5; }
.dm-bubble-me { background: linear-gradient(135deg,var(--red),#ff6a35); color: #fff; border-bottom-right-radius: 4px; }
.dm-bubble-them { background: var(--bg3); color: var(--white); border-bottom-left-radius: 4px; }
.dm-bubble-time { font-size: 9px; color: rgba(255,255,255,.25); margin-top: 3px; padding: 0 4px; }
.dm-input-row { display: flex; gap: 10px; padding: 12px 14px; border-top: 0.5px solid var(--border); flex-shrink: 0; padding-bottom: max(14px,var(--safe-bot)); }
#dm-input { flex: 1; background: rgba(255,255,255,.06); border: 0.5px solid rgba(255,255,255,.1); border-radius: 22px; padding: 11px 16px; color: var(--white); font-family: var(--font); font-size: 14px; outline: none; }
#dm-input::placeholder { color: rgba(255,255,255,.25); }
#dm-send { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,var(--red),#ff7a40); border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; flex-shrink: 0; transition: transform .18s; }
#dm-send:active { transform: scale(.9); }

/* ══ PROFILE ══ */
#pg-profile { background: var(--bg); overflow: hidden; }
#profile-content { flex: 1; overflow-y: auto; }
.prof-header { padding: 20px 16px 14px; border-bottom: 0.5px solid var(--border); }
.prof-top-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.prof-av-ring { width: 88px; height: 88px; border-radius: 50%; padding: 2.5px; background: linear-gradient(135deg,var(--red),var(--cyan)); flex-shrink: 0; cursor: pointer; position: relative; }
#pav-file { display: none; }
.prof-av-inner { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; position: relative; }
.prof-av-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prof-av-edit { position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.prof-info { flex: 1; }
.prof-name { font-size: 20px; font-weight: 900; }
.prof-handle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.prof-bio { font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.55; margin-top: 6px; }
.prof-stats { display: flex; gap: 0; margin-bottom: 14px; border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.pstat { flex: 1; text-align: center; padding: 12px 0; border-right: 0.5px solid var(--border); cursor: pointer; transition: background .18s; }
.pstat:last-child { border-right: none; }
.pstat:hover { background: rgba(255,255,255,.04); }
.pstat-n { font-size: 18px; font-weight: 900; }
.pstat-l { font-size: 10px; color: var(--muted); margin-top: 2px; }
.prof-action-row { display: flex; gap: 8px; }
.prof-btn { flex: 1; padding: 10px 0; border-radius: 10px; border: 0.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--white); font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.prof-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }
.prof-btn.red { background: var(--red); border-color: var(--red); }
.prof-btn.red:hover { background: #e6004a; }
.prof-tabs { display: flex; border-bottom: 0.5px solid var(--border); }
.ptab { flex: 1; padding: 13px 0; display: flex; align-items: center; justify-content: center; cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; color: rgba(255,255,255,.35); }
.ptab i { font-size: 18px; }
.ptab.on { color: var(--white); border-color: var(--white); }
.prof-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; }
.pg-cell { aspect-ratio: 9/16; border-radius: 3px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: clamp(24px,7vw,44px); position: relative; transition: transform .18s; }
.pg-cell:hover { transform: scale(1.05); z-index: 2; }
.pg-cell-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px; background: linear-gradient(to top,rgba(0,0,0,.75),transparent); display: flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 700; color: rgba(255,255,255,.85); }
.prof-empty { grid-column: 1/-1; padding: 50px 20px; text-align: center; color: rgba(255,255,255,.28); }
.prof-empty i { font-size: 42px; margin-bottom: 10px; display: block; }
.prof-empty p { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: rgba(255,255,255,.45); }
.prof-empty small { font-size: 12px; }

/* ══ USER CHANNEL MODAL ══ */
#user-channel-modal { position: fixed; inset: 0; z-index: 3000; background: var(--bg); display: none; flex-direction: column; overflow-y: auto; }
#user-channel-modal.open { display: flex; animation: fadeIn .25s ease; }
.uchan-header { display: flex; align-items: center; padding: 14px 16px; border-bottom: 0.5px solid var(--border); flex-shrink: 0; gap: 12px; }
.uchan-back { font-size: 24px; cursor: pointer; color: var(--muted); }
.uchan-header-title { font-size: 16px; font-weight: 900; flex: 1; }
.uchan-settings-btn { font-size: 22px; cursor: pointer; color: var(--muted); }
.uchan-body { padding: 20px 16px; }
.uchan-top { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; text-align: center; }
#uchan-av { margin-bottom: 12px; }
.uchan-name { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.uchan-handle { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.uchan-bio { font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.55; max-width: 300px; }
.uchan-stats { display: flex; justify-content: center; gap: 0; margin: 14px 0; border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.uchan-stat { flex: 1; text-align: center; padding: 12px 0; border-right: 0.5px solid var(--border); max-width: 120px; }
.uchan-stat:last-child { border-right: none; }
.uchan-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.uchan-follow { min-width: 140px; }
.uchan-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; }

/* ══ EDIT PROFILE MODAL ══ */
#edit-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.7); display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
#edit-modal.open { display: flex; }
.edit-sheet { background: #161616; border-radius: 24px 24px 0 0; border-top: 0.5px solid var(--border2); width: 100%; max-width: 600px; padding: 24px; animation: slideUp .35s cubic-bezier(.32,.72,0,1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.edit-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--faint); margin: 0 auto 20px; }
.edit-title { font-size: 16px; font-weight: 900; text-align: center; margin-bottom: 20px; }
.edit-av-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.edit-av-ring { width: 84px; height: 84px; border-radius: 50%; padding: 2.5px; background: linear-gradient(135deg,var(--red),var(--cyan)); cursor: pointer; position: relative; }
#edit-av-file { display: none; }
.edit-av-inner { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; position: relative; }
.edit-av-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.edit-av-badge { position: absolute; bottom: 0; right: 0; background: var(--red); width: 26px; height: 26px; border-radius: 50%; border: 2px solid #161616; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.edit-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.4); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.edit-input { width: 100%; background: rgba(255,255,255,.05); border: 0.5px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; color: var(--white); font-family: var(--font); font-size: 14px; margin-bottom: 14px; outline: none; transition: border-color .2s; }
.edit-input::placeholder { color: rgba(255,255,255,.25); }
.edit-input:focus { border-color: rgba(255,0,80,.5); }
.edit-save { width: 100%; padding: 14px; border-radius: 14px; border: none; background: linear-gradient(135deg,var(--red),#ff6a35); color: #fff; font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .18s; }
.edit-save:hover { transform: scale(1.02); }
.edit-cancel { width: 100%; padding: 10px; border-radius: 14px; border: 0.5px solid var(--border2); background: none; color: var(--muted); font-family: var(--font); font-size: 13px; cursor: pointer; margin-top: 8px; }
.edit-cancel:hover { color: var(--white); }

/* ══ POST MODAL ══ */
#post-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.7); display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
#post-modal.open { display: flex; }
.post-sheet { background: #161616; border-radius: 24px 24px 0 0; border-top: 0.5px solid var(--border2); width: 100%; max-width: 600px; padding: 22px; animation: slideUp .35s cubic-bezier(.32,.72,0,1); max-height: 90vh; overflow-y: auto; }
.post-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--faint); margin: 0 auto 18px; }
.post-title { font-size: 16px; font-weight: 900; text-align: center; margin-bottom: 6px; }
.post-hint { font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1.5px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 16px; max-height: 180px; overflow-y: auto; }
.ep-opt { width: 50px; height: 50px; border-radius: 13px; background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; transition: all .18s; flex-shrink: 0; }
.ep-opt:hover,.ep-opt.sel { background: rgba(255,0,80,.15); border-color: rgba(255,0,80,.5); transform: scale(1.1); }
.post-upload-area { border: 1.5px dashed rgba(255,255,255,.2); border-radius: 14px; padding: 18px; text-align: center; margin-bottom: 14px; cursor: pointer; transition: border-color .2s; position: relative; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.post-upload-area:hover { border-color: rgba(255,0,80,.5); }
.post-upload-area input { display: none; }
.post-preview-emoji { font-size: 52px; }
.post-sound-row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; cursor: pointer; transition: background .18s; }
.post-sound-row:hover { background: rgba(255,255,255,.09); }
.post-sound-row i { font-size: 18px; color: var(--cyan); }
#post-sound-label { font-size: 13px; flex: 1; color: rgba(255,255,255,.7); }
textarea.post-cap { width: 100%; background: rgba(255,255,255,.05); border: 0.5px solid rgba(255,255,255,.1); border-radius: 13px; padding: 12px 14px; color: var(--white); font-family: var(--font); font-size: 13px; resize: none; outline: none; height: 76px; margin-bottom: 12px; transition: border-color .2s; }
textarea.post-cap::placeholder { color: rgba(255,255,255,.25); }
textarea.post-cap:focus { border-color: rgba(255,0,80,.45); }
.post-submit { width: 100%; padding: 14px; border-radius: 14px; border: none; background: linear-gradient(135deg,var(--red),#ff6a35); color: #fff; font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 20px rgba(255,0,80,.35); transition: transform .18s; }
.post-submit:hover { transform: scale(1.02); }
.post-cancel-btn { width: 100%; padding: 10px; border-radius: 14px; border: 0.5px solid var(--border2); background: none; color: var(--muted); font-family: var(--font); font-size: 13px; cursor: pointer; margin-top: 8px; }

/* ══ USE SOUND MODAL ══ */
#usesound-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.75); display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
#usesound-modal.open { display: flex; }
.usesound-sheet { background: #161616; border-radius: 24px 24px 0 0; border-top: 0.5px solid var(--border2); width: 100%; max-width: 600px; padding: 24px; animation: slideUp .35s cubic-bezier(.32,.72,0,1); }
.usesound-disc { width: 80px; height: 80px; border-radius: 50%; background: var(--bg3); border: 3px solid #333; display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 14px; animation: discSpin 4s linear infinite; }
#usesound-name { font-size: 15px; font-weight: 900; text-align: center; margin-bottom: 4px; }
#usesound-creator { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 20px; }
.usesound-use-btn { width: 100%; padding: 14px; border-radius: 14px; border: none; background: linear-gradient(135deg,var(--red),#ff6a35); color: #fff; font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; margin-bottom: 8px; }
.usesound-cancel { width: 100%; padding: 10px; border-radius: 14px; border: 0.5px solid var(--border2); background: none; color: var(--muted); font-family: var(--font); font-size: 13px; cursor: pointer; }

/* ══ MORE OPTIONS SHEET ══ */
#more-sheet { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.7); display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
#more-sheet.open { display: flex; }
.more-sheet-inner { background: #161616; border-radius: 24px 24px 0 0; border-top: 0.5px solid var(--border2); width: 100%; max-width: 600px; padding: 14px; animation: slideUp .35s cubic-bezier(.32,.72,0,1); }
.more-option { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; cursor: pointer; transition: background .18s; }
.more-option:hover { background: rgba(255,255,255,.06); }
.more-option i { font-size: 22px; color: var(--muted); }
.more-option span { font-size: 15px; font-weight: 600; }
.more-option.danger span,.more-option.danger i { color: var(--red); }

/* ══ SETTINGS MODAL ══ */
#settings-modal { position: fixed; inset: 0; z-index: 3000; background: var(--bg); display: none; flex-direction: column; }
#settings-modal.open { display: flex; animation: fadeIn .25s ease; }
.settings-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
.settings-back { font-size: 24px; cursor: pointer; color: var(--muted); }
.settings-title { font-size: 18px; font-weight: 900; }
#settings-content { flex: 1; overflow-y: auto; padding: 10px 0; }
.settings-section { padding: 4px 16px 4px; }
.settings-section-title { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: 2px; padding: 12px 0 6px; }
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 0.5px solid var(--border); cursor: pointer; }
.settings-item:last-child { border-bottom: none; }
.settings-item-left { display: flex; align-items: center; gap: 14px; }
.settings-item-left i { font-size: 20px; color: var(--muted); }
.settings-item-label { font-size: 15px; font-weight: 600; }
.settings-item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-item-right { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.settings-logout { margin: 16px; padding: 14px; border-radius: 14px; border: 1.5px solid rgba(255,0,80,.4); background: rgba(255,0,80,.08); color: var(--red); font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 32px); transition: all .18s; }
.settings-logout:hover { background: rgba(255,0,80,.18); }

/* ══ TOAST ══ */
#toast { position: fixed; bottom: calc(var(--nav-h) + var(--safe-bot) + 14px); left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(24,24,24,.96); backdrop-filter: blur(16px); border: 0.5px solid rgba(255,255,255,.15); border-radius: 22px; padding: 9px 20px; font-size: 13px; color: var(--white); opacity: 0; transition: all .28s; z-index: 9000; pointer-events: none; white-space: nowrap; font-weight: 600; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }