:root {
  --mint: #3effb0;
  --mint-soft: #98ffd6;
  --mint-deep: #0fbf85;
  --mint-glow: rgba(62, 255, 176, 0.55);
  --pink: #ff4fa3;
  --bg: #0b0f0e;
  --panel: #121a17;
  --text: #f2fff9;
  --muted: #9fb8ae;
  --font: "Outfit", system-ui, -apple-system, sans-serif;
  --bar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
/* Phones: no double-tap page zoom (double-tap = like), no grey tap flash, no long-press callouts on the feed */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }
.post, .ad-slot { -webkit-touch-callout: none; }
.post video { pointer-events: none; }
a { color: var(--mint); }
svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ================= AGE GATE ================= */
.age-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px 16px;
  background: radial-gradient(ellipse at 50% 30%, #0f2a20 0%, var(--bg) 70%);
  overflow-y: auto;
  transition: opacity .5s ease, visibility .5s;
}
.age-gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 14s ease-in-out infinite alternate; }
.orb-1 { width: 380px; height: 380px; background: var(--mint); top: -120px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--pink); bottom: -100px; right: -80px; opacity: .3; animation-delay: -5s; }
.orb-3 { width: 220px; height: 220px; background: var(--mint-deep); top: 55%; left: 60%; animation-delay: -9s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }

.gate-card {
  position: relative;
  width: 100%; max-width: 440px;
  padding: 28px 24px 22px;
  text-align: center;
  background: rgba(18, 26, 23, .72);
  border: 1px solid rgba(62, 255, 176, .25);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 60px rgba(62, 255, 176, .15), 0 30px 80px rgba(0,0,0,.6);
  animation: rise .7s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); } }

.gate-art { width: 100%; max-width: 300px; height: auto; display: block; margin: -6px auto 10px; filter: drop-shadow(0 0 22px var(--mint-glow)); }
.gate-title { font-size: clamp(24px, 6vw, 30px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; }
.gate-text { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin-bottom: 22px; }

.gate-actions { display: grid; gap: 10px; }
.btn { padding: 15px 18px; border-radius: 999px; font-weight: 600; font-size: 16px; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--mint-soft), var(--mint) 50%, var(--mint-deep));
  color: #04261a;
  box-shadow: 0 0 0 0 var(--mint-glow), 0 8px 24px rgba(62,255,176,.35);
  animation: pulse 2.4s infinite;
}
.btn-primary:hover { box-shadow: 0 0 30px var(--mint-glow); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--mint-glow); } 70% { box-shadow: 0 0 0 14px rgba(62,255,176,0); } 100% { box-shadow: 0 0 0 0 rgba(62,255,176,0); } }
.btn-ghost { border: 1px solid rgba(255,255,255,.18); color: var(--muted); }
.btn-ghost:hover { background: rgba(255,255,255,.06); color: var(--text); }

