:root {
  --bg: #0c0a11;
  --bg-2: #14111c;
  --card: #191424;
  --card-2: #221b31;
  --line: #2e2542;
  --text: #f1ecf9;
  --muted: #9d93b4;
  --accent: #ff3d7f;
  --accent-2: #9b5cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(155, 92, 255, .18), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(255, 61, 127, .14), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.pos { color: var(--ok); }
.neg { color: var(--accent); }
.pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, monospace; font-size: .85rem; text-align: left; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --- Layout ---------------------------------------------------------------- */

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 96px; }
.wrap-narrow { max-width: 520px; }
.col-narrow { max-width: 620px; margin: 0 auto; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.col-side { display: grid; gap: 16px; position: sticky; top: 88px; }
.stack { display: grid; gap: .75rem; }
.stack-lg { display: grid; gap: 24px; }
.page-title { font-size: 1.5rem; margin-bottom: 1rem; }
.section-title { font-size: 1.2rem; margin: 2rem 0 1rem; }

@media (max-width: 900px) {
  .columns { grid-template-columns: 1fr; }
  .col-side { position: static; order: -1; }
}

/* --- Topbar ---------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(12, 10, 17, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-center { justify-content: center; margin-bottom: 1rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: .85rem; color: #fff;
}
.brand-name { font-size: 1.05rem; }
.search { flex: 1; max-width: 320px; }
.search input { width: 100%; }
.topnav { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pill {
  padding: 7px 12px; border-radius: 999px; font-size: .92rem; color: var(--muted);
  border: 1px solid transparent; white-space: nowrap;
}
.pill:hover { background: var(--card); color: var(--text); text-decoration: none; }
.pill.is-active { background: var(--card-2); color: var(--text); border-color: var(--line); }

@media (max-width: 820px) {
  .search { display: none; }
  .topnav .pill { display: none; }
  .topnav .pill:nth-last-child(2) { display: inline-block; }
}

.badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .72rem; text-align: center; font-weight: 700;
}

.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; z-index: 50;
}
.menu-panel a, .menu-panel button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px;
  background: none; border: 0; color: var(--text); font: inherit; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--card-2); text-decoration: none; }

/* --- Tabbar (mobil) ------------------------------------------------------- */

.tabbar { display: none; }
@media (max-width: 820px) {
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(12, 10, 17, .95); border-top: 1px solid var(--line);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; text-align: center; font-size: .78rem; color: var(--muted); padding: 4px 0; }
  .tabbar a.is-active { color: var(--text); }
}

/* --- Buttons / Forms ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font: inherit; font-weight: 650; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn-sm { padding: 6px 12px; font-size: .86rem; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }

input, textarea, select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  background: #100d18; border: 1px solid var(--line); color: var(--text); font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-size: .92rem; color: var(--muted); }
label > input, label > textarea, label > select { color: var(--text); }
.hint { font-size: .8rem; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
legend { padding: 0 6px; color: var(--muted); font-size: .9rem; }
.radio { display: flex; align-items: flex-start; gap: 10px; color: var(--text); }
.radio input { width: auto; margin-top: 3px; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; flex: 1 1 90px; }
.inline-form select { width: auto; }
.searchbar { display: flex; gap: 8px; margin-bottom: 20px; }
.icon-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit;
  padding: 6px 8px; border-radius: 8px;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); text-decoration: none; }
.like-btn.is-on { color: var(--accent); }

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.empty { text-align: center; color: var(--muted); }
.big { font-size: 1.9rem; font-weight: 750; margin: 0 0 .5rem; }
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
.flash-error { border-color: #7f1d3a; background: #2a1020; }
.flash-success { border-color: #14603f; background: #0e2a1f; }
.flash-info { border-color: var(--line); }

.authbox { max-width: 440px; margin: 40px auto; }
.prose { line-height: 1.7; }
.prose h2 { margin-top: 1.6rem; font-size: 1.1rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* --- Hero / Landing ------------------------------------------------------- */

