/* =====================================================================
   BoldOpinion — app.css (2026-10 flat redesign)
   Clean and flat: neutral surfaces, hairline borders, soft shadows.
   Colour only where it means something: 🔥 Yeah (red) / 🧊 Nah (blue),
   pastel topic tags, the logo. Fun comes from type, emoji and motion.
   Light by default; dark via [data-theme="dark"].
   ===================================================================== */

:root {
  --bg: #F5F5F3;
  --surface: #FFFFFF;
  --surface-2: #F2F1EE;
  --surface-3: #E9E8E4;
  --line: #E6E4DF;
  --line-2: #D2D0CA;
  --text: #17171A;
  --text-2: #4F4F57;
  --text-3: #85858E;
  --accent: #17171A;
  --accent-ink: #FFFFFF;
  --hot: #E5484D;          /* Yeah */
  --hot-2: #FDECEC;
  --hot-ink: #FFFFFF;
  --cold: #3E63DD;         /* Nah */
  --cold-2: #EBF0FF;
  --good: #12A150;
  --bad: #D93025;
  --mark: #FFE27A;
  --sun: #FFD23F;
  --tag-ink: #2B2B30;
  --t0: #FFF1BF;
  --t1: #D7F3E6;
  --t2: #FDE0EC;
  --t3: #DBECFF;
  --t4: #E9E2FF;
  /* legacy names other pages still use */
  --border: var(--line);
  --shadow: rgba(20, 20, 25, .08);
  --bw: 1px;
  --sh: 0 1px 2px rgba(20, 20, 25, .05);
  --sh-sm: 0 1px 2px rgba(20, 20, 25, .05);
  --sh-lg: 0 8px 24px rgba(20, 20, 25, .08);
  --sh-pop: 0 14px 36px rgba(20, 20, 25, .16);
  --mint: var(--t1); --pink: var(--t2); --sky: var(--t3); --lilac: var(--t4); --tag-sun: var(--t0);
  --r: 14px;
  --font-d: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-b: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1040px;
  --tabbar-h: 0px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0F0F11;
  --surface: #18181B;
  --surface-2: #212126;
  --surface-3: #2B2B31;
  --line: #2A2A30;
  --line-2: #3B3B43;
  --text: #F4F4F5;
  --text-2: #B6B6BE;
  --text-3: #80808A;
  --accent: #F4F4F5;
  --accent-ink: #111113;
  --hot: #F2555A;
  --hot-2: #3A1D1F;
  --cold: #5B7FFF;
  --cold-2: #1C2440;
  --mark: #5C4A0E;
  --tag-ink: #ECECEE;
  --t0: #3A3216;
  --t1: #163328;
  --t2: #3A1C2A;
  --t3: #172A3E;
  --t4: #2A2342;
  --shadow: rgba(0, 0, 0, .4);
  --sh: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-lg: 0 8px 24px rgba(0, 0, 0, .35);
  --sh-pop: 0 14px 36px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }
body {
  margin: 0; min-height: 100vh;
  font: 500 15px/1.5 var(--font-b);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--tabbar-h);
}
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-d); line-height: 1.12; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
mark { background: linear-gradient(transparent 58%, var(--mark) 58%); color: inherit; padding: 0 .08em; border-radius: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-3); }
.center { text-align: center; }
.ic { flex: none; }
kbd { font: 700 11px/1 var(--font-b); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; background: var(--surface); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 20px 20px 56px; }
.wrap-narrow { max-width: 680px; }
.wrap-play { max-width: 600px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 16px;
  font: 700 14px/1 var(--font-b); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s, opacity .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn-hot, .btn-ink { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-hot:hover, .btn-ink:hover { background: var(--accent); opacity: .86; }
.btn-ghost { background: var(--surface); }
.btn-lg { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.btn-sm { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: var(--wrap); margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 14px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand-word { font: 800 18px/1 var(--font-d); letter-spacing: -0.03em; }
.brand-word span { color: inherit; }
.logo-mark { transition: transform .25s cubic-bezier(.2,1.6,.4,1); }
.brand:hover .logo-mark { transform: rotate(-10deg) scale(1.08); }
.topnav { display: flex; gap: 2px; margin-left: 8px; }
.topnav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  font-weight: 700; font-size: 14px; text-decoration: none; color: var(--text-2); white-space: nowrap;
}
.topnav-link:hover { color: var(--text); background: var(--surface-2); }
.topnav-link.on { color: var(--text); background: var(--surface-3); }
.topnav-link.is-play .ic { color: var(--hot); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-post .post-short { display: none; }
.theme-btn .when-dark { display: none; }
:root[data-theme="dark"] .theme-btn .when-dark { display: block; }
:root[data-theme="dark"] .theme-btn .when-light { display: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.col-main { min-width: 0; }
.col-side { display: grid; gap: 14px; align-content: start; }

/* ---------- home intro + composer ---------- */
.intro { margin-bottom: 18px; }
.intro-title { font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -0.03em; }
.intro-sub { margin: 4px 0 12px; font-size: 14px; color: var(--text-2); }
.t-hot { color: var(--hot); white-space: nowrap; }
.t-cold { color: var(--cold); white-space: nowrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.eyebrow a { color: var(--text-2); }

.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 10px; }
.composer:focus-within { border-color: var(--line-2); box-shadow: var(--sh-lg); }
.composer-box { position: relative; }
.composer textarea {
  width: 100%; min-height: 76px; resize: vertical; display: block;
  font: 600 16px/1.4 var(--font-d); letter-spacing: -0.01em;
  padding: 10px 12px 22px; border-radius: 10px; border: 0; background: var(--surface-2);
}
.composer textarea:focus { outline: none; background: var(--surface-2); }
.composer textarea::placeholder { color: var(--text-3); font-weight: 500; }
.count { position: absolute; right: 10px; bottom: 5px; font-size: 11px; font-weight: 700; color: var(--text-3); }
.count.warn { color: var(--hot); }
.composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.select select {
  appearance: none; -webkit-appearance: none; min-height: 36px; padding: 6px 30px 6px 10px; font-weight: 700; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2385858E' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.composer-bar .btn { margin-left: auto; }
.composer-error { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--hot-2); color: var(--bad); font-weight: 700; font-size: 13px; }
.composer.is-busy .btn-hot { opacity: .6; pointer-events: none; }
.post-note { margin-top: 12px; font-size: 13px; color: var(--text-3); text-align: center; }
.post-note a { color: var(--text-2); font-weight: 700; }
.posted-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-lg); padding: 14px; animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.posted-card h2 { font-size: 18px; margin-bottom: 2px; }
.posted-card .take { box-shadow: none; margin: 10px 0; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- page heads ---------- */
.page-head { padding: 4px 0 14px; }
.page-head-center { text-align: center; }
.page-title { font-size: clamp(22px, 2.8vw, 28px); font-weight: 800; letter-spacing: -0.025em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head-center .page-title { justify-content: center; display: block; }
.page-emoji { font-size: .9em; }
.page-sub { margin-top: 4px; color: var(--text-2); font-size: 14px; max-width: 40em; }
.page-head-center .page-sub { margin-left: auto; margin-right: auto; }
.section-title { font-size: 18px; margin: 28px 0 12px; }

/* ---------- sort (segmented) + topic chips ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.seg::-webkit-scrollbar { display: none; }
.seg-item { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; min-height: 30px; border-radius: 999px; font-weight: 700; font-size: 13px; text-decoration: none; color: var(--text-2); white-space: nowrap; }
.seg-item:hover { color: var(--text); }
.seg-item.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20,20,25,.12); }
:root[data-theme="dark"] .seg-item.on { background: var(--line-2); }
.seg-wide { display: flex; width: 100%; margin-bottom: 16px; }
.seg-wide .seg-item { flex: 1; justify-content: center; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chips > :last-child { margin-right: 32px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 30px; padding: 4px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 700; font-size: 13px; text-decoration: none; color: var(--text-2);
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- take card ---------- */
.feed { display: grid; gap: 10px; }
.take {
  --tag: var(--t0);
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); padding: 12px 16px 14px;
  transition: border-color .15s, box-shadow .15s;
  content-visibility: auto; contain-intrinsic-size: auto 150px;
}
.take:hover { border-color: var(--line-2); }
.take:has(.menu:not([hidden])) { content-visibility: visible; z-index: 6; }
.take.tone-1 { --tag: var(--t1); }
.take.tone-2 { --tag: var(--t2); }
.take.tone-3 { --tag: var(--t3); }
.take.tone-4 { --tag: var(--t4); }
.take-head { display: flex; align-items: center; gap: 8px; margin: 0 -8px 6px 0; min-height: 30px; }
.cat-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 7px;
  background: var(--tag); color: var(--tag-ink); font-weight: 700; font-size: 12px; text-decoration: none;
}
.cat-tag:hover { filter: brightness(.97); }
.cat-tag-sm { font-size: 11px; padding: 2px 7px; }
.take-time { font-size: 12px; font-weight: 600; color: var(--text-3); }
.temp { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.take:not(.is-revealed) .temp { display: none; }
.temp-nuclear { color: var(--bad); }
.temp-spicy { color: var(--hot); }
.temp-mild { color: var(--good); }
.temp-cold { color: var(--cold); }
.take-text { font: 700 18px/1.34 var(--font-d); letter-spacing: -0.012em; overflow-wrap: anywhere; text-wrap: pretty; }
.take-text a { text-decoration: none; }
.take-text a:hover { color: var(--text-2); }
.take-tools { margin-left: auto; display: flex; }
.tool { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--text-3); }
.tool:hover, .tool[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }

.take-act { margin-top: 12px; }
.vote-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vote {
  --c: var(--text); --fill: var(--surface-2);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 14px;
  border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text);
  font: 700 15px/1 var(--font-d); letter-spacing: -0.01em;
  transition: border-color .15s, background-color .15s, color .15s, transform .1s;
}
.vote-up { --c: var(--hot); --fill: var(--hot-2); }
.vote-down { --c: var(--cold); --fill: var(--cold-2); }
/* the poll fill: grows to the share of votes once results are shown */
.vote::before { content: ""; position: absolute; z-index: -1; inset: 0 auto 0 0; width: 0; background: var(--fill); transition: width .7s cubic-bezier(.2,.9,.3,1); }
.take:not(.is-revealed) .vote:hover { border-color: var(--c); color: var(--c); background: var(--fill); }
.vote:active { transform: scale(.98); }
.vote-pct { display: none; font: 800 14px/1 var(--font-b); font-variant-numeric: tabular-nums; color: var(--text-2); }
.take.is-revealed .vote { justify-content: space-between; }
.take.is-revealed .vote::before { width: var(--p); }
.take.is-revealed .vote-pct { display: inline; }
.vote[aria-pressed="true"] { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.vote[aria-pressed="true"]::before { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.vote[aria-pressed="true"] .vote-pct { color: var(--c); }
.vote.boom .vote-label { animation: nudge .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes nudge { 40% { transform: scale(1.14); } }
@keyframes boom { 40% { transform: scale(1.5); } }

.take-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.take-meta b { color: var(--text-2); }
.peek { border: 0; background: none; padding: 6px 4px; margin: -6px 0; color: var(--text-2); font-weight: 700; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.peek:hover { color: var(--text); }
.take.is-revealed .peek { display: none; }

/* big card on a take's own page */
.take-lg { padding: 16px 20px 18px; box-shadow: var(--sh-lg); }
.take-lg .take-text { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.24; font-weight: 800; }
.take-lg .take-act { margin-top: 16px; }
.take-lg .vote { height: 48px; font-size: 16px; }

/* ⋯ menu */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-pop);
  display: grid; animation: pop .16s ease;
}
.menu[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 7px 10px;
  border: 0; border-radius: 8px; background: none; text-align: left; text-decoration: none;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.menu-item .ic { color: var(--text-3); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-danger, .menu-danger .ic { color: var(--bad); }

/* ---------- Today's take (inline in the feed) ---------- */
.daily { padding: 8px; border: 1px solid #F0DFA0; border-radius: calc(var(--r) + 4px); background: linear-gradient(180deg, #FFF6D6, #FFFBEE); }
:root[data-theme="dark"] .daily { border-color: #3D3418; background: linear-gradient(180deg, #262110, #1D1A12); }
.daily-head { display: flex; align-items: center; gap: 8px; margin: 2px 6px 8px; min-height: 24px; }
.daily-head h2 { font: 800 11px/1 var(--font-b); color: #8A6A00; text-transform: uppercase; letter-spacing: .08em; }
:root[data-theme="dark"] .daily-head h2 { color: #E2C25A; }
.streak { margin-left: auto; font-weight: 800; font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 3px 10px; }
.streak.bump { animation: boom .5s cubic-bezier(.2,1.6,.4,1); }
.daily .take { box-shadow: none; border-color: #F0DFA0; }
:root[data-theme="dark"] .daily .take { border-color: #3D3418; }
.daily-foot { margin: 8px 6px 2px; font-size: 12px; font-weight: 600; color: #7A6A3A; }
:root[data-theme="dark"] .daily-foot { color: #B8A672; }
.daily.is-done .daily-tip { font-weight: 800; }

/* ---------- pager / empty ---------- */
.pager { display: flex; justify-content: center; gap: 10px; margin: 22px 0 6px; flex-wrap: wrap; }
.feed-end { color: var(--text-3); font-weight: 600; font-size: 13px; text-align: center; }
.feed-end a { color: var(--text); font-weight: 800; }
.empty { text-align: center; padding: 30px 18px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty-lg { margin-top: 30px; padding: 44px 18px; }
.empty-emoji { font-size: 34px; margin-bottom: 6px; }
.empty h1, .empty h2 { font-size: 20px; margin-bottom: 6px; }
.empty p { color: var(--text-2); max-width: 30em; margin: 0 auto 14px; font-size: 14px; }

/* ---------- sidebar ---------- */
.side-card { display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); text-decoration: none; }
.side-title { font-size: 14px; }
.side-play { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); gap: 4px; transition: transform .15s; }
.side-play:hover { transform: translateY(-1px); }
.side-play b { font: 800 17px/1.15 var(--font-d); }
.side-play > span { font-size: 13px; opacity: .8; }
.side-kicker { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: 1 !important; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
.topic { display: flex; align-items: center; gap: 6px; padding: 5px 7px; min-height: 32px; border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--text-2); }
.topic small { margin-left: auto; color: var(--text-3); font-size: 11px; }
.topic:hover, .topic.on { background: var(--surface-2); color: var(--text); }

/* ---------- take page ---------- */
.take-page .crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.banner { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.banner-good { background: var(--t1); color: var(--tag-ink); }
.banner-bad { background: var(--hot-2); color: var(--bad); }
.verdict-chip { display: none; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.take.is-revealed .verdict-chip { display: inline-block; }
.take-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.take-share .btn[hidden] { display: none; }
.take-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: 28px; }
.take-nav > :first-child { justify-self: start; }
.take-nav > :last-child { justify-self: end; }
.related { margin-top: 28px; }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.related-head .section-title { margin: 0; }
.related-head a { font-size: 13px; font-weight: 700; color: var(--text-2); }

/* comments link on feed cards */
.cmt-link { margin-left: auto; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.cmt-link:hover { border-color: var(--line-2); color: var(--text); background: var(--surface-2); }

/* ---------- comments ---------- */
.comments { margin-top: 22px; }
.comments-title { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.comments-title span { font: 700 13px/1 var(--font-b); color: var(--text-3); }
.c-form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; transition: border-color .15s, box-shadow .15s; }
.c-form:focus-within { border-color: var(--line-2); box-shadow: var(--sh-lg); }
.c-form textarea { display: block; width: 100%; min-height: 40px; max-height: 260px; resize: none; border: 0; border-radius: 8px; padding: 9px 10px; background: var(--surface-2); font: 500 15px/1.45 var(--font-b); }
.c-form textarea:focus { outline: none; }
.c-form textarea::placeholder { color: var(--text-3); }
.c-form-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.c-form-note { margin-right: auto; font-size: 12px; color: var(--text-3); font-weight: 600; }
.c-form.is-busy .btn-ink { opacity: .55; pointer-events: none; }
.c-error { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--hot-2); color: var(--bad); font-size: 13px; font-weight: 700; }
.c-form-reply { margin: 8px 0 4px; }
.c-list, .c-kids { list-style: none; margin: 0; padding: 0; }
.c-list { margin-top: 14px; display: grid; gap: 10px; }
.c-list > .c { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px; }
.c-kids { margin: 8px 0 0 4px; padding-left: 14px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.c-kids .c { padding-top: 2px; }
.c-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); font-weight: 600; }
.c-anon { color: var(--text-2); font-weight: 700; }
.c-badge { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.c-op { background: var(--accent); color: var(--accent-ink); }
.c-yeah { background: var(--hot-2); color: var(--hot); }
.c-nah { background: var(--cold-2); color: var(--cold); }
.c-head time::before { content: "·"; margin-right: 6px; }
.c-text { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; white-space: normal; }
.c-gone { color: var(--text-3); font-style: italic; }
.c-actions { display: flex; gap: 2px; margin: 4px 0 0 -8px; }
.c-act { border: 0; background: none; padding: 5px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.c-act:hover { background: var(--surface-2); color: var(--text); }
.c-new > .c-main { animation: flash 1.6s ease; border-radius: 8px; }
@keyframes flash { 0% { background: var(--t0); } 100% { background: transparent; } }
.c-empty { margin-top: 14px; padding: 18px; text-align: center; color: var(--text-3); font-weight: 600; font-size: 14px; border: 1px dashed var(--line-2); border-radius: 12px; }

/* ---------- top board ---------- */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.board-row.p1 { background: linear-gradient(180deg, #FFF6D6, #FFFBEE); border-color: #F0DFA0; }
:root[data-theme="dark"] .board-row.p1 { background: linear-gradient(180deg, #262110, #1D1A12); border-color: #3D3418; }
.board-rank { font: 800 16px/1 var(--font-d); text-align: center; color: var(--text-3); }
.podium .board-rank { font-size: 21px; }
.board-text { font: 700 15px/1.3 var(--font-d); text-decoration: none; }
.board-text:hover { color: var(--text-2); }
.board-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--text-3); font-weight: 600; flex-wrap: wrap; }
.board-meta b { color: var(--text); }
.mini-split { width: 56px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--hot) var(--pct), var(--cold) var(--pct)); }
.board-score { font: 800 15px/1 var(--font-d); color: var(--good); min-width: 40px; text-align: right; }

/* ---------- Judge Mode ---------- */
.play-head { text-align: center; padding: 0 0 12px; }
.play-head .page-title { justify-content: center; }
.play-head .page-sub { margin-left: auto; margin-right: auto; }
.meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.meter-stat { text-align: center; padding: 8px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.meter-stat b { display: block; font: 800 20px/1 var(--font-d); }
.meter-stat span { font-size: 11px; font-weight: 700; color: var(--text-3); }
.meter-stat.bump b { animation: boom .4s; color: var(--hot); }
.stage { position: relative; min-height: 280px; }
.stage .take { animation: deal .3s cubic-bezier(.2,1.2,.4,1); }
.stage .take.fly-right { animation: flyR .32s ease-in forwards; }
.stage .take.fly-left { animation: flyL .32s ease-in forwards; }
@keyframes deal { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes flyR { to { opacity: 0; transform: translateX(50%) rotate(6deg); } }
@keyframes flyL { to { opacity: 0; transform: translateX(-50%) rotate(-6deg); } }
.stage .take-text { font-size: clamp(20px, 3.2vw, 26px); font-weight: 800; min-height: 3.2em; display: flex; align-items: center; }
.stage .vote { height: 50px; font-size: 16px; }
.crowd-note { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; text-align: center; }
.crowd-note.with { background: var(--t1); color: var(--tag-ink); }
.crowd-note.against { background: var(--t2); color: var(--tag-ink); }
.crowd-note.first { background: var(--t0); color: var(--tag-ink); }
.play-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.kbd-hint { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; margin-top: 14px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.summary { margin-top: 18px; text-align: center; padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-lg); animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.summary-kicker { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--text-3); }
.summary-title { font-size: clamp(26px, 4vw, 34px); margin: 6px 0; }
.summary-emoji { font-size: 44px; }
.summary p { color: var(--text-2); max-width: 28em; margin: 0 auto; font-size: 14px; }

/* ---------- topics / about / rules / post ---------- */
.topic-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.topic-card { display: grid; gap: 4px; align-content: start; padding: 14px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s; }
.topic-card:nth-child(5n+1) .topic-card-emoji { background: var(--t0); }
.topic-card:nth-child(5n+2) .topic-card-emoji { background: var(--t1); }
.topic-card:nth-child(5n+3) .topic-card-emoji { background: var(--t2); }
.topic-card:nth-child(5n+4) .topic-card-emoji { background: var(--t3); }
.topic-card:nth-child(5n+5) .topic-card-emoji { background: var(--t4); }
.topic-card:hover { border-color: var(--line-2); box-shadow: var(--sh-lg); }
.topic-card-emoji { width: 38px; height: 38px; display: grid; place-items: center; font-size: 20px; border-radius: 10px; margin-bottom: 4px; }
.topic-card b { font: 800 16px/1.15 var(--font-d); }
.topic-card span { font-size: 13px; color: var(--text-2); }
.topic-card small { font-weight: 700; color: var(--text-3); font-size: 12px; }
.more-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.more-links a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 14px; text-decoration: none; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.steps li { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.steps b { display: block; font: 800 15px/1.2 var(--font-d); margin: 8px 0 4px; }
.steps p { color: var(--text-2); font-size: 13px; }
.step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 14px/1 var(--font-d); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.stat-row div { text-align: center; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat-row b { display: block; font: 800 22px/1 var(--font-d); }
.stat-row span { font-size: 12px; font-weight: 700; color: var(--text-3); }
.prose { margin-top: 14px; }
.prose h2 { font-size: 18px; margin: 22px 0 6px; }
.prose p { color: var(--text-2); font-size: 15px; line-height: 1.65; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 800 18px/1 var(--font-d); color: var(--text-3); }
.faq[open] summary::after { content: "–"; }
.faq p { padding: 0 14px 12px; font-size: 14px; color: var(--text-2); }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule { padding: 14px 16px; border-radius: var(--r); }
.rule-yes { background: var(--t1); color: var(--tag-ink); }
.rule-no { background: var(--t2); color: var(--tag-ink); }
.rule h2 { font-size: 16px; margin-bottom: 8px; }
.rule ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-weight: 600; font-size: 14px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 32px; }
.footer-in { max-width: var(--wrap); margin: 0 auto; padding: 26px 20px 14px; display: grid; grid-template-columns: 1.1fr 2fr; gap: 28px; }
.footer-brand p { margin-top: 8px; color: var(--text-2); max-width: 26em; font-size: 13px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.footer-cols h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 6px; font-family: var(--font-b); font-weight: 800; }
.footer-cols a { display: block; padding: 3px 0; text-decoration: none; font-weight: 600; font-size: 13px; color: var(--text-2); }
.footer-cols a:hover { color: var(--text); }
.footer-legal { max-width: var(--wrap); margin: 0 auto; padding: 10px 20px 20px; font-size: 12px; color: var(--text-3); }

.tabbar { display: none; }

/* ---------- dialogs / toast ---------- */
.sheet { border: 0; padding: 0; background: none; max-width: 400px; width: calc(100% - 24px); }
.sheet::backdrop { background: rgba(10, 10, 12, .45); backdrop-filter: blur(2px); }
.sheet-card { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-pop); padding: 18px; }
.sheet-card h2 { font-size: 18px; margin-bottom: 4px; }
.sheet-card > .muted { font-size: 13px; }
.radio-list { display: grid; gap: 6px; margin: 12px 0; }
.radio { display: flex; align-items: center; gap: 9px; padding: 9px 12px; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--line-2); background: var(--surface-2); }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--tabbar-h)); z-index: 90; transform: translate(-50%, 16px);
  padding: 9px 16px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; box-shadow: var(--sh-pop);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: max-content; max-width: min(420px, calc(100% - 32px)); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); color: #fff; }

/* Save as image window */
.sheet-img { max-width: 480px; max-height: calc(100dvh - 24px); }
.sheet-img .sheet-card { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 14px; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sheet-top h2 { margin: 0; font-size: 17px; }
.sheet-top .icon-btn { width: 32px; height: 32px; border: 0; background: var(--surface-2); }
.fmt-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fmt-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px; min-height: 58px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  font-weight: 700; font-size: 12px; color: var(--text-2);
}
.fmt-tab small { font-size: 10px; font-weight: 700; color: var(--text-3); }
.fmt-tab:hover { border-color: var(--line-2); color: var(--text); }
.fmt-tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.fmt-tab[aria-selected="true"] small { color: var(--accent-ink); opacity: .7; }
.fmt-shape { display: block; border: 1.5px solid currentColor; border-radius: 3px; }
.fmt-post { width: 13px; height: 16px; }
.fmt-square { width: 15px; height: 15px; }
.fmt-story { width: 10px; height: 18px; }
.fmt-wide { width: 21px; height: 12px; margin: 3px 0; }
.img-stage {
  position: relative; display: flex; align-items: center; justify-content: center; margin-top: 10px; height: min(46vh, 380px); padding: 12px; overflow: hidden;
  border-radius: 12px; background: var(--surface-2);
}
.img-stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 24px rgba(10,10,12,.18); transition: opacity .2s; }
.img-stage.is-loading img { opacity: .2; }
.img-loading { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.img-stage.is-loading .img-loading { display: grid; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fmt-hint { margin: 8px 2px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-3); }
.img-actions { display: flex; gap: 8px; margin-top: 10px; }
.img-actions .btn { flex: 1; }
.img-actions .btn[hidden] { display: none; }
.img-actions .btn:disabled { opacity: .55; cursor: default; }
.img-actions .js-img-share { flex: 0 0 auto; }
.img-tip { margin-top: 8px; font-size: 12px; color: var(--text-3); text-align: center; }
.img-tip b { color: var(--text-2); }

/* ---------- admin ---------- */
.admin-wrap { max-width: 960px; margin: 0 auto; padding: 20px 20px 50px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head h1 { font-size: 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.admin-stat { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.admin-stat .num { display: block; font: 800 20px/1 var(--font-d); }
.admin-stat .lbl { font-size: 12px; color: var(--text-3); font-weight: 700; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.admin-section { display: grid; gap: 8px; }
.admin-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.admin-row.is-hidden { opacity: .65; }
.admin-row .body { flex: 1 1 320px; }
.admin-row .txt { font-weight: 700; font-size: 14px; }
.admin-row .sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.admin-form-inline { display: inline; }
.admin-head .btn-ghost { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 700; font-size: 13px; text-decoration: none; background: var(--surface); }
.admin-wrap .btn-sm { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-weight: 700; font-size: 13px; text-decoration: none; }
.admin-wrap .btn-sm.good { background: var(--t1); }
.admin-wrap .btn-sm.danger { background: var(--hot-2); color: var(--bad); }
.badge { padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.badge.danger { background: var(--hot-2); color: var(--bad); }
.login-box { max-width: 340px; margin: 50px auto; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-lg); display: grid; gap: 8px; }
.login-box form { display: grid; gap: 8px; }
.login-box input { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.login-err { padding: 8px; border-radius: 8px; background: var(--hot-2); color: var(--bad); font-weight: 700; font-size: 13px; }
.btn-launch { min-height: 40px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; padding: 8px 16px; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (min-width: 981px) {
  .chips { display: none; }        /* the sidebar's Topics box does this job on desktop */
}
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-main { max-width: 640px; width: 100%; margin: 0 auto; }
  .col-side { display: none; }     /* phones/tablets: topic chips + Judge tab cover it */
}
@media (max-width: 900px) {
  :root { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  .topnav { display: none; }
  .btn-post { min-height: 34px; padding: 6px 14px; }
  .btn-post .post-long { display: none; }
  .btn-post .post-short { display: inline; }
  .topbar-in { padding: 6px 16px; min-height: 52px; }
  .wrap { padding: 14px 14px 32px; }
  .wrap-narrow, .wrap-play { max-width: 640px; }
  .footer-in { grid-template-columns: 1fr; gap: 16px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols > div:last-child { grid-column: 1 / -1; }
  .steps, .rule-grid { grid-template-columns: 1fr; }
  .board-row { grid-template-columns: 28px 1fr; }
  .board-score { display: none; }
  .kbd-hint { display: none; }
  .menu { right: -4px; }

  /* slim composer until it's used, so takes show up sooner */
  .composer:not(.is-open) textarea { min-height: 42px; height: 42px; padding: 10px 12px; resize: none; overflow: hidden; }
  .composer:not(.is-open) .count, .composer:not(.is-open) .select { display: none; }
  .composer:not(.is-open) .composer-bar { margin-top: 8px; }
  .composer:not(.is-open) .composer-bar .btn { width: 100%; margin: 0; }
  .composer-bar .select { flex: 1; }
  .composer-bar .select select { width: 100%; }

  /* bottom tab bar */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: var(--tabbar-h); padding: 0 6px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px);
    border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--text-3); }
  .tab.on { color: var(--text); }
  .tab.on .tab-ic { background: var(--surface-3); }
  .tab-ic { display: grid; place-items: center; width: 42px; height: 26px; border-radius: 999px; }
  .tab-center .tab-ic { width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: var(--sh-lg); }
  .tab-center.on .tab-ic { background: var(--accent); }
}
@media (max-width: 600px) {
  .take { padding: 11px 13px 12px; }
  .take-text { font-size: 17px; }
  .take-head { margin-right: -6px; }
  .take-act { margin-top: 10px; }
  .take-lg { padding: 14px 15px 16px; }
  .take-share .btn { flex: 1; padding: 6px 8px; }
  .c-list > .c { padding: 10px 12px 8px; }
  .c-kids { padding-left: 10px; margin-left: 2px; }
  .c-form-note { display: none; }
  .stage .take-text { min-height: 0; }
  .img-stage { height: min(42vh, 340px); padding: 8px; }
  .fmt-tab { min-height: 54px; }
}
@media (max-width: 380px) {
  .brand-word { font-size: 17px; }
  .mini-split { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
