@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,650..760&family=Nunito:wght@400..900&display=swap");

:root {
  color-scheme: light;
  --ink: #18221d;
  --muted: #65746b;
  --paper: #fbfaf4;
  --panel: #ffffff;
  --field: #c8d88e;
  --grass: #89b867;
  --moss: #4d7d50;
  --clay: #c96d42;
  --stone: #77818b;
  --water: #4aa0b5;
  --gold: #d4a743;
  --line: rgba(24, 34, 29, 0.14);
  --shadow: 0 18px 50px rgba(38, 49, 38, 0.18);
  --font-body: Nunito, "Avenir Next Rounded", "Avenir Next", "Segoe UI Rounded", "Hiragino Maru Gothic ProN", ui-rounded, system-ui, sans-serif;
  --font-display: Fraunces, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: Nunito, "Avenir Next Rounded", "Avenir Next", "Segoe UI Rounded", ui-rounded, system-ui, sans-serif;
  font-family: var(--font-body);
  font-synthesis-weight: none;
}

/* Base document and shared element defaults. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(120deg, rgba(255, 188, 180, 0.18), transparent 34%),
    linear-gradient(250deg, rgba(108, 159, 176, 0.18), transparent 35%),
    linear-gradient(145deg, #f7f2e4 0%, #dce9cc 47%, #eef5f0 100%);
  color: var(--ink);
  overflow: auto;
}

button {
  border: 0;
  font: inherit;
  font-family: var(--font-ui);
  cursor: pointer;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Top-level screen layout. */
.app-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.cover-screen,
.setup-screen,
.game-screen {
  min-height: 100vh;
  min-height: 100svh;
}

/* Cover illustration and title composition. */
.cover-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  gap: 1.2rem;
}

.home-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-atmosphere::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 213, 104, 0.24), transparent 18%),
    radial-gradient(circle at 12% 18%, rgba(184, 211, 232, 0.22), transparent 18%),
    radial-gradient(circle at 48% 82%, rgba(255, 176, 197, 0.16), transparent 20%);
  animation: homeSkyBreath 16s ease-in-out infinite alternate;
}

.home-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0.2px);
  opacity: 0.74;
}

.home-orb-sun {
  top: clamp(1.3rem, 6vw, 4rem);
  right: clamp(1.6rem, 8vw, 7rem);
  width: clamp(64px, 8vw, 104px);
  aspect-ratio: 1;
  background: radial-gradient(circle, #ffd96a 0 42%, rgba(255, 224, 128, 0.34) 43% 66%, transparent 67%);
  box-shadow: 0 0 70px rgba(245, 196, 85, 0.28);
  animation: homeSunFloat 14s ease-in-out infinite alternate;
}

.home-orb-moon {
  top: clamp(5.8rem, 16vw, 12rem);
  left: clamp(1.4rem, 7vw, 6rem);
  width: clamp(44px, 5.5vw, 72px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 66% 35%, rgba(219, 230, 218, 0.9) 0 12%, transparent 13%),
    radial-gradient(circle at 42% 46%, #fff8d8 0 42%, rgba(255, 248, 216, 0.14) 43% 70%, transparent 71%);
  box-shadow: 0 0 48px rgba(255, 241, 184, 0.18);
  animation: homeMoonFloat 18s ease-in-out infinite alternate;
}

.home-rain {
  position: absolute;
  inset: -20%;
  opacity: 0.052;
  background-image:
    linear-gradient(110deg, transparent 0 47%, rgba(95, 146, 171, 0.5) 48% 49%, transparent 50% 100%);
  background-size: 132px 186px;
  transform: rotate(8deg);
  animation: homeRain 1.9s linear infinite;
  mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 78%, transparent 100%);
}

.home-wind {
  position: absolute;
  left: -24vw;
  width: clamp(120px, 20vw, 260px);
  height: 20px;
  border-top: 2px solid rgba(112, 157, 140, 0.18);
  border-radius: 999px;
  opacity: 0.8;
  animation: homeWind 12s ease-in-out infinite;
}

.home-wind::after {
  content: "";
  position: absolute;
  right: 14%;
  top: 6px;
  width: 36%;
  border-top: 2px solid rgba(112, 157, 140, 0.12);
  border-radius: inherit;
}

.wind-one {
  top: 24%;
  animation-delay: -2s;
}

.wind-two {
  top: 46%;
  width: clamp(80px, 14vw, 180px);
  animation-duration: 15s;
  animation-delay: -7s;
}

.wind-three {
  top: 69%;
  width: clamp(96px, 17vw, 220px);
  animation-duration: 18s;
  animation-delay: -11s;
}

.home-particle {
  position: absolute;
  top: -12vh;
  left: var(--x);
  opacity: 0;
  animation: homeFall var(--dur) linear infinite;
  animation-delay: var(--delay);
  transform: translate3d(0, -12vh, 0) rotate(var(--rot));
}

.home-particle.petal {
  width: 11px;
  height: 17px;
  border-radius: 999px 999px 999px 3px;
  background: rgba(241, 143, 176, 0.64);
}

.home-particle.leaf {
  width: 13px;
  height: 19px;
  border-radius: 999px 2px 999px 2px;
  background: rgba(181, 107, 49, 0.62);
}

.home-particle.snow {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.home-particle.rain-drop {
  width: 2px;
  height: 24px;
  border-radius: 999px;
  background: rgba(93, 151, 179, 0.38);
}

.particle-a { --x: 7%; --dur: 14s; --delay: -4s; --drift: 22vw; --rot: 18deg; }
.particle-b { --x: 18%; --dur: 17s; --delay: -12s; --drift: 12vw; --rot: -35deg; }
.particle-c { --x: 39%; --dur: 15s; --delay: -7s; --drift: 19vw; --rot: 54deg; }
.particle-d { --x: 71%; --dur: 18s; --delay: -14s; --drift: 8vw; --rot: -18deg; }
.particle-e { --x: 13%; --dur: 16s; --delay: -9s; --drift: 24vw; --rot: 42deg; }
.particle-f { --x: 54%; --dur: 19s; --delay: -3s; --drift: 15vw; --rot: -54deg; }
.particle-g { --x: 83%; --dur: 20s; --delay: -15s; --drift: 5vw; --rot: 26deg; }
.particle-h { --x: 93%; --dur: 15s; --delay: -6s; --drift: -7vw; --rot: -20deg; }
.particle-i { --x: 28%; --dur: 20s; --delay: -2s; --drift: 4vw; --rot: 0deg; }
.particle-j { --x: 47%; --dur: 22s; --delay: -11s; --drift: 8vw; --rot: 0deg; }
.particle-k { --x: 63%; --dur: 18s; --delay: -8s; --drift: -5vw; --rot: 0deg; }
.particle-l { --x: 76%; --dur: 23s; --delay: -17s; --drift: 6vw; --rot: 0deg; }
.particle-m { --x: 88%; --dur: 21s; --delay: -5s; --drift: -8vw; --rot: 0deg; }
.particle-n { --x: 21%; --dur: 5.5s; --delay: -2s; --drift: 10vw; --rot: 18deg; }
.particle-o { --x: 58%; --dur: 6.2s; --delay: -4s; --drift: 13vw; --rot: 18deg; }
.particle-p { --x: 86%; --dur: 5.8s; --delay: -1s; --drift: 8vw; --rot: 18deg; }

.cover-panel,
.desktop-download {
  position: relative;
  z-index: 1;
}

@keyframes homeFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -12vh, 0) rotate(var(--rot));
  }
  10% {
    opacity: 0.82;
  }
  88% {
    opacity: 0.74;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 112vh, 0) rotate(calc(var(--rot) + 260deg));
  }
}

