/* All of the LOLs: one small stylesheet, mobile first. Colors from the 2018 LOL face. Sizes are in rem
   (borders and outlines aside), so everything follows the root size set on html below ("Screens"). */
:root {
  --bg: #fffdf6;
  --surface: #ffffff;
  --ink: #1d1a14;
  --muted: #6b6455;
  --line: #ece5d3;
  --yellow: #ffcc4d;
  --yellow-deep: #f4a900;
  --brown: #664500;
  --blue: #5dadec;
  --link: #8a5a00;
  --stage: #f3eee0;
  --bad: #b3261e;
  --shadow: 0 1px 2px rgba(60, 40, 0, .06), 0 .25rem 1rem rgba(60, 40, 0, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f;
    --surface: #1f1c16;
    --ink: #f3eee2;
    --muted: #a99f8a;
    --line: #353026;
    --link: #ffcc4d;
    --stage: #0d0c09;
    --bad: #ffb4ab;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f; --surface: #1f1c16; --ink: #f3eee2; --muted: #a99f8a; --line: #353026; --link: #ffcc4d;
  --stage: #0d0c09; --bad: #ffb4ab; --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The root size: 16px (the browser's own default) up to 2200 CSS px wide, then a little more for
   every pixel, to 150% at about 4000. A 32-inch 4K panel at its native 3840 x 2160 gets about 23px,
   which reads there like 16px on a laptop; a big screen run scaled (1920, 2560) stays at or near
   16px. The width counted is at most 16:9 of the height, so a short ultrawide keeps small type. */
html { font-size: clamp(100%, 100% + (min(100vw, 177.78vh) - 2200px) * .0045, 150%); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, video, iframe { max-width: 100%; }
img, video { height: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--yellow); color: #000; padding: .375rem .625rem; z-index: 10; }

/* header */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  max-width: 47.5rem; margin: 0 auto; padding: .875rem 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .625rem; text-decoration: none; color: var(--ink);
  font-weight: 900; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1;
  font-family: "Arial Black", "Helvetica Neue", Impact, system-ui, sans-serif;
}
.brand img { width: 2.5rem; height: 2.5rem; transition: transform .3s ease; }
.brand:hover img { transform: rotate(-20deg); }
.site-head nav { display: flex; gap: .25rem; }
.site-head nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem;
  padding: .375rem .75rem; border-radius: 999px;
}
.site-head nav a:hover { background: var(--yellow); color: #1d1a14; }

main { max-width: 47.5rem; margin: 0 auto; padding: 0 1rem 2.5rem; }
h1, h2 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; margin: .75rem 0 .375rem; }
h1.tagline { font-size: 1.15rem; font-weight: 600; color: var(--muted); margin: .25rem 0 1.125rem; }
h1 small { font-size: .6em; color: var(--muted); font-weight: 500; }
.intro { color: var(--muted); margin-top: 0; }

/* posts and cards */
.card, .post {
  background: var(--surface); border: 1px solid var(--line); border-radius: .875rem;
  padding: 1.125rem 1.125rem .5rem; margin: 0 0 1.375rem; box-shadow: var(--shadow);
}
.card h2 { font-size: 1.3rem; margin: 0 0 .25rem; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-decoration-color: var(--yellow-deep); }
.post h1 { margin-top: 0; }
/* Matt's take: his own line about a post, right under its title. A speech bubble in the site's
   yellow, larger than the body text, so it reads as a person talking rather than a caption. */
.take {
  width: fit-content; max-width: 100%; margin: .5rem 0 .75rem; padding: .5625rem .875rem .625rem;
  font-size: 1.2rem; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere;
  background: var(--yellow); color: #1d1a14; border-radius: .25rem 1rem 1rem 1rem;
}
.card h2 + .take { margin-top: .5rem; }
.meta { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }
.meta .stars { text-decoration: none; letter-spacing: 1px; }
.body > :first-child { margin-top: 0; }
.body h2, .body h3, .body h4 { font-size: 1.1rem; }
.body p { margin: 0 0 .75rem; }
.media { margin: 0 -1.125rem .875rem; }
.media { position: relative; text-align: center; background: #00000006; }
.media img, .media video { display: block; width: auto; max-width: 100%; height: auto; max-height: 85vh; max-height: 85svh; margin: 0 auto; }
.media video { max-height: 80vh; max-height: 80svh; background: #000; }
.body img { display: block; margin: 0 auto .75rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin: .375rem 0 .625rem; }
.crumbs a { color: var(--muted); }
.tags { font-size: .9rem; }
.tags a { margin-right: .5rem; text-decoration: none; }
.fine { font-size: .85rem; color: var(--muted); }
.more { font-weight: 600; }
.credit { font-size: .9rem; color: var(--muted); }
.credit .yours, .credit .whomade { white-space: nowrap; }
.maker { margin: .25rem 0 0; font-size: .95rem; font-weight: 600; }  /* "By <who made it>", above the credit */
.see-reddit { margin: 0 0 .75rem; }

/* Top comments from Reddit that Matt picked: our copy of the words, who said it, a link to it there */
.top-comments { margin: .25rem 0 1rem; }
.top-comments h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--muted); font-weight: 600; }
.rcomment { margin: 0 0 .75rem; }
.rcomment blockquote { margin: 0; padding: .1rem 0 .1rem .75rem; border-left: .1875rem solid var(--yellow); font-size: 1.05rem; }
.rcomment blockquote p { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.rcomment blockquote.rparent { font-size: .92rem; color: var(--muted); margin-bottom: .4rem; }
.rcomment.reply > blockquote:not(.rparent) { margin-left: 1rem; }
.rcomment.reply > figcaption { margin-left: 1rem; }
.rcomment figcaption, .rcomment footer { font-size: .85rem; color: var(--muted); padding-left: .75rem; }
.rcomment footer { padding-left: 0; }
.rcomment figcaption a, .rcomment footer a { color: var(--muted); }

/* YouTube: a picture and a link until it is tapped */
.yt { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.yt a, .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.yt span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--yellow); color: #1d1a14; font-weight: 700; padding: .625rem 1.125rem; border-radius: 999px;
}

/* "Where did this come from?" (off until shop links are switched on) */
.source { margin: 0 0 .75rem; font-size: .95rem; }
.source summary { cursor: pointer; color: var(--muted); }

/* ad slots: space reserved so nothing shifts (off until ads are switched on) */
.ad-slot { min-height: 6.25rem; margin: 0 0 1.375rem; }
html[data-sfw="off"] .ad-slot { display: none; } /* never an ad beside a raunchy post */

/* paging and related */
.pager, .prevnext {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  margin: .5rem 0 1.375rem; font-weight: 600;
}
.pager span { color: var(--muted); font-weight: 500; font-size: .9rem; }
.prevnext a { max-width: 48%; }
.prevnext a[rel="next"] { text-align: right; margin-left: auto; }
.related h2 { font-size: 1.15rem; margin: 0 0 .625rem; }
.related .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.related a {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: .625rem; overflow: hidden; font-size: .9rem; font-weight: 600;
}
.related img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; height: auto; }
.related span { display: block; padding: .5rem .625rem; }

