/* ==========================================================================
   randome.io — design system
   1. Tokens and themes      5. Stage and result panel   9. Individual generators
   2. Base                   6. Form controls           10. Article, FAQ, tiles
   3. Header and menu        7. Buttons                 11. Footer, modal, toast
   4. Page head              8. History and lists       12. Print and motion
   ========================================================================== */

/* ------------------------------------------------------------------ 1. Tokens */

@font-face {
  font-family: "Unbounded Fallback";
  src: local("Arial Black"), local("Arial Bold"), local("Arial");
  size-adjust: 112%;
  ascent-override: 92%;
  descent-override: 24%;
}

:root {
  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Unbounded", "Unbounded Fallback", "Arial Black", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f4f3fb;
  --surface: #ffffff;
  --surface-2: #f6f5fc;
  --surface-3: #eceaf6;
  --ink: #17132e;
  --ink-2: #4b4768;
  --ink-3: #77738f;
  --line: #e4e1f1;
  --line-2: #d3cfe8;
  --shadow-1: 0 1px 2px rgba(23, 19, 46, .05), 0 4px 14px rgba(23, 19, 46, .05);
  --shadow-2: 0 2px 4px rgba(23, 19, 46, .05), 0 18px 44px rgba(23, 19, 46, .10);
  --ok: #0f9d6b;
  --bad: #dc3d43;
  --warn: #d98a00;

  --radius: 18px;
  --radius-lg: 28px;

  --accent: #6c47ff;
  --accent-2: #a44dff;
  --accent-deep: #4a28d6;
  --on-accent: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent-deep) 92%, var(--ink));
}

[data-theme="dark"] {
  --bg: #0d0b1a;
  --surface: #17142b;
  --surface-2: #1d1936;
  --surface-3: #282346;
  --ink: #f4f2ff;
  --ink-2: #c0bbdc;
  --ink-3: #908cae;
  --line: #2a2549;
  --line-2: #3b3566;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .28);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 44px rgba(0, 0, 0, .45);
  --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 62%, #ffffff);
}

