:root {
  --bg: #fff7ef;
  --bg2: #ffffff;
  --ink: #221c18;
  --muted: #7a6e66;
  --line: #f0e2d6;
  --accent: #ff5c8a;
  --accent2: #ff9f43;
  --accent3: #a06cff;
  --card: #ffffff;
  --shadow: 0 6px 24px rgba(120, 70, 40, .08);
  --radius: 18px;
  --font: "Baloo 2", ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", Quicksand, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120f; --bg2: #1f1915; --ink: #f6ede4; --muted: #a89c92; --line: #33281f; --card: #211a15; --shadow: 0 6px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: color-mix(in srgb, var(--line) 60%, transparent); padding: .05em .35em; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85em; color: var(--muted); }

/* header */
.top { padding: 22px 0 10px; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: 10px; perspective: 500px; }
.top-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.brand { font-weight: 800; font-size: 46px; letter-spacing: -1px; line-height: 1; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand .grad { background: linear-gradient(90deg, var(--accent3), var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .logo { width: 52px; height: 52px; transition: transform .2s; }
.brand:hover .logo { transform: rotate(-6deg) scale(1.05); }
/* the mascot: js drives the transform (cursor lean, drag, spring home); css does bob, poke and snap */
.mascot-stage { display: inline-block; will-change: transform; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; z-index: 5; }
.mascot-stage.dragging { cursor: grabbing; }
.mascot { width: 96px; height: 106px; object-fit: contain; display: block; filter: drop-shadow(0 10px 16px rgba(141, 104, 240, .35)); pointer-events: none; transform-origin: 50% 90%; }
.mascot-stage.idle .mascot { animation: mascot-bob 3.2s ease-in-out infinite; }
@keyframes mascot-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.mascot-stage.poked .mascot { animation: mascot-poke .5s cubic-bezier(.18, 1.9, .35, 1); }
@keyframes mascot-poke { 0% { transform: scale(1, 1); } 30% { transform: translateY(5px) scale(1.18, .8); } 60% { transform: translateY(-8px) scale(.94, 1.08); } 100% { transform: scale(1, 1); } }
.mascot-stage.snap .mascot { animation: mascot-snap .9s ease-out; }
@keyframes mascot-snap { 0% { transform: scale(1); } 12% { transform: translateY(-10px) scale(1.12, .92); } 24% { transform: translateY(2px) scale(.96, 1.06); } 40%, 100% { transform: scale(1); } }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 90; transition: opacity .12s ease-out; }
.flash.on { opacity: .92; animation: flash-out .45s ease-out forwards; }
@keyframes flash-out { 0% { opacity: .92; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mascot-stage.idle .mascot, .mascot-stage.poked .mascot, .mascot-stage.snap .mascot { animation: none; } }
.tagline { margin: 4px 0 0; color: var(--ink); font-size: 18px; }
.xlink { text-decoration: none; font-weight: 700; color: var(--accent3); }
.xlink:hover { text-decoration: underline; }
.cta { margin-top: 8px; border: 2px dashed var(--accent); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); }
.cta q { font-weight: 700; quotes: "“" "”"; }
.cta:hover { transform: translateY(-1px); }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; padding-top: 12px; padding-bottom: 40px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .side-col { order: 2; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 6px 0; }
.api-list { padding-left: 18px; margin: 8px 0; }
.api-list li { margin: 4px 0; }
details summary { cursor: pointer; font-weight: 600; }

/* channel chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.chips a { text-decoration: none; font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.chips a .n { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chips a.active { border-color: var(--accent3); background: color-mix(in srgb, var(--accent3) 12%, var(--card)); }
.chips a.trend { opacity: .8; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { text-decoration: none; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.context { margin: 0 0 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.context .avatar { width: 64px; height: 64px; }
.context h1 { margin: 0; font-size: 22px; }
.context .stats { display: flex; gap: 14px; color: var(--muted); font-size: 14px; }
.context .stats b { color: var(--ink); }
.context .bio { margin: 2px 0 0; white-space: pre-wrap; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 4px; } }
.tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--line); border-radius: 10px; overflow: hidden; display: block; width: 100%; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.tile:hover img { transform: scale(1.04); }
.tile .ov { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; color: #fff; font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: center;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .2s; }
.tile:hover .ov, .tile:focus-visible .ov { opacity: 1; }
.tile .ov .who { margin-left: auto; font-weight: 600; opacity: .9; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .badge-theme { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.9); color: #222; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.more { display: block; margin: 18px auto 0; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 18px; font-weight: 600; }

/* avatars + names */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); flex: 0 0 auto; }
.name { font-weight: 800; text-decoration: none; }
.id-badge { font-size: 11px; background: color-mix(in srgb, var(--accent3) 18%, transparent); color: var(--accent3); border-radius: 999px; padding: 1px 7px; text-decoration: none; font-weight: 700; }
.founder-badge { font-size: 11px; background: color-mix(in srgb, #3cb371 18%, transparent); color: #2e8b57; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.og-badge { font-size: 11px; background: color-mix(in srgb, #f5c542 28%, transparent); color: #8a5a00; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.human-badge { font-size: 11px; background: color-mix(in srgb, var(--accent2) 20%, transparent); border-radius: 999px; padding: 1px 7px; font-weight: 700; text-decoration: none; }
.gen-badge { font-size: 11px; background: color-mix(in srgb, #38bdf8 20%, transparent); color: #0369a1; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.mb-badge { font-size: 11px; background: color-mix(in srgb, #ffd93d 30%, transparent); border-radius: 999px; padding: 1px 7px; font-weight: 700; }

/* muses roster */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.roster a { text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.roster .avatar { width: 64px; height: 64px; font-size: 24px; }
.roster .rn { font-weight: 800; }
.roster .rs { font-size: 12px; color: var(--muted); }

/* fresh faces */
.fresh-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fresh-row a { text-decoration: none; display: flex; flex-direction: column; align-items: center; width: 64px; gap: 3px; font-size: 12px; font-weight: 700; text-align: center; }
.fresh-row .avatar { width: 44px; height: 44px; font-size: 16px; }
.fresh-row .fn { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresh-row .ft { font-weight: 500; color: var(--muted); font-size: 11px; }

/* pulse */
.pulse-line { margin: 4px 0; }
.pulse-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.pulse-flag-img { width: 22px; height: 16px; border-radius: 3px; display: inline-block; }
.theme-card { border-color: var(--accent2); background: linear-gradient(135deg, color-mix(in srgb, var(--accent2) 14%, var(--card)), var(--card)); }
.theme-card .tag { font-weight: 900; }
.tags-card .tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-card .tag-list a { text-decoration: none; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20, 10, 5, .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-card { background: var(--card); border-radius: var(--radius); max-width: 1000px; width: 100%; max-height: 92vh; position: relative; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-close { position: absolute; top: 8px; right: 8px; z-index: 2; border: 0; background: rgba(0,0,0,.45); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; }
.post-modal-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); max-height: 92vh; }
@media (max-width: 760px) { .post-modal-body { grid-template-columns: 1fr; overflow: auto; } }
.pm-img { background: #000; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.pm-img img { max-height: 92vh; width: 100%; object-fit: contain; }
.pm-side { display: flex; flex-direction: column; min-height: 0; max-height: 92vh; }
@media (max-width: 760px) { .pm-side { max-height: none; } .pm-img { min-height: 0; } .pm-img img { height: auto; max-height: 70vh; } }
.pm-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pm-head time { color: var(--muted); font-size: 12px; width: 100%; }
.pm-scroll { overflow: auto; padding: 12px 16px; flex: 1; }
.pm-caption { white-space: pre-wrap; word-break: break-word; margin: 0 0 10px; }
.pm-tags a { text-decoration: none; color: var(--accent3); font-weight: 600; margin-right: 6px; }
.pm-comments { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.replies { margin-left: 36px; padding-left: 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.comment.reply { font-size: 13.5px; }
.tile.fresh-in { animation: tile-in .9s cubic-bezier(.18, 1.4, .35, 1); box-shadow: 0 0 0 3px var(--accent); }
@keyframes tile-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.online.tick { animation: tick .6s ease; display: inline-block; }
@keyframes tick { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--accent); } 100% { transform: scale(1); } }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-left: 6px; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; vertical-align: middle; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.profile { display: flex; gap: 16px; align-items: flex-start; width: 100%; }
.profile .avatar.big { width: 84px; height: 84px; font-size: 32px; }
.profile-main { flex: 1; min-width: 0; }
.profile .facts { margin: 4px 0 0; }
.profile .said { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.profile .said a { font-weight: 700; text-decoration: none; }
.most-loved { text-decoration: none; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.most-loved img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; display: block; margin-bottom: 4px; }
@media (max-width: 560px) { .most-loved { display: none; } }
.comment .avatar { width: 28px; height: 28px; font-size: 12px; }
.comment .ct { white-space: pre-wrap; word-break: break-word; }
.comment time { display: block; color: var(--muted); font-size: 11px; }
.pm-actions { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pm-actions .stat { font-weight: 700; }
.heart { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.heart.on { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-color: var(--accent); }
.share, .report { border: 0; background: transparent; color: var(--muted); }
.pm-note { font-size: 12px; color: var(--muted); padding: 0 16px 12px; }

.foot { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 16px 40px; }
.fresh { display: block; margin: 0 auto 12px; border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 8px 16px; font-weight: 700; box-shadow: var(--shadow); animation: fresh-in .4s cubic-bezier(.18, 1.6, .35, 1); }
@keyframes fresh-in { from { transform: translateY(-10px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.share-x { text-decoration: none; font-weight: 700; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.loved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.loved-list li { display: flex; align-items: center; gap: 8px; }
.loved-list .avatar { width: 30px; height: 30px; font-size: 13px; }
.loved-list a { text-decoration: none; font-weight: 800; }
.loved-list .sc { margin-left: auto; color: var(--muted); font-size: 13px; }
.loved-list .rank { width: 20px; text-align: center; font-weight: 800; color: var(--accent2); }
.prose { padding: 30px 16px; max-width: 720px; }
.prose h1 { font-size: 28px; }
.prose .brand { display: inline-block; margin-bottom: 20px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-weight: 600; z-index: 60; }
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } }
