/* =========================================================
   Asaqwerty: cosmic hub
   Colors are checked for WCAG 2.2 AA contrast (see README).
   All motion stops under .motion-off (set from the Pause
   button or the OS "reduce motion" setting).
   ========================================================= */

:root {
  --bg: #070616;
  --bg-2: #120d36;
  --surface: #17124a;
  --surface-2: #211a63;
  --surface-border: #6c62d8;
  --text: #f5f3ff;
  --muted: #d4cdfa;
  --cyan: #67e8f9;
  --pink: #ff8ad8;
  --yellow: #ffd23f;
  --purple: #b9a4ff;
  --ink: #1b1240;           /* dark text on bright fills */
  --focus: #ffd23f;
  --danger: #ff6b8b;

  --font-display: "Orbitron", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 0 1px rgba(185, 164, 255, 0.25), 0 10px 40px rgba(124, 58, 237, 0.35);
  --max: 1120px;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 140px; scroll-padding-bottom: 96px; }
[hidden] { display: none !important; }
html.motion-off { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -20%, #2a1a6e 0%, var(--bg-2) 35%, var(--bg) 75%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; }

a { color: var(--cyan); text-underline-offset: 0.2em; }
a:hover { color: #a5f3fc; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
}
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); color: var(--yellow); }
h3 { font-size: 1.15rem; color: var(--cyan); }
h4 { font-size: 1rem; color: var(--purple); }

p { margin: 0 0 1em; }

kbd {
  display: inline-block;
  padding: 0 0.4em;
  border: 1px solid var(--surface-border);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Focus: always visible, 3px, high contrast ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}
