/* Tom Pearl Soundboard. Buttons = path-traced sprites (tests/soundboard/art): columns up, half, pushed, lit; rows = Tom's faces. */
:root { --pink: #ff1fa8; --ink: #141014; --grout: #bdb6bf; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--grout); color: var(--ink); font: 600 15px/1.35 Inter, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #141014; outline-offset: 2px; }
[hidden] { display: none !important; }
/* pink tiled wall with Tom in front of it */
.sb-hero { position: relative; overflow: hidden; color: #fff; background: url(/assets/soundboard/tile.webp) 50% 0 / 110px, var(--pink); box-shadow: inset 0 -14px 22px -14px #0007; }
.sb-top, .sb-stage { width: min(1180px, 100%); margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)); }
.sb-top { display: flex; justify-content: space-between; padding-top: 6px; }
.sb-top a { color: #fff; text-decoration: none; padding: 12px 0; font-weight: 700; text-shadow: 0 1px 3px #7a0048; }
.sb-stage { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; min-height: 330px; }
.sb-words { position: relative; z-index: 1; flex: 1; min-width: 0; align-self: center; padding: 8px 0 30px; }
.sb-hero h1 { margin: 0; font: 400 clamp(36px, 6.2vw, 82px)/.98 "Bowlby One", Impact, sans-serif; text-transform: uppercase; letter-spacing: -.01em; text-shadow: 0 2px 0 #d3007f, 0 4px 0 #b0006a, 0 6px 0 #8c0054, 0 10px 16px #4a002c99; }
.sb-hero h1 span { display: block; }
.sb-say { position: relative; display: inline-block; max-width: 520px; margin-top: 24px; padding: 13px 20px; border-radius: 18px; background: #fff; color: var(--ink); font-size: 19px; font-weight: 700; line-height: 1.28; box-shadow: 0 6px 14px #4a002c66; }
.sb-say::after { content: ""; position: absolute; left: 100%; bottom: 14px; margin-left: -2px; border: 10px solid #0000; border-left: 18px solid #fff; }
.sb-tom { flex: none; position: relative; width: 656px; height: 400px; margin: -24px -110px 0 -150px; padding: 0; border: 0; background: none; transform-origin: 50% 100%; transition: transform .12s; filter: drop-shadow(0 8px 16px #4a002c88); }
.sb-tom:hover { transform: scale(1.02); } .sb-tom:active { transform: scale(.97); }
.sb-talk { display: block; width: 100%; height: 100%; background: url(/assets/soundboard/talk.webp?v=1) 0 100% / 700% auto no-repeat; }
/* search + groups */
.sb-bar { position: sticky; top: 0; z-index: 5; background: #fff; box-shadow: 0 3px 12px #0003; }
.sb-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; width: min(1180px, 100%); margin: 0 auto; padding: 10px max(12px, env(safe-area-inset-left)) 8px; }
.sb-bar input { flex: 1 1 160px; min-width: 0; height: 46px; padding: 0 16px; background: #f1edf2; border: 2px solid #f1edf2; border-radius: 12px; font-size: 16px; }
.sb-bar input:focus { outline: 0; border-color: var(--pink); background: #fff; }
.sb-bar #sb-random { height: 46px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 4px 0 #000, inset 0 1px 0 #fff5; transform: translateY(-2px); }
.sb-bar #sb-random:active { transform: translateY(2px); box-shadow: 0 0 0 #000, inset 0 1px 0 #fff5; }
.sb-tabs { display: flex; flex-basis: 100%; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.sb-tabs::-webkit-scrollbar { display: none; }
.sb-tabs button { flex: none; display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 12px 0 6px; background: none; border: 0; border-radius: 12px; font-weight: 700; }
.sb-tabs button:first-child { padding-left: 12px; }
.sb-tabs i { width: 36px; height: 36px; background: url(/assets/soundboard/tabs.webp?v=1) calc(var(--t) * -36px) 0 / 288px 36px; }
.sb-tabs button:hover { background: #f1edf2; }
.sb-tabs button[aria-pressed="true"] { background: var(--pink); color: #1a0011; }
/* white tiled wall: one tile per button */
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 4px; padding: 4px; min-height: 60vh; align-content: start; overflow: hidden; overflow: clip; }
.sb-item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding: 12px 10px 8px; scroll-margin: 160px; border-radius: 7px;
  background: linear-gradient(158deg, #fff 0 22%, #f6f4f7 40%, #eeebf0); box-shadow: inset 2px 2px 2px #fff, inset -2px -3px 4px #b9b1bd, inset 0 0 26px #d9d3dc, 0 1px 2px #0003; }
.sb-push { position: relative; z-index: 1; width: min(100%, 156px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: var(--img) 0 var(--r) / 400% var(--rows) no-repeat; touch-action: manipulation; }
.sb-push:hover { filter: brightness(1.06); }
.sb-push:active { animation: sb-in .05s step-end; background-position-x: 66.667%; }
.sb-item.is-out .sb-push { animation: sb-out .1s step-end; }
.sb-item.is-on .sb-push { animation: none; background-position-x: 100%; }
@keyframes sb-in { 0% { background-position-x: 33.333%; } 100% { background-position-x: 66.667%; } }
@keyframes sb-out { 0% { background-position-x: 66.667%; } 50% { background-position-x: 33.333%; } 100% { background-position-x: 0; } }
.sb-item::before { content: ""; position: absolute; left: 50%; top: 12px; width: min(100%, 190px); aspect-ratio: 1; border-radius: 50%; transform: translateX(-50%) scale(1.1); background: radial-gradient(var(--c), #0000 68%); opacity: 0; transition: opacity .15s; }
.sb-item.is-on::before { opacity: .6; }
.sb-item[data-g="Hello"] { --img: url(/assets/soundboard/hello.webp?v=1); --rows: 300%; --c: #ff1fa8; }
.sb-item[data-g="Shit"] { --img: url(/assets/soundboard/shit.webp?v=1); --rows: 500%; --c: #ff2b3f; }
.sb-item[data-g="Diarrhea"] { --img: url(/assets/soundboard/diarrhea.webp?v=1); --rows: 300%; --c: #9c3cff; }
.sb-item[data-g="Piss"] { --img: url(/assets/soundboard/piss.webp?v=1); --rows: 300%; --c: #ffc400; }
.sb-item[data-g="Talk"] { --img: url(/assets/soundboard/talking.webp?v=1); --rows: 300%; --c: #ff8fd2; }
.sb-item[data-g="Gags"] { --img: url(/assets/soundboard/gags.webp?v=1); --rows: 300%; --c: #77717c; }
.sb-item[data-g="Eating"] { --img: url(/assets/soundboard/eating.webp?v=1); --rows: 300%; --c: #ff7a1a; }
.sb-item[data-g="Grunts"] { --img: url(/assets/soundboard/grunts.webp?v=1); --rows: 300%; --c: #1f8bff; }
.sb-name { position: relative; margin: 4px 0 2px; font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.sb-acts { position: relative; display: flex; gap: 2px; margin-top: auto; }
.sb-acts button { display: grid; place-items: center; width: 46px; height: 42px; padding: 0; background: none; border: 0; border-radius: 10px; color: #6a616e; }
.sb-acts button:hover { color: #c4007a; background: #fff; }
.sb-acts svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sb-item.is-shared .sb-push { animation: sb-call 1s ease-in-out 4; }
@keyframes sb-call { 50% { transform: scale(1.08); } }
.sb-empty { grid-column: 1 / -1; margin: 0; padding: 60px 16px 120px; text-align: center; font-size: 18px; background: #fff; }
.sb-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; padding: 20px 16px calc(76px + env(safe-area-inset-bottom)); background: var(--ink); }
.sb-foot a { color: #fff; text-decoration: none; padding: 10px 0; }
/* Tom pops up from the bottom while he talks and the top of the page is out of sight */
.sb-words .sb-say { display: block; width: fit-content; margin-left: auto; margin-right: 24px; }
.sb-pop { position: fixed; left: max(0px, calc(50% - 560px)); bottom: 0; z-index: 8; display: flex; align-items: flex-end; max-width: 100vw; pointer-events: none; transform: translateY(105%); transition: transform .16s ease-in; }
.sb-pop.is-up { transform: none; transition: transform .2s cubic-bezier(.2, 1.3, .5, 1); }
.sb-pop .sb-talk { flex: none; width: 296px; height: 180px; margin-left: -50px; filter: drop-shadow(0 3px 8px #0007); }
.sb-pop .sb-say { max-width: min(440px, calc(100vw - 200px)); margin: 0 12px 88px -66px; font-size: 16px; padding: 10px 15px; background: var(--ink); color: #fff; box-shadow: 0 4px 12px #0006; }
.sb-pop .sb-say::after { left: auto; right: 100%; margin: 0 -2px 0 0; border: 9px solid #0000; border-right: 16px solid var(--ink); }
/* Download ad */
.sb-ad { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #3a3340; border-radius: 16px; background: #17131a; color: #fff; overflow: hidden; }
.sb-ad::backdrop { background: #000c; }
.sb-ad__head, .sb-ad__foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.sb-ad__head { justify-content: space-between; font-weight: 700; }
.sb-ad button { white-space: nowrap; min-height: 44px; padding: 0 14px; border: 1px solid #3a3340; border-radius: 22px; background: #08070a; font-weight: 700; }
.sb-ad__stage { position: relative; background: #000; height: min(56vw, 400px, calc(100dvh - 160px)); min-height: 120px; }
.sb-ad__stage video { width: 100%; height: 100%; display: block; object-fit: contain; }
.sb-ad__wait { position: absolute; inset: 0; display: grid; place-items: center; color: #c9bfcc; }
.sb-ad.is-playing .sb-ad__wait { display: none; }
.sb-ad #sb-ad-skip { margin-left: auto; background: #fff; color: #000; }
.sb-ad #sb-ad-skip:disabled { background: #3a343f; color: #d9d2dc; cursor: default; }
.sb-ad [hidden] { display: none; }
.sb-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 9; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 700; text-align: center; box-shadow: 0 6px 18px #0006; }
.sb-toast a { color: #ff8fd2; margin-left: 8px; }
@media (max-width: 760px) {
  .sb-stage { gap: 0; min-height: 0; }
  .sb-words { align-self: flex-start; padding: 2px 0 14px; }
  .sb-hero h1 { font-size: clamp(27px, 8.4vw, 48px); white-space: nowrap; }
  .sb-say { font-size: 15px; padding: 9px 13px; margin-top: 16px; border-radius: 14px; }
  .sb-words .sb-say { max-width: 44vw; margin-left: 0; margin-right: 0; }
  .sb-tom { width: 360px; height: 219px; margin: 62px -104px 0 -240px; }
  .sb-words .sb-say::after { bottom: 10px; border-width: 8px; border-left-width: 14px; }
  .sb-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
  .sb-item { padding: 6px 4px 2px; border-radius: 5px; } .sb-name { font-size: 13px; line-height: 1.25; }
  .sb-acts button { width: 44px; }
  .sb-pop .sb-talk { width: 222px; height: 135px; margin-left: -58px; } .sb-pop .sb-say { max-width: calc(100vw - 124px); margin: 0 8px 66px -46px; font-size: 14.5px; }
}
@media (max-width: 400px) { .sb-ad button { padding: 0 10px; font-size: 14px; } .sb-ad__foot { gap: 6px; padding-inline: 8px; } }
@media (prefers-reduced-motion: reduce) { .sb-item.is-shared .sb-push { animation: none; } .sb-pop, .sb-tom { transition: none; } }
/* 11-29 search text: his lines as plain text + FAQ under the board */
.sb-about { background: #fff; padding: 34px max(16px, calc(50% - 560px)) 40px; }
.sb-about h2 { margin: 0 0 10px; font: 400 26px/1.1 "Bowlby One", Impact, sans-serif; } .sb-about h2:not(:first-child) { margin-top: 34px; }
.sb-about > p { max-width: 72ch; margin: 0 0 16px; font-weight: 500; line-height: 1.55; } .sb-about a { color: #c2007b; }
.sb-quotes { margin: 0; padding: 0; list-style: none; columns: 3 260px; column-gap: 28px; }
.sb-quotes li { break-inside: avoid; } .sb-quotes a { display: block; padding: 7px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid #eee; } .sb-quotes a:hover { color: #c2007b; }
.sb-faq { max-width: 72ch; border-top: 1px solid #e4dde5; } .sb-faq:last-of-type { border-bottom: 1px solid #e4dde5; }
.sb-faq summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; font-weight: 700; cursor: pointer; list-style: none; }
.sb-faq summary::-webkit-details-marker { display: none; } .sb-faq summary::after { content: '+'; color: var(--pink); font-size: 22px; transition: transform .2s; } .sb-faq[open] summary::after { transform: rotate(45deg); }
.sb-faq p { margin: 0 0 14px; font-weight: 500; line-height: 1.55; }
