:root {
  --bg: #0a0a0c;
  --panel: #141417;
  --panel2: #1c1c21;
  --line: #27272e;
  --accent: #ff4d8d;
  --accent-ink: #2b0716;
  --violet: #a78bfa;
  --green: #4ade80;
  --red: #f87171;
  --text: #f4f4f6;
  --dim: #9b9ba6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.grow { flex-grow: 1; }
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- app frame ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 22px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg); flex-shrink: 0; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.brand .mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--violet)); display: flex; align-items: center; justify-content: center; color: #fff; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--dim); font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel2); }
.signin { background: var(--text); color: #111; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.ghost:hover { border-color: var(--dim); }

/* ---------- feed ---------- */
.feed { padding: 24px 24px 48px; max-width: 1400px; width: 100%; margin: 0 auto; }
.feedhead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.feedhead h1 { font-size: 24px; margin: 0; letter-spacing: -0.02em; }
.feedhead .hint { color: var(--dim); }
.filters { display: flex; gap: 8px; margin-bottom: 18px; }
.filters button { background: var(--panel); border: 1px solid var(--line); color: var(--dim); border-radius: 999px; padding: 6px 14px; font-weight: 600; cursor: pointer; }
.filters button.on { color: var(--text); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { position: relative; display: block; aspect-ratio: 3 / 4.6; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.card:hover img { transform: scale(1.03); }
.card .shade { position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.92)); }
.card .count { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 5px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; backdrop-filter: blur(6px); }
.card .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; }
.card .name { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.card .desc { color: #d3d3da; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
.card .meta { display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 600; }
.card .meta span { display: flex; align-items: center; gap: 5px; }
.card .meta .by { color: var(--dim); font-weight: 500; }

/* ---------- character page ---------- */
.cpage { display: flex; flex-grow: 1; min-height: calc(100vh - 56px); }
.stagecol { flex: 1 0 auto; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 16px 24px; }
/* shrink order when the window narrows: videos column first (flex-shrink 6), then the
   generation panel (1, down to 280px); the player never shrinks. */
.side { flex: 0 1 340px; min-width: 280px; border-right: 1px solid var(--line); height: calc(100vh - 56px); position: sticky; top: 56px; padding: 18px 16px; gap: 18px; overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.profile { display: flex; flex-direction: column; gap: 10px; }
.profile .row { display: flex; align-items: center; gap: 12px; }
.profile .avatar { width: 52px; height: 52px; border-radius: 999px; object-fit: cover; object-position: top; border: 2px solid var(--accent); }
.profile .name { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.profile .tagline { color: var(--dim); font-size: 13px; }
.profile .stats { color: var(--dim); font-size: 12px; font-weight: 600; gap: 14px; }
.profile .stats span { display: flex; align-items: center; gap: 5px; }
.profile .like { display: flex; align-items: center; gap: 6px; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 12px; cursor: pointer; }
.profile .like:hover { border-color: var(--accent); color: var(--accent); }
.profile .about { color: #c9c9d2; font-size: 13px; line-height: 1.45; }

.player { position: relative; height: calc(100vh - 88px); min-height: 480px; max-height: calc((100vw - 560px) * 16 / 9); aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 24px 70px rgba(0,0,0,.6); flex-shrink: 0; }
.player video, .player .poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: 14px; left: 14px; right: 104px; display: flex; gap: 8px; align-items: flex-start; }
.hud-bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.badge { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 11px; letter-spacing: .1em; border-radius: 6px; padding: 5px 8px; flex-shrink: 0; background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.14); color: var(--text); backdrop-filter: blur(6px); }
.badge.hot { background: var(--accent); color: #fff; border-color: var(--accent); }
.overlay { background: rgba(0,0,0,.66); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; min-width: 0; backdrop-filter: blur(8px); }
.overlay .label { color: var(--accent); font-size: 10px; letter-spacing: .12em; font-weight: 800; }
.overlay .who { color: var(--dim); font-size: 11px; margin-top: 2px; }
.overlay.gen { border-color: rgba(255,77,141,.5); display: flex; gap: 10px; align-items: center; max-width: 100%; }
.overlay.gen .ring { color: var(--accent); flex-shrink: 0; }
.overlay.gen .t { font-size: 13px; }
.overlay.gen .bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.14); margin-top: 6px; overflow: hidden; }
.overlay.gen .bar > div { height: 100%; background: var(--accent); }

/* ---------- right column: videos ---------- */
.col { background: var(--panel); display: flex; flex-direction: column; flex-shrink: 0; }
.clipcol { flex: 0 6 400px; min-width: 200px; border-left: 1px solid var(--line); height: calc(100vh - 56px); position: sticky; top: 56px; }
.colhead { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 8px; }
.colhead .h { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.colhead .n { color: var(--dim); font-size: 12px; font-weight: 700; }
.colhead .hint { font-size: 12px; color: var(--dim); }
.list { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.empty { color: var(--dim); padding: 10px; font-size: 13px; }
.clipcard { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; background: var(--bg); }
.clipcard:hover { border-color: var(--dim); }
.clipcard.selected { border-color: var(--accent); background: #1d1219; }
.clipcard .thumb { position: relative; width: 48px; height: 84px; border-radius: 8px; flex-shrink: 0; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.clipcard .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.clipcard.locked .thumb img { filter: blur(6px) brightness(.55); }
.clipcard.locked .thumb .lock { position: absolute; color: #fff; }
.clipcard .body { flex-grow: 1; min-width: 0; }
.clipcard .t { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clipcard .p { color: var(--dim); font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clipcard .s { color: var(--dim); font-size: 11px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.clipcard .s .tag { color: var(--violet); font-weight: 800; letter-spacing: .06em; }
.clipcard.selected .s .now { color: var(--accent); font-weight: 800; letter-spacing: .08em; }
.chip { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; border: 1px solid; border-radius: 999px; padding: 4px 10px; flex-shrink: 0; }
.chip.generating { color: var(--accent); border-color: var(--accent); }
.chip.unlock { color: var(--text); border-color: var(--line); background: var(--panel2); }
.clipcard.pending { border-style: dashed; border-color: rgba(255,77,141,.5); }
.paywall { margin: 6px 0 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel2); font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.paywall b { color: var(--text); }
.paywall button { margin-left: auto; background: var(--text); color: #111; border: 0; border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: 12px; cursor: pointer; white-space: nowrap; }


/* ---------- left panel: call to action ---------- */
.cta { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel2); }
.cta .make { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 12px; height: 48px; font-weight: 800; font-size: 15px; cursor: pointer; }
.cta .make.quiet { background: transparent; color: var(--dim); border-color: var(--line); }
.cta .make:disabled { background: var(--panel); color: var(--dim); border-color: var(--line); cursor: default; }
.cta .note { font-size: 12px; color: var(--dim); text-align: center; }
.cta .note.reply { color: var(--text); text-align: left; }
.cta .note.reply b { color: var(--accent); }
.cta .note.err { color: var(--red); }
.howto { display: flex; flex-direction: column; gap: 8px; color: var(--dim); font-size: 12.5px; }
.howto div { display: flex; gap: 10px; align-items: flex-start; }
.howto .n { width: 20px; height: 20px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- sound button on the player ---------- */
.soundbtn { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 999px; background: rgba(0,0,0,.7); color: var(--text); border: 1px solid rgba(255,255,255,.16); font-weight: 700; font-size: 12px; cursor: pointer; backdrop-filter: blur(6px); }
.soundbtn:hover { border-color: rgba(255,255,255,.4); }
.soundbtn.muted { background: var(--accent); border-color: var(--accent); color: #fff; padding-right: 14px; }
.hud-bottom { right: 14px; padding-right: 0; }
.player:has(.overlay.gen) .soundbtn { bottom: 84px; }

/* ---------- create sheet over the stage column ---------- */
.stagecol { position: relative; }
.sheet { position: absolute; inset: 0; background: rgba(10,10,12,.86); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 4; padding: 16px; }
.sheet .box { width: min(640px, 100%); max-height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.sheet .head { display: flex; align-items: center; gap: 10px; }
.sheet .head .h { font-size: 15px; font-weight: 800; }
.sheet .head .step { color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.sheet .close { margin-left: auto; background: transparent; border: 1px solid var(--line); color: var(--dim); border-radius: 999px; width: 30px; height: 30px; cursor: pointer; }
.sheet .close:hover { color: var(--text); border-color: var(--dim); }
.sheet .pick { display: flex; gap: 14px; min-height: 0; }
.sheet .big { flex: 0 0 200px; height: 300px; border-radius: 12px; overflow: hidden; position: relative; background: #000; }
.sheet .big img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.sheet .big .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 12px; }
.sheet .big .cap b { display: block; font-size: 14px; }
.sheet .grid3 { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: start; overflow-y: auto; }
.outfit { border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--panel2); cursor: pointer; position: relative; }
.outfit img { width: 100%; height: 88px; object-fit: cover; object-position: top; display: block; }
.outfit .t { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 5px; font-size: 10px; font-weight: 800; text-align: center; letter-spacing: .02em; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.outfit:hover { border-color: var(--dim); }
.outfit.selected { border-color: var(--accent); }
.outfit.selected .t::before { content: '✓ '; color: var(--accent); }
.sheet .ask { display: flex; flex-direction: column; gap: 8px; }
.sheet .ask label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--dim); }
.ask-text { width: 100%; resize: none; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 13px 14px; font: inherit; font-size: 15px; line-height: 1.4; min-height: 50px; max-height: 160px; outline: none; }
.ask-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,77,141,.18); }
.ask-text.attn { border-color: var(--accent); animation: nudge .35s ease; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
.sheet .ask .row { display: flex; gap: 12px; align-items: center; }
.sheet .ask .hint { flex: 1; font-size: 12px; color: var(--dim); }
.sheet .ask .hint.attn { color: var(--accent); font-weight: 700; }
.sheet .ask .send { display: flex; align-items: center; gap: 6px; background: var(--accent); border: 1px solid var(--accent); border-radius: 12px; color: #fff; font-weight: 800; padding: 0 18px; height: 46px; cursor: pointer; white-space: nowrap; }
.sheet .ask .send:disabled { background: var(--panel2); color: var(--dim); border-color: var(--line); cursor: default; pointer-events: none; }
.sheet .ask .sendwrap { display: inline-flex; }
