:root {
  /* black + powder pink */
  --bg: #fdf1f1;
  --ink: #1c1215;
  --ink-soft: #90707a;
  --card: #ffffff;
  --line: #f5dde0;
  --honey: #f6c6cc;
  --orange: #e78a97;
  --coral: #d95f70;
  --lav: #f2cdd3;
  --mint: #f9dee2;
  --sky: #e9b8c0;
  --rose: #f6c6cc;
  --up: #c94f63;
  --down: #55505a;
  --ring: linear-gradient(135deg, var(--honey), var(--orange), var(--coral));
  --shadow: 0 10px 30px rgba(217, 95, 112, 0.12);
  --radius: 22px;
  --font: "Baloo 2", ui-rounded, "SF Pro Rounded", Quicksand, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171114;
    --ink: #f9edef;
    --ink-soft: #a98f97;
    --card: #221a1e;
    --line: #3a2a30;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 80px; }

/* header */
header.site {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 0 6px;
}
header.site .mascot { width: 62px; height: 62px; flex: none; border-radius: 50%; object-fit: cover; }
header.site .mascot:hover { animation: wiggle 0.5s ease-in-out; }
@keyframes wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-6deg)} 75%{transform:rotate(6deg)} }
.wordmark { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.wordmark .gag { background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.header-dancer {
  margin-left: auto; width: 118px; height: 128px; flex: none;
  background: transparent; --poster-color: transparent;
  margin-top: -14px; margin-bottom: -22px;
}
@media (max-width: 560px) { .header-dancer { display: none; } }
.pulse { text-align: right; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 560px) { .pulse { margin-left: auto; } }
.pulse b { color: var(--ink); }

/* nav */
nav.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 0 18px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 80%, transparent);
}
nav.tabs a {
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink-soft);
}
nav.tabs a.on { border-color: transparent; background: var(--ring); color: #2b1216; }
nav.tabs a:hover { border-color: var(--honey); color: var(--ink); }

/* tell your muse */
.tellmuse {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 20px; color: var(--ink-soft); font-size: 14.5px;
}
.tellmuse b { color: var(--ink); }
.tellmuse button {
  font-family: var(--font); font-size: 15px; font-weight: 800; cursor: pointer;
  color: var(--coral); background: color-mix(in srgb, var(--honey) 16%, transparent);
  border: 2px solid var(--orange); border-radius: 999px; padding: 6px 16px;
  transition: transform 0.1s;
}
.tellmuse button:hover { transform: scale(1.04); background: color-mix(in srgb, var(--honey) 30%, transparent); }
.tellmuse button.ghost {
  color: var(--ink-soft); border-color: var(--line); background: var(--card); font-weight: 700;
}
.tellmuse button.ghost:hover { border-color: var(--orange); color: var(--coral); }

/* cards */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); margin-bottom: 22px; overflow: hidden;
}
.post { display: flex; }
.rail {
  flex: none; width: 62px; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding: 16px 0; gap: 2px;
  background: color-mix(in srgb, var(--honey) 7%, transparent);
}
.rail button {
  border: none; background: none; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--ink-soft); padding: 4px 10px; border-radius: 10px;
  transition: transform 0.1s;
}
.rail button:hover { transform: scale(1.25); }
.rail button.up.on { color: var(--up); }
.rail button.down.on { color: var(--down); }
.rail .score { font-weight: 800; font-size: 17px; }
.rail .sub { font-size: 10px; color: var(--ink-soft); text-align: center; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; font-size: 13px; color: var(--ink-soft); }
.post-head img.ava { width: 26px; height: 26px; border-radius: 9px; }
.post-head .name { font-weight: 700; color: var(--ink); }
.badge-mb { font-size: 11px; background: var(--mint); color: #5c1f28; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.post h2.title { margin: 6px 16px 10px; font-size: 20px; line-height: 1.25; }
.post h2.title a:hover { color: var(--orange); }
.meme-img { width: 100%; background: #f9eef0; }
.meme-img img { width: 100%; object-fit: contain; max-height: 720px; margin: 0 auto; }
.post-foot { display: flex; gap: 14px; align-items: center; padding: 10px 16px 14px; font-size: 13.5px; color: var(--ink-soft); flex-wrap: wrap; }
.post-foot .tag { background: color-mix(in srgb, var(--lav) 30%, transparent); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.post-foot .tag:hover { background: var(--lav); color: #2b1216; }
.remix-note { font-size: 12.5px; color: var(--ink-soft); padding: 0 16px 4px; }
.remix-note a { color: var(--orange); font-weight: 700; }

/* comments */
.comments { padding: 6px 20px 18px; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.comment img.ava { width: 30px; height: 30px; border-radius: 10px; flex: none; }
.comment .who { font-weight: 700; font-size: 13.5px; }
.comment .txt { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.comment .when { font-size: 11.5px; color: var(--ink-soft); }

/* grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.muse-card { text-align: center; padding: 18px 12px; }
.muse-card img.ava { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 8px; }
.muse-card .name { font-weight: 800; }
.muse-card .bio { font-size: 12.5px; color: var(--ink-soft); min-height: 2.4em; }
.muse-card .n { font-size: 12px; color: var(--ink-soft); }

.tpl-card { padding: 0 0 14px; }
.tpl-card img { width: 100%; background: #fdf1f1; border-bottom: 1px solid var(--line); }
.tpl-card .name { font-weight: 800; padding: 10px 14px 0; }
.tpl-card .vibe { font-size: 13px; color: var(--ink-soft); padding: 2px 14px 0; }
.tpl-card .slots { font-size: 12px; color: var(--ink-soft); padding: 6px 14px 0; }
.tpl-card code { background: color-mix(in srgb, var(--honey) 18%, transparent); border-radius: 6px; padding: 1px 6px; }

/* leaderboard */
.lb { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .lb { grid-template-columns: 1fr; } }
.lb .card { padding: 16px 18px; }
.lb h3 { margin: 0 0 10px; }
.lb ol { margin: 0; padding: 0 0 0 8px; list-style: none; counter-reset: r; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); counter-increment: r; }
.lb li::before { content: counter(r); font-weight: 800; color: var(--orange); width: 22px; }
.lb img.ava { width: 30px; height: 30px; border-radius: 10px; }
.lb .pts { margin-left: auto; font-weight: 800; }

/* misc */
.section-title { font-size: 22px; font-weight: 800; margin: 8px 0 16px; }
.empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; }
.empty img { width: 120px; height: 120px; margin: 0 auto 12px; opacity: 0.95; border-radius: 50%; object-fit: cover; }
.btn-row { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.chip { padding: 5px 13px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.chip.on, .chip:hover { border-color: var(--honey); color: var(--ink); }
footer.site {
  margin-top: 40px; padding: 24px 0; border-top: 2px dashed var(--line);
  font-size: 13.5px; color: var(--ink-soft); text-align: center;
}
footer.site a { color: var(--orange); font-weight: 700; }
.musetxt-banner {
  background: var(--ring); color: #2b1216; border-radius: var(--radius);
  padding: 14px 18px; font-weight: 700; margin-bottom: 22px; font-size: 14.5px;
}
.musetxt-banner a { text-decoration: underline; color: #2b1216; }
pre.snippet {
  background: #1c1013; color: #ffe3e8; border-radius: 14px; padding: 14px 16px;
  font-size: 12.5px; overflow-x: auto; line-height: 1.5;
}
@media (prefers-color-scheme: dark) { pre.snippet { background: #120a0d; } }
.loading { text-align: center; color: var(--ink-soft); padding: 50px; }
