/* frontend/css/style.css — Barakuda design system */

/* ─────────────────────────────────────────────────────────────
   TOKENS
   ───────────────────────────────────────────────────────────── */
:root {
    --bg:          #0b0d14;
    --surface:     #141822;
    --surface-2:   #1c2130;
    --surface-3:   #262c3d;
    --border:      rgba(255, 255, 255, .08);
    --border-loud: rgba(255, 255, 255, .16);

    --text:        #f2f4f8;
    --text-dim:    #a8b0c2;
    --text-muted:  #6f7889;

    --accent:      #ff2e63;
    --accent-dim:  #c41f49;
    --accent-soft: rgba(255, 46, 99, .14);
    --violet:      #8b5cf6;
    --gold:        #f5b93b;
    --gold-soft:   rgba(245, 185, 59, .14);
    --green:       #34d399;
    --red:         #f87171;
    --blue:        #60a5fa;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-full: 999px;

    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
    --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

    --header-h: 56px;
    --nav-h: 64px;

    --shadow-md: 0 4px 16px rgba(0, 0, 0, .32);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .48);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─────────────────────────────────────────────────────────────
   BASE
   ───────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

/* Telegram's webview resizes when the sheet is collapsed and restored.
   `dvh` follows that on its own; --app-height is the fallback for older
   webviews and is only written when the reported height is sane. */
:root { --app-height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

#app-root {
    display: flex;
    flex-direction: column;
    height: var(--app-height);
    padding-top: var(--safe-top);
}
@supports (height: 100dvh) {
    #app-root { height: 100dvh; }
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ─────────────────────────────────────────────────────────────
   ICONS
   Stroke attributes are hoisted here so the sprite stays compact.
   ───────────────────────────────────────────────────────────── */
.ic {
    width: 22px;
    height: 22px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 44px; height: 44px; stroke-width: 1.5; }

/* ─────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────── */
.header {
    height: var(--header-h);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 0 var(--sp-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.logo .ic { color: var(--accent); }

.badge-18 {
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

.coins-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-full);
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 700;
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────────────────────── */
.main { flex: 1; position: relative; min-height: 0; }

.section {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    min-height: 0;
}
.section.active { display: flex; }

.scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--sp-4);
    padding-bottom: calc(var(--sp-6) + var(--safe-bottom));
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.015em;
    margin-bottom: var(--sp-3);
}
.section-subtitle {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: var(--sp-4);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
}

/* ─────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    width: 100%;
    min-height: 46px;
    padding: 0 var(--sp-4);
    border-radius: var(--r-md);
    font-size: .92rem;
    font-weight: 650;
    transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-gold      { background: var(--gold); color: #1a1206; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost     { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-danger    { background: transparent; color: var(--red); border: 1px solid rgba(248,113,113,.32); }

.btn-sm { min-height: 34px; width: auto; font-size: .82rem; padding: 0 var(--sp-3); border-radius: var(--r-sm); }

.btn-row { display: flex; gap: var(--sp-2); }
.btn-row .btn { width: auto; flex: 1; }

/* File pickers are <label for="…"> rather than a button calling input.click():
   some webviews refuse a synthetic click on a hidden input, which made the
   picker dead on desktop while working on mobile. A label opens it natively.
   The input must stay rendered — display:none would break the label link in
   the same engines — so it is clipped instead. */
.file-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.file-input:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─────────────────────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-3); }
.field-row { display: flex; gap: var(--sp-2); }
.field-row .field { flex: 1; }

.label {
    display: block;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input, .select, .textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px var(--sp-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: var(--sp-5); }

.hint { font-size: .74rem; color: var(--text-muted); margin-top: 6px; }

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-2) 0;
}
.toggle {
    width: 46px; height: 27px; flex: none;
    background: var(--surface-3);
    border-radius: var(--r-full);
    position: relative;
    transition: background .18s ease;
}
.toggle::after {
    content: '';
    position: absolute; top: 3px; left: 3px;
    width: 21px; height: 21px;
    background: #fff;
    border-radius: 50%;
    transition: transform .18s ease;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(19px); }

/* ─────────────────────────────────────────────────────────────
   DISCOVER / SWIPE
   ───────────────────────────────────────────────────────────── */
.filter-bar {
    flex: none;
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
}
.filter-bar .select, .filter-bar .input { min-height: 38px; font-size: .84rem; padding: 6px 10px; }

