/* /memes/ — the imageboard everyone knows, rebuilt for 2026.
   What is kept from the original: its three stylesheets (Yotsuba B, Yotsuba, Tomorrow) with their exact colours,
   the bracketed board list, the centred board title, the post header (Subject Name (ID) date No.), the File line,
   greentext, the ## Mod capcode, [Post a Meme], the style switcher in the footer.
   What is new: the type, the spacing, the feed, the pool strip, the leaderboard, the phone layout. */
@font-face { font-family: "Inter"; src: url("assets/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root, :root[data-theme="yotsuba-b"] {
  --bg: #eef2ff; --fade: #d1d5ee; --text: #000000; --post: #d6daf0; --border: #b7c5d9; --rule: #cfd8e8;
  --surface: #ffffff; --well: #ffffff; --control: #9aa8c2;
  --title: #af0a0f; --subject: #0f0c5d; --name: #117743; --quote: #4a6610; --capcode: #800080;
  --link: #34345c; --hover: #dd0000; --nav: #6f7f95; --muted: #3f4863; --faint: #5a6480;
  --label: #9988ee; --label-text: #000000; --like: #af0a0f; --hl: #d6bad0;
  --btn: #af0a0f; --btn-text: #ffffff;
}
:root[data-theme="yotsuba"] {
  --bg: #ffffee; --fade: #fed6af; --text: #800000; --post: #f0e0d6; --border: #d9bfb7; --rule: #e6d2ca;
  --surface: #ffffff; --well: #ffffff; --control: #c9a79c;
  --title: #800000; --subject: #cc1105; --name: #117743; --quote: #4d6a0e; --capcode: #800080;
  --link: #0000ee; --hover: #dd0000; --nav: #a5704d; --muted: #7a2f22; --faint: #8f4a3a;
  --label: #eeaa88; --label-text: #800000; --like: #cc1105; --hl: #f0c0b0;
  --btn: #800000; --btn-text: #ffffff;
}
:root[data-theme="tomorrow"] {
  --bg: #1d1f21; --fade: #1d1f21; --text: #c5c8c6; --post: #282a2e; --border: #3a3e44; --rule: #33373c;
  --surface: #232528; --well: #1d1f21; --control: #555b63;
  --title: #c5c8c6; --subject: #b294bb; --name: #b5bd68; --quote: #b5bd68; --capcode: #b294bb;
  --link: #81a2be; --hover: #b9d3e8; --nav: #8b9197; --muted: #a9adab; --faint: #8f9492;
  --label: #373b41; --label-text: #c5c8c6; --like: #cc6666; --hl: #3b3329;
  --btn: #81a2be; --btn-text: #101214;
  color-scheme: dark;
}
:root {
  --radius-card: 10px; --radius-inner: 8px; --gap: 16px; --pad: 16px;
  --font: "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); background: var(--bg) linear-gradient(var(--fade), var(--bg) 200px) no-repeat; font: 15px/22px var(--font); } /* taste-skill-ignore: the top fade is the original boards' own */
a { color: var(--link); text-decoration: underline; cursor: pointer; }
a:hover { color: var(--hover); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, p, ol, ul { margin: 0; padding: 0; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---------- board list, the top line of every board */
.boardlist { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 16px 4px; font-size: 14px; color: var(--nav); max-width: 1212px; margin: 0 auto; }
.boardlist a, .footrow .group a { color: var(--link); text-decoration: none; }
.boardlist a:hover, .footrow .group a:hover { color: var(--hover); }
.boardlist a.on { font-weight: 700; }
.grow { flex: 1; }
.me { color: var(--text); display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.me .name { color: var(--name); font-weight: 700; }
.uid { font-size: 12px; line-height: 18px; padding: 0 7px; border-radius: 9px; color: #ffffff; white-space: nowrap; }

/* ---------- banner: the cap, the centred title, the CA */
.page { max-width: 1212px; margin: 0 auto; padding: 0 16px 40px; }
.boardBanner { text-align: center; padding: 6px 0 2px; }
.logo { width: 112px; height: 112px; border-radius: 50%; display: block; margin: 0 auto 8px; background: #ffffff; border: 1px solid var(--border); }
h1 { color: var(--title); font: 800 34px/1.12 var(--font); letter-spacing: -.045em; }
.boardSub { margin-top: 6px; font-size: 15px; color: var(--text); }
.boardSub b { font-weight: 700; }
.ca { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin-top: 14px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); max-width: 100%; }
.caLabel { background: var(--title); color: var(--bg); font-weight: 700; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 4px; }
:root[data-theme="tomorrow"] .caLabel { background: var(--label); color: var(--text); }
.caValue { border: 0; background: none; padding: 0; cursor: pointer; font: 600 16px/22px var(--mono); color: var(--text); overflow-wrap: anywhere; text-align: center; }
.caValue:hover { color: var(--hover); }
.caValue.soon { font-family: var(--font); font-weight: 500; cursor: default; color: var(--muted); }
.caLinks { font-size: 14px; white-space: nowrap; }

/* ---------- pool strip */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.kpi { padding: 14px 18px 16px; border-left: 1px solid var(--rule); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .label { font-size: 13px; line-height: 18px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.kpi .value small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--faint); margin-left: 4px; }
.kpi.lead .value { font-size: 36px; line-height: 40px; font-weight: 800; letter-spacing: -.04em; color: var(--title); margin-top: 2px; }
.kpi.lead .value small { font-size: 16px; }
.kpi .sub { font-size: 13px; line-height: 18px; color: var(--faint); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { height: 6px; border-radius: 3px; background: var(--post); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--name); transition: width 1s linear; }

/* ---------- layout */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 20px; align-items: start; }
.rail { display: grid; gap: var(--gap); position: sticky; top: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; min-width: 0; }
.panelHead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 14px; background: var(--post); border-bottom: 1px solid var(--border); }
h2 { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--subject); }
.panelNote { font-size: 12px; color: var(--faint); white-space: nowrap; }
.panel.red .panelHead { background: var(--title); border-bottom-color: var(--title); }
.panel.red h2 { color: var(--bg); }
.panel.red .panelNote { color: var(--bg); opacity: .85; }
:root[data-theme="tomorrow"] .panel.red .panelHead { background: var(--label); border-bottom-color: var(--border); }
:root[data-theme="tomorrow"] .panel.red h2, :root[data-theme="tomorrow"] .panel.red .panelNote { color: var(--text); }
.panelBody { padding: 12px 14px 14px; }
.panelBody .links { margin-top: 10px; }
.capcode { color: var(--capcode); font-weight: 700; }

/* ---------- ranked list */
.leaders { list-style: none; }
.leaders li { display: grid; grid-template-columns: 16px 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 14px; cursor: pointer; border-top: 1px solid var(--rule); }
.leaders li:first-child { border-top: 0; }
.leaders li:hover { background: var(--bg); }
.leaders li.none { display: block; cursor: default; color: var(--muted); font-size: 14px; }
.leaders li.none:hover { background: none; }
.leaders .place { color: var(--faint); font-size: 14px; font-weight: 700; }
.leaders img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; display: block; background: var(--post); border: 1px solid var(--border); }
.leaders .who { min-width: 0; line-height: 18px; }
.leaders .who b { display: block; font-size: 14px; color: var(--subject); white-space: nowrap; }
.leaders .who small { display: block; font-size: 13px; color: var(--name); font-weight: 700; white-space: nowrap; }
.leaders .bar { display: block; height: 3px; border-radius: 2px; background: var(--control); margin-top: 5px; min-width: 3px; }
.leaders li.first .bar { background: var(--name); }
.leaders .score { text-align: right; white-space: nowrap; line-height: 18px; }
.leaders .score b { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 15px; }
.leaders .score small { display: block; font-size: 12px; color: var(--faint); }
.leaders .score small.win { color: var(--name); font-weight: 700; }
.leaders .score small.out { color: var(--like); }

/* ---------- feed */
.togglePost { text-align: center; font-size: 22px; line-height: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.togglePost a { text-decoration: none; }
.feedNav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.feedNav b { color: var(--text); }
.txt { color: var(--link); cursor: pointer; background: none; border: 0; padding: 0; text-decoration: none; font-size: 14px; }
.txt:hover { color: var(--hover); }
.newPosts { display: block; width: 100%; text-align: center; padding: 9px; margin-bottom: 12px; border-radius: var(--radius-inner); background: var(--hl); border: 1px solid var(--border); color: var(--text); font-weight: 700; cursor: pointer; }
.empty { color: var(--muted); padding: 22px var(--pad); background: var(--post); border: 1px solid var(--border); border-radius: var(--radius-card); }

.post { background: var(--post); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px var(--pad) 14px; margin-bottom: 14px; scroll-margin-top: 14px; }
.post.highlight { background: var(--hl); }
.postInfo { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.rank { font-size: 12px; font-weight: 800; line-height: 20px; padding: 0 7px; border-radius: 4px; background: var(--title); color: var(--bg); }
:root[data-theme="tomorrow"] .rank { background: var(--label); color: var(--text); }
.subject { color: var(--subject); font-weight: 700; }
.name { color: var(--name); font-weight: 700; }
.you { color: var(--muted); }
.postInfo .no { color: var(--text); text-decoration: none; }
.postInfo .no:hover { color: var(--hover); }
.nobag { font-size: 12px; line-height: 18px; padding: 0 7px; border-radius: 4px; border: 1px solid var(--like); color: var(--like); white-space: nowrap; }
.fileText { font-size: 13px; line-height: 18px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.shot { display: block; width: fit-content; max-width: 100%; margin-top: 6px; position: relative; cursor: zoom-in; border-radius: var(--radius-inner); overflow: hidden; }
.shot img { display: block; max-height: 540px; width: auto; height: auto; background: var(--surface); }
.shot.open { cursor: zoom-out; }
.shot.open img { max-height: none; }
.shot .gif { position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 700; line-height: 20px; padding: 0 7px; border-radius: 4px; background: #000000; color: #ffffff; }
.shot.open .gif { display: none; }
.msg { font-size: 15px; line-height: 22px; margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote { color: var(--quote); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.like { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid var(--control); background: var(--surface); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; transition: background .12s, color .12s, border-color .12s, transform .08s; }
.like:hover { border-color: var(--like); color: var(--like); }
.like:active { transform: scale(.96); }
.heart { width: 16px; height: 16px; fill: currentColor; flex: none; display: block; }
.like.on { background: var(--like); border-color: var(--like); color: var(--bg); }
.like.pop .heart { animation: pop .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
.tag { font-size: 12px; font-weight: 700; line-height: 20px; padding: 0 8px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.tag.ok { border-color: var(--name); color: var(--name); }
.prize { font-weight: 700; }

/* ---------- catalog */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 14px; }
.tile { display: block; background: var(--post); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 8px 8px 10px; text-decoration: none; color: var(--text); min-width: 0; text-align: center; }
.tile:hover { background: var(--hl); color: var(--text); }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; background: var(--surface); }
.tile .row1 { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 13px; line-height: 18px; }
.tile .row1 b { display: inline-flex; align-items: center; gap: 4px; }
.tile .sub { font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub b { color: var(--subject); }

/* ---------- post form: the label cells of the original, the fields of today */
.composer { margin-bottom: 14px; }
.fields { display: grid; gap: 6px; padding: 14px; }
.field { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px; align-items: stretch; }
.field > span { background: var(--label); color: var(--label-text); border: 1px solid var(--border); border-radius: 6px; font-weight: 700; font-size: 14px; padding: 9px 10px 0; }
.field .hint { grid-column: 2; font-size: 12px; line-height: 16px; color: var(--faint); }
input[type=text], input[type=password], input[type=number], textarea, select { width: 100%; background: var(--well); border: 1px solid var(--control); border-radius: 6px; padding: 0 10px; height: 40px; outline: none; }
select { width: auto; height: 30px; }
textarea { height: 96px; padding: 9px 10px; resize: vertical; display: block; line-height: 20px; }
input:focus, textarea:focus { border-color: var(--link); box-shadow: 0 0 0 2px var(--post); }
::placeholder { color: var(--faint); opacity: .8; }
input[type=file] { width: 100%; font-size: 14px; padding: 5px 0; min-height: 40px; }
input[type=file]::file-selector-button { height: 30px; padding: 0 12px; margin-right: 10px; border-radius: 6px; border: 1px solid var(--control); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.asWho { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 40px; }
.formFoot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 0 14px 14px; }
.formFoot .note { flex: 1; min-width: 220px; }
.note { font-size: 13px; line-height: 18px; color: var(--faint); }
.err { color: #dd0000; font-weight: 700; font-size: 14px; }
:root[data-theme="tomorrow"] .err { color: #cc6666; }
.err:empty { display: none; }
.fields + .err { padding: 0 14px 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--control); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .08s, filter .12s; }
.btn:hover { color: var(--text); filter: brightness(.96); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-text); font-weight: 700; }
.btn.primary:hover { color: var(--btn-text); filter: brightness(1.12); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }

/* ---------- winners and rules */
.roundHead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 20px 0 10px; padding: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-inner); }
.roundHead:first-child { margin-top: 0; }
.roundHead span { font-size: 13px; color: var(--faint); }
.rules { display: grid; gap: var(--gap); }
.rules ol { padding: 12px 14px 14px 34px; display: grid; gap: 10px; }
.rules li { padding-left: 2px; }
.rules li b { font-weight: 700; }

/* ---------- windows: nick, profile */
.modalWrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; overflow: auto; }
.modal { width: 100%; max-width: 440px; background: var(--post); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 16px 48px rgba(0, 0, 0, .35); overflow: hidden; }
.modal .panelHead { background: var(--label); align-items: center; padding: 8px 8px 8px 14px; }
.modal h2 { color: var(--label-text); }
.modal .body { padding: 14px; }
.modal p { margin-bottom: 12px; }
.modal label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.modal label small { font-weight: 400; color: var(--faint); font-size: 13px; line-height: 18px; }
.modal input[type=text] { height: 44px; font-size: 16px; }
.modal input.mono { font-size: 13px; }
.close { width: 28px; height: 28px; border-radius: 6px; border: 0; background: none; color: var(--label-text); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.close:hover { background: rgba(0, 0, 0, .12); }
.okLine { color: var(--name); font-weight: 700; }
.badLine { color: var(--like); font-weight: 700; }
.rowBtns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- footer, toast, phone bar */
footer { font-size: 14px; }
.footrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--nav); }
.styleSwitch { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.fine { font-size: 12px; line-height: 18px; color: var(--faint); margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 460px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); text-align: center; }
.bottombar { display: none; }

@media (max-width: 980px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; order: -1; }
  #lastPanel, #pinPanel { display: none; }
  .leaders li:nth-child(n+4) { display: none; }
  body { padding-bottom: 72px; }
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--post); border-top: 1px solid var(--border); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .bottombar a { display: grid; place-items: center; height: 44px; font-size: 14px; text-decoration: none; }
  .bottombar a.on { font-weight: 800; color: var(--text); }
  .bottombar button { height: 44px; border-radius: 8px; border: 0; background: var(--btn); color: var(--btn-text); font-weight: 800; cursor: pointer; margin: 0 4px; }
  .toast { bottom: 88px; }
}
@media (max-width: 640px) {
  .page { padding: 0 16px 32px; }
  .boardlist { padding: 8px 16px 4px; }
  .logo { width: 88px; height: 88px; }
  h1 { font-size: 26px; letter-spacing: -.04em; }
  .caValue { font-size: 13px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 12px 14px; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .kpi.lead .value { font-size: 28px; line-height: 34px; }
  .kpi .value { font-size: 22px; line-height: 28px; }
  .field { grid-template-columns: minmax(0, 1fr); }
  .field > span { padding: 5px 10px; }
  .field .hint { grid-column: 1; }
  .catalog { grid-template-columns: 1fr 1fr; gap: 10px; }
  .post { padding: 10px 12px 12px; }
  .shot img { max-height: 460px; }
  hr { margin: 14px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .like.pop .heart { animation: none; }
  .meter i, .btn, .like { transition: none; }
}

#pinned { margin-top: 0; }

/* ---------- video: a cover with a play mark, then the player in its place */
.shot.video { cursor: pointer; }
.shot .play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(0, 0, 0, .62); transition: transform .12s, background .12s; }
.shot .play::after { content: ''; position: absolute; left: 27px; top: 20px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent #ffffff; }
.shot.video:hover .play { transform: scale(1.08); background: rgba(0, 0, 0, .78); }
.player { display: block; max-width: 100%; max-height: 540px; margin-top: 6px; border-radius: var(--radius-inner); background: #000000; }

/* ---------- the address a meme pays to, always on the post */
.payTo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 13px; line-height: 18px; }
.payTo span { color: var(--muted); font-weight: 700; }
.payTo a.mono { font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.field input.mono { font-size: 13px; }
@media (max-width: 640px) { .player { max-height: 460px; } }
@media (prefers-reduced-motion: reduce) { .shot .play { transition: none; } }

.logoLink { display: block; width: fit-content; margin: 0 auto 8px; border-radius: 50%; }
.logoLink .logo { margin: 0; transition: transform .12s; }
.logoLink:hover .logo { transform: scale(1.05); }
.footrow button.txt { font-size: inherit; }
