@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-latin-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #15131c;
  --muted: #6f6a80;
  --line: #e7e4ee;
  --red: #e5383b;
  --red-deep: #b5191c;
  --red-tint: rgba(229, 56, 59, 0.06);
  --red-tint-strong: rgba(229, 56, 59, 0.12);
  --blue: #2f6fed;
  --blue-deep: #1a4fbd;
  --blue-tint: rgba(47, 111, 237, 0.06);
  --blue-tint-strong: rgba(47, 111, 237, 0.12);
  --gold: #f5b301;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.45;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
kbd {
  font: inherit;
  font-size: .85em;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #faf9fc;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter) 6px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brand img { flex: none; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.brand__tagline { color: var(--muted); font-size: .8rem; }
.topbar__right { display: flex; align-items: center; gap: 12px; flex: none; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 500;
}
.connection__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d39a00;
  animation: pulse 1.2s ease-in-out infinite;
}
.connection[data-state="live"] .connection__dot { background: #1f9d55; box-shadow: 0 0 0 3px rgba(31, 157, 85, .15); animation: none; }
.connection[data-state="offline"] .connection__dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.account-button {
  min-height: 38px;
  padding: 6px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  font-weight: 600;
  font-size: .9rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.account-button:hover { background: var(--ink); color: var(--bg); }
.account-button[data-state="signed-in"] { border-color: var(--line); }
.account-button[data-state="signed-in"]::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ab8fff;
  vertical-align: 1px;
}

/* ---------- Scoreboard ---------- */
.score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "red middle blue"
    "bar bar bar"
    "status status status";
  align-items: end;
  gap: 6px 16px;
  padding: 8px var(--gutter) 10px;
}
.score__team { display: flex; flex-direction: column; min-width: 0; }
.score__team--red { grid-area: red; align-items: flex-start; }
.score__team--blue { grid-area: blue; align-items: flex-end; text-align: right; }
.score__name { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.score__team--red .score__name, .score__team--red .score__pct { color: var(--red); }
.score__team--blue .score__name, .score__team--blue .score__pct { color: var(--blue); }
.score__pct {
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.score__meta { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.score__middle {
  grid-area: middle;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding-bottom: 4px;
  text-align: center;
  color: var(--muted);
  font-size: .8125rem;
}
.score__round { color: var(--ink); font-weight: 700; font-size: .95rem; }

.bar {
  grid-area: bar;
  position: relative;
  height: 14px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue);
}
.bar__red {
  width: 50%;
  height: 100%;
  background: var(--red);
  transition: width .45s var(--ease);
}
.bar__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, .85);
}
.bar__tick--red { left: 95%; }
.bar__tick--mid { left: 50%; background: rgba(255, 255, 255, .55); }
.bar__tick--blue { left: 5%; }
.score__status {
  grid-area: status;
  text-align: center;
  font-size: .9rem;
  font-weight: 600;
}
.score__status[data-team="red"] { color: var(--red-deep); }
.score__status[data-team="blue"] { color: var(--blue-deep); }

/* ---------- Arena ---------- */
.arena {
  --rope-y: 44%;
  --fig-h: 96px;
  --fig-w: 58px;
  position: relative;
  flex: 1 1 auto;
  min-height: 340px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  touch-action: manipulation;
  cursor: default;
  outline: none;
  transition: background-color .2s;
}
.half--red { left: 0; background: var(--red-tint); }
.half--blue { right: 0; background: var(--blue-tint); }
.half:focus-visible { box-shadow: inset 0 0 0 3px var(--ink); }
.half--mine { cursor: pointer; }
.half--red.half--mine:hover, .half--red.half--mine:active { background: var(--red-tint-strong); }
.half--blue.half--mine:hover, .half--blue.half--mine:active { background: var(--blue-tint-strong); }