/* One accent per generator. Set on <html>, on a tile or on a tab. */
[data-accent="violet"]  { --accent: #6c47ff; --accent-2: #a44dff; --accent-deep: #4a28d6; --on-accent: #fff; }
[data-accent="blue"]    { --accent: #2f6bff; --accent-2: #5a4bff; --accent-deep: #1b4bd1; --on-accent: #fff; }
[data-accent="pink"]    { --accent: #f43f7f; --accent-2: #ff7a3d; --accent-deep: #c9255f; --on-accent: #fff; }
[data-accent="emerald"] { --accent: #0a9a6c; --accent-2: #0fb5a8; --accent-deep: #07785a; --on-accent: #fff; }
[data-accent="orange"]  { --accent: #ea5f0c; --accent-2: #f43f5e; --accent-deep: #bb4505; --on-accent: #fff; }
[data-accent="red"]     { --accent: #e5383b; --accent-2: #ff6a3d; --accent-deep: #b82226; --on-accent: #fff; }
[data-accent="amber"]   { --accent: #ffbe1a; --accent-2: #ff9a1f; --accent-deep: #c98300; --on-accent: #2a1c00; }
[data-accent="sky"]     { --accent: #0b8fd0; --accent-2: #4f6bff; --accent-deep: #0870a5; --on-accent: #fff; }
[data-accent="purple"]  { --accent: #9b4df0; --accent-2: #e84dbd; --accent-deep: #7a2fcc; --on-accent: #fff; }
[data-accent="teal"]    { --accent: #0d9488; --accent-2: #2f8bff; --accent-deep: #0a736a; --on-accent: #fff; }
[data-accent="indigo"]  { --accent: #5562ea; --accent-2: #9a4dff; --accent-deep: #3b46c2; --on-accent: #fff; }
[data-accent="fuchsia"] { --accent: #c936c9; --accent-2: #ff5a8a; --accent-deep: #9f22a0; --on-accent: #fff; }

[data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent-deep) 92%, var(--ink));
}
[data-theme="dark"] [data-accent], [data-theme="dark"][data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 62%, #ffffff);
}

/* ------------------------------------------------------------------ 2. Base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 400 1rem/1.55 var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Soft coloured light behind the page, tinted by the current accent. */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 620px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52rem 26rem at 8% -8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(46rem 24rem at 96% -4%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%);
  transition: background .5s;
}

main { flex: 1; padding-bottom: 56px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

a { color: var(--accent-text); }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

.ic {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic--sm { width: 1em; height: 1em; }

kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  background: var(--surface);
  font: 600 .78rem var(--font-ui);
  color: var(--ink-2);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ 3. Header */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.hdr.is-stuck, .hdr.is-open { border-bottom-color: var(--line); }
.hdr__in { display: flex; align-items: center; gap: 10px; height: 64px; }

/* The logo: a die whose lit pips form "r", and the word randome.io drawn with one round line.
   Both pictures come from tools/logo.py. The die and ".io" take the accent of the current page. */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.logo__mark {
  width: 34px;
  height: 34px;
  color: var(--accent);
  transform: rotate(-8deg);
  filter: drop-shadow(0 3px 0 var(--accent-deep));
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), color .4s, filter .4s;
}
.logo__mark svg { display: block; width: 100%; height: 100%; }
.logo__pips { fill: var(--on-accent); transition: fill .4s; }
.logo:hover .logo__mark { transform: rotate(10deg) scale(1.06); }
/* The picture has empty space under the baseline, so its middle is the middle of the small letters. */
.logo__word { display: block; width: auto; height: 28px; overflow: visible; }
.logo__name { stroke: currentColor; }
.logo__tld { stroke: var(--accent-text); transition: stroke .4s; }
.logo__pip { fill: var(--accent-text); transition: fill .4s; }

/* Links that do not fit wrap to a second row, which is clipped: no half-visible items. */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; height: 40px; margin-left: 10px; min-width: 0; flex: 1; overflow: hidden; }
.nav__btn, .nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink-2);
  font: 600 .94rem var(--font-ui);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav__btn:hover, .nav__link:hover { background: var(--surface-3); color: var(--ink); }
.nav__btn[aria-expanded="true"] { background: var(--surface-3); color: var(--ink); }
.nav__btn .ic--sm { transition: transform .2s; }
.nav__btn[aria-expanded="true"] .ic--sm { transform: rotate(180deg); }
.nav__link.is-current { background: var(--accent-soft); color: var(--accent-text); }

.hdr__side { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }

.lang { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); }
.lang__opt {
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--ink-3);
  font: 700 .78rem/1.2 var(--font-ui);
  letter-spacing: .05em;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.lang__opt:hover { color: var(--ink); }
.lang__opt.is-current { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.iconbtn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }
.iconbtn--soft { width: 64px; height: 64px; border-radius: 18px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.iconbtn .ic { width: 22px; height: 22px; }

.ic--moon, [data-theme="dark"] .ic--sun { display: none; }
[data-theme="dark"] .ic--moon { display: block; }
.ic--close, [aria-expanded="true"] > .ic--open { display: none; }
[aria-expanded="true"] > .ic--close { display: block; }
.ic--off, [aria-pressed="false"] > .ic--on { display: none; }
[aria-pressed="false"] > .ic--off { display: block; }

.hdr__burger { display: none; }

.mega {
  position: absolute;
  inset: 100% 0 auto 0;
  max-height: calc(100dvh - 64px);
  overflow: auto;
  padding: 16px 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  animation: drop .18s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.mega__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 6px; }
.mega__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
.mega__item:hover { background: var(--accent-soft); }

.suggest { background: var(--ink); color: var(--bg); font-size: .92rem; }
.suggest__in { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.suggest__cta { color: inherit; font-weight: 700; margin-left: 4px; }
.suggest__close { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--bg) 14%, transparent); color: inherit; cursor: pointer; }

@media (max-width: 980px) {
  .nav__link { display: none; }
}
@media (max-width: 700px) {
  .hdr__in { height: 58px; }
  .nav { display: none; }
  .hdr__burger { display: grid; }
  .mega { max-height: calc(100dvh - 58px); }
}
@media (max-width: 420px) {
  .logo { gap: 8px; }
  .logo__mark { width: 30px; height: 30px; }
  .logo__word { height: 20px; }
  .hdr__side { gap: 2px; }
  .lang__opt { padding: 6px 7px; }
}
/* 360 px is the most common phone width: the logo gives up a little so that nothing touches the edge. */
@media (max-width: 374px) {
  .hdr__in { gap: 6px; }
  .hdr .logo__word { height: 18px; }
}
@media (max-width: 359px) {
  .hdr .logo__word { display: none; }
}

/* ------------------------------------------------------------------ 4. Page head */

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: .86rem;
  color: var(--ink-3);
}
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); text-decoration: underline; }

.hero { padding: 10px 0 18px; }
.hero--home { padding-top: 30px; }
.hero h1 {
  margin: 0 0 12px;
  font: 800 clamp(1.65rem, 1.02rem + 3.1vw, 3.15rem)/1.08 var(--font-display);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.lead {
  max-width: 72ch;
  color: var(--ink-2);
  font-size: clamp(1rem, .96rem + .28vw, 1.14rem);
  line-height: 1.6;
}
.lead p { margin: 0; }

@media (max-width: 700px) {
  .hero { padding: 8px 0 12px; }
  .hero--home { padding-top: 16px; }
  .hero h1 { margin-bottom: 8px; }
  /* The generator must stay on the first screen: the intro folds to three lines, a tap opens it. */
  .lead:not(.is-open) p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    cursor: pointer;
  }
}

.hero--404 { text-align: center; padding: 40px 0 10px; }
.hero--404 .lead { margin-inline: auto; margin-bottom: 22px; }
.hero__code {
  margin: 0 0 6px;
  font: 800 clamp(4.5rem, 20vw, 9rem)/1 var(--font-display);
  letter-spacing: -.04em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .06em;
}
.hero__die { width: .8em; height: .8em; display: inline-block; transform: rotate(12deg); animation: wobble 3s ease-in-out infinite; }
.hero__die svg { width: 100%; height: 100%; display: block; }
@keyframes wobble { 50% { transform: rotate(-12deg) translateY(-6px); } }

/* ------------------------------------------------------------------ 5. Stage and result panel */

.stage {
  position: relative;
  padding: clamp(10px, 2.2vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.tool__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 22px);
  align-items: stretch;
}
.tool__grid--list { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
/* A long settings column must not stretch the result panel: it keeps its size and stays in view. */
@media (min-width: 861px) {
  .tool__grid:not(.tool__grid--list) { align-items: start; }
  .tool__grid:not(.tool__grid--list) > .display { position: sticky; top: 78px; }
}
.tool__main { display: grid; gap: clamp(12px, 2vw, 18px); align-content: start; min-width: 0; }
.tool__side { min-width: 0; }
.tool__side.panel { padding: 14px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); }

@media (max-width: 860px) {
  .tool__grid, .tool__grid--list { grid-template-columns: minmax(0, 1fr); }
  /* On a phone you type the list first, then press the button, then read the result. */
  .tool__grid--list .tool__main { display: contents; }
  .tool__grid--list .tool__side { order: 1; }
  .tool__grid--list .panel[data-ref="form"] { order: 2; }
  .tool__grid--list .display { order: 3; }
}

.display {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: clamp(180px, 30vw, 340px);
  padding: 18px 16px 62px;
  border-radius: 22px;
  color: var(--on-accent);
  text-align: center;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-2) 100%);
}
.display::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--on-accent) 20%, transparent) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 78%);
}
.display::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 60%;
  aspect-ratio: 1;
  left: -18%;
  top: -40%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .26), transparent);
  pointer-events: none;
}