.likes-left {
    flex: none;
    text-align: center;
    font-size: .76rem;
    color: var(--text-muted);
    padding-bottom: var(--sp-2);
}

.swipe-area {
    flex: 1;
    position: relative;
    margin: 0 var(--sp-4);
    min-height: 0;
}
.card-stack { position: absolute; inset: 0; }

.swipe-card {
    position: absolute;
    inset: 0;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
    will-change: transform;
    touch-action: pan-y;
}
.swipe-card > img { width: 100%; height: 100%; object-fit: cover; }

.card-shade {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--sp-5) var(--sp-4) var(--sp-4);
    background: linear-gradient(to top, rgba(6,8,14,.96) 12%, rgba(6,8,14,.72) 48%, transparent);
}
.card-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -.02em;
}
.card-name .ic { color: var(--blue); }
.card-name .ic.premium { color: var(--gold); }

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--text-dim);
    margin-top: 3px;
}
.card-bio {
    font-size: .85rem;
    color: var(--text-dim);
    margin-top: var(--sp-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-facts {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
    font-size: .78rem;
    color: var(--text-dim);
}
.card-facts span { display: inline-flex; align-items: center; }
.card-facts .ic-sm { margin-right: 4px; color: var(--text-muted); }

.card-sub-price {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: var(--sp-3);
    padding: 7px 12px;
    border-radius: var(--r-full);
    background: var(--gold-soft);
    color: var(--gold);
    font-size: .78rem;
    font-weight: 650;
}
.card-sub-price.free { background: rgba(52,211,153,.14); color: var(--green); }

/* Sits above the card so the profile is one tap away — the swipe deck alone
   never shows enough to decide whether a creator is worth paying for. */
.card-info {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: var(--r-full);
    background: rgba(6, 8, 14, .68);
    backdrop-filter: blur(6px);
    color: var(--text);
    font-size: .76rem;
    font-weight: 650;
}
.card-info:active { transform: scale(.95); }

.dot-online {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex: none;
}

.stamp {
    position: absolute;
    top: 28px;
    padding: 6px 14px;
    border: 3px solid;
    border-radius: var(--r-md);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .06em;
    opacity: 0;
    pointer-events: none;
}
.stamp.like { left: 20px; color: var(--green); border-color: var(--green); transform: rotate(-14deg); }
.stamp.nope { right: 20px; color: var(--red);   border-color: var(--red);   transform: rotate(14deg); }

.gone-left  { transform: translateX(-140%) rotate(-24deg) !important; opacity: 0; }
.gone-right { transform: translateX(140%)  rotate(24deg)  !important; opacity: 0; }
.gone-up    { transform: translateY(-140%) !important; opacity: 0; }

.swipe-actions {
    flex: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--sp-4);
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

/* Each control is captioned: an icon alone does not tell a first-time user
   what a lightning bolt costs or what a heart actually does here. */
.act-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 68px;
}
.act-label {
    font-size: .66rem;
    line-height: 1.2;
    text-align: center;
    color: var(--text-muted);
}

.act {
    width: 54px; height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: transform .12s ease;
}
.act:active { transform: scale(.9); }
.act.nope  { color: var(--red); }
.act.super { color: var(--violet); }
.act.like  { color: var(--green); background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); }
.act.gift  { color: var(--gold); }

/* ─────────────────────────────────────────────────────────────
   POSTS FEED
   ───────────────────────────────────────────────────────────── */
.feed-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.feed-head h2 { font-size: 1.05rem; font-weight: 700; }

.posts-stream {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--sp-3);
    padding-bottom: calc(var(--sp-6) + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    min-height: 0;
}

.post {
    /* The stream is a flex column, so without this every card shrinks to
       share the visible height and the media collapses into a thin strip. */
    flex: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.post-head {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3);
}

/* Tapping the author is the gesture people try first, so it is a real target
   rather than decoration next to a small icon button. */
.post-author-block {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex: 1;
    min-width: 0;
    padding: 4px;
    margin: -4px;
    border-radius: var(--r-md);
}
.post-author-block[onclick]:active { background: var(--surface-2); }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.post-author { display: flex; align-items: center; gap: 5px; font-weight: 650; font-size: .9rem; }
.post-author .ic { color: var(--blue); }
.post-handle { font-size: .76rem; color: var(--text-muted); }
.post-caption { padding: 0 var(--sp-3) var(--sp-3); font-size: .88rem; color: var(--text-dim); }

