/* PuzzlePit — interface styles. The procedural scene (visual-stage.*) draws the environment;
   everything here is the interface that lives inside it: flat paper, ink outlines, chunky type. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-grotesque.e5707ab65a.woff2") format("woff2-variations"), url("/assets/bricolage-grotesque.e5707ab65a.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: "PuzzlePit Rubik"; src: url("/assets/rubik-cyrillic.9e4cf0a125.woff2") format("woff2");
  font-weight: 300 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PuzzlePit Rubik"; src: url("/assets/rubik-arabic.3fc670713b.woff2") format("woff2");
  font-weight: 300 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "PuzzlePit Poppins"; src: url("/assets/poppins-devanagari-700.2d134da26c.woff2") format("woff2");
  font-weight: 400 750; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: "PuzzlePit Poppins"; src: url("/assets/poppins-devanagari-800.f311d92210.woff2") format("woff2");
  font-weight: 751 900; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
/* Translated text (i18n.js). Right-to-left scripts run right to left inside their own boxes. */
:root[data-rtl-text] :is(p, h1, h2, h3, li, label, legend, small, strong, summary, button, a, span, option) { unicode-bidi: plaintext; }
/* CJK and Devanagari read better with a touch more line height and no negative tracking. */
:root:is([data-lang="ja"], [data-lang="zh"], [data-lang="ko"], [data-lang="hi"]) :is(h1, h2, h3, .pp-title, .wordmark-tagline) { letter-spacing: -.01em; }
:root:is([data-lang="ja"], [data-lang="zh"]) { line-break: strict; }
:root[data-lang="ko"] { word-break: keep-all; }
:root {
  color-scheme: dark;
  /* Bricolage Grotesque covers Latin. Other scripts fall back, glyph by glyph, to the closest heavy
     grotesques we can serve (Rubik for Cyrillic and Arabic, Poppins for Devanagari, each loaded only
     when a page contains that script), then to the platform's own CJK sans faces. */
  --font: "Bricolage Grotesque", "PuzzlePit Rubik", "PuzzlePit Poppins", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo",
    "PingFang SC", "Microsoft YaHei UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK JP", "Noto Sans CJK SC", "Noto Sans CJK KR", system-ui, sans-serif;
  --ink: #120c24;          /* outlines */
  --paper: #2a1d66;        /* the stage (plum night) */
  --text: #fbf3ea;
  --muted: #cdc4e4;
  --line: #5a46a8;
  --accent: #ffc845;       /* butter */
  --field: #1d1450;
  --plate: #fbf3ea;        /* small paper objects: brand plate, avatar */
  --plate-ink: #1a1230;
  --create: #ff7a59; --create-ink: #1a1230;   /* coral */
  --join: #ffc845; --join-ink: #1a1230;       /* butter */
  --button: #fbf3ea; --button-ink: #1a1230;
  --focus: #ffc845; --field-focus: #ffc845;
  --brand: #4b33b5;
  --offset: 4px;
  font: 450 17px/1.5 var(--font);
  color: var(--text);
  background: var(--paper);
}
:root[data-large-text] { font-size: 20px; }
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #241a45; --paper: #fffaf4; --text: #221a38; --muted: #574c72; --line: #d8cdf5;
  --accent: #4b33b5; --field: #fbf9fe; --plate: #fbf9fe; --plate-ink: #221a38;
  --create: #ff7a59; --create-ink: #221a38; --join: #4b33b5; --join-ink: #fbf9fe;
  --button: #fbf9fe; --button-ink: #221a38; --focus: #221a38; --field-focus: #4b33b5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; isolation: isolate; background: var(--paper); }

/* Scroll bars in the site's style. The page's own is drawn by scrollbar.js (a rail from under the
   masthead to above the footer), so the browser's is hidden; anything else that scrolls gets a
   thin accent thumb. */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