@keyframes homeRain {
  from { background-position: 0 0; }
  to { background-position: 92px 186px; }
}

@keyframes homeWind {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0);
  }
  14% {
    opacity: 0.72;
  }
  76% {
    opacity: 0.34;
  }
  100% {
    opacity: 0;
    transform: translateX(132vw) translateY(-18px);
  }
}

@keyframes homeSkyBreath {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}

@keyframes homeSunFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-14px, 10px, 0) scale(1.06); }
}

@keyframes homeMoonFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(12px, -8px, 0) scale(1.04); }
}

.setup-screen {
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.cover-panel {
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(320px, 0.86fr);
  gap: clamp(1.2rem, 4vw, 4rem);
  align-items: center;
  min-width: 0;
  width: min(1160px, 100%);
  margin: 0 auto;
}

.desktop-download {
  align-self: end;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: auto;
  margin: 0 auto;
  min-height: 58px;
  padding: 0.42rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    radial-gradient(circle at 10% 18%, rgba(242, 167, 185, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(250, 246, 232, 0.58)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.86),
    0 10px 28px rgba(64, 82, 55, 0.1);
  backdrop-filter: blur(12px);
  transition: gap 220ms ease, padding 220ms ease;
}

.desktop-download.is-expanded {
  gap: 0.52rem;
  padding-left: 0.48rem;
}

.download-copy {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.download-stage {
  display: none;
  align-items: center;
  min-height: 24px;
  padding: 0.18rem 0.52rem;
  border: 1px solid rgba(36, 61, 49, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(36, 61, 49, 0.74);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

.download-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.64rem 1.08rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #243d31;
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.download-note {
  display: none;
  margin: 0;
  max-width: 28ch;
  color: rgba(36, 61, 49, 0.62);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
}

.download-note code {
  font-family: var(--font-ui);
  font-size: 0.96em;
}

.desktop-download.is-expanded .download-stage {
  display: inline-flex;
}

.desktop-download.is-expanded .download-note {
  display: block;
}

.download-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-8px);
  transition: max-width 260ms ease, opacity 180ms ease, transform 220ms ease;
  width: max-content;
}

.desktop-download.is-expanded .download-actions {
  max-width: 360px;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.download-word {
  color: rgba(36, 61, 49, 0.68);
  font-size: 0.78rem;
  font-weight: 850;
}

.download-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 86px;
  padding: 0.64rem 1rem;
  border: 1px solid rgba(12, 16, 14, 0.08);
  border-radius: 999px;
  background: #0e0f0e;
  color: #fffdf8;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(18, 20, 16, 0.16);
}

.download-tile.is-disabled {
  border-color: rgba(32, 30, 28, 0.1);
  background: rgba(255, 255, 255, 0.46);
  color: rgba(36, 45, 39, 0.38);
  box-shadow: none;
  cursor: not-allowed;
}

.cover-scene {
  position: relative;
  overflow: hidden;
  min-height: clamp(330px, 47vw, 560px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 235, 0.9), rgba(255, 250, 232, 0.2) 43%),
    linear-gradient(145deg, #b8d6d6 0%, #d7e5c2 52%, #a8c982 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 22px 52px rgba(64, 82, 55, 0.18);
}

.cover-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background:
    radial-gradient(circle at 34% 82%, rgba(255, 245, 195, 0.42) 0 12%, transparent 13%),
    radial-gradient(circle at 78% 62%, rgba(255, 188, 204, 0.3) 0 9%, transparent 10%);
  pointer-events: none;
}

.cover-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent 0, #000 44%, #000 100%);
  opacity: 0.55;
}

.cover-sky,
.cover-yard {
  position: absolute;
  inset: 0;
}

.cover-sun {
  position: absolute;
  top: 12%;
  right: 16%;
  width: 62px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #f3be55;
  box-shadow: 0 0 0 11px rgba(255, 241, 181, 0.35);
}

.cover-cloud {
  position: absolute;
  width: 86px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.cover-cloud::before,
.cover-cloud::after {
  content: "";
  position: absolute;
  bottom: 9px;
  border-radius: 999px;
  background: inherit;
}

.cover-cloud::before {
  left: 14px;
  width: 34px;
  height: 34px;
}

.cover-cloud::after {
  right: 14px;
  width: 28px;
  height: 28px;
}

.cloud-a {
  top: 17%;
  left: 12%;
}

.cloud-b {
  top: 31%;
  right: 9%;
  transform: scale(0.76);
}

.cover-petal {
  position: absolute;
  width: 12px;
  height: 18px;
  border-radius: 999px 999px 999px 3px;
  background: #f2a7b9;
  opacity: 0.76;
}

.petal-a {
  top: 20%;
  left: 43%;
  transform: rotate(24deg);
}

.petal-b {
  top: 34%;
  left: 26%;
  transform: rotate(-18deg) scale(0.82);
}

.petal-c {
  top: 44%;
  right: 24%;
  transform: rotate(48deg) scale(0.72);
}

.cover-yard {
  top: auto;
  height: 62%;
  background:
    radial-gradient(circle at 58% 76%, rgba(255, 244, 199, 0.32) 0 15%, transparent 16%),
    radial-gradient(circle at 81% 78%, rgba(223, 135, 169, 0.25) 0 11%, transparent 12%),
    linear-gradient(155deg, transparent 0 54%, rgba(86, 126, 74, 0.18) 54% 55%, transparent 55%),
    linear-gradient(22deg, #95be72 0%, #c0d792 100%);
  clip-path: polygon(0 30%, 100% 4%, 100% 100%, 0 100%);
}

.cover-house {
  position: absolute;
  left: 13%;
  bottom: 29%;
  width: 170px;
  height: 104px;
  border-radius: 12px 12px 8px 8px;
  background: #fff3dc;
  box-shadow: inset -16px 0 rgba(207, 176, 132, 0.18), 0 16px 22px rgba(54, 72, 47, 0.12);
}

.cover-house::before {
  content: "";
  position: absolute;
  left: -14px;
  top: -43px;
  width: 198px;
  height: 78px;
  border-radius: 50% 50% 8px 8px / 42% 42% 8px 8px;
  background: #364044;
  clip-path: polygon(0 58%, 50% 0, 100% 58%, 92% 73%, 50% 32%, 8% 73%);
}

.cover-house::after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: 0;
  width: 38px;
  height: 58px;
  border-radius: 9px 9px 0 0;
  background: #7a563a;
  box-shadow:
    65px -18px 0 -11px #9fc9d0,
    108px -18px 0 -11px #9fc9d0;
}

.cover-sign {
  position: absolute;
  left: 9%;
  bottom: 16%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 82px;
  height: 54px;
  border: 3px solid #8a5b38;
  border-radius: 12px;
  background: #fff3d4;
  color: #5f7147;
  box-shadow:
    0 12px 0 -9px rgba(75, 91, 61, 0.18),
    22px 38px 0 -18px #8a5b38;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.12;
  text-align: center;
  transform: rotate(-5deg);
}

.cover-sign::before,
.cover-sign::after {
  content: "";
  position: absolute;
  bottom: -34px;
  width: 6px;
  height: 34px;
  border-radius: 999px;
  background: #8a5b38;
}

.cover-sign::before {
  left: 18px;
}

.cover-sign::after {
  right: 18px;
}

.cover-tree {
  position: absolute;
  width: 94px;
  height: 86px;
  border-radius: 48% 52% 45% 55%;
  background: #4f9855;
  box-shadow:
    inset 14px 10px rgba(255, 255, 255, 0.13),
    inset -12px -10px rgba(36, 77, 45, 0.16);
}

.cover-tree::after {
  content: "";
  position: absolute;
  left: 43%;
  bottom: -38px;
  width: 13px;
  height: 48px;
  border-radius: 999px;
  background: #8a5b38;
}

.tree-a {
  right: 9%;
  bottom: 37%;
  transform: rotate(-8deg);
}

.tree-b {
  right: 3%;
  bottom: 25%;
  width: 70px;
  height: 64px;
  background: #d9829c;
  transform: rotate(8deg);
}

.cover-flower {
  position: absolute;
  z-index: 3;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 11px 11px, #f4cf55 0 4px, transparent 4.5px),
    radial-gradient(circle at 19px 8px, #e87b9d 0 5px, transparent 5.5px),
    radial-gradient(circle at 28px 13px, #fff8d8 0 5px, transparent 5.5px),
    radial-gradient(circle at 38px 9px, #f0a8bd 0 4px, transparent 4.5px),
    radial-gradient(ellipse at 50% 100%, #5f9a55 0 58%, transparent 59%);
}

.flower-a {
  left: 33%;
  bottom: 22%;
}

.flower-b {
  left: 64%;
  bottom: 29%;
  transform: scale(0.9) rotate(5deg);
}

.flower-c {
  right: 10%;
  bottom: 12%;
  transform: scale(0.82) rotate(-8deg);
}

.cover-butterfly {
  position: absolute;
  z-index: 4;
  width: 20px;
  height: 17px;
  background:
    radial-gradient(ellipse at 30% 48%, #f0a8bd 0 35%, transparent 38%),
    radial-gradient(ellipse at 70% 48%, #f4cf55 0 35%, transparent 38%);
}

.cover-butterfly::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: #526047;
}

.butterfly-a {
  left: 54%;
  bottom: 48%;
  transform: rotate(13deg);
}

.butterfly-b {
  right: 28%;
  bottom: 37%;
  transform: scale(0.72) rotate(-18deg);
}

.cover-path {
  position: absolute;
  left: 29%;
  bottom: -12%;
  width: 192px;
  height: 180px;
  border-radius: 999px 999px 0 0;
  border: 34px solid rgba(235, 218, 177, 0.98);
  border-bottom: 0;
  transform: rotate(-18deg);
  box-shadow: inset 0 0 0 9px rgba(255, 245, 211, 0.34);
}

.cover-stones {
  position: absolute;
  left: 43%;
  bottom: 18%;
  z-index: 4;
  width: 104px;
  height: 38px;
  background:
    radial-gradient(ellipse at 12px 24px, #ded2bb 0 10px, transparent 11px),
    radial-gradient(ellipse at 38px 13px, #cfc3af 0 8px, transparent 9px),
    radial-gradient(ellipse at 67px 24px, #e7dac2 0 10px, transparent 11px),
    radial-gradient(ellipse at 91px 12px, #cfc3af 0 7px, transparent 8px);
}

.cover-pond {
  position: absolute;
  right: 13%;
  bottom: 7%;
  width: 118px;
  height: 55px;
  border-radius: 52% 48% 58% 42%;
  background: #63b5c1;
  box-shadow:
    inset -20px -10px rgba(43, 132, 145, 0.16),
    inset 18px 8px rgba(255, 255, 255, 0.25),
    0 7px 0 rgba(50, 101, 109, 0.18);
}

.cover-pond::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 13px;
  width: 44px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.cover-dino {
  position: absolute;
  left: 49%;
  bottom: 13%;
  z-index: 5;
  width: 112px;
  height: 92px;
  border-radius: 52% 48% 43% 45%;
  background:
    radial-gradient(ellipse at 52% 68%, #f7df9f 0 29%, transparent 30%),
    radial-gradient(circle at 35px 18px, rgba(255, 255, 255, 0.18) 0 13px, transparent 14px),
    linear-gradient(145deg, #91c67d 0%, #6fad68 100%);
  box-shadow:
    0 12px 0 rgba(45, 65, 56, 0.12),
    inset -12px -12px rgba(69, 133, 73, 0.14);
}

.cover-dino::before {
  content: "";
  position: absolute;
  inset: auto 16px -5px;
  height: 13px;
  border-radius: 999px;
  background: rgba(45, 65, 56, 0.17);
  filter: blur(1px);
}

.cover-dino::after {
  content: "";
  position: absolute;
  left: 42px;
  bottom: 6px;
  z-index: 4;
  width: 7px;
  height: 10px;
  border-radius: 999px;
  background: rgba(72, 91, 54, 0.52);
  box-shadow:
    12px 0 0 rgba(72, 91, 54, 0.52),
    24px 0 0 rgba(72, 91, 54, 0.52);
}

.dino-face {
  position: absolute;
  left: 19px;
  top: -31px;
  z-index: 3;
  width: 91px;
  height: 73px;
  border-radius: 54% 48% 52% 46%;
  background:
    radial-gradient(circle at 27px 15px, rgba(255, 255, 255, 0.18) 0 13px, transparent 14px),
    linear-gradient(145deg, #91c67d 0%, #74b66b 100%);
  box-shadow:
    0 6px 0 rgba(45, 65, 56, 0.08),
    inset -7px -7px rgba(69, 133, 73, 0.14);
}

.dino-face::before {
  content: "";
  position: absolute;
  left: 13px;
  top: -16px;
  z-index: 4;
  width: 13px;
  height: 17px;
  border-radius: 999px 999px 2px 2px;
  background: #f1bf62;
  transform: rotate(-11deg);
  filter:
    drop-shadow(20px -4px 0 #f1bf62)
    drop-shadow(40px 0 0 #f1bf62);
}

.dino-face::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: 6px;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: #f8e1a7;
  box-shadow:
    inset 3px -3px rgba(224, 195, 128, 0.12),
    0 2px 0 rgba(45, 65, 56, 0.04);
}

.dino-eye {
  position: absolute;
  left: 30px;
  top: 28px;
  z-index: 4;
  width: 9px;
  height: 12px;
  border-radius: 999px;
  background: #172237;
  box-shadow: 30px 0 0 #172237;
}

.dino-eye::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 2.2px;
  height: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 30px 0 0 #ffffff;
}

.dino-cheeks {
  position: absolute;
  left: 25px;
  top: 48px;
  z-index: 5;
  width: 13px;
  height: 10px;
  border-radius: 999px;
  background: rgba(245, 133, 158, 0.46);
  box-shadow: 44px 0 0 rgba(245, 133, 158, 0.46);
}

.dino-smile {
  position: absolute;
  left: 47px;
  top: 49px;
  z-index: 6;
  width: 16px;
  height: 9px;
  border-bottom: 2px solid rgba(23, 34, 55, 0.64);
  border-radius: 0 0 999px 999px;
}

.dino-smile::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -6px;
  width: 5px;
  height: 4px;
  border-radius: 50% 50% 70% 70%;
  background: rgba(23, 34, 55, 0.58);
}

.dino-belly {
  position: absolute;
  left: 33px;
  bottom: 14px;
  z-index: 3;
  width: 49px;
  height: 55px;
  border-radius: 999px;
  background: #f8e5aa;
  box-shadow: inset 4px -4px rgba(224, 195, 128, 0.12);
}

.dino-arm {
  position: absolute;
  top: 42px;
  z-index: 4;
  width: 28px;
  height: 19px;
  border-radius: 999px 999px 14px 999px;
  background: #6aaa66;
  box-shadow: inset -5px -3px rgba(62, 124, 68, 0.12);
}

.arm-left {
  left: -8px;
  transform: rotate(-22deg);
}

.arm-right {
  right: -7px;
  transform: scaleX(-1) rotate(-22deg);
}

.dino-feet {
  position: absolute;
  left: 21px;
  bottom: -6px;
  z-index: 4;
  width: 29px;
  height: 18px;
  border-radius: 999px 999px 11px 11px;
  background:
    radial-gradient(ellipse at 50% 72%, #efbf63 0 35%, transparent 37%),
    #6aaa66;
  box-shadow: 49px 0 0 #6aaa66;
}

.dino-feet::after {
  content: "";
  position: absolute;
  left: 49px;
  top: 0;
  width: 29px;
  height: 18px;
  border-radius: 999px 999px 11px 11px;
  background:
    radial-gradient(ellipse at 50% 72%, #efbf63 0 35%, transparent 37%),
    #6aaa66;
}

.dino-tail {
  position: absolute;
  right: -38px;
  bottom: 24px;
  z-index: -1;
  width: 68px;
  height: 44px;
  border-right: 16px solid #79b86f;
  border-bottom: 16px solid #79b86f;
  border-radius: 0 0 58px 0;
  transform: rotate(-8deg);
  filter: drop-shadow(5px 6px 0 rgba(45, 65, 56, 0.1));
}

.dino-tail::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -3px;
  width: 25px;
  height: 25px;
  background: #efbf63;
  clip-path: polygon(12% 50%, 100% 0, 82% 96%);
}

.dino-back-spikes {
  position: absolute;
  right: -6px;
  top: 16px;
  z-index: 4;
  width: 12px;
  height: 15px;
  background: #efbf63;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  filter:
    drop-shadow(3px 23px 0 #efbf63)
    drop-shadow(0 44px 0 #efbf63);
}

.setup-copy {
  max-width: 600px;
}

.eyebrow,
.tool-label {
  margin: 0 0 0.45rem;
  color: #647061;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.8rem;
  max-width: 560px;
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 5.6vw, 5.15rem);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 720;
  line-height: 1.05;
}

h3 {
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.setup-copy p:not(.eyebrow) {
  max-width: 500px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

/* Shared action buttons and setup/save cards. */
.setup-actions,
.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.save-picker {
  display: grid;
  gap: 0.6rem;
  width: min(100%, 760px);
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(47, 43, 39, 0.1);
  border-radius: 12px;
  background: rgba(255, 252, 245, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.save-picker.is-empty {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.save-picker-title {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.save-slot {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  overflow: hidden;
}

.save-slot.is-current {
  border-color: rgba(67, 120, 84, 0.45);
  box-shadow: 0 10px 24px rgba(67, 120, 84, 0.12);
}

.save-slot-open {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 2.9rem 0.55rem 0.55rem;
  border: 0;
  background: transparent;
  color: #1c241c;
  text-align: left;
}

.save-slot-preview {
  display: block;
  width: 92px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
  background: #e8e0d0;
  box-shadow: 0 8px 20px rgba(34, 31, 27, 0.08);
}

.save-slot-preview-fallback {
  display: grid;
  place-items: center;
  gap: 0.18rem;
  width: 92px;
  height: 58px;
  padding: 0.35rem;
  background:
    linear-gradient(180deg, rgba(137, 182, 214, 0.95), rgba(241, 224, 182, 0.95)),
    #e8e0d0;
  color: rgba(33, 31, 28, 0.78);
  font-size: 0.63rem;
  font-weight: 800;
  text-align: center;
}

.save-slot-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.save-slot strong {
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.2;
}

.save-slot span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.25;
}

.save-slot:hover,
.save-slot-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(34, 31, 27, 0.09);
}

.save-slot-delete {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  padding: 0 0.45rem;
  border: 1px solid rgba(54, 48, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.92);
  color: rgba(69, 57, 48, 0.74);
  box-shadow: 0 6px 18px rgba(34, 31, 27, 0.08);
  font-size: 0.64rem;
  font-weight: 800;
}

.save-slot-delete svg {
  width: 0.92rem;
  height: 0.92rem;
}

.save-slot-delete.is-armed {
  background: rgba(137, 46, 34, 0.94);
  border-color: rgba(137, 46, 34, 0.94);
  color: #fff8f5;
}

.primary-action,
.secondary-action,
.tool-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-action {
  background: #2f2b27;
  color: white;
  box-shadow: 0 14px 24px rgba(34, 31, 27, 0.2);
}

.cover-screen .primary-action {
  min-width: 152px;
  min-height: 52px;
  padding-inline: 1.35rem;
  border-radius: 12px;
  background: #2f2b27;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 16px 28px rgba(34, 31, 27, 0.2);
  font-size: 1.05rem;
}

.secondary-action,
.tool-button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border: 1px solid var(--line);
}

.tool-button.is-confirmed {
  border-color: rgba(67, 120, 84, 0.4);
  background: rgba(231, 246, 234, 0.95);
  color: #29573a;
}

.topbar .tool-button.is-confirmed {
  min-width: 168px;
}

.primary-action:hover,
.secondary-action:hover,
.tool-button:hover,
.icon-button:hover,
.icon-tool:hover,
.palette-button:hover {
  transform: translateY(-1px);
}

/* Setup selection screen. */
.choice-panel {
  display: grid;
  gap: 0.9rem;
  width: min(940px, 100%);
  padding: clamp(0.8rem, 1.35vw, 1.05rem);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 250, 239, 0.58)),
    rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 54px rgba(34, 31, 27, 0.12);
  backdrop-filter: blur(18px);
}

.choice-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(0.85rem, 2vw, 1.4rem);
  align-items: center;
  padding: 0.1rem 0.1rem 0.2rem;
}

.choice-intro h1 {
  margin-bottom: 0;
  min-width: 0;
  max-width: 14ch;
  font-size: clamp(2.05rem, 3vw, 3.35rem);
  line-height: 0.98;
  text-wrap: balance;
}

.choice-actions {
  display: grid;
  justify-items: end;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}

.choice-actions .primary-action {
  min-width: 140px;
  min-height: 48px;
  border-radius: 12px;
  font-size: 1rem;
}

.choice-actions .setup-actions > button {
  min-height: 48px;
}

.choice-section {
  min-width: 0;
}

.setup-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.mode-card {
  display: grid;
  gap: 0.42rem;
  min-height: 154px;
  padding: 1rem;
  border: 1px solid rgba(54, 48, 42, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 239, 0.72)),
    rgba(255, 255, 255, 0.7);
  text-align: left;
  box-shadow: 0 16px 30px rgba(34, 31, 27, 0.08);
}

.mode-card strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 720;
  line-height: 1.1;
}

.mode-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.setupSavedView .save-picker,
#setupSavedView .save-picker {
  width: 100%;
}

.setupSavedView .choice-panel,
#setupSavedView.choice-panel {
  width: min(760px, 100%);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 720;
  line-height: 1.08;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.option-card {
  min-height: 136px;
  padding: 0.52rem 0.52rem 0.62rem;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.95);
  text-align: center;
  box-shadow: 0 8px 24px rgba(24, 34, 29, 0.08);
}

.option-card.is-selected {
  border-color: rgba(47, 43, 39, 0.72);
  background: #fffdf7;
  box-shadow:
    0 14px 28px rgba(34, 31, 27, 0.12),
    inset 0 0 0 2px rgba(245, 184, 75, 0.24);
}

.option-preview {
  display: block;
  width: 100%;
  height: 84px;
  margin-bottom: 0.42rem;
  border-radius: 10px;
  background: #e9efd9;
}

.option-kicker {
  display: block;
  margin-bottom: 0.1rem;
  color: #9b6d42;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.option-name {
  display: block;
  max-width: 22ch;
  margin: 0 auto;
  color: #202b25;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.option-desc {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.selection-ticket {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.ticket-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.42rem 0.64rem;
  border: 1px solid rgba(54, 48, 42, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.78);
  color: rgba(48, 42, 37, 0.82);
  box-shadow: 0 8px 18px rgba(34, 31, 27, 0.07);
  font-size: 0.82rem;
  font-weight: 900;
}

.is-hidden {
  display: none !important;
}

/* Main game shell, top bar, and responsive side panels. */
.game-screen {
  display: grid;
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  height: 100svh;
  padding: 0.8rem;
  gap: 0.8rem;
  overflow: hidden;
}

.game-screen.is-hidden {
  display: none;
}

.topbar,
.toolbar,
.inspector {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.46), rgba(255, 250, 239, 0.28)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 12px 30px rgba(34, 31, 27, 0.09);
  backdrop-filter: blur(18px) saturate(1.02);
}

.topbar {
  position: absolute;
  top: 1.55rem;
  right: calc(220px + 1.6rem);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0.28rem;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 253, 247, 0.16);
  box-shadow: 0 12px 28px rgba(34, 31, 27, 0.06);
  pointer-events: none;
}

.game-screen.inspector-collapsed .topbar {
  right: calc(52px + 1.6rem);
}

.topbar > div:first-child {
  display: none;
}

.topbar .top-actions {
  gap: 0.32rem;
  pointer-events: auto;
}

.topbar .tool-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 18px rgba(34, 31, 27, 0.06);
  font-size: 0;
}

.topbar .tool-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.play-area {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.toolbar {
  position: absolute;
  top: 0.8rem;
  bottom: 0.8rem;
  left: 0.8rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.72rem;
  width: 138px;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  transition:
    width 180ms ease,
    min-height 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.toolbar-toggle {
  display: grid;
  place-items: center;
  align-self: end;
  width: 34px;
  height: 34px;
  margin: -0.2rem 0 0;
  border: 1px solid rgba(54, 48, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.5);
  color: rgba(32, 30, 28, 0.8);
  box-shadow: 0 6px 16px rgba(34, 31, 27, 0.06);
}

.toolbar-toggle svg {
  width: 1rem;
  height: 1rem;
  transition: transform 180ms ease;
}

.game-screen.toolbar-collapsed .toolbar {
  width: 52px;
  bottom: auto;
  min-height: 52px;
  padding: 0.52rem;
}

.game-screen.toolbar-collapsed .toolbar-toggle {
  align-self: center;
  margin: 0;
}

.game-screen.toolbar-collapsed .toolbar-toggle svg {
  transform: rotate(180deg);
}

.game-screen.toolbar-collapsed .tool-section {
  display: none;
}

.tool-section {
  display: grid;
  gap: 0.62rem;
  min-height: 0;
  flex: 1;
}

.toolbar .tool-label {
  margin: 0;
  padding: 0.18rem 0.12rem 0;
  text-align: center;
  letter-spacing: 0.075em;
}

.palette,
.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 52px);
  grid-auto-rows: 52px;
  gap: 0.5rem;
  justify-content: center;
}

.palette {
  position: relative;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.05rem 0.12rem 0.2rem 0;
  scrollbar-width: thin;
}

.palette-button,
.icon-tool,
.icon-button {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.58);
  color: rgba(32, 30, 28, 0.84);
}

.palette-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0.18rem;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 6px 14px rgba(34, 31, 27, 0.07);
}

.palette-button.is-active,
.icon-tool.is-active,
.variant-button.is-active {
  background: rgba(39, 36, 32, 0.82);
  color: #fffaf0;
  border-color: rgba(39, 36, 32, 0.5);
}

.palette-snippet {
  width: 36px;
  height: 36px;
  display: block;
  filter: drop-shadow(0 2px 1px rgba(24, 34, 29, 0.1));
  stroke-linecap: round;
  stroke-linejoin: round;
}

.variant-picker {
  display: grid;
  position: fixed;
  top: 4.65rem;
  left: calc(0.8rem + 138px + 0.55rem);
  z-index: 12;
  width: 180px;
  gap: 0.38rem;
  padding: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 14px 34px rgba(34, 31, 27, 0.12);
  backdrop-filter: blur(16px);
}

.variant-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 0.38rem;
  min-height: 38px;
  padding: 0.25rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.64);
  color: rgba(32, 30, 28, 0.84);
  text-align: left;
}

.variant-button .palette-snippet {
  width: 30px;
  height: 30px;
}

.variant-button span {
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.05;
  text-overflow: ellipsis;
}

/* Canvas HUD and status feedback. */
.stage-wrap {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #dde8c1;
  box-shadow: inset 0 0 0 1px rgba(24, 34, 29, 0.08), var(--shadow);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

canvas.is-panning {
  cursor: grabbing;
}

.hud {
  position: absolute;
  top: 0.9rem;
  left: calc(138px + 2.3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  pointer-events: none;
}

.game-screen.toolbar-collapsed .hud {
  left: calc(52px + 2.1rem);
}

.meter {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
  min-width: 0;
  min-height: 40px;
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 24px rgba(34, 31, 27, 0.04);
  backdrop-filter: blur(12px) saturate(1.05);
}

.meter:has(.hud-speed) {
  pointer-events: auto;
}

.hud-speed {
  display: grid;
  grid-template-columns: 23px minmax(28px, 1fr) 23px;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.12rem;
}

.hud-speed button {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(32, 30, 28, 0.72);
  font-weight: 900;
}

.hud-speed span {
  color: rgba(32, 30, 28, 0.7);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.meter span,
.inspector-card p {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.meter > span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(32, 30, 28, 0.62);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.season-meter > span {
  width: auto;
  min-width: 0;
  height: auto;
  background: transparent;
  font-size: 0;
}

.meter strong {
  display: block;
  margin-top: 0;
  color: rgba(32, 30, 28, 0.76);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1;
}

.budget-meter > span {
  background: rgba(238, 252, 243, 0.28);
  color: rgba(31, 93, 67, 0.8);
}

.budget-meter strong {
  color: #1f5d43;
}

.season-meter strong {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 1.16rem;
}

.season-meter .season-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.day-meter strong::before {
  content: "#";
  margin-right: 0.08rem;
  color: rgba(32, 30, 28, 0.38);
  font-size: 0.78rem;
}

.toast {
  position: absolute;
  right: calc(220px + 1.8rem);
  bottom: 1rem;
  max-width: min(320px, calc(100% - 2rem));
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: rgba(24, 34, 29, 0.88);
  color: white;
  font-size: 0.84rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-preview {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  max-width: min(380px, calc(100% - 2rem));
  padding: 0.6rem;
}

.game-screen.inspector-collapsed .toast {
  right: calc(52px + 1.8rem);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-preview {
  display: block;
  width: 92px;
  height: 64px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.toast-copy {
  display: grid;
  gap: 0.18rem;
}

.toast-copy strong {
  font-size: 0.84rem;
  line-height: 1.2;
}

.toast-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}

/* Inspector, edit controls, and night-mode panel treatments. */
.inspector {
  position: absolute;
  top: 5.05rem;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 18;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.7rem;
  width: 220px;
  min-width: 0;
  overflow: visible;
  transition:
    width 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.inspector-toggle {
  display: grid;
  place-items: center;
  align-self: start;
  width: 34px;
  height: 34px;
  margin: -0.22rem 0 0.1rem auto;
  border: 1px solid rgba(54, 48, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.46);
  color: rgba(32, 30, 28, 0.8);
  box-shadow: 0 6px 16px rgba(34, 31, 27, 0.06);
}

.inspector-toggle svg {
  width: 1rem;
  height: 1rem;
  transition: transform 180ms ease;
}

.game-screen.inspector-collapsed .inspector {
  width: 52px;
  bottom: auto;
  min-height: 52px;
  padding: 0.52rem;
}

.game-screen.inspector-collapsed .inspector-toggle {
  margin: 0;
}

.game-screen.inspector-collapsed .inspector-toggle svg {
  transform: rotate(180deg);
}

.game-screen.inspector-collapsed .inspector-card {
  display: none;
}

.inspector-card {
  padding: 0.2rem 0.15rem 0.55rem;
}

.selected-card {
  display: grid;
  gap: 0.28rem;
}

.selected-card .tool-label {
  margin-bottom: 0;
  font-size: 0.64rem;
  letter-spacing: 0.065em;
}

.selected-card h3 {
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 720;
  line-height: 1.1;
}

.selected-card p {
  margin-bottom: 0;
  font-size: 0.68rem;
  line-height: 1.25;
}

.inspector-card + .inspector-card {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(54, 48, 42, 0.12);
}

.game-screen.is-night .topbar,
.game-screen.is-night .toolbar,
.game-screen.is-night .inspector {
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(10, 14, 24, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 32px rgba(0, 0, 0, 0.18);
}

.game-screen.is-night .tool-label,
.game-screen.is-night .inspector-card p,
.game-screen.is-night .meter span,
.game-screen.is-night .hud-speed span {
  color: rgba(255, 255, 255, 0.78);
}

.game-screen.is-night h3,
.game-screen.is-night .meter strong,
.game-screen.is-night .stepper span {
  color: rgba(255, 255, 255, 0.94);
}

.game-screen.is-night .palette-button,
.game-screen.is-night .icon-tool,
.game-screen.is-night .icon-button,
.game-screen.is-night .tool-button,
.game-screen.is-night .variant-button,
.game-screen.is-night .toolbar-toggle,
.game-screen.is-night .inspector-toggle,
.game-screen.is-night .hud-speed button {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

.game-screen.is-night .palette-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 16px rgba(0, 0, 0, 0.16);
}

.game-screen.is-night .topbar .tool-button {
  background: rgba(255, 255, 255, 0.16);
}

.game-screen.is-night .tool-button.is-confirmed {
  background: rgba(132, 196, 144, 0.24);
  border-color: rgba(132, 196, 144, 0.34);
  color: rgba(229, 255, 234, 0.96);
}

.game-screen.is-night .palette-button.is-active,
.game-screen.is-night .icon-tool.is-active,
.game-screen.is-night .variant-button.is-active {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
}

.game-screen.is-night .meter {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.game-screen.is-night .budget-meter > span {
  color: rgba(144, 211, 162, 0.95);
}

.game-screen.is-night .budget-meter strong {
  color: #90d3a2;
}

.game-screen.is-night .quiet-danger {
  color: rgba(255, 214, 206, 0.82);
  text-decoration-color: rgba(255, 214, 206, 0.35);
}

.game-screen.is-night .quiet-danger:hover,
.game-screen.is-night .quiet-danger:focus-visible,
.game-screen.is-night .quiet-danger.is-armed {
  color: rgba(255, 197, 184, 0.98);
  text-decoration-color: currentColor;
}

.game-screen.is-night .day-meter strong::before {
  color: rgba(255, 255, 255, 0.56);
}

.game-screen.is-night .inspector-card + .inspector-card {
  border-top-color: rgba(255, 255, 255, 0.16);
}

.inspector-card.compact {
  display: grid;
  gap: 0.55rem;
}

.time-actions {
  display: grid;
  gap: 0.45rem;
}

.time-actions .tool-button {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.65rem;
}

.quiet-danger {
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(106, 74, 67, 0.78);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(106, 74, 67, 0.28);
  text-underline-offset: 0.18rem;
  opacity: 0.74;
}

.quiet-danger:hover,
.quiet-danger:focus-visible {
  opacity: 1;
  color: rgba(132, 54, 47, 0.94);
  text-decoration-color: currentColor;
}

.quiet-danger.is-armed {
  color: #8a2d23;
  opacity: 1;
  text-decoration-color: currentColor;
}

.quiet-danger:disabled {
  opacity: 0.38;
  cursor: default;
  text-decoration-color: transparent;
}

.stepper {
  display: grid;
  grid-template-columns: 34px minmax(46px, 1fr) 34px;
  align-items: center;
  gap: 0.32rem;
  margin-top: 0.38rem;
}

.stepper .icon-button {
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.stepper span {
  font-size: 0.86rem;
  text-align: center;
  font-weight: 900;
}

/* Responsive layout for tablets and phones. */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .setup-screen {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .cover-panel {
    grid-template-columns: minmax(240px, 0.85fr) minmax(260px, 1fr);
    align-items: center;
  }

  .desktop-download {
    align-items: flex-start;
  }

  .cover-scene {
    min-height: 260px;
  }

  h1 {
    font-size: clamp(2.15rem, 6.6vw, 3.75rem);
  }

  .setup-copy p:not(.eyebrow) {
    font-size: 0.95rem;
  }

  .selection-ticket {
    margin: 0.78rem 0;
  }

  .choice-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .choice-intro h1 {
    max-width: 100%;
  }

  .choice-actions {
    justify-items: start;
  }

  .choice-panel {
    width: min(100%, 760px);
  }

  .setup-mode-grid {
    grid-template-columns: 1fr;
  }

  .option-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .option-card {
    min-height: 126px;
    padding: 0.48rem;
  }

  .option-preview {
    height: 78px;
    margin-bottom: 0.42rem;
  }

  .option-name {
    font-size: 0.78rem;
  }

  .option-desc {
    font-size: 0.68rem;
  }

  .game-screen {
    min-height: 100svh;
    padding: max(0.55rem, env(safe-area-inset-top)) max(0.55rem, env(safe-area-inset-right)) max(0.55rem, env(safe-area-inset-bottom)) max(0.55rem, env(safe-area-inset-left));
    overflow: auto;
  }

  .topbar {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 30;
    max-width: min(calc(100% - 1.1rem), 360px);
    min-height: 46px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar .top-actions {
    gap: 0.3rem;
  }

  .topbar .tool-button {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 10px 24px rgba(34, 31, 27, 0.04);
  }

  .topbar .tool-button svg {
    width: 1.12rem;
    height: 1.12rem;
  }

  .game-screen.inspector-collapsed .topbar {
    right: 0.55rem;
  }

  .topbar::-webkit-scrollbar {
    display: none;
  }

  .play-area {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(400px, 66svh) auto auto;
    align-content: start;
    gap: 0.6rem;
  }

  .game-screen.inspector-collapsed .play-area {
    grid-template-rows: minmax(400px, 66svh) 66px 58px;
  }

  .game-screen:not(.inspector-collapsed) .play-area {
    grid-template-rows: minmax(360px, 58svh) 66px auto;
  }

  .toolbar {
    position: relative;
    inset: auto;
    flex-direction: row;
    order: 2;
    width: auto;
    max-width: 100%;
    height: 66px;
    min-height: 66px;
    max-height: 66px;
    padding: 0.48rem;
    overflow: visible;
  }

  .game-screen.toolbar-collapsed .toolbar {
    width: auto;
    min-height: 50px;
    padding: 0.48rem;
  }

  .tool-section {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    flex: 1;
    min-width: 0;
    min-height: auto;
  }

  .toolbar .tool-label {
    min-width: 38px;
    padding-top: 0;
    text-align: left;
    font-size: 0.64rem;
  }

  .toolbar-toggle {
    align-self: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }

  .palette {
    display: flex;
    justify-content: flex-start;
    gap: 0.42rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.05rem 0.08rem 0.28rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .palette-button {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    scroll-snap-align: start;
  }

  .palette-snippet {
    width: 29px;
    height: 29px;
  }

  .variant-picker {
    position: absolute;
    top: auto;
    bottom: calc(100% + 0.55rem);
    left: max(0.25rem, env(safe-area-inset-left));
    max-width: min(220px, calc(100vw - 1.5rem));
  }

  .stage-wrap {
    order: 1;
    min-height: 400px;
    height: 66svh;
    max-height: 680px;
  }

  .game-screen:not(.inspector-collapsed) .stage-wrap {
    min-height: 360px;
    height: 58svh;
  }

  .hud {
    top: 0.7rem;
    left: 0.7rem;
    right: auto;
    max-width: calc(100% - 250px);
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .meter {
    min-height: 42px;
    padding: 0.24rem 0.5rem;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 10px 24px rgba(34, 31, 27, 0.04);
  }

  .meter > span {
    min-width: 20px;
    height: 20px;
    font-size: 0.72rem;
  }

  .meter strong {
    font-size: 0.82rem;
  }

  .season-meter strong {
    font-size: 0.98rem;
  }

  .hud-speed {
    grid-template-columns: 28px 30px 28px;
  }

  .hud-speed button {
    width: 28px;
    height: 28px;
  }

  .toast {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .game-screen.inspector-collapsed .toast {
    right: 0.75rem;
  }

  .inspector {
    position: relative;
    order: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.48rem;
    width: auto;
    max-width: 100%;
    min-height: 66px;
    padding: 0.46rem 2.7rem 0.46rem 0.52rem;
    border-radius: 10px;
    overflow: hidden;
  }

  .game-screen:not(.inspector-collapsed) .inspector {
    margin-top: -4.8rem;
  }

  .inspector-toggle {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 30px;
    height: 30px;
    margin: 0;
    border-radius: 8px;
  }

  .inspector-toggle svg {
    width: 0.9rem;
    height: 0.9rem;
  }

  .game-screen.inspector-collapsed .inspector {
    justify-self: start;
    width: 58px;
    max-width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0.48rem;
    align-content: center;
    justify-items: center;
  }

  .selected-card {
    gap: 0.18rem;
    padding-bottom: 0.16rem;
    min-width: 0;
  }

  .selected-card .tool-label,
  .inspector-card .tool-label {
    margin-bottom: 0;
    font-size: 0.58rem;
    letter-spacing: 0.065em;
  }

  .selected-card h3 {
    font-size: 0.82rem;
  }

  .selected-card p {
    max-width: 34ch;
    overflow: hidden;
    font-size: 0.62rem;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .selected-card .zoom-stepper {
    display: none;
  }

  .inspector-card {
    padding: 0;
  }

  .inspector-card.compact {
    gap: 0.32rem;
  }

  .inspector-card + .inspector-card {
    padding-top: 0;
    border-top: 0;
  }

  .time-actions {
    grid-template-columns: repeat(3, 38px);
    gap: 0.34rem;
  }

  .time-actions .tool-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    gap: 0;
    border-radius: 8px;
    font-size: 0;
    line-height: 1;
  }

  .time-actions .tool-button svg,
  .edit-grid .icon-tool svg {
    width: 1rem;
    height: 1rem;
  }

  .edit-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.34rem;
    justify-content: flex-start;
  }

  .edit-grid .icon-tool {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 8px;
  }

  .quiet-danger {
    display: none;
  }
}

@media (max-width: 560px) {
  .setup-screen {
    padding: 0.85rem;
  }

  .choice-intro h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
    max-width: 100%;
  }

  .cover-panel {
    grid-template-columns: 1fr;
  }

  .desktop-download {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    max-width: calc(100vw - 2rem);
    padding: 0.54rem 0.62rem;
  }

  .desktop-download.is-expanded {
    gap: 0.4rem;
  }

  .download-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.34rem;
  }

  .desktop-download:not(.is-expanded) .download-actions {
    display: none;
  }

  .download-copy {
    gap: 0.22rem;
  }

  .download-stage {
    min-height: 22px;
    padding: 0.16rem 0.46rem;
    font-size: 0.62rem;
  }

  .download-note {
    max-width: 24ch;
    font-size: 0.64rem;
  }

  .download-tile {
    min-width: auto;
    min-height: 42px;
    padding: 0.62rem 0.84rem;
  }

  .desktop-download.is-expanded .download-actions {
    max-width: 270px;
  }

  .cover-scene {
    min-height: 250px;
    border-radius: 14px;
  }

  .cover-scene::before {
    background-size: 32px 32px;
  }

  .cover-yard {
    height: 58%;
  }

  .cover-house {
    left: 7%;
    bottom: 34%;
    width: 118px;
    height: 76px;
  }

  .cover-house::before {
    left: -10px;
    top: -35px;
    width: 138px;
    height: 62px;
  }

  .cover-house::after {
    left: 22px;
    width: 30px;
    height: 44px;
    box-shadow:
      48px -12px 0 -9px #9fc9d0,
      82px -12px 0 -9px #9fc9d0;
  }

  .cover-sign {
    left: 7%;
    bottom: 14%;
    width: 64px;
    height: 44px;
    font-size: 0.56rem;
  }

  .cover-path {
    left: 36%;
    width: 110px;
  }

  .cover-pond {
    right: 10%;
    bottom: 10%;
    width: 78px;
    height: 42px;
  }

  .cover-tree {
    width: 68px;
    height: 62px;
  }

  .tree-a {
    right: 18%;
    bottom: 28%;
  }

  .tree-b {
    right: 7%;
    bottom: 22%;
  }

  .cover-dino {
    left: 56%;
    bottom: 9%;
    transform: translateX(-50%) scale(0.72);
    transform-origin: bottom center;
  }

  .topbar,
  .setup-actions {
    align-items: flex-start;
  }

  .topbar {
    width: auto;
    max-width: none;
    height: 32px;
    min-height: 0;
    padding: 0;
    align-items: center;
    overflow: hidden;
    right: 0.5rem;
  }

  .top-actions {
    width: auto;
    gap: 0.22rem;
    flex-wrap: nowrap;
  }

  .tool-button {
    flex: 1;
    justify-content: center;
  }

  .topbar .tool-button {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
  }

  .topbar .tool-button.is-confirmed {
    flex-basis: 30px;
    width: 30px;
    min-width: 30px;
    font-size: 0;
  }

  .topbar .tool-button svg {
    width: 0.95rem;
    height: 0.95rem;
  }

  .play-area {
    grid-template-rows: minmax(360px, 64svh) auto auto;
    align-content: start;
  }

  .game-screen.inspector-collapsed .play-area {
    grid-template-rows: minmax(360px, 64svh) 66px 58px;
  }

  .game-screen:not(.inspector-collapsed) .play-area {
    grid-template-rows: minmax(320px, 54svh) 66px auto;
  }

  .stage-wrap {
    min-height: 360px;
    height: 64svh;
    border-radius: 8px;
  }

  .game-screen:not(.inspector-collapsed) .stage-wrap {
    min-height: 320px;
    height: 54svh;
  }

  .hud {
    top: 0.55rem;
    left: 0.5rem;
    right: auto;
    max-width: calc(100% - 168px);
    gap: 0.22rem;
  }

  .meter {
    gap: 0.22rem;
    min-height: 32px;
    padding: 0.18rem 0.34rem;
    border-radius: 8px;
  }

  .meter > span {
    min-width: 18px;
    height: 18px;
  }

  .budget-meter > span,
  .day-meter > span {
    display: none;
  }

  .season-meter {
    display: none;
  }

  .hud-speed {
    grid-template-columns: 22px 24px 22px;
    gap: 0.1rem;
  }

  .hud-speed button {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .meter strong,
  .hud-speed span {
    font-size: 0.72rem;
  }

  .toolbar {
    min-height: 66px;
    border-radius: 10px;
  }

  .toolbar-toggle {
    width: 30px;
    height: 30px;
  }

  .tool-section {
    gap: 0.36rem;
  }

  .toolbar .tool-label {
    min-width: 38px;
    font-size: 0.64rem;
  }

  .palette-button {
    flex-basis: 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .palette-snippet {
    width: 29px;
    height: 29px;
  }

  .variant-picker {
    width: min(190px, calc(100vw - 1.5rem));
  }

  .variant-button {
    min-height: 36px;
  }

  .toast {
    left: 0.65rem;
    right: 0.65rem;
    max-width: none;
  }

  .toast.is-preview {
    grid-template-columns: 74px minmax(0, 1fr);
    max-width: none;
  }

  .toast-preview {
    width: 74px;
    height: 52px;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .option-card {
    min-height: 132px;
  }

  .option-preview {
    height: 86px;
  }

  .inspector {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.34rem;
    padding: 0.46rem 2.7rem 0.46rem 0.52rem;
    border-radius: 10px;
  }

  .game-screen:not(.inspector-collapsed) .inspector {
    margin-top: -3.5rem;
  }

  .selected-card {
    grid-column: 1 / -1;
    gap: 0.18rem;
    padding-right: 2rem;
    padding-bottom: 0.16rem;
  }

  .selected-card .tool-label {
    font-size: 0.58rem;
  }

  .selected-card h3 {
    font-size: 0.82rem;
  }

  .selected-card p {
    font-size: 0.62rem;
  }

  .selected-card .zoom-stepper {
    display: none;
  }

  .inspector-card.compact {
    gap: 0.32rem;
  }

  .inspector-card + .inspector-card {
    padding-top: 0.38rem;
  }

  .inspector-card .tool-label {
    margin-bottom: 0;
    font-size: 0.58rem;
    letter-spacing: 0.065em;
  }

  .time-actions {
    grid-template-columns: repeat(3, 38px);
    gap: 0.34rem;
  }

  .time-actions .tool-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    gap: 0;
    border-radius: 8px;
    font-size: 0;
    line-height: 1;
  }

  .time-actions .tool-button svg,
  .edit-grid .icon-tool svg {
    width: 1rem;
    height: 1rem;
  }

  .game-screen.inspector-collapsed .inspector {
    height: 58px;
    min-height: 58px;
    padding: 0.48rem;
    align-content: center;
  }

  .inspector-card {
    padding: 0.06rem 0.05rem 0.24rem;
  }

  .edit-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.34rem;
    justify-content: flex-start;
  }

  .edit-grid .icon-tool {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 8px;
  }

  .quiet-danger {
    display: none;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 560px) {
  body {
    overflow: hidden;
  }

  .game-screen {
    height: 100svh;
    min-height: 0;
    padding: max(0.42rem, env(safe-area-inset-top)) max(0.42rem, env(safe-area-inset-right)) max(0.42rem, env(safe-area-inset-bottom)) max(0.42rem, env(safe-area-inset-left));
    overflow: hidden;
  }

  .topbar {
    position: absolute;
    top: max(0.45rem, env(safe-area-inset-top));
    right: max(0.45rem, env(safe-area-inset-right));
    max-width: min(310px, calc(100vw - 6rem));
  }

  .top-actions {
    flex-wrap: nowrap;
  }

  .play-area {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
  }

  .stage-wrap {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .toolbar {
    position: absolute;
    inset: auto max(12.6rem, calc(190px + 0.9rem)) 0.45rem 0.45rem;
    z-index: 20;
    flex-direction: row;
    width: auto;
    height: 58px;
    min-height: 0;
    padding: 0.38rem;
    border-radius: 10px;
    overflow: hidden;
  }

  .toolbar-toggle {
    align-self: center;
    width: 30px;
    height: 30px;
  }

  .tool-section {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    gap: 0.34rem;
  }

  .palette {
    display: flex;
    justify-content: flex-start;
    gap: 0.36rem;
    height: 100%;
    max-height: none;
    align-content: start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.05rem 0.1rem 0.25rem;
    scroll-snap-type: x proximity;
  }

  .palette-button {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .palette-snippet {
    width: 30px;
    height: 30px;
  }

  .variant-picker {
    position: absolute;
    top: auto;
    bottom: calc(100% + 0.45rem);
    left: 0.4rem;
    width: min(176px, calc(100vw - 14rem));
    max-height: calc(100svh - 5.2rem);
    overflow: auto;
  }

  .hud {
    top: 0.6rem;
    left: 0.6rem;
    right: 20rem;
    max-width: none;
  }

  .inspector {
    position: absolute;
    top: 3.7rem;
    right: max(0.45rem, env(safe-area-inset-right));
    bottom: 0.45rem;
    z-index: 18;
    display: flex;
    width: 190px;
    padding: 0.42rem;
    overflow: auto;
  }

  .game-screen:not(.inspector-collapsed) .inspector {
    margin-top: 0;
  }

  .inspector-card {
    padding-bottom: 0.16rem;
  }

  .inspector-card + .inspector-card {
    padding-top: 0.3rem;
  }

  .selected-card p {
    line-height: 1.15;
  }

  .selected-card .zoom-stepper {
    display: none;
  }

  .time-actions {
    grid-template-columns: repeat(3, 42px);
  }

  .time-actions .tool-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 0;
  }

  .time-actions .tool-button svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .edit-grid {
    display: grid;
    grid-template-columns: repeat(4, 42px);
  }

  .quiet-danger {
    display: none;
  }

  .game-screen.inspector-collapsed .inspector {
    width: 48px;
    min-height: 48px;
    bottom: auto;
    padding: 0.42rem;
    overflow: visible;
  }

  .game-screen.inspector-collapsed .inspector-toggle {
    margin: 0;
  }

  .toast {
    right: 4.2rem;
    bottom: 0.65rem;
    left: auto;
    max-width: min(310px, calc(100% - 8rem));
  }

  .game-screen:not(.inspector-collapsed) .toast {
    right: calc(190px + 1rem);
    bottom: calc(58px + 1rem);
  }
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .topbar,
  .toolbar,
  .inspector,
  .meter,
  .variant-picker,
  .choice-panel {
    backdrop-filter: none;
  }

  .primary-action,
  .secondary-action,
  .tool-button,
  .palette-button,
  .icon-tool,
  .icon-button,
  .toolbar-toggle,
  .inspector-toggle,
  .hud-speed button {
    transition: none;
  }

  .save-slot:hover,
  .save-slot-open:hover,
  .palette-button:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-atmosphere::before,
  .home-orb,
  .home-rain,
  .home-wind,
  .home-particle {
    animation: none;
  }

  .home-rain,
  .home-wind,
  .home-particle {
    opacity: 0.24;
  }
}
