/* Blobshooter: how the page looks.
 *
 * The game draws itself into the canvas. Everything here is what the page
 * lays over it: the landing page, the blob maker, the cards, and what a
 * player sees while playing. Nothing uses the system's own controls: every
 * button, slider, and text field is built from plain elements and styled
 * here, so the page looks the same everywhere.
 *
 * The body carries the state of the page as a class: at-loading,
 * at-landing, at-maker, at-joining, at-playing. Others add to it: touch
 * (a touch screen), calm (reduced effects), debug (opened on a local
 * address, with the development overlays).
 */

/* The page's own typeface, served from here like everything else. Fredoka
   is licensed under the SIL Open Font License (fredoka-license.txt). */
@font-face {
  font-family: "Fredoka";
  src: url("fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #0a0018;
  --glass: rgba(22, 8, 48, 0.74);
  --glass-strong: rgba(18, 6, 40, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6efff;
  --dim: #bcaae3;
  --pink: #ff4fb8;
  --violet: #a763ff;
  --cyan: #35d6ff;
  --sun: #ffd23f;
  --bad: #ff6b8b;
  --good: #7dffb0;
  --gel: linear-gradient(100deg, var(--pink), var(--violet) 48%, var(--cyan));
  --round: "Fredoka", ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* A small blob as the mouse pointer. */
  --pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='10' cy='10' r='7.5' fill='%23ff4fb8' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='7.6' cy='7.4' r='2' fill='%23fff' opacity='.8'/%3E%3C/svg%3E") 10 10, default;
  --pointer-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='%23ffd23f' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='9' cy='8.8' r='2.4' fill='%23fff' opacity='.85'/%3E%3C/svg%3E") 12 12, pointer;
}

* { box-sizing: border-box; }
/* No double-tap zoom anywhere. */
html { touch-action: manipulation; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font: 500 16px/1.45 var(--round);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  /* The page does not move under a finger: no bouncing, no pull to reload. */
  overscroll-behavior: none;
  cursor: var(--pointer);
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  outline: none;
  touch-action: none;
}
body.at-playing:not(.is-paused) #game { cursor: crosshair; }

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ veil */

/* Behind the page's own screens the game's picture is dimmed, more where
   the text is. While playing it is gone. */
#veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease, background 0.5s ease;
  background: radial-gradient(120% 90% at 50% 40%, #2a0f52 0%, #10052a 55%, #07030f 100%);
}
body.at-loading #veil { opacity: 1; }
body.at-landing #veil {
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(10, 0, 24, 0.86) 0%, rgba(10, 0, 24, 0.55) 34%, rgba(10, 0, 24, 0) 62%),
    linear-gradient(0deg, rgba(10, 0, 24, 0.7) 0%, rgba(10, 0, 24, 0) 30%);
}
body.at-maker #veil {
  opacity: 1;
  background: linear-gradient(270deg, rgba(10, 0, 24, 0.8) 0%, rgba(10, 0, 24, 0.35) 42%, rgba(10, 0, 24, 0) 66%);
}
body.at-joining #veil { opacity: 1; background: rgba(10, 0, 24, 0.5); }
body.with-card #veil, body.is-paused #veil { opacity: 1; background: rgba(10, 0, 24, 0.72); }

/* ------------------------------------------------------------------ logo */

/* One element for the whole visit. While the game loads it sits in the
   middle. On the landing page the script puts it where the layout keeps a
   place free for it (.logo-space), and it glides there. */
#logo {
  position: fixed;
  left: 50%;
  top: 44%;
  display: block;
  width: min(360px, 68vw);
  height: auto;
  overflow: visible;
  pointer-events: none;
  transform: translate(-50%, -60%);
  transition:
    left 0.8s cubic-bezier(0.3, 0.9, 0.3, 1), top 0.8s cubic-bezier(0.3, 0.9, 0.3, 1),
    width 0.8s cubic-bezier(0.3, 0.9, 0.3, 1), transform 0.8s cubic-bezier(0.3, 0.9, 0.3, 1), opacity 0.35s ease;
}
body.at-landing #logo { transform: none; }
body:not(.at-loading):not(.at-landing) #logo { opacity: 0; }
body.at-landing.with-card #logo { opacity: 0.12; }
.logo-space { aspect-ratio: 388 / 236; width: clamp(250px, 29vw, 430px); margin-left: -8px; flex: none; }
.logo-glow { filter: drop-shadow(0 6px 22px rgba(167, 99, 255, 0.55)); }

/* The blobs of the logo are alive: the big one breathes, drips hang from
   the letters and let go, and in the second line one blob shoots a piece
   of itself at the other. */