.post-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: var(--surface-3);
    overflow: hidden;
}
.post-media img { width: 100%; height: 100%; object-fit: cover; }

/* The locked state is a placeholder, not a blurred image: the server never
   sends the URL until it is paid for, so there is nothing to blur. */
.post-locked {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-5);
    text-align: center;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 12px, transparent 12px 24px),
        var(--surface-2);
}
.post-locked .ic-xl { color: var(--text-muted); }
.post-locked-title { font-weight: 700; font-size: .95rem; }
.post-locked-note  { font-size: .78rem; color: var(--text-muted); }

.post-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-3);
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-muted);
}
.post-bar button { display: flex; align-items: center; gap: 5px; color: inherit; }
.post-bar .price { margin-left: auto; color: var(--gold); font-weight: 650; }

/* ─────────────────────────────────────────────────────────────
   CHATS
   ───────────────────────────────────────────────────────────── */
.tabs {
    flex: none;
    display: flex;
    gap: var(--sp-1);
    padding: var(--sp-3) var(--sp-4);
}
.tab {
    flex: 1;
    text-align: center;
    padding: 9px;
    border-radius: var(--r-sm);
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
}
.tab.active { background: var(--accent); color: #fff; }

.chat-list { flex: 1; overflow-y: auto; padding-bottom: calc(var(--sp-5) + var(--safe-bottom)); }

.chat-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.chat-item:active { background: var(--surface); }
.chat-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; flex: none; }
.chat-info { flex: 1; min-width: 0; }
.chat-name { display: flex; align-items: center; gap: 5px; font-weight: 650; font-size: .92rem; }
.chat-name .ic { color: var(--gold); }
.chat-preview {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-side { text-align: right; flex: none; }
.chat-time { font-size: .7rem; color: var(--text-muted); }
.chat-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px; height: 20px;
    margin-top: 4px;
    padding: 0 6px;
    border-radius: var(--r-full);
    background: var(--accent);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   CHAT ROOM
   ───────────────────────────────────────────────────────────── */
.chat-room {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    flex-direction: column;
    background: var(--bg);
    padding-top: var(--safe-top);
}
.chat-room.active { display: flex; }

.cr-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    height: var(--header-h);
    padding: 0 var(--sp-3);
    border-bottom: 1px solid var(--border);
}
.cr-peer {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex: 1;
    min-width: 0;
    padding: 4px;
    border-radius: var(--r-md);
}
.cr-peer:active { background: var(--surface-2); }
.cr-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.cr-name { font-weight: 650; font-size: .95rem; }
.cr-status { font-size: .72rem; color: var(--green); }
.cr-actions { margin-left: auto; display: flex; gap: var(--sp-1); }
.cr-actions button { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--text-dim); }
.cr-actions button.on { color: var(--gold); }

.messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.msg {
    max-width: 78%;
    padding: 9px var(--sp-3);
    border-radius: var(--r-lg);
    font-size: .89rem;
    word-break: break-word;
}
.msg.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: var(--sp-1); }
.msg.in  { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: var(--sp-1); }
.msg-time { font-size: .64rem; opacity: .65; margin-top: 3px; text-align: right; }

.msg-gift {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-3);
}
.msg-gift .ic-xl { color: var(--gold); }
.msg-gift-title { font-size: .78rem; font-weight: 650; }

.msg-media { padding: 4px; }
.msg-media img { border-radius: var(--r-md); max-height: 320px; object-fit: cover; }
.msg-ppv {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-5) var(--sp-4);
    border-radius: var(--r-md);
    background: var(--surface-3);
    text-align: center;
}
.msg-ppv .ic-lg { color: var(--gold); }

.chat-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    padding-bottom: calc(var(--sp-2) + var(--safe-bottom));
    border-top: 1px solid var(--border);
}
.chat-bar .icon-btn {
    width: 40px; height: 40px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--text-dim);
}
.chat-bar input {
    flex: 1;
    min-height: 40px;
    padding: 0 var(--sp-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    outline: none;
}
.chat-bar .send { color: var(--accent); }

/* ─────────────────────────────────────────────────────────────
   WALLET
   ───────────────────────────────────────────────────────────── */
.stat-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.stat {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-3);
}
.stat-label { font-size: .72rem; color: var(--text-muted); margin-bottom: 4px; }
.stat-value {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.28rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stat-value.gold  { color: var(--gold); }
.stat-value.green { color: var(--green); }
.stat-note { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }

.promo {
    background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(255,46,99,.14));
    border: 1px solid rgba(139,92,246,.28);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
}
.promo h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: 1.02rem; font-weight: 700; }
.promo h3 .ic { color: var(--gold); }
.promo ul { list-style: none; margin: var(--sp-3) 0; display: flex; flex-direction: column; gap: 6px; }
.promo li { display: flex; align-items: center; gap: var(--sp-2); font-size: .84rem; color: var(--text-dim); }
.promo li .ic-sm { color: var(--green); }

