/* Parkboxd: Letterboxd layout, South Park construction paper */

:root {
  --bg: #14181c;
  --bg-deep: #0f1215;
  --surface: #242c34;
  --surface-2: #2a3440;
  --line: #2c3640;
  --line-2: #3a4654;
  --text: #d8e0e8;
  --text-soft: #c9d6e2;
  --muted: #8a9aaa;
  --white: #fff;
  --green: #3fb950;
  --orange: #f2711c;
  --blue: #6aa8f0;
  --blue-2: #4a90e2;
  --blue-hover: #9cc6f7;
  --yellow: #f5c518;
  --red: #d63a3a;
  --sky: #1a2a3a;
  --font-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-cut: 'Luckiest Guy', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-body);
}

main { flex: 1; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-weight: 400; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Signature pieces ---- */

.paper {
  clip-path: polygon(0 3%, 4% 0, 48% 2%, 96% 0, 100% 4%, 99% 50%, 100% 96%, 95% 100%, 52% 98%, 3% 100%, 0 95%, 1% 48%);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px);
}

.cut { font-family: var(--font-cut); letter-spacing: .02em; font-weight: 400; }

/* ---- Header ---- */

.site-header { background: var(--bg-deep); border-bottom: 1px solid var(--surface); }

.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  padding-top: 14px; padding-bottom: 14px;
}

.logo { display: flex; gap: 2px; align-items: center; }
.logo-letter {
  display: inline-block; padding: 4px 6px 2px; color: var(--bg); line-height: 1.1;
}
.logo:hover .logo-letter:nth-child(odd) { transform: rotate(0deg) !important; }

.main-nav {
  display: flex; flex-wrap: wrap; gap: 20px;
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
}
.main-nav a { color: var(--text); }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--green); }
.nav-soon { color: var(--muted); cursor: default; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.header-link {
  color: var(--text); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
}

.avatar {
  --size: 40px; --c: var(--orange);
  width: var(--size); height: var(--size); flex: 0 0 var(--size);
  border-radius: 50%; border: 2px solid var(--c); background: var(--surface-2); color: var(--c);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: calc(var(--size) * .42); line-height: 1;
}
.avatar-link { display: inline-flex; border-radius: 50%; }

/* Badge flair */
.avatar.gold-ring { border-color: #f5c518; box-shadow: 0 0 0 2px #14181c, 0 0 0 4px #f5c518, 0 0 12px rgba(245,197,24,.55); }
.flair-critic {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; vertical-align: 1px;
  background: rgba(106,168,240,.18); color: #b9d6fa; font: 700 10px var(--font-body); text-transform: uppercase; letter-spacing: .06em;
}
.flair-spicy { margin-left: 4px; font-size: .9em; }

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

.site-footer { border-top: 1px solid var(--surface); background: var(--bg-deep); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 24px; padding-bottom: 24px; font-size: 13px; color: var(--muted);
}
.footer-inner span { max-width: 640px; }
.footer-inner a { color: var(--text-soft); text-decoration: underline; }

.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-align: left;
}
.link-button:hover { color: var(--orange); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 6px; padding: 10px 16px; cursor: pointer;
  font: 700 13px var(--font-body); text-transform: uppercase; letter-spacing: .06em;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-green { background: var(--green); color: var(--bg-deep); }
.btn-green:hover { background: #57c967; color: var(--bg-deep); }
.btn-orange { background: var(--orange); color: var(--bg); }
.btn-orange:hover { background: #f5873f; color: var(--bg); }
.btn-outline { background: transparent; color: var(--orange); border: 2px solid var(--orange); padding: 8px 14px; }
.btn-outline:hover { color: var(--bg); background: var(--orange); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--line-2); color: var(--white); }

.btn-paper {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; font-weight: 700; font-size: 15px; color: var(--bg-deep);
}
.btn-paper:hover { color: var(--bg-deep); filter: brightness(1.08); }

/* ---- Sections ---- */

.page { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }

.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 0 0 18px;
}
.section-head h2, h2.section-head {
  margin: 0; font: 600 13px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.section-head a { font-size: 13px; }

.empty {
  color: var(--muted); font-size: 14px; padding: 24px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: 6px;
}

/* ---- Hero with snowy mountains ---- */

.hero { position: relative; overflow: hidden; background: var(--sky); }
.hero-mountains { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 260px; }
.hero-inner { position: relative; padding-top: 72px; padding-bottom: 150px; text-align: center; }
.hero h1 { margin: 0 0 16px; font-size: clamp(34px, 5vw, 58px); line-height: 1.05; color: var(--white); }
.hero p { margin: 0 auto 28px; max-width: 560px; font-size: 18px; color: var(--text-soft); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero.small .hero-inner { padding-top: 40px; padding-bottom: 110px; }
.hero.small h1 { font-size: clamp(30px, 4vw, 44px); }
.hero-tagline { font-size: 28px; color: var(--white); }

.callout { padding: 20px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; color: var(--bg); }
.callout .cut { font-size: 24px; }
.callout p { margin: 0; flex: 1; min-width: 240px; }
.callout a { color: var(--bg); font-weight: 700; text-decoration: underline; }
.tilt-left { transform: rotate(-.4deg); }
.tilt-right { transform: rotate(.6deg); }

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

.auth-card {
  width: 100%; max-width: 440px; margin: -80px auto 0; position: relative;
  background-color: var(--surface-2); padding: 32px 32px 36px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 30px; color: var(--white); }
.auth-card .lead { margin: 0 0 22px; color: var(--text-soft); font-size: 14px; }

.tabs { display: flex; gap: 6px; margin-bottom: 22px; background: var(--bg-deep); padding: 4px; border-radius: 8px; }
.tabs button {
  flex: 1; border: 0; border-radius: 6px; padding: 10px; cursor: pointer;
  background: transparent; color: var(--muted); font: 700 13px var(--font-body); text-transform: uppercase; letter-spacing: .06em;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--white); }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .hint.ok { color: var(--green); }
.field .hint.bad { color: #ff8a8a; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; background: var(--bg-deep); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 11px 12px; font: 15px var(--font-body);
}
input:focus, textarea:focus, select:focus { border-color: var(--blue-2); outline: none; box-shadow: 0 0 0 3px rgba(74,144,226,.35); }

.checkbox { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-soft); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--green); }

.form .btn { padding: 13px 16px; }

.notice { padding: 12px 14px; border-radius: 6px; font-size: 14px; margin: 0; }
.notice[hidden] { display: none; }
.notice-error { background: rgba(214,58,58,.16); border: 1px solid rgba(214,58,58,.6); color: #ffb3b3; }
.notice-ok { background: rgba(63,185,80,.14); border: 1px solid rgba(63,185,80,.55); color: #9be3a6; }
.notice-info { background: rgba(74,144,226,.14); border: 1px solid rgba(74,144,226,.5); color: #b9d6fa; }
main > .notice.wrap { margin-top: 16px; }

.small-print { font-size: 13px; color: var(--muted); margin: 18px 0 0; text-align: center; }

/* ---- Profile ---- */

.profile-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px;
  background-color: var(--surface-2); padding: 28px 32px;
}
.profile-head .who { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.profile-head h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; color: var(--white); word-break: break-word; }
.profile-head .handle { color: var(--muted); font-size: 14px; }
.profile-head .bio { margin: 6px 0 0; color: var(--text-soft); max-width: 560px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stats { display: flex; flex-wrap: wrap; gap: 6px 0; }
.stat { padding: 0 20px; text-align: center; border-left: 1px solid var(--line-2); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-size: 22px; color: var(--white); font-weight: 700; }
.stat span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.top4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.top4-slot {
  aspect-ratio: 16 / 10; display: flex; flex-direction: column; justify-content: space-between; padding: 10px;
  background-color: var(--surface);
}
.top4-slot.empty { align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; }

.ep-card-code {
  font: 700 11px var(--font-body); color: var(--bg); background: rgba(255,255,255,.78);
  align-self: flex-start; padding: 2px 6px; border-radius: 3px;
}
.ep-card-title { font-family: var(--font-cut); font-size: 15px; color: var(--white); line-height: 1.1; text-shadow: 0 2px 0 rgba(0,0,0,.45); }

.two-col { display: flex; flex-wrap: wrap; gap: 40px; }
.two-col > :first-child { flex: 999 1 520px; min-width: 0; }
.two-col > :last-child { flex: 1 1 280px; min-width: 0; }

.diary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.diary li { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--surface); font-size: 14px; }
.diary .date { flex: 0 0 90px; color: var(--muted); font-size: 13px; }
.diary .title { flex: 1; color: var(--white); font-weight: 600; min-width: 0; }
.diary .code { color: var(--muted); font-weight: 400; margin-left: 6px; }
.diary .rating { color: var(--green); letter-spacing: 1px; }
.diary .heart { color: var(--orange); }

.progress-list { display: flex; flex-direction: column; gap: 14px; }
.progress-row .label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-row .label span:last-child { color: var(--muted); }
.bar { height: 10px; background: var(--surface); border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; }

.big-message { text-align: center; padding: 60px 0; }
.big-message h1 { font-size: clamp(30px, 5vw, 48px); color: var(--white); margin: 0 0 12px; }
.big-message p { color: var(--text-soft); margin: 0 0 20px; }

/* ---- Import ---- */

.import-card { background-color: var(--surface-2); padding: 28px 32px; max-width: 720px; }
.import-card h1 { margin: 0 0 8px; color: var(--white); font-size: 34px; }
.import-card p { color: var(--text-soft); margin: 0 0 18px; }
.import-log {
  list-style: none; margin: 0; padding: 14px 16px; max-height: 360px; overflow: auto;
  background: var(--bg-deep); border-radius: 6px; font: 13px/1.7 ui-monospace, Consolas, monospace; color: var(--text-soft);
}
.import-log .ok { color: var(--green); }
.import-log .err { color: #ff8a8a; }
.import-progress { margin: 4px 0 0; }
.movie-list { display: flex; flex-direction: column; gap: 10px; }
.movie-list .checkbox { align-items: flex-start; }
.movie-list .checkbox input { margin-top: 2px; flex: 0 0 18px; }
.movie-list .meta { color: var(--muted); font-size: 13px; }
.import-progress > div { background: var(--green); width: 0; transition: width .2s; }

/* ---- Header search + log ---- */

.header-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px;
  padding: 0 14px; color: var(--muted);
}
.header-search input[type="search"] {
  background: transparent; border: 0; padding: 8px 0; width: 160px; color: var(--text); font-size: 14px; box-shadow: none;
}
.header-search:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---- Episode cards ---- */

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 16px; }
.ep-grid.wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ep-card { color: var(--text); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ep-card:hover { color: var(--white); }
.ep-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 10px;
}
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-thumb.has-img::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0) 35%, rgba(0,0,0,.78));
}
.ep-thumb > span { position: relative; z-index: 1; }
.ep-card:hover .ep-thumb img { transform: scale(1.04); }
.ep-thumb img { transition: transform .25s; }
.ep-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.ep-card-meta .rating { color: var(--green); letter-spacing: 1px; }
.ep-card-meta .heart { color: var(--orange); }
.watched-badge {
  position: absolute !important; top: 8px; right: 8px; z-index: 2 !important;
  width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
}
.ep-card .ep-name { font-size: 14px; font-weight: 600; line-height: 1.3; }