/* footer */
.site-foot {
  max-width: 47.5rem; margin: 0 auto; padding: 1.125rem 1rem 2.5rem; color: var(--muted);
  font-size: .85rem; border-top: 1px solid var(--line);
}
.site-foot a { color: var(--muted); }

@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .card, .post { padding: 1.375rem 1.625rem .625rem; }
  .media { margin: 0 -1.625rem 1rem; }
  .related .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .brand img { transition: none; }
}

/* header menu and search (backlog 3d): the footer links live here too, since the feed never ends */
.main-nav { align-items: center; }
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; font-weight: 600; font-size: .95rem; padding: .375rem .75rem; border-radius: 999px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: .8em; }
.menu[open] summary, .menu summary:hover { background: var(--yellow); color: #1d1a14; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + .375rem); z-index: 20; min-width: 12.5rem; padding: .375rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.site-head .menu-list a { border-radius: .5rem; padding: .5rem .75rem; }
/* the search box and the SFW switch share a row, on every width */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex: 1 1 100%; min-width: 0; }
.search-box { display: flex; gap: .375rem; flex: 1 1 auto; min-width: 0; }
.search-box input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: .5rem .875rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.search-box input:focus { outline: 2px solid var(--yellow-deep); outline-offset: 1px; }
.search-box button {
  font: inherit; font-weight: 600; font-size: .95rem; padding: .5rem .875rem; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--yellow); color: #1d1a14;
}

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: .375rem; }
.tags a, .tag-filter a {
  display: inline-block; text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--ink);
  padding: .25rem .625rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); margin: 0;
}
.tags a:hover, .tag-filter a:hover { background: var(--yellow); color: #1d1a14; border-color: var(--yellow); }
.tag-filter {
  display: flex; flex-wrap: nowrap; gap: .375rem; margin: -.5rem -1rem 1.125rem; padding: 0 1rem .25rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tag-filter::-webkit-scrollbar { display: none; }
.tag-filter a { flex: 0 0 auto; }
.tag-filter a.all { border-style: dashed; color: var(--muted); }
.tag-list { list-style: none; padding: 0; margin: 0 0 1.5rem; columns: 2 13.75rem; column-gap: 1.5rem; }
.tag-list li { break-inside: avoid; padding: .375rem 0; border-bottom: 1px solid var(--line); }
.tag-list a { font-weight: 700; text-decoration: none; }
.tag-list small { color: var(--muted); font-weight: 600; }
.tag-list span { display: block; color: var(--muted); font-size: .85rem; }

/* descriptions and the words in the picture */
.about { margin: 0 0 .875rem; font-size: .85rem; line-height: 1.45; color: var(--muted); }
.about .desc { margin: 0 0 .375rem; color: inherit; }
.about .words { font-size: inherit; margin: 0; }
.desc { color: var(--ink); }
.words { margin: 0 0 .75rem; font-size: .9rem; }
.words summary { cursor: pointer; color: var(--muted); }
.words p { margin: .375rem 0 0; white-space: pre-line; }

/* infinite scroll */
.keep-going { text-align: center; margin: .25rem 0 .875rem; }
.keep-going button {
  font: inherit; font-weight: 700; padding: .625rem 1.375rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--yellow); color: #1d1a14; box-shadow: var(--shadow);
}

/* search page (Pagefind's UI, in the site's colors) */
.search-ui {
  --pagefind-ui-primary: var(--link); --pagefind-ui-text: var(--ink); --pagefind-ui-background: var(--surface);
  --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--bg); --pagefind-ui-border-radius: .625rem;
  --pagefind-ui-font: inherit; --pagefind-ui-scale: .9; min-height: 60vh;
}

@media (min-width: 640px) {
  .search-box { flex: 0 1 21.25rem; }
  .tag-filter { flex-wrap: wrap; overflow: visible; margin: -.5rem 0 1.125rem; padding: 0; }
}

/* SFW filter (assets/sfw.js): <html data-sfw="on|off">, no attribute at all without JavaScript.
   Raunchy posts sit in <template class="raunchy"> until the filter is off. */
html:not([data-sfw]) .needs-js { display: none; }
html[data-sfw="off"] [data-sfw-gate], html[data-sfw="off"] .sfw-only { display: none; }
[tabindex="-1"]:focus { outline: none; }
.sfw-toggle {
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
  min-height: 2.75rem; padding: .5rem .75rem; border-radius: .5rem; border: 1px solid var(--line); background: var(--surface);
}
.sfw-toggle small { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); }
.sfw-toggle:hover, .sfw-toggle:focus-visible { border-color: var(--yellow-deep); }
/* The switch in the header: a small track and knob, "SFW" in green while the filter is on,
   "NSFW 🌶️" in red once it is off. */
.sfw-switch {
  flex: none; display: inline-flex; align-items: center; gap: .4375rem; min-height: 2.5rem; padding: .25rem .75rem .25rem .5rem;
  font: inherit; font-size: .9rem; font-weight: 800; white-space: nowrap; cursor: pointer; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.sfw-switch::before {
  content: ""; flex: none; width: 2rem; height: 1.125rem; border-radius: 999px;
  background: #2f9e5a radial-gradient(circle at 1.4375rem .5625rem, #fff .40625rem, transparent .4375rem); /* on: knob to the right */
}
.sfw-switch[aria-pressed="false"] { border-color: #d9480f; }
.sfw-switch[aria-pressed="false"]::before { background: #d9480f radial-gradient(circle at .5625rem .5625rem, #fff .40625rem, transparent .4375rem); }
.sfw-switch:hover, .sfw-switch:focus-visible { border-color: var(--yellow-deep); }
.sfw-line { margin: 0 0 .875rem; }
.sfw-gate, .sfw-note { text-align: center; }
.sfw-gate { padding-bottom: .875rem; }
.sfw-note {
  color: var(--muted); border: 1px dashed var(--line); border-radius: .875rem; padding: 1rem 1rem .375rem; margin: 0 0 1.375rem;
}
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .625rem; margin: 0 0 .875rem; }
.gate-actions button {
  font: inherit; font-weight: 700; min-height: 2.75rem; padding: .625rem 1.25rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--yellow); background: var(--yellow); color: #1d1a14;
}
.gate-actions button.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 600; }
.gate-actions button.quiet:hover { border-color: var(--yellow-deep); }