.pack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.pack {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-3);
    text-align: center;
    transition: border-color .15s ease;
}
.pack:active { border-color: var(--gold); }
.pack-coins {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    font-size: 1.08rem; font-weight: 700; color: var(--gold);
}
.pack-stars { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }
.pack-bonus {
    position: absolute; top: -7px; right: 8px;
    padding: 2px 7px;
    border-radius: var(--r-full);
    background: var(--green);
    color: #06281c;
    font-size: .62rem;
    font-weight: 800;
}

.tx-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}
.tx-row:last-child { border-bottom: none; }
.tx-icon {
    width: 34px; height: 34px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-dim);
}
.tx-main { flex: 1; min-width: 0; }
.tx-date { font-size: .7rem; color: var(--text-muted); }
.tx-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amount.in  { color: var(--green); }
.tx-amount.out { color: var(--text-dim); }

.status-pill {
    padding: 2px 9px;
    border-radius: var(--r-full);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.status-pill.pending  { background: var(--gold-soft); color: var(--gold); }
.status-pill.paid     { background: rgba(52,211,153,.14); color: var(--green); }
.status-pill.rejected { background: rgba(248,113,113,.14); color: var(--red); }

/* ─────────────────────────────────────────────────────────────
   PROFILE
   ───────────────────────────────────────────────────────────── */
.profile-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.profile-avatar {
    width: 68px; height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-loud);
    flex: none;
}
.profile-name { display: flex; align-items: center; gap: 6px; font-size: 1.12rem; font-weight: 700; }
.profile-handle { font-size: .8rem; color: var(--text-muted); }