/* ---- Toolbar / chips ---- */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toolbar input[type="search"] { max-width: 340px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--surface); color: var(--text-soft); border: 0; border-radius: 999px; padding: 7px 14px;
  font: 600 13px var(--font-body); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--green); color: var(--bg-deep); }
.chip:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }
.icon-btn { background: var(--surface); color: var(--text); border: 0; border-radius: 6px; padding: 8px 10px; font-size: 18px; line-height: 1; cursor: pointer; }
.icon-btn:hover { background: var(--line-2); }
.bell { position: relative; display: inline-flex; align-items: center; color: var(--text); }
.bell:hover { color: var(--white); }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--orange); color: var(--bg); font: 700 11px/18px var(--font-body); text-align: center;
}
.bell-count[hidden] { display: none; }

/* ---- Notifications page ---- */

.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notif-list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 10px; border-bottom: 1px solid var(--surface); border-radius: 4px; }
.notif-list li.unread { background: rgba(242,113,28,.08); box-shadow: inset 3px 0 0 var(--orange); }
.notif-list .body { flex: 1; min-width: 0; color: var(--text-soft); font-size: 14px; }
.notif-list .body strong { color: var(--white); }
.notif-list .quote { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.notif-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }
select { width: auto; }
.result-count { color: var(--muted); font-size: 13px; }

/* ---- Episode page ---- */