main:focus-visible, [tabindex="-1"]:focus-visible { outline-offset: 6px; }
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 0.75em 1.25em;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Background layers ---------- */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.nebula { position: fixed; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.nebula__blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  animation: drift 38s ease-in-out infinite alternate;
}
.nebula__blob--1 { background: #ff4fd8; top: -20vmax; left: -15vmax; }
.nebula__blob--2 { background: #3b82f6; bottom: -25vmax; right: -20vmax; animation-duration: 46s; }
.nebula__blob--3 { background: #8b5cf6; top: 30%; left: 40%; width: 40vmax; height: 40vmax; animation-duration: 54s; opacity: 0.16; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(8vmax, 6vmax) scale(1.15); }
}

.space-decor { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.mini-planet {
  position: absolute;
  border-radius: 50%;
  animation: float 14s ease-in-out infinite;
}
.mini-planet::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 42%;
  width: 180%;
  height: 16%;
  border-radius: 50%;
  border: 3px solid rgba(103, 232, 249, 0.6);
  transform: rotate(-18deg);
}
.mini-planet--a {
  width: 70px; height: 70px;
  top: 18%; right: 6%;
  background: radial-gradient(circle at 35% 30%, #a5f3fc, #0e7490 70%);
  opacity: 0.6;
}
.mini-planet--b {
  width: 42px; height: 42px;
  bottom: 14%; left: 5%;
  background: radial-gradient(circle at 35% 30%, #fde68a, #c2410c 75%);
  opacity: 0.55;
  animation-duration: 18s;
  animation-delay: -6s;
}
.mini-planet--b::after { display: none; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-24px) rotate(8deg); }
}

.ufo {
  position: absolute;
  top: 12%;
  left: -80px;
  font-size: 2.5rem;
  animation: ufo-fly 26s linear infinite;
  animation-delay: 4s;
}
@keyframes ufo-fly {
  0%   { transform: translate(0, 0) rotate(-8deg); }
  20%  { transform: translate(30vw, 6vh) rotate(8deg); }
  40%  { transform: translate(60vw, -2vh) rotate(-8deg); }
  55%  { transform: translate(calc(100vw + 160px), 4vh) rotate(8deg); }
  100% { transform: translate(calc(100vw + 160px), 4vh) rotate(8deg); }
}

.astronaut {
  position: absolute;
  bottom: 8%;
  right: 4%;
  font-size: 2.6rem;
  animation: tumble 22s ease-in-out infinite;
  opacity: 0.85;
}
@keyframes tumble {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-40px, -60px) rotate(180deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(7, 6, 22, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(185, 164, 255, 0.3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}
.brand img { transition: transform 0.6s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover img { transform: rotate(-20deg) scale(1.15); }
.brand:hover { color: var(--text); }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.45em 1em;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  border: 2px solid transparent;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.site-nav a:hover { background: var(--surface-2); border-color: var(--surface-border); transform: translateY(-2px); }
.site-nav a[aria-current="page"] {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}
.site-nav a[aria-current="page"] .nav-icon { animation: wiggle 1.6s ease-in-out infinite; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-14deg); }
  75% { transform: rotate(14deg); }
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.45em 1em;
  border-radius: 999px;
  border: 2px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.motion-toggle:hover { background: rgba(103, 232, 249, 0.12); }
.motion-toggle[aria-pressed="true"] { border-color: var(--pink); color: var(--pink); }

/* ---------- Layout ---------- */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
}

.page { animation: page-in 0.6s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes page-in {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.panel {
  margin: 2rem auto 0;
  max-width: 820px;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(160deg, rgba(33, 26, 99, 0.94), rgba(23, 18, 74, 0.94));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
}
.panel p:last-child { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 0.5rem; }
.hero__logo {
  width: min(420px, 100%);
  margin: 0 auto;
}
.logo { display: block; width: 100%; height: auto; overflow: visible; }
.logo__bob { animation: bob 6s ease-in-out infinite; transform-origin: 200px 150px; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}
.logo__eyes { animation: blink 5s infinite; transform-origin: 200px 140px; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
.spark { animation: twinkle 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.spark--2 { animation-delay: -0.8s; }
.spark--3 { animation-delay: -1.6s; }
.spark--4 { animation-delay: -2.2s; }
@keyframes twinkle {
  0%, 100% { transform: scale(0.6) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.2) rotate(45deg); opacity: 1; }
}
.logo-key rect { fill: url(#key-grad); stroke: #1b1240; stroke-width: 2.5; }
.logo-key .key-base { fill: #8b7fe0; stroke: #1b1240; stroke-width: 2.5; }
.logo-key text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  fill: #1b1240;
  text-anchor: middle;
  dominant-baseline: central;
}

.wordmark {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.5rem, 8.5vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.wordmark__letters { display: inline-flex; flex-wrap: wrap; justify-content: center; }
.wordmark__letters span {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 10%, #ffc2ec 55%, #ff8ad8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #5b21b6) drop-shadow(0 0 18px rgba(255, 122, 217, 0.55));
  animation: letter-wave 2.8s ease-in-out infinite;
}
.wordmark__letters .wordmark__q {
  background-image: linear-gradient(180deg, #ffffff 10%, #a5f3fc 55%, #67e8f9 100%);
  filter: drop-shadow(0 4px 0 #1e3a8a) drop-shadow(0 0 18px rgba(103, 232, 249, 0.55));
}
.wordmark__letters span:nth-child(1) { animation-delay: 0s; }
.wordmark__letters span:nth-child(2) { animation-delay: 0.1s; }
.wordmark__letters span:nth-child(3) { animation-delay: 0.2s; }
.wordmark__letters span:nth-child(4) { animation-delay: 0.3s; }
.wordmark__letters span:nth-child(5) { animation-delay: 0.4s; }
.wordmark__letters span:nth-child(6) { animation-delay: 0.5s; }
.wordmark__letters span:nth-child(7) { animation-delay: 0.6s; }
.wordmark__letters span:nth-child(8) { animation-delay: 0.7s; }
.wordmark__letters span:nth-child(9) { animation-delay: 0.8s; }
@keyframes letter-wave {
  0%, 60%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-14px) rotate(-6deg); }
}

.hero__tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 36em;
  margin: 0 auto 1.5rem;
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.6em 1.4em;
  border-radius: 999px;
  border: 3px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.3, 1.6, .5, 1), box-shadow 0.2s, background-color 0.2s;
}
.btn:hover { transform: translateY(-3px) scale(1.04); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 6px 0 #b8860b, 0 0 28px rgba(255, 210, 63, 0.45);
}
.btn--primary:hover { color: var(--ink); box-shadow: 0 9px 0 #b8860b, 0 0 40px rgba(255, 210, 63, 0.6); }
.btn--secondary {
  background: var(--surface-2);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 6px 0 #0e7490;
}
.btn--secondary:hover { color: #a5f3fc; }
.btn--ghost {
  background: transparent;
  color: var(--pink);
  border-color: var(--pink);
}
.btn--ghost:hover { color: var(--pink); background: rgba(255, 138, 216, 0.12); }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed;
  transform: none;
  background: #2c275a;
  color: #c9c3ef;
  border-color: #8a83c2;
  box-shadow: none;
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin: 0;
}
.stat {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 6, 22, 0.55);
  border: 1px solid var(--surface-border);
}
.stat dt { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.stat dd { margin: 0.25rem 0 0; }
.stat__value {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--cyan);
}
.bump { display: inline-block; animation: bump 0.3s ease-out; }
@keyframes bump {
  50% { transform: scale(1.35); color: var(--yellow); }
}
.stat__note { display: block; font-size: 0.85rem; color: var(--muted); }

/* ---------- Page heads ---------- */
.page-head { text-align: center; margin-bottom: 2rem; }
.page-head h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
}
.page-head__text {
  background: linear-gradient(90deg, var(--cyan), #ffffff, var(--pink), #ffffff, var(--cyan));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}
.page-head__emoji { display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes shimmer { to { background-position: 300% 0; } }
.page-head__lede { color: var(--muted); font-size: 1.15rem; }

/* ---------- Launch pad ---------- */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.launch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: flex-start;
  height: 100%;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 2px solid var(--surface-border);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1), border-color 0.2s, box-shadow 0.3s;
}
/* The spinning glow lives in its own clipped layer so the card itself
   doesn't clip, which lets the rocket fly out past the card's edges. */
.launch-card__glow {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: linear-gradient(160deg, #211a63, #17124a);
}
.launch-card__glow::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(103, 232, 249, 0.35), rgba(255, 138, 216, 0.35), transparent);
  animation: spin 6s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}
.launch-card__glow::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--radius) - 5px);
  background: linear-gradient(160deg, #211a63, #17124a);
}
.launch-card > * { position: relative; z-index: 1; }
.launch-card:hover, .launch-card:focus-visible {
  z-index: 5;
  transform: translateY(-8px) rotate(-1deg);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 20px 60px rgba(103, 232, 249, 0.3);
  color: var(--text);
}
.launch-card:hover .launch-card__glow::before,
.launch-card:focus-visible .launch-card__glow::before { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.launch-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: var(--bg);
  border: 2px solid var(--surface-border);
}
.launch-card__body { display: flex; flex-direction: column; gap: 0.35rem; }
.launch-card__kicker {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pink);
}
.launch-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
.launch-card__text { color: var(--text); }
.launch-card__url { font-size: 0.95rem; color: var(--cyan); word-break: break-word; }
.launch-card__newtab { display: inline-block; margin-left: 0.15em; font-weight: 700; }
.launch-card__rocket {
  position: absolute !important;
  z-index: 3 !important;
  right: 1.25rem;
  top: 1.25rem;
  font-size: 2rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.7s cubic-bezier(.5, -0.4, .6, 1.4);
}
.launch-card__rocket::after {
  content: "";
  position: absolute;
  left: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd23f 0 35%, #ff8ad8 60%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}
/* Turn the rocket to point straight up, then lift off out of the top of the card. */
.launch-card:hover .launch-card__rocket,
.launch-card:focus-visible .launch-card__rocket {
  transform: translate(-4px, -78px) rotate(-45deg) scale(1.35);
}
.launch-card:hover .launch-card__rocket::after,
.launch-card:focus-visible .launch-card__rocket::after { opacity: 1; animation: thrust 0.15s ease-in-out infinite alternate; }
@keyframes thrust { to { transform: translate(-3px, 3px) scale(1.4); } }

.print-layer { opacity: 0; animation: print 4s steps(1) infinite; }
.print-layer--1 { animation-delay: 0s; }
.print-layer--2 { animation-delay: 0.6s; }
.print-layer--3 { animation-delay: 1.2s; }
.print-layer--4 { animation-delay: 1.8s; }
@keyframes print {
  0% { opacity: 0; }
  1% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}
.visor-glint { animation: led 3s ease-in-out infinite; }
.server-led { animation: led 2.4s ease-in-out infinite; }
.server-led--2 { animation-delay: -0.8s; }
.server-led--3 { animation-delay: -1.6s; }
@keyframes led { 50% { opacity: 0.35; } }

/* ---------- Game tabs ---------- */
.game-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.game-tabs [role="tab"] {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.9rem;
  align-items: center;
  text-align: left;
  padding: 1rem 1.25rem;
  min-height: 72px;
  border-radius: var(--radius);
  border: 3px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1), border-color 0.2s, background-color 0.2s;
}
.game-tabs [role="tab"]:hover { transform: translateY(-3px); border-color: var(--cyan); }
.game-tabs [role="tab"][aria-selected="true"] {
  background: linear-gradient(135deg, #3b2a9e, #5b21b6);
  border-color: var(--yellow);
  box-shadow: 0 0 30px rgba(255, 210, 63, 0.35);
}
.game-tabs__emoji { grid-row: span 2; font-size: 2.2rem; }
[aria-selected="true"] .game-tabs__emoji { animation: wiggle 1.6s ease-in-out infinite; }
.game-tabs__name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.game-tabs__hint { color: var(--muted); font-size: 0.95rem; }

.game-panel {
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(33, 26, 99, 0.96), rgba(23, 18, 74, 0.96));
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-glow);
}
.game-panel:focus-visible { outline-offset: 4px; }

.game-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.game-header h2 { margin-bottom: 0.4em; }
.game-scores { display: flex; gap: 1.25rem; margin: 0; color: var(--muted); }
.game-scores strong { color: var(--text); font-family: var(--font-display); }

.how-to {
  margin: 0.5rem 0 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 6, 22, 0.55);
  border: 1px solid var(--surface-border);
}
.how-to summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--cyan);
  min-height: 32px;
  display: list-item;
}
.how-to ul { margin: 0.75rem 0 0.25rem; padding-left: 1.25rem; }
.how-to li { margin-bottom: 0.4rem; }