.half__label {
  position: absolute;
  bottom: -0.12em;
  font-size: clamp(4rem, 14vw, 11rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  opacity: .07;
  pointer-events: none;
}
.half--red .half__label { left: 12px; color: var(--red); }
.half--blue .half__label { right: 12px; color: var(--blue); }

.half__hint {
  display: none;
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .5;
  pointer-events: none;
}
.half--mine .half__hint { display: block; }
.half--red .half__hint { color: var(--red-deep); }
.half--blue .half__hint { color: var(--blue-deep); }
.half.is-straining { animation: strain .25s; }
@keyframes strain {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 3px dashed rgba(21, 19, 28, .22);
  transform: translateX(-50%);
  pointer-events: none;
}
.ground {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--rope-y) + var(--fig-h) * .52);
  height: 2px;
  background: rgba(21, 19, 28, .12);
  pointer-events: none;
}
.win-line {
  position: absolute;
  top: calc(var(--rope-y) - var(--fig-h) * .9);
  height: calc(var(--fig-h) * 1.42);
  border-left: 2px dashed;
  pointer-events: none;
}
.win-line span {
  position: absolute;
  bottom: 100%;
  left: 0;
  transform: translate(-50%, -4px);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.win-line--red { left: 34%; color: var(--red); border-color: rgba(229, 56, 59, .5); }
.win-line--blue { left: 66%; color: var(--blue); border-color: rgba(47, 111, 237, .5); }

/* The rope, the ribbon and everyone holding it slide together. --shift is set by stage.js. */
.rig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translateX(calc(var(--shift, 0) * 1%));
  transition: transform .55s var(--ease);
}
.rope {
  position: absolute;
  left: -40%;
  right: -40%;
  top: calc(var(--rope-y) - 4px);
  height: 8px;
  border-radius: 4px;
  background: repeating-linear-gradient(115deg, #d2a464 0 6px, #a97a3c 6px 10px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.rig.is-tugged-red .rope { animation: rope-red .3s var(--ease); }
.rig.is-tugged-blue .rope { animation: rope-blue .3s var(--ease); }
@keyframes rope-red { 40% { transform: translateX(-5px); } }
@keyframes rope-blue { 40% { transform: translateX(5px); } }

.ribbon {
  position: absolute;
  left: 50%;
  top: calc(var(--rope-y) - 7px);
  z-index: 50;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
}
.ribbon span {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 16px;
  height: 30px;
  margin-left: -8px;
  background: var(--gold);
  border: 2.5px solid var(--ink);
  border-top: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
  transform-origin: top center;
  animation: flutter 2.4s ease-in-out infinite;
}
@keyframes flutter { 50% { transform: rotate(6deg); } }

.crew { position: absolute; inset: 0; }
.fig {
  --fig-ink: #1b1a22;
  position: absolute;
  top: calc(var(--rope-y) - var(--fig-h) * .48);
  width: var(--fig-w);
  height: var(--fig-h);
  transform: translateX(-50%);
  transition: left .5s var(--ease);
}
.fig--red { --head: var(--red); }
.fig--blue { --head: var(--blue); }
.fig__pose { width: 100%; height: 100%; transform-origin: 50% 95%; transition: opacity .3s; }
.fig__body { display: block; width: 100%; height: 100%; overflow: visible; }
.fig--blue .fig__body { transform: scaleX(-1); }
.fig--idle .fig__pose { opacity: .38; }
.fig--self .fig__body { filter: drop-shadow(0 0 5px rgba(245, 179, 1, .9)); }
.fig--enter { animation: fig-in .45s var(--ease); }
@keyframes fig-in { from { opacity: 0; translate: 0 -14px; } }

.crew--red.is-tugging .fig__pose { animation: tug-red .34s var(--ease) calc(var(--i, 0) * 16ms) both; }
.crew--blue.is-tugging .fig__pose { animation: tug-blue .34s var(--ease) calc(var(--i, 0) * 16ms) both; }
@keyframes tug-red { 40% { transform: translateX(-5px) rotate(-7deg); } }
@keyframes tug-blue { 40% { transform: translateX(5px) rotate(7deg); } }
.crew--red.is-tugging.is-mega .fig__pose { animation: mega-red .7s var(--ease) calc(var(--i, 0) * 22ms) both; }
.crew--blue.is-tugging.is-mega .fig__pose { animation: mega-blue .7s var(--ease) calc(var(--i, 0) * 22ms) both; }
@keyframes mega-red { 30% { transform: translateX(-14px) rotate(-18deg); } 60% { transform: translateX(-8px) rotate(-10deg); } }
@keyframes mega-blue { 30% { transform: translateX(14px) rotate(18deg); } 60% { transform: translateX(8px) rotate(10deg); } }
.arena.is-shaking { animation: shake .45s; }
@keyframes shake {
  15% { transform: translate(-4px, 2px); }
  30% { transform: translate(4px, -2px); }
  45% { transform: translate(-3px, -1px); }
  60% { transform: translate(3px, 1px); }
  80% { transform: translate(-1px, 0); }
}

/* The ring that fills while you hold for a mega pull. stage.js sets --progress from 0 to 1. */
.charge {
  position: absolute;
  z-index: 70;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  pointer-events: none;
}
.charge svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.charge circle { fill: none; stroke-width: 5; }
.charge__track { stroke: rgba(21, 19, 28, .12); }
.charge__fill {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--progress, 0) * 100);
}
.charge[data-team="red"] .charge__fill { stroke: var(--red); }
.charge[data-team="blue"] .charge__fill { stroke: var(--blue); }
.charge span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  opacity: calc(.3 + var(--progress, 0) * .7);
}