/* Thumbnail strip on the creator sheet: shows how much content exists and how
   much of it is behind the paywall, which is what the subscribe decision needs. */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-1);
    margin-bottom: var(--sp-3);
}
.preview-cell {
    aspect-ratio: 1;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface-2);
}
.preview-cell img { width: 100%; height: 100%; object-fit: cover; }
.preview-locked {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    background: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 8px, transparent 8px 16px);
}

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.photo-cell {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell .lock-badge {
    position: absolute; top: 5px; right: 5px;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(6,8,14,.7);
    color: var(--gold);
}
.photo-add {
    display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--border-loud);
    color: var(--text-muted);
    cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────
   BOTTOM NAV
   ───────────────────────────────────────────────────────────── */
.nav {
    flex: none;
    display: flex;
    height: var(--nav-h);
    padding-bottom: var(--safe-bottom);
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.nav-btn {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: .64rem;
    font-weight: 600;
    transition: color .15s ease;
}
.nav-btn.active { color: var(--accent); }
.nav-badge {
    position: absolute;
    top: 6px;
    left: 50%;
    margin-left: 4px;
    min-width: 17px; height: 17px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    background: var(--accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: flex-end;
    background: rgba(4, 6, 11, .72);
    backdrop-filter: blur(3px);
}
.modal.active { display: flex; }

.modal-body {
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-top: 1px solid var(--border-loud);
    padding: var(--sp-4);
    padding-bottom: calc(var(--sp-5) + var(--safe-bottom));
    animation: sheet-up .24s cubic-bezier(.16, 1, .3, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}
.modal-head h3 { font-size: 1.06rem; font-weight: 700; }
.modal-close { color: var(--text-muted); display: flex; }

.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: var(--sp-3) var(--sp-2);
    background: var(--surface-2);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    transition: border-color .15s ease;
}
.gift-item.selected { border-color: var(--gold); background: var(--gold-soft); }
.gift-item .ic-lg { color: var(--gold); }
.gift-name { font-size: .7rem; color: var(--text-dim); text-align: center; }
.gift-price { display: flex; align-items: center; gap: 3px; font-size: .76rem; font-weight: 700; color: var(--gold); }

.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.amount-chip {
    padding: 10px 0;
    text-align: center;
    background: var(--surface-2);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    font-weight: 700;
    font-size: .86rem;
}
.amount-chip.selected { border-color: var(--gold); color: var(--gold); }

/* ─────────────────────────────────────────────────────────────
   MATCH POPUP
   ───────────────────────────────────────────────────────────── */
.match-popup {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    background: rgba(4, 6, 11, .88);
    backdrop-filter: blur(6px);
}
.match-popup.active { display: flex; }
.match-inner { text-align: center; max-width: 340px; width: 100%; }
.match-inner h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(100deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.match-avatars { display: flex; justify-content: center; margin: var(--sp-4) 0; }
.match-avatars img {
    width: 92px; height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg);
}
.match-avatars img:last-child { margin-left: -22px; }

/* ─────────────────────────────────────────────────────────────
   VIDEO CALL
   ───────────────────────────────────────────────────────────── */
.video-screen {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    flex-direction: column;
    background: #05070c;
}
.video-screen.active { display: flex; }

.video-stage { flex: 1; position: relative; overflow: hidden; }
.video-stage video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    background: #05070c;
}
.video-self {
    position: absolute;
    top: calc(var(--safe-top) + var(--sp-3));
    right: var(--sp-3);
    width: 104px;
    aspect-ratio: 3 / 4;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border-loud);
    z-index: 2;
}
.video-self video { object-fit: cover; }

.video-meter {
    position: absolute;
    top: calc(var(--safe-top) + var(--sp-3));
    left: var(--sp-3);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px var(--sp-3);
    border-radius: var(--r-full);
    background: rgba(6,8,14,.72);
    font-size: .78rem;
    font-weight: 650;
}
.video-meter .ic-sm { color: var(--gold); }

.video-controls {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    padding-bottom: calc(var(--sp-4) + var(--safe-bottom));
}
.video-controls .act.end { background: var(--red); color: #fff; border-color: transparent; }
.video-controls .act.muted { background: var(--red); color: #fff; border-color: transparent; }

/* Says what the call is doing while there is no picture yet — a black screen
   with no explanation reads as a broken app. */
.video-state {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    text-align: center;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text-dim);
    background: rgba(5, 7, 12, .82);
}
.video-state[hidden] { display: none; }
.video-state.tappable { cursor: pointer; color: var(--text); }
.video-state.tappable::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* ─────────────────────────────────────────────────────────────
   AGE GATE
   Above every other layer, including the watermark, so nothing of the
   content is visible behind it before the visitor confirms.
   ───────────────────────────────────────────────────────────── */
.age-gate {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    background: var(--bg);
}
.age-gate[hidden] { display: none; }

.age-gate-inner {
    width: 100%;
    max-width: 340px;
    text-align: center;
}
.age-gate-inner .ic-xl { margin: 0 auto var(--sp-4); color: var(--accent); }
.age-gate-inner h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: var(--sp-2);
}
.age-gate-inner p {
    font-size: .88rem;
    color: var(--text-muted);
    margin-bottom: var(--sp-5);
}
.age-gate-inner .btn { margin-bottom: var(--sp-2); }

/* ─────────────────────────────────────────────────────────────
   FEEDBACK
   ───────────────────────────────────────────────────────────── */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-6) var(--sp-4);
    text-align: center;
    color: var(--text-muted);
}
.empty .ic-xl { color: var(--surface-3); }
.empty-title { font-size: .95rem; font-weight: 650; color: var(--text-dim); }
.empty-note { font-size: .82rem; }

.spinner {
    width: 26px; height: 26px;
    margin: var(--sp-6) auto;
    border: 2.5px solid var(--surface-3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-host {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--sp-3));
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    width: calc(100% - var(--sp-6));
    max-width: 420px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 11px var(--sp-3);
    border-radius: var(--r-md);
    background: var(--surface-3);
    border: 1px solid var(--border-loud);
    box-shadow: var(--shadow-md);
    font-size: .85rem;
    animation: toast-in .22s ease;
}
.toast.ok    { border-color: rgba(52,211,153,.4); }
.toast.ok    .ic-sm { color: var(--green); }
.toast.err   { border-color: rgba(248,113,113,.4); }
.toast.err   .ic-sm { color: var(--red); }
.toast.info  .ic-sm { color: var(--blue); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

#watermark {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: .05;
    font-size: .7rem;
    color: #fff;
    overflow: hidden;
}
