/* What do we bet? — mid-century Swiss.
   One grotesk, a navy/cream base, and flat blocks of orange, teal, mauve and
   mustard. Each block sets its own --ground and --ink, so components inside
   just use those and work on any colour. Mobile-first, no framework. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Fixed inks: the same in light and dark. */
  --navy: #14233a;
  --cream: #f4eee4;
  --orange: #ee5a2a;
  --teal: #3cb8c6;
  --mauve: #c77fb3;
  --mustard: #eaa938;
  --sage: #93b47e;
  --salmon: #e8907f;

  /* Surfaces: these change in dark mode. */
  --paper: #f4eee4;
  --sheet: #fffbf5;
  --block: #14233a;
  --sand: #e3d8c5;
  --footer: #14233a;

  /* Context: what a component is sitting on. */
  --ground: var(--paper);
  --ink: #14233a;
  --soft: #5e6675;

  --danger: #c2321a;
  --tap: 48px;
  --font: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  font-kerning: normal;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

::selection {
  background: var(--mustard);
  color: var(--navy);
}

p {
  margin: 0;
}

/* ---------- surfaces
   Blocks re-declare the context so everything inside adapts. */

.card {
  --ground: var(--sheet);
  background: var(--ground);
  color: var(--ink);
  padding: 22px 18px 24px;
}

/* The new-bet and join forms: the big navy block. */
form.card {
  --ground: var(--block);
  --ink: var(--cream);
  --soft: #b4bcc9;
}

.card.invite,
.banner.success,
.badge-same {
  --ground: var(--teal);
}

.keycard,
.banner.outcome,
.badge-close {
  --ground: var(--mustard);
}

.keycard-prominent,
.banner.outcome-failed {
  --ground: var(--orange);
}

.result-share {
  --ground: var(--mauve);
}

.banner.outcome-called_off {
  --ground: var(--sand);
}

.card.invite,
.keycard,
.result-share,
.banner,
.badge-same,
.badge-close {
  --ink: var(--navy);
  --soft: rgb(20 35 58 / 78%);
}

/* ---------- page frame */

.topbar {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) 14px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.brand .accent {
  color: inherit;
}

.logo {
  color: var(--orange);
  flex: none;
}

.wrap {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 16px 48px;
}

.wrap > * + * {
  margin-top: 24px;
}

.stack > * + * {
  margin-top: 16px;
}

.center {
  text-align: center;
}

.foot {
  --ground: var(--footer);
  --ink: var(--cream);
  --soft: #aab3c1;
  background: var(--ground);
  color: var(--soft);
  padding: 28px max(16px, calc((100% - 528px) / 2)) calc(32px + env(safe-area-inset-bottom));
  font-size: 0.88rem;
  line-height: 1.6;
}

.foot a {
  color: var(--ink);
}

.foot-links,
.langs {
  margin-top: 12px;
}

.langs a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--soft);
  text-decoration: none;
}

.langs a[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
}

/* ---------- type */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--soft);
}

label,
legend,
.label {
  display: block;
  padding: 0;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

.muted {
  color: var(--soft);
}

.small {
  font-size: 0.875rem;
}

.hint {
  color: var(--soft);
  font-size: 0.9rem;
}

.accent {
  color: var(--orange);
}

.big-emoji {
  font-size: 3rem;
  line-height: 1;
}

/* Small label with a dot, used above the bet question. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.95rem;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--orange);
}

/* ---------- home hero */

/* The headline is sized to its own column (cqi), so the longest word always
   fits: "apostamos…?" in Spanish is ~6.7em wide, "What do we" ~4.6em. */
.hero {
  container-type: inline-size;
}

.hero h1 {
  font-size: min(6.4rem, 19cqi);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

:lang(es) .hero h1 {
  font-size: min(6.4rem, 14cqi);
}

.lede {
  margin-top: 20px;
  font-size: 1.2rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 32ch;
}

/* Mid-century shapes: circle, half moon, square, quarter, target. */
.motif {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 26px;
  max-width: 340px;
}

.motif i {
  aspect-ratio: 1;
  background: var(--orange);
  border-radius: 50%;
}

.motif i:nth-child(2) {
  background: var(--teal);
  border-radius: 100% 100% 0 0 / 100% 100% 0 0;
  aspect-ratio: 2 / 1;
  align-self: end;
}

.motif i:nth-child(3) {
  background: var(--mauve);
  border-radius: 0;
}

.motif i:nth-child(4) {
  background: var(--mustard);
  border-radius: 100% 0 0 0;
}

.motif i:nth-child(5) {
  background: radial-gradient(circle, var(--orange) 0 28%, var(--ink) 29%);
}

/* ---------- the bet question */

.question {
  font-size: clamp(2.1rem, 9.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--orange);
  overflow-wrap: anywhere;
}

.question .q {
  color: var(--ink);
}

.section-title {
  font-size: 2rem;
  letter-spacing: -0.04em;
}

/* ---------- how it works */

.how h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
}

.how .steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.how .steps li {
  --ink: var(--navy);
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 18px 18px;
  background: var(--mauve);
  color: var(--ink);
}

.how .steps li:nth-child(2) {
  background: var(--teal);
}

.how .steps li:nth-child(3) {
  background: var(--mustard);
}

.how .steps strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.step-num {
  flex: none;
  min-width: 0.6em;
  font-size: 4rem;
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.75;
}

/* ---------- forms */

.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field > * + * {
  margin-top: 8px;
}

/* Numbered fields in the new-bet and join forms: 01, 02… */
form.card {
  counter-reset: field;
}

form.card > .field {
  counter-increment: field;
}

form.card > .field > label::before,
form.card > .field > legend::before {
  content: counter(field, decimal-leading-zero);
  display: inline-block;
  min-width: 2.2em;
  font-weight: 400;
  color: var(--orange);
}

/* A floated legend sits inside the fieldset instead of on its top border. */
fieldset.field > legend {
  float: left;
  width: 100%;
  margin-bottom: 8px;
}

fieldset.field > legend + * {
  clear: both;
  margin-top: 0;
}

form.card > .field + .field {
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
}

input[type="text"],
input[type="number"],
textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 12px 10px;
  font: inherit;
  /* 16px+ stops iOS zooming on focus */
  font-size: max(16px, 1rem);
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  transition: border-color 0.12s, background 0.12s;
}

::placeholder {
  color: var(--ink);
  opacity: 0.5;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--orange);
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-bottom-color: var(--danger);
  border-bottom-width: 3px;
}

form.card input[aria-invalid="true"],
form.card textarea[aria-invalid="true"] {
  border-bottom-color: var(--salmon);
}

input.narrow {
  max-width: 120px;
}

.prefixed {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border-bottom: 2px solid var(--ink);
  padding: 12px 12px 2px;
}

.prefixed:focus-within {
  border-bottom-color: var(--orange);
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}

.prefixed .prefix {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--orange);
}

.prefixed textarea,
.prefixed textarea:focus {
  background: transparent;
  border: 0;
  padding: 4px 0 10px;
  min-height: 0;
  font-size: max(16px, 1.1rem);
}

.stakes {
  list-style: none;
  counter-reset: stake;
  margin: 12px 0 0;
  padding: 0;
}

.stakes li {
  counter-increment: stake;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stakes li + li {
  margin-top: 8px;
}

.stakes li::before {
  content: counter(stake);
  flex: 0 0 26px;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  text-align: right;
  color: var(--soft);
}

.field-error {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--danger);
}

form.card .field-error {
  color: var(--salmon);
}

.alert {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--navy);
  background: var(--salmon);
}

/* ---------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.btn:hover {
  background: var(--ink);
  color: var(--ground);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--navy);
}

.btn.primary:hover {
  background: var(--mustard);
  border-color: var(--mustard);
  color: var(--navy);
}

/* On orange or colour blocks the primary button turns navy. */
.keycard .btn.primary,
.result-share .btn.primary,
.banner .btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--cream);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.btn.ghost:hover {
  background: transparent;
  color: var(--ink);
  text-decoration-thickness: 3px;
}

.btn.block {
  display: flex;
  width: 100%;
}

.btn.big {
  min-height: 60px;
  font-size: 1.15rem;
}

.btn.small {
  min-height: 42px;
  padding: 6px 14px;
  font-size: 0.92rem;
}

.btn.busy {
  opacity: 0.6;
  pointer-events: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row .btn {
  flex: 1 1 0;
  white-space: nowrap;
}

/* ---------- copy field */

.copy-row {
  display: flex;
  margin-top: 8px;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.copy-row .btn {
  min-height: var(--tap);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.copy-row .btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--navy);
}

.keycard-prominent .copy-row .btn:hover {
  background: var(--mustard);
  border-color: var(--mustard);
}

.copy-field > .btn.block {
  margin-top: 10px;
}

.copy-field .hint {
  margin-top: 8px;
}

/* ---------- progress */

.progress progress {
  display: block;
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}

.progress progress::-webkit-progress-bar {
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}

.progress progress::-webkit-progress-value {
  background: var(--orange);
}

.progress progress::-moz-progress-bar {
  background: var(--orange);
}

.progress-text {
  margin-top: 12px;
}

/* "1 of 3" as a big light figure. */
.progress-text strong {
  display: block;
  font-size: 3.4rem;
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.9;
  margin-bottom: 4px;
}

/* ---------- people */

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.pill {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
}

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  font-weight: 800;
  line-height: 1;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 1.15rem;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
}