.fig__tag {
  position: absolute;
  top: 100%;
  left: 50%;
  max-width: 130px;
  overflow: hidden;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: #3b3848;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: translate(-50%, calc(var(--level, 0) * 21px + 6px));
}
.fig--named.fig--red .fig__tag { border-color: rgba(229, 56, 59, .45); color: var(--red-deep); }
.fig--named.fig--blue .fig__tag { border-color: rgba(47, 111, 237, .45); color: var(--blue-deep); }
.fig--self .fig__tag { border-color: var(--ink); background: var(--ink); color: #fff; }
.fig--idle .fig__tag { opacity: .6; }
.fig--tagless .fig__tag { display: none; }
.crew__more {
  position: absolute;
  top: calc(var(--rope-y) - 13px);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
}

.floater {
  position: absolute;
  z-index: 60;
  font-weight: 700;
  font-size: 1.3rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: float-up .9s var(--ease) forwards;
}
.floater--mega {
  z-index: 61;
  font-size: 2rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-shadow: 0 2px 0 var(--gold);
  animation-duration: 1.4s;
}
.floater--red { color: var(--red); }
.floater--blue { color: var(--blue); }
@keyframes float-up {
  to { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -260%) scale(1.15); }
}

/* ---------- Dock and footer ---------- */
.dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 76px;
  padding: 12px var(--gutter) 6px;
  text-align: center;
}
.dock__join { font-weight: 600; }
.dock__play { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; }
.dock__team[data-team="red"] { color: var(--red); }
.dock__team[data-team="blue"] { color: var(--blue); }
.dock__count { color: var(--muted); font-size: .9rem; }
.dock__count:empty { display: none; }
.dock__mega {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(245, 179, 1, .16);
  color: #8a6200;
  font-size: .85rem;
  font-weight: 700;
}
.dock__mega[data-ready="false"] { background: #f1eff6; color: var(--muted); font-weight: 600; }
.dock__save { color: var(--muted); font-size: .85rem; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px var(--gutter) max(16px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.wordmark { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.wordmark span { color: #8b86a3; }
.wordmark:hover { text-decoration: underline; }

/* ---------- A win ---------- */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in .3s ease;
}
.celebrate[data-team="red"] { --team: var(--red); --team-deep: var(--red-deep); }
.celebrate[data-team="blue"] { --team: var(--blue); --team-deep: var(--blue-deep); }
.celebrate__card {
  position: relative;
  z-index: 1;
  max-width: 420px;
  padding: 26px 30px;
  border-radius: 28px;
  background: var(--team);
  box-shadow: 0 8px 0 var(--team-deep), 0 30px 60px rgba(21, 19, 28, .25);
  color: #fff;
  text-align: center;
  animation: pop .5s cubic-bezier(.18, 1.35, .32, 1);
}
.celebrate__kicker { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.celebrate__title { margin-top: 4px; font-size: clamp(2rem, 7vw, 2.75rem); line-height: 1.05; letter-spacing: -0.04em; }
.celebrate__text { margin-top: 10px; font-weight: 500; }
.celebrate__confetti { position: absolute; inset: 0; pointer-events: none; }
.celebrate__confetti i {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: fall var(--fall, 3s) linear var(--delay, 0s) forwards;
}
.celebrate__confetti .bit--team { background: var(--team); }
.celebrate__confetti .bit--gold { background: var(--gold); }
@keyframes fall { to { transform: translateY(110vh) rotate(var(--spin, 360deg)); } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(21, 19, 28, .2);
  animation: toast-in .3s var(--ease);
  transition: opacity .35s, transform .35s;
  overflow-wrap: anywhere;
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.toast--red::before { background: var(--red); }
.toast--blue::before { background: var(--blue); }
.toast--leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Account welcome pill (same as Simple Soundboard and BasketSmash) ---------- */
.welcome-pill {
  position: fixed;
  top: max(22px, env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 13px 19px 13px 13px;
  border-radius: 24px;
  background: rgba(29, 25, 43, 0.97);
  border: 1px solid rgba(205, 185, 245, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.4;
  color: #f8f5ff;
  opacity: 0;
  transform: translate(-50%, -90px) scale(0.88);
  filter: blur(5px);
  transition: transform 0.6s cubic-bezier(0.18, 1.35, 0.32, 1), opacity 0.4s ease, filter 0.4s ease;
  pointer-events: none;
}

.welcome-pill.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  filter: blur(0);
}

.welcome-pill.leaving {
  opacity: 0;
  transform: translate(-50%, -35px) scale(0.95);
  filter: blur(3px);
  transition: transform 0.4s ease-in, opacity 0.4s ease-in, filter 0.4s ease-in;
}

.welcome-pill .brand-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
}

.welcome-pill .pill-content { min-width: 0; }

.welcome-pill .brand-name {
  color: #bcaed7;
  font-size: 11px;
  letter-spacing: -0.2px;
  font-weight: 700;
}

.welcome-pill .message {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.3px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.welcome-pill .login-confirmation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: #b9b0cb;
  font-size: 11px;
  font-weight: 450;
  line-height: 1.4;
}

.welcome-pill .login-confirmation svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #cdbaf1;
}

.welcome-pill .check {
  color: #d1bafa;
  font-size: 17px;
  margin-left: 4px;
  margin-top: 7px;
  flex-shrink: 0;
}

/* ---------- Sign-in dialog ---------- */
.signin-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  color: var(--ink);
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(21, 19, 28, .25);
}
.signin-dialog::backdrop { background: rgba(21, 19, 28, .45); }
.signin-panel { padding: 22px; }
.signin-brand { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .875rem; font-weight: 600; }
.signin-brand img { width: 26px; height: 26px; object-fit: contain; }
.signin-panel h2 { margin-top: 14px; font-size: 1.55rem; font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; }
.signin-panel p { margin-top: 8px; color: #4d4860; }
.signin-waiting { display: flex; align-items: center; gap: 9px; font-size: .875rem; }
.signin-waiting span {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #ab8fff;
  box-shadow: 0 0 9px #ab8fff;
  animation: pulse 1.1s ease-in-out infinite;
}
.signin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.signin-button {
  min-height: 44px;
  margin-bottom: 4px;
  padding: 8px 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 4px 0 #4a4560;
  font-weight: 600;
  transition: transform .08s, box-shadow .08s, background .12s;
}
.signin-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a4560; }
.signin-button--quiet { color: var(--ink); background: #f1eff6; box-shadow: 0 4px 0 #d9d5e4; }
.signin-button--quiet:hover { background: #e8e5f0; }
.signin-button--quiet:active { box-shadow: 0 1px 0 #d9d5e4; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .brand__tagline { display: none; }
  .connection span:last-child { display: none; }
  .score {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "red blue"
      "bar bar"
      "status status"
      "middle middle";
  }
  .score__middle { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px 10px; padding: 0; }
  .arena { --fig-h: 72px; --fig-w: 43px; min-height: 320px; }
  .fig__tag { max-width: 92px; font-size: .66rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rig, .bar__red, .fig { transition: none; }
  .ribbon span, .connection__dot, .signin-waiting span { animation: none; }
  .crew--red.is-tugging .fig__pose, .crew--blue.is-tugging .fig__pose,
  .crew--red.is-tugging.is-mega .fig__pose, .crew--blue.is-tugging.is-mega .fig__pose,
  .rig.is-tugged-red .rope, .rig.is-tugged-blue .rope, .fig--enter, .half.is-straining,
  .arena.is-shaking { animation: none; }
  .floater { animation-duration: .01s; }
  .welcome-pill,
  .welcome-pill.visible,
  .welcome-pill.leaving {
    transition: none;
    filter: none;
    transform: translate(-50%, 0);
  }
}