:where(body *) { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
:where(body *)::-webkit-scrollbar { width: 10px; height: 10px; }
:where(body *)::-webkit-scrollbar-thumb { background: var(--accent); background-clip: padding-box; border: 2px solid transparent; border-radius: 999px; }
:where(body *)::-webkit-scrollbar-track { background: transparent; }
.pit-scrollbar {
  position: fixed; z-index: 40; right: clamp(.15rem, .5vw, .4rem); top: var(--sb-top, 6rem); bottom: var(--sb-bottom, 1rem);
  width: 1rem; opacity: 0; pointer-events: none; transition: opacity .25s ease; touch-action: none;
}
.pit-scrollbar.is-on { opacity: 1; pointer-events: auto; }
.pit-scrollbar::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 6px; translate: -50% 0; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 18%, transparent); pointer-events: none;
}
.pit-scrollbar-thumb {
  position: absolute; top: 0; left: 50%; width: .7rem; height: var(--sb-thumb, 3rem); translate: -50% var(--sb-y, 0);
  background: var(--accent); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink);
  cursor: grab; transition: width .15s ease, scale .15s ease;
}
.pit-scrollbar:hover .pit-scrollbar-thumb, .pit-scrollbar.is-dragging .pit-scrollbar-thumb { width: .9rem; }
.pit-scrollbar.is-dragging .pit-scrollbar-thumb { cursor: grabbing; }
@media (pointer: coarse) {
  .pit-scrollbar { width: .7rem; }
  .pit-scrollbar-thumb { width: .55rem; box-shadow: none; }
  .pit-scrollbar.is-on:not(.is-awake, .is-dragging) { opacity: 0; pointer-events: none; }
}
@media (forced-colors: active) { .pit-scrollbar { display: none; } html { scrollbar-width: auto; } }
main { width: min(100% - 2rem, 34rem); margin: 0 auto; padding: 2rem 0 calc(5.5rem + env(safe-area-inset-bottom)); }
main:has(.masthead) { display: flex; flex-direction: column; min-height: 100dvh; padding: clamp(5.2rem, 14vh, 8.5rem) 0 0; }
main:has(#party-actions:not([hidden])) { width: min(100% - 2.5rem, 52rem); }
main:has(#party:not([hidden]):not(#lobby-view[hidden] *)) { width: min(100% - 2.5rem, 34rem); }
main:has(#party-library:not([hidden]):not(#lobby-view[hidden] *)) { width: min(100% - 2.5rem, 46rem); }
main:has(#solo:not([hidden]):not(#lobby-view[hidden] *)) { width: min(100% - 2.5rem, 46rem); }
/* The party screen: a little less space above, and enough below that the drawn card ends
   above the footer links instead of running over them. */
main:has(:is(#party, #solo):not([hidden]):not(#lobby-view[hidden] *)) { padding-top: clamp(4.4rem, 10.5vh, 7.5rem); }
body:has(#lobby-view:not([hidden]) :is(#party, #solo):not([hidden])) .site-footer { padding-top: clamp(2.6rem, 8vh, 5rem); }
main:has(#contact:not([hidden])) { width: min(100% - 2.5rem, 62rem); }
main:has(#advertisers:not([hidden])) { width: min(100% - 2.5rem, 70rem); padding-top: clamp(4.4rem, 10vh, 7rem); }
main:has(.plain-information:not([hidden])) { width: min(100% - 2.5rem, 52rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, p { margin: 0; }
h1 { font: 800 clamp(2.5rem, 9vw, 3.6rem)/1 var(--font); letter-spacing: -.05em; }
h2 { font-size: 1.05rem; font-weight: 750; letter-spacing: -.02em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 6px; }

/* Masthead: the small wordmark plate and the profile control sit on the surrounding pieces. */
.masthead {
  position: absolute; inset: clamp(.8rem, 2.6vw, 1.5rem) clamp(.9rem, 3.4vw, 2.6rem) auto; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: .65rem; pointer-events: none;
}
.masthead > * { pointer-events: auto; }
.brand {
  display: inline-block; padding: .18rem .7rem .3rem; color: var(--plate-ink); background: var(--plate);
  border: 3px solid #1b1140; border-radius: 999px; box-shadow: 3px 3px 0 #1b1140; rotate: -2deg;
  font: 800 clamp(1.15rem, 2.6vw, 1.45rem)/1.1 var(--font); letter-spacing: -.045em; text-decoration: none;
}
.brand span { color: var(--brand); }
/* "Pit" is a tilted sticker badge — a party label rather than a puzzle motif. */
.wordmark span {
  display: inline-block; margin-left: .04em; padding: .02em .16em .1em; color: #1b1140; background: #ff7a59;
  border: max(3px, .035em) solid #1b1140; border-radius: .26em; rotate: -5deg; translate: 0 -.04em;
  box-shadow: .05em .05em 0 #1b1140;
}
/* On the home stage the giant wordmark is the page heading, so the plate steps aside. */
body:has(#lobby-view:not([hidden]) #entry:not([hidden])) .masthead .brand { visibility: hidden; }

/* Home: wordmark + interlocking primary actions inside the pit stage. */
#lobby-view { display: grid; align-content: center; }
#lobby-view:has(#entry:not([hidden])) { flex: 1 0 auto; min-height: min(58vh, 32rem); }
#lobby-view:has(#party:not([hidden]), #solo:not([hidden])) { flex: 1 0 auto; min-height: min(50vh, 28rem); }
#code-field label { margin-bottom: .85rem; }
.wordmark {
  width: fit-content; margin: 0 auto clamp(1.4rem, 4vh, 2.4rem); color: var(--text);
  font: 800 clamp(3.6rem, 13.5vw, 9.4rem)/.82 var(--font); letter-spacing: -.062em; text-align: center;
}
#lobby-view:has(#party-form:not([hidden])) .wordmark { font-size: clamp(2.3rem, 7vw, 4.2rem); margin-bottom: 1.2rem; }
#lobby-view:has(#party:not([hidden]), #solo:not([hidden])) .wordmark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
#party-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: min(100%, 38rem); margin: 0 auto; }
#party-actions button {
  position: relative; isolation: isolate; display: block; width: 100%; min-height: 4.6rem; margin: 0;
  border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--offset) var(--offset) 0 var(--ink);
  font: 800 clamp(1.15rem, 2.3vw, 1.5rem)/1 var(--font); letter-spacing: -.03em;
}
#party-actions #choose-create { background: var(--create); color: var(--create-ink); --piece-fill: var(--create); }
#party-actions #choose-join { background: var(--join); color: var(--join-ink); --piece-fill: var(--join); margin-left: -3px; }
#party-actions :is(#choose-create, #choose-join)[data-piece-ready] { background: transparent; border-color: transparent; box-shadow: none; }
#party-actions button:hover:not(:disabled) { filter: none; }
@media (max-width: 34rem) {
  #party-actions { grid-template-columns: 1fr; }
  #party-actions #choose-join { margin: -3px 0 0; }
  #party-actions button { min-height: 4.1rem; }
}

/* Forms and the party sit directly on the stage: no floating card. */
.panel { padding: 0; background: transparent; border: 0; }
#party-form { width: min(100%, 26rem); margin: 0 auto; }
#form-title { margin-bottom: 1rem; font: 800 1.5rem/1.1 var(--font); letter-spacing: -.035em; }
label, .label { display: block; margin-bottom: .4rem; font-size: .92rem; font-weight: 700; }
input, button, select { font: inherit; }
input, textarea {
  width: 100%; min-width: 0; min-height: 3.2rem; padding: .7rem .85rem; color: var(--text); background: var(--field);
  border: 3px solid var(--ink); border-radius: 16px;
}
:root:not([data-theme="light"]) :is(input, textarea):not(#settings-dialog *, #account-menu *, .contact-panel *, .partner-card *) { border-color: #fffaf3; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.party-code-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(.25rem, 1.5vw, .55rem); max-width: 23rem; }
#code-field input { padding: .35rem 0; font-size: clamp(1.15rem, 6vw, 1.65rem); font-weight: 750; text-align: center; text-transform: uppercase; }
/* Fields show focus on their own border (one rounded box, no extra outline around it). */
:is(input, textarea):focus-visible { outline: none; border-radius: 16px; border-color: var(--field-focus) !important; box-shadow: inset 0 0 0 2px var(--field-focus); }
input[aria-invalid="true"] { border-color: var(--create) !important; border-style: dashed; }
.name-field { margin-top: 1rem; }
#name-hint { color: var(--muted); font-size: .86rem; margin-top: .35rem; }
.form-actions { margin-top: 1.25rem; }
button {
  min-height: 3rem; padding: .6rem 1.25rem; border: 3px solid var(--ink); border-radius: 999px;
  background: var(--button); color: var(--button-ink); box-shadow: 4px 4px 0 var(--ink);
  font: 780 1rem/1.15 var(--font); letter-spacing: -.01em;
}
button:active:not(:disabled) { box-shadow: 1px 1px 0 var(--ink); translate: 3px 3px; }
button:disabled { opacity: .65; }
#party-submit { background: var(--create); color: var(--create-ink); }
body:has(#code-field:not([hidden])) #party-submit { background: var(--join); color: var(--join-ink); }
.secondary { background: var(--button); color: var(--button-ink); white-space: nowrap; }
.quiet { margin-top: 1rem; background: transparent; color: var(--text); border-style: dashed; box-shadow: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
#party-code { color: var(--text); font: 800 clamp(1.9rem, 6.5vw, 2.6rem)/1 var(--font); letter-spacing: .14em; }
#masked-party-code { color: var(--muted); font-size: 1.25rem; }
#count, #status { color: var(--muted); font-size: .92rem; }
#status { margin-top: 1rem; min-height: 1.5em; text-align: center; font-weight: 600; }
/* On the party and solo screens the empty status line takes no room (it stays in the page, so
   announcements still reach screen readers). */
#lobby-view:has(:is(#party, #solo):not([hidden])) #status:empty { min-height: 0; margin-top: 0; }
/* Players: compact tiles (character, name, status) so a full party of 12 fits in two or three rows. */
.player-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.9rem, 1fr)); gap: .3rem; padding: 0; margin: .3rem 0 0; list-style: none; }
.player-tile { position: relative; display: grid; justify-items: center; padding: .3rem .2rem .35rem; border-radius: 1rem; text-align: center; }
.player-tile.self { background: color-mix(in srgb, var(--line) 45%, transparent); }
.player-tile.away { opacity: .5; }
.player-name {
  display: grid; justify-items: center; gap: .1rem; width: 100%; min-width: 0; min-height: 0; padding: 0;
  background: transparent; color: inherit; border: 0; box-shadow: none; font-size: .88rem; font-weight: 750;
}
.player-name:active:not(:disabled) { translate: none; box-shadow: none; }
.player-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-name:is(:hover, :focus-visible) .player-label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.player-state { min-height: 1.2em; color: var(--muted); font-size: .7rem; font-weight: 650; line-height: 1.2; }


/* Profile control and its menu. */
#account-menu { position: relative; z-index: 3; }
#account-menu summary {
  display: grid; place-items: center; list-style: none; padding: 0; border-radius: 50%;
  border: 3px solid #1b1140; background: var(--plate); box-shadow: 3px 3px 0 #1b1140;
}
#account-menu summary::-webkit-details-marker { display: none; }
#account-avatar { width: 2.6rem; height: 2.6rem; }
.account-menu-items {
  --menu-ink: #1b1140; --menu-muted: #5a4f7a; --menu-line: #ddd3f7; --menu-accent: #4b33b5;
  color-scheme: light; color: var(--menu-ink); background: #fffaf3;
  position: absolute; right: 0; top: calc(100% + .9rem); width: min(16.5rem, calc(100vw - 2rem));
  border: 3px solid #1b1140; border-radius: 20px; padding: .4rem; box-shadow: 5px 5px 0 #1b1140;
}
.account-menu-identity { display: flex; align-items: center; gap: .62rem; padding: .7rem .62rem; background: #efe8ff; border-radius: 11px; }
#menu-avatar { width: 2.3rem; height: 2.3rem; background: #ffc845; color: #1b1140; font-size: .86rem; }
.account-menu-person { min-width: 0; }
.account-menu-person > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-person strong { font-size: .95rem; font-weight: 800; }
.account-menu-person small { color: var(--menu-muted); font-size: .8rem; }
.account-menu-group { display: grid; gap: .06rem; padding-top: .3rem; }
.account-menu-footer { border-top: 2px solid var(--menu-line); margin-top: .3rem; }
.account-menu-row {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.4rem; padding: .32rem .57rem;
  border: 0; border-radius: 9px; margin: 0; background: transparent; color: var(--menu-ink); box-shadow: none;
  font: 650 .92rem/1.3 var(--font); text-align: left; text-decoration: none;
}
.account-menu-row:is(:hover, :focus-within) { background: #f4efff; }
.account-menu-row:active { translate: none; }
.account-menu-items :focus-visible { outline-color: var(--menu-accent); outline-offset: 1px; }
.account-menu-icon, .account-menu-row img { display: inline-grid; place-items: center; width: 1.18rem; height: 1.18rem; flex: 0 0 1.18rem; }
.account-menu-icon { color: #4b33b5; }
.player-touch-actions { display: none; }
@media (any-pointer: coarse) {
  .player-touch-actions {
    display: grid; place-items: center; position: absolute; z-index: 1; inset: 0 0 auto auto;
    width: 2rem; min-height: 2rem; padding: 0; border: 0; border-radius: .55rem;
    background: var(--field); color: var(--text); box-shadow: none; font-size: 1.05rem;
  }
}
#menu-dark-mode, #menu-music { --purple: var(--menu-accent); margin-left: auto; }
.account-avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: #ffc845; color: #1b1140; font-weight: 800; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Dialogs are paper objects with ink outlines; the scene re-forms around them. */
dialog {
  width: min(100% - 2rem, 26rem); color: #1b1140; background: #fffaf3; color-scheme: light;
  border: 3px solid #1b1140; border-radius: 24px; padding: 1.3rem; box-shadow: 6px 6px 0 #1b1140;
}
dialog::backdrop { background: #0f082859; }
dialog h2 { margin-bottom: .8rem; font-size: 1.3rem; letter-spacing: -.03em; }
dialog label { margin-top: .65rem; }
dialog :is(input, textarea, select) { color: #1b1140; background: #fff; border-color: #1b1140; }
dialog select { width: 100%; padding: .6rem; border: 3px solid #1b1140; border-radius: 14px; }
dialog button { --ink: #1b1140; }
dialog button:not(.secondary, .profile-close, .settings-close, [role="tab"], .account-menu-row, .settings-action, .settings-danger, .settings-primary) { background: #ff7a59; color: #1b1140; }
#eligibility-form a, #report-form a { color: #4b33b5; }
#eligibility-form input[type=checkbox] { width: auto; min-height: auto; }
#account-status, #profile-status, #settings-status { color: var(--muted); font-size: .9rem; }
#account-status.discord-signing-in { text-align: center; }

/* Information pages: a reading sheet in the pit. */
.information { margin-top: 1.5rem; overflow-wrap: anywhere; }
.information h1 { font-size: clamp(2.2rem, 7vw, 3.8rem); margin-bottom: .85rem; }
.information h2 { margin: 1rem 0 .35rem; }
.information p + p, .information li + li { margin-top: .6rem; }
.information a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .18em; }
.plain-information h1, .contact-panel h1 { font: 800 clamp(2.4rem, 7vw, 4.6rem)/.95 var(--font); letter-spacing: -.06em; }
.information-lead, .policy-date { color: var(--muted); }
.information-lead { font-size: 1.12rem; }
.policy-date { font-size: .82rem; margin-top: .3rem; }
.information-topics { display: grid; margin-top: 1.2rem; border-top: 3px solid var(--ink); }
:root:not([data-theme="light"]) .information-topics { border-top-color: var(--line); }
.information-topics details { border-bottom: 2px solid var(--line); }
.information-topics summary { display: flex; justify-content: space-between; gap: .6rem; align-items: center; list-style: none; padding: .75rem 0; font-weight: 750; font-size: 1.05rem; }
.information-topics summary::-webkit-details-marker { display: none; }
.information-topics summary::after { content: ""; flex: 0 0 1.1rem; height: 1.1rem; border: 3px solid currentColor; border-radius: 50%; background: radial-gradient(currentColor 0 0) center / 55% 3px no-repeat, radial-gradient(currentColor 0 0) center / 3px 55% no-repeat; }
.information-topics details[open] summary::after { background: radial-gradient(currentColor 0 0) center / 55% 3px no-repeat; }
.topic-body { max-height: min(36vh, 18rem); overflow-y: auto; padding: .15rem .75rem .8rem 0; color: var(--muted); }
.about-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem 2rem; margin: 1.6rem 0; }
.about-facts > div { padding-top: .8rem; border-top: 3px solid var(--ink); }
:root:not([data-theme="light"]) .about-facts > div { border-top-color: var(--line); }
.about-facts h2 { font-size: 1.3rem; margin: 0 0 .35rem; }
.about-facts p { color: var(--muted); }
.about-play { font-weight: 750; }
#community ul { padding-left: 1.2rem; }

/* Footer: links printed on the floor piece of the same canvas — no bar. */
.site-footer {
  align-self: center; margin-top: auto; padding: 2.6rem .2rem calc(.9rem + env(safe-area-inset-bottom));
  text-align: center; color: var(--text); font-size: .76rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem clamp(.6rem, 2.6vw, 1.6rem); }
.site-footer a { display: inline-block; padding: .3rem 0; color: var(--text); font-size: clamp(.8rem, 2.9vw, .95rem); font-weight: 700; text-decoration: none; }
.site-footer a:is(:hover, :focus-visible), .site-footer a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .25em; }
.site-footer a:focus-visible { outline-color: var(--focus); }
.site-footer small { font-weight: 600; }

/* Contact: a sentence you fill in. */
.contact-panel { width: min(100%, 62rem); margin-inline: auto; text-align: center; }
.contact-intro { color: var(--muted); font-size: 1.1rem; }
#contact-form { margin-top: clamp(1.25rem, 4vw, 2.75rem); }
.contact-line { display: flex; align-items: baseline; justify-content: center; gap: .65rem; font-size: clamp(1.05rem, 2.3vw, 1.55rem); font-weight: 700; line-height: 1.35; }
.contact-clause, .contact-blank { display: inline-flex; align-items: baseline; min-width: 0; }
.contact-clause { gap: .55rem; }
.contact-blank { gap: .12rem; }
.contact-line label { margin: 0; font: inherit; white-space: nowrap; }
.contact-line input, .contact-line select, .contact-details textarea {
  min-width: 0; color: var(--text); background: transparent; border: 0; border-bottom: 3px solid var(--text);
  border-radius: 0; padding: .48rem .18rem; font: inherit; box-shadow: none;
}
.contact-line :is(input, select) { width: 100%; height: 2.9rem; min-height: 0; text-align: center; font-weight: 500; }
.contact-blank > :is(input, .contact-select) { width: clamp(10rem, 20vw, 16rem); }
.contact-select { display: inline-block; position: relative; min-width: 0; }
.contact-select::after { content: ""; position: absolute; top: 50%; right: .55rem; width: .5rem; height: .5rem; border: solid currentColor; border-width: 0 3px 3px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.contact-line select { appearance: none; padding-right: 1.5rem; }
.contact-line select option { background: #fffaf3; color: #1b1140; }
.contact-details { width: min(100%, 43rem); margin: clamp(1.75rem, 4vw, 2.5rem) auto 0; text-align: left; }
.contact-details label { font-size: 1rem; }
.contact-details textarea { display: block; width: 100%; padding: .65rem .18rem; resize: vertical; }
.contact-actions { display: grid; justify-items: center; gap: .6rem; margin-top: 1.4rem; }
.contact-actions button { display: flex; align-items: center; gap: 1.2rem; background: var(--create); color: var(--create-ink); }
#contact-result { font-size: .9rem; overflow-wrap: anywhere; }
#contact-result:empty { display: none; }
.contact-panel #contact-addresses { margin-top: .9rem; }
textarea { width: 100%; font: inherit; }
@media (max-width: 47rem) {
  .contact-line { flex-direction: column; align-items: center; gap: .3rem; }
  .contact-blank > :is(input, .contact-select) { width: clamp(9rem, 50vw, 14rem); }
}
@media (max-width: 23rem) { .contact-clause { flex-direction: column; align-items: center; gap: 0; } }
/* New screen content fades in while the scene settles around it (opacity only, so the layout the
   scene measures never moves). Re-runs whenever a view is un-hidden. */
:is(#party-actions, #party-form, #party, [data-section]) { animation: pp-enter .3s ease-out both; }
@keyframes pp-enter { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  button:active:not(:disabled) { translate: none; }
  :is(#party-actions, #party-form, #party, [data-section]) { animation: none; }
}
:root[data-reduced-motion] button:active:not(:disabled) { translate: none; }
@media (forced-colors: active) {
  button, input, textarea, .brand, #account-menu summary { border-color: CanvasText; box-shadow: none; }
  #party-actions button[data-piece-ready] { border-color: ButtonText; }
}

/* Character portraits and picker */
.roster-portrait {
  position: relative; display: grid; place-items: center; width: 3.6rem; aspect-ratio: 1; flex: 0 0 auto;
  font-size: 1.3rem; font-weight: 800;
}
.roster-portrait:not(:has(img:not(.player-crown))) { background: var(--field); border: 2px solid var(--line); border-radius: 50%; width: 2.9rem; margin: .35rem; }
.roster-portrait img:not(.player-crown) { display: block; width: 100%; height: 100%; filter: drop-shadow(0 .25rem .2rem #0f082866); transform-origin: 50% 85%; }
.player-crown { position: absolute; top: -.25rem; left: -.15rem; width: 1.35rem; height: 1.35rem; rotate: -18deg; }
/* Narrow screens have no backdrop beside the panel, so the roster's characters sway instead. */
body.party-sway .roster-portrait img:not(.player-crown) { animation: character-bob 2.6s ease-in-out infinite alternate; }
body.party-sway .player-tile:nth-child(3n + 2) .roster-portrait img:not(.player-crown) { animation-duration: 3.1s; animation-delay: -1.2s; }
body.party-sway .player-tile:nth-child(3n + 3) .roster-portrait img:not(.player-crown) { animation-duration: 2.3s; animation-delay: -.6s; }
#player-icon-dialog { width: min(45rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); }
.player-icon-picker { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr); align-items: start; gap: 1rem; }
.player-icon-preview { background: #ece2ff; border: 2px solid #1b1140; border-radius: 1rem; padding: .5rem; }
.player-icon-stage { aspect-ratio: 1; display: grid; place-items: center; }
.player-icon-stage :is(img, canvas) { width: 100%; height: auto; }
.player-icon-rotation { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .25rem; text-align: center; font-size: .85rem; }
.player-icon-rotation button { min-height: 2.25rem; min-width: 2.25rem; padding: .15rem; box-shadow: none; }
#player-icon-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(3.6rem, 1fr)); gap: .4rem;
  min-width: 0; margin: 0; padding: .2rem; border: 0;
}
#player-icon-options .player-icon-option {
  position: relative; display: grid; grid-template-rows: auto 1fr; align-items: center; justify-items: center;
  margin: 0; padding: .15rem; border: 2px solid #d8cdf5; border-radius: .65rem;
  background: #fffaf4; font-size: .7rem; line-height: 1.1; text-align: center;
}
#player-icon-options .player-icon-option:has(input:disabled) { border-style: dashed; }
.player-icon-option:has(input:disabled) img { opacity: .45; }
.player-icon-taken { font-size: .63rem; font-weight: 700; color: #65567d; }
.player-icon-option img { display: block; width: min(100%, 3.4rem); height: auto; }
#player-icon-options .player-icon-option:has(:checked) { outline: 2px solid #5738a0; background: #e3d4ff; }
.player-icon-option:has(:focus-visible) { outline: 3px solid #1b1140; outline-offset: 1px; }
#player-icon-options:disabled { opacity: .75; }
#player-icon-status { margin: .65rem 0 0; font-size: .85rem; }
#player-icon-status:empty { display: none; }
.player-icon-actions { margin-top: .85rem; }
@media (max-width: 35rem) {
  .player-icon-picker { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .player-icon-preview { width: min(100%, 12rem); justify-self: center; }
  .player-icon-stage { max-height: 7rem; }
  .player-icon-stage :is(img, canvas) { width: min(100%, 7rem); }
}
@media (forced-colors: active) {
  #player-icon-options .player-icon-option:has(:checked) { outline: 2px solid Highlight; }
}

/* Party screen: header (code, invite, leave), players, then the play area. */
.party-chip {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.2rem; padding: .3rem .8rem;
  background: transparent; color: var(--text); border: 2px solid var(--line); box-shadow: none;
  font-size: .86rem; font-weight: 750; white-space: nowrap;
}
.party-chip:hover:not(:disabled) { border-color: var(--text); }
.party-chip:active:not(:disabled) { translate: 0 1px; box-shadow: none; }
.party-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding-bottom: .8rem; border-bottom: 2px solid var(--line); }
.party-code-block .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem; }
.party-code-line { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .9rem; }
.party-leave { color: var(--muted); border-style: dashed; }
.party-leave:hover:not(:disabled) { color: var(--text); }
.roster-heading { display: flex; align-items: center; gap: .55rem; margin: .7rem 0 .1rem; }
.roster-heading h2 { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#count { font-size: .8rem; font-weight: 700; }
#choose-player-icon { margin-left: auto; min-height: 2rem; padding: .2rem .7rem; font-size: .8rem; }
.party-play { display: grid; gap: .55rem; margin-top: .7rem; padding-top: .7rem; border-top: 2px solid var(--line); }
#start-match { width: 100%; min-height: 3rem; background: var(--create); color: var(--create-ink); font-size: 1.08rem; }

/* The game library entry: just the book sticker and its caption, no button plate. */
.library-button {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 0; padding: .25rem .4rem .25rem 0;
  background: none; border: 0; box-shadow: none; color: var(--text); text-align: left; border-radius: 16px;
}
.library-button:active:not(:disabled) { translate: none; box-shadow: none; }
.library-button img { width: 3.8rem; height: 3.8rem; flex: 0 0 auto; transition: transform .22s cubic-bezier(.3,1.6,.5,1); }
.library-button:is(:hover, :focus-visible) img { transform: rotate(-8deg) scale(1.1); }
.library-button-text { display: grid; gap: .05rem; flex: 1; min-width: 0; }
.library-button strong { font-size: 1.08rem; font-weight: 800; }
#lineup-summary { color: var(--muted); font-size: .86rem; font-weight: 600; }
.library-button-chevron { flex: 0 0 auto; color: var(--muted); transition: translate .2s ease; }
.library-button:is(:hover, :focus-visible) .library-button-chevron { translate: 3px 0; color: var(--text); }

/* Game library: replaces the party screen inside the same panel, in the site's own colors. */
.party-library { display: grid; gap: .8rem; }
.library-notice { padding: .55rem .8rem; border: 2px dashed var(--create); border-radius: .9rem; color: var(--text); font-weight: 700; font-size: .9rem; }
.library-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.library-count { color: var(--muted); font-size: .86rem; font-weight: 700; }
.library-title-row { display: flex; align-items: center; gap: .8rem; }
.library-title-row img { width: 2.9rem; height: 2.9rem; rotate: -6deg; flex: 0 0 auto; }
#library-title { font: 800 clamp(1.6rem, 5vw, 2.1rem)/1 var(--font); letter-spacing: -.04em; }
#library-title:focus { outline: none; }
.library-hint { color: var(--muted); font-size: .88rem; margin-top: .25rem; }

/* Category shelf: bare stickers with their names, no boxes or counts. The picked category lifts
   and gets a marker underline; categories without games yet are greyed out. Every tile keeps the
   same size in every state, so picking one never moves anything. */
.library-categories {
  display: flex; gap: .1rem; margin: 0 -.25rem; padding: .2rem .25rem .1rem; overflow-x: auto;
  scrollbar-width: none; scroll-snap-type: x proximity;
  /* More categories than fit: the row fades out at the edge and scrolls sideways. */
  mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
}
.library-category {
  position: relative; display: grid; justify-items: center; align-content: start; gap: .2rem; flex: 0 0 4.9rem; min-height: 0;
  padding: .3rem .15rem .65rem; background: none; color: var(--muted); border: 0; border-radius: .9rem; box-shadow: none;
  font-size: .8rem; font-weight: 750; scroll-snap-align: start; transition: color .2s ease;
}
.library-category img {
  width: 2.8rem; height: 2.8rem; opacity: .8; filter: drop-shadow(2px 3px 0 #0f082833);
  transition: transform .22s cubic-bezier(.3,1.6,.5,1), opacity .2s ease;
}
.library-category::after {
  content: ""; position: absolute; left: 50%; bottom: .2rem; width: 1.7rem; height: 4px; margin-left: -.85rem;
  border-radius: 4px; background: var(--accent); scale: 0 1; transition: scale .22s cubic-bezier(.3,1.4,.5,1);
}
.library-category:hover { color: var(--text); }
.library-category:hover img { transform: rotate(-8deg) scale(1.08); opacity: 1; }
.library-category[aria-pressed="true"] { color: var(--text); }
.library-category[aria-pressed="true"] img { transform: translateY(-2px) rotate(-6deg) scale(1.14); opacity: 1; }
.library-category[aria-pressed="true"]::after { scale: 1 1; }
.library-category:active:not(:disabled) { translate: 0 1px; box-shadow: none; }
.library-category.empty img { filter: grayscale(1); opacity: .38; }
.library-category.empty:not([aria-pressed="true"]) { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.library-category:focus-visible { outline-offset: 0; }
/* The shelf holds the full catalog's height (see holdShelfHeight in game-catalog.js). */
.shelf-area { display: grid; align-content: start; gap: .9rem; min-height: var(--shelf-height, 0px); }
.shelf-area > .library-empty { min-height: min(var(--shelf-height, 0px), 14rem); align-content: center; }

.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: .9rem; }
.library-grid:not(:has(> :not([hidden]))) { display: none; }
.game-card {
  --cover: #4b33b5;
  display: grid; align-content: start; min-height: 0; padding: 0 0 .65rem; overflow: hidden; text-align: left;
  background: var(--field); color: var(--text); border: 3px solid var(--ink); border-radius: 1.1rem; box-shadow: 4px 4px 0 var(--ink);
  font: inherit; white-space: normal; transition: transform .16s ease, box-shadow .16s ease, opacity .2s ease;
}
:root:not([data-theme="light"]) .game-card { border-color: #0c0720; }
.game-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.game-card:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); translate: none; }
.game-cover {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; margin-bottom: .55rem;
  background-color: var(--cover); background-image: radial-gradient(circle at 1px 1px, #ffffff38 1.6px, transparent 2.2px); background-size: 14px 14px;
  transition: filter .25s ease;
}
.game-card[data-pattern="1"] .game-cover { background-image: repeating-linear-gradient(-35deg, #ffffff1f 0 10px, transparent 10px 22px); background-size: auto; }
.game-card[data-pattern="2"] .game-cover { background-image: radial-gradient(circle at 18% 120%, #ffffff33 0 38%, transparent 38.5%), radial-gradient(circle at 100% -10%, #00000022 0 30%, transparent 30.5%); background-size: auto; }
.game-cover-sticker {
  position: absolute; right: -6%; bottom: -12%; width: 54%; height: auto; rotate: var(--tilt, -10deg);
  filter: drop-shadow(3px 4px 0 #1b114055); transition: transform .3s cubic-bezier(.3,1.5,.5,1);
}
.game-card:hover .game-cover-sticker { transform: scale(1.08) rotate(6deg); }
.game-cover-title {
  position: absolute; left: .75rem; right: 36%; bottom: .65rem; color: #fffaf3;
  font: 800 clamp(1.25rem, 2.4vw, 1.6rem)/.92 var(--font); letter-spacing: -.045em; overflow-wrap: anywhere;
  text-shadow: 2px 2px 0 #1b1140, -1px -1px 0 #1b1140, 1px -1px 0 #1b1140, -1px 1px 0 #1b1140, 3px 3px 0 #1b1140;
}
.game-check, .game-order {
  position: absolute; top: .5rem; display: grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 .35rem;
  border: 3px solid #1b1140; border-radius: 999px; font: 800 .9rem/1 var(--font); color: #1b1140;
}
.game-check { right: .5rem; width: 1.9rem; padding: 0; background: #fffaf3; }
.game-order { left: .5rem; background: #ffc845; }
.game-order:empty { display: none; }
.game-card[aria-pressed="true"] .game-check { background: #ffc845 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1140' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 1.05rem no-repeat; }
/* A cover picture of the game itself: darkened at the foot so the title stays readable. */
.game-card .game-cover.has-photo, .game-card[data-pattern] .game-cover.has-photo {
  background-image: linear-gradient(to top, #1b1140f2 0%, #1b114099 28%, transparent 56%), var(--photo);
  background-size: cover; background-position: center;
}
.game-cover.has-photo .game-cover-sticker { display: none; }
.game-cover.has-photo .game-cover-title { right: .75rem; }
.game-desc {
  padding: 0 .75rem .35rem; color: var(--text); font-size: .82rem; font-weight: 600; line-height: 1.3;
}
.game-desc:empty { display: none; }
.game-meta { padding: 0 .75rem; color: var(--muted); font-size: .8rem; font-weight: 650; }
.game-card.unavailable .game-meta { color: var(--create); }
/* Not picked: washed out to grey, still readable and one tap from being added back. */
.game-card[aria-pressed="false"] { opacity: .55; box-shadow: 2px 2px 0 var(--ink); }
.game-card[aria-pressed="false"] .game-cover { filter: grayscale(1) contrast(.85); }
.game-card[aria-pressed="false"]:hover { opacity: .85; }
.game-card.unavailable .game-cover { filter: grayscale(.75); }
.library-empty { color: var(--muted); text-align: center; padding: 1.2rem 1rem; border: 2px dashed var(--line); border-radius: 1rem; display: grid; justify-items: center; gap: .6rem; }

/* Play order and rounds: a short list under the shelf. */
.library-lineup { padding-top: 1rem; border-top: 2px solid var(--line); }
.lineup-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .6rem; }
#lineup-title { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.lineup-order { display: inline-grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 2px; border: 2px solid var(--line); border-radius: 999px; }
.lineup-order label { position: relative; margin: 0; }
.lineup-order input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; }
.lineup-order span { display: block; padding: .3rem .85rem; border-radius: 999px; text-align: center; font-size: .84rem; font-weight: 750; color: var(--muted); }
.lineup-order input:checked + span { background: var(--join); color: var(--join-ink); }
.lineup-order input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.lineup-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.lineup-item { --cover: #4b33b5; display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.lineup-badge {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: 0 0 auto; border-radius: .75rem;
  background: var(--cover); border: 2px solid #1b1140; color: #fffaf3; font-weight: 800; text-shadow: 1px 1px 0 #1b1140;
}
.lineup-badge img { width: 1.9rem; height: 1.9rem; }
.lineup-name { display: grid; flex: 1; min-width: 0; }
.lineup-name strong { font-size: .98rem; overflow-wrap: anywhere; }
.lineup-name small { color: var(--muted); font-size: .78rem; font-weight: 600; }
.lineup-item.skipped .lineup-name small { color: var(--create); }
.lineup-item.skipped .lineup-badge { filter: grayscale(1); opacity: .6; }
.lineup-rounds { display: inline-flex; align-items: center; gap: .15rem; padding: 2px; border: 2px solid var(--line); border-radius: 999px; }
.lineup-rounds-value { min-width: 1.4rem; text-align: center; font-weight: 800; }
.lineup-item button {
  width: 2rem; min-height: 2rem; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text);
  box-shadow: none; font-size: 1.05rem; line-height: 1;
}
.lineup-item button:hover:not(:disabled) { background: var(--line); }
.lineup-item button:active:not(:disabled) { translate: 0 1px; box-shadow: none; }
.lineup-item button:disabled { opacity: .3; }
.lineup-controls { display: inline-flex; gap: .1rem; }
.lineup-controls:empty { display: none; }
.lineup-empty { color: var(--muted); font-size: .88rem; }
.lineup-total { margin-top: .6rem; font-weight: 800; font-size: .92rem; }
.lineup-total:empty { display: none; }
#library-done { width: 100%; min-height: 3.1rem; background: var(--join); color: var(--join-ink); }
@media (max-width: 34rem) {
  /* Phones: four players per row, icon-only Leave, and a slimmer gap above the footer. */
  .player-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem; }
  .roster-portrait { width: 3.1rem; }
  .player-name { font-size: .8rem; }
  .party-leave .chip-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .party-leave { padding: .3rem .55rem; }
  #party-code { font-size: 1.75rem; letter-spacing: .08em; }
  .party-code-line { gap: .4rem .6rem; }
  body:has(#lobby-view:not([hidden]) :is(#party, #solo):not([hidden])) .site-footer { padding-top: 1.8rem; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .game-cover-title { font-size: 1.1rem; left: .55rem; bottom: .5rem; }
  .game-meta { font-size: .74rem; padding: 0 .55rem; }
  .library-category { flex-basis: 4.4rem; font-size: .76rem; }
  .library-category img { width: 2.5rem; height: 2.5rem; }
  .lineup-list.custom .lineup-item { flex-wrap: wrap; }
  .lineup-list.custom .lineup-name { flex-basis: calc(100% - 3.2rem); }
  .lineup-list.custom .lineup-rounds { margin-left: 3rem; }
}

/* Party characters: each player's character drifts and sways beside the panel, name above. */
.party-characters { display: none; position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
body:has(#lobby-view:not([hidden]) #party:not([hidden]) #party-match[hidden]):not(.party-sway) .party-characters { display: block; }
.party-character {
  --size: 88px;
  position: absolute; width: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  transition: left .7s cubic-bezier(.3,1.3,.5,1), top .7s cubic-bezier(.3,1.3,.5,1), opacity .4s ease;
}
.party-character-wander { display: grid; justify-items: center; animation: character-wander var(--wander-time, 11s) ease-in-out var(--delay, 0s) infinite alternate; }
.party-character-bob {
  width: var(--size); aspect-ratio: 1; display: grid; place-items: center;
  animation: character-bob var(--bob-time, 3.2s) ease-in-out var(--delay, 0s) infinite alternate;
  transform-origin: 50% 85%;
}
.party-character-bob img { width: 100%; height: 100%; filter: drop-shadow(0 .5rem .4rem #0f082873); }
.party-character-initial {
  display: grid; place-items: center; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: var(--accent); color: var(--plate-ink); border: 3px solid var(--ink); font: 800 calc(var(--size) * .32)/1 var(--font);
}
/* The name floats on its own: bold type with an ink outline, readable on any backdrop. */
.party-character-name {
  display: inline-flex; align-items: center; gap: .25rem; max-width: var(--name-max, 11rem); margin-bottom: -.1rem;
  overflow: hidden; white-space: nowrap; color: #fffaf3; font-size: .92rem; font-weight: 800; letter-spacing: -.01em;
  text-shadow: 0 2px 0 #1b1140, 2px 0 0 #1b1140, -2px 0 0 #1b1140, 0 -2px 0 #1b1140, 1.5px 1.5px 0 #1b1140, -1.5px 1.5px 0 #1b1140, 1.5px -1.5px 0 #1b1140, -1.5px -1.5px 0 #1b1140;
}
.party-character-name img { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
.party-character-name span { overflow: hidden; text-overflow: ellipsis; }
.party-character.self .party-character-name { color: #ffc845; }
.party-character.nameless .party-character-name { display: none; }
.party-character.away { opacity: .45; }
.party-character.away .party-character-bob { animation-play-state: paused; }
.party-character.arriving .party-character-bob img, .party-character.arriving .party-character-initial { animation: character-arrive .55s cubic-bezier(.3,1.6,.5,1) both; }
.party-character.leaving { opacity: 0; }
@keyframes character-wander {
  0% { translate: calc(var(--wander-x) * -1) calc(var(--wander-y) * .3); }
  35% { translate: calc(var(--wander-x) * -.2) calc(var(--wander-y) * -1); }
  70% { translate: calc(var(--wander-x) * .7) calc(var(--wander-y) * .2); }
  100% { translate: var(--wander-x) calc(var(--wander-y) * -.6); }
}
@keyframes character-bob {
  from { translate: 0 -7px; rotate: calc(var(--sway, 9deg) * -1); }
  to { translate: 0 7px; rotate: var(--sway, 9deg); }
}
@keyframes character-arrive { from { scale: 0; } to { scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .party-character-wander, .party-character-bob, .party-character.arriving :is(img, .party-character-initial) { animation: none; }
  body.party-sway .roster-portrait img { animation: none !important; }
  .party-character { transition: none; }
  .library-button img, .library-button-chevron, .game-cover-sticker, .game-card, .library-category img, .library-category::after { transition: none; }
}
:root[data-reduced-motion] :is(.party-character-wander, .party-character-bob, .party-character.arriving img, .party-character.arriving .party-character-initial) { animation: none; }
:root[data-reduced-motion] body.party-sway .roster-portrait img { animation: none !important; }
:root[data-reduced-motion] :is(.party-character, .library-button img, .library-button-chevron, .game-cover-sticker, .game-card, .library-category img, .library-category::after) { transition: none; }
@media (forced-colors: active) {
  .game-card[aria-pressed="true"] { outline: 3px solid Highlight; }
  .library-category[aria-pressed="true"] { text-decoration: underline; }
  .lineup-order input:checked + span { outline: 2px solid Highlight; }
}
/* Home: the solo play entry under Create / Join. A quiet line of text on the stage, so the two
   party buttons stay the stars. */
.solo-button {
  display: flex; align-items: center; gap: .45rem; width: max-content; max-width: 100%; min-height: 2.75rem;
  margin: 1.3rem auto 0; padding: .35rem .75rem; background: none; border: 0; border-radius: 999px; box-shadow: none;
  color: var(--text); font: 800 1.1rem/1.1 var(--font); letter-spacing: -.02em;
}
.solo-button:active:not(:disabled) { translate: none; box-shadow: none; }
.solo-button-lead { color: var(--muted); font-weight: 600; }
.solo-button strong {
  font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 3px; text-underline-offset: .3em; transition: text-underline-offset .2s ease;
}
.solo-button svg { flex: 0 0 auto; color: var(--accent); transition: translate .2s cubic-bezier(.3,1.6,.5,1); }
.solo-button:is(:hover, :focus-visible) strong { text-underline-offset: .2em; }
.solo-button:is(:hover, :focus-visible) svg { translate: 5px 0; }

/* Solo play page: a title in the wordmark's style, a big Surprise me roll, then the shelf. */
.solo-panel { display: grid; gap: 1.05rem; }
.solo-head { display: flex; }
.solo-intro { display: grid; gap: .5rem; }
#solo-title { font: 800 clamp(2.3rem, 7.5vw, 3.4rem)/.95 var(--font); letter-spacing: -.055em; }
#solo-title:focus { outline: none; }
#solo-title span {
  display: inline-block; margin-left: .08em; padding: .03em .18em .1em; color: #1b1140; background: #ff7a59;
  border: 3px solid #1b1140; border-radius: .26em; rotate: -4deg; box-shadow: .06em .06em 0 #1b1140;
}
.solo-tagline { color: var(--muted); font-size: 1rem; font-weight: 600; }
.solo-surprise {
  position: relative; display: flex; align-items: center; gap: 1rem; width: 100%; min-height: 5.4rem; padding: .7rem 1rem .7rem .8rem;
  color: var(--join-ink); text-align: left; border: 3px solid var(--ink); border-radius: 1.35rem; box-shadow: 5px 5px 0 var(--ink);
  background: var(--join) repeating-linear-gradient(-35deg, #ffffff26 0 12px, transparent 12px 28px);
  transition: transform .16s ease, box-shadow .16s ease;
}
.solo-surprise:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.solo-surprise:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); translate: none; }
.solo-surprise:disabled { opacity: .55; }
/* The same 3D die as the home page; it rolls (its turntable strip) while hovered. */
.solo-die {
  flex: 0 0 auto; width: 4.6rem; aspect-ratio: 1; margin-block: -.9rem; rotate: -10deg;
  --roll: url("/assets/pieces/d6-spin.fd97e8cb38.webp");
  background: url("/assets/pieces/d6.e663c850ef.webp") center / contain no-repeat; filter: drop-shadow(0 .4rem .3rem #1b114059);
}
.solo-surprise:is(:hover, :focus-visible):not(:disabled) .solo-die {
  background: var(--roll) 0 0 / 3300% 100% no-repeat; animation: piece-spin 1.2s steps(32) 1;
}
.solo-surprise-text { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.solo-surprise-text strong { font: 800 clamp(1.4rem, 3.6vw, 1.75rem)/1 var(--font); letter-spacing: -.04em; }
#solo-surprise-hint { font-size: .92rem; font-weight: 650; opacity: .82; }
.solo-surprise-go {
  display: inline-flex; align-items: center; gap: .3rem; flex: 0 0 auto; padding: .5rem .95rem .5rem 1.05rem;
  border-radius: 999px; background: #1b1140; color: #fffaf3; font-weight: 800; transition: translate .2s cubic-bezier(.3,1.6,.5,1);
}
.solo-surprise:is(:hover, :focus-visible) .solo-surprise-go { translate: 4px 0; }
.solo-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.solo-grid .game-card { padding-bottom: .75rem; }
.solo-card-body { padding: 0 .8rem; }
.solo-grid .game-desc { padding: 0 .8rem .5rem; font-size: .86rem; font-weight: 500; line-height: 1.35; }
.solo-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .76rem; font-weight: 700; }
.solo-best { padding: .1rem .5rem; border-radius: 999px; background: var(--line); color: var(--text); white-space: nowrap; }
.solo-best:empty { display: none; }
.solo-grid .game-check {
  width: 2.3rem; min-width: 2.3rem; height: 2.3rem;
  background: #ffc845 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231b1140'%3E%3Cpath d='M8 5.5v13l10.5-6.5z'/%3E%3C/svg%3E") 58% center / 1.15rem no-repeat;
  box-shadow: 2px 2px 0 #1b1140; transition: transform .2s cubic-bezier(.3,1.6,.5,1);
}
.solo-grid .game-card:is(:hover, :focus-visible) .game-check { transform: scale(1.2) rotate(-8deg); }
.solo-grid .game-card.last-played .game-order { display: grid; padding: 0 .55rem; }
.solo-grid .game-card.last-played .game-order::before { content: "Last played"; font-size: .72rem; }
.solo-grid .game-card:disabled { opacity: .6; cursor: progress; }
#solo-status { order: 1; }
@media (max-width: 34rem) {
  .solo-panel { gap: .85rem; }
  .solo-surprise { gap: .7rem; min-height: 4.6rem; padding: .6rem .7rem .6rem .6rem; }
  .solo-die { width: 3.6rem; }
  #solo-surprise-hint { font-size: .82rem; }
  .solo-surprise-go { padding: .55rem; }
  .solo-surprise-go span { display: none; }
  .solo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .solo-card-body { padding: 0 .55rem; }
  .solo-grid .game-desc { padding-inline: .55rem; font-size: .78rem; }
  .solo-card-meta { flex-wrap: wrap; font-size: .7rem; gap: .25rem; }
}

/* A solo game in the party panel: no party code or invite, and Leave reads "Quit game". */
#party.solo .party-code-block { display: none; }
#party.solo .party-header { justify-content: flex-end; padding-bottom: .5rem; }

/* The match screen. */
#party-match { display: flex; flex-direction: column; }
.match-heading { align-items: center; margin-bottom: .75rem; }
.match-clock-controls { display: flex; align-items: center; gap: .7rem; }
#match-title { font-size: clamp(1.65rem, 6vw, 2.4rem); line-height: 1.1; overflow-wrap: anywhere; }
#match-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 1.15rem; }
#match-content { margin-bottom: .6rem; }
.game-prompt { font-size: 1.2rem; font-weight: 700; margin: 0 0 .55rem; }
.game-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.game-choices button { white-space: normal; overflow-wrap: anywhere; }
.match-notice { margin: .45rem 0; color: var(--muted); font-size: .86rem; }
.match-notice:empty { display: none; }
.match-table { max-width: 100%; overflow: auto; }
.match-table table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.match-table table + table { margin-top: .9rem; }
.match-table :is(th, td) { padding: .48rem .38rem; border-bottom: 1px solid var(--line); text-align: left; }
.match-table td { font-variant-numeric: tabular-nums; }
#match-round-details { margin-top: .75rem; }
#match-round-details summary { width: fit-content; font-weight: 700; cursor: pointer; }
.match-finish { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .75rem; }
.match-finish:not(:has(button:not([hidden]))) { display: none; }
.match-finish button { min-height: 3.3rem; padding-inline: 1.6rem; font-size: 1.06rem; }
#play-again { background: var(--create); color: var(--create-ink); }

/* While a round is played the page never scrolls. main is no taller than the window; the match
   card hugs its game, with the footer links a short gap under it on a computer (a phone has no
   footer in a match: the game is the whole page). When the window is too short, the card gives
   way: every level down to #match-content may shrink, and each game's view fits what it's given
   (gavel-drop.css), so everything stays on screen. */
main:has(#lobby-view:not([hidden]) #party-match:not([hidden]):not(.results, .results-round)) {
  height: 100dvh; min-height: 0; padding-top: clamp(3.9rem, 9vh, 5.6rem);
}
body:has(#lobby-view:not([hidden]) #party-match:not([hidden]):not(.results, .results-round)) .site-footer {
  flex: none; margin-top: 0; padding-top: clamp(.7rem, 2.2vh, 1.15rem);
}
body:has(#lobby-view:not([hidden]) #party-match:not([hidden]):not(.results, .results-round)) .site-footer small { display: none; }
#lobby-view:has(#party-match:not([hidden]):not(.results, .results-round)) { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
:is(#party, #party-home):has(#party-match:not([hidden]):not(.results, .results-round)) { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
#party-match:not(.results, .results-round) { flex: 0 1 auto; min-height: 0; }
#party-match:not(.results, .results-round) > * { flex: none; }
#party-match:not(.results, .results-round) > #match-content {
  flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: .2rem; padding-bottom: 6px;
  /* Whatever a game draws past its bottom edge (a paddle's stick, a sticker) never extends the page. */
  overflow-y: clip;
}
#party-match:not(.results, .results-round) .match-heading { margin-bottom: .55rem; }
#party-match:not(.results, .results-round) .score-strip { margin-top: .45rem; padding-top: .5rem; gap: .25rem 1rem; }
@media (max-width: 46rem), (max-height: 44rem) {
  #party-match:not(.results, .results-round) #match-title { font-size: 1.45rem; }
  #party-match:not(.results, .results-round) #match-progress { margin: 0; font-size: .76rem; }
  /* Scores on one line (yours first); the rest fade off the edge rather than taking rows. */
  #party-match:not(.results, .results-round) .score-strip {
    flex-wrap: nowrap; overflow: hidden; mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  #party-match:not(.results, .results-round) .score-chip { flex: none; font-size: .86rem; }
  #party-match:not(.results, .results-round) .score-chip.self { order: -1; }
  #party-match:not(.results, .results-round) .score-chip-figure { width: 1.65rem; }
}
/* A laptop-height window: the round's progress sits on the title's line. */
@media (min-width: 46.01rem) and (max-height: 50rem) {
  #party-match:not(.results, .results-round) .match-heading-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .9rem; }
  #party-match:not(.results, .results-round) #match-progress { order: 2; margin: 0; }
}
/* A phone (either way up): the match is the whole page, with no footer until it's over, and the
   card fills the screen (each game's view fills #match-content). */
@media (max-width: 46rem), (max-height: 30rem) {
  body:has(#lobby-view:not([hidden]) #party-match:not([hidden])) .site-footer { display: none; }
  main:has(#lobby-view:not([hidden]) #party-match:not([hidden]):not(.results, .results-round)) { padding-bottom: clamp(.4rem, 1.5vh, .8rem); }
  #lobby-view:has(#party-match:not([hidden]):not(.results, .results-round)),
  :is(#party, #party-home):has(#party-match:not([hidden]):not(.results, .results-round)),
  #party-match:not(.results, .results-round),
  #party-match:not(.results, .results-round) > #match-content { flex: 1 1 0; }
}
/* A landscape phone: the round gets the whole height. */
@media (max-height: 30rem) {
  main:has(#lobby-view:not([hidden]) #party-match:not([hidden]):not(.results, .results-round)) { padding-top: 4.1rem; padding-bottom: .4rem; }
  #party-match:not(.results, .results-round) :is(#match-progress, #match-standings, #match-notice) { display: none; }
  #party-match:not(.results, .results-round) .match-heading { margin-bottom: .3rem; padding-right: 4.4rem; }
  #party-match:not(.results, .results-round) #match-title { font-size: 1.2rem; }
}

/* While a round is played: everyone's score as a strip of characters and numbers. */
.score-strip { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .9rem 0 0; padding: .75rem 0 0; border-top: 2px dashed var(--line); list-style: none; }
.score-chip { display: inline-flex; align-items: center; gap: .35rem; font-weight: 750; }
.score-chip.left { opacity: .5; }
.score-chip-figure { display: grid; place-items: center; width: 2.1rem; aspect-ratio: 1; }
.score-chip-figure img { width: 100%; height: 100%; filter: drop-shadow(0 .2rem .15rem #0f082859); }
.score-chip-figure.initial > span { display: grid; place-items: center; width: 76%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); color: var(--plate-ink); font-size: .8rem; }
.score-chip.self .score-chip-name { color: var(--accent); }
.score-chip-total { font-variant-numeric: tabular-nums; }
.score-chip.leader .score-chip-total { padding: 0 .4rem; border-radius: 999px; background: #ffc845; color: #1b1140; }

/* Results sequences (results-stage.js; one module per concept: results-heavy.js, results-pop.js,
   results-shuffle.js, results-steel.js, results-planes.js). No card and no panel: every concept
   plays straight on the site's own backdrop (visual-stage.js, in one of the site's palettes) and
   composes its scene on an absolutely positioned stage. The page widens; the party code steps
   aside; the heading stays for screen readers; the clock and Leave sit on the backdrop. Type is the
   site's: Bricolage Grotesque, heavy and tight, ink outlines, sticker tags and offset shadows. */
@font-face {
  font-family: "Caveat";
  src: url("/assets/caveat.b501720e0f.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
:root { --hand: "Caveat", "Bricolage Grotesque", cursive; --rs-ink: #1b1140; }
/* The scene spans the full width and is clipped to it, so things flying in from off screen never
   widen the page (on a phone that would zoom the whole page out). */
main:has(#party-match:is(.results, .results-round):not([hidden]):not(#lobby-view[hidden] *)) { width: 100%; max-width: none; padding-top: 5.6rem; padding-inline: 0; overflow-x: clip; }
/* The footer stays printed on the backdrop, above the scene. */
body:has(#party-match:is(.results, .results-round):not([hidden])) .site-footer { position: relative; z-index: 6; align-self: stretch; padding-top: 1.2rem !important; background: none; }
#party:has(#party-match:is(.results, .results-round):not([hidden])) { position: relative; }
/* The scene sizes itself to the window from its top, so the page mustn't re-centre it as it does. */
#lobby-view:has(#party-match:is(.results, .results-round):not([hidden])) { align-content: start; }
/* In a match, the party code and invite stay in the party (and Leave moves by the clock). */
#party:has(#party-match:not([hidden])) .party-header { display: none; }
/* Leave and the countdown sit straight on the backdrop: no chips, no pills, in the site's type. */
#party:has(#party-match:is(.results, .results-round):not([hidden])) .party-leave {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .1rem .55rem; border: 0; border-radius: .5rem;
  background: none; box-shadow: none; color: var(--text); font: 800 1.3rem/1 var(--font); letter-spacing: -.03em; rotate: -5deg;
  text-shadow: 0 .12rem 0 var(--rs-ink); transition: rotate .15s ease, scale .15s ease, color .15s ease;
}
#party:has(#party-match:is(.results, .results-round):not([hidden])) .party-leave .chip-text { display: inline; position: static; width: auto; height: auto; clip-path: none; overflow: visible; }
#party:has(#party-match:is(.results, .results-round):not([hidden])) .party-leave svg { width: 1.3rem; height: 1.3rem; filter: drop-shadow(0 .12rem 0 var(--rs-ink)); }
#party:has(#party-match:is(.results, .results-round):not([hidden])) .party-leave:is(:hover, :focus-visible) { rotate: -1deg; scale: 1.08; color: var(--accent); box-shadow: none; }
#party-match:is(.results, .results-round) .match-heading {
  position: absolute; top: -4.65rem; right: max(clamp(5.5rem, 10vw, 9.5rem), calc(clamp(.9rem, 3.4vw, 2.6rem) + 5rem)); z-index: 2; margin: 0;
}
#party-match:is(.results, .results-round) .match-heading-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#party-match:is(.results, .results-round) .match-clock-controls { display: grid; justify-items: center; gap: .3rem; }
#party-match:is(.results, .results-round) #match-clock {
  display: inline-block; padding: 0; background: none; color: var(--text); font: 800 2rem/1 var(--font); letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; text-shadow: 0 .14rem 0 var(--rs-ink);
}
:root[data-theme="light"] #party-match:is(.results, .results-round) #match-clock,
:root[data-theme="light"] #party:has(#party-match:is(.results, .results-round):not([hidden])) .party-leave { color: var(--rs-ink); text-shadow: none; }
:root[data-theme="light"] #party:has(#party-match:is(.results, .results-round):not([hidden])) .party-leave svg { filter: none; }
#match-clock:not([data-label=""])::before { content: attr(data-label) " "; }
#party-match:is(.results, .results-round) #match-clock::before { content: none; }
@media (max-height: 30rem) {
  main:has(#party-match:is(.results, .results-round):not([hidden]):not(#lobby-view[hidden] *)) { padding-top: 5rem; }
  .rs { padding-top: 1.9rem; }
  #party-match:is(.results, .results-round) .match-heading { top: -4.3rem; }
}
#party-match.results #match-results { order: 1; }
#party-match.results :is(.match-finish, #match-notice, #match-round-details) { position: relative; z-index: 5; }
#party-match.results .match-finish { order: 2; justify-content: center; margin-top: 1rem; }
#party-match.results #match-notice { order: 3; text-align: center; }
#party-match.results #match-round-details { order: 4; align-self: center; width: 100%; margin-top: .35rem; }
#party-match.results #match-round-details summary { margin: 0 auto; }
/* A landscape phone: the final keeps just its buttons under the scene, and a scene with more rows
   than the height allows is cut at its edge rather than making the page scroll. */
@media (max-height: 30rem) {
  .rs-stage { overflow-y: clip; }
  #party-match.results :is(#match-notice, #match-round-details) { display: none; }
  #party-match.results .match-finish { margin-top: .4rem; }
  #party-match.results .match-finish button { min-height: 2.6rem; padding-inline: 1.1rem; font-size: .95rem; }
}
/* The breakdown opens over the scene, not under it, so opening it never makes the page scroll. */
#party-match.results #match-round-details { position: relative; }
#party-match.results #match-round-details[open] > #match-history {
  position: absolute; z-index: 8; left: 50%; bottom: calc(100% + .6rem); translate: -50% 0;
  width: min(100vw - 2rem, 44rem); max-height: min(62dvh, 28rem); overflow: auto; padding: .7rem 1rem;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--offset) var(--offset) 0 var(--ink);
}

/* What every concept shares: a stage of known size, figures, the site's sticker type, dust. */
.rs { position: relative; padding-top: 2.4rem; color: var(--text); }
.rs-stage { position: relative; isolation: isolate; }
.rs-stage > *, :is(.sl-door, .sl-inside, .sl-face) > *, .rs-stage i { position: absolute; }
.rs-sheet { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.rs-sheet path, .rs-sheet circle { vector-effect: non-scaling-stroke; }
.rs-hand { font: 700 1em/1.02 var(--hand); letter-spacing: .005em; }
.rs-fig { position: relative; width: 100%; height: 100%; }
/* Characters: a touch brighter than the lobby's dim light, with a soft contact shadow. */
.rs-fig img { display: block; width: 100%; height: 100%; object-fit: contain; filter: saturate(1.12) brightness(1.1) drop-shadow(0 .45rem .3rem #0f082870); }
.rs-fig.blob { display: grid; place-items: center; }
.rs-fig.blob > span {
  display: grid; place-items: center; width: 78%; height: 84%; border-radius: 47% 53% 44% 56% / 58% 46% 54% 42%;
  background: var(--player); color: var(--rs-ink); font: 800 2.2em/1 var(--font); border: 3px solid var(--rs-ink);
  box-shadow: inset -.3em -.35em 0 #0002, 3px 4px 0 var(--rs-ink);
}
.rs-world { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.rs-dust {
  width: 11px; height: 11px; border-radius: 40% 60% 50% 50%; background: #fffaf4c0; pointer-events: none;
  animation: rs-dust .8s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes rs-dust {
  from { transform: translate(-50%, -50%) scale(var(--s)); opacity: .9; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0); opacity: 0; }
}
/* Name tag: the site's paper plate, ink outline, offset shadow, a sticker's tilt. */
.pp-tag {
  display: inline-flex; align-items: baseline; gap: .35em; max-width: 100%; padding: .16em .62em .24em; overflow: hidden;
  color: var(--rs-ink); background: #fffaf4; border: max(2px, .11em) solid var(--rs-ink); border-radius: 999px;
  box-shadow: .1em .14em 0 var(--rs-ink); font: 800 1em/1.05 var(--font); letter-spacing: -.03em; white-space: nowrap; text-overflow: ellipsis;
}
.pp-tag > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.pp-tag.self { background: #ffc845; }
.pp-tag.left { opacity: .55; }
.pp-tag em { flex: none; padding: .05em .4em; border-radius: 999px; background: var(--rs-ink); color: #ffc845; font: 800 .62em/1.2 var(--font); font-style: normal; letter-spacing: 0; translate: 0 -.12em; }
/* Scores: white, outlined in ink, standing on a hard shadow. */
.pp-score { color: #fff; font: 800 1em/1 var(--font); letter-spacing: -.045em; font-variant-numeric: tabular-nums; -webkit-text-stroke: .16em var(--rs-ink); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--rs-ink); white-space: nowrap; }
.pp-gain { color: #ffc845; }
/* Headline: white type with one word on a coral sticker badge, as in the wordmark. */
.pp-title { transform-origin: 0 60%; color: #fff; font: 800 1em/.98 var(--font); letter-spacing: -.055em; text-shadow: 0 .06em 0 var(--rs-ink); text-wrap: balance; }
.pp-title > span {
  display: inline-block; margin-left: .06em; padding: .02em .16em .1em; color: var(--rs-ink); background: #ff7a59; text-shadow: none;
  border: max(3px, .04em) solid var(--rs-ink); border-radius: .24em; rotate: -4deg; box-shadow: .05em .06em 0 var(--rs-ink);
}
.pp-kicker { color: #fff; font: 800 1em/1.1 var(--font); letter-spacing: -.02em; opacity: .85; text-shadow: 0 .1em 0 var(--rs-ink); }
:root[data-theme="light"] :is(.pp-title, .pp-kicker) { color: var(--rs-ink); text-shadow: none; }
/* Big numerals modelled like the home page's pieces: a lit face over a solid body (clay()). */
.pp-clay { position: absolute; font: 800 1em/1 var(--font); letter-spacing: -.06em; white-space: nowrap; pointer-events: none; }
.pp-clay > .body, .pp-clay > .body > span { position: absolute; left: 0; top: 0; }
.pp-clay > .body > .face { -webkit-background-clip: text; background-clip: text; color: transparent; paint-order: stroke fill; }
/* Impact lines and sparks. */
.pp-burst { width: 0; height: 0; pointer-events: none; }
.pp-burst > i { position: absolute; left: 0; top: 0; width: var(--l); height: var(--w); border-radius: 999px; background: var(--c, #fffaf4); transform-origin: 0 50%; rotate: var(--a); translate: var(--r) calc(var(--w) / -2); }

/* HEAVY NUMBERS: the site's indigo backdrop with its stripes; cream and coral numerals modelled like
   the home page's pieces (clay() in results-kit.js, set inline), bumper plates in the pop colours
   with ink outlines, name stickers in the site's type. */
.hv-num { position: relative; font: 800 1em/.9 var(--font); color: transparent; letter-spacing: -.06em; white-space: nowrap; transform-origin: 50% 100%; }
.hv-num > .pp-clay { left: 0; top: 0; }
.hv-tip { position: relative; transform-origin: 50% 100%; }
.rs-brush { stroke: none; }
.rs-mark path { fill: currentColor; }
.hv-floor { fill: #fffaf4; opacity: .45; }
.hv-impact { color: #fffaf4; opacity: 0; }
.hv-hit { color: #fffaf4; }
.hv-bracket { fill: #fffaf4; opacity: .8; }
.hv-arrow { color: #fffaf4; }
.hv-question { display: grid; gap: .2em; color: #fff; font: 800 1em/1.12 var(--font); letter-spacing: -.02em; text-shadow: 0 .1em 0 var(--rs-ink); }
.hv-note { color: #ffc845; font-size: .85em; }
.hv-callout { z-index: 8; }
.hv-tie { z-index: 8; background: #ffc845; }
.hv-mover { top: 0; left: 0; height: 100%; z-index: 2; }
.hv-mover.tall { left: 0; width: 100%; height: auto; }
.hv-mover.left { opacity: .55; }
.hv-stack { position: absolute; left: 0; width: 100%; }
.hv-mover.tall .hv-stack { top: 0; height: 100%; }
/* Bumper plates: rendered rubber discs with a steel hub (results-art/plates*.webp, a frame per
   weight class); the weight is printed on the rim. */
.hv-plate { position: absolute; background: url("/assets/results-art/plates.a1f6e6f852.webp") 0 0 / 400% 100% no-repeat; }
.hv-plate.stand { background-image: url("/assets/results-art/plates-stand.44f51d89ec.webp"); }
.hv-plate span {
  position: absolute; left: 50%; translate: -50% -50%; color: #fff; font: 800 1em/1 var(--font); letter-spacing: -.01em;
  -webkit-text-stroke: .18em var(--rs-ink); paint-order: stroke fill; white-space: nowrap;
}
.hv-bar { position: absolute; left: -20px; height: 8px; border-radius: 4px; border: 2px solid var(--rs-ink); background: linear-gradient(#ffffff, #c9cdd6 55%, #8f95a3); }
.hv-rider, .hv-char { position: absolute; }
.hv-bob { width: 100%; height: 100%; transform-origin: 50% 100%; }
.hv-label { position: absolute; display: grid; justify-items: center; gap: .3rem; color: #fff; text-align: center; line-height: 1.05; }
.hv-label.row { grid-auto-flow: column; justify-content: start; align-items: center; justify-items: start; gap: .5rem; text-align: left; }
.hv-label > * { max-width: 100%; }
.hv-name { rotate: -2deg; }
.hv-total { font-size: clamp(1.4rem, 4vh, 2.3rem); }
.hv-pickline { display: inline-flex; align-items: center; gap: .2em; color: #fff; font: 700 clamp(.85rem, 1.9vh, 1.05rem)/1.1 var(--font); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-upline { padding: .1em .5em .15em; border: 2px solid var(--rs-ink); border-radius: 999px; background: #ffc845; color: var(--rs-ink); font: 800 .8rem/1.1 var(--font); box-shadow: 2px 2px 0 var(--rs-ink); white-space: nowrap; }
.hv-check { position: static; width: 1em; height: 1em; color: #9ed65a; overflow: visible; }
.hv-check .rs-mark path { fill: #9ed65a; }
.hv-label.row .hv-total { font-size: 1.25rem; }
.hv-shrug-wrap { position: absolute; transform-origin: 30% 100%; }
.hv-shrug-wrap svg { position: absolute; inset: 0; }
.hv-shrug { color: #fffaf4; }
.hv-pick { z-index: 4; font-size: 0; }
.hv-pick > .pp-clay { position: relative; display: block; font-size: inherit; }
.hv-rank { z-index: 1; color: #ffffff1a; font: 800 1em/.9 var(--font); letter-spacing: -.06em; -webkit-text-stroke: 3px #ffffff66; white-space: nowrap; }
.hv-rank.first { color: #ffc84533; -webkit-text-stroke: 4px #ffc845; }
.hv-shadow { height: 1.4rem; border-radius: 50%; background: radial-gradient(closest-side, #0f0828aa, #0f082800); transform-origin: 50% 50%; }
/* Name stickers across the numerals: the site's tag, with the score after the name. */
.hv-tape { position: absolute; z-index: 2; }
.hv-tape-score { flex: none; font-variant-numeric: tabular-nums; }
.hv-award { display: grid; gap: .1em; z-index: 30; padding: .45em .8em .55em; border: 3px solid var(--rs-ink); border-radius: .9em; background: #fffaf4; color: var(--rs-ink); box-shadow: 4px 4px 0 var(--rs-ink); font: 700 1em/1.15 var(--font); }
.hv-award strong { color: #e4572e; font: 800 1.05em/1.1 var(--font); }
.rs-paper { position: absolute; left: 0; top: 0; pointer-events: none; }
.about-credits { max-width: 40rem; margin-top: 1.4rem; font-size: .85rem; opacity: .8; }
.about-credits a { color: inherit; }

/* COLD STORAGE: a chunky fridge prop on the site's teal backdrop. Brushed stainless after real
   material references (fine horizontal hairlines in brushed-steel.webp, low contrast, warm-neutral
   grey, and the anisotropic sheen of brushed metal, where highlights stretch across the grain), but
   drawn as one of the site's objects: ink outline, rounded corners, a solid body behind the door
   for thickness. Magnets are moulded plastic in the pop colours; names are the site's stickers. */
.sl-stage { perspective: 1800px; }
.sl-body { z-index: 0; border: 3px solid var(--rs-ink); border-radius: 1.6rem; background: linear-gradient(90deg, #7d8690, #a3abb3 30%, #8b949c); box-shadow: 0 1.4rem 2.4rem #0f08284d; }
.sl-door {
  z-index: 2; transform-origin: 0 50%; backface-visibility: hidden; border: 3px solid var(--rs-ink); border-radius: 1.6rem; will-change: transform;
  background:
    radial-gradient(ellipse 4% 7% at 95.5% 30%, #ffffff12, #0000), radial-gradient(ellipse 3% 5% at 94% 41%, #0000000c, #0000),
    linear-gradient(90deg, #0000 4%, #ffffff26 16%, #0000 27%, #0000 58%, #ffffff1c 69%, #0000 79%, #0000 92%, #ffffff18 97%, #0000),
    linear-gradient(#ffffff2e, #0000 22% 70%, #0f082826),
    url("/assets/brushed-steel.2ed2047c8d.webp") 0 0 / 1024px 256px, #b4b6b4;
  box-shadow: inset 0 3px 0 #ffffff80, inset 0 -4px 0 #0f082826;
}
  right: 5.5%; top: 14%; width: 1.15rem; height: 40%; border: 3px solid var(--rs-ink); border-radius: .7rem;
  background: linear-gradient(90deg, #8d949b, #eef0f1 40%, #ffffff 50%, #b1b7bc 70%, #7b828a);
  box-shadow: -.4rem .55rem .5rem #0f082840;
}
/* Stand-offs: the handle is bolted to the door at both ends. */
.sl-inside { z-index: 1; overflow: hidden; border: 3px solid var(--rs-ink); border-radius: 1.6rem; background: radial-gradient(ellipse 60% 55% at 50% 0%, #f6fcff, #d3e8f1 45%, #94b8c9); box-shadow: inset 0 0 4rem #2c6a8566; }
.sl-face { overflow: visible; }
.sl-shelves { position: absolute; inset: 0; background: linear-gradient(transparent calc(70% - 3px), #fffc calc(70% - 3px) 70%, #36505f33 70% calc(70% + 7px), transparent 0), linear-gradient(transparent calc(40% - 3px), #fffb calc(40% - 3px) 40%, #36505f33 40% calc(40% + 7px), transparent 0); }
.sl-frost { position: absolute; left: 4%; right: 4%; top: 4%; display: grid; justify-items: center; gap: .2em; color: #ffffffe6; text-align: center; font: 800 1em/.95 var(--font); letter-spacing: -.05em; text-shadow: 0 0 .1em #2c6a85, 0 .06em .3em #2c6a8599; }
.sl-frost-name { line-height: .9; overflow-wrap: anywhere; }
.sl-frost-score { font-size: clamp(1.2rem, 3.6vh, 2rem); letter-spacing: -.02em; }
.sl-guests { position: absolute; left: 50%; bottom: 6%; display: flex; align-items: end; gap: 1rem; translate: -50% 0; }
.sl-guest { flex: none; }
.sl-title { display: grid; gap: .05em; z-index: 2; }
.sl-letters { display: flex; align-items: flex-end; gap: .04em; }
.sl-mag { position: relative; display: inline-block; }
.sl-mag > .pp-clay { left: 0; top: 0; }
.sl-gap { display: inline-block; }
.sl-group { z-index: 3; }
.sl-group.left { opacity: .6; }
.sl-slide, .sl-rattle { transform-origin: 50% 0; }
.sl-rattle { display: grid; grid-template: "fig score" auto "fig tape" auto / auto auto; align-items: center; column-gap: .45rem; row-gap: .2rem; justify-items: start; }
.sl-sticker { grid-area: fig; }
/* Die-cut sticker magnets: a white border all round, then a soft shadow on the door. */
.sl-sticker img { filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 .4rem .3rem #0f082866); }
.sl-sticker.blob > span { outline: 3px solid #fff; }
.sl-score { grid-area: score; }
.sl-tape { grid-area: tape; }
.sl-place { align-self: center; color: var(--rs-ink); font: 800 1em/1 var(--font); letter-spacing: -.02em; padding-left: .35em; white-space: nowrap; }
.sl-marker { fill: var(--rs-ink); }
.sl-loop, .sl-arrow { color: var(--rs-ink); }
.sl-question { z-index: 2; color: var(--rs-ink); font: 800 1em/1 var(--font); }
.sl-callout { z-index: 4; color: var(--rs-ink); text-shadow: none; }
.sl-note { z-index: 4; display: grid; gap: .1em; padding: .45em .8em .55em; border: 3px solid var(--rs-ink); border-radius: .3em; background: #fff1a8; color: var(--rs-ink); box-shadow: 4px 4px 0 var(--rs-ink); font: 700 1em/1.15 var(--font); }
.sl-note strong { color: #c24a2a; font: 800 1.05em/1.1 var(--font); }
.sl-ink { z-index: 1; }

/* PAPER PLANES: the site's magenta backdrop with its waves; a dotted flight lane with see-through
   distance numerals, your best as a butter banner on a string, a folded graph-paper plane. */
.pl-head { display: grid; gap: .35rem; justify-items: start; z-index: 5; }
.pl-question { color: #fff; font: 800 1em/1.15 var(--font); letter-spacing: -.02em; text-shadow: 0 .1em 0 var(--rs-ink); }
.pl-answer { color: #fff; font: 700 1em/1.15 var(--font); opacity: .85; }
.pl-answer.right span { color: #9ed65a; } .pl-answer.wrong span { color: #ffc845; }
.pl-lane { z-index: 1; height: 4px; transform-origin: 0 50%; background: radial-gradient(circle, #fffaf4 0 2px, #0000 2.5px) 0 50% / 14px 4px repeat-x; opacity: .7; }
.pl-tick { z-index: 1; width: 4px; height: 14px; border-radius: 2px; background: #fffaf4; opacity: .8; }
.pl-plane { z-index: 4; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; filter: drop-shadow(0 .9rem .7rem #0f082840); }
.pl-plane.old { z-index: 2; filter: none; }
.pl-frames { position: absolute; inset: 0; background: url("/assets/results-art/paper-plane.71b097ae49.webp") 50% 0 / 900% 100% no-repeat; }
.pl-you { z-index: 3; }
.pl-hop { width: 100%; height: 100%; transform-origin: 50% 100%; }
.pl-name { position: absolute; z-index: 3; rotate: -3deg; }
.pl-banner { z-index: 3; width: 0; height: 0; }
.pl-banner > * { position: absolute; }
.pl-string { left: -1px; top: 0; width: 2px; background: #fffaf4b3; transform-origin: 50% 0; }
.pl-guide { left: -1px; bottom: auto; width: 2px; background: repeating-linear-gradient(#fffaf466 0 6px, #0000 6px 12px); }
.pl-card {
  display: grid; justify-items: center; padding: .3em .7em .4em; translate: -50% -15%; transform-origin: 50% 0;
  border: 3px solid var(--rs-ink); border-radius: .7em; background: #fffaf4; color: var(--rs-ink); box-shadow: 4px 4px 0 var(--rs-ink);
  font: 800 1em/1.05 var(--font); white-space: nowrap; animation: pl-swing 2.6s ease-in-out infinite alternate;
}
.pl-card span { font-size: .72em; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.pl-card strong { font-size: 1.5em; letter-spacing: -.04em; }
.pl-banner.gold .pl-card { background: #ffc845; }
@keyframes pl-swing { from { rotate: -4deg; } to { rotate: 4deg; } }
@media (prefers-reduced-motion: reduce) { .pl-card { animation: none; } }
:root[data-reduced-motion] .pl-card { animation: none; }
.pl-dim { z-index: 2; height: 14px; border-inline: 3px solid #fffaf4; background: linear-gradient(#fffaf4, #fffaf4) 0 50% / 100% 3px no-repeat; transform-origin: 0 50%; }
.pl-short { z-index: 3; background: #ffc845; }
.pl-score { z-index: 5; display: flex; align-items: flex-end; gap: .4rem; transform-origin: 50% 100%; }
.pl-score .gold { color: #ffc845; }
.pl-gain { padding-bottom: .5em; }
.pl-verdict { z-index: 5; display: grid; gap: .4rem; justify-items: start; }
.pl-verdict.gold .pp-title > span { background: #ffc845; }

/* Admin verification and live streamer links */
.admin-verify { min-height: 100dvh; display: grid; align-content: center; padding-block: 2rem; }
.admin-verify section {
  padding: clamp(1.2rem, 5vw, 2.6rem); border: 3px solid var(--ink); border-radius: 1.25rem;
  background: var(--field); box-shadow: 7px 7px 0 var(--ink);
}
.admin-verify h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
.admin-verify p { margin-top: .65rem; color: var(--muted); }
.admin-verify-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.1rem; }
.admin-verify-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .45rem .8rem; border: 3px solid var(--ink); border-radius: .7rem;
  background: var(--button); color: var(--button-ink); box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none; font-size: .95rem; font-weight: 750;
}
.admin-verify-primary { background: var(--join); color: var(--join-ink); }
.admin-verify-primary img { padding: 2px; border-radius: 50%; background: #fff; }
.admin-verify-button:hover { filter: brightness(1.06); }
.admin-verify-button:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--ink); }

.masthead-left { position: relative; }
/* Sits straight on the page backdrop, close to the top-left corner (offsets cancel the
   masthead inset so it lands about 1rem from the viewport edges). */
#live-streamers {
  position: absolute; top: calc(.85rem - clamp(.8rem, 2.6vw, 1.5rem)); inset-inline-start: calc(1rem - clamp(.9rem, 3.4vw, 2.6rem));
  width: max-content; max-width: min(30rem, calc(100vw - 6rem)); color: var(--text);
}
.live-streamers-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .6rem; margin-bottom: .45rem; }
#live-streamers-title { font-size: clamp(.92rem, 1.6vw, 1.05rem); letter-spacing: -.01em; }
#live-streamers-category { color: var(--muted); font-size: clamp(.74rem, 1.2vw, .84rem); font-weight: 600; text-decoration: none; }
#live-streamers-category:is(:hover, :focus-visible) { color: var(--text); text-decoration: underline; text-underline-offset: .2em; }
.live-streamers-empty { color: var(--muted); font-size: clamp(.8rem, 1.3vw, .9rem); font-weight: 600; }
#live-streamers-list { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
#live-streamers-list a {
  position: relative; isolation: isolate; display: grid; place-items: center;
  width: clamp(2.2rem, 5.6vw, 2.85rem); aspect-ratio: 1; border: 2px solid #c7acff; border-radius: 50%;
  background: #f0e7ff; color: #312160; font-size: .8rem; font-weight: 800; text-decoration: none;
  box-shadow: 2px 2px 0 #1b1140; transition: translate .15s, border-color .15s;
}
#live-streamers-list a:hover, #live-streamers-list a:focus-visible { border-color: #ffc845; translate: 0 -2px; }
#live-streamers-list img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Home-screen decorations: pre-rendered 3D board-game pieces that
   drift up and down; hovering one spins it once. Shown only beside the party buttons. */
.home-pieces { display: none; position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.home-pieces * { pointer-events: none; }
body:has(#lobby-view:not([hidden]) #entry:not([hidden]) #party-actions:not([hidden])) .home-pieces { display: block; }
.home-piece {
  /* left/top give the piece's centre. Frames are cropped to the piece, so the box is the piece. */
  position: absolute; width: var(--size, 5.6rem); aspect-ratio: 1; margin: calc(var(--size, 5.6rem) / -2) 0 0 calc(var(--size, 5.6rem) / -2);
  animation: piece-float var(--float, 6s) ease-in-out var(--delay, 0s) infinite alternate;
}
.home-pieces .home-piece::after { content: ""; position: absolute; inset: 8%; border-radius: 50%; pointer-events: auto; }
/* At rest: one high-resolution still. Spinning: a 33-frame turntable strip loaded in the background. */
.home-piece > span {
  position: relative; display: block; width: 100%; height: 100%;
  filter: drop-shadow(0 .55rem .45rem #1b114059); transition: scale .25s ease;
}
.home-piece > span::before { content: ""; position: absolute; inset: 0; background: var(--still) center / contain no-repeat; }
.home-piece canvas { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
.home-piece:hover > span { scale: 1.08; }
.home-piece.spin canvas { visibility: visible; }
.home-piece.spin > span::before { visibility: hidden; }
@keyframes piece-float {
  from { translate: 0 calc(var(--rise, 10px) * -1); rotate: calc(var(--tilt, 4deg) * -1); }
  to { translate: 0 var(--rise, 10px); rotate: var(--tilt, 4deg); }
}
[data-piece="d20"] { --still: url("/assets/pieces/d20.0278cb8e90.webp"); --spin: url("/assets/pieces/d20-spin.bb335b135d.webp"); --size: clamp(4.4rem, 5.8vw, 5.6rem); left: 9%; top: 49%; --float: 6.4s; }
[data-piece="chip"] { --still: url("/assets/pieces/chip.282c676390.webp"); --spin: url("/assets/pieces/chip-spin.8ad5942c2f.webp"); --size: clamp(4.4rem, 5.8vw, 5.6rem); left: 27%; top: 23%; --float: 7.2s; --delay: -2s; --tilt: -5deg; }
[data-piece="coin"] { --still: url("/assets/pieces/coin.7bd89cfe37.webp"); --spin: url("/assets/pieces/coin-spin.2c21f594c1.webp"); --size: clamp(4.6rem, 6vw, 5.8rem); left: 20%; top: 78%; --float: 5.6s; --delay: -4s; }
[data-piece="d8"] { --still: url("/assets/pieces/d8.c9b72ab3f7.webp"); --spin: url("/assets/pieces/d8-spin.88a59f5227.webp"); --size: clamp(3.8rem, 5vw, 4.8rem); left: 73%; top: 20%; --float: 6.8s; --delay: -1s; --tilt: -3deg; }
[data-piece="d6"] { --still: url("/assets/pieces/d6.e663c850ef.webp"); --spin: url("/assets/pieces/d6-spin.fd97e8cb38.webp"); --size: clamp(5rem, 6.6vw, 6.4rem); left: 90%; top: 44%; --float: 5.9s; --delay: -3s; }
[data-piece="domino"] { --still: url("/assets/pieces/domino.34c187d410.webp"); --spin: url("/assets/pieces/domino-spin.95ccf3da4c.webp"); --size: clamp(6.2rem, 8.2vw, 7.8rem); left: 81%; top: 76%; --float: 7.6s; --delay: -5s; --tilt: -4deg; }
@media (max-width: 720px) {
  [data-piece="chip"], [data-piece="d8"] { display: none; }
  [data-piece="d20"] { --size: 3.4rem; left: 14%; top: 22%; }
  [data-piece="d6"] { --size: 3.8rem; left: 86%; top: 19%; }
  [data-piece="coin"] { --size: 3.5rem; left: 16%; top: 76%; }
  [data-piece="domino"] { --size: 4.6rem; left: 84%; top: 77%; }
}
@media (max-height: 560px) { .home-pieces { display: none !important; } }

/* Discord: white mark in the bottom-right corner of the page. body is the positioned ancestor
   (full width, no margin), so the masthead and scene keep their existing placement. */
body { position: relative; }
.discord-link {
  position: absolute; right: clamp(.4rem, 2vw, 1.4rem); bottom: calc(.9rem + env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0 !important; color: #fff !important;
  transition: scale .2s ease;
}
.discord-link svg { width: 2rem; height: 2rem; fill: currentColor; filter: drop-shadow(0 2px 0 #1b114066); }
.discord-link:is(:hover, :focus-visible) { scale: 1.25; text-decoration: none !important; }
@media (max-width: 720px) {
  .discord-link { position: static; margin: .5rem auto 0; }
}
@media (prefers-reduced-motion: reduce) {
  .home-piece { animation: none; }
  .discord-link, .home-piece > span { transition: none; }
}
:root[data-reduced-motion] .home-piece { animation: none; }
:root[data-reduced-motion] :is(.discord-link, .home-piece > span) { transition: none; }
.pp-spark { width: 10px; height: 5px; border-radius: 2px; pointer-events: none; box-shadow: 0 1px 0 #0f082840; }
.pp-coin { width: 40px; height: 40px; pointer-events: none; background: url("/assets/pieces/coin-spin.2c21f594c1.webp") 0 0 / 3300% 100% no-repeat; animation: pp-coin-spin .9s steps(32) infinite; }
@keyframes pp-coin-spin { to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .pp-coin { animation: none; } }
:root[data-reduced-motion] .pp-coin { animation: none; }

/* POP-IN RANKS: the home backdrop (violet, contours); a lineup; numerals that arrive with force. */
.pi-shake { inset: 0; }
.pi-shake > * { position: absolute; }
.pi-slot { width: 0; height: 0; }
.pi-slot > * { position: absolute; }
.pi-slot.left { opacity: .6; }
.pi-num { transform-origin: 50% 100%; }
.pi-push, .pi-shove, .pi-hop { transform-origin: 50% 100%; }
.pi-shove, .pi-hop { width: 100%; height: 100%; }
.pi-label { display: grid; justify-items: center; gap: .3rem; }
.pi-label .pp-tag { rotate: -2deg; }
.pi-score { margin-top: .05em; }
.pi-gain { position: absolute; right: -.2em; bottom: 0; translate: 100% 0; font-size: 1.1rem; }
.pi-ground { height: 1.6rem; translate: 0 -50%; border-radius: 50%; background: radial-gradient(closest-side, #0f082899, #0f082800); }
.pi-head { display: grid; gap: .45rem; justify-items: start; z-index: 5; }
.pi-headline { margin-top: .1rem; }

/* SHUFFLE INTO ORDER: the lobby backdrop (blue, confetti); a scramble that sorts itself out. */
.sh-num { transform-origin: 50% 100%; }
.sh-mover { width: 0; height: 0; }
.sh-mover > * { position: absolute; }
.sh-mover.left { opacity: .6; }
.sh-hop { transform-origin: 50% 100%; }
.sh-label { display: grid; justify-items: center; gap: .3rem; }
.sh-label .pp-tag { rotate: 2deg; }
.sh-gain { position: absolute; left: 50%; top: 100%; font-size: 1.05rem; translate: -50% .1rem; }
.sh-head { display: grid; gap: .45rem; justify-items: start; z-index: 5; }
/* The round's outcome as text (prompt, answer, your pick), for answers that aren't a numeral. */
.sh-outcome { display: grid; gap: .25em; max-width: 34em; }
.sh-prompt { color: #fff; font: 800 1em/1.15 var(--font); letter-spacing: -.02em; text-shadow: 0 .1em 0 var(--rs-ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sh-answer { color: #fff; font: 700 .95em/1.15 var(--font); text-shadow: 0 .08em 0 var(--rs-ink); overflow-wrap: anywhere; }
.sh-answer.right span { color: #9ed65a; } .sh-answer.wrong span { color: #ffc845; }
.sh-note { color: #ffc845; font: 700 .85em/1.15 var(--font); text-shadow: 0 .08em 0 var(--rs-ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sl-callout.outside { color: #fff; text-shadow: 0 .06em 0 var(--rs-ink); }
.sl-note.outside { z-index: 5; }
.sl-frost { color: #1e5069cc; text-shadow: 0 0 .08em #ffffffcc, 0 .03em .25em #ffffff99; }
/* The floating glove shared by the sequences (glove() in results-kit.js). */
.pp-glove { z-index: 40; left: 0; top: 0; pointer-events: none; filter: drop-shadow(.3rem 1rem .8rem #0f082859); }
/* Both poses share a 410px frame. Crop at the wrist, below the cuff’s ink outline. */
.pp-glove img { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(27.8% 0 0); }
.pp-glove img.open { opacity: 0; }
/* Paper Planes in a party: one lane each, faint guide lines at the distances. */
.pl-col { z-index: 0; width: 2px; background: repeating-linear-gradient(#fffaf433 0 6px, #0000 6px 12px); }
.pl-you.left { opacity: .55; }
.pl-lane-name { position: absolute; z-index: 3; rotate: -2deg; }
.pl-lane-score { z-index: 5; display: flex; align-items: center; gap: .35rem; transform-origin: 0 100%; }
.pl-lane-score .gold { color: #ffc845; }
.pl-place { flex: none; }

/* Advertisers: one screen. The pitch on the left, an enquiry card on the right. Calmer than the
   game screens (no stickers, no tilt), same type, outlines and colours. */
.partner-panel { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 1fr); gap: clamp(1.4rem, 3vw, 2.6rem); align-items: start; width: 100%; margin-top: 0; }
.partner-panel h1 { font: 800 clamp(2.1rem, min(4.2vw, 7vh), 3.5rem)/.95 var(--font); letter-spacing: -.055em; margin-bottom: .6rem; }
.partner-eyebrow { margin-bottom: .45rem; color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.partner-panel .information-lead { font-size: 1rem; max-width: 40rem; }
.partner-status { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .7rem; color: var(--muted); font-size: .88rem; }
.partner-status span { padding: .18rem .6rem; border: 2px solid var(--ink); border-radius: 999px; background: #ffc845; color: #1b1140; font-size: .78rem; font-weight: 800; }
.partner-facts { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem 1.3rem; margin-top: .9rem; }
.partner-facts > section { padding-top: .7rem; border-top: 3px solid var(--ink); }
:root:not([data-theme="light"]) .partner-facts > section { border-top-color: var(--line); }
.information .partner-facts h2 { margin: 0 0 .35rem; font-size: 1.08rem; letter-spacing: -.02em; }
.partner-facts p, .partner-facts li { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.partner-facts ul { margin: 0 0 .45rem; padding: 0; list-style: none; }
.information .partner-facts li + li { margin-top: .3rem; }
.partner-sizes li { display: flex; align-items: baseline; gap: .5rem; }
.partner-sizes li { white-space: nowrap; }
.partner-sizes b { min-width: 4.4rem; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 800; }
.partner-rules li { position: relative; padding-left: 1.1rem; }
.partner-rules li::before { content: ""; position: absolute; left: 0; top: .42em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }
/* The enquiry card: the site's paper card with an ink outline and offset shadow. */
.partner-card {
  display: grid; gap: .2rem; margin-top: .7rem; padding: 1.1rem 1.25rem 1rem; color: #1b1140; background: #fffaf3; color-scheme: light;
  border: 3px solid #1b1140; border-radius: 22px; box-shadow: 6px 6px 0 #1b1140; text-align: left;
}
.information .partner-card h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.03em; }
.partner-card > p:first-of-type { margin-bottom: .3rem; color: #4a4266; font-size: .86rem; }
.partner-card label { margin: .3rem 0 0; font-size: .82rem; font-weight: 750; }
.partner-card :is(input, select, textarea) { width: 100%; min-height: 0; padding: .42rem .7rem; border: 2px solid #1b1140; border-radius: 12px; color: #1b1140; background: #fff; font: 500 .95rem/1.3 var(--font); }
.partner-card select { appearance: none; padding-right: 2rem; }
.partner-card .contact-select { display: block; }
.partner-card textarea { resize: vertical; }
.partner-card button { justify-self: start; display: flex; align-items: center; gap: 1rem; margin-top: .6rem; background: var(--create); color: var(--create-ink); }
.partner-card a { color: #4b33b5; }
#partner-inquiry-result { font-size: .85rem; overflow-wrap: anywhere; }
#partner-inquiry-result:empty { display: none; }
.contact-partners { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.1rem; padding: .45rem 1rem; border: 2px solid currentColor; border-radius: 999px; color: var(--text); font-size: .9rem; font-weight: 750; text-decoration: none; }
.information .contact-partners { color: var(--text); }
.contact-partners:is(:hover, :focus-visible) { background: var(--text); color: var(--ink); }
@media (max-width: 56rem) {
  .partner-panel { grid-template-columns: 1fr; gap: 1.1rem; }
  .partner-facts { grid-template-columns: 1fr 1fr; }
  .partner-facts > section:last-child { grid-column: 1 / -1; }
}
@media (max-width: 34rem) {
  .partner-facts { grid-template-columns: 1fr; gap: .7rem; }
  .partner-facts > section:last-child { grid-column: auto; }
}

/* The Discord join view uses two adjacent surfaces on the existing join backdrop. */
body:has(#lobby-view:not([hidden]) #entry:not([hidden]) #discord-party-discovery:not([hidden])) #visual-stage .pp-stage {
  visibility: hidden;
}

:root {
  --discord-card: #4a1530;
  --discord-card-edge: #2cc5b0;
}
:root[data-theme="light"] { --discord-card: #fffaf4; }

.discord-link-card,
#entry:has(#discord-party-discovery:not([hidden])) :is(#party-form, #discord-party-discovery) {
  color: var(--text);
  background: var(--discord-card);
  border: 3px solid var(--ink);
  border-radius: 1.15rem 1.45rem 1rem 1.35rem / 1rem 1.2rem 1.35rem 1.1rem;
  box-shadow: .25rem .3rem 0 var(--discord-card-edge);
}
/* Twin cut-paper surfaces keep the ink outline and teal offset of the board. */
#entry:has(#discord-party-discovery:not([hidden])) :is(#party-form, #discord-party-discovery) {
  --discord-card-cut: polygon(0 6%, 1% 3%, 3.5% 1.2%, 17% .4%, 23% 0, 29% 1.5%,
    35% 1.4%, 44% .3%, 61% .6%, 70% 1%, 77% 0, 84% 1.1%, 97% .6%, 99% 2%, 100% 5%,
    99.4% 20%, 98.6% 30%, 99.2% 37%, 100% 43%, 99.3% 61%, 98.8% 67%, 99% 73%,
    100% 80%, 99% 88%, 99.3% 96%, 98% 99%, 94% 100%, 75% 98.8%, 66% 99.3%, 59% 97.7%,
    53% 97.5%, 46% 99%, 26% 98.5%, 3.5% 97.5%, 1% 96%, 0 92%, .5% 76%, 0 61%,
    .8% 52%, 1.25% 46%, .9% 40%, 0 34%);
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: drop-shadow(.25rem .3rem 0 var(--discord-card-edge));
}
#entry:has(#discord-party-discovery:not([hidden])) :is(#party-form, #discord-party-discovery)::before,
#entry:has(#discord-party-discovery:not([hidden])) :is(#party-form, #discord-party-discovery)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--ink);
  clip-path: var(--discord-card-cut);
  pointer-events: none;
}
#entry:has(#discord-party-discovery:not([hidden])) :is(#party-form, #discord-party-discovery)::after {
  inset: 3px;
  background: var(--discord-card);
}
@media (forced-colors: active) {
  #entry:has(#discord-party-discovery:not([hidden])) :is(#party-form, #discord-party-discovery) {
    border: 2px solid CanvasText;
    border-radius: 1rem;
    filter: none;
  }
}
#entry:has(#discord-party-discovery:not([hidden])) #party-form { padding: clamp(.95rem, 3vw, 1.55rem); }
#discord-party-discovery:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: .8rem;
  width: min(100%, 26rem);
  margin: .9rem auto 0;
  padding: 1rem;
}
#discord-discovery-title { font-size: 1.26rem; }
.discord-discovery-panel + .discord-discovery-panel {
  border-top: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  padding-top: .8rem;
}
.discord-discovery-panel h3 { margin: 0 0 .3rem; font-size: .98rem; }
.discord-discovery-panel p { margin: .3rem 0 .55rem; color: var(--muted); font-size: .84rem; }
.discord-discovery-panel p:empty,
.discord-discovery-panel ul:empty { display: none; }
.discord-discovery-panel ul {
  display: grid;
  gap: .35rem;
  margin: .5rem 0;
  padding: 0;
  list-style: none;
  max-height: 10rem;
  overflow: auto;
}
#discord-discovery-refresh {
  justify-self: stretch;
  margin-top: .25rem;
  color: var(--join-ink);
  background: var(--join);
  border-color: var(--ink);
}
.discord-discovery-panel .party-chip { color: inherit; border-color: currentColor; }
.discord-discovery-panel .discord-party-result {
  display: flex;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  gap: .5rem;
  overflow-wrap: anywhere;
}
.discord-party-result img { width: 1.65rem; height: 1.65rem; flex: none; border-radius: 50%; object-fit: cover; }
@media (min-width: 42rem) {
  main:has(#lobby-view:not([hidden]) #entry:not([hidden]) #discord-party-discovery:not([hidden])) {
    width: min(100% - 2.5rem, 43rem);
  }
  #entry:has(#discord-party-discovery:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 26rem);
    gap: .85rem;
    justify-content: center;
    align-items: start;
  }
  #entry:has(#discord-party-discovery:not([hidden])) #party-form { grid-area: 1 / 2; }
  #discord-party-discovery:not([hidden]) { grid-area: 1 / 1; margin-top: 0; }
}

.discord-link-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background: repeating-linear-gradient(50deg, #a02a62 0 13px, #b83d76 13px 24px);
}
.discord-link-page main { width: min(100% - 2rem, 29rem); padding: 2.5rem 0; }
.discord-link-page .wordmark { font-size: clamp(2.75rem, 10vw, 4.4rem); margin-bottom: 1.5rem; }
.discord-link-card { padding: clamp(1.15rem, 5vw, 2rem); }
.discord-link-card h1 { font-size: clamp(1.6rem, 6vw, 2.15rem); line-height: 1.06; }
.discord-link-card p { margin-top: .7rem; color: var(--muted); }
.discord-link-card #continue-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.25rem;
  background: var(--button);
  color: var(--button-ink);
}
.discord-link-card #link-status:empty { display: none; }
.discord-link-card .discord-link-code {
  padding: .65rem .75rem;
  color: var(--text);
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: .65rem;
  font-family: ui-monospace, monospace;
  letter-spacing: .055em;
  overflow-wrap: anywhere;
}

#discord-party-visibility-row:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem .95rem;
  margin: .85rem 0 1rem;
  padding: .6rem .75rem;
  border: 2px solid color-mix(in srgb, var(--text) 29%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--field) 54%, transparent);
}
#discord-party-visibility-row label { margin: 0; font-weight: 800; }
#discord-party-visibility {
  max-width: 100%;
  min-height: 2.25rem;
  padding: .25rem .6rem;
  border: 2px solid var(--ink);
  border-radius: .65rem;
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--button-ink);
  background: var(--button);
  font-weight: 750;
  cursor: pointer;
}
#discord-party-visibility:disabled { cursor: default; }
#discord-party-visibility option { color: var(--button-ink); background: var(--button); }

@supports (appearance: base-select) {
  #discord-party-visibility, #discord-party-visibility::picker(select) { appearance: base-select; }
  #discord-party-visibility { gap: .65rem; }
  #discord-party-visibility::picker(select) {
    margin-block: .3rem;
    padding: .25rem;
    border: 2px solid var(--ink);
    border-radius: .75rem;
    box-shadow: 3px 3px 0 var(--ink);
    color: var(--button-ink);
    background: var(--button);
  }
  #discord-party-visibility option { padding: .4rem .55rem; border-radius: .45rem; }
  #discord-party-visibility option:is(:checked, :focus-visible, :hover) {
    color: var(--join-ink);
    background: var(--join);
  }
}