.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.03em; }
.lead { max-width: 620px; margin: 0 auto 1.5rem; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.creator-card { padding: 0; overflow: hidden; display: block; }
.creator-card:hover { text-decoration: none; border-color: var(--accent-2); }
.creator-banner { height: 96px; background: linear-gradient(135deg, #2a1f3d, #3d1f33); }
.creator-banner img { width: 100%; height: 100%; object-fit: cover; }
.creator-body { display: flex; gap: 10px; align-items: center; padding: 0 14px; margin-top: -22px; }
.creator-body .avatar { border: 3px solid var(--card); }
.creator-body > div { padding-top: 22px; }
.creator-bio { padding: 10px 14px 0; color: var(--muted); font-size: .9rem; }
.creator-meta {
  display: flex; gap: 10px; justify-content: space-between; padding: 12px 14px;
  font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 10px;
}
.creator-meta strong { color: var(--text); }
.name { font-weight: 650; }

/* --- Avatar --------------------------------------------------------------- */

.avatar {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: .85rem; border: 0; cursor: pointer; padding: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 34px; height: 34px; flex-basis: 34px; font-size: .72rem; }
.avatar-lg { width: 92px; height: 92px; flex-basis: 92px; font-size: 1.5rem; }

/* --- Feed / Post ---------------------------------------------------------- */

.feed { display: grid; gap: 16px; }
.feed .card + .card { margin-top: 0; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-who { display: grid; line-height: 1.25; min-width: 0; }
.post-who .muted { font-size: .82rem; }
.post-head .tag { margin-left: auto; }
.post-body { white-space: pre-wrap; word-break: break-word; }
.post-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 12px; flex-wrap: wrap; }
.tipform { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.tipform input { width: 80px; padding: 6px 10px; font-size: .86rem; }

.tag {
  font-size: .74rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); white-space: nowrap;
}
.tag-ppv { border-color: var(--accent); color: var(--accent); }
.tag-public { border-color: #2f6f52; color: var(--ok); }
.tag-ok { border-color: #2f6f52; color: var(--ok); }

.media-grid { display: grid; gap: 4px; border-radius: var(--radius-sm); overflow: hidden; margin: 10px 0; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
.media { margin: 0; background: #000; }
.media img, .media video { width: 100%; max-height: 640px; object-fit: contain; }
.media-grid.is-locked .media img { max-height: 340px; object-fit: cover; }
.blurred { filter: blur(2px) saturate(.75); }

.lockbox {
  text-align: center; padding: 20px; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); background: var(--card-2);
}
.lock-icon { font-size: 1.6rem; margin-bottom: 6px; }

.comments { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 14px; }
.comments li { display: flex; gap: 10px; }
.comments p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.commentform { display: flex; gap: 8px; }
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-preview img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }

/* --- Profil --------------------------------------------------------------- */

.profile { margin-bottom: 24px; }
.profile-banner {
  height: 200px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #2a1f3d, #3d1f33); border: 1px solid var(--line);
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { display: flex; gap: 16px; align-items: flex-end; padding: 0 8px; margin-top: -46px; flex-wrap: wrap; }
.profile-head .avatar-lg { border: 4px solid var(--bg); }
.profile-id h1 { font-size: 1.4rem; margin: 0; }
.profile-id p { margin: 0; font-size: .88rem; }
.profile-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.profile-bio { margin: 16px 8px; white-space: pre-wrap; }
.statrow { display: flex; gap: 24px; flex-wrap: wrap; padding: 14px 8px; }
.statrow > div { display: grid; }
.statrow strong { font-size: 1.15rem; }
.statrow span { color: var(--muted); font-size: .82rem; }

/* --- Listen / Tabellen ---------------------------------------------------- */

.userlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.userlist li { display: flex; align-items: center; gap: 10px; }
.userlist .muted { margin-left: auto; font-size: .84rem; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }

.imgrow { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.imgrow > div { display: grid; gap: 10px; }
.banner-preview {
  height: 110px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--card-2); border: 1px solid var(--line); min-width: 240px;
}
.banner-preview img { width: 100%; height: 100%; object-fit: cover; }

/* --- Chat ----------------------------------------------------------------- */

.chat-head { display: flex; align-items: center; gap: 12px; }
.chat-head .btn { margin-left: auto; }
.chat-log { display: grid; gap: 10px; margin: 16px 0; }
.bubble {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px;
  padding: 10px 14px; max-width: 78%; justify-self: start;
}
.bubble.mine {
  justify-self: end; border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, rgba(255, 61, 127, .22), rgba(155, 92, 255, .22));
  border-color: #46335e;
}
.bubble p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.bubble img, .bubble video { border-radius: 10px; margin-top: 6px; max-height: 420px; }
.bubble-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.bubble-locked { display: grid; gap: 8px; justify-items: center; }
.chat-form { display: grid; gap: 8px; }
.chat-form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chat-form-row input[type="file"] { flex: 1 1 160px; }
.chat-form-row input[type="text"] { width: 150px; }

.threadlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.thread-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.thread-row.is-unread { border-color: var(--accent-2); }
.thread-main { flex: 1; min-width: 0; }
.thread-main:hover { text-decoration: none; }
.preview { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Footer --------------------------------------------------------------- */

.sitefoot {
  max-width: 1100px; margin: 40px auto 0; padding: 20px 16px 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
  display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap;
}
.sitefoot nav { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 820px) { .sitefoot { margin-bottom: 70px; } }