/* ---------- Starship Battle ---------- */
.bs-controls, .mm-controls, .game-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.bs-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 1.75rem;
}
.bs-board {
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(7, 6, 22, 0.6);
  border: 1px solid var(--surface-border);
}
.bs-board.is-active { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow), 0 0 30px rgba(255, 210, 63, 0.25); }
.bs-board.is-shaking { animation: shake 0.4s ease-in-out; }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.bs-grid-wrap { overflow-x: auto; }
.bs-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
}
.bs-grid caption { text-align: left; color: var(--muted); font-size: 0.9rem; padding-bottom: 0.4rem; }
.bs-grid th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
}
.bs-grid .bs-corner { width: 1.8em; }
.bs-grid thead th { height: 1.6em; }
.bs-box {
  display: grid;
  place-items: center;
  width: 100%;
  position: relative;
  aspect-ratio: 1;
  min-width: 24px;
  padding: 0;
  border-radius: 5px;
  background: #1c1760;
  border: 1px solid #8f86ea;
  text-align: center;
  vertical-align: middle;
  font-size: clamp(0.8rem, 2.4vw, 1.05rem);
  line-height: 1;
}
.bs-cell {
  color: var(--text);
  font-family: inherit;
  font-weight: 900;
  cursor: crosshair;
  transition: background-color 0.15s, transform 0.15s;
}
.bs-grid td { padding: 0; }
.bs-cell:hover:not([aria-disabled="true"]) { background: #3b2a9e; transform: scale(1.08); }
.bs-cell:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  z-index: 2;
  background: #3b2a9e;
}
.bs-cell[aria-disabled="true"] { cursor: default; }