/* Share, Next funny and Random (assets/buttons.js) */
.actions { margin: 0 0 .625rem; }
.share {
  font: inherit; font-size: .95rem; font-weight: 700; min-height: 2.75rem; min-width: 6rem; padding: .5rem 1.125rem;
  border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.share::before { content: "↗ "; }
.share:hover, .share:focus-visible { border-color: var(--yellow-deep); background: var(--yellow); color: #1d1a14; }
.onward { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; margin: 0 0 1.375rem; }
.onward .next-funny { grid-column: 1 / -1; }
.onward a {
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  border-radius: .875rem; font-weight: 800;
}
.next-funny { min-height: 3.5rem; font-size: 1.15rem; background: var(--yellow); color: #1d1a14; box-shadow: var(--shadow); }
.next-funny:hover, .next-funny:focus-visible { background: var(--yellow-deep); }
.onward .random, .onward .play-from {
  min-height: 3rem; padding: .25rem .5rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.onward .random:hover, .onward .random:focus-visible,
.onward .play-from:hover, .onward .play-from:focus-visible { border-color: var(--yellow-deep); }
.sfw-gate .onward { margin: 0 0 .875rem; }

/* The header nav. "One at a time" leads, in yellow. Random and Tags sit in the row where there is
   room (.nav-wide) and inside the More menu where there isn't (.nav-narrow), so the row is four
   items on a phone and fits in one line down to 20rem wide. */
.site-head nav { flex-wrap: wrap; }
.site-head nav a, .menu summary { white-space: nowrap; }
.site-head nav a.nav-play { background: var(--yellow); color: #1d1a14; }
.site-head nav a.nav-play:hover, .site-head nav a.nav-play:focus-visible { background: var(--yellow-deep); }
.nav-wide, .nav-narrow { display: contents; }
.nav-narrow { display: none; }
@media (max-width: 639px) {
  .nav-wide { display: none; }
  .nav-narrow { display: contents; }
}
@media (max-width: 430px) {
  .site-head nav { gap: 0; flex: 1 1 100%; justify-content: space-between; }
  .site-head nav a, .menu summary { padding: .375rem .625rem; font-size: .9rem; }
}
@media (max-width: 380px) {
  .site-head nav a, .menu summary { padding: .375rem .4375rem; }
}
@media (max-width: 340px) {
  .site-head nav a, .menu summary { padding: .375rem .3125rem; }
}
@media (min-width: 760px) { /* six items and the name share one line */
  .site-head nav a, .menu summary { padding: .375rem .5625rem; }
}
@media (max-width: 400px) { /* a phone: the keyboard's own Search key sends the form */
  .search-box button { display: none; }
}

/* The way into One at a time near the top of the home page */
.play-entry { margin: 0 0 1.125rem; }
.play-entry a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px .75rem; padding: .875rem 1.125rem; border-radius: .875rem;
  background: var(--yellow); color: #1d1a14; text-decoration: none; box-shadow: var(--shadow);
}
.play-entry b { font-size: 1.2rem; font-weight: 800; }
.play-entry span { font-size: .9rem; }
.play-entry a:hover, .play-entry a:focus-visible { background: var(--yellow-deep); }

/* Visitors' ratings (assets/rate.js): five buttons under a post and in One at a time. The line
   under them keeps its height while empty, so the result arriving moves nothing. */
.rate { margin: 2px 0 .875rem; }
.rate-ask { margin: 0 0 .375rem; font-size: .95rem; font-weight: 700; }
.rate-buttons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .375rem; }
.rate-buttons button {
  font: inherit; color: var(--ink); cursor: pointer; min-height: 3.75rem; padding: .375rem 0 .3125rem; border-radius: .75rem;
  border: 1px solid var(--line); background: var(--rate-bg, var(--bg));
  display: grid; gap: 2px; justify-items: center; align-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.rate-buttons b { font-size: 1.35rem; line-height: 1; }
.rate-buttons span { font-size: .72rem; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.rate-buttons button:focus-visible { outline: 2px solid var(--yellow-deep); outline-offset: 1px; }
@media (hover: hover) {
  .rate-buttons button:hover:not(:disabled) { border-color: var(--yellow-deep); }
}
.rate-buttons button:active:not(:disabled), .rate-buttons button[aria-pressed="true"] {
  background: var(--yellow); border-color: var(--yellow-deep); color: #1d1a14;
}
.rate-buttons button:active:not(:disabled) span, .rate-buttons button[aria-pressed="true"] span { color: #1d1a14; }
.rate-buttons button:disabled { opacity: .45; cursor: default; }
.rate-all { margin: .375rem 0 0; min-height: 1.5em; font-size: .9rem; color: var(--muted); }

/* One at a time (/play/, assets/play.js): one funny fills the screen. Five rows: the title, the
   stage (all the room that is left), two lines about the post, Back / Share / Next, the ratings.
   Every row but the stage has a fixed height, so nothing moves from one funny to the next. */
body.bare { overflow: hidden; overscroll-behavior: none; }
.play {
  position: relative; display: grid; grid-template: auto minmax(0, 1fr) auto auto auto / minmax(0, 1fr);
  height: 100vh; height: 100dvh; max-width: 56.25rem; margin: 0 auto;
}
.play-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: .375rem; padding: .375rem .5rem .375rem .75rem;
}
.play-home { display: block; line-height: 0; }
.play-home img { width: 2.25rem; height: 2.25rem; }
.play-head h1 { margin: 0; font-size: 1.1rem; line-height: 1.2; height: 2.4em; display: flex; align-items: center; }
.play-head h1 a {
  color: var(--ink); text-decoration: none; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.play-head .menu summary {
  display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.35rem; line-height: 1;
}
.play-head .menu summary::after { content: none; }
/* Matt's take in One at a time: a row of its own under the title (the stage gives up the room,
   the buttons below stay where they are), three lines until it is tapped. */
.play-take {
  grid-column: 1 / -1; margin: 0 .25rem 2px 0; font-size: 1.05rem; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  /* the space above and below is border, not padding: a clamped box shows the next line in its padding */
  padding-top: 0; padding-bottom: 0; border: solid var(--yellow); border-width: .4375rem 0 .5rem;
}
.play-take[hidden] { display: none; }
.play-take.open { display: block; }
.play-head .menu-list a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; border-radius: .5rem; padding: .5rem .75rem;
}
.play-head .menu-list a:hover { background: var(--yellow); color: #1d1a14; }

.play-stage {
  position: relative; min-height: 0; max-width: none; margin: 0; padding: 0; overflow: auto; background: var(--stage);
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
  overscroll-behavior: contain; touch-action: pan-y;
}
/* The funny as large as the stage allows: a video fills it (black beside a narrow one, like any
   player), a picture grows to fit but never past twice its own size (--w and --h, from play.js). */
.play-stage > img, .play-stage > video { display: block; width: 100%; height: 100%; object-fit: contain; }
.play-stage > img { max-width: calc(var(--w) * 2); max-height: calc(var(--h) * 2); cursor: zoom-in; }
.play-stage > video { background: #000; }
/* a tall picture at full width, to scroll (tap a picture to switch), and a post with several */
.play-stage.wide, .play-stage.many { grid-template-rows: auto; place-items: start center; }
.play-stage.wide > img { width: min(100%, calc(var(--w, 100vw) * 2)); height: auto; max-width: none; max-height: none; cursor: zoom-out; }
.play-stage.many > * { height: auto; max-height: none; }
.play-stage > .yt { width: 100%; max-height: 100%; }
.play-note { max-width: 26rem; padding: 1.5rem 1.25rem; text-align: center; color: var(--muted); }
.play-note strong { display: block; color: var(--ink); font-size: 1.2rem; margin-bottom: .375rem; }
.play-note p { margin: 0 0 1rem; }
.play-go {
  display: block; margin: 0 auto .625rem; font: inherit; font-weight: 800; min-height: 3.125rem; padding: .625rem 1.5rem;
  border-radius: .875rem; border: 0; cursor: pointer; background: var(--yellow); color: #1d1a14; box-shadow: var(--shadow);
}
.play-go:hover, .play-go:focus-visible { background: var(--yellow-deep); }
.play-list { display: inline-block; padding: .5rem; font-weight: 600; }
/* "Tap for sound", over a video that started muted: here, and on every other page (assets/video.js) */
.play-sound, .media .sound {
  position: absolute; left: 50%; bottom: 4.2rem; transform: translateX(-50%); white-space: nowrap; cursor: pointer;
  font: inherit; font-weight: 700; min-height: 2.75rem; padding: .5rem 1.125rem; border-radius: 999px;
  color: #fff; background: rgba(0, 0, 0, .72); border: 1px solid rgba(255, 255, 255, .35);
}
@media (prefers-reduced-motion: no-preference) {
  .play-stage.from-right > :not(.play-sound) { animation: play-from-right .16s ease-out; }
  .play-stage.from-left > :not(.play-sound) { animation: play-from-left .16s ease-out; }
}
@keyframes play-from-right { from { opacity: 0; transform: translateX(1.375rem); } }
@keyframes play-from-left { from { opacity: 0; transform: translateX(-1.375rem); } }

.play-info {
  position: relative; height: 3rem; padding: 0 .75rem; display: flex; flex-direction: column; justify-content: center;
  font-size: .85rem; line-height: 1.4; color: var(--muted);
}
.play-text, .play-meta { margin: 0; }
.play-text { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.play-text.open {
  position: absolute; z-index: 3; left: .5rem; right: .5rem; bottom: 1.5rem; white-space: normal; padding: .625rem .75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: .625rem; box-shadow: var(--shadow);
}
.play-meta { display: flex; align-items: baseline; gap: .625rem; }
.play-meta > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-meta > span a { color: inherit; }
.play-meta > a { flex: none; font-weight: 600; text-decoration: none; }

.play-tools { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); gap: .5rem; padding: .25rem .75rem .5rem; }
.play-tools button { min-height: 3.125rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.play-tools button:disabled { opacity: .45; cursor: default; }
.play-back {
  font: inherit; font-size: 1.3rem; font-weight: 700; min-width: 3.375rem; border-radius: .875rem; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.play-back:hover:not(:disabled), .play-back:focus-visible { border-color: var(--yellow-deep); }
.play-tools .share { border-radius: .875rem; background: var(--surface); }
.play-next {
  font: inherit; font-size: 1.15rem; font-weight: 800; border-radius: .875rem; border: 0; cursor: pointer;
  background: var(--yellow); color: #1d1a14; box-shadow: var(--shadow);
}
.play-next:hover:not(:disabled), .play-next:focus-visible { background: var(--yellow-deep); }
.play-rate { --rate-bg: var(--surface); margin: 0; padding: 0 .75rem .75rem; }
.play-rate .rate-buttons button { min-height: 3.875rem; }
.play-toast {
  position: absolute; z-index: 5; left: 50%; top: 4.125rem; transform: translateX(-50%); margin: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 1.5rem); padding: .5rem .875rem; border-radius: 999px; text-align: center;
  background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 650; box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .25);
}
@media (min-width: 760px) {
  .play { padding: 0 1rem .5rem; }
  .play-head { padding: .625rem 0; }
  .play-head h1 { font-size: 1.35rem; }
  .play-stage { border: 1px solid var(--line); border-radius: .875rem; }
  .play-info, .play-tools, .play-rate { padding-left: 0; padding-right: 0; }
  .play-tools, .play-rate { width: min(100%, 40rem); margin-left: auto; margin-right: auto; } /* buttons a hand's width, not the stage's */
  .play-toast { top: 4.75rem; }
}
@media (max-height: 480px) { /* a phone on its side: the funny keeps what room there is */
  .play-info { display: none; }
  .play-head h1 { height: 1.2em; }
  .play-head h1 a { -webkit-line-clamp: 1; }
  .play-take { -webkit-line-clamp: 1; border-width: .1875rem 0 .25rem; font-size: .95rem; }
  .play-tools { padding-top: .375rem; }
  .play-tools button { min-height: 2.5rem; }
  .play-rate .rate-buttons button { min-height: 2.75rem; }
  .play-rate .rate-buttons span { display: none; }
}

/* Accounts (assets/account.js): optional, passkeys only. <html data-account="out|wait|in">; no
   attribute at all without JavaScript. "Sign in" leaves the menu once someone is signed in. */
html[data-account="in"] .menu [data-account-signin], html[data-account="wait"] .menu [data-account-signin] { display: none; }

/* "Save your 5 ratings": an offer, not a wall. A small card under the rating row; in One at a
   time a row of its own between the funny and the lines about it (the stage gives up the room,
   the buttons below stay where they are). */
.save-ask {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; margin: 0 0 .875rem; padding: .625rem .75rem .625rem .875rem;
  background: var(--bg); border: 1px solid var(--line); border-left: .3125rem solid var(--yellow); border-radius: .75rem;
}
.save-ask[hidden] { display: none; }
.save-ask p { margin: 0; }
.save-ask-words { flex: 1 1 13rem; min-width: 0; font-size: .88rem; line-height: 1.35; color: var(--muted); text-wrap: balance; }
.save-ask-words strong { display: block; font-size: 1.05rem; line-height: 1.3; color: var(--ink); }
.save-ask-acts { display: flex; gap: .5rem; }
.save-ask button {
  font: inherit; font-size: .95rem; font-weight: 700; min-height: 2.75rem; padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
  white-space: nowrap; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.save-ask-go { border: 1px solid var(--yellow); background: var(--yellow); color: #1d1a14; }
.save-ask-go:hover, .save-ask-go:focus-visible { background: var(--yellow-deep); border-color: var(--yellow-deep); }
.save-ask-no { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; }
.save-ask-no:hover, .save-ask-no:focus-visible { border-color: var(--yellow-deep); }
.play .save-ask { margin: .375rem .75rem 0; background: var(--surface); }
@media (min-width: 760px) {
  .play .save-ask { width: min(100%, 40rem); margin: .5rem auto 0; }
}
@media (max-height: 480px) { /* a phone on its side: one line */
  .play .save-ask { padding: .25rem .5rem .25rem .75rem; flex-wrap: nowrap; }
  .play .save-ask-words span { display: none; }
  .play .save-ask button { min-height: 2.25rem; }
}

/* The sheet: sign-up, and what happened. Up from the bottom on a phone, a card in the middle
   on anything wider. */
.sheet {
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; margin: auto 0 0; overflow: auto;
  padding: 1.375rem 1.25rem calc(1.125rem + env(safe-area-inset-bottom)); border: 0; border-radius: 1.125rem 1.125rem 0 0;
  background: var(--surface); color: var(--ink); box-shadow: 0 -.375rem 2.5rem rgba(0, 0, 0, .25);
}
.sheet::backdrop { background: rgba(29, 26, 20, .55); }
.sheet [hidden] { display: none; }
.sheet h2 { margin: 0 2.5rem .5rem 0; font-size: 1.4rem; }
.sheet p { margin: 0 0 .75rem; }
.sheet-x {
  position: absolute; top: .625rem; right: .625rem; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; cursor: pointer;
  font: inherit; font-size: 1.05rem; line-height: 1; background: transparent; color: var(--muted);
}
.sheet-x:hover, .sheet-x:focus-visible { background: var(--bg); color: var(--ink); }
.sheet-how { font-size: .92rem; color: var(--muted); }
.sheet-check {
  display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; margin: 0 0 .75rem; padding: .5rem .875rem; cursor: pointer;
  font-weight: 700; border: 1px solid var(--line); border-radius: .75rem; background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
.sheet-check input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--yellow-deep); }
.sheet-check:focus-within { border-color: var(--yellow-deep); }
.sheet-go, .sheet-acts button, .sheet-acts a {
  display: block; width: 100%; min-height: 3.125rem; padding: .625rem 1.25rem; border-radius: .875rem; cursor: pointer; text-align: center;
  font: inherit; font-weight: 800; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.sheet-go { border: 0; background: var(--yellow); color: #1d1a14; font-size: 1.1rem; box-shadow: var(--shadow); }
.sheet-go:hover:not(:disabled), .sheet-go:focus-visible { background: var(--yellow-deep); }
.sheet-go:disabled { opacity: .6; cursor: default; }
.sheet .sheet-say { margin: .75rem 0 0; font-size: .95rem; font-weight: 600; }
.sheet .sheet-say:empty { margin: 0; }
.sheet-say.bad, .account-say.bad { color: var(--bad); }
.sheet .sheet-acts { display: grid; gap: .5rem; margin: .75rem 0 0; }
.sheet-acts button:not(.sheet-go), .sheet-acts a {
  min-height: 2.875rem; padding: .5625rem 1.25rem; font-weight: 600; text-decoration: none; line-height: 1.6;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.sheet-acts button:not(.sheet-go):hover, .sheet-acts a:hover { border-color: var(--yellow-deep); }
@media (min-width: 640px) {
  .sheet { width: 27.5rem; margin: auto; padding: 1.625rem 1.75rem 1.5rem; border-radius: 1.125rem; box-shadow: 0 .625rem 3.125rem rgba(0, 0, 0, .3); }
}

/* The account page: the part that matches the visitor shows. */
[data-account-view] { display: none; }
html[data-account="out"] [data-account-view="out"], html[data-account="wait"] [data-account-view="wait"],
html[data-account="in"] [data-account-view="in"] { display: block; }
.account [hidden] { display: none; }
.account h2 { font-size: 1.15rem; margin: 1.375rem 0 .375rem; }
.account-acts { display: flex; flex-wrap: wrap; gap: .625rem; margin: 0 0 .875rem; }
.account-acts button {
  font: inherit; font-weight: 700; min-height: 3rem; padding: .625rem 1.25rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.account-acts button:hover, .account-acts button:focus-visible { border-color: var(--yellow-deep); }
.account-acts button.go { border-color: var(--yellow); background: var(--yellow); color: #1d1a14; }
.account-acts button.go:hover, .account-acts button.go:focus-visible { background: var(--yellow-deep); border-color: var(--yellow-deep); }
.account-acts button.danger { color: var(--bad); }
.account-acts button.danger:hover, .account-acts button.danger:focus-visible { border-color: var(--bad); }
.account-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; }
.account-facts div { padding: .625rem .75rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--bg); }
.account-facts dt { font-size: .78rem; color: var(--muted); }
.account-facts dd { margin: 0; font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.account-confirm { margin: 0 0 .875rem; padding: .875rem .875rem 2px; border: 1px solid var(--bad); border-radius: .75rem; }
.account-confirm p { margin: 0 0 .625rem; }
.account .account-say { margin: 0 0 .875rem; padding: .625rem .875rem; font-weight: 600; border-radius: .75rem; background: var(--bg); border: 1px solid var(--line); }
.account .account-say:empty { margin: 0; padding: 0; border: 0; }
.account-cant { color: var(--muted); }
@media (max-width: 430px) {
  .account-facts { grid-template-columns: 1fr 1fr; }
  .account-facts div:first-child { grid-column: 1 / -1; }
}

/* ---- Filters and "less like this" (assets/filters.js, play.js; backlog 3h) ---- */

/* A video's length, in its top corner: on cards, post pages and slides */
.len {
  position: absolute; z-index: 2; top: .5rem; left: .5rem; pointer-events: none;
  padding: 2px .4375rem; border-radius: .375rem; font-size: .8rem; font-weight: 700; line-height: 1.4;
  font-variant-numeric: tabular-nums; color: #fff; background: rgba(0, 0, 0, .72);
}
.yt .len { left: .5rem; top: .5rem; transform: none; padding: 2px .4375rem; border-radius: .375rem; background: rgba(0, 0, 0, .72); color: #fff; font-weight: 700; }
.yt iframe ~ .len { display: none; } /* YouTube's player has its own */
.media > .len { left: .5rem; top: .5rem; }

/* Under a post: Share and the ⋯ menu side by side */
div.actions { display: flex; align-items: center; gap: .5rem; }
.less { position: relative; }
.less > summary {
  list-style: none; cursor: pointer; display: grid; place-items: center; min-width: 3rem; min-height: 2.75rem;
  padding: 0 .625rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 1.3rem; font-weight: 800; line-height: 1; letter-spacing: 1px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.less > summary::-webkit-details-marker { display: none; }
.less[open] > summary, .less > summary:hover, .less > summary:focus-visible { border-color: var(--yellow-deep); }
.less-list {
  position: absolute; z-index: 30; left: 0; top: calc(100% + .375rem); width: max-content; min-width: 13.75rem; max-width: min(20rem, calc(100vw - 2rem));
  display: flex; flex-direction: column; padding: .375rem; border-radius: .75rem;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 .375rem 1.5rem rgba(0, 0, 0, .18);
}
.less-list button {
  font: inherit; font-size: .95rem; font-weight: 600; text-align: left; color: var(--ink); cursor: pointer;
  min-height: 2.75rem; padding: .5rem .75rem; border: 0; border-radius: .5rem; background: none;
}
.less-list button:hover, .less-list button:focus-visible { background: var(--yellow); color: #1d1a14; }
.less-more { margin: .25rem 0 0; padding: .5rem .75rem .25rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.less-more a { display: inline-block; margin: .25rem .375rem 0 0; padding: .1875rem .625rem; border-radius: 999px; border: 1px solid var(--line);
  font-weight: 700; text-decoration: none; color: var(--ink); background: var(--bg); }
.less-more a:hover { background: var(--yellow); border-color: var(--yellow); color: #1d1a14; }

/* A hidden card in a listing folds down to one line (the head script writes which cards) */
.hidden-line { display: none; align-items: center; justify-content: space-between; gap: .625rem; margin: 0; color: var(--muted); font-size: .9rem; }
.hidden-line button {
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; min-height: 2.25rem; padding: .25rem .875rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.hidden-line button:hover, .hidden-line button:focus-visible { border-color: var(--yellow-deep); }
.card.shown .hidden-line { display: none; }

/* "Things you've hidden" sits in the menu only while something is hidden */
.hidden-link { display: none !important; }
html[data-hidden][data-sfw] .hidden-link { display: block !important; }
.hidden-list { list-style: none; padding: 0; margin: 0 0 1.125rem; }
.hidden-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.hidden-list button {
  flex: none; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; min-height: 2.5rem; padding: .375rem .875rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.hidden-list button:hover, .hidden-list button:focus-visible { border-color: var(--yellow-deep); }
.hidden-page h2 { font-size: 1.1rem; margin: 1.125rem 0 .25rem; }

/* "Hidden. Undo" */
.undo-toast, .play-undo {
  position: fixed; z-index: 40; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: .625rem; width: max-content; max-width: calc(100% - 1.5rem); margin: 0;
  padding: .375rem .375rem .375rem 1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .92rem; font-weight: 650;
  box-shadow: 0 .375rem 1.5rem rgba(0, 0, 0, .3);
}
.undo-toast[hidden], .play-undo[hidden] { display: none; }
.undo-toast button, .play-undo button {
  font: inherit; font-weight: 800; min-height: 2.5rem; padding: .375rem 1rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--yellow); color: #1d1a14;
}
.play-undo { position: absolute; bottom: auto; top: 4.125rem; }

/* "Show fewer of these?" after a second 1 for a series or tag */
.less-ask {
  margin: 0 0 .875rem; padding: .625rem .75rem .625rem .875rem; border-radius: .75rem; background: var(--bg);
  border: 1px solid var(--line); border-left: .3125rem solid var(--blue);
}
.less-ask p { margin: 0; font-size: .92rem; }
.less-ask strong { display: block; font-size: 1.02rem; }
.less-ask-acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem !important; }
.less-ask button {
  font: inherit; font-size: .92rem; font-weight: 700; min-height: 2.75rem; padding: .5rem .875rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.less-ask button.less-ask-go { border-color: var(--yellow); background: var(--yellow); color: #1d1a14; }
.less-ask.floating {
  position: absolute; z-index: 6; left: .75rem; right: .75rem; top: 4rem; margin: 0; background: var(--surface);
  box-shadow: 0 .5rem 1.875rem rgba(0, 0, 0, .25);
}
@media (min-width: 760px) { .less-ask.floating { left: 50%; right: auto; width: 560px; transform: translateX(-50%); } }

/* Matt's guilty pleasures: said plainly, before it plays */
.meta .guilty, .play-meta .guilty, .tags a.guilty { font-weight: 700; }
.tags a.guilty { border-style: dashed; border-color: var(--yellow-deep); }
.tags a.guilty::before, .meta .guilty::before, .play-meta .guilty::before { content: "😬 "; }

/* One at a time: the Filters button, what is on, and the ⋯ beside Share */
.play-filters {
  position: relative; display: inline-flex; align-items: center; gap: .375rem; min-width: 2.75rem; min-height: 2.5rem; padding: .25rem .625rem;
  font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.play-filters:hover, .play-filters:focus-visible { border-color: var(--yellow-deep); }
.play-filters b {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .3125rem; border-radius: 999px;
  font-size: .75rem; background: var(--yellow); color: #1d1a14;
}
.play-filters b[hidden] { display: none; }
@media (max-width: 430px) { .play-filters-word { display: none; } .play-filters { padding: 4px 9px; } }
.play-chips {
  grid-column: 1 / -1; display: flex; align-items: center; gap: .375rem; margin: 0 -.5rem 2px -.75rem; padding: 0 .5rem 2px .75rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.play-chips[hidden] { display: none; }
.play-chips::-webkit-scrollbar { display: none; }
.chips-n { flex: none; font-size: .85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.chip {
  flex: none; font: inherit; font-size: .85rem; font-weight: 700; white-space: nowrap; cursor: pointer; min-height: 2.125rem;
  padding: .25rem .625rem; border-radius: 999px; border: 1px solid var(--yellow-deep); background: var(--yellow); color: #1d1a14;
}
.chip:not(.chip-clear):not(.chip-share)::after { content: " ✕"; font-size: .8em; }
.chip.chip-clear, .chip.chip-share { background: var(--surface); color: var(--ink); border-color: var(--line); min-width: 0; }
.chip.chip-share::before { content: "↗ "; }
.play-linked {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: 0 0 .25rem; padding: .375rem .625rem;
  font-size: .85rem; border-radius: .625rem; background: var(--bg); border: 1px dashed var(--line);
}
.play-linked[hidden] { display: none; }
.play-linked span { flex: 1 1 12rem; color: var(--muted); }
.play-linked button {
  font: inherit; font-size: .85rem; font-weight: 700; min-height: 2.125rem; padding: .25rem .75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.play-linked button[data-linked="keep"] { background: var(--yellow); border-color: var(--yellow); color: #1d1a14; }
.play-less > summary { min-height: 3.125rem; min-width: 3.125rem; border-radius: .875rem; background: var(--surface); }
.play-less.off { visibility: hidden; }
.play-less .less-list { top: auto; bottom: calc(100% + .375rem); left: 50%; transform: translateX(-50%); }
.play-stage > .len { top: .625rem; left: .625rem; }

/* The filters sheet (a <dialog> like the account one) */
.filters-sheet { padding-bottom: 0; }
.filters-sheet h2 { margin-bottom: 2px; }
.filters-count { margin: 0 0 .75rem !important; color: var(--muted); font-weight: 700; }
.filters fieldset { border: 0; margin: 0 0 .875rem; padding: 0; min-width: 0; }
.filters legend { padding: 0; margin: 0 0 .375rem; font-weight: 800; font-size: .95rem; }
.seg > div { display: flex; flex-wrap: wrap; gap: .375rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label span, .fchip {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: .375rem .875rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .92rem; font-weight: 650; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.seg input:checked + span, .fchip[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow-deep); color: #1d1a14; }
.fchip.out[aria-pressed="true"] { background: var(--surface); border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.seg input:focus-visible + span, .fchip:focus-visible { outline: 2px solid var(--yellow-deep); outline-offset: 1px; }
.fchip small { margin-left: .375rem; color: var(--muted); font-weight: 600; }
.fchip[aria-pressed="true"] small { color: inherit; }
.seg .fine { margin: .375rem 0 0; }
.seg-small { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; margin: 0 0 .5rem; font-size: .88rem; color: var(--muted); }
.seg-small label span { min-height: 2.125rem; padding: .25rem .75rem; font-size: .85rem; }
.tag-chips, [data-moods] { display: flex; flex-wrap: wrap; gap: .375rem; }
.filters-check {
  display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; margin: 0 0 .75rem; padding: .5rem .875rem; cursor: pointer;
  font-weight: 700; border: 1px solid var(--line); border-radius: .75rem; background: var(--bg);
}
.filters-check input { flex: none; width: 1.375rem; height: 1.375rem; margin: 0; accent-color: var(--yellow-deep); }
.filters-check small { display: block; font-weight: 500; font-size: .82rem; color: var(--muted); }
.filters-series { display: flex; align-items: center; gap: .5rem; margin: 0 0 .75rem; font-weight: 700; }
.filters-series[hidden] { display: none; }
.filters-none { margin: 0 0 .5rem; padding: .625rem .875rem; border-radius: .75rem; border: 1px solid var(--bad); }
.filters-none p { margin: 0; }
.filters-acts {
  position: sticky; bottom: 0; z-index: 2; margin: 0 -1.25rem !important; padding: .75rem 1.25rem calc(.875rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex !important; flex-direction: row-reverse; gap: .5rem;
}
.filters-acts button { margin: 0; }
.filters-acts .sheet-go { flex: 1 1 auto; }
.filters-acts #filters-clear { flex: none; width: auto; padding: .625rem 1rem; }
.filters-sheet .sheet-go:disabled { opacity: .5; }
@media (min-width: 640px) {
  .filters-sheet { width: 32.5rem; max-height: 88vh; padding-bottom: 0; }
  .filters-acts { margin: 0 -1.75rem !important; padding: .75rem 1.75rem 1rem; }
}

/* ---- Screens: a phone, a laptop, a 32-inch 4K monitor (2026-11-15) ----
   Phones: the page runs under the notch and the home bar (viewport-fit=cover in the head), so
   every edge keeps clear of them with env(safe-area-inset-*), and heights use svh/dvh, which
   follow Safari's bars. From 1120px wide: the header is one row; a listing is a grid of cards
   that grows a column at a time (30rem each at least; MASONRY_SCRIPT in build_site.py bricks them);
   a post's wide picture or video (data-media="wide") grows past its text, which keeps its measure.
   One at a time, from 700px wide on a screen at least 3:2, puts the funny on the left as big as
   the height allows and the title, rating and buttons in a column on the right. */
:root { --gutter: 1rem; --column: 45.5rem; --measure: 42.25rem; }
.site-head, main, .site-foot {
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.site-head { padding-top: max(.875rem, env(safe-area-inset-top)); }
.site-foot { padding-bottom: max(2.5rem, calc(1rem + env(safe-area-inset-bottom))); }
.play { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.play-head { padding-top: max(.375rem, env(safe-area-inset-top)); }
.play-rate { padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
@media (min-width: 760px) {
  .play {
    padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(.5rem, env(safe-area-inset-bottom));
  }
  .play-head { padding-top: max(.625rem, env(safe-area-inset-top)); }
}

/* The keys One at a time answers: only where there is a keyboard and a mouse (below) */
.play-keys { display: none; margin: .75rem 0 0; font-size: .85rem; line-height: 1.6; color: var(--muted); }
.play-keys kbd {
  font: inherit; font-weight: 700; color: var(--ink); padding: 0 .375rem; border-radius: .3125rem;
  border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface);
}

@media (min-width: 1120px) {
  :root { --gutter: clamp(1.25rem, 2vw, 3rem); }
  /* the header in one row: the name, the nav, then search and the switch at the right */
  .site-head, .site-foot { max-width: none; }
  .site-head { gap: .75rem 1.5rem; }
  .head-row { flex: 1 1 18rem; max-width: 34rem; margin-left: auto; }
  .search-box { flex: 1 1 auto; }
  main { max-width: calc(var(--column) + 2 * var(--gutter)); }

  /* listings: a column more for every 30rem */
  main.feed-main, main.search-main { max-width: none; }
  .feed-main .play-entry a { width: fit-content; }
  .feed-main > .pager, .feed-main > .keep-going { max-width: var(--column); margin-left: auto; margin-right: auto; }
  #feed {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 1.5rem;
    align-items: start;
  }
  #feed > .chunk { display: contents; }
  #feed .card, #feed .sfw-note { margin: 0; }
  #feed .sfw-note { grid-column: 1 / -1; }
  #feed.masonry { grid-auto-rows: 4px; row-gap: 0; }
  #feed .media img, #feed .media video { max-height: 70vh; max-height: 70svh; } /* a whole card fits on the screen */
  .tag-list { columns: 16rem; }

  /* search: the box at the text's width (its ✕ at the box's end), the results in columns */
  .head-row { justify-content: flex-end; } /* the switch at the right on the search page, which has no box up here */
  .search-main .pagefind-ui__search-input { max-width: var(--column); }
  main.search-main .pagefind-ui .pagefind-ui__search-clear { right: calc(100% - min(100%, var(--column)) + 2px); }
  .search-main .pagefind-ui__results {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); column-gap: 1.5rem;
  }

  /* a post's page: the text at its measure; a wide picture or video as wide as 88rem */
  main.post-main { max-width: calc(88rem + 2 * var(--gutter)); }
  main.post-main > * { max-width: var(--column); margin-left: auto; margin-right: auto; }
  main.post-main > .post[data-media="wide"] {
    max-width: none; display: grid; padding-left: 0; padding-right: 0;
    grid-template-columns: [full-start] minmax(1.625rem, 1fr) [text-start] minmax(0, var(--measure)) [text-end] minmax(1.625rem, 1fr) [full-end];
  }
  .post[data-media="wide"] > * { grid-column: text; }
  .post[data-media="wide"] > .body { grid-column: full; display: grid; grid-template-columns: subgrid; }
  .post[data-media="wide"] > .body > * { grid-column: text; }
  .post[data-media="wide"] > .body > .media { grid-column: full; margin: 0 0 1rem; }
}

/* One at a time on a wide screen: the stage on the left, everything else in a column on the right,
   the buttons and ratings at its foot so they never move from one funny to the next */
@media (min-width: 700px) and (min-aspect-ratio: 3/2) {
  .play {
    --side: clamp(19rem, 20vw + 3rem, 30rem); --gap: clamp(1rem, 1.6vw, 2.5rem); --edge: 1rem;
    max-width: none; column-gap: var(--gap);
    grid-template:
      "stage head" auto
      "stage info" minmax(0, 1fr)
      "stage save" auto
      "stage tools" auto
      "stage rate" auto
      "stage keys" auto / minmax(0, 1fr) var(--side);
    padding: max(var(--edge), env(safe-area-inset-top)) max(var(--edge), env(safe-area-inset-right))
             max(var(--edge), env(safe-area-inset-bottom)) max(var(--edge), env(safe-area-inset-left));
  }
  .play-stage { grid-area: stage; border: 1px solid var(--line); border-radius: .875rem; }
  .play-head { grid-area: head; align-self: start; padding: 0; gap: .375rem; }
  .play-head h1 {
    grid-column: 1 / -1; grid-row: 2; display: block; height: auto; margin: .75rem 0 .25rem;
    font-size: 1.5rem; line-height: 1.25;
  }
  .play-head h1 a { -webkit-line-clamp: 4; }
  .play-home { grid-column: 1; grid-row: 1; }
  .play-head .play-filters { grid-column: 3; grid-row: 1; }
  .play-head .sfw-switch { grid-column: 4; grid-row: 1; }
  .play-head .menu { grid-column: 5; grid-row: 1; }
  .play-chips { flex-wrap: wrap; overflow: visible; margin: .25rem 0; padding: 0; }
  .play-take { -webkit-line-clamp: 6; margin: .25rem 0; }
  .play-info {
    grid-area: info; display: flex; height: auto; justify-content: flex-start; gap: .5rem; padding: .5rem 0 0;
    font-size: .95rem; overflow: hidden;
  }
  .play-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; text-overflow: clip; }
  .play-text[hidden] { display: none; }
  .play-text.open {
    position: static; display: block; padding: 0; overflow: auto; background: none; border: 0; border-radius: 0; box-shadow: none;
  }
  .play-meta { flex-wrap: wrap; gap: .25rem .75rem; }
  .play-meta > span { white-space: normal; }
  .play .save-ask { grid-area: save; width: auto; margin: .5rem 0 0; }
  .play-tools { grid-area: tools; width: auto; margin: 0; padding: .75rem 0 .5rem; }
  .play-rate { grid-area: rate; width: auto; margin: 0; padding: 0; }
  /* what is said over the funny: over the stage's middle, not the page's */
  .play-toast, .play-undo, .less-ask.floating {
    top: 2rem; left: calc(var(--edge) + (100% - 2 * var(--edge) - var(--side) - var(--gap)) / 2);
  }
  .less-ask.floating { right: auto; width: min(35rem, calc(100% - var(--side) - 4rem)); transform: translateX(-50%); }
}
@media (min-width: 700px) and (min-aspect-ratio: 3/2) and (max-height: 480px) { /* a phone on its side */
  .play-head h1 { margin: .25rem 0 0; font-size: 1.1rem; }
  .play-head h1 a { -webkit-line-clamp: 2; }
  .play-take, .play-text { -webkit-line-clamp: 2; }
  .play-info { font-size: .85rem; gap: .25rem; padding-top: .25rem; }
  .play-tools { padding: .375rem 0; }
}
@media (min-width: 700px) and (min-aspect-ratio: 3/2) and (hover: hover) and (pointer: fine) {
  .play-keys { display: block; grid-area: keys; }
}