.display__hint { font: 600 clamp(1rem, .9rem + 1.6cqw, 1.35rem)/1.3 var(--font-ui); opacity: .88; letter-spacing: 0; text-shadow: none; }
.display__result {
  max-width: 100%;
  font: 800 min(clamp(3.3rem, 24cqw, 9.5rem), calc(94cqw / (var(--chars, 3) * .78)))/1 var(--font-display);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 .045em 0 rgba(0, 0, 0, .14);
  overflow-wrap: anywhere;
}
.display__result--md { font-size: min(clamp(2rem, 13cqw, 4.4rem), calc(94cqw / (var(--chars, 3) * .78))); }
.display__meta { min-height: 1.35em; font: 500 .9rem/1.35 var(--font-ui); opacity: .84; }
.display__meta--big { font: 700 clamp(1.1rem, 4.4cqw, 1.7rem) var(--font-display); letter-spacing: -.02em; opacity: 1; }
.display__note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: .86rem; line-height: 1.4; opacity: .92; text-align: left; }
.display__note .ic { margin-top: 1px; }
.display__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin-inline: auto;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .22);
  font: 600 .8rem/1.3 var(--font-ui);
}
.display__bar { position: absolute; inset: auto 10px 12px 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.chipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: color-mix(in srgb, var(--on-accent) 16%, transparent);
  color: inherit;
  font: 600 .84rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.chipbtn .ic { width: 17px; height: 17px; }
.chipbtn:hover:not(:disabled) { background: color-mix(in srgb, var(--on-accent) 28%, transparent); }
.chipbtn:active:not(:disabled) { transform: scale(.96); }
.chipbtn:disabled { opacity: .42; cursor: default; }
.chipbtn--icon { width: 36px; padding: 0; justify-content: center; }
.chipbtn--solid { background: #fff; color: var(--accent-deep); }
.chipbtn--solid:hover:not(:disabled) { background: #fff; filter: brightness(.96); }

/* Narrow panel: icons only. The labels stay available to screen readers. */
@container (max-width: 380px) {
  .display__bar .chipbtn:not(.chipbtn--solid) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .display__bar .chipbtn { width: 40px; height: 38px; padding: 0; justify-content: center; }
  .display__bar .chipbtn--solid { width: auto; padding: 0 12px; }
}

/* A single number "lands" with a little bounce. */
.pop { animation: pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { from { transform: scale(.72); opacity: .3; } }

/* Several numbers are shown as lottery balls. */
.balls { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 1.8cqw, 12px); font-size: 1rem; letter-spacing: -.02em; text-shadow: none; }
.ball {
  --d: clamp(52px, 15cqw, 92px);
  display: grid;
  place-items: center;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fff 0%, #f3f1ff 52%, #d6d1f2 100%);
  color: #1d1838;
  font: 800 calc(var(--d) * .36)/1 var(--font-display);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .16), inset 0 -5px 9px rgba(0, 0, 0, .08);
  animation: pop .4s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.ball--3 { font-size: calc(var(--d) * .29); }
.ball--4 { font-size: calc(var(--d) * .23); }
.ball--5 { font-size: calc(var(--d) * .18); }

.chipset {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
  padding: 2px;
  font: 700 1rem/1 var(--font-ui);
  letter-spacing: 0;
  text-shadow: none;
}
.chipset span { padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--on-accent) 17%, transparent); font-variant-numeric: tabular-nums; }

/* Full-screen result for a projector or a stream. */
.display:fullscreen { border-radius: 0; min-height: 100vh; padding: 5vh 4vw 12vh; cursor: pointer; }
.display:fullscreen .display__result { font-size: min(46vh, calc(92vw / (var(--chars, 3) * .78))); }
.display:fullscreen .ball { --d: clamp(80px, 13vw, 220px); }
.display:fullscreen .display__meta { font-size: 1.4rem; }
.display:fullscreen .display__bar { bottom: 3vh; }

/* Result as a list (picker, names, words). */
.display--list { align-items: stretch; justify-content: center; padding-top: 22px; min-height: clamp(210px, 30vw, 360px); }
.display--list .display__result {
  font: 800 clamp(1.5rem, 9cqw, 3.4rem)/1.12 var(--font-display);
  letter-spacing: -.03em;
  width: 100%;
  max-height: 380px;
  overflow: auto;
}
.display--list .display__hint { font-weight: 600; }
.display--list .display__meta { text-align: center; }

.rlist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; font: 700 clamp(1rem, 4.6cqw, 1.35rem)/1.25 var(--font-ui); letter-spacing: 0; text-shadow: none; }
.rlist li { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--on-accent) 15%, transparent); overflow-wrap: anywhere; }
.rlist li > i { flex: none; min-width: 1.6em; font-style: normal; font-weight: 600; opacity: .7; font-variant-numeric: tabular-nums; }
.rlist--reserve li { background: color-mix(in srgb, var(--on-accent) 8%, transparent); font-weight: 600; }
.rlist__title { margin: 12px 0 6px; font: 700 .8rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; opacity: .8; text-align: left; text-shadow: none; }
.rlist__title:first-child { margin-top: 0; }

.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; text-align: left; font: 500 .98rem/1.35 var(--font-ui); letter-spacing: 0; text-shadow: none; }
.teamgrid section { padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--on-accent) 15%, transparent); }
.teamgrid strong { display: block; margin: 0 0 4px; font: 800 .82rem var(--font-display); letter-spacing: 0; opacity: .85; }
.teamgrid ul { margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }

/* Clickable results: nicknames, names, words. */
.picks { width: 100%; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; align-content: center; }
.picks > .display__hint { grid-column: 1 / -1; text-align: center; }
.pick {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--on-accent) 16%, transparent);
  transition: background .15s;
  animation: pop .35s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.pick:hover { background: color-mix(in srgb, var(--on-accent) 26%, transparent); }
.pick__text {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 10px 14px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: 700 1.05rem/1.25 var(--font-ui);
  overflow-wrap: anywhere;
  cursor: pointer;
}
.pick__star { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-right: 4px; border: 0; border-radius: 10px; background: none; color: inherit; opacity: .7; cursor: pointer; }
.pick__star:hover { opacity: 1; background: color-mix(in srgb, var(--on-accent) 16%, transparent); }
.pick__star[aria-pressed="true"] { opacity: 1; }
.pick__star[aria-pressed="true"] .ic { fill: currentColor; }
.picks--names { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.picks--plain { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.picks--plain .pick { background: var(--surface-2); color: var(--ink); animation: none; }
.picks--plain .pick:hover { background: var(--accent-soft); }
.words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; }
.words .pick { min-height: 0; }
.words .pick__text { padding: 10px 16px; text-align: center; font: 800 clamp(1.15rem, 5.6cqw, 2rem)/1.15 var(--font-display); letter-spacing: -.02em; }
.words--many .pick__text { font: 700 1.05rem/1.2 var(--font-ui); letter-spacing: 0; }

/* ------------------------------------------------------------------ 6. Form controls */

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack--tight { gap: 10px; }
.stack--grow { flex: 1; }

.row { display: grid; gap: 10px; }
.row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row--opts { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; }
.row--top { align-items: start; }
.row--action { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 520px) {
  /* Keep the switch and the small select on one line; the select's caption stays for screen readers. */
  .row--opts .field--inline .field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .row--opts.row--top { grid-template-columns: minmax(0, 1fr); }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--grow { flex: 1; }
.field--grow .textarea { flex: 1; }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }
.field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 .74rem/1.3 var(--font-ui);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.count { margin-left: auto; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-weight: 700; letter-spacing: 0; text-transform: none; }
.count:empty { display: none; }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font: 500 1.02rem/1.3 var(--font-ui);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .75; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.input--big { min-height: 60px; padding: 0 6px; text-align: center; font: 700 clamp(1.15rem, .9rem + 1.3vw, 1.55rem)/1 var(--font-display); letter-spacing: -.03em; }
.input--mono { font-family: var(--font-mono); }
.input[type="number"] { -moz-appearance: textfield; }
.input[type="number"]::-webkit-outer-spin-button, .input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2377738f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  cursor: pointer;
}
.select--sm { min-height: 40px; width: auto; font-size: .94rem; }

.textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.textarea--list { min-height: 200px; }
.textarea--tall { min-height: 300px; }
.textarea--mono { font: 500 .92rem/1.55 var(--font-mono); }

.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; }
.stepper .input { border-radius: 0; text-align: center; font-weight: 700; padding: 0 4px; position: relative; }
.stepper .input:focus { z-index: 1; }
.stepper__btn {
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.stepper__btn:first-child { border-right: 0; border-radius: 13px 0 0 13px; }
.stepper__btn:last-child { border-left: 0; border-radius: 0 13px 13px 0; }
.stepper__btn:hover { background: var(--accent-soft); color: var(--accent-text); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; -webkit-user-select: none; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 99px;
  background: var(--line-2);
  transition: background .2s;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .22s cubic-bezier(.34, 1.4, .64, 1);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 2px; }
.switch input:disabled ~ * { opacity: .45; cursor: default; }
.switch__text { font-weight: 600; font-size: .97rem; line-height: 1.3; }
.switch__text small { display: block; margin-top: 2px; font-weight: 400; font-size: .82rem; line-height: 1.4; color: var(--ink-3); }

.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px; background: var(--surface-3); max-width: 100%; }
.seg--wide { display: flex; }
.seg--wide .seg__opt { flex: 1; }
.seg--wrap { flex-wrap: wrap; }
.seg--wrap .seg__opt { flex: 1 1 auto; }
.seg__opt { position: relative; min-width: 0; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg__opt span {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font: 600 .93rem/1.2 var(--font-ui);
  text-align: center;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg__opt:hover span { color: var(--ink); }
.seg__opt input:checked + span { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-1); }
[data-theme="dark"] .seg__opt input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg__opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 1px; }
.seg__opt input:disabled + span { opacity: .4; cursor: default; }

.checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.check { position: relative; cursor: pointer; }
.check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check span {
  display: block;
  padding: 11px 4px;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-3);
  font: 700 .95rem/1 var(--font-mono);
  text-align: center;
  transition: all .15s;
}
.check input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 2px; }

.range { width: 100%; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--line-2) var(--fill, 50%)); }
.range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--line-2); }
.range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border: 4px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.range::-moz-range-thumb { width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent); }

.more { border: 1.5px dashed var(--line-2); border-radius: 15px; }
.more[open] { border-style: solid; }
.more > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  color: var(--ink-2);
  font: 600 .95rem/1.25 var(--font-ui);
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { color: var(--ink); }
.more__chev { margin-left: auto; transition: transform .2s; }
.more[open] .more__chev { transform: rotate(180deg); }
.more__body { display: flex; flex-direction: column; gap: 14px; padding: 4px 13px 14px; }
.more--game { background: var(--accent-soft); border-color: transparent; }

.hint { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--ink-3); }
.hint--key { text-align: center; margin-top: -4px; }
@media (hover: none), (max-width: 860px) { .hint--key { display: none; } }

.error {
  margin: 0;
  padding: 10px 13px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bad) 12%, var(--surface));
  color: color-mix(in srgb, var(--bad) 80%, var(--ink));
  font-size: .93rem;
  line-height: 1.4;
  font-weight: 500;
}

.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 11px;
  border: 1.5px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-2);
  font: 600 .86rem/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .1s;
}
.chip .ic { width: 16px; height: 16px; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.chip:active { transform: scale(.96); }
.chip--accent { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); }
.chip--file:focus-within { border-color: var(--accent); }

.linkbtn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; color: var(--ink-3); font: 600 .86rem var(--font-ui); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--accent-text); text-decoration-color: currentColor; }

/* ------------------------------------------------------------------ 7. Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font: 700 .98rem/1.15 var(--font-ui);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 var(--line-2);
  transition: transform .08s, box-shadow .08s, filter .15s;
  user-select: none;
  -webkit-user-select: none;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 0 var(--line-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--lg { min-height: 54px; padding-inline: 22px; font-size: 1.02rem; }
.btn--accent { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent), 0 3px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.btn--accent:active { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 transparent; }

.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 60%);
  color: var(--on-accent);
  box-shadow: 0 5px 0 var(--accent-deep), 0 14px 26px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btn--primary:active { transform: translateY(5px); box-shadow: 0 0 0 var(--accent-deep), 0 6px 12px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn--xl {
  width: 100%;
  min-height: 66px;
  margin-bottom: 5px;
  border-radius: 19px;
  font: 700 clamp(1rem, .9rem + .6vw, 1.18rem)/1.15 var(--font-display);
  letter-spacing: -.01em;
  text-wrap: balance;
}
.btn--xl .ic { width: 22px; height: 22px; }

.btn--light { background: #fff; color: var(--accent-deep); box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.btn--light:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(0, 0, 0, .2); }
.btn--glass { background: color-mix(in srgb, var(--on-accent) 16%, transparent); color: inherit; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-accent) 42%, transparent); }
.btn--glass:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-accent) 42%, transparent); }

/* ------------------------------------------------------------------ 8. History, tabs */

.history { margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed var(--line-2); }
.history__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.history__title { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font: 700 .95rem var(--font-ui); }
.history__list { display: flex; flex-direction: column; gap: 6px; max-height: 268px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.history__list li { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); font-size: .95rem; line-height: 1.4; }
.history__list time { flex: none; color: var(--ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; }
.history__list b { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.history__list span { flex: none; margin-left: auto; color: var(--ink-3); font-size: .84rem; text-align: right; }
.history__list q { quotes: none; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.history__empty { margin: 4px 0 0; color: var(--ink-3); font-size: .9rem; }

.tabs { display: flex; gap: 6px; }
.tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-ui);
}
.tabs--lg { overflow-x: auto; margin: -4px -4px 8px; padding: 4px 4px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs--lg::-webkit-scrollbar { display: none; }
.tabs--lg [role="tab"] {
  flex: 1 0 auto;
  height: 50px;
  padding: 0 16px;
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 700;
  font-size: .97rem;
  box-shadow: inset 0 0 0 1.5px var(--line);
  scroll-snap-align: start;
  transition: background .2s, color .2s, box-shadow .2s, transform .1s;
}
.tabs--lg [role="tab"]:hover { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent); }
.tabs--lg [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 0 var(--accent-deep); }
.tabs--lg [role="tab"]:active { transform: translateY(2px); }

.tabs--sm { padding: 4px; border-radius: 14px; background: var(--surface-3); gap: 3px; }
.tabs--sm [role="tab"] { flex: 1 1 auto; gap: 5px; padding: 9px 6px; border-radius: 10px; background: none; color: var(--ink-2); font-weight: 600; font-size: .86rem; min-width: 0; }
.tabs--sm [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-1); }
.tabs--sm .count { margin-left: 0; padding: 1px 6px; background: var(--accent-soft); color: var(--accent-text); font-size: .74rem; }