.is-miss { background: #110d36 !important; color: var(--muted) !important; }
.is-hit { background: var(--danger) !important; color: var(--ink) !important; border-color: #ffd0da !important; }
.is-sunk { background: #7f1d3a !important; color: #ffffff !important; border-color: var(--danger) !important; }
.is-ship { background: var(--cyan) !important; color: var(--ink) !important; border-color: #cffafe !important; }
.is-ship.is-hit { background: var(--danger) !important; }
.is-ship.is-sunk { background: #7f1d3a !important; color: #ffffff !important; }

.bs-mark { display: inline-block; }
.is-hit .bs-mark, .is-sunk .bs-mark { animation: boom 0.5s cubic-bezier(.3, 1.8, .5, 1); }
.is-miss .bs-mark { animation: plop 0.4s ease-out; }
@keyframes boom {
  0% { transform: scale(0) rotate(-90deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes plop {
  0% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.shot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  animation: ring 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ring {
  from { transform: scale(0.3); opacity: 1; }
  to { transform: scale(2.4); opacity: 0; }
}

.bs-fleet-title { margin: 1rem 0 0.5rem; }
.bs-fleet {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bs-fleet li {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  font-size: 0.9rem;
}
.bs-fleet .pips { display: inline-flex; gap: 2px; }
.bs-fleet .pip { width: 8px; height: 12px; border-radius: 2px; background: var(--cyan); }
.bs-fleet .pip.hit { background: var(--danger); }
.bs-fleet li.sunk { text-decoration: line-through; color: var(--muted); border-color: var(--danger); }
.bs-fleet li.sunk .pip { background: #7f1d3a; outline: 1px solid var(--danger); }

.bs-log-wrap { margin-top: 1.5rem; }
.bs-log {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 6, 22, 0.6);
  border: 1px solid var(--surface-border);
}
.bs-log ol { margin: 0; padding-left: 2.5rem; }
.bs-log ol:empty { padding-left: 0; }
.bs-log ol:empty::before { content: "No shots fired yet."; color: var(--muted); }
.bs-log li { margin-bottom: 0.25rem; }
.bs-log li.you { color: var(--cyan); }
.bs-log li.enemy { color: var(--pink); }
.bs-log li.big { color: var(--yellow); font-weight: 700; }

/* ---------- Cosmic Memory ---------- */
.mm-levels, .option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0.6rem 1rem 0.8rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
}
.mm-levels legend, .option-group legend { padding: 0 0.4em; color: var(--cyan); font-weight: 700; }
.mm-levels label, .option-group label { display: inline-flex; align-items: center; gap: 0.45em; min-height: 32px; cursor: pointer; }
.mm-levels input, .option-group input { width: 1.2em; height: 1.2em; accent-color: var(--yellow); }

.mm-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1.25rem;
}
.mm-stats div {
  min-width: 120px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 6, 22, 0.6);
  border: 1px solid var(--surface-border);
}
.mm-stats dt { font-size: 0.85rem; color: var(--muted); }
.mm-stats dd { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }

.mm-grid {
  --cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(0.4rem, 1.5vw, 0.9rem);
  max-width: calc(var(--cols) * 130px);
  margin: 0 auto;
  perspective: 900px;
}
.mm-grid[data-level="hard"] { --cols: 6; }
@media (max-width: 560px) {
  .mm-grid[data-level="hard"] { --cols: 4; }
}

.mm-card {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.3, 1.4, .5, 1);
}
.mm-card:hover:not(.is-flipped) { transform: translateY(-4px) rotate(-2deg); }
.mm-card.is-flipped { transform: rotateY(180deg); }
.mm-card:focus-visible { outline-offset: 4px; border-radius: 14px; }

.mm-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 3px solid var(--surface-border);
}
.mm-face--back svg { width: 45%; height: auto; }
.mm-face--back {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.8) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px),
    linear-gradient(145deg, #5b21b6, #1e1b4b);
  color: var(--yellow);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.1rem, 4vw, 1.8rem);
}
.mm-face--front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #fef9c3, #fbcfe8);
  border-color: var(--yellow);
  font-size: clamp(1.8rem, 6vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  line-height: 1;
}
.mm-face__name {
  display: block;
  font-size: clamp(0.6rem, 1.6vw, 0.8rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  padding: 0 4px;
}
.mm-card.is-matched .mm-face--front {
  background: linear-gradient(160deg, #a5f3fc, #bbf7d0);
  border-color: var(--cyan);
  animation: matched 0.7s ease-out;
}
.mm-card.is-matched { cursor: default; }
.mm-card.is-wrong .mm-face--front { border-color: var(--danger); animation: shake 0.4s ease-in-out; }
.mm-card.is-matched .mm-face--front::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 1rem;
  font-weight: 900;
  color: #065f46;
}
@keyframes matched {
  40% { transform: rotateY(180deg) scale(1.12); box-shadow: 0 0 30px var(--cyan); }
}

.mm-status {
  min-height: 1.6em;
  margin: 1.25rem 0 0;
  text-align: center;
  font-weight: 700;
  color: var(--yellow);
}

/* ---------- Shared bits for the newer games ---------- */
.game-status {
  min-height: 1.6em;
  margin: 0 0 1rem;
  font-weight: 700;
  color: var(--yellow);
}
.field-hint { color: var(--muted); font-weight: 400; }

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 40px;
  padding: 0.3em 0.9em;
  border-radius: 999px;
  border: 2px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.chip-toggle:hover { border-color: var(--cyan); transform: translateY(-2px); }
.chip-toggle[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: var(--ink); font-weight: 700; }
.chip-toggle[aria-pressed="true"]::after { content: "✓"; font-weight: 900; }

.coin-pop {
  position: fixed;
  transform: translate(-50%, 0);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--yellow);
  text-shadow: 0 2px 0 #1b1240, 0 0 10px rgba(0, 0, 0, 0.8);
  animation: coin-rise 1.1s ease-out forwards;
  white-space: nowrap;
}
@keyframes coin-rise {
  from { transform: translate(-50%, 0) scale(0.6); opacity: 1; }
  to { transform: translate(-50%, -70px) scale(1.15); opacity: 0; }
}

/* ---------- Tic-Tac-Toe ---------- */
.ttt-wrap {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
}
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ttt-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 3px solid #8f86ea;
  background: #1c1760;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.3, 1.6, .5, 1), background-color 0.2s, border-color 0.2s;
}
.ttt-cell:hover:not([aria-disabled="true"]) { transform: scale(1.05); background: #3b2a9e; border-color: var(--cyan); }
.ttt-cell[aria-disabled="true"] { cursor: default; }
.ttt-cell.is-x { color: var(--pink); text-shadow: 0 0 18px rgba(255, 138, 216, 0.6); }
.ttt-cell.is-o { font-family: var(--font-body); color: var(--cyan); text-shadow: 0 0 18px rgba(103, 232, 249, 0.6); }
.ttt-cell.is-new .ttt-mark { animation: ttt-pop 0.45s cubic-bezier(.3, 1.8, .5, 1); }
.ttt-cell.is-win { background: var(--yellow); border-color: #fff3b0; color: var(--ink) !important; text-shadow: none; }
.ttt-cell.is-win .ttt-mark { animation: ttt-dance 0.8s ease-in-out 2; }
.ttt-mark { display: inline-block; }
@keyframes ttt-pop {
  from { transform: scale(0) rotate(-120deg); }
  to { transform: scale(1) rotate(0deg); }
}
@keyframes ttt-dance {
  25% { transform: translateY(-10px) rotate(-10deg); }
  75% { transform: translateY(-10px) rotate(10deg); }
}
.ttt-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.ttt-line line {
  stroke: #ffffff;
  stroke-width: 0.07;
  stroke-linecap: round;
  stroke-dasharray: 5;
  stroke-dashoffset: 5;
  opacity: 0;
  filter: drop-shadow(0 0 0.06px #1b1240);
}
.ttt-line.is-shown line { opacity: 0.95; animation: draw-line 0.6s ease-out forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.motion-off .ttt-line.is-shown line { stroke-dashoffset: 0; }

/* ---------- Aquarium ---------- */
.aq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.aq-tank {
  position: relative;
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(180deg, #4c3fa8, #2a2170);
  box-shadow: inset 0 0 0 2px #8f86ea, 0 12px 40px rgba(14, 165, 233, 0.3);
}
.aq-tank::before {
  content: "";
  position: absolute;
  left: 10px; right: 10px; top: 4px;
  height: 8px;
  border-radius: 6px;
  background: #8f86ea;
}
#aq-canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  background: #0369a1;
}
.aq-meter {
  height: 12px;
  margin-top: 0.9rem;
  border-radius: 999px;
  background: #110d36;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}
.aq-meter__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), #a5f3fc);
  transition: width 0.6s ease;
}
.aq-meter__fill.is-low { background: linear-gradient(90deg, #a3a635, #d9f99d); }
.aq-clean-text { margin: 0.35rem 0 1rem; color: var(--muted); }
.aq-clean-text strong { color: var(--text); }

.aq-side h3 { margin-top: 1.25rem; }
.aq-side h3:first-child, .aq-add h3 { margin-top: 0; }
.aq-add {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 6, 22, 0.6);
  border: 1px solid var(--surface-border);
}
.aq-add label { font-weight: 700; margin-top: 0.3rem; }
.aq-add select, .aq-add input {
  min-height: 44px;
  padding: 0.4em 0.7em;
  border-radius: 10px;
  border: 2px solid #8f86ea;
  background: #110d36;
  color: var(--text);
  font: inherit;
}
.aq-add select:focus-visible, .aq-add input:focus-visible { border-color: var(--yellow); }
.aq-add .btn { margin-top: 0.6rem; justify-self: start; }
.aq-decor { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.aq-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  max-height: 22rem;
  overflow-y: auto;
}
.aq-list__empty { color: var(--muted); }
.aq-fish {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  animation: page-in 0.4s ease-out;
}
.aq-fish__swatch { flex: none; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; border: 2px solid #ffffff; transform: rotate(-45deg); }
.aq-fish__text { display: flex; flex-direction: column; flex: 1; line-height: 1.3; min-width: 0; }
.aq-fish__text span { font-size: 0.9rem; color: var(--muted); }
.aq-fish__text .aq-fish__state { color: var(--cyan); font-weight: 700; }
.aq-fish__rehome {
  min-height: 36px;
  padding: 0.2em 0.8em;
  border-radius: 999px;
  border: 2px solid var(--pink);
  background: transparent;
  color: var(--pink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.aq-fish__rehome:hover { background: rgba(255, 138, 216, 0.14); }

/* ---------- Stardust Farm ---------- */
.farm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.farm-seeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 1rem; }
.farm-seed {
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: border-color 0.2s, background-color 0.2s;
}
.farm-seed:has(input:checked) { border-color: var(--yellow); background: rgba(255, 210, 63, 0.1); }
.farm-seed__emoji { font-size: 1.6rem; }
.farm-seed__text { display: flex; flex-direction: column; line-height: 1.25; }
.farm-seed__text span { font-size: 0.85rem; color: var(--muted); }

.farm-scene {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid #8f86ea;
  background: linear-gradient(180deg, #7dd3fc 0, #bae6fd 70px, #4d7c0f 70px, #3f6212 100%);
  transition: filter 0.5s;
}
.farm-scene[data-weather="cloudy"] { background: linear-gradient(180deg, #94a3b8 0, #cbd5e1 70px, #4d7c0f 70px, #3f6212 100%); }
.farm-scene[data-weather="rainy"] { background: linear-gradient(180deg, #64748b 0, #94a3b8 70px, #3f6212 70px, #365314 100%); }
.farm-sky { position: relative; height: 70px; }
.farm-sun {
  position: absolute;
  left: 18px;
  top: 10px;
  font-size: 2.6rem;
  animation: sun-spin 20s linear infinite;
}
@keyframes sun-spin { to { transform: rotate(360deg); } }
.farm-scene[data-weather="rainy"] .farm-sun, .farm-scene[data-weather="cloudy"] .farm-sun { animation: float 6s ease-in-out infinite; }
.farm-cloud { position: absolute; top: 8px; font-size: 2rem; animation: cloud-drift 40s linear infinite; }
.farm-cloud--1 { left: 30%; }
.farm-cloud--2 { left: 65%; top: 22px; font-size: 1.5rem; animation-duration: 55s; animation-delay: -20s; }
@keyframes cloud-drift {
  0% { transform: translateX(0); }
  50% { transform: translateX(80px); }
  100% { transform: translateX(0); }
}
.farm-rain { display: none; }
.farm-scene[data-weather="rainy"] .farm-rain {
  display: block;
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255, 255, 255, 0.45) 14px 15px, transparent 15px 28px);
  background-size: 100% 60px;
  animation: rain 0.9s linear infinite;
  pointer-events: none;
}
@keyframes rain { to { background-position: -16px 60px; } }

.farm-field {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  padding: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 2px, transparent 2px 22px);
}
.farm-plot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 118px;
  padding: 0.5rem 0.4rem;
  border-radius: 14px;
  border: 3px solid #2b1a0a;
  background: #6b4423;
  color: #ffffff;
  font: inherit;
  text-align: center;
  cursor: pointer;
  background-image: radial-gradient(rgba(0, 0, 0, 0.18) 1.5px, transparent 2px);
  background-size: 12px 12px;
  transition: transform 0.2s cubic-bezier(.3, 1.6, .5, 1), background-color 0.4s;
}
.farm-plot:hover { transform: translateY(-3px); }
.farm-plot:focus-visible { outline-offset: 2px; }
.farm-plot.is-dry { background-color: #7a4d24; }
.farm-plot.is-watered { background-color: #3d2410; }
.farm-plot.is-ready { background-color: #3d2410; border-color: var(--yellow); box-shadow: 0 0 18px rgba(255, 210, 63, 0.55); }
.farm-plot__emoji { font-size: 2.2rem; line-height: 1.1; transform-origin: bottom center; }
.farm-plot.is-dry .farm-plot__emoji, .farm-plot.is-watered .farm-plot__emoji { animation: sway 3s ease-in-out infinite; }
.farm-plot.is-ready .farm-plot__emoji { animation: ready-bounce 1.2s ease-in-out infinite; }
.farm-plot.is-empty .farm-plot__emoji { opacity: 0.7; font-size: 1.6rem; }
.farm-plot__name { font-weight: 700; font-size: 0.95rem; }
.farm-plot__info { font-size: 0.8rem; color: #fde68a; }
.farm-plot.is-ready .farm-plot__info { color: var(--yellow); font-weight: 800; }
.farm-plot__drop { position: absolute; top: 6px; right: 8px; font-size: 1rem; display: none; }
.farm-plot.is-watered .farm-plot__drop { display: block; }
.farm-plot.is-splash::after {
  content: "💧💧💧";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  animation: splash 0.7s ease-out forwards;
}
@keyframes splash {
  from { transform: translate(-50%, -16px); opacity: 1; }
  to { transform: translate(-50%, 30px); opacity: 0; }
}
@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
@keyframes ready-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.12); }
}

.farm-night {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 6, 22, 0.88);
  font-size: 4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.farm-scene.is-night .farm-night { opacity: 1; }
.farm-scene.is-night .farm-night span { animation: float 1.1s ease-in-out; }

.farm-side section { margin-bottom: 1.25rem; }
.farm-side h3 { margin-bottom: 0.4rem; }
.farm-side p { margin-bottom: 0.6rem; }
.farm-coop {
  position: relative;
  height: 64px;
  margin-bottom: 0.6rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #fde68a 0 30%, #a16207 30%);
  border: 2px solid #8f86ea;
  overflow: hidden;
}
.farm-animal {
  position: absolute;
  bottom: 6px;
  font-size: 1.7rem;
  animation: peck 3.4s ease-in-out infinite;
}
.farm-animal--cow { font-size: 2rem; animation: cow-sway 5s ease-in-out infinite; }
.farm-animal--hive { bottom: 26px; font-size: 1.3rem; animation: buzz 2.2s ease-in-out infinite; }
@keyframes peck {
  0%, 100% { transform: translateX(0) scaleX(1); }
  20% { transform: translateX(14px) scaleX(1) rotate(12deg); }
  40% { transform: translateX(22px) scaleX(-1); }
  60% { transform: translateX(8px) scaleX(-1) rotate(-12deg); }
  80% { transform: translateX(0) scaleX(1); }
}
@keyframes cow-sway {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(10px) rotate(-4deg); }
}
@keyframes buzz {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(12px, -8px); }
  50% { transform: translate(22px, 2px); }
  75% { transform: translate(8px, 6px); }
}
.farm-shop { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.farm-shop .btn { width: 100%; justify-content: flex-start; }
.farm-side .btn[aria-disabled="true"] { cursor: not-allowed; }

@media (max-width: 860px) {
  .aq-layout, .farm-layout { grid-template-columns: 1fr; }
}

/* ---------- Sound toggle ---------- */
.sound-toggle { border-color: var(--purple); color: var(--purple); }
.sound-toggle:hover { background: rgba(185, 164, 255, 0.14); }
.sound-toggle[aria-pressed="true"] { border-color: var(--yellow); color: var(--yellow); }
.motion-toggle[aria-pressed="true"]::after, .sound-toggle[aria-pressed="true"]::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Trophy shelf ---------- */
.trophy-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; }
.trophy-progress { margin: 0; color: var(--muted); }
.trophy-progress strong { color: var(--text); font-family: var(--font-display); }
.trophy-meter {
  height: 12px;
  margin: 0.25rem 0 1rem;
  border-radius: 999px;
  background: #110d36;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}
.trophy-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--yellow), var(--pink), var(--cyan));
  transition: width 0.8s ease;
}
.trophy-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.trophy {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(7, 6, 22, 0.55);
  border: 2px dashed var(--surface-border);
}
.trophy__icon { flex: none; font-size: 1.8rem; line-height: 1; filter: grayscale(1); }
.trophy__body { display: flex; flex-direction: column; line-height: 1.3; }
.trophy__body strong { font-family: var(--font-display); font-size: 0.95rem; }
.trophy__state { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.trophy__how { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
.trophy.is-earned {
  border-style: solid;
  border-color: var(--yellow);
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.16), rgba(255, 138, 216, 0.1));
  box-shadow: 0 0 18px rgba(255, 210, 63, 0.2);
}
.trophy.is-earned .trophy__icon { filter: none; animation: trophy-shine 3s ease-in-out infinite; }
.trophy.is-earned .trophy__state { color: var(--yellow); }
@keyframes trophy-shine {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.15); }
}

/* ---------- Workshop ---------- */
.workshop-section { margin-top: 2.5rem; }
.workshop-section:first-of-type { margin-top: 0; }
.workshop-section__lede { color: var(--muted); max-width: 46em; }
.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.print-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #211a63, #17124a);
  border: 2px solid var(--surface-border);
  box-shadow: var(--shadow-glow);
  transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1), border-color 0.2s, box-shadow 0.3s;
}
.print-card:hover, .print-card:focus-within {
  transform: translateY(-6px) rotate(-0.6deg);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 18px 50px rgba(103, 232, 249, 0.25);
}
.print-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #110d36; }
.print-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.print-card:hover .print-card__media img, .print-card:focus-within .print-card__media img { transform: scale(1.06); }
/* A glowing "nozzle" line sweeps over the photo on hover, like a print in progress. */
.print-card__scan {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 4px;
  background: var(--cyan);
  box-shadow: 0 0 14px 4px rgba(103, 232, 249, 0.7);
  opacity: 0;
}
.print-card:hover .print-card__scan, .print-card:focus-within .print-card__scan { opacity: 1; animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { from { top: 0; } to { top: calc(100% - 4px); } }
.print-card__body { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.1rem 1.25rem 1.25rem; flex: 1; }
.print-card__title { margin: 0; font-size: 1.1rem; color: var(--yellow); }
.print-card__body p { margin: 0; flex: 1; }
.print-card__link { font-weight: 700; margin-top: 0.4rem; }
.workshop-more { margin-top: 1.25rem; text-align: center; font-weight: 700; }
.site-chips { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.site-chips a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 44px;
  padding: 0.5em 1.1em;
  border-radius: 999px;
  border: 2px solid var(--cyan);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1), background-color 0.2s;
}
.site-chips a:hover { transform: translateY(-3px) rotate(-1deg); background: var(--surface-2); color: var(--text); }

/* ---------- QWERTY Defender ---------- */
.qd-field {
  position: relative;
  height: clamp(300px, 55vh, 440px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid #8f86ea;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 55%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 120%, #5b21b6 0%, #1e1b4b 45%, #070616 80%);
  background-size: 180px 140px, 230px 170px, 150px 190px, 260px 120px, 100% 100%;
}
.qd-field.is-hit { animation: qd-hit 0.5s ease-out; }
@keyframes qd-hit {
  0% { box-shadow: inset 0 0 0 0 rgba(255, 107, 139, 0); }
  30% { box-shadow: inset 0 0 60px 10px rgba(255, 107, 139, 0.6); transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 107, 139, 0); transform: none; }
}
.qd-ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 78px;
  background: linear-gradient(180deg, transparent, rgba(103, 232, 249, 0.18));
  border-top: 2px dashed rgba(103, 232, 249, 0.6);
}
.qd-planet { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); width: 110px; height: 110px; }
.qd-planet img { width: 100%; height: 100%; animation: float 5s ease-in-out infinite; }
.qd-shield {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 3px solid rgba(103, 232, 249, 0.7);
  box-shadow: 0 0 22px rgba(103, 232, 249, 0.6);
  animation: led 2.4s ease-in-out infinite;
}
.qd-rock {
  position: absolute;
  left: 0; top: 0;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #d9d2ff);
  border: 3px solid #1b1240;
  box-shadow: 0 5px 0 #8b7fe0, 0 0 18px rgba(255, 138, 216, 0.5);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.7rem;
  will-change: transform;
}
.qd-rock::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 14px;
  height: 42px;
  margin-left: -7px;
  border-radius: 7px;
  background: linear-gradient(0deg, rgba(255, 138, 216, 0.75), rgba(255, 210, 63, 0));
}
.qd-rock.is-calm { width: 84px; height: 84px; font-size: 2.6rem; animation: calm-pulse 1.8s ease-in-out infinite; }
.qd-rock.is-calm::before { display: none; }
@keyframes calm-pulse { 50% { scale: 1.1; } }
.qd-rock.is-zapped { animation: zapped 0.18s ease-in forwards; }
@keyframes zapped { to { scale: 1.6; opacity: 0; } }
.qd-lasers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.qd-lasers line {
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px #67e8f9);
  animation: laser 0.26s ease-out forwards;
}
@keyframes laser { to { opacity: 0; stroke-width: 1; } }
.qd-spark {
  position: absolute;
  margin: -10px 0 0 -10px;
  font-size: 1.1rem;
  pointer-events: none;
  animation: qd-spark 0.6s ease-out forwards;
}
@keyframes qd-spark { to { transform: translate(var(--dx), var(--dy)) scale(0.4); opacity: 0; } }
.qd-overlay {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  margin: 0;
  padding: 0.9rem 1.4rem;
  border-radius: 14px;
  background: rgba(7, 6, 22, 0.88);
  border: 2px solid var(--yellow);
  color: var(--text);
  font-weight: 700;
  text-align: center;
}
.qd-console {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-top: 0.9rem;
}
.qd-console label { font-weight: 700; color: var(--cyan); }
.qd-console input {
  width: 9ch;
  min-height: 48px;
  padding: 0.3em 0.6em;
  border-radius: 12px;
  border: 3px solid #8f86ea;
  background: #110d36;
  color: var(--yellow);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  text-transform: uppercase;
  caret-color: var(--yellow);
}
.qd-console input:focus-visible { border-color: var(--yellow); }
.qd-console.is-shake { animation: shake 0.35s ease-in-out; }
.qd-target { color: var(--muted); font-weight: 700; }
.qd-keyboard { margin-top: 0.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.qd-keyrow { display: flex; justify-content: center; gap: 6px; }
.qd-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 54px;
  min-height: 46px;
  padding: 0;
  border-radius: 9px;
  border: 2px solid #1b1240;
  background: linear-gradient(180deg, #ffffff, #d9d2ff);
  box-shadow: 0 4px 0 #8b7fe0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.qd-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #8b7fe0; }

/* ---------- Memory: share ---------- */
.mm-share-wrap { text-align: center; margin: 0.75rem 0 0; }

/* ---------- Farm: real-world time of day ---------- */
.farm-scene[data-time="dawn"], .farm-scene[data-time="dusk"] {
  background: linear-gradient(180deg, #f472b6 0, #fdba74 70px, #4d7c0f 70px, #3f6212 100%);
}
.farm-scene[data-time="night"] {
  background:
    radial-gradient(circle at 30% 20px, #ffffff 0 1px, transparent 2px),
    radial-gradient(circle at 75% 35px, #ffffff 0 1px, transparent 2px),
    radial-gradient(circle at 55% 12px, #ffffff 0 1px, transparent 2px),
    linear-gradient(180deg, #0b1030 0, #1e1b4b 70px, #2f4f0c 70px, #23400a 100%);
}
.farm-scene[data-time="night"] .farm-cloud { opacity: 0.45; }

/* ---------- Visitor counter ---------- */
.visitor-counter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}
.odo {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  background: #000000;
  border: 2px solid #8f86ea;
  box-shadow: 0 0 14px rgba(124, 255, 107, 0.25);
}
.odo__digit {
  display: block;
  height: 1em;
  overflow: hidden;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  line-height: 1em;
  color: #7cff6b;
  background: #0b1a0b;
  border-radius: 3px;
  padding: 0 0.12em;
}
.odo__strip {
  display: block;
  width: 1ch;
  word-break: break-all;
  line-height: 1em;
  transition: transform 1.4s cubic-bezier(.2, .9, .3, 1.1);
}

/* ---------- Planet Pal mascot ---------- */
.pal {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 30;
}
.pal__button {
  display: block;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 216, 0.25), transparent 70%);
  cursor: pointer;
}
.pal__button img { width: 100%; height: 100%; animation: float 4s ease-in-out infinite; }
.pal__button:hover img { animation: wiggle 0.6s ease-in-out infinite; }
.pal.is-spinning .pal__button img { animation: pal-spin 0.8s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pal-spin { from { transform: rotate(0deg) scale(1.2); } to { transform: rotate(720deg) scale(1); } }
.pal__bubble {
  position: absolute;
  left: 0;
  bottom: 78px;
  width: min(300px, calc(100vw - 32px));
  padding: 0.9rem 1rem 0.75rem;
  border-radius: 16px;
  background: #fff7d6;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: page-in 0.35s cubic-bezier(.2, .9, .3, 1.3);
}
.pal__bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -13px;
  width: 20px;
  height: 20px;
  background: #fff7d6;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}
.pal__text { margin: 0 0 0.6rem; font-weight: 500; }
.pal__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pal__actions button {
  min-height: 34px;
  padding: 0.2em 0.8em;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.pal__actions button:hover { background: rgba(27, 18, 64, 0.1); }
.pal__bubble :focus-visible { outline-color: #5b21b6; }

/* Small screens: the dock shrinks to round icon buttons. Their names stay available to screen readers. */
@media (max-width: 720px) {
  .dock .motion-toggle {
    width: 52px;
    height: 52px;
    min-height: 0;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .dock .motion-toggle__icon, .dock .sound-toggle__icon { font-size: 1.4rem; }
  .dock__label {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .dock .motion-toggle[aria-pressed="true"]::after { position: absolute; top: 5px; right: 5px; }
  .pal__bubble { width: min(300px, calc(100vw - 32px - 70px)); }
}
@media (max-width: 400px) {
  .qd-keyrow, .qd-keyboard { gap: 3px; }
  .pal__button { width: 52px; height: 52px; }
  .pal__bubble { bottom: 64px; }
}

/* ---------- Stardust Farm: barn, orders, locked seeds ---------- */
.farm-seed--locked {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin: 0;
  color: var(--muted);
  border: 2px dashed var(--surface-border);
}
.farm-robot { position: absolute; right: 18px; top: 14px; font-size: 1.9rem; animation: float 3s ease-in-out infinite; }
.farm-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.farm-board {
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(7, 6, 22, 0.6);
  border: 1px solid var(--surface-border);
}
.farm-board h3 { margin-bottom: 0.5rem; }
.farm-board__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.farm-board__head h3 { margin: 0; }
.farm-small-btn { min-height: 40px; padding: 0.3em 1em; font-size: 0.9rem; box-shadow: 0 4px 0 #0e7490; }
.farm-market-note { font-size: 0.9rem; color: var(--muted); margin: 0.5rem 0 0.75rem; }
.farm-barn, .farm-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.farm-empty { color: var(--muted); font-size: 0.95rem; }
.farm-item, .farm-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  animation: page-in 0.35s ease-out;
}
.farm-item__emoji, .farm-order__who { font-size: 1.6rem; line-height: 1; }
.farm-item__text, .farm-order__text { display: flex; flex-direction: column; flex: 1 1 140px; line-height: 1.3; min-width: 0; }
.farm-item__price, .farm-order__detail { font-size: 0.85rem; color: var(--muted); }
.farm-item__price.is-high { color: #86efac; font-weight: 700; }
.farm-item__price.is-low { color: #fda4af; }
.farm-item__actions { display: flex; gap: 0.4rem; }
.farm-mini-btn {
  min-height: 36px;
  padding: 0.2em 0.85em;
  border-radius: 999px;
  border: 2px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}
.farm-mini-btn:hover { background: rgba(255, 210, 63, 0.14); transform: translateY(-2px); }
.farm-mini-btn[aria-disabled="true"] { border-color: #8a83c2; color: #c9c3ef; cursor: not-allowed; transform: none; background: transparent; }
.farm-order.is-ready { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255, 210, 63, 0.25); }
.farm-order.is-ready .farm-order__btn { background: var(--yellow); color: var(--ink); }

/* ---------- Floating settings dock (bottom right) ---------- */
.dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.dock .motion-toggle {
  position: relative;
  background: rgba(7, 6, 22, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1), background-color 0.2s;
}
.dock .motion-toggle:hover { background: #1c1760; transform: translateX(-4px) scale(1.04); }
.dock .motion-toggle__icon, .dock .sound-toggle__icon { font-size: 1.15rem; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 16px 8rem;
  color: var(--muted);
  border-top: 1px solid rgba(185, 164, 255, 0.25);
  background: rgba(7, 6, 22, 0.75);
}
.site-footer p { margin: 0.25rem 0; }

/* ---------- Toast + FX ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 200%);
  transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1);
  text-align: center;
}
.toast.is-visible { transform: translate(-50%, 0); }
.toast:empty { visibility: hidden; }

.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fx-star {
  position: absolute;
  font-size: 1.4rem;
  animation: fx-burst 1.3s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes fx-burst {
  0% { transform: translate(0, 0) scale(0.4) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(var(--rot)); opacity: 0; }
}
.fx-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, #fff);
  box-shadow: 0 0 8px var(--c, #fff);
  animation: sparkle-fade 0.8s ease-out forwards;
}
@keyframes sparkle-fade {
  to { transform: translateY(18px) scale(0); opacity: 0; }
}

/* ---------- Motion off: stop everything ---------- */
.motion-off *, .motion-off *::before, .motion-off *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  animation-delay: 0s !important;
  transition-duration: 0.001ms !important;
}
/* Keep decorative movers parked somewhere sensible when frozen */
.motion-off .ufo, .motion-off .astronaut { display: none; }
.motion-off .print-card__scan { display: none; }
.motion-off .print-layer { opacity: 1; }
.motion-off .farm-scene[data-weather="rainy"] .farm-rain { background-position: 0 0; }

/* ---------- Windows high contrast / forced colors ---------- */
@media (forced-colors: active) {
  .bs-box, .mm-face { border: 1px solid CanvasText; }
  .wordmark__letters span, .page-head__text { color: CanvasText; background: none; -webkit-text-fill-color: CanvasText; }
  .mm-face { forced-color-adjust: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  html { scroll-padding-top: 0; }
  .site-header { justify-content: center; position: static; }
  .site-nav { margin-left: 0; width: 100%; }
  .site-nav ul { justify-content: center; }
  .bs-board { padding: 0.6rem; }
  .bs-grid { border-spacing: 1px; }
}
@media (max-width: 400px) {
  .brand__name { font-size: 1rem; }
  .site-nav a { padding: 0.45em 0.7em; }
  .bs-grid th { font-size: 0.65rem; }
  .bs-grid .bs-corner { width: 1.3em; }
  .game-panel { padding: 0.75rem 0.5rem; }
  .bs-board { padding: 0.35rem; }
}

/* Lift toasts above the floating settings dock on narrower screens. */
@media (max-width: 960px) {
  .toast { bottom: 140px; }
}