.logo-blob { transform-box: fill-box; transform-origin: 50% 100%; animation: logo-breathe 3.4s ease-in-out infinite; }
.logo-drip { animation: logo-drip 4.2s cubic-bezier(0.5, 0, 0.9, 0.6) infinite; }
.logo-drip-b { animation-delay: -1.6s; animation-duration: 5.1s; }
.logo-drip-c { animation-delay: -2.9s; animation-duration: 4.6s; }
.logo-shooter { transform-box: fill-box; transform-origin: 50% 50%; animation: logo-recoil 2.6s ease-in-out infinite; }
.logo-shot { animation: logo-shot 2.6s linear infinite; }
.logo-target { transform-box: fill-box; transform-origin: 50% 50%; animation: logo-hit 2.6s ease-in-out infinite; }

@keyframes logo-breathe {
  0%, 100% { transform: scale(1, 1); }
  40% { transform: scale(1.07, 0.93); }
  70% { transform: scale(0.95, 1.06); }
}
@keyframes logo-drip {
  0%, 20% { transform: translateY(-10px); opacity: 1; }
  70% { transform: translateY(8px); opacity: 1; }
  92% { transform: translateY(34px); opacity: 0; }
  100% { transform: translateY(-10px); opacity: 0; }
}
@keyframes logo-recoil {
  0%, 8%, 30%, 100% { transform: translateX(0) scale(1, 1); }
  14% { transform: translateX(3px) scale(0.86, 1.1); }
  20% { transform: translateX(-4px) scale(1.08, 0.94); }
}
@keyframes logo-shot {
  0%, 16% { transform: translateX(-24px) scale(0.3); opacity: 0; }
  20% { transform: translateX(-16px) scale(1); opacity: 1; }
  36% { transform: translateX(6px) scale(1); opacity: 1; }
  40%, 100% { transform: translateX(12px) scale(0.4); opacity: 0; }
}
@keyframes logo-hit {
  0%, 36%, 62%, 100% { transform: translateX(0) scale(1, 1); }
  42% { transform: translateX(5px) scale(0.84, 1.14); }
  50% { transform: translateX(-2px) scale(1.1, 0.92); }
}
body.calm .logo-blob, body.calm .logo-drip, body.calm .logo-shooter, body.calm .logo-shot, body.calm .logo-target { animation: none; }
body.calm .logo-drip { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .logo-blob, .logo-drip, .logo-shooter, .logo-shot, .logo-target { animation: none; }
  .logo-drip { opacity: 0; }
}

/* --------------------------------------------------------------- loading */

#loading {
  position: fixed;
  left: 50%;
  top: 44%;
  width: min(300px, 64vw);
  transform: translate(-50%, 110px);
  text-align: center;
  transition: opacity 0.4s ease;
}
body:not(.at-loading) #loading { opacity: 0; pointer-events: none; }
/* While the game loads, or when it has failed, nothing else is there. */
body.at-loading #ui, body.at-loading .touch-stick { visibility: hidden; pointer-events: none; }
.loading-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.loading-fill { width: 4%; height: 100%; border-radius: 4px; background: var(--gel); transition: width 0.25s ease; }
.loading-status { margin-top: 14px; min-height: 1.5em; color: var(--dim); font-size: 15px; }
#loading.failed .loading-bar { display: none; }
#loading.failed { width: min(440px, 84vw); }
#loading.failed .loading-status { color: #ffc1d2; font-size: 17px; line-height: 1.45; -webkit-user-select: text; user-select: text; }
#loading .btn { margin-top: 18px; }