.av-0 { background: var(--orange); }
.av-1 { background: var(--teal); }
.av-2 { background: var(--mauve); }
.av-3 { background: var(--mustard); }
.av-4 { background: var(--sage); }
.av-5 { background: var(--salmon); }

/* ---------- banners */

.banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  background: var(--ground);
  color: var(--ink);
}

.banner strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* ---------- sides: will the creator do it or not? */

.sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.side-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background 0.12s;
}

.side-option input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--navy);
}

.side-option:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.side-option:focus-within {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.side-option:has(input:checked) {
  --ink: var(--navy);
  color: var(--navy);
  border-color: var(--navy);
}

.side-for:has(input:checked) {
  background: var(--teal);
}

.side-against:has(input:checked) {
  background: var(--orange);
}

.side-emoji {
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
}

.your-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border-left: 6px solid var(--teal);
  overflow-wrap: anywhere;
}

.your-side.side-against {
  border-left-color: var(--orange);
}

.your-side .label {
  font-size: 0.8rem;
  color: var(--soft);
}

/* ---------- who pays whom */

.scenario-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scenario {
  padding: 12px 0 12px 14px;
  border-left: 6px solid var(--teal);
  overflow-wrap: anywhere;
}

.scenario + .scenario {
  margin-top: 10px;
}

.scenario-failed {
  border-left-color: var(--orange);
}

.scenario-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.scenario-head strong {
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}

.scenario p {
  margin-top: 4px;
}

.verdict {
  flex: none;
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
  color: var(--navy);
}

.verdict-win {
  background: var(--sage);
}

.verdict-pay {
  background: var(--salmon);
}

.banner .verdict {
  margin-top: 6px;
  background: var(--navy);
  color: var(--cream);
}

/* ---------- reveal */

.matches,
.teasers,
.my-stakes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.matches li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
}

.matches li:first-child {
  border-top: 0;
  padding-top: 0;
}

.match-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.match-pair .arrow {
  color: var(--orange);
}

.badge {
  align-self: flex-start;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink);
}

.badge-vibe {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--soft);
}

.teasers li,
.my-stakes li {
  padding: 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.teasers li:first-child,
.my-stakes li:first-child {
  border-top: 0;
  padding-top: 0;
}

.my-stakes {
  counter-reset: mine;
}

.my-stakes li {
  counter-increment: mine;
  display: flex;
  gap: 14px;
}

.my-stakes li::before {
  flex: none;
  content: counter(mine, decimal-leading-zero);
  font-weight: 400;
  color: var(--orange);
}

.seal {
  font-size: 0.8rem;
  color: var(--soft);
}

.seal code {
  font-family: var(--mono);
}

details.card summary {
  cursor: pointer;
  min-height: 28px;
  font-size: 1.05rem;
}

details.card summary::marker {
  color: var(--orange);
}

details.card[open] summary {
  margin-bottom: 14px;
}

details.card .seal {
  margin-top: 12px;
}

/* ---------- waiting */

.empty {
  padding: 4px 0;
}

.empty > * + * {
  margin-top: 4px;
}

.empty-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 10px;
}

.waiting-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.pulse {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- private link ("key") */

.keycard-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.keycard-head > div > * + * {
  margin-top: 6px;
}

.keycard-icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  border-radius: 50%;
  background: var(--navy);
}

.keycard-prominent h2 {
  font-size: 1.7rem;
  letter-spacing: -0.035em;
}

.savebar {
  --ground: var(--navy);
  --ink: var(--cream);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) 16px;
  background: var(--ground);
  color: var(--ink);
  border-top: 6px solid var(--orange);
  animation: rise 0.25s ease-out;
}

.savebar p {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

body.has-savebar {
  padding-bottom: 80px;
}

@keyframes rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ---------- your bets on this device */

.mybets {
  margin-top: 36px;
}

.mybets h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
}

.mybets-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  border-bottom: 2px solid var(--ink);
}

.mybet {
  display: flex;
  align-items: stretch;
  border-top: 2px solid var(--ink);
}

.mybet-link {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px 4px 10px 0;
  color: var(--ink);
  text-decoration: none;
}

.mybet-link:hover .mybet-question {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
}

.mybet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.82rem;
  color: var(--soft);
}

.mybet-role {
  font-weight: 700;
  color: var(--orange);
}