/* ------------------------------------------------------------------ 9. Generators */

/* --- wheel --- */
.wheel-top { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.wheel-title {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1.5px solid transparent;
  border-radius: 13px;
  background: none;
  font: 700 clamp(1.1rem, .95rem + 1vw, 1.5rem)/1.2 var(--font-display);
  letter-spacing: -.03em;
  color: var(--ink);
  text-overflow: ellipsis;
}
.wheel-title:hover { border-color: var(--line-2); }
.wheel-title:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.wheel-title::placeholder { color: var(--ink-3); opacity: .7; }

.wheel-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, 1fr); gap: clamp(14px, 2.4vw, 26px); align-items: start; }
.wheel-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.wheel-fs-title { display: none; }
.wheel-box { position: relative; width: min(100%, 580px, 72vh); aspect-ratio: 1; container-type: inline-size; }
.wheel-box--sm { width: min(100%, 300px, 44vh); }
.wheel-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: pointer;
  will-change: transform;
  filter: drop-shadow(0 12px 22px rgba(20, 10, 60, .28));
}
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: .9cqw solid #fff;
  border-radius: 50%;
  background: #17132e;
  color: #fff;
  font: 800 clamp(.6rem, 3cqw, 1.05rem)/1.05 var(--font-display);
  letter-spacing: -.01em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  transition: transform .15s;
}
.wheel-hub span { display: block; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.wheel-hub:hover { transform: translate(-50%, -50%) scale(1.05); }
.wheel-hub:active { transform: translate(-50%, -50%) scale(.96); }
.wheel-cap { position: absolute; top: 50%; left: 50%; width: 16%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 4px solid #fff; background: #17132e; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); pointer-events: none; }
.wheel-pointer {
  position: absolute;
  top: 50%;
  right: -4.5%;
  width: 11%;
  aspect-ratio: 1.25;
  transform: translateY(-50%);
  transform-origin: 100% 50%;
  background: #17132e;
  clip-path: polygon(0 50%, 100% 4%, 100% 96%);
  pointer-events: none;
}
[data-theme="dark"] .wheel-pointer { background: #fff; }
.display .wheel-pointer { background: #fff; }
.wheel-pointer.is-tick { animation: tick .09s ease-out; }
@keyframes tick { 40% { transform: translateY(-50%) rotate(-14deg); } }
.is-spinning .wheel-canvas, .is-spinning .wheel-hub { cursor: default; }

.wheel-under { display: flex; align-items: flex-start; gap: 10px; width: min(100%, 520px); }
.wheel-under .btn--xl { flex: 1; }
.wheel-last { margin: 0; min-height: 1.4em; color: var(--ink-2); font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.wheel-last b { color: var(--accent-text); }

.wheel-side { padding: 12px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); }
.wheel-pane { display: flex; flex-direction: column; gap: 12px; }
.results { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow: auto; counter-reset: res; }
.results li { counter-increment: res; display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 12px; background: var(--surface); font-weight: 600; overflow-wrap: anywhere; }
.results li::before { content: counter(res) "."; flex: none; min-width: 1.6em; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.results time { margin-left: auto; flex: none; color: var(--ink-3); font-size: .8rem; font-weight: 400; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1.5px var(--line-2); transition: transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked="true"] { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 3px var(--accent); }

.wheel-stage:fullscreen { justify-content: center; gap: 2.4vh; padding: 3vh 3vw; background: var(--bg); overflow: auto; }
.wheel-stage:fullscreen .wheel-box { width: min(76vh, 92vw); }
.wheel-stage:fullscreen .wheel-fs-title { display: block; font: 800 clamp(1.2rem, 3.6vh, 2.6rem)/1.1 var(--font-display); letter-spacing: -.03em; text-align: center; }
.wheel-stage:fullscreen .wheel-last { font-size: clamp(1.1rem, 3vh, 2rem); }

@media (max-width: 900px) {
  .wheel-grid { grid-template-columns: minmax(0, 1fr); }
  .wheel-top__acts { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .wheel-top__acts::-webkit-scrollbar { display: none; }
  .wheel-box { width: min(100%, 76vh); }
  .textarea--tall { min-height: 200px; }
}

/* --- yes / no --- */
.display--yesno { padding-bottom: 20px; gap: 10px; }
.yn { display: grid; place-items: center; width: 100%; min-height: 150px; }
.yn__wheel { display: grid; place-items: center; width: 100%; padding-right: 4%; }
.yn__question { margin: 0; max-width: 100%; font: 600 1rem/1.35 var(--font-ui); opacity: .9; overflow-wrap: anywhere; }
.ans-yes, .ans-no, .ans-maybe { display: inline-block; }

.ball8 {
  display: grid;
  place-items: center;
  width: clamp(140px, 42cqw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #74748a 0%, #20202b 36%, #06060a 100%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .4), inset 0 -12px 22px rgba(0, 0, 0, .6);
}
.ball8__window {
  display: grid;
  place-items: center;
  width: 54%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #3239b0, #0b0e3f);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .09), inset 0 8px 16px rgba(0, 0, 0, .6);
}
.ball8__text { padding: 4px; color: #e3e9ff; font: 800 clamp(.8rem, 5.4cqw, 1.35rem)/1.05 var(--font-display); text-transform: uppercase; transition: opacity .3s, transform .3s; }
.ball8.is-shaking { animation: shake .85s cubic-bezier(.36, .07, .19, .97); }
.ball8.is-shaking .ball8__text { opacity: 0; transform: scale(.6) rotate(-20deg); }
@keyframes shake {
  10%, 90% { transform: translate(-3px, 2px) rotate(-3deg); }
  20%, 80% { transform: translate(6px, -3px) rotate(4deg); }
  30%, 50%, 70% { transform: translate(-9px, 4px) rotate(-6deg); }
  40%, 60% { transform: translate(9px, -2px) rotate(6deg); }
}

/* --- coin --- */
.display--coin { padding-top: 26px; }
.coinbox { position: relative; width: clamp(120px, 36cqw, 190px); aspect-ratio: 1; margin: 4px 0 18px; perspective: 900px; }
.coin { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; perspective: 900px; }
.coin__inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.coin__face { position: absolute; inset: 0; border-radius: 50%; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.coin__face svg { display: block; width: 100%; height: 100%; }
.coin__face--tails { transform: rotateX(180deg); }
.coin__digit { font: 800 60px var(--font-display); fill: #a86a00; }
.coin__word { font: 800 26px var(--font-display); fill: #8f5a00; letter-spacing: -1px; }
.coin__shadow { position: absolute; left: 14%; right: 14%; bottom: -16px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .3); filter: blur(6px); }

.stats { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.stats__head { display: flex; align-items: center; justify-content: space-between; }
.stats__bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.stats__bar span { display: block; width: 50%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .35s; }
.stats__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.stats__grid dt { font-size: .76rem; line-height: 1.25; color: var(--ink-3); }
.stats__grid dd { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.stats__grid b { font: 800 1.2rem var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats__grid small { color: var(--ink-3); font-size: .8rem; }
@media (max-width: 420px) { .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.strip { display: flex; flex-wrap: wrap; gap: 5px; max-height: 120px; overflow: auto; }
.strip i { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 9px; font: 700 .8rem var(--font-ui); font-style: normal; background: var(--surface-3); color: var(--ink-2); }
.strip i.is-heads { background: var(--accent-soft); color: var(--accent-text); }

/* --- dice --- */
.display--dice { padding-top: 22px; }
.tray { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(16px, 5cqw, 30px); min-height: 110px; padding: 12px 8px; width: 100%; }
.die { --s: clamp(54px, 17cqw, 94px); width: var(--s); height: var(--s); perspective: 620px; }
.die__tilt { width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-16deg) rotateY(18deg); }
.die__cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.05s cubic-bezier(.17, .84, .3, 1); }
.die__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 14%;
  border-radius: 17%;
  background: linear-gradient(145deg, #ffffff, #e9e6f7);
  box-shadow: inset 0 0 0 2px rgba(23, 19, 46, .08);
}
.die__face i { place-self: center; width: 72%; aspect-ratio: 1; border-radius: 50%; background: #1d1838; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55); }
.die__face--1 { transform: translateZ(calc(var(--s) / 2)); }
.die__face--6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.die__face--3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.die__face--4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.die__face--5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.die__face--2 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.die__face--1 i { background: #e5383b; width: 92%; }

.poly { --s: clamp(60px, 18cqw, 100px); position: relative; display: grid; place-items: center; width: var(--s); height: var(--s); color: #1d1838; font: 800 calc(var(--s) * .32)/1 var(--font-display); letter-spacing: -.04em; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .18)); }
.poly::before { content: ""; position: absolute; inset: 0; background: linear-gradient(150deg, #ffffff 20%, #ddd8f3); clip-path: var(--shape); }
.poly span { position: relative; }
.poly--4 { --shape: polygon(50% 3%, 98% 92%, 2% 92%); }
.poly--4 span { transform: translateY(22%); }
.poly--6 { --shape: inset(5% round 18%); }
.poly--8 { --shape: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.poly--10 { --shape: polygon(50% 0, 96% 38%, 50% 100%, 4% 38%); }
.poly--10 span { transform: translateY(-8%); }
.poly--12 { --shape: polygon(50% 0, 98% 36%, 80% 96%, 20% 96%, 2% 36%); }
.poly--12 span { transform: translateY(6%); }
.poly--20 { --shape: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%); }
.poly--100 { --shape: circle(50%); font-size: calc(var(--s) * .27); }
.poly.is-rolling { animation: tumble .75s cubic-bezier(.17, .84, .3, 1); }
@keyframes tumble {
  0% { transform: rotate(-220deg) scale(.55) translateY(-34px); opacity: .3; }
  65% { transform: rotate(14deg) scale(1.08); opacity: 1; }
}

/* --- password --- */
.display--pw { align-items: stretch; justify-content: center; gap: 14px; padding: 18px; text-align: left; }
.pw {
  display: block;
  min-height: 3.4em;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .2);
  font: 600 clamp(1.1rem, 4.6cqw, 1.85rem)/1.4 var(--font-mono);
  letter-spacing: .02em;
  word-break: break-all;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.pw .d { color: #ffe680; }
.pw .s { color: #ffc2dc; }
.pw--phrase { word-break: normal; }
.meter__bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .26); overflow: hidden; }
.meter__bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .3s; }
.meter__text { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 8px; font-size: .9rem; }
.pw__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.pw__acts .btn { flex: 1 1 140px; }

/* --- words: game mode --- */
.game { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.game__top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.game__timer { padding: 4px 13px; border-radius: 12px; background: rgba(0, 0, 0, .22); font: 800 1.5rem var(--font-display); font-variant-numeric: tabular-nums; }
.game__timer.is-low { background: #fff; color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.game__word { min-height: 1.2em; font: 800 clamp(1.9rem, 13cqw, 4.2rem)/1.05 var(--font-display); letter-spacing: -.04em; overflow-wrap: anywhere; text-shadow: 0 .045em 0 rgba(0, 0, 0, .14); }
.game__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.game__btns .btn { flex: 1 1 140px; max-width: 240px; }
.game__over { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.game__msg { margin: 0; font: 700 1.15rem/1.35 var(--font-ui); }
.teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.teams label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 14px; background: var(--surface); }
.teams .input { min-height: 40px; border-color: transparent; font-weight: 600; padding: 0 10px; }
.teams b { font: 800 1.1rem var(--font-display); font-variant-numeric: tabular-nums; }
.teams label.is-turn { box-shadow: 0 0 0 2px var(--accent); }

/* --- giveaway --- */
.countdown { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent), var(--accent-2)); font: 800 clamp(5rem, 40cqw, 12rem)/1 var(--font-display); }
.countdown span { animation: count .9s cubic-bezier(.2, .9, .3, 1); }
@keyframes count { from { transform: scale(2.2); opacity: 0; } 35% { opacity: 1; } to { transform: scale(.8); opacity: .4; } }
.display--giveaway { min-height: clamp(240px, 32vw, 380px); }

/* --- protocol --- */
.protocol { background: #fff; color: #17132e; border-radius: 18px; padding: 22px; font: 400 .95rem/1.45 var(--font-ui); }
.protocol__head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid #17132e; }
.protocol__mark { width: 38px; height: 38px; color: #6c47ff; flex: none; }
.protocol__title { margin: 0; font: 800 1.2rem/1.15 var(--font-display); letter-spacing: -.03em; }
.protocol__sub { margin: 2px 0 0; font-size: .82rem; color: #5d5878; }
.protocol dl { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.protocol dt { color: #5d5878; font-size: .88rem; }
.protocol dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.protocol__result { margin: 14px 0; padding: 14px; border-radius: 14px; background: #f3f1fd; }
.protocol__result h2, .protocol__result h3 { margin: 0 0 6px; font: 700 .76rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: #5d5878; }
.protocol__result p, .protocol__result ol { margin: 0; font: 800 1.15rem/1.4 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.protocol__result ol { padding-left: 1.5em; font: 700 1.02rem/1.5 var(--font-ui); letter-spacing: 0; }
.protocol__hash { font: 500 .74rem/1.45 var(--font-mono); color: #5d5878; word-break: break-all; }
.protocol__foot { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #e4e1f1; font-size: .8rem; color: #5d5878; }
.protocol__warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff4d6; color: #6b4a00; font-weight: 600; font-size: .9rem; }
.protocol__ok { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #dff7ec; color: #0b6b49; font-weight: 600; font-size: .9rem; }
.protocol-page { max-width: 760px; margin: 0 auto; }
.protocol-page .protocol { border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.protocol__result--soft { background: #faf9fe; }
.protocol__result--soft ol { font-weight: 600; }
.protocol-page__cta { margin: 26px 0 0; text-align: center; }
.protocol dd.protocol__hash { font-weight: 500; }
.checkbox { margin-top: 22px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.checkbox h2 { margin: 0; font: 700 1.2rem var(--font-display); letter-spacing: -.02em; }
.checkbox p { margin: 0; color: var(--ink-2); }

/* --- sub-page links --- */
.variants { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.variants__title { font: 700 .74rem/1.3 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.variants__list { display: flex; flex-wrap: wrap; gap: 6px; }
.variants .chip { text-decoration: none; }
.variants .chip.is-current { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* --- nicknames for one game: the rules line --- */
.rules { margin: 0; padding: 10px 13px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: .9rem; line-height: 1.4; font-weight: 600; }

/* --- dice: the die that does not count in an advantage roll --- */
.poly.is-dropped { opacity: .45; transform: scale(.82); }

/* --- colors --- */
.display--color { padding: 0 0 58px; min-height: clamp(220px, 32vw, 360px); background: var(--surface-3); color: var(--ink); }
.display--color::before, .display--color::after { display: none; }
.display--color .chipbtn { background: rgba(23, 19, 46, .78); color: #fff; }
.display--color .chipbtn:hover:not(:disabled) { background: rgba(23, 19, 46, .92); }
.stripes { flex: 1; display: flex; width: 100%; min-height: 160px; align-self: stretch; }
.stripes > .display__hint { margin: auto; }
.stripe { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 4px 16px; border: 0; cursor: pointer; font: 800 clamp(.8rem, 4.6cqw, 1.5rem)/1 var(--font-display); letter-spacing: -.02em; transition: flex .25s; }
.stripe:hover { flex: 1.25; }
.stripes--many .stripe { font-size: clamp(.6rem, 2.3cqw, .9rem); writing-mode: vertical-rl; padding: 0 0 14px; align-items: center; justify-content: flex-end; }
.stripe:only-child { align-items: center; padding-bottom: 0; font-size: clamp(1.8rem, 12cqw, 4.2rem); }
.display--color:fullscreen { padding-bottom: 0; }
.display--color:fullscreen .stripes { min-height: 100vh; }
.codes { display: grid; gap: 6px; }
.code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.code__dot { flex: none; width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px rgba(23, 19, 46, .12); }
.code__value { padding: 7px 9px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink-2); font: 500 .8rem/1 var(--font-mono); cursor: pointer; }
.code__value:hover { border-color: var(--accent); color: var(--accent-text); }
.strip--colors { gap: 6px; }
.dot { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(23, 19, 46, .12); transition: transform .12s; }
.dot:hover { transform: scale(1.15); }

/* --- one big answer with a picture: animal, country --- */
.display--fact .display__result { display: flex; flex-direction: column; justify-content: center; }
.fact { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.fact__pic { font: 400 clamp(3.4rem, 22cqw, 6.5rem)/1.05 var(--font-ui); text-shadow: none; }
.fact__name { font: 800 clamp(1.5rem, 9cqw, 3.2rem)/1.1 var(--font-display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.fact__note { font: 600 clamp(.95rem, 4cqw, 1.25rem)/1.3 var(--font-ui); letter-spacing: 0; opacity: .88; text-shadow: none; }
.flag { font-style: normal; }
.flag--code { display: inline-grid; place-items: center; min-width: 1.9em; padding: .12em .32em; border-radius: .32em; background: color-mix(in srgb, var(--on-accent) 22%, transparent); font: 800 .52em/1.3 var(--font-display); letter-spacing: .02em; vertical-align: middle; }
.pick__text .flag--code { font-size: .78em; }
.pick__text small { font-weight: 500; opacity: .8; }

/* --- truth or dare, random question --- */
.display--question { padding-top: 54px; min-height: clamp(240px, 32vw, 360px); }
.display--question[data-kind="dare"] { background: linear-gradient(140deg, var(--accent-2), var(--accent)); }
.question { max-width: 100%; font: 800 clamp(1.15rem, calc(190cqw / var(--len, 40) + .5rem), 2.5rem)/1.22 var(--font-display); letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 .04em 0 rgba(0, 0, 0, .12); }
.question .display__hint { font: 600 clamp(1rem, .9rem + 1.6cqw, 1.35rem)/1.3 var(--font-ui); letter-spacing: 0; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ------------------------------------------------------------------ 10. Article, FAQ, tiles */

.block { margin-top: 40px; }
.block__title { margin: 0 0 16px; font: 800 clamp(1.25rem, 1rem + 1.2vw, 1.75rem)/1.15 var(--font-display); letter-spacing: -.03em; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--accent) 38%, transparent);
}
.tile__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: 0 4px 0 var(--accent-deep);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.tile__icon .ic { width: 26px; height: 26px; }
.tile__icon--sm { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 3px 0 var(--accent-deep); }
.tile__icon--sm .ic { width: 22px; height: 22px; }
.tile__icon--xs { width: 30px; height: 30px; border-radius: 10px; box-shadow: 0 2px 0 var(--accent-deep); }
.tile__icon--xs .ic { width: 16px; height: 16px; }
.tile:hover .tile__icon, .mega__item:hover .tile__icon { transform: rotate(-8deg) scale(1.08); }
.tile__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile__text b { font: 700 1rem/1.25 var(--font-ui); }
.tile__text small { color: var(--ink-3); font-size: .86rem; line-height: 1.35; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; margin-top: 40px; }
.aside { position: sticky; top: 84px; display: grid; gap: 14px; }
@media (max-width: 1000px) {
  .article { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .aside { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

.trust { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1); }
.trust__item { display: flex; gap: 12px; padding: 10px; }
.trust__item > .ic { width: 22px; height: 22px; margin-top: 2px; color: var(--accent-text); }
.trust__item b { font-size: .96rem; }
.trust__item p { margin: 2px 0 0; color: var(--ink-3); font-size: .86rem; line-height: 1.45; }

.seealso { padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1); }
.seealso__title { margin-bottom: 8px; font: 700 .74rem var(--font-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.seealso ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.seealso a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none; }
.seealso a:hover { background: var(--accent-soft); color: var(--accent-text); }

.prose { max-width: 76ch; color: var(--ink-2); font-size: 1.05rem; line-height: 1.72; }
.prose > section:first-child > h2 { margin-top: 0; }
.prose h2 { margin: 2.1em 0 .65em; color: var(--ink); font: 800 clamp(1.25rem, 1.02rem + 1.1vw, 1.7rem)/1.18 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.prose h3 { margin: 1.5em 0 .35em; color: var(--ink); font: 700 1.14rem/1.3 var(--font-ui); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent-text); font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2.5px; }
.prose code { padding: .12em .42em; border-radius: 7px; background: var(--surface-3); color: var(--ink); font: 500 .9em var(--font-mono); overflow-wrap: anywhere; }
.prose .note { padding: 13px 16px; border-left: 4px solid var(--accent); border-radius: 4px 14px 14px 4px; background: var(--accent-soft); color: var(--ink); }
.prose--card { padding: clamp(18px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }

.table-wrap { margin: 0 0 1.2em; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.45; }
.prose th, .prose td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .86rem; letter-spacing: .02em; }
.prose tr:last-child td { border-bottom: 0; }

.steps { counter-reset: step; display: grid; gap: 8px; margin: 0 0 1.1em; padding: 0 !important; list-style: none; }
.steps li {
  counter-increment: step;
  position: relative;
  min-height: 58px;
  margin: 0;
  padding: 15px 16px 15px 62px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  line-height: 1.55;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--on-accent);
  font: 800 .92rem var(--font-display);
  box-shadow: 0 3px 0 var(--accent-deep);
}

.faq details { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-1); }
.faq summary { position: relative; padding: 16px 52px 16px 18px; color: var(--ink); font-weight: 700; line-height: 1.4; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 9px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c47ff' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 15px no-repeat;
  transition: transform .25s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__a { padding: 0 18px 4px; }

.contact { display: flex; align-items: center; gap: 14px; margin: 1.4em 0 0; padding: 16px; border-radius: 18px; background: var(--accent-soft); }
.contact span:last-child { display: flex; flex-direction: column; }
.contact small { color: var(--ink-3); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; }
.contact a { font: 700 1.15rem var(--font-ui); overflow-wrap: anywhere; }

.ad { margin: 26px auto 0; min-height: 100px; text-align: center; }

/* ------------------------------------------------------------------ 11. Footer, modal, toast */

.ftr { margin-top: auto; padding: 44px 0 26px; border-top: 1px solid var(--line); background: var(--surface); }
.ftr__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr) minmax(0, .9fr); gap: 32px 44px; }
.ftr__brand p { max-width: 38ch; margin: 14px 0 0; color: var(--ink-3); font-size: .92rem; line-height: 1.55; }
.ftr__title { margin-bottom: 12px; font: 700 .74rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ftr__title--gap { margin-top: 22px; }
.ftr__links { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.ftr__links--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px; }
.ftr__links--row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ftr__links a { color: var(--ink-2); font-size: .95rem; text-decoration: none; }
.ftr__links a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.ftr__bottom { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .86rem; }
@media (max-width: 820px) {
  .ftr__grid { grid-template-columns: minmax(0, 1fr); }
}

.modal {
  width: min(560px, 100% - 24px);
  max-height: min(86dvh, 760px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  overflow: auto;
}
.modal::backdrop { background: rgba(13, 11, 26, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal[open] { animation: modal .28s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes modal { from { transform: translateY(18px) scale(.94); opacity: 0; } }
.modal__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 22px; background: var(--surface); }
.modal__title { margin: 0; font: 800 1.2rem var(--font-display); letter-spacing: -.03em; }
.modal__body { padding: 30px 24px 24px; text-align: center; }
.modal__kicker { margin: 0 0 10px; font: 700 .78rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.modal__winner { margin: 0 0 24px; font: 800 clamp(1.8rem, 8vw, 3.2rem)/1.1 var(--font-display); letter-spacing: -.04em; color: var(--accent-text); overflow-wrap: anywhere; }
.modal__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.modal__acts .btn { flex: 1 1 150px; }
.modal__list { display: grid; gap: 8px; padding: 4px 16px 20px; }
.modal__pad { padding: 4px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal--wide { width: min(640px, 100% - 24px); }
.pickrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; }
.pickrow__main { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.pickrow__main b { display: block; font: 700 1rem/1.3 var(--font-ui); overflow-wrap: anywhere; }
.pickrow__main small { display: block; margin-top: 2px; color: var(--ink-3); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pickrow:hover { border-color: var(--accent); background: var(--accent-soft); }

.toasts { position: fixed; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 11px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .94rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: toast .3s cubic-bezier(.34, 1.4, .64, 1); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast { from { transform: translateY(16px) scale(.92); opacity: 0; } }

.confetti { position: fixed; inset: 0; z-index: 300; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; pointer-events: none; }

/* ------------------------------------------------------------------ 12. Print and motion */

#print-root { display: none; }
@media print {
  body.is-printing > *:not(#print-root) { display: none !important; }
  body.is-printing { background: #fff; }
  body.is-printing::before { display: none; }
  body.is-printing #print-root { display: block; padding: 0; }
  body.is-printing .protocol { border: 1px solid #ccc; border-radius: 0; }
  .hdr, .ftr, .suggest, .toasts { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