.ep-hero { position: relative; height: 320px; overflow: hidden; background: var(--surface-2); }
.ep-hero img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.ep-hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 180px; background: linear-gradient(rgba(20,24,28,0), var(--bg));
}
.ep-layout {
  position: relative; margin-top: -130px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 40px;
}
.ep-side { flex: 0 0 260px; display: flex; flex-direction: column; gap: 14px; }
.ep-side .ep-thumb { box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.ep-counts { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.ep-counts span { display: flex; gap: 6px; align-items: center; }
.ep-main { flex: 999 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-top: 80px; }
.ep-main .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ep-main h1 { margin: 0; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.05; color: var(--white); }
.ep-main .overview { margin: 0; font-size: 16px; line-height: 1.65; color: var(--text-soft); max-width: 640px; }
.ep-aside { flex: 1 1 260px; min-width: 0; padding-top: 80px; display: flex; flex-direction: column; gap: 20px; }

.action-panel { background-color: var(--surface-2); padding: 22px 20px; display: flex; flex-direction: column; gap: 18px; }
.action-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.action-btn {
  background: transparent; border: 0; color: var(--muted); font: 600 12px var(--font-body);
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 8px 0; border-radius: 6px;
}
.action-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.action-btn.watched[aria-pressed="true"] { color: var(--green); }
.action-btn.liked[aria-pressed="true"] { color: var(--orange); }
.action-btn.liked[aria-pressed="true"] svg { fill: var(--orange); }
.action-btn.watchlist[aria-pressed="true"] { color: var(--blue); }
.rate-box { border-top: 1px solid var(--line-2); padding-top: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rate-box .label { font-size: 12px; color: var(--muted); }
.panel-links { border-top: 1px solid var(--line-2); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.note-card { background-color: var(--yellow); color: var(--bg); padding: 16px 18px; font-size: 13px; line-height: 1.5; }

/* Star input: grey stars with a green overlay clipped to the value */
.star-input {
  --size: 32px; position: relative; display: inline-block; font-size: var(--size); line-height: 1;
  letter-spacing: 2px; color: var(--line-2); cursor: pointer; user-select: none; border-radius: 4px;
}
.star-input .fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--green); pointer-events: none; }
.star-input.preview .fill { color: #7fd88c; }
.star-row { display: flex; align-items: center; gap: 10px; }
.clear-rating { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px; }
.clear-rating:hover { color: var(--text); }

.histogram { display: flex; align-items: flex-end; gap: 4px; height: 70px; }
.histogram .bucket { flex: 1; background: var(--line-2); border-radius: 2px 2px 0 0; min-height: 2px; }
.histogram .end { color: var(--green); font-size: 11px; }
.histogram.clickable .bucket { display: block; background: #678; transition: background .15s; }
.histogram.clickable .bucket:hover, .histogram.clickable .bucket:focus-visible { background: var(--green); }
.histogram.clickable .bucket.active { background: var(--green); }
.avg-big { color: var(--green); font-size: 22px; font-weight: 700; }

.review { display: flex; gap: 14px; border-bottom: 1px solid var(--surface); padding-bottom: 18px; }
.review-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.review-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.review-meta strong { color: var(--text-soft); }
.review-meta .rating { color: var(--green); letter-spacing: 1px; }
.review-meta .heart { color: var(--orange); }
.review p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-soft); white-space: pre-line; overflow-wrap: anywhere; }
.reviews { display: flex; flex-direction: column; gap: 20px; }
.review .ep-link { color: var(--white); font-weight: 700; }

/* ---- Log dialog ---- */

.log-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0;
  background: transparent; color: var(--text);
}
.log-dialog::backdrop { background: rgba(8,10,12,.75); }
.log-dialog .sheet { background-color: var(--surface-2); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.log-dialog h2 { margin: 0; color: var(--white); font-size: 26px; }
.log-dialog .ep-pick { display: flex; gap: 14px; align-items: center; }
.log-dialog .ep-pick .ep-thumb { width: 120px; flex: 0 0 120px; padding: 6px; }
.log-dialog .ep-pick .title { font-weight: 700; color: var(--white); }
.log-dialog .ep-pick .code { color: var(--muted); font-size: 13px; }
.log-dialog textarea { min-height: 110px; resize: vertical; }
.log-dialog .row { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.log-dialog input[type="date"] {
  background: var(--bg-deep); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 9px 10px; font: 15px var(--font-body);
  color-scheme: dark;
}
.log-dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.log-dialog .actions .spacer { flex: 1; }
.like-toggle {
  background: transparent; border: 2px solid var(--line-2); color: var(--muted); border-radius: 999px; padding: 6px 14px;
  font: 700 13px var(--font-body); cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.like-toggle[aria-pressed="true"] { border-color: var(--orange); color: var(--orange); }
.pick-results { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; display: flex; flex-direction: column; }
.pick-results button {
  width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--surface);
  color: var(--text); padding: 10px 6px; cursor: pointer; font: 14px var(--font-body); display: flex; gap: 10px; justify-content: space-between;
}
.pick-results button:hover, .pick-results button:focus-visible { background: var(--surface); }
.pick-results .code { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---- Season covers ---- */

.season-card .ep-thumb { aspect-ratio: 16 / 9; }
.season-card .ep-card-title { font-size: 22px; }
.season-card .bar { height: 6px; }

/* ---- Profile tabs ---- */

.profile-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.profile-tabs a {
  padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.profile-tabs a:hover { color: var(--text); }
.profile-tabs a[aria-current="page"] { color: var(--white); border-bottom-color: var(--green); }

.diary-month { margin-bottom: 28px; }
.diary-month h3 { margin: 0 0 6px; font: 600 13px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.diary .actions { display: flex; gap: 10px; }
.diary .actions button { font-size: 12px; }
.diary .rewatch { color: var(--blue); font-size: 12px; }
.diary .review-snippet { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 2px; }
.diary a.title { color: var(--white); }
.diary a.title:hover { color: var(--blue-hover); }

.remove-x {
  position: absolute !important; top: 6px; right: 6px; z-index: 3 !important; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 16px; line-height: 1;
}

/* ---- Edit profile ---- */

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; border-radius: 50%; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch input:checked + .avatar { outline: 3px solid var(--white); outline-offset: 3px; }
.swatch input:focus-visible + .avatar { outline: 3px solid var(--yellow); outline-offset: 3px; }
.top4-edit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.top4-filled { display: flex; flex-direction: column; gap: 6px; }
.slot-tools { display: flex; justify-content: space-between; font-size: 13px; }
.slot-tools button:disabled { opacity: .3; cursor: default; }
.pick-results button:disabled { opacity: .5; cursor: default; }
a.top4-slot { color: inherit; }

/* ---- Stats ---- */

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stat-tile { background-color: var(--surface-2); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.stat-tile b { font-size: 30px; color: var(--white); font-weight: 700; line-height: 1.1; }
.stat-tile span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.month-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line-2); }
.month-chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.month-chart .col .b { width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 0; }
.month-chart .col:hover .b, .month-chart .col:focus-visible .b { background: #7fd88c; }
.month-chart .col:hover .tip, .month-chart .col:focus-visible .tip { display: block; }
.month-chart .tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--bg-deep); border: 1px solid var(--line-2); color: var(--text); font-size: 12px; padding: 4px 8px; border-radius: 4px; z-index: 2;
}
.month-axis { display: flex; gap: 2px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.month-axis span { flex: 1; text-align: center; }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-list li { display: grid; grid-template-columns: 28px 110px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.rank-list .pos { color: var(--muted); text-align: right; }
.rank-list a { color: var(--text); font-weight: 600; }
.rank-list .track { height: 10px; background: var(--surface); border-radius: 2px; overflow: hidden; }
.rank-list .track div { height: 100%; background: var(--green); border-radius: 0 4px 4px 0; }
.rank-list .val { text-align: right; color: var(--text); font-weight: 700; }
.rank-list .sub { color: var(--muted); font-weight: 400; }

/* ---- Social ---- */

.review-foot { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.review-foot a { color: var(--muted); }
.review-foot a:hover { color: var(--text); }
.review-like { font-size: 12px; }
.review-like[aria-pressed="true"] { color: var(--orange); }
.hot-tag { background: rgba(214,58,58,.2); color: #ffb3b3; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.friend-tag { background: rgba(74,144,226,.18); color: #b9d6fa; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--surface); }
.people .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.people .who a { color: var(--white); font-weight: 700; }
.people .who span { color: var(--muted); font-size: 13px; }

.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comments li { display: flex; gap: 12px; }
.comments .body { flex: 1; min-width: 0; }
.comments .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.comments .meta strong { color: var(--text-soft); }
.comments p { margin: 4px 0 0; color: var(--text-soft); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--surface); font-size: 14px; color: var(--text-soft); }
.activity li > span:nth-child(2) { flex: 1; min-width: 0; }
.activity a.ep { color: var(--white); font-weight: 600; }
.activity .rating { color: var(--green); letter-spacing: 1px; }
.activity .heart { color: var(--orange); }
.activity time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---- Lists ---- */

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.list-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.list-card:hover strong { color: var(--blue-hover); }
.list-stack { display: flex; }
.list-stack .ep-thumb { flex: 0 0 38%; margin-right: -12%; box-shadow: 4px 0 10px rgba(0,0,0,.5); padding: 0; }
.list-stack .ep-thumb:last-child { margin-right: 0; }
.list-info { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.list-info strong { color: var(--white); font-size: 16px; }
.list-info span { display: flex; align-items: center; gap: 6px; }
.list-info .desc { display: block; }
.people .link-button:disabled { opacity: .3; cursor: default; }

/* ---- Tags & arcs ---- */

.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-chip {
  background: var(--surface); color: var(--text-soft); border-radius: 4px; padding: 6px 10px; font-size: 12px; font-weight: 600;
  display: inline-flex; gap: 6px; align-items: center;
}
.tag-chip:hover { color: var(--white); background: var(--line-2); }
.tag-chip.character::before { content: '☺'; color: var(--yellow); }
.tag-chip.theme::before { content: '#'; color: var(--blue); }
.tag-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.tag-chip button:hover { color: var(--red); }
.tag-add { display: flex; gap: 6px; align-items: center; }
.tag-add input { width: 180px; padding: 6px 10px; font-size: 13px; }
.tag-add select { padding: 6px 8px; font-size: 13px; }

.arc-box { background-color: var(--surface-2); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.arc-box ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.arc-box li[aria-current] { font-weight: 700; color: var(--white); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; align-items: start; }

/* ---- Rankings ---- */

.rank-table { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-table li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--surface); }
.rank-table .pos { width: 32px; text-align: right; color: var(--muted); font-weight: 700; font-size: 18px; }
.rank-table .thumb { flex: 0 0 110px; }
.rank-table .thumb .ep-thumb { padding: 6px; }
.rank-table .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-table .info a { color: var(--white); font-weight: 700; }
.rank-table .info span { color: var(--muted); font-size: 13px; }
.rank-table .score { text-align: right; display: flex; flex-direction: column; }
.rank-table .score b { color: var(--green); font-size: 22px; }
.rank-table .score span { color: var(--muted); font-size: 12px; }

/* ---- Badges, character card ---- */

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge {
  background-color: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted);
  opacity: .6;
}
.badge.earned { background-color: var(--surface-2); opacity: 1; }
.badge .emoji { font-size: 28px; line-height: 1.1; filter: grayscale(1); }
.badge.earned .emoji { filter: none; }
.badge strong { color: var(--white); font-size: 13px; }
.badge .got { color: var(--green); font-weight: 700; }
.badge .bar { height: 6px; margin-top: 4px; }
.badge .secret-hint { margin-top: 6px; padding: 6px 8px; border-radius: 4px; background: rgba(121,224,106,.12); color: #b6f0aa; font-size: 11px; font-weight: 600; line-height: 1.4; }

.char-card { background-color: var(--surface-2); padding: 18px 20px; }

/* ---- Tier list ---- */

.tiers { display: flex; flex-direction: column; gap: 8px; }
.tier { display: flex; min-height: 64px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.tier .label {
  flex: 0 0 64px; display: flex; align-items: center; justify-content: center; font-family: var(--font-cut); font-size: 30px; color: var(--bg);
}
.tier .slot { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; align-content: flex-start; }
.tier .slot.drop-hover, .tier-pool.drop-hover { outline: 3px dashed var(--yellow); outline-offset: -3px; }
.tier-pool { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; background: var(--bg-deep); border-radius: 4px; min-height: 60px; }
.tier-chip {
  background: var(--surface-2); color: var(--white); border: 2px solid transparent; border-radius: 4px; padding: 8px 10px;
  font: 700 13px var(--font-body); cursor: grab; user-select: none;
}
.tier-chip[aria-pressed="true"] { border-color: var(--yellow); }
.tier-chip .avg { color: var(--green); font-weight: 600; margin-left: 4px; font-size: 11px; }
.tier-view .tier-chip { cursor: default; }

/* ---- Toasts ---- */

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  background-color: var(--yellow); color: var(--bg); padding: 14px 18px; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); transform: rotate(-.6deg); animation: toast-in .25s ease-out;
}
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes toast-in { from { transform: translateY(20px) rotate(-.6deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---- Hamburger rain ---- */

.burger-rain { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.burger-rain span { position: absolute; top: -60px; animation-name: burger-fall; animation-timing-function: ease-in; animation-fill-mode: forwards; }
@keyframes burger-fall { to { transform: translateY(calc(100vh + 120px)) rotate(var(--spin)); } }

/* ---- Towelie's towel ---- */

.towel-float {
  position: fixed; left: -80px; top: 30vh; z-index: 999; pointer-events: none; font-size: 64px;
  animation: towel-drift 4s ease-in-out forwards;
}
@keyframes towel-drift {
  0% { transform: translate(0, 0) rotate(-10deg); }
  25% { transform: translate(28vw, -40px) rotate(12deg); }
  50% { transform: translate(55vw, 20px) rotate(-8deg); }
  75% { transform: translate(82vw, -30px) rotate(10deg); }
  100% { transform: translate(calc(100vw + 160px), 0) rotate(-6deg); }
}

/* ---- GROUNDED stamp ---- */

.grounded {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background-color: var(--red); color: var(--white); padding: 10px 16px; transform: rotate(-3deg);
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.grounded .cut { font-size: 26px; line-height: 1; letter-spacing: .06em; }
.grounded span { font-size: 12px; font-weight: 600; }
.grounded a { color: var(--white); text-decoration: underline; }

.team-flair { display: inline-block; background-color: var(--yellow); color: var(--bg); padding: 4px 10px; font-weight: 700; font-size: 12px; transform: rotate(-1.5deg); }

/* ---- Professor Chaos mode ---- */

html.chaos {
  --bg: #10180f; --bg-deep: #0a1009; --surface: #1d2a1b; --surface-2: #243422; --line: #2b3b28; --line-2: #3c5238;
  --green: #7dff4f; --blue: #b9f27a; --blue-hover: #d8ffb0; --muted: #9db596;
}
html.chaos .site-header {
  background: repeating-linear-gradient(115deg, #8f9aa3 0 10px, #c9d2d9 10px 22px, #7c868e 22px 30px);
  border-bottom-color: #5e6870;
}
html.chaos .site-header .main-nav a, html.chaos .site-header .header-link { color: #10180f; }
html.chaos .site-header .nav-soon { color: #2b3b28; }
html.chaos .logo-letter { background-color: #7dff4f !important; }
html.chaos .hero { background: #12220f; }
html.chaos .hero-mountains path:first-child { fill: #23401c; }
html.chaos .btn-green { background: #7dff4f; }
html.chaos .toast { background-color: #7dff4f; }

/* ---- Mysterion mode ---- */

html.mysterion {
  --bg: #120d1a; --bg-deep: #0b0812; --surface: #221a2e; --surface-2: #2b2139; --line: #2e2540; --line-2: #43365a;
  --green: #79e06a; --blue: #c3a6ff; --blue-hover: #e0d2ff; --muted: #a99bbf; --text-soft: #d8cfe6; --yellow: #79e06a;
}
html.mysterion .site-header { background: linear-gradient(90deg, #1b1326, #2a1c3d 50%, #1b1326); border-bottom-color: #43365a; }
html.mysterion .logo-letter { background-color: #2b1f3d !important; color: #79e06a; box-shadow: inset 0 0 0 2px #43365a; }
html.mysterion .hero { background: #160f22; }
html.mysterion .hero-mountains path:first-child { fill: #2a1d3b; }
html.mysterion .hero-mountains path:not(:first-child) { fill: #3a2d50; }
html.mysterion .btn-green { background: #79e06a; }
html.mysterion .toast { background-color: #2b1f3d; color: #e8ffe2; box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 0 0 2px #79e06a; }
html.mysterion body::before {
  content: '?'; position: fixed; right: -2vw; bottom: -12vh; z-index: 0; pointer-events: none;
  font-family: var(--font-cut); font-size: 70vh; line-height: 1; color: #79e06a; opacity: .05;
}
html.mysterion main, html.mysterion .site-header, html.mysterion .site-footer { position: relative; z-index: 1; }
/* Secret identities: everyone else's avatar is a "?" and their name is blurred until you hover or focus it. */
html.mysterion .avatar:not(.is-me) { color: transparent; position: relative; }
html.mysterion .avatar:not(.is-me)::after {
  content: '?'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #79e06a; font-family: var(--font-cut); font-size: calc(var(--size) * .55);
}
html.mysterion a[href*="profile.html?u="]:not(.is-me) { filter: blur(5px); transition: filter .2s; }
html.mysterion a[href*="profile.html?u="]:not(.is-me):hover,
html.mysterion a[href*="profile.html?u="]:not(.is-me):focus-visible { filter: none; }
@media (prefers-reduced-motion: reduce) { html.mysterion a[href*="profile.html?u="] { transition: none; } }

/* ---- Coon takeover ---- */

.coon-takeover {
  background: repeating-linear-gradient(90deg, #3a3330 0 28px, #4a423d 28px 56px);
  border-bottom: 6px solid #1c1917; color: #f3ede6; animation: coon-in .4s ease-out;
}
.coon-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 14px; padding-bottom: 14px; }
.coon-emoji { font-size: 40px; line-height: 1; }
.coon-inner > div { flex: 1; min-width: 220px; }
.coon-title { font-size: 22px; line-height: 1.15; color: #fff; }
.coon-sub { font-size: 13px; color: #d9cfc5; }
.coon-btn { background: #1c1917; color: #f3ede6; border: 2px solid #f3ede6; }
.coon-btn:hover { background: #f3ede6; color: #1c1917; }
@keyframes coon-in { from { transform: translateY(-100%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .coon-takeover { animation: none; } }

/* ---- Phones ---- */

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .header-inner { gap: 12px 16px; }
  .logo-letter { font-size: 18px !important; padding: 3px 4px 1px; }
  .main-nav { order: 3; width: 100%; gap: 16px; }
  .auth-card, .profile-head, .import-card { padding: 24px 20px; }
  .top4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 0 12px; }
  .diary .date { flex-basis: 70px; }
  .header-search { order: 4; flex: 1; }
  .header-search input[type="search"] { width: 100%; }
  .ep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .ep-hero { height: 220px; }
  .ep-layout { margin-top: -90px; gap: 24px; }
  .ep-side { flex-basis: 100%; flex-direction: row; align-items: flex-end; }
  .ep-side .ep-thumb { width: 150px; flex: 0 0 150px; }
  .ep-main, .ep-aside { padding-top: 0; }
  .log-dialog .sheet { padding: 22px 18px; }
  .rank-table .thumb { flex-basis: 72px; }
  .rank-table .pos { width: 22px; font-size: 14px; }
}

/* Butters' Book Club host review */
.butters-review { background: rgba(245,197,24,.07); border: 1px solid rgba(245,197,24,.25); border-radius: 6px; padding: 14px; }
.host-tag { background: rgba(245,197,24,.18); color: #f5d76e; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

/* Your own review on an episode page */
.my-review { background: rgba(0,224,84,.06); border: 1px solid rgba(0,224,84,.22); border-radius: 6px; padding: 14px; }

/* Butters' replies under Book Club reviews */
.butters-reply { display: flex; gap: 10px; margin-top: 6px; padding: 10px 12px; border-left: 3px solid #f5c518; background: rgba(245,197,24,.06); border-radius: 0 6px 6px 0; }
.butters-reply .who { font-size: 12px; font-weight: 700; color: #f5d76e; display: flex; gap: 8px; align-items: center; }
.butters-reply p { margin: 2px 0 0; font-size: 13px; }

/* Cage Match */
.cage-game { display: flex; flex-direction: column; gap: 14px; }
.cage-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; }
.cage-card { background: var(--surface); border: 2px solid transparent; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); cursor: pointer; transition: transform .12s, border-color .12s; font: inherit; }
.cage-card:hover, .cage-card:focus-visible { border-color: var(--orange); transform: translateY(-3px) rotate(-.5deg); }
.cage-card strong { font-size: 18px; color: var(--white); }
.cage-card span { font-size: 13px; color: var(--muted); }
.cage-vs { font-size: 38px; color: var(--orange); transform: rotate(-8deg); }
.cage-comment { text-align: center; margin: 0; min-height: 1.4em; color: var(--yellow); font-weight: 600; }
.cage-champ { display: grid; grid-template-columns: minmax(140px, 260px) 1fr; gap: 18px; align-items: center; padding: 14px; margin-bottom: 18px; background-color: var(--surface); color: var(--text); border: 2px solid var(--yellow); }
.cage-champ > div { display: flex; flex-direction: column; gap: 4px; }
.cage-champ .cut { color: var(--yellow); font-size: 22px; }
.cage-champ strong { font-size: 22px; color: var(--white); }
.cage-champ span:last-child { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .cage-arena { grid-template-columns: 1fr; }
  .cage-vs { text-align: center; }
  .cage-champ { grid-template-columns: 1fr; }
}

/* Tegridy streak */
.streak-link { display: block; color: inherit; }
.streak-card { display: flex; gap: 18px; align-items: center; padding: 16px 20px; background-color: #2f5d34; color: #eaf6e4; }
.streak-card.hot { background-color: #3f7d2c; }
.streak-num { display: flex; flex-direction: column; align-items: center; min-width: 70px; line-height: 1; }
.streak-num b { font-family: 'Luckiest Guy', cursive; font-size: 44px; color: #fff; }
.streak-num span { font-size: 12px; }
.streak-num span[aria-hidden] { font-size: 26px; }
.streak-text { display: flex; flex-direction: column; gap: 4px; }
.streak-text strong { color: #fff; font-size: 16px; }
.streak-text p { margin: 0; font-size: 14px; }
.streak-text .who, .streak-best { font-size: 12px; color: #b7d8ad; }

/* Mr. Garrison's Report Card */
.report-card { background-color: #d9caa5; color: #2b2b2b; padding: 22px 24px; background-image: repeating-linear-gradient(transparent 0 27px, rgba(40,80,130,.2) 27px 28px); }
.rc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid #9e2a1f; padding-bottom: 10px; margin-bottom: 12px; }
.rc-head .cut { color: #9e2a1f; font-size: 14px; display: block; }
.rc-head strong { font-family: 'Luckiest Guy', cursive; font-size: 32px; color: #1d3557; }
.rc-meta { font-size: 13px; line-height: 1.6; text-align: right; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-table th, .rc-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid rgba(0,0,0,.18); vertical-align: top; }
.rc-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #4a4433; }
.rc-table a { color: #1d3557; font-weight: 700; }
.rc-table td:nth-child(3) { color: #4a4433; white-space: nowrap; }
.rc-grade { font-family: 'Luckiest Guy', cursive; font-size: 24px; display: inline-block; transform: rotate(-6deg); }
.grade-a { color: #1e6b2a; } .grade-b { color: #175283; } .grade-c { color: #7d4a00; } .grade-d { color: #983800; } .grade-f { color: #9e2a1f; }
.rc-foot { margin-top: 14px; font-size: 14px; }
.rc-foot p { margin: 4px 0; }
.rc-sign { text-align: right; font-style: italic; font-family: 'Luckiest Guy', cursive; font-size: 18px; color: #9e2a1f; }
.rc-foot .rc-link { margin-top: 10px; text-align: center; font-weight: 700; color: #1d3557; }
@media (max-width: 640px) { .rc-meta { text-align: left; } }
.grade-inc { color: #5e5744; font-size: 18px; }
.rc-inc td, .rc-inc th { color: #5e5744; }
.rc-need { display: block; font-size: 11px; color: #5e5744; }

/* Cage Match extras */
.cage-top { display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.cage-filter { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-soft); }
.cage-filter select { width: auto; }
.cage-meter { display: flex; flex-direction: column; gap: 6px; }
.cage-meter-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); }
.cage-meter .bar { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.cage-meter .bar > div { height: 100%; transition: width .3s; }
.cage-move { font-size: 11px; font-weight: 700; margin-left: 4px; }
.cage-move.up { color: var(--green); } .cage-move.down { color: #e5534b; } .cage-move.new { color: var(--yellow); }
.cage-note { display: block; margin-top: 6px; }
.rc-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.rc-actions .chip { background: #ece0c1; color: #1d3557; border: 2px solid #1d3557; }
.rc-actions .chip:hover { background: #f5edd8; }
.rc-actions .chip[aria-pressed="true"] { background: #1d3557; color: #fff; }
.rc-actions .btn-ghost { background: #ece0c1; color: #1d3557; border: 2px solid #1d3557; padding: 6px 12px; }
.rc-actions .btn-ghost:hover { background: #f5edd8; color: #1d3557; }
.rc-curve-tag { font-size: 11px; background: #1d3557; color: #fff; border-radius: 3px; padding: 1px 5px; }
.rc-stars { display: block; margin-top: 4px; font-size: 12px; color: #4a4433; }
.rc-stars a { color: #1d3557; font-weight: 600; }
.rc-st { color: #7d4a00; letter-spacing: 1px; }
.cage-card .cage-rating { font-size: 13px; color: var(--muted); } .cage-card .cage-rating b { color: var(--green); letter-spacing: 1px; font-size: 16px; }

/* ===== Cartman's Cage Match arena ===== */
.cage-ring {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 18px;
  border: 6px solid #1a1a1a; border-radius: 10px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 236, 170, .22), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 22px),
    #15181d;
  box-shadow: inset 0 0 0 3px #f5c518, inset 0 0 60px rgba(0,0,0,.8), 0 10px 30px rgba(0,0,0,.4);
}
.cage-ring::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: repeating-linear-gradient(-45deg, #f5c518 0 14px, #1a1a1a 14px 28px); }
.cage-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.cage-title {
  font-size: clamp(26px, 5vw, 46px); line-height: 1; transform: rotate(-2deg);
  background: linear-gradient(180deg, #ffe066 0%, #f5a623 55%, #d63a3a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(3px 3px 0 #000); letter-spacing: 1px;
}
.cage-round { background: #d63a3a; color: #fff; padding: 4px 12px; border: 3px solid #000; border-radius: 6px; font-size: 18px; transform: rotate(3deg); box-shadow: 3px 3px 0 #000; }
.cage-host { display: flex; gap: 14px; align-items: flex-start; }
.cage-mic { flex: 0 0 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 35% 35%, #ff6b6b, #b71c1c); border: 3px solid #000; box-shadow: 3px 3px 0 #000; }
.cage-bubble { position: relative; flex: 1; background: #fff3a6; color: #1a1a1a; border: 3px solid #000; border-radius: 14px; padding: 10px 16px 12px; box-shadow: 4px 4px 0 #000; }
.cage-bubble::before { content: ""; position: absolute; left: -14px; top: 18px; border: 8px solid transparent; border-right: 12px solid #000; }
.cage-bubble::after { content: ""; position: absolute; left: -8px; top: 20px; border: 6px solid transparent; border-right: 9px solid #fff3a6; }
.cage-bubble .who { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #d63a3a; }
.cage-bubble .call { margin: 2px 0 0; font-family: 'Luckiest Guy', cursive; font-size: clamp(17px, 2.4vw, 22px); line-height: 1.25; letter-spacing: .3px; }
.cage-bubble .next { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: #444; }
.cage-bubble .next:empty { display: none; }
.cage-bubble.pop { animation: cage-pop .35s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes cage-pop { 0% { transform: scale(.85) rotate(-2deg); } 100% { transform: scale(1) rotate(0); } }

.cage-ring .cage-arena { position: relative; }
.cage-card { position: relative; background: #22262d; border: 3px solid #000; box-shadow: 4px 4px 0 #000; padding: 10px 10px 12px; overflow: visible; }
.cage-card.red { border-top: 6px solid #d63a3a; }
.cage-card.blue { border-top: 6px solid #4a90e2; }
.cage-card.champ { border-top-color: #f5c518; box-shadow: 0 0 0 2px #f5c518, 4px 4px 0 #000, 0 0 24px rgba(245,197,24,.35); }
.cage-card .corner { align-self: flex-start; font-size: 13px; padding: 2px 8px; border-radius: 4px; background: #d63a3a; color: #fff; transform: rotate(-2deg); }
.cage-card.blue .corner { background: #4a90e2; }
.cage-card.champ .corner { background: #f5c518; color: #1a1a1a; }
.cage-card:hover, .cage-card:focus-visible { border-color: #f5c518; transform: translateY(-4px) rotate(-.6deg); }
.cage-ring .cage-vs { font-size: clamp(40px, 6vw, 64px); color: #f5c518; text-shadow: 3px 3px 0 #d63a3a, 6px 6px 0 #000; animation: cage-vs 1.4s ease-in-out infinite; }
@keyframes cage-vs { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(-4deg) scale(1.12); } }
.cage-card::after { position: absolute; top: 38%; left: 50%; font-family: 'Luckiest Guy', cursive; font-size: clamp(28px, 4vw, 44px); padding: 4px 14px; border: 4px solid currentColor; border-radius: 8px; transform: translate(-50%, -50%) rotate(-12deg) scale(2.5); opacity: 0; pointer-events: none; background: rgba(0,0,0,.55); }
.cage-card.win { border-color: #f5c518; transform: scale(1.04); box-shadow: 0 0 0 3px #f5c518, 0 0 36px rgba(245,197,24,.6); }
.cage-card.win::after { content: "WINNER!"; color: #f5c518; animation: cage-stamp .3s ease-out forwards; }
.cage-card.ko { animation: cage-ko .35s ease-out forwards; }
@keyframes cage-ko { to { filter: grayscale(1) brightness(.55); transform: rotate(4deg) translateY(10px); } }
.cage-card.ko::after { content: "K.O."; color: #ff5a5a; animation: cage-stamp .3s ease-out forwards; }
@keyframes cage-stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
.cage-arena.fought .cage-vs { animation: cage-shake .4s; }
@keyframes cage-shake { 0%, 100% { transform: rotate(-8deg); } 25% { transform: rotate(-20deg) scale(1.3); } 75% { transform: rotate(6deg) scale(1.2); } }
.cage-crowd { text-align: center; min-height: 1.2em; font-weight: 800; color: #ffe066; letter-spacing: .5px; opacity: 0; }
.cage-crowd.show { animation: cage-crowd 2.2s ease-out; }
@keyframes cage-crowd { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
.cage-ring .btn-ghost { border-color: rgba(255,255,255,.3); }
.cage-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); }
.cage-keys { color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .cage-ring .cage-vs, .cage-bubble.pop, .cage-crowd.show { animation: none; }
  .cage-crowd.show { opacity: 1; }
  .cage-card.win::after, .cage-card.ko::after { animation: none; opacity: 1; transform: translate(-50%, -50%) rotate(-12deg); }
  .cage-card.ko { animation: none; filter: grayscale(1) brightness(.55); }
}
@media (max-width: 640px) { .cage-ring { padding: 18px 12px 14px; } .cage-mic { flex-basis: 44px; height: 44px; font-size: 22px; } }

/* Home: Book Club + Cage Match side by side */
.home-promos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: stretch; }
.home-promos > * { margin: 0; }
.cage-ad {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 20px 18px; border-radius: 8px; color: #eee; overflow: hidden;
  border: 4px solid #1a1a1a; box-shadow: inset 0 0 0 2px #f5c518, 4px 4px 0 #000;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 236, 170, .2), transparent 65%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 18px),
    #15181d;
  transform: rotate(.6deg); transition: transform .15s;
}
.cage-ad::before { content: ""; position: absolute; inset: 0 0 auto; height: 7px; background: repeating-linear-gradient(-45deg, #f5c518 0 12px, #1a1a1a 12px 24px); }
.cage-ad:hover { transform: rotate(-.4deg) scale(1.01); }
.cage-ad-title { font-size: 26px; line-height: 1.05; background: linear-gradient(180deg, #ffe066, #f5a623 55%, #d63a3a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(2px 2px 0 #000); }
.cage-ad-text { font-size: 14px; color: #ddd; }
.cage-ad-text strong { color: #ffe066; }
.cage-ad-cta { align-self: flex-start; margin-top: auto; background: #d63a3a; color: #fff; padding: 4px 12px; border: 3px solid #000; border-radius: 6px; box-shadow: 3px 3px 0 #000; font-size: 15px; }
.cage-ad-head { display: flex; gap: 10px; align-items: center; } .cage-ad-glove { font-size: 30px; line-height: 1; filter: drop-shadow(2px 2px 0 #000); }

/* ===== Butters' Book Club: school library / notebook theme ===== */
:root { --club-paper: #fff3a6; --club-ink: #1d2a44; --club-line: #e8d27a; --club-margin: #f28b82; --club-blue: #2f6db5; }
.club-tape { position: absolute; top: -10px; left: 50%; width: 120px; height: 26px; transform: translateX(-50%) rotate(-3deg); background: repeating-linear-gradient(45deg, rgba(245,197,24,.85) 0 10px, rgba(255,224,102,.85) 10px 20px); box-shadow: 0 2px 4px rgba(0,0,0,.25); z-index: 2; }
.club-tape.small { width: 80px; height: 20px; top: -9px; left: 60px; transform: rotate(4deg); }
.club-sticker { position: absolute; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; line-height: 1; font-size: 26px; text-align: center; color: #5a3d00;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f5c518 55%, #c99700); border: 3px solid #000; box-shadow: 3px 3px 0 #000; transform: rotate(12deg); z-index: 2; }
.club-sticker small { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; margin-top: -10px; }
.notebook { background: linear-gradient(90deg, transparent 34px, var(--club-margin) 34px 36px, transparent 36px), repeating-linear-gradient(var(--club-paper) 0 27px, var(--club-line) 27px 28px); color: var(--club-ink); }

/* Home card */
.club-ad {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px 20px 18px 50px; border-radius: 8px; overflow: visible;
  border: 4px solid #1a1a1a; box-shadow: inset 0 0 0 2px var(--club-blue), 4px 4px 0 #000; transform: rotate(-.6deg); transition: transform .15s;
  background: linear-gradient(90deg, transparent 34px, var(--club-margin) 34px 36px, transparent 36px), repeating-linear-gradient(var(--club-paper) 0 27px, var(--club-line) 27px 28px);
  color: var(--club-ink);
}
.club-ad:hover { transform: rotate(.4deg) scale(1.01); }
.club-ad::before { content: ""; position: absolute; left: 12px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: #15181d; box-shadow: 0 38px 0 #15181d, 0 76px 0 #15181d; }
.club-ad-head { display: flex; gap: 10px; align-items: center; padding-right: 64px; }
.club-ad-books { font-size: 30px; line-height: 1; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.6)); }
.club-ad-title { font-size: 26px; line-height: 1.05; color: var(--club-blue); text-shadow: 2px 2px 0 #f5c518, 3px 3px 0 #000; }
.club-ad-text { font-size: 14px; }
.club-ad-text strong { color: #b23a2e; }
.club-ad-cta { align-self: flex-start; margin-top: auto; background: var(--club-blue); color: #fff; padding: 4px 12px; border: 3px solid #000; border-radius: 6px; box-shadow: 3px 3px 0 #000; font-size: 15px; }
.club-ad .club-sticker { top: -14px; right: -10px; }

/* Club page hero */
.club-hero { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 30px 24px 22px 56px; border: 4px solid #1a1a1a; border-radius: 10px; box-shadow: 5px 5px 0 #000;
  background: linear-gradient(90deg, transparent 38px, var(--club-margin) 38px 40px, transparent 40px), repeating-linear-gradient(var(--club-paper) 0 31px, var(--club-line) 31px 32px); color: var(--club-ink); }
.club-hero::before { content: ""; position: absolute; left: 14px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg, #14181c); box-shadow: 0 44px 0 var(--bg, #14181c), 0 88px 0 var(--bg, #14181c); }
.club-kicker { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #b23a2e; }
.club-title { margin: 2px 0 4px; font-size: clamp(34px, 6vw, 56px); line-height: 1; color: var(--club-blue); text-shadow: 3px 3px 0 #f5c518, 5px 5px 0 #000; transform: rotate(-1.5deg); }
.club-sub { margin: 0; font-size: 14px; color: #3c4a66; max-width: 520px; }
.club-due { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border: 3px dashed #c0392b; border-radius: 8px; color: #c0392b; transform: rotate(6deg); background: rgba(255,243,166,.7); text-transform: uppercase; font-weight: 800; font-size: 12px; letter-spacing: 1px; }
.club-due b { font-family: 'Luckiest Guy', cursive; font-size: 44px; line-height: 1; }

/* This week's book */
.club-book { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr); gap: 26px; align-items: center; }
.club-cover { position: relative; display: block; padding-left: 16px; border-radius: 4px 8px 8px 4px; background: linear-gradient(90deg, #1d3557, #2f6db5 60%, #1d3557); box-shadow: 6px 6px 0 #000; transform: rotate(-1deg); }
.club-cover .ep-thumb { border-radius: 0 6px 6px 0; }
.club-ribbon { position: absolute; top: 12px; left: -8px; background: #d63a3a; color: #fff; padding: 4px 12px; border: 3px solid #000; box-shadow: 3px 3px 0 #000; font-size: 14px; transform: rotate(-3deg); z-index: 2; }
.club-cover .club-sticker { right: -14px; bottom: -14px; }
.club-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: 3px solid #000; border-radius: 8px; box-shadow: 4px 4px 0 #000; color: var(--club-ink);
  background: linear-gradient(var(--club-paper) 0 34px, #e57373 34px 36px, var(--club-paper) 36px) , var(--club-paper); }
.club-card .club-code { font-size: 12px; font-weight: 700; color: #6b7a93; }
.club-card h2 { margin: 0; font-size: 30px; line-height: 1.1; }
.club-card h2 a { color: var(--club-blue); }
.club-blurb { margin: 0; font-size: 14px; color: #3c4a66; }
.club-card .result-count { color: #6b7a93; }
.club-members { display: flex; flex-direction: column; gap: 6px; border-top: 2px dashed #cbd5e1; padding-top: 10px; }
.club-members-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #b23a2e; }
.club-members > div { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Butters' review: a note on lined paper with a gold star */
.butters-review { position: relative; border: 3px solid #000 !important; border-radius: 6px; box-shadow: 4px 4px 0 #000; padding: 18px 16px 14px 50px !important;
  background: linear-gradient(90deg, transparent 38px, var(--club-margin) 38px 40px, transparent 40px), repeating-linear-gradient(var(--club-paper) 0 25px, var(--club-line) 25px 26px) !important; color: var(--club-ink); }
.butters-review p { color: var(--club-ink); font-size: 15px; }
.butters-review .review-meta, .butters-review .review-foot, .butters-review .review-foot a { color: #5b6b86; }
.butters-review .review-meta strong { color: var(--club-ink); }
.butters-review .review-meta .rating { color: #c99700; }
.butters-review .review-like { color: var(--club-blue); }
.butters-review .host-tag { background: var(--club-blue); color: #fff; }
.butters-star { position: absolute; right: 12px; top: -12px; font-size: 30px; transform: rotate(14deg); filter: drop-shadow(2px 2px 0 #000); }

/* Past reads on a wooden shelf */
.club-shelf { position: relative; padding: 14px 14px 30px; border-radius: 6px; background: rgba(139, 90, 43, .12); }
.club-shelf::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; border-radius: 0 0 6px 6px; background: linear-gradient(#a8743f, #7a4e24); box-shadow: 0 4px 0 #4a2e12; }
@media (max-width: 720px) { .club-book { grid-template-columns: 1fr; } .club-hero { padding-left: 48px; } }
/* Butters' replies: yellow sticky notes */
.butters-reply { background: #fff3a6; color: var(--club-ink); border: 2px solid #000; border-left: 2px solid #000; border-radius: 3px; box-shadow: 3px 3px 0 #000; transform: rotate(-.5deg); max-width: 640px; }
.butters-reply .who { color: #b23a2e; }
.butters-reply p { color: var(--club-ink); }
.butters-reply .host-tag { background: var(--club-blue); color: #fff; }

/* Book Club vote */
.club-vote-butters { margin: 0 0 14px; font-size: 14px; color: var(--text-soft); font-style: italic; }
.club-vote-butters span { font-style: normal; color: var(--muted); }
.club-vote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.club-vote-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 3px solid #000; border-radius: 6px; box-shadow: 4px 4px 0 #000; color: var(--club-ink);
  background: repeating-linear-gradient(var(--club-paper) 0 23px, var(--club-line) 23px 24px); }
.club-vote-card:nth-child(2) { transform: rotate(.8deg); } .club-vote-card:nth-child(3) { transform: rotate(-.6deg); }
.club-vote-card.mine { box-shadow: 0 0 0 3px var(--green), 4px 4px 0 #000; }
.club-vote-flag { position: absolute; top: -12px; right: 10px; z-index: 2; background: #f5c518; color: #1a1a1a; padding: 2px 10px; border: 2px solid #000; border-radius: 4px; font-size: 13px; transform: rotate(4deg); }
.club-vote-card.leading .club-vote-flag { background: #d63a3a; color: #fff; }
.club-vote-title { font-weight: 800; color: var(--club-blue); }
.club-vote-code { font-size: 12px; color: #6b7a93; }
.club-vote-bar { height: 8px; border: 2px solid #000; border-radius: 4px; background: #fffbe0; overflow: hidden; }
.club-vote-bar > div { height: 100%; background: var(--club-blue); }
.club-vote-card .btn-ghost { color: var(--club-ink); border-color: rgba(0,0,0,.35); }

/* Profile: Book Club library card */
.library-card { max-width: 760px; border: 3px solid #000; border-radius: 8px; box-shadow: 5px 5px 0 #000; overflow: hidden; background: #f3ead2; color: var(--club-ink); transform: rotate(-.4deg); }
.lc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: #b23a2e; color: #fff; }
.lc-head .cut { font-size: 18px; }
.lc-head span:last-child { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: .9; }
.lc-body { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 14px 16px; background: repeating-linear-gradient(#f3ead2 0 23px, #d9c9a3 23px 24px); }
.lc-who { display: flex; flex-direction: column; gap: 2px; }
.lc-who > span:first-child { font-size: 11px; font-weight: 800; text-transform: uppercase; color: #8a6d3b; }
.lc-who strong { font-size: 18px; }
.lc-count { font-size: 13px; margin-top: 6px; }
.lc-count b { font-family: 'Luckiest Guy', cursive; font-size: 20px; color: #b23a2e; }
.lc-stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lc-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; border: 1px solid #b9a77f; border-radius: 4px; background: rgba(255,255,255,.55); color: #6b5a3a; overflow: hidden; }
.lc-date { font-size: 11px; font-weight: 700; }
.lc-stamp { margin-top: 2px; padding: 1px 6px; border: 2px solid #c0392b; border-radius: 4px; color: #c0392b; font-size: 13px; transform: rotate(-10deg); opacity: .9; }
.lc-slot.now { border: 2px dashed var(--club-blue); }
.lc-now { font-size: 10px; color: var(--club-blue); font-weight: 800; text-transform: uppercase; }
@media (max-width: 560px) { .lc-body { grid-template-columns: 1fr; } }
.club-vote-card .btn { border: 2px solid #000; box-shadow: 2px 2px 0 #000; } .club-vote-card .btn-ghost { background: #fffbe0; color: var(--club-ink); } .club-vote-card .btn-ghost:hover { background: #ffe97a; }

/* Cartman's bubble: red announcer card (his jacket), mic in his teal-and-yellow hat colours */
.cage-bubble { background: linear-gradient(180deg, #e04848, #b02020); color: #fff; }
.cage-bubble::after { border-right-color: #d23c3c; }
.cage-bubble .who { color: #ffe066; }
.cage-bubble .call { color: #fff; text-shadow: 2px 2px 0 #000; }
.cage-bubble .next { color: #ffe3e3; }
.cage-mic { background: radial-gradient(circle at 35% 35%, #5ee0ea, #11808c); }
.club-due.archived { border-color: #2e8b3a; color: #2e8b3a; transform: rotate(-5deg); }
.club-shelf .ep-card.current { outline: 3px solid #f5c518; outline-offset: 3px; border-radius: 6px; }

/* ===== Original paper-cutout art ===== */
.art { display: block; width: 100%; height: auto; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.45)); }

/* Hero: paper town in front of the mountains, and gentle falling snow */
.hero-town { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 260px; pointer-events: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.hero-snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-snow::before, .hero-snow::after {
  content: ""; position: absolute; inset: -320px 0 0; opacity: .7;
  background-image: radial-gradient(2.5px 2.5px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(2px 2px at 110px 140px, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 190px 80px, #fff 50%, transparent 51%), radial-gradient(2px 2px at 260px 210px, #fff 50%, transparent 51%);
  background-size: 300px 320px; animation: snowfall 14s linear infinite;
}
.hero-snow::after { background-size: 220px 240px; opacity: .45; animation: snowfall2 22s linear infinite; transform: translateX(60px); }
@keyframes snowfall2 { to { background-position: -30px 240px; } }
@keyframes snowfall { to { background-position: 40px 320px; } }

/* Footer: a snowy pine strip on every page */
.site-footer { border-top: 0; position: relative; }
.footer-art { line-height: 0; margin-top: 36px; background: var(--bg); }
.art-pines { display: block; width: 100%; height: 72px; filter: drop-shadow(0 -2px 0 rgba(0,0,0,.2)); }

/* "Nothing here" pages: a paper bus stop */
.big-message-art { width: 120px; margin: 0 auto 10px; transform: rotate(-4deg); }

/* Cage Match pieces */


.cage-ad-glove { width: 42px; flex: 0 0 42px; transform: rotate(-12deg); }
.cage-champ { position: relative; }
.cage-champ-belt { position: absolute; right: 18px; top: 14px; width: 120px; transform: rotate(6deg); z-index: 2; }

/* Book Club pieces */
.club-ad-books { width: 48px; flex: 0 0 48px; transform: rotate(-6deg); }
.club-hero-art { position: absolute; right: 168px; top: 18px; width: 92px; transform: rotate(-8deg); }

@media (max-width: 720px) { .club-hero-art { display: none; } .cage-champ-belt { width: 84px; top: 10px; right: 10px; } }
@media (prefers-reduced-motion: reduce) { .hero-snow::before, .hero-snow::after { animation: none; } }

/* ===== General polish ===== */
/* Header: a construction-paper stripe in the logo colours */
.site-header::after { content: ""; display: block; height: 5px; background: linear-gradient(90deg, #3fb950 0 20%, #4a90e2 20% 40%, #d63a3a 40% 60%, #f5c518 60% 80%, #f2711c 80%); box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.site-header { border-bottom: 0; }
/* Episode cards wobble a little, like paper, when hovered */
.ep-card .ep-thumb { transition: transform .15s ease, box-shadow .15s ease; }
.ep-card:hover .ep-thumb { transform: rotate(-1.2deg) translateY(-3px); box-shadow: 4px 6px 0 rgba(0,0,0,.45); }
.ep-grid .ep-card:nth-child(even):hover .ep-thumb { transform: rotate(1.2deg) translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .ep-card:hover .ep-thumb { transform: none; } }

/* Paper-cutout profile pictures */
.avatar.has-icon { padding: calc(var(--size) * .1); } /* not %: percentage padding follows the parent's width */
.avatar.has-icon svg { width: 100%; height: 100%; display: block; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.4)); }
html.mysterion .avatar.has-icon:not(.is-me) svg { visibility: hidden; }
.icon-picker .avatar.has-icon, .icon-picker .avatar { transition: transform .12s; } .icon-picker .swatch:hover .avatar { transform: rotate(-6deg) scale(1.06); }

/* ===== Header on phones and tablets: ☰ menu ===== */
.menu-toggle, .nav-mobile-only { display: none; }
@media (max-width: 900px) {
  .header-inner { gap: 10px 12px; }
  .logo { order: 1; }
  .header-right { order: 2; gap: 10px; }
  .menu-toggle { display: inline-flex; order: 3; }
  .header-right > .header-search, .header-right > #header-random, .header-right > .admin-link { display: none; }
  .main-nav { order: 4; display: none; flex-basis: 100%; flex-direction: column; gap: 0; padding: 4px 0 8px; }
  .site-header.menu-open .main-nav { display: flex; }
  .main-nav > a, .main-nav > .nav-random { display: block; padding: 12px 4px; border-top: 1px solid var(--surface); font-size: 15px; text-align: left; color: var(--text); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
  .main-nav > .nav-mobile-only { display: block; }
  .main-nav > .header-search.nav-mobile-only { display: flex; margin: 6px 0 10px; }
  .main-nav > .header-search input[type="search"] { width: 100%; }
  .menu-open .menu-toggle { background: var(--surface-2); }
}
@media (max-width: 480px) {
  .logo-letter { font-size: 15px !important; padding: 2px 3px 1px; }
  .header-right { gap: 8px; }
  .header-right .btn-green { padding: 8px 10px; }
  .header-right .avatar { --size: 34px !important; }
}

/* Settings: account section */
.account { margin-top: 36px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
.account-grid h3 { margin: 0; font-size: 20px; color: var(--white); }
.btn-danger { background: var(--red); color: #fff; border: 0; }
.btn-danger:hover { background: #b52a2a; }
.danger-zone { border: 2px solid rgba(214,58,58,.5); }

/* Header search dropdown */
.search-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: min(360px, 90vw); max-height: 70vh; overflow: auto; padding: 6px; background: var(--surface); border: 2px solid #000; border-radius: 8px; box-shadow: 4px 4px 0 #000; }
.search-pop-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.search-pop-item { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 14px; }
.search-pop-item:hover, .search-pop-item:focus { background: var(--surface-2); color: var(--white); }
.search-pop-item small { color: var(--muted); }
.search-pop-code { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--muted); min-width: 52px; text-transform: uppercase; }
.search-pop-snippet { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; }
.search-pop-snippet mark { background: none; color: var(--yellow); font-weight: 700; }
.search-pop-hint { padding: 8px 10px 4px; font-size: 13px; color: var(--muted); }
.search-pop-hint strong { color: var(--text); }
.search-pop-try { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 10px; }
.search-pop-empty { padding: 10px; color: var(--muted); font-size: 14px; }
.search-pop-all { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--blue); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
@media (max-width: 900px) { .main-nav .search-pop { width: 100%; } }
.comment-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; } .comment-edit textarea { width: 100%; }

/* Phone header, part 2: a grid keeps logo, actions and ☰ on one row */
@media (max-width: 900px) {
  .header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
  .logo { grid-column: 1; grid-row: 1; }
  .header-right { grid-column: 2; grid-row: 1; justify-self: end; margin-left: 0; }
  .menu-toggle { grid-column: 3; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; }
  .main-nav > .header-search.nav-mobile-only { order: -1; }
  .club-cover .club-sticker { right: -4px; bottom: -10px; }
  .club-ad .club-sticker { right: -4px; }
}
@media (max-width: 420px) {
  .logo-letter { font-size: 13px !important; padding: 2px 2px 1px; }
  .header-right .btn-green { padding: 7px 9px; font-size: 12px; }
}
.butters-liked { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: #fff3a6; color: #b23a2e; font-weight: 800; font-size: 11px; border: 1.5px solid #000; transform: rotate(-2deg); }

/* Jimmy's Comedy Roast */
.jimmy-sheet { position: relative; max-width: 620px; }
.jimmy-stage { position: absolute; top: -18px; right: 18px; width: 54px; height: 54px; display: grid; place-items: center; font-size: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe066, #c99700); border: 3px solid #000; box-shadow: 3px 3px 0 #000; transform: rotate(10deg); }
.jimmy-set { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.jimmy-set li { position: relative; padding: 10px 14px; background: var(--surface-2); border: 2px solid #000; border-radius: 12px; box-shadow: 3px 3px 0 #000; font-size: 15px; line-height: 1.45; opacity: 0; animation: jimmy-in .35s ease-out forwards; }
.jimmy-set li:first-child, .jimmy-set li:last-child { background: #2f3b4a; font-weight: 700; color: var(--white); }
@keyframes jimmy-in { from { opacity: 0; transform: translateY(8px) rotate(-1deg); } to { opacity: 1; transform: none; } }
.jimmy-crowd { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .jimmy-set li { animation: none; opacity: 1; } }
.stan-quote { margin: -6px 0 14px; font-style: italic; color: var(--text-soft); } .stan-quote span { font-style: normal; color: var(--muted); }

/* ===== Kenny's Daily Mystery Episode ===== */
.mystery-head { display: flex; gap: 16px; align-items: center; }
.mystery-head h1 { margin: 2px 0 4px; font-size: clamp(30px, 5vw, 46px); color: #f2711c; text-shadow: 3px 3px 0 #000; transform: rotate(-1deg); }
.mystery-head p { margin: 0; color: var(--text-soft); max-width: 620px; }
.mystery-kenny { flex: 0 0 64px; height: 64px; display: grid; place-items: center; font-size: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffa64d, #d4570f); border: 3px solid #000; box-shadow: 3px 3px 0 #000; }
.mystery-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.mystery-frame { position: relative; overflow: hidden; border: 4px solid #000; border-radius: 8px; box-shadow: 5px 5px 0 #000; background: #000; aspect-ratio: 16 / 9; }
.mystery-frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: filter .5s ease; }
.mystery-tries { position: absolute; top: 10px; right: 10px; background: #f2711c; color: #fff; padding: 3px 10px; border: 2px solid #000; border-radius: 4px; transform: rotate(4deg); font-size: 15px; }
.mystery-guess { position: relative; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.mystery-guess input { width: 100%; font-size: 16px; padding: 12px 14px; }
.mystery-guess .pick-results { position: absolute; top: 52px; left: 0; right: 0; z-index: 5; background: var(--surface); border-radius: 6px; box-shadow: 4px 4px 0 #000; }
.mystery-guess .pick-results:empty { display: none; }
.mystery-guesses { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.mystery-guesses li { padding: 6px 12px; border-radius: 6px; background: var(--surface); font-size: 14px; }
.mystery-guesses li.wrong { color: #ff8a8a; } .mystery-guesses li.right { color: var(--green); font-weight: 700; }
.mystery-result { margin-top: 16px; padding: 16px 18px; border: 3px solid #000; border-radius: 8px; box-shadow: 4px 4px 0 #000; }
.mystery-result.won { background: #1f4d2a; } .mystery-result.lost { background: #4d1f1f; }
.mystery-result strong { font-size: 24px; color: #fff; }
.mystery-result p { margin: 6px 0 10px; }
.mystery-squares { font-size: 22px; letter-spacing: 2px; margin-bottom: 10px; }
.mystery-side { display: flex; flex-direction: column; gap: 18px; }
.mystery-hints h2, .mystery-stats h2 { margin: 0 0 10px; font-size: 20px; color: var(--white); }
.kenny-hint { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 10px 12px; background: #f2711c; color: #2b1300; border: 2px solid #000; border-radius: 12px 12px 12px 2px; box-shadow: 3px 3px 0 #000; }
.kenny-says { font-family: 'Luckiest Guy', cursive; font-size: 16px; }
.kenny-means { font-size: 13px; font-weight: 600; }
.mystery-stats { padding: 14px 16px; background-color: var(--surface); border-radius: 8px; }
.mystery-nums { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-bottom: 10px; }
.mystery-nums b { display: block; font-family: 'Luckiest Guy', cursive; font-size: 26px; color: var(--white); }
.mystery-nums span { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.mystery-dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mystery-dist li { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.mystery-dist li > div { background: #f2711c; color: #2b1300; font-weight: 800; padding: 1px 6px; border-radius: 3px; text-align: right; min-width: 20px; }
@media (max-width: 760px) { .mystery-layout { grid-template-columns: 1fr; } }

/* Home: Kenny's mystery card */
.kenny-ad { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 20px 18px; border-radius: 8px; border: 4px solid #1a1a1a; box-shadow: 4px 4px 0 #000; color: #2b1300; transform: rotate(.4deg); transition: transform .15s;
  background: radial-gradient(ellipse at 70% 30%, rgba(255,255,255,.18), transparent 60%), repeating-linear-gradient(-45deg, rgba(0,0,0,.05) 0 3px, transparent 3px 9px), #f2711c; }
.kenny-ad:hover { transform: rotate(-.4deg) scale(1.01); }
.kenny-ad-head { display: flex; gap: 10px; align-items: center; }
.kenny-ad-head span:first-child { font-size: 30px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.5)); }
.kenny-ad-title { font-size: 26px; line-height: 1.05; color: #fff; text-shadow: 2px 2px 0 #000; }
.kenny-ad-text { font-size: 14px; font-weight: 600; }
.kenny-ad-cta { align-self: flex-start; margin-top: auto; background: #2b1300; color: #fff; padding: 4px 12px; border: 3px solid #000; border-radius: 6px; box-shadow: 3px 3px 0 #000; font-size: 15px; }
/* Jimmy: one joke at a time, in a speech bubble under the profile buttons */
.jimmy-bubble { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; background: var(--surface-2); color: var(--white); border: 2px solid #000; border-radius: 14px; box-shadow: 3px 3px 0 #000; }
.jimmy-bubble p { margin: 0; flex: 1; font-size: 15px; line-height: 1.45; }
.jimmy-mic { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe066, #c99700); border: 2px solid #000; font-size: 17px; }
.jimmy-rim { align-self: flex-end; font-size: 11px; color: var(--muted); white-space: nowrap; }
.jimmy-bubble.pop { animation: cage-pop .3s cubic-bezier(.2, 1.6, .5, 1); }
@media (prefers-reduced-motion: reduce) { .jimmy-bubble.pop { animation: none; } }

/* ===== Kenny's mystery, part 2: case-file / evidence-board theme ===== */
.case-head { position: relative; padding: 30px 26px 22px; border: 4px solid #1a1a1a; border-radius: 4px 10px 10px 10px; box-shadow: 5px 5px 0 #000; color: #3b2a12;
  background: linear-gradient(180deg, rgba(0,0,0,.04), transparent 30%), #e9c98a; margin-top: 18px; }
.case-tab { position: absolute; top: -22px; left: -4px; padding: 4px 16px 2px; background: #e9c98a; border: 4px solid #1a1a1a; border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 15px; color: #3b2a12; }
.case-stamp { position: absolute; top: 14px; right: 18px; padding: 2px 10px; border: 3px solid #c0392b; border-radius: 6px; color: #c0392b; font-size: 18px; transform: rotate(8deg); opacity: .85; }
.case-head-row { display: flex; gap: 16px; align-items: center; }
.case-head h1 { margin: 0 0 4px; font-size: clamp(30px, 5vw, 46px); color: #f2711c; text-shadow: 3px 3px 0 #000; transform: rotate(-1deg); }
.case-head p { margin: 0; color: #4a3820; max-width: 640px; font-weight: 500; }
.mystery-board { padding: 18px; border-radius: 10px; border: 4px solid #1a1a1a; box-shadow: 5px 5px 0 #000;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,200,140,.12), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ctext x='8' y='40' font-size='34' font-family='Arial' fill='%23ffffff' fill-opacity='.05'%3E%3F%3C/text%3E%3C/svg%3E"), #1b1410; }
.mystery-frame { border: 10px solid #f2711c; border-radius: 28px; box-shadow: inset 0 0 0 4px #7a3a08, 0 0 0 4px #000, 6px 6px 0 #000; }
.mystery-frame img { border-radius: 16px; }
.evidence-label { position: absolute; top: 10px; left: 12px; z-index: 2; padding: 2px 10px; background: #fff3a6; color: #1a1a1a; border: 2px solid #000; transform: rotate(-4deg); font-size: 13px; }
.case-verdict { position: absolute; left: 50%; top: 50%; z-index: 2; padding: 6px 18px; font-size: clamp(28px, 5vw, 46px); border: 5px solid currentColor; border-radius: 10px; background: rgba(0,0,0,.45); transform: translate(-50%, -50%) rotate(-10deg); }
.case-verdict.won { color: #5be36f; } .case-verdict.lost { color: #ff5a5a; }
.kenny-lives { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 22px; }
.kenny-lives span { filter: drop-shadow(1px 1px 0 #000); transition: opacity .3s; }
.kenny-lives span.used { opacity: .2; filter: grayscale(1); }
.kenny-lives b { margin-left: 8px; font-size: 13px; color: #ffb27a; text-transform: uppercase; letter-spacing: .5px; }
.mystery-board .mystery-guess input { background: #2a1e16; border-color: #5a3d22; }
.case-folder { padding: 16px; border: 3px solid #1a1a1a; border-radius: 4px 10px 10px 10px; box-shadow: 4px 4px 0 #000; background: #e9c98a; color: #3b2a12; }
.case-folder h2 { margin: 0 0 12px; font-size: 20px; color: #3b2a12; }
.case-folder .kenny-hint { position: relative; padding-top: 22px; }
.case-folder .exhibit { position: absolute; top: -9px; left: 10px; padding: 1px 8px; background: #1a1a1a; color: #e9c98a; font-size: 11px; border-radius: 3px; }
.case-folder .kenny-hint.locked { background: rgba(0,0,0,.08); color: #6b5530; border-style: dashed; box-shadow: none; }
.case-folder .kenny-hint.locked .kenny-means { font-weight: 700; }
/* Comment replies: indented under the comment they answer */
.comments > li.replies { display: block; padding: 0 0 0 44px; border: 0; margin-top: -6px; }
.comments > li.replies > .comments { border-left: 2px solid var(--line); padding-left: 12px; }
.comments li.is-reply .body p { font-size: 14px; }
.reply-to { color: var(--blue); font-weight: 600; }
.reply-box:empty { display: none; }
.reply-box { margin-top: 6px; }
/* Comments under Butters' Book Club review */
.butters-thread { margin: -6px 0 6px 50px; padding: 12px 14px; border-left: 3px solid #f5c518; background: rgba(245,197,24,.05); border-radius: 0 8px 8px 0; display: flex; flex-direction: column; gap: 12px; }
.butters-comment-form { display: flex; gap: 8px; align-items: flex-end; }
.butters-comment-form textarea { flex: 1; min-height: 42px; }
@media (max-width: 560px) { .butters-thread { margin-left: 0; } .butters-comment-form { flex-direction: column; align-items: stretch; } }
.menu-count { margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; }
@media (max-width: 900px) { .header-right > .mail-btn { display: none; } }

/* ===== Direct messages ===== */
.dm-head h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); color: var(--white); }
.dm-cartman { margin: 6px 0 4px; font-size: 15px; font-style: italic; color: #ffb3b3; }
.dm-cartman span:last-child { font-style: normal; color: var(--muted); font-size: 13px; }
.dm-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; margin-top: 18px; min-height: 480px; }
.dm-list { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface); border-radius: 10px; border: 2px solid #000; box-shadow: 4px 4px 0 #000; align-self: start; }
.dm-person { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; color: var(--text); }
.dm-person:hover { background: var(--surface-2); color: var(--white); }
.dm-person.active { background: #1f4d2a; color: #fff; }
.dm-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-who small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-person.active .dm-who small { color: #b9e7c1; }
.dm-person time { font-size: 11px; color: var(--muted); }
.dm-unread { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.dm-thread { display: flex; flex-direction: column; background: var(--surface); border-radius: 10px; border: 2px solid #000; box-shadow: 4px 4px 0 #000; overflow: hidden; min-height: 480px; }
.dm-thread-head { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dm-thread-head a { display: inline-flex; gap: 10px; align-items: center; color: var(--white); }
.dm-bubbles { list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; max-height: 60vh; }
.dm-bubbles li { max-width: 75%; display: flex; flex-direction: column; }
.dm-bubbles li p { margin: 0; padding: 8px 12px; border-radius: 14px; white-space: pre-line; overflow-wrap: anywhere; border: 2px solid #000; }
.dm-bubbles li time { font-size: 10px; color: var(--muted); margin: 2px 6px 0; }
.dm-bubbles li.mine { align-self: flex-end; align-items: flex-end; }
.dm-bubbles li.mine p { background: var(--green); color: #08240f; border-bottom-right-radius: 4px; }
.dm-bubbles li.theirs p { background: var(--surface-2); color: var(--white); border-bottom-left-radius: 4px; }
.dm-bubbles li.dm-start { max-width: none; align-self: center; color: var(--muted); font-size: 13px; text-align: center; margin: auto 0; }
.dm-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.dm-compose textarea { flex: 1; resize: none; min-height: 42px; }
.dm-empty { margin: auto; padding: 30px; text-align: center; color: var(--text-soft); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dm-empty p { margin: 0; }
@media (max-width: 760px) { .dm-layout { grid-template-columns: 1fr; } .dm-thread { min-height: 420px; } }

/* ===== Kenny's mystery, part 3: purple + orange ===== */
:root { --m-purple: #5b2a86; --m-purple-2: #7b45b8; --m-lilac: #d9c6f2; --m-deep: #1d1030; --m-orange: #f2711c; }
.mystery-logo { flex: 0 0 76px; width: 76px; transform: rotate(-8deg); }
.mystery-title, .case-head h1 { background: linear-gradient(180deg, #ffb066 0%, #f2711c 45%, #b06ae8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(3px 3px 0 #000); }
.case-head { background: radial-gradient(ellipse at 85% 0%, rgba(242,113,28,.25), transparent 55%), linear-gradient(160deg, #6c38a6, #4a2273); color: #f1e8ff; }
.case-tab { background: #6c38a6; color: #f1e8ff; }
.case-stamp { border-color: var(--m-orange); color: var(--m-orange); }
.case-head p { color: #e6d8fb; }
.mystery-board { background: radial-gradient(ellipse at 50% 0%, rgba(242,113,28,.14), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ctext x='8' y='40' font-size='34' font-family='Arial' fill='%23c9a6ff' fill-opacity='.08'%3E%3F%3C/text%3E%3C/svg%3E"), var(--m-deep); }
.mystery-frame { box-shadow: inset 0 0 0 4px var(--m-purple), 0 0 0 4px #000, 6px 6px 0 #000; }
.evidence-label { background: var(--m-lilac); color: #2a1640; }
.kenny-lives b { color: #ffb066; }
.mystery-board .mystery-guess input { background: #2a1a40; border-color: #5b3a86; }
.case-folder { background: linear-gradient(160deg, #4f2680, #3a1b60); color: #f1e8ff; }
.case-folder h2 { color: #fff; }
.case-folder .exhibit { background: var(--m-orange); color: #2b1300; }
.case-folder .kenny-hint.locked { background: rgba(255,255,255,.06); color: #cdb6ee; border-color: #8a63c0; }
.mystery-stats { background: #2a1a40; border: 2px solid #000; box-shadow: 3px 3px 0 #000; }
.mystery-stats h2 { color: #fff; }

/* Home card: purple with an orange call to action */
.kenny-ad { color: #f1e8ff; background: radial-gradient(ellipse at 85% 10%, rgba(242,113,28,.3), transparent 55%), repeating-linear-gradient(-45deg, rgba(255,255,255,.04) 0 3px, transparent 3px 9px), linear-gradient(160deg, #6c38a6, #43206b); }
.kenny-ad-logo { width: 46px; flex: 0 0 46px; transform: rotate(-8deg); }
.kenny-ad-title { background: linear-gradient(180deg, #ffb066, #f2711c 50%, #c48cff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(2px 2px 0 #000); }
.kenny-ad-text { color: #eadcff; }
.kenny-ad-cta { background: var(--m-orange); color: #2b1300; }

/* Character accounts (Butters, Kyle) on episode pages and Kyle's reading-list notes */
.guest-tag { background: rgba(63,185,80,.18); color: #9be3a6; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.guest-note { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--green); background: rgba(63,185,80,.08); font-size: 13px; color: var(--text-soft); }
.guest-thread { margin: 10px 0 0; border-left-color: var(--green); background: rgba(63,185,80,.05); }
.guest-thread[hidden] { display: none; }
.search-pop-season { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: 4px; }
.kyle-note { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background-color: var(--surface-2); border-left: 4px solid #3fb950; }
.kyle-note .section-head { margin-bottom: 4px; }
.kyle-note-ep { color: var(--white); } .kyle-note-ep span { color: var(--muted); font-size: 13px; }
.kyle-note-text { margin: 4px 0 0; font-style: italic; color: var(--text-soft); }
.kyle-note .guest-note { margin-top: 4px; }
.kyle-note-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }

/* Mystery on phones: the newest clue right under the photo (the full list is far below) */
.mystery-new-clue { display: none; }
.case-folder .kenny-hint.newest { outline: 3px solid #ffd23f; outline-offset: 2px; animation: clue-pop .6s ease-out; }
@keyframes clue-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@media (max-width: 760px) {
  .mystery-new-clue { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 4px; padding: 12px 14px; background: var(--m-orange); color: #2b1300; border: 3px solid #000; border-radius: 12px 12px 12px 2px; box-shadow: 4px 4px 0 #000; animation: clue-pop .6s ease-out; }
  .mystery-new-clue .exhibit { align-self: flex-start; padding: 1px 8px; background: #1a1a1a; color: #ffd23f; font-size: 12px; border-radius: 3px; }
  .mystery-new-clue .kenny-says { font-size: 18px; }
  .mystery-new-clue .kenny-means { font-size: 15px; }
  .mystery-all-clues { font-size: 13px; font-weight: 700; color: #2b1300; text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) { .mystery-new-clue, .case-folder .kenny-hint.newest { animation: none; } }

/* PC Principal's "PC it" filter */
.pc-toggle { margin-left: auto; font-size: 12px; color: #c48cff; }
.review-body > p.pc-text { color: #e6d8fb; background: rgba(123,69,184,.14); border-left: 3px solid #7b45b8; padding: 6px 10px; border-radius: 0 6px 6px 0; }
.pc-by { display: flex; gap: 10px; align-items: center; margin: 6px 0 0; padding: 8px 12px; background: #7b45b8; color: #fff; border: 2px solid #000; border-radius: 8px 8px 0 0; box-shadow: 3px 3px 0 #000; font-size: 13px; }
.pc-by strong { display: block; font-family: 'Luckiest Guy', cursive; font-weight: 400; font-size: 15px; letter-spacing: .5px; color: #ffd23f; }
.pc-badge { flex: 0 0 34px; height: 34px; display: grid; place-items: center; font-size: 20px; background: #ffd23f; border: 2px solid #000; border-radius: 50%; }
.pc-by + p.pc-text { margin-top: 0; border-radius: 0 0 6px 6px; border-left-width: 3px; }

/* Secret modes: the logo hold must not drag the link or open the long-press menu */
.logo { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; touch-action: none; }
.logo img, .logo span { -webkit-user-drag: none; }
/* Always-visible way out of Chaos / Mysterion mode */
.mode-exit { position: fixed; left: 14px; bottom: 14px; z-index: 60; padding: 8px 14px; border: 2px solid #000; border-radius: 999px; box-shadow: 3px 3px 0 #000; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--surface-2); color: var(--white); }
html.mysterion .mode-exit { background: #2b1f3d; color: #79e06a; box-shadow: 3px 3px 0 #000, inset 0 0 0 2px #79e06a; }
html.chaos .mode-exit { background: #7dff4f; color: #10180f; }

/* Coon takeover: raccoon stars. Emoji ignore text colour, so the unrated ones are faded instead. */
html.coon-takeover-on .star-input .base { filter: grayscale(1) opacity(.3); }
html.coon-takeover-on .histogram .end { font-size: 7px; }

/* Mr. Mackey's counselor note on an episode page */
.mackey-note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; background-color: var(--yellow); color: var(--bg); border-radius: 4px; font-size: 13px; line-height: 1.5; }
.mackey-note > span { font-size: 22px; line-height: 1; }
.mackey-note p { margin: 0; color: inherit; }
.mackey-note strong { display: block; }

/* Mr. Hankey's 12 Days of Christmas (hankey.html) */
.advent-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 22px 26px; background-color: #1f5c38; color: #f4f8fb; }
.advent-head > div { flex: 1; min-width: 220px; }
.advent-head h1 { margin: 0 0 6px; font-size: clamp(28px, 5vw, 42px); line-height: 1.05; color: #fff; }
.advent-head p { margin: 2px 0 0; font-size: 14px; }
.advent-emoji { font-size: 56px; line-height: 1; }
.advent { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.advent li { display: flex; flex-direction: column; }
.door { flex: 1; width: 100%; min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; font: inherit; color: #fff; }
.advent .door.locked, .advent .door.ready { justify-content: center; align-items: center; }
.door.locked { background-color: var(--surface); color: var(--muted); }
.door.ready { background-color: #b3262e; cursor: pointer; transition: transform .12s; }
.advent li:nth-child(even) .door.ready { background-color: #1f7a44; }
.door.ready:hover, .door.ready:focus-visible { transform: rotate(-2deg) scale(1.03); }
.door-num { font-size: 56px; line-height: 1; }
.door-when { font-size: 13px; font-weight: 600; }
.door.open { justify-content: flex-start; align-items: stretch; gap: 4px; color: var(--text-soft); font-size: 13px; }
.door.open a { display: flex; flex-direction: column; gap: 8px; }
.door.open p { margin: 0; line-height: 1.5; }
.door.seen > span { color: var(--green); }
.advent-cert { text-align: center; padding: 26px; background-color: #f3ead2; color: #2b2118; }
.advent-cert > span { font-size: 44px; }
.advent-cert h2 { margin: 6px 0; }
.advent-cert p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .door.ready { transition: none; } }

/* Share cards: preview dialog */
.share-dialog img { display: block; max-width: 100%; max-height: 58vh; margin: 0 auto; border-radius: 6px; }
.share-dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* "Get the app" corner ad on the home page */
.install-ad { position: fixed; right: 14px; bottom: 14px; z-index: 55; display: flex; gap: 12px; align-items: center; width: min(300px, calc(100vw - 28px)); padding: 14px 36px 14px 14px; background-color: var(--yellow); color: var(--bg-deep); }
.install-ad img { border-radius: 10px; flex: 0 0 52px; }
.install-ad > div { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13px; }
.install-ad strong { font-size: 17px; line-height: 1.1; color: var(--bg-deep); text-shadow: none; }
.install-ad .btn { margin-top: 5px; padding: 6px 12px; font-size: 12px; background: var(--bg-deep); color: #fff; }
.install-ad-close { position: absolute; top: 6px; right: 10px; background: none; border: 0; padding: 4px; color: var(--bg-deep); font-size: 15px; cursor: pointer; }
html.chaos .install-ad, html.mysterion .install-ad { bottom: 66px; }
