:root {
  --bg: #141416;
  --surface: #1a1a1d;
  --surface-2: #222226;
  --border: #3a332e;
  --text: #f6f0ea;
  --muted: #c6b8aa;
  --accent: #ffd9b8;
  --accent-2: #ffc48f;
  --ok: #ffd9b8;
  --badge: #38bdf8;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.page { max-width: 440px; margin: 0 auto; padding: 12px 12px 40px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 10px; color: var(--muted);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.brand-mark { color: var(--accent); font-size: 18px; }
.brand strong { color: var(--accent-2); }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.hero { position: relative; }
.cover { height: 170px; position: relative; overflow: hidden; }
.cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 85%; display: block;
}
.hero-lower { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 14px; margin-top: -44px; gap: 8px; }
.avatar-wrap { position: relative; width: 88px; height: 88px; flex: 0 0 auto; }
.avatar {
  width: 88px; height: 88px; border-radius: 50%; border: 4px solid var(--surface);
  object-fit: cover; display: block; background: #222226;
}
.online-dot { position: absolute; right: 6px; bottom: 8px; width: 14px; height: 14px; background: #ffb26b; border: 3px solid var(--surface); border-radius: 50%; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; padding-bottom: 6px; }
.stat { text-align: center; font-size: 11px; color: var(--muted); }
.stat strong { display: block; color: var(--text); font-size: 13px; margin-top: 1px; }
.stat small { font-size: 10px; }
.stat .ico { display: none; }

.bio { padding: 10px 16px 14px; }
.name-row h1 { font: 800 22px/1.2 "Manrope", sans-serif; margin: 4px 0 0; letter-spacing: -.3px; }
.badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--badge, #38bdf8); color: #041018; font-size: 11px; vertical-align: middle; box-shadow: 0 0 0 1px color-mix(in srgb, var(--badge, #38bdf8) 35%, transparent); }
.badge[hidden] { display: none; }
.handle { color: var(--accent-2); margin: 2px 0 8px; font-weight: 500; }
.bio-text { color: var(--muted); margin: 0 0 12px; line-height: 1.55; font-size: 14px; }
.bio-actions { display: flex; gap: 8px; }
.btn {
  font: 600 14px "DM Sans", sans-serif; border-radius: 12px; padding: 11px 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: .15s transform, .15s background;
}
.btn:hover { transform: translateY(-1px); background: #2a2a30; }
.btn.primary { background: linear-gradient(110deg, var(--accent), var(--accent-2)); color: #2a1608; border-color: var(--accent); flex: 1; }
.btn.ghost { background: #222226; }
.btn.icon-only { flex: 0 0 44px; padding: 0; display: grid; place-items: center; }
.btn.icon-only svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.profile-like { flex: 0 0 44px; padding: 0; display: grid; place-items: center; }
.btn.profile-like svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn.profile-like.liked { border-color: var(--accent); color: var(--accent-2); }
.btn.profile-like.liked svg { fill: var(--accent-2); stroke: var(--accent-2); }
.btn.profile-like:disabled { cursor: default; opacity: 1; transform: none; }
.btn.full { width: 100%; }

.tabs { border-top: 1px solid var(--border); }
.tab-bar { display: grid; grid-template-columns: 1fr 1fr; }
.tab { background: none; border: none; color: var(--muted); padding: 14px; font: 600 14px "DM Sans", sans-serif; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 12px; }
.tab-panel.active { display: block; }

.feed { display: flex; flex-direction: column; gap: 12px; }
.post { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.post-head strong { color: var(--text); }
.post-media { height: 260px; position: relative; display: grid; place-items: center; overflow: hidden; }
.ph { position: absolute; inset: 0; }
.ph.a { background: linear-gradient(160deg, #4a3424, #1b1b1f 60%); }
.ph.b { background: linear-gradient(160deg, #5c412b, #1b1b1f 60%); }
.ph.c { background: linear-gradient(160deg, #6e4d31, #1b1b1f 60%); }
.ph.d { background: linear-gradient(160deg, #3e3227, #1b1b1f 60%); }
.post-media.locked .ph { filter: blur(18px) brightness(.7); transform: scale(1.08); }
.lock-overlay { position: relative; z-index: 1; text-align: center; padding: 16px; }
.lock-overlay .lock-label { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.lock-overlay p { margin: 4px 0 10px; color: #f3e7da; font-weight: 600; }
.lock-overlay .btn { padding: 8px 14px; font-size: 13px; }
.post-body { padding: 10px 12px 12px; }
.post-body p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.post-actions { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.post-actions button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; padding: 0; }
.post-actions button.liked { color: var(--accent-2); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.media-item { aspect-ratio: 1; border-radius: 10px; position: relative; overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.media-item .ph { position: absolute; inset: 0; }
.media-item.locked .ph { filter: blur(10px) brightness(.6); transform: scale(1.05); }
.media-item .mini-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #f3e7da; text-transform: uppercase; background: rgba(10,10,12,.42); }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,10,12,.82); backdrop-filter: blur(6px); }
.modal-dialog {
  position: relative; width: min(420px, 100%); background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); z-index: 1;
}
.modal-dialog h3 { margin: 0 0 4px; font: 700 20px "Manrope", sans-serif; }
.modal-dialog .muted { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 18px; }
.plans { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.plan { display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.plan.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(255,217,184,.25); }
.plan small { display: block; color: var(--muted); font-weight: 400; }
.plan .price { color: var(--accent-2); font-weight: 700; }
.fake-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fake-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.fake-form input { background: #222226; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; }
.pay-method { font-size: 14px; color: var(--muted); padding: 4px 0; }
.pay-method strong { color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px);
  background: #222226; color: var(--text); border: 1px solid var(--border); padding: 10px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 60; font-size: 14px; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 380px) {
  .hero-lower { flex-direction: column; align-items: flex-start; margin-top: -40px; }
  .stats { width: 100%; padding-top: 4px; }
}

/* ---------- post media (photo / video) ---------- */
.post-img, .post-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.post-media.locked .post-img,
.post-media.locked .post-video { filter: blur(18px) brightness(.7); transform: scale(1.08); }
.video-badge {
  position: relative; z-index: 0;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 3px;
  background: rgba(10,10,12,.55); border: 1px solid rgba(255,255,255,.18);
  color: #f6f0ea; font-size: 15px; line-height: 1;
}
.media-item .video-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; font-size: 11px; padding-left: 2px;
}

/* ---------- polls ---------- */
.poll { padding: 2px 2px 4px; }
.poll-question { margin: 0 0 10px !important; color: var(--text) !important; font-weight: 600; font-size: 14px; line-height: 1.45; }
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font: 500 13px "DM Sans", sans-serif; cursor: pointer; text-align: left;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option.voted { cursor: default; border-color: var(--border); }
.poll-fill {
  position: absolute; inset: 0; width: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(255,217,184,.30), rgba(255,196,143,.14));
  transition: width .35s ease;
}
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-pct { color: var(--accent-2); font-weight: 700; font-size: 12px; }
.poll-total { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }

/* ---------- media sale ---------- */
.media-img, .media-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item.locked .media-img,
.media-item.locked .media-video { filter: blur(10px) brightness(.6); transform: scale(1.05); }
.media-item .sale-overlay {
  display: none; position: absolute; inset: 0; z-index: 3;
  flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 5px; text-align: center;
  background: rgba(10,10,12,.62); backdrop-filter: blur(2px);
}
.media-item .sale-overlay .sale-top {
  font-size: 8px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.media-item .sale-overlay strong { font-size: 12px; color: var(--accent-2); }
.media-item .sale-overlay .btn {
  padding: 6px 8px; font-size: 10px; border-radius: 8px;
  flex: 0 0 auto; line-height: 1; margin-top: 3px;
}

body.subscribed .post.locked .lock-overlay { display: none; }
body.subscribed .post.locked .ph,
body.subscribed .post.locked .post-img,
body.subscribed .post.locked .post-video { filter: none; transform: none; }
body.subscribed .media-item .mini-lock { display: none; }
body.subscribed .media-item.locked .ph,
body.subscribed .media-item.locked .media-img,
body.subscribed .media-item.locked .media-video { filter: none; transform: none; }
.media-item.is-sale:not(.purchased) .sale-overlay { display: flex; }
.media-item.is-sale:not(.purchased) .ph,
.media-item.is-sale:not(.purchased) .media-img,
.media-item.is-sale:not(.purchased) .media-video { filter: blur(10px) brightness(.6); transform: scale(1.05); }
.media-item.is-sale .mini-lock { display: none; }
.media-item.purchased .sale-overlay { display: none; }
.media-item.purchased .mini-lock { display: none; }
.media-item.purchased .ph,
.media-item.purchased .media-img,
.media-item.purchased .media-video { filter: none; transform: none; }

/* ---------- media purchase modal ---------- */
.media-modal-preview {
  position: relative; height: 160px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px;
  background: var(--surface-2);
}
.media-modal-preview .ph,
.media-modal-preview img,
.media-modal-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media-modal-preview img,
.media-modal-preview video,
.media-modal-preview .ph { filter: blur(12px) brightness(.6); transform: scale(1.06); }
.media-price { font: 800 22px "Manrope", sans-serif; color: var(--accent-2); margin: 0 0 12px; }
.btn.primary:disabled { transform: none; opacity: .8; cursor: default; }

.viewer-dialog { padding: 12px; }
.viewer-media {
  position: relative; height: min(62vh, 520px); overflow: hidden;
  border-radius: 14px; background: #0d0d10; border: 1px solid var(--border);
}
.viewer-media img,
.viewer-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.viewer-media .ph { position: absolute; inset: 0; }
.viewer-media .video-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.viewer-dialog h3 { margin: 12px 4px 4px; font: 700 16px "Manrope", sans-serif; }
.viewer-dialog .close { z-index: 2; background: rgba(20,20,22,.8); }
.media-modal-preview .video-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; }