.gate-remember { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.gate-remember input { accent-color: var(--mint); width: 16px; height: 16px; }
.gate-fine { margin-top: 14px; font-size: 11.5px; color: #6f8a80; line-height: 1.5; }

/* ================= APP SHELL ================= */
body.locked .app { filter: blur(24px); pointer-events: none; }
.app { position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; background: #000; transition: filter .6s; }

.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
}
.logo { display: flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; }
.logo b { color: var(--mint); font-weight: 800; }
.tabs { display: flex; gap: 18px; }
.tab { font-weight: 600; font-size: 16px; color: rgba(255,255,255,.6); padding: 4px 0; position: relative; }
.tab.active { color: #fff; }
.tab b { color: var(--mint); font-weight: inherit; }
.tab-count:not(:empty) { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 2px; }
.tab.active::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: -3px; height: 3px; border-radius: 3px; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; }

/* ================= FEED ================= */
.feed[hidden] { display: none; }
.feed {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.post {
  position: relative;
  height: calc(100dvh - var(--bar-h));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  user-select: none;
}
.media, .media video, .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; }
.media video { object-fit: cover; background: #000; }
.placeholder { display: grid; place-items: center; background: var(--ph, linear-gradient(160deg, #0f3d2c, #062018 60%, #1b0b18)); }
.post.has-video .placeholder { display: none; }
.ph-loop {
  width: 120px; height: 60px;
  border: 6px solid var(--mint);
  border-radius: 60px;
  opacity: .25;
  box-shadow: 0 0 40px var(--mint-glow);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 40%); }

.meta { position: absolute; left: 14px; right: 90px; bottom: 22px; z-index: 2; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.handle { display: inline-block; color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; margin-bottom: 6px; }
.handle::after { content: " ✓"; color: var(--mint); font-size: 13px; }
.caption { font-size: 14.5px; line-height: 1.4; margin-bottom: 8px; }
.caption .tag { color: var(--mint-soft); font-weight: 600; }
.sound { display: flex; gap: 6px; font-size: 13px; color: rgba(255,255,255,.85); white-space: nowrap; }
.sound .track { flex: 1; overflow: hidden; }
.sound .track span { display: inline-block; animation: marquee 9s linear infinite; padding-left: 4px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-60%); } }

.actions { position: absolute; right: 10px; bottom: 26px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.avatar-wrap { position: relative; margin-bottom: 8px; }
.avatar { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #fff; background: var(--av, var(--mint-deep)) center/cover; }
.follow { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: #04261a; font-weight: 800; line-height: 1; transition: transform .2s; }
.follow.done { background: #fff; transform: translateX(-50%) scale(0); }
.act { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.act svg { width: 34px; height: 34px; fill: rgba(255,255,255,.95); stroke: none; transition: transform .2s; }
.act.share svg, .act.mute svg { fill: none; stroke: #fff; stroke-width: 2; width: 30px; height: 30px; }
.act.mute svg path:first-child { fill: #fff; }
.act.liked svg { fill: var(--mint); filter: drop-shadow(0 0 8px var(--mint)); animation: pop .35s; }
.act.discard svg { fill: none; stroke: #fff; stroke-width: 2; width: 30px; height: 30px; }
.act.discard .i-restore { display: none; }
.act.discard.restore .i-discard { display: none; }
.act.discard.restore .i-restore { display: block; stroke: var(--mint); }
.act.discard:hover svg { stroke: var(--mint); }
.post.tossing { animation: toss .38s ease-in forwards; }
@keyframes toss { to { transform: translateX(-30%) rotate(-8deg) scale(.85); opacity: 0; } }
@keyframes pop { 50% { transform: scale(1.35); } }
.mute .i-on { display: none; }
.unmuted .mute .i-on { display: block; }
.unmuted .mute .i-off { display: none; }

.big-heart { position: absolute; z-index: 3; font-size: 110px; color: var(--mint); text-shadow: 0 0 30px var(--mint); pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.4); }
.big-heart.show { animation: heart .8s ease-out forwards; }
@keyframes heart { 15% { opacity: 1; transform: translate(-50%,-50%) scale(1.15) rotate(-8deg); } 30% { transform: translate(-50%,-50%) scale(.95) rotate(-8deg); } 100% { opacity: 0; transform: translate(-50%,-140%) scale(1) rotate(-8deg); } }

.paused-icon { position: absolute; top: 50%; left: 50%; z-index: 3; transform: translate(-50%,-50%); font-size: 64px; color: rgba(255,255,255,.75); pointer-events: none; opacity: 0; transition: opacity .2s; }
.post.paused .paused-icon { opacity: 1; }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.15); z-index: 2; }
.progress span { display: block; height: 100%; width: 0; background: var(--mint); box-shadow: 0 0 8px var(--mint); }

/* ================= EMPTY STATES ================= */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center; background: radial-gradient(ellipse at 50% 40%, #0f2a20, #000 70%); }
.empty[hidden] { display: none; }
.empty h2 { font-size: 22px; margin-top: 18px; }
.empty p { color: var(--muted); max-width: 300px; line-height: 1.5; }
.empty b { color: var(--mint); }

/* ================= BOTTOM BAR ================= */
.bottombar {
  height: var(--bar-h);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: #000; border-top: 1px solid rgba(255,255,255,.08);
}
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: rgba(255,255,255,.6); }
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn.active { color: #fff; }
.nav-btn.active svg { stroke: var(--mint); }
.upload .plus {
  display: grid; place-items: center; width: 46px; height: 30px; border-radius: 9px;
  background: #fff; color: #000; font-size: 22px; font-weight: 800;
  box-shadow: -4px 0 0 var(--mint), 4px 0 0 var(--pink);
}

.toast { position: absolute; left: 50%; bottom: calc(var(--bar-h) + 20px); transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: rgba(18,26,23,.95); border: 1px solid rgba(62,255,176,.35); font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 20; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= SHEETS ================= */
.scrim { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .28s; }
.scrim.show { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 31;
  max-height: 88dvh; overflow-y: auto;
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid rgba(62,255,176,.3);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 50px rgba(62,255,176,.12);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.3,1);
}
.sheet.show { transform: none; }
.sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(255,255,255,.2); }
.sheet-tall { max-height: 94dvh; }
.sheet h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.sheet h3 { font-size: 20px; margin-bottom: 6px; }
.sheet-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.sheet-sub b { color: var(--text); }
.sheet-fine { margin-top: 14px; font-size: 12px; color: #6f8a80; text-align: center; }
.sheet-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--muted); background: rgba(255,255,255,.06); }
.sheet-icon { display: flex; justify-content: center; margin-bottom: 12px; filter: drop-shadow(0 0 14px var(--mint-glow)); }
#sheet-join { text-align: center; }
#sheet-join .field { text-align: left; }

.form { display: grid; gap: 14px; }
.form[hidden], .step[hidden] { display: none; }
.step { border: 0; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: #0b120f; border: 1px solid rgba(255,255,255,.12);
  color: var(--text); font: inherit; font-size: 16px; font-weight: 400;
  color-scheme: dark;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(62,255,176,.2); }
.form-error { color: #ff7a9c; font-size: 13.5px; }
.form-error[hidden] { display: none; }
.note { font-size: 13px; line-height: 1.5; color: var(--muted); padding: 12px 14px; border-radius: 12px; background: rgba(62,255,176,.07); border: 1px solid rgba(62,255,176,.2); }

.sent { text-align: center; display: grid; gap: 12px; justify-items: center; }
.sent[hidden] { display: none; }
.sent p { color: var(--muted); line-height: 1.5; }
.sent b { color: var(--text); }
.sent .btn { width: 100%; }
.sent-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: #04261a; background: var(--mint); box-shadow: 0 0 30px var(--mint-glow); }

.steps { list-style: none; display: flex; gap: 8px; margin-bottom: 18px; counter-reset: s; }
.steps[hidden] { display: none; }
.steps li { flex: 1; counter-increment: s; font-size: 12px; font-weight: 600; color: #6f8a80; padding-top: 10px; border-top: 3px solid rgba(255,255,255,.12); }
.steps li::before { content: counter(s) ". "; }
.steps li.active { color: var(--text); border-color: var(--mint); }
.steps li.done { color: var(--mint); border-color: var(--mint-deep); }

.upload-box { position: relative; display: grid; gap: 2px; padding: 16px 16px 16px 56px; border-radius: 14px; border: 1.5px dashed rgba(62,255,176,.35); background: #0b120f; cursor: pointer; }
.upload-box::before { content: "↑"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(62,255,176,.15); color: var(--mint); font-weight: 800; }
.upload-box.has-file { border-style: solid; border-color: var(--mint); }
.upload-box.has-file::before { content: "✓"; background: var(--mint); color: #04261a; }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-title { font-weight: 600; }
.up-hint { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.choice-group { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #0b120f; border: 1px solid rgba(255,255,255,.12); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--mint); background: rgba(62,255,176,.08); }
.choice input, .check input { accent-color: var(--mint); width: 18px; height: 18px; flex: none; }
.choice span { display: grid; }
.choice small { color: var(--muted); font-size: 12.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

.step-nav { display: flex; gap: 10px; margin-top: 4px; }
.step-nav .btn { flex: 1; }
.step-nav .btn[hidden] { display: none; }
.btn:disabled { opacity: .5; animation: none; cursor: default; }

.me-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.me-head .sheet-sub { margin: 0; word-break: break-all; }
.me-avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #04261a; background: linear-gradient(135deg, var(--mint-soft), var(--mint-deep)); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stats div { display: grid; gap: 2px; text-align: center; padding: 14px 6px; border-radius: 14px; background: #0b120f; }
.stats b { font-size: 18px; color: var(--mint); }
.stats span { font-size: 12px; color: var(--muted); }
#sheet-me .btn { width: 100%; margin-bottom: 10px; }

@media (min-width: 521px) {
  .app { border-left: 1px solid #1a2420; border-right: 1px solid #1a2420; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= UPLOAD ================= */
.progress-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress-bar[hidden] { display: none; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--mint); box-shadow: 0 0 10px var(--mint); transition: width .2s; }
a.btn { display: block; text-align: center; text-decoration: none; }
a.btn[hidden] { display: none; }
.feed-loading { height: calc(100dvh - var(--bar-h)); display: grid; place-items: center; scroll-snap-align: start; }

/* ================= SPONSORED (ads) ================= */
.ad-slot {
  position: relative;
  height: calc(100dvh - var(--bar-h));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid; place-items: center;
  padding: 72px 16px 24px; /* stay clear of the top bar — nothing may overlap the ad */
  background: radial-gradient(ellipse at 50% 45%, #0f2a20, #000 70%);
}
.ad-inner { display: grid; justify-items: center; gap: 12px; max-width: 100%; }
.ad-label { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.ad-box { max-width: 100%; display: grid; place-items: center; background: rgba(255,255,255,.03); border-radius: 8px; overflow: hidden; }
.ad-hint { font-size: 12px; color: #6f8a80; }

/* ================= FOOTER LINKS ================= */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 16px; font-size: 12px; }
.legal-links a { color: #6f8a80; text-decoration: none; }
.legal-links a:hover { color: var(--mint); }