.noscript { position: fixed; left: 50%; top: 44%; width: min(440px, 84vw); transform: translate(-50%, 110px); text-align: center; color: #ffc1d2; font-size: 17px; }

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

button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: var(--pointer-on);
  touch-action: manipulation;
}
button:focus { outline: none; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
#game:focus-visible { outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.btn-go {
  background: var(--gel);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(40, 0, 70, 0.45);
  box-shadow: 0 8px 28px rgba(255, 79, 184, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(40, 0, 70, 0.22);
}
.btn-go:hover { box-shadow: 0 12px 38px rgba(255, 79, 184, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(40, 0, 70, 0.22); }
.btn-big { min-height: 64px; padding: 0 40px; font-size: 22px; }

.btn-plain {
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-plain:hover { background: rgba(255, 255, 255, 0.18); }

.btn-link {
  min-height: 40px;
  padding: 0 6px;
  color: var(--dim);
  font-size: 16px;
}
.btn-link:hover { color: var(--text); }

.btn-round {
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-round:hover { background: rgba(255, 255, 255, 0.2); }
.btn-round { position: relative; }
/* A switch that is off is dim and struck through. */
.btn-round.off { color: rgba(255, 255, 255, 0.4); }
.btn-round.off::before {
  content: "";
  position: absolute;
  width: 62%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(22, 8, 48, 0.9);
  transform: rotate(-45deg);
}
/* What a button with only a picture does, said in words on hover. */
.btn-round[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn-round[data-tip]:hover::after, .btn-round[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.switches .btn-round:last-child[data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
.switches .btn-round:last-child[data-tip]:hover::after { transform: none; }
body.touch .btn-round[data-tip]::after { display: none; }
.btn-round svg, .btn svg { width: 22px; height: 22px; display: block; }

svg.icon { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
svg.icon .solid { fill: currentColor; stroke: none; }

/* --------------------------------------------------------------- landing */

.landing {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh max(7vw, env(safe-area-inset-left)) 12vh;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
body.at-landing .landing { opacity: 1; transform: none; }
body.at-landing:not(.with-card) .landing > * { pointer-events: auto; }
.landing-line {
  margin: clamp(10px, 2.4vh, 26px) 0 clamp(18px, 3.6vh, 40px);
  max-width: 27em;
  font-size: clamp(17px, 1.55vw, 23px);
  font-weight: 500;
  line-height: 1.4;
  color: #eadfff;
  text-shadow: 0 2px 14px rgba(10, 0, 24, 0.8);
}
.landing-line b { color: var(--sun); font-weight: 600; }
.landing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.landing-more { display: flex; gap: 18px; margin-top: 18px; }

.landing-foot {
  position: fixed;
  left: max(7vw, env(safe-area-inset-left));
  right: max(4vw, env(safe-area-inset-right));
  bottom: max(26px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
body.at-landing .landing-foot { opacity: 1; }
body.at-landing:not(.with-card) .landing-foot > * { pointer-events: auto; }
.world-count { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 15px; text-shadow: 0 1px 8px rgba(10, 0, 24, 0.9); }
.world-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 12px var(--good); animation: pulse 2.4s ease-in-out infinite; }
.world-count.quiet .world-dot { background: var(--dim); box-shadow: none; animation: none; }
@keyframes pulse { 50% { transform: scale(0.7); opacity: 0.6; } }
.switches { display: flex; gap: 10px; }

/* ----------------------------------------------------------------- maker */

.maker {
  position: fixed;
  top: 50%;
  right: max(4.5vw, env(safe-area-inset-right));
  width: min(440px, 92vw);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  padding: 24px 26px 22px;
  border-radius: 28px;
  background: var(--glass);
  border: 1.5px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(30px, -50%);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
body.at-maker .maker { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
body.at-maker.with-card .maker { opacity: 0.2; }

.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step-tab {
  flex: 1;
  min-height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}
.step-tab:hover { background: rgba(255, 255, 255, 0.14); color: var(--text); }
.step-tab.on { background: var(--gel); color: #ffffff; text-shadow: 0 1px 2px rgba(40, 0, 70, 0.45); }

/* A step that is taller than its room scrolls. Its lower edge fades out,
   so that what is cut off there is seen to go on. */
.step {
  display: none;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding-bottom: 16px;
  margin-bottom: -16px;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent);
}
.step::-webkit-scrollbar { display: none; }
.step.on { display: flex; animation: step-in 0.28s ease; }
@keyframes step-in { from { opacity: 0; transform: translateX(14px); } }
.step-title { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; }
.step-note { margin: -8px 0 0; color: var(--dim); font-size: 15px; font-weight: 500; }

.maker-foot { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.maker-foot .spacer { flex: 1; }
.maker-foot .btn { min-height: 48px; padding: 0 22px; font-size: 17px; }
.maker-foot .btn { flex: none; }
.maker-foot .btn-round, .maker-foot .btn-tight { width: 48px; padding: 0; }
.maker-foot .btn-tight span { display: none; }
/* Size and color of a pattern, dimmed while there is none. */
.pattern-parts { display: flex; flex-direction: column; gap: 14px; transition: opacity 0.25s ease; }
.pattern-parts.off { opacity: 0.3; pointer-events: none; }

/* ---- the name field and its keys */

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 10px 0 20px;
  border-radius: 18px;
  background: rgba(8, 0, 22, 0.55);
  border: 2px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field.active { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(167, 99, 255, 0.22); }
.field.wrong { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(255, 107, 139, 0.2); }
.field.shake { animation: shake 0.3s ease; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.field-text { flex: 1; display: flex; align-items: center; min-width: 0; font-size: 28px; font-weight: 700; letter-spacing: 0.02em; white-space: pre; }
.field-hint { color: rgba(255, 255, 255, 0.28); font-weight: 600; }
.field-caret { width: 3px; height: 32px; margin-left: 2px; border-radius: 2px; background: var(--cyan); animation: blink 1s steps(2, start) infinite; }
.field:not(.active) .field-caret { visibility: hidden; }
@keyframes blink { 50% { opacity: 0; } }
.field-count { color: var(--dim); font-size: 14px; font-weight: 600; }
.field .btn-round { flex: none; width: 44px; min-height: 44px; }
.namefield { display: flex; flex-direction: column; gap: 12px; }
.field-says { min-height: 1.4em; margin: -4px 4px 0; font-size: 15px; font-weight: 600; color: var(--dim); }
.field-says.bad { color: var(--bad); }
.field-says.good { color: var(--good); }

.keys { display: flex; flex-direction: column; gap: 6px; }
.keys-row { display: flex; justify-content: center; gap: 5px; }
.keys button {
  flex: 1 1 0;
  max-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 18px;
  font-weight: 600;
}
.keys button:active { background: var(--violet); transform: scale(0.94); }
.keys button.wide { flex: 1.6 1 0; max-width: 70px; display: grid; place-items: center; }
.keys svg { width: 22px; height: 22px; }
.keys button.on { background: var(--cyan); color: var(--ink); }

/* ---- sliders */

.slider { display: flex; flex-direction: column; gap: 6px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 600; }
.slider-ends { display: flex; justify-content: space-between; color: var(--dim); font-size: 13px; font-weight: 500; }
.slider-track {
  position: relative;
  height: 30px;
  border-radius: 15px;
  background: rgba(8, 0, 22, 0.55);
  border: 1.5px solid var(--line);
  touch-action: none;
  cursor: var(--pointer-on);
}
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 15px; background: var(--gel); opacity: 0.85; }
.slider-track.painted .slider-fill { display: none; }
.slider-thumb {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45), inset 0 -3px 0 rgba(120, 90, 170, 0.35);
  transition: transform 0.12s ease;
}
.slider-track:active .slider-thumb, .slider-track.held .slider-thumb { transform: scale(1.15); }
.slider-track:focus-visible { outline-offset: 2px; }

/* ---- colors */

.color { display: flex; flex-direction: column; gap: 10px; }
.color-label { font-size: 15px; font-weight: 600; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.22), inset 0 3px 5px rgba(255, 255, 255, 0.35);
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.swatch:hover { transform: scale(1.14); }
.swatch.on { border-color: #ffffff; transform: scale(1.14); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), inset 0 -4px 6px rgba(0, 0, 0, 0.22), inset 0 3px 5px rgba(255, 255, 255, 0.35); }
.color .slider-track { height: 24px; border-radius: 12px; }
.color .slider-thumb { width: 28px; height: 28px; margin: -14px 0 0 -14px; }

/* ---- pattern tiles */

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.14s ease;
}
.tile:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }
.tile.on { border-color: #ffffff; background: rgba(255, 255, 255, 0.16); color: var(--text); }
.tile svg { width: 46px; height: 46px; display: block; }
.tile .body { fill: var(--body, #ff4fb8); }
.tile .mark { fill: var(--accent, #ffd23f); }
.tile .line { fill: none; stroke: var(--accent, #ffd23f); stroke-width: 5; stroke-linecap: round; }

/* ----------------------------------------------------------------- cards */

.card-wrap {
  position: fixed;
  inset: 0;
  /* Over everything else, also what shows while playing. */
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.card-wrap.on { opacity: 1; pointer-events: auto; }
.card {
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 30px 32px 28px;
  border-radius: 30px;
  background: var(--glass-strong);
  border: 1.5px solid var(--line);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.3s ease;
}
.card::-webkit-scrollbar { display: none; }
.card-wrap.on .card { transform: none; }
.card h2 { margin: 0 0 18px; font-size: 30px; font-weight: 700; line-height: 1.1; }
.card p { margin: 0 0 14px; color: #e3d8fb; font-weight: 500; }
.card p.small { color: var(--dim); font-size: 14px; }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.card a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(53, 214, 255, 0.4);
  cursor: var(--pointer-on);
}
.card a:hover { border-bottom-color: var(--cyan); }

/* How to play: a few rows, each a small picture and a sentence. */
.how { display: flex; flex-direction: column; gap: 14px; }
.how-row { display: flex; align-items: center; gap: 16px; }
.how-pic { flex: none; width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; }
.how-pic svg { width: 100%; height: 100%; }
.how-row b { color: var(--sun); }
.how-row span { color: #e3d8fb; font-weight: 500; line-height: 1.35; }
.how-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); color: var(--dim); font-size: 14px; line-height: 1.7; }
.how-key { white-space: nowrap; }

/* The drawings move: a shot leaves, a blob splits, matter is taken in,
   and the other half stays close. */
.how-recoil, .how-shot, .how-half-a, .how-half-b, .how-hit, .how-grow, .how-bit, .how-buddy, .how-rays, .how-light { transform-box: fill-box; transform-origin: 50% 50%; }
.how-rays { animation: how-rays 9s linear infinite; }
.how-light { animation: how-light 1.8s ease-in-out infinite; }
@keyframes how-rays { to { transform: rotate(360deg); } }
@keyframes how-light { 0%, 100% { transform: scale(0.92); } 50% { transform: scale(1.08); } }
.how-recoil { animation: how-recoil 2.2s ease-in-out infinite; }
.how-shot { animation: how-shot 2.2s linear infinite; }
.how-half-a { animation: how-half-a 2.6s ease-in-out infinite; }
.how-half-b { animation: how-half-b 2.6s ease-in-out infinite; }
.how-hit { animation: how-hit 2.6s ease-out infinite; }
.how-grow { animation: how-grow 3s ease-in-out infinite; }
.how-bit { animation: how-bit-a 3s ease-in infinite; }
.how-bit-b { animation-name: how-bit-b; }
.how-bit-c { animation-name: how-bit-c; }
.how-buddy { animation: how-buddy 2.4s ease-in-out infinite; }
@keyframes how-recoil {
  0%, 12%, 40%, 100% { transform: none; }
  18% { transform: translateX(-2.5px) scale(0.9, 1.08); }
  26% { transform: translateX(1px) scale(1.05, 0.96); }
}
@keyframes how-shot {
  0%, 12% { transform: translateX(-14px) scale(0.3); opacity: 0; }
  18% { transform: translateX(-8px) scale(1); opacity: 1; }
  60% { transform: translateX(8px) scale(1); opacity: 1; }
  72%, 100% { transform: translateX(12px) scale(0.5); opacity: 0; }
}
@keyframes how-half-a {
  0%, 30% { transform: none; }
  55%, 85% { transform: translateX(-10px) scale(0.72); }
  100% { transform: none; }
}
@keyframes how-half-b {
  0%, 30% { transform: none; }
  55%, 85% { transform: translateX(10px) scale(0.72); }
  100% { transform: none; }
}
@keyframes how-hit {
  0%, 22% { transform: scale(0.2); opacity: 0; }
  30% { transform: scale(1); opacity: 0.9; }
  48%, 100% { transform: scale(2.4); opacity: 0; }
}
@keyframes how-grow {
  0%, 20% { transform: scale(0.8); }
  45% { transform: scale(0.88); }
  65% { transform: scale(0.95); }
  85%, 100% { transform: scale(1.04); }
}
@keyframes how-bit-a {
  0%, 15% { transform: none; opacity: 1; }
  40%, 100% { transform: translate(-18px, 14px) scale(0.3); opacity: 0; }
}
@keyframes how-bit-b {
  0%, 35% { transform: none; opacity: 1; }
  60%, 100% { transform: translate(-20px, -3px) scale(0.3); opacity: 0; }
}
@keyframes how-bit-c {
  0%, 55% { transform: none; opacity: 1; }
  80%, 100% { transform: translate(-10px, -13px) scale(0.3); opacity: 0; }
}
@keyframes how-buddy {
  0%, 100% { transform: none; }
  30% { transform: translate(-2px, -5px) scale(0.94, 1.06); }
  55% { transform: translate(1px, 1px) scale(1.07, 0.93); }
}
body.calm .how-pic svg * { animation: none; }
body.calm .how-hit { opacity: 0; }
.key {
  display: inline-block;
  min-width: 1.9em;
  padding: 0 0.5em;
  margin: 0 1px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.about-made { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; padding: 16px 18px; border-radius: 20px; background: rgba(255, 255, 255, 0.07); }
.about-made svg { flex: none; width: 54px; height: 54px; }
.about-made div { font-size: 19px; font-weight: 600; line-height: 1.3; }

.card-menu { width: min(400px, 100%); text-align: center; }
.card-menu h2 { margin-bottom: 6px; }
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-list > .btn { width: 100%; }
.menu-switches { display: flex; justify-content: center; gap: 12px; margin: 6px 0 2px; }

/* Joining: between the landing page and the game. */
.joining {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 16px rgba(10, 0, 24, 0.9);
}
body.at-joining .joining { opacity: 1; }
.joining-dots::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ------------------------------------------------------- while playing */

.hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; }
body.at-playing .hud { opacity: 1; }
body.is-paused .hud { opacity: 0.25; }

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 10px rgba(255, 255, 255, 0.3);
}
/* On a touch screen the blob shoots by itself at an enemy in the middle:
 * the crosshair is what is aimed with, and shows when it is on one. */
body.touch .crosshair { opacity: 0.75; transition: transform 0.12s ease, border-color 0.12s ease; }
body.touch .crosshair.on-target { opacity: 1; border-color: var(--cyan); transform: scale(1.5); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 14px var(--cyan); }

.vitals {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(12, 2, 30, 0.5);
  border: 1.5px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.vitals span { color: var(--dim); }
.vitals b { color: var(--sun); font-weight: 700; }
.vitals .shielded { color: var(--cyan); }
body.touch .vitals { bottom: auto; top: max(12px, env(safe-area-inset-top)); }

/* The powerups the player holds, and the signs over powerups in the
   world. Each power has its color. */
.power-0 { --power: #ff5a48; }
.power-1 { --power: #4df06a; }
.power-2 { --power: #5c9bff; }
.power-3 { --power: #ffd23f; }
.power-4 { --power: #b869ff; }
/* Who made the game: faint, in the lower right corner. */
.credit {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  opacity: 0.4;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(10, 0, 24, 0.6);
}
.credit svg { flex: none; width: 17px; height: 14px; filter: drop-shadow(0 1px 1px rgba(10, 0, 24, 0.6)); }
/* A little smaller on a touch screen, where it lies under a thumb. */
body.touch .credit { bottom: max(6px, env(safe-area-inset-bottom)); font-size: 10.5px; }

.powers {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 30px);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}
.power-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(12, 2, 30, 0.5);
  border: 1.5px solid color-mix(in srgb, var(--power) 55%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 18px color-mix(in srgb, var(--power) 28%, transparent);
  white-space: nowrap;
  animation: power-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.power-icon { flex: none; width: 26px; height: 26px; color: var(--power); filter: drop-shadow(0 0 5px var(--power)); }
.power-icon svg { display: block; width: 100%; height: 100%; }
.power-count { min-width: 0; color: var(--power); font-size: 17px; font-weight: 700; }
.power-count:empty { display: none; }
.power-words { display: flex; flex-direction: column; line-height: 1.15; }
.power-name { font-size: 14px; font-weight: 600; }
.power-left { color: var(--dim); font-size: 12px; font-weight: 500; }
.power-chip.ending { animation: power-ending 1.2s ease-in-out infinite; }
@keyframes power-in { from { opacity: 0; transform: translateX(16px) scale(0.8); } }
@keyframes power-ending { 50% { opacity: 0.45; } }
body.calm .power-chip, body.calm .power-chip.ending { animation: none; }
/* On a touch screen the thumbs are below. */
body.touch .powers { bottom: auto; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); flex-direction: column; gap: 6px; }
body.touch .power-chip { padding: 4px 10px 4px 6px; gap: 6px; }
body.touch .power-icon { width: 20px; height: 20px; }
body.touch .power-name { display: none; }

.ranking {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  min-width: 190px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(12, 2, 30, 0.45);
  border: 1.5px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}
.ranking:empty { display: none; }
.ranking-row { display: flex; justify-content: space-between; gap: 18px; }
.ranking-row:first-child { color: var(--sun); }
.ranking-row.ranking-me { color: var(--cyan); }
.ranking-own { margin-top: 2px; color: var(--cyan); }
body.touch .ranking { display: none; }

.tags { position: absolute; inset: 0; overflow: hidden; }
.tag-danger { color: var(--bad); border: 1.5px solid color-mix(in srgb, var(--bad) 60%, transparent); }
.tag-prey { color: var(--good); }
.tag-power { color: var(--power); border: 1.5px solid color-mix(in srgb, var(--power) 50%, transparent); font-variant-numeric: tabular-nums; }
.tag {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(12, 2, 30, 0.6);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.news {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.news-line {
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(12, 2, 30, 0.55);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  animation: news-in 0.25s ease;
  transition: opacity 1s ease;
}
.news-line.fading { opacity: 0; }
@keyframes news-in { from { opacity: 0; transform: translateY(-8px); } }
body.touch .news { top: max(56px, env(safe-area-inset-top)); }

/* A first game's hints: one line at a time, gone for good once done. */
.hint {
  position: absolute;
  left: 50%;
  bottom: 21%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(12, 2, 30, 0.72);
  border: 1.5px solid rgba(255, 210, 63, 0.5);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hint.on { opacity: 1; }
.hint span { margin: 0 3px; }
.hint .key { margin: 0 2px; }
.click-hint { bottom: auto; top: 58%; border-color: var(--line); }
/* With a keyboard, Esc opens the menu. */
.esc-hint {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.7;
}
body.touch .hint { bottom: auto; top: 20%; width: max-content; max-width: 84vw; padding: 10px 20px; border-radius: 22px; font-size: 15px; white-space: normal; text-align: center; }

.hurt { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 9vw 2vw #ff2a5e; }

.menu-button {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
body.at-playing:not(.is-paused) .menu-button { opacity: 0.75; pointer-events: auto; }
body.at-playing:not(.is-paused) .menu-button:hover { opacity: 1; }

.gameover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, rgba(26, 0, 51, 0.6) 0%, rgba(10, 0, 24, 0.82) 70%);
  text-align: center;
}
.gameover-title { font-size: clamp(44px, 9vw, 84px); font-weight: 700; letter-spacing: 0.02em; line-height: 1; background: var(--gel); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 24px rgba(255, 79, 184, 0.5)); }
.gameover-score { font-size: 22px; font-weight: 600; }
.gameover-hint { font-size: 17px; font-weight: 600; color: var(--dim); }

/* -------------------------------------------------------- touch controls */

.touch-stick {
  position: fixed;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(12, 2, 30, 0.25);
  pointer-events: none;
}
.touch-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
}
/* The ring under a thumb that is held still: it fills from its middle
 * while a bounce is charged, and lights up when the charge is full. */
.touch-charge {
  position: fixed;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 210, 63, 0.55);
  background: radial-gradient(circle closest-side, rgba(255, 210, 63, 0.5) calc(var(--charge, 0) * 100%), rgba(12, 2, 30, 0.25) calc(var(--charge, 0) * 100% + 1px));
  pointer-events: none;
}
.touch-charge.full { border-color: #fff3a8; box-shadow: 0 0 18px rgba(255, 210, 63, 0.8); }
body.at-loading .touch-charge { visibility: hidden; }
/* The stick that turns the view: its knob in the color of the crosshair
 * it steers. */
.touch-look { border-color: rgba(53, 214, 255, 0.5); }
.touch-look .touch-knob { background: rgba(53, 214, 255, 0.45); }

/* ------------------------------------------------------ for development */

/* These only exist when the page is opened on a local address (panel.js). */
.readout, .help, .tuning, .tuning-toggle {
  position: fixed;
  background: rgba(13, 6, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
}
body:not(.at-playing) .readout, body:not(.at-playing) .help, body:not(.at-playing) .tuning, body:not(.at-playing) .tuning-toggle { display: none; }
.readout { top: 52px; left: 12px; padding: 8px 12px; white-space: pre; font: 12px/1.5 ui-monospace, Menlo, monospace; color: #d8ccff; pointer-events: none; }
.help { left: 12px; bottom: 12px; padding: 10px 14px; font-size: 13px; color: #d8ccff; pointer-events: none; }
.help-row { display: flex; gap: 12px; }
.help-keys { min-width: 9.5em; color: #25e6ff; font-weight: 500; }
.tuning-toggle { top: 12px; left: 112px; padding: 6px 14px; color: #efe9ff; font-size: 14px; }
.tuning { top: 52px; left: 112px; bottom: 12px; width: min(25rem, calc(100vw - 124px)); padding: 12px 14px; overflow-y: auto; font-size: 13px; }
.tuning-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tuning-head strong { flex: 1; font-size: 15px; }
.tuning button { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #efe9ff; }
.tuning-note { margin-bottom: 8px; color: #a99bd0; }
.tuning-group { margin: 12px 0 4px; color: #ff9df5; font-weight: 500; }
.tuning-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.tuning-name { flex: 0 0 10em; }
.tuning-row input[type="range"] { flex: 1; min-width: 0; }
.tuning-value { flex: 0 0 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.tuning-row.changed .tuning-name { color: #25e6ff; }
.tuning.inactive .tuning-row { opacity: 0.4; pointer-events: none; }
body.touch .help, body.touch .tuning, body.touch .tuning-toggle { display: none; }
body.touch .readout { top: 64px; font-size: 10px; }

/* ------------------------------------------------------- small screens */

@media (max-width: 820px), (orientation: portrait) {
  .landing { justify-content: flex-start; align-items: center; padding: max(5vh, env(safe-area-inset-top)) 6vw 0; text-align: center; transform: translateY(-20px); }
  .logo-space { width: min(300px, 66vw); margin: 0; }
  .landing-line { margin: 8px 0 0; font-size: 16px; max-width: 22em; }
  .landing-actions {
    position: fixed;
    left: 6vw;
    right: 6vw;
    bottom: calc(max(22px, env(safe-area-inset-bottom)) + 108px);
    flex-direction: column;
    gap: 10px;
  }
  .landing-actions .btn { width: 100%; }
  .landing-more { position: fixed; left: 0; right: 0; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 60px); justify-content: center; margin: 0; }
  .landing-foot { left: 6vw; right: 6vw; }
  body.at-landing #veil {
    background:
      linear-gradient(180deg, rgba(10, 0, 24, 0.82) 0%, rgba(10, 0, 24, 0.2) 34%, rgba(10, 0, 24, 0) 46%),
      linear-gradient(0deg, rgba(10, 0, 24, 0.9) 0%, rgba(10, 0, 24, 0.5) 30%, rgba(10, 0, 24, 0) 48%);
  }

  /* The maker is a sheet at the bottom, with the blob above it. */
  .maker {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 62dvh;
    padding: 16px 18px max(16px, env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    border-width: 1.5px 0 0;
    transform: translateY(40px);
  }
  body.at-maker .maker { transform: none; }
  body.at-maker #veil { background: linear-gradient(0deg, rgba(10, 0, 24, 0.8) 0%, rgba(10, 0, 24, 0.3) 55%, rgba(10, 0, 24, 0) 70%); }
  .steps { margin-bottom: 12px; }
  .step { gap: 10px; }
  /* The tab says which step it is. Only the first one keeps its title. */
  .step-title { font-size: 21px; }
  .step:not(.step-name) .step-title, .step:not(.step-name) .step-note { display: none; }
  .step-note { font-size: 14px; }
  .slider { gap: 3px; }
  .slider-ends { font-size: 12px; line-height: 1.2; }
  .namefield { gap: 8px; }
  .maker-foot { margin-top: 12px; }
  .maker-foot .btn-dice { width: 48px; padding: 0; }
  .btn-dice span { display: none; }
  .pattern-parts { gap: 10px; }
  .field { min-height: 52px; }
  .field .btn-round { width: 40px; min-height: 40px; }
  .field-text { font-size: 24px; }
  .card { padding: 22px 20px 20px; border-radius: 24px; }
  .card h2 { font-size: 25px; }
  .how-pic { width: 52px; height: 52px; border-radius: 14px; }
  .how-row span { font-size: 15px; }
  /* On a narrow touch screen the size and score reach across the top,
     so what the player holds goes below them. */
  body.touch .powers { top: calc(max(12px, env(safe-area-inset-top)) + 48px); }
}

/* A wide window that is not tall, like a browser on a small laptop: How
   to play fits when its rules stand two by two. */
@media (min-width: 900px) and (max-height: 820px) {
  .card:has(.how) { width: min(860px, 100%); }
  .how { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
  .how-keys { grid-column: 1 / -1; margin-top: 0; }
}

/* A phone held sideways: wide, but with very little height. */
@media (max-height: 560px) and (orientation: landscape) {
  .landing { padding-top: 3vh; padding-bottom: 14vh; }
  .logo-space { width: clamp(180px, 24vw, 280px); }
  .landing-line { margin: 6px 0 12px; font-size: 15px; }
  .btn-big { min-height: 50px; font-size: 19px; }
  .maker { width: min(500px, 60vw); padding: 12px 16px; max-height: calc(100dvh - 12px); right: max(1.5vw, env(safe-area-inset-right)); }
  .steps { margin-bottom: 8px; }
  .step-tab { min-height: 32px; }
  .step { gap: 8px; }
  .step-title, .step-note { display: none; }
  .maker-foot { margin-top: 14px; }
  .maker-foot .btn { min-height: 42px; }
  .maker-foot .btn-round, .maker-foot .btn-tight { width: 42px; }
  .field { min-height: 44px; }
  .field-text { font-size: 22px; }
  .field .btn-round { width: 36px; min-height: 36px; }
  .field-says { margin-top: -2px; font-size: 14px; }
  .namefield { gap: 6px; }
  .keys { gap: 4px; }
  .keys button { min-height: 32px; max-width: none; font-size: 16px; }
  .keys button.wide { max-width: none; }
  .slider { gap: 3px; }
  .slider-ends { font-size: 12px; line-height: 1.2; }
  /* How to play fits when its rules stand two by two. */
  .card { width: min(780px, 100%); padding: 16px 22px; max-height: calc(100dvh - 16px); }
  .card-wrap { padding: 8px; }
  .card h2 { margin-bottom: 10px; font-size: 22px; }
  .how { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
  .how-keys { grid-column: 1 / -1; margin-top: 0; padding: 8px 14px; }
  .how-pic { width: 46px; height: 46px; border-radius: 13px; }
  .how-row { gap: 12px; }
  .how-row span { font-size: 14px; }
  .card-foot { margin-top: 12px; }
  .card-foot .btn, .menu-list .btn { min-height: 44px; }
  .card-menu { width: min(400px, 100%); }
  .menu-list { gap: 8px; }
  .about-made { margin-bottom: 12px; padding: 10px 16px; }
}

body.calm .world-dot, body.calm .joining-dots::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01s !important; }
  .world-dot, .field-caret, .step.on { animation: none; }
}