.mybet-question {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.mybet-remove {
  flex: none;
  width: var(--tap);
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}

.mybet-remove:hover {
  color: var(--navy);
  background: var(--orange);
}

/* ---------- share the result */

.share-preview {
  margin: 0;
  padding: 14px 16px;
  background: var(--cream);
  color: var(--navy);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.share-url {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 400;
  color: #5e6675;
}

/* ---------- privacy & terms */

.legal {
  counter-reset: legal;
}

.legal h1 {
  font-size: clamp(2.8rem, 13vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.legal header p {
  margin-top: 12px;
}

.legal .lede {
  max-width: none;
}

.legal section {
  counter-increment: legal;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

.legal section h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.legal section h2::before {
  content: counter(legal, decimal-leading-zero);
  display: inline-block;
  min-width: 2.2em;
  font-weight: 400;
  color: var(--orange);
}

.legal section p + p {
  margin-top: 8px;
}

.legal-contact {
  padding: 16px 18px;
  background: var(--mustard);
  color: var(--navy);
  overflow-wrap: anywhere;
}

/* ---------- layout helpers */

.split > * + * {
  margin-top: 32px;
}

.board > * + * {
  margin-top: 16px;
}

.board-side:empty {
  display: none;
}

@media (min-width: 600px) {
  .card {
    padding: 28px 26px 30px;
  }
}

/* ---------- desktop
   Phones keep the single 560px column above. From 900px: home and join split
   into intro + form, the bet page into main + sidebar. */

@media (min-width: 900px) {
  body {
    font-size: 18px;
  }

  .topbar,
  .wrap {
    max-width: 1200px;
    padding-left: 48px;
    padding-right: 48px;
  }

  .topbar {
    padding-top: 24px;
    padding-bottom: 18px;
    border-bottom: 0;
  }

  /* A rule from the brand to the right edge. */
  .topbar::after {
    content: "";
    flex: 1;
    height: 2px;
    margin-left: 24px;
    background: var(--ink);
  }

  .brand {
    font-size: 1.25rem;
  }

  .wrap {
    padding-top: 28px;
    padding-bottom: 88px;
  }

  .wrap > * + * {
    margin-top: 36px;
  }

  .wrap-narrow {
    max-width: 760px;
  }

  .foot {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 32px;
    align-items: baseline;
    padding: 40px max(48px, calc((100% - 1104px) / 2)) 48px;
  }

  .foot-links,
  .langs {
    margin-top: 0;
  }

  .card {
    padding: 34px 34px 36px;
  }

  .stack > * + * {
    margin-top: 20px;
  }

  /* Intro left, form right. */
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    grid-template-areas:
      "intro main"
      "aside main";
    grid-template-rows: auto 1fr;
    column-gap: 64px;
    row-gap: 56px;
    align-items: start;
  }

  .split > * + * {
    margin-top: 0;
  }

  .split-intro {
    grid-area: intro;
    padding-top: 8px;
  }

  .split-main {
    grid-area: main;
  }

  .split-aside {
    grid-area: aside;
  }

  .motif {
    margin-top: 36px;
    max-width: 420px;
    gap: 8px;
  }

  .lede {
    margin-top: 32px;
    font-size: 1.35rem;
  }

  /* The heading runs up the side of the three tiles. */
  .how {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
  }

  .how h2 {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: right;
  }

  .how .steps {
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .how .steps li {
    flex-direction: column;
    gap: 22px;
    min-height: 230px;
    padding: 18px 18px 20px;
  }

  .step-num {
    font-size: 5.5rem;
  }

  .question {
    font-size: clamp(3rem, 5vw, 4.6rem);
    max-width: 18ch;
  }

  .split .question {
    max-width: none;
    font-size: clamp(2.6rem, 4vw, 3.8rem);
  }

  .board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    column-gap: 40px;
    align-items: start;
  }

  .board > * + * {
    margin-top: 0;
  }

  .board:has(> .board-side:empty) {
    grid-template-columns: minmax(0, 760px);
  }

  .board-side .card {
    padding: 26px;
  }

  /* The private link already sits in the sidebar on desktop. */
  .savebar {
    display: none;
  }

  body.has-savebar {
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- dark: the same poster at night
   Navy is already the base ink, so the page simply turns navy. The coloured
   blocks keep their exact inks and navy text; only paper and sheets change. */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a2b;
    --sheet: #18263b;
    --block: #213452;
    --sand: #c9bea9;
    --footer: #0a1220;
    --ink: #efe8dc;
    --soft: #a2abba;
    --danger: #ff8a73;
    color-scheme: dark;
  }
}

/* Pair heading: avatar | name (wraps) | match count. A grid keeps long
   names next to the avatar instead of dropping onto their own line. */
.pair h3 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.pair h3 .pill {
  margin-left: 0;
  white-space: nowrap;
}
