:root {
  color-scheme: dark;
  --ink: #15243b;
  --ink-soft: #263a59;
  --cream: #fff6dc;
  --paper: #fffdf5;
  --coral: #ff6f61;
  --coral-dark: #d94e49;
  --mint: #54d6bd;
  --mint-dark: #238d83;
  --sun: #ffd166;
  --sky: #70cfff;
  --violet: #9d8cff;
  --danger: #ff5570;
  --shadow: 0 18px 48px rgba(12, 31, 53, .2);
  --small-shadow: 0 8px 18px rgba(12, 31, 53, .18);
  --radius: 24px;
  --tap: 48px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #d9f2ff;
}

body {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid rgba(255, 209, 102, .95);
  outline-offset: 3px;
}

.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overflow: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 255, 255, .9) 0 7%, transparent 23%),
    linear-gradient(155deg, #daf5ff 0%, #fff1d5 50%, #ffd7cc 100%);
}

.app::before,
.app::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  opacity: .55;
  filter: blur(1px);
}

.app::before {
  width: 38vw;
  height: 38vw;
  left: -16vw;
  bottom: -19vw;
  background: rgba(84, 214, 189, .35);
}

.app::after {
  width: 31vw;
  height: 31vw;
  right: -12vw;
  top: -16vw;
  background: rgba(112, 207, 255, .38);
}

[hidden] {
  display: none !important;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 28px;
  color: white;
  background: linear-gradient(150deg, #163456, #216b78);
  text-align: center;
}

.noscript-message p {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(16px, 4vw, 21px);
  font-weight: 800;
  line-height: 1.35;
}

.boot-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  gap: 24px;
  background: linear-gradient(150deg, #163456, #216b78);
}

.boot-logo {
  position: relative;
  width: 118px;
  height: 94px;
  border: 8px solid rgba(255, 255, 255, .92);
  border-radius: 31px 31px 27px 27px;
  background: var(--coral);
  box-shadow: 0 18px 0 rgba(8, 24, 43, .18);
  animation: boot-bob 1.1s ease-in-out infinite alternate;
}

.boot-ear {
  position: absolute;
  top: -25px;
  width: 34px;
  height: 36px;
  border: 8px solid rgba(255, 255, 255, .92);
  border-bottom: 0;
  background: var(--coral);
  transform: rotate(45deg);
  border-radius: 7px;
}

.boot-ear-left { left: 8px; }
.boot-ear-right { right: 8px; }

.boot-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 1000;
  font-size: 48px;
  text-shadow: 0 3px rgba(0, 0, 0, .12);
}

.boot-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.boot-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  animation: dot-pulse .9s ease-in-out infinite;
}

.boot-dots i:nth-child(2) { animation-delay: .15s; }
.boot-dots i:nth-child(3) { animation-delay: .3s; }

.topbar {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  height: calc(62px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  color: white;
  background: rgba(21, 36, 59, .93);
  border-bottom: 2px solid rgba(255, 255, 255, .12);
  box-shadow: 0 5px 22px rgba(21, 36, 59, .18);
  backdrop-filter: blur(12px);
}

.brand-mini {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: 900;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-paw {
  flex: 0 0 auto;
  color: var(--sun);
  transform: rotate(45deg);
}

/* The complete localized title is announced to assistive technology and shown
   on the main screen. The compact gameplay header stays text-free so promo
   captures never contain a shortened, console-inconsistent title. */
#brand-mini-text {
  display: none;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 57px;
  height: 38px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.coin-pill b { color: var(--sun); }
.star-pill b { color: #fff1a8; }

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: white;
  background: rgba(255, 255, 255, .12);
  font-size: 23px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.icon-button:active {
  transform: scale(.92);
  background: rgba(255, 255, 255, .22);
}

.screen-root {
  position: relative;
  z-index: 2;
  height: calc(100% - 62px - env(safe-area-inset-top));
  overflow: hidden;
}

.screen {
  width: 100%;
  height: 100%;
  animation: screen-in .28s cubic-bezier(.2, .8, .2, 1) both;
}

.menu-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.town-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .8);
  border-radius: 30px;
  background: linear-gradient(#8bdcff 0 47%, #a9d98c 47% 100%);
  box-shadow: var(--shadow);
}

.town-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(transparent, rgba(37, 92, 77, .18));
  pointer-events: none;
}

.town-heading {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 18px;
  color: white;
  background: rgba(21, 36, 59, .78);
  box-shadow: var(--small-shadow);
  backdrop-filter: blur(8px);
}

.town-heading h1,
.town-heading p {
  margin: 0;
}

.town-heading h1 {
  max-width: 680px;
  font-size: clamp(20px, 6vw, 38px);
  line-height: .98;
  letter-spacing: -.045em;
}

.town-heading p {
  margin-top: 5px;
  font-size: clamp(12px, 3.2vw, 16px);
  font-weight: 700;
  opacity: .9;
}

.town-scene {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
}

.town-upgrade {
  opacity: .08;
  filter: grayscale(1);
  transition: opacity .55s ease, filter .55s ease, transform .55s cubic-bezier(.2, .9, .2, 1);
  transform-origin: center bottom;
  transform: scale(.92);
}

.town-upgrade.is-built {
  opacity: 1;
  filter: none;
  transform: scale(1);
}

.town-upgrade.is-new {
  animation: build-pop .8s cubic-bezier(.2, 1.4, .3, 1);
}

.cat-walker {
  transform-origin: center;
  animation: cat-walk 8s ease-in-out infinite alternate;
}

.menu-panel {
  display: grid;
  gap: 10px;
}

.progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid rgba(255, 255, 255, .75);
  border-radius: 22px;
  background: rgba(255, 253, 245, .92);
  box-shadow: var(--small-shadow);
}

.progress-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: #176f68;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.progress-copy h2 {
  margin: 0;
  font-size: clamp(16px, 4vw, 21px);
  line-height: 1.1;
}

.progress-track {
  width: 100%;
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5e6;
}

.progress-track > span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), #2eb9b2);
  transition: width .4s ease;
}

.menu-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, .5fr);
  gap: 10px;
}

.button {
  position: relative;
  min-height: var(--tap);
  border: 0;
  border-radius: 18px;
  padding: 13px 18px;
  color: white;
  background: var(--ink);
  box-shadow: 0 7px 0 #0b1728, 0 12px 20px rgba(21, 36, 59, .2);
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.button:not(:disabled):active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #0b1728, 0 6px 10px rgba(21, 36, 59, .16);
}

.button:disabled {
  cursor: default;
  opacity: .55;
  filter: grayscale(.35);
}

.button-primary {
  min-height: 58px;
  color: #15243b;
  background: var(--sun);
  box-shadow: 0 7px 0 #d59e2f, 0 12px 20px rgba(112, 73, 3, .18);
  font-size: clamp(18px, 4.5vw, 23px);
}

.button-primary:not(:disabled):active {
  box-shadow: 0 2px 0 #d59e2f, 0 6px 10px rgba(112, 73, 3, .15);
}

.button-secondary {
  background: var(--mint-dark);
  box-shadow: 0 7px 0 #16675f, 0 12px 20px rgba(19, 96, 88, .18);
}

.button-secondary:not(:disabled):active {
  box-shadow: 0 2px 0 #16675f, 0 6px 10px rgba(19, 96, 88, .15);
}

.button-coral {
  background: var(--coral);
  box-shadow: 0 7px 0 var(--coral-dark), 0 12px 20px rgba(142, 48, 48, .2);
}

.button-coral:not(:disabled):active {
  box-shadow: 0 2px 0 var(--coral-dark), 0 6px 10px rgba(142, 48, 48, .15);
}

.button-ghost {
  color: var(--ink);
  background: #edf3f4;
  box-shadow: 0 5px 0 #c7d2d5;
}

.button-ghost:not(:disabled):active {
  box-shadow: 0 1px 0 #c7d2d5;
}

.button small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  opacity: .75;
}

.daily-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
}

.daily-button > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.daily-button .calendar-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid currentColor;
  border-radius: 10px;
  font-size: 14px;
}

.daily-button.is-done {
  opacity: .68;
}

.game-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 980px;
  margin: 0 auto;
  padding: 10px max(10px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.level-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 20px;
  background: rgba(255, 253, 245, .94);
  box-shadow: var(--small-shadow);
}

.level-title {
  min-width: 0;
}

.level-title h1,
.level-title p {
  margin: 0;
}

.level-title h1 {
  font-size: clamp(18px, 4.6vw, 25px);
  line-height: 1;
}

.level-title p {
  margin-top: 4px;
  color: #5f6d7b;
  font-size: 12px;
  font-weight: 800;
}

.hearts {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  min-width: 72px;
  color: var(--danger);
  font-size: clamp(17px, 4.5vw, 24px);
  line-height: 1;
}

.heart.is-empty {
  color: #cbd3d7;
  transform: scale(.85);
}

.board-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.board-shell {
  position: relative;
  width: min(94vw, 58vh, 580px);
  height: min(94vw, 58vh, 580px);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  padding: clamp(8px, 2vw, 14px);
  border: 4px solid rgba(255, 255, 255, .92);
  border-radius: clamp(22px, 6vw, 34px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    #243a59;
  background-size: calc(100% / var(--board-size)) calc(100% / var(--board-size));
  box-shadow: 0 22px 55px rgba(22, 50, 74, .28), inset 0 0 0 5px rgba(14, 30, 49, .25);
  overflow: hidden;
}

.board {
  position: relative;
  width: 100%;
  height: 100%;
}

.lane-exit {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
}

.lane-exit.n,
.lane-exit.s {
  width: 34%;
  height: 5px;
  left: 33%;
}

.lane-exit.n { top: 4px; }
.lane-exit.s { bottom: 4px; }

.lane-exit.e,
.lane-exit.w {
  width: 5px;
  height: 34%;
  top: 33%;
}

.lane-exit.e { right: 4px; }
.lane-exit.w { left: 4px; }

.van {
  --cell: calc(100% / var(--board-size));
  position: absolute;
  z-index: 2;
  left: calc(var(--col) * var(--cell));
  top: calc(var(--row) * var(--cell));
  width: var(--cell);
  height: var(--cell);
  display: grid;
  place-items: center;
  padding: max(2px, calc(var(--cell) * .08));
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  transition: left .2s ease, top .2s ease, transform .48s cubic-bezier(.22, .8, .25, 1), opacity .36s ease;
  will-change: transform, opacity;
}

.van-body {
  position: relative;
  width: 86%;
  height: 62%;
  display: grid;
  place-items: center;
  border: clamp(2px, .55vw, 4px) solid rgba(255, 255, 255, .94);
  border-radius: 28% 34% 34% 28%;
  color: white;
  background: var(--van-color, var(--coral));
  box-shadow: 0 5px 0 var(--van-dark, var(--coral-dark)), 0 8px 12px rgba(0, 0, 0, .22);
  transform: rotate(var(--rotation));
  transition: filter .2s ease, transform .2s ease;
}

.van-body::before,
.van-body::after {
  content: "";
  position: absolute;
  left: 13%;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: #14243a;
  box-shadow: inset 0 0 0 2px #7f98ae;
}

.van-body::before { top: -14%; }
.van-body::after { bottom: -14%; }

.van-window {
  position: absolute;
  right: 8%;
  top: 19%;
  width: 26%;
  height: 55%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 38% 48% 48% 38%;
  background: #c9f1ff;
}

.van-window::before,
.van-window::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 45%;
  height: 45%;
  background: #f0b27b;
  transform: rotate(45deg);
}

.van-window::before { left: 0; }
.van-window::after { right: 0; }

.van-arrow {
  position: relative;
  margin-right: 18%;
  font-size: clamp(14px, calc(92px / var(--board-size)), 28px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px rgba(0, 0, 0, .15);
}

.van-badge {
  position: absolute;
  z-index: 3;
  top: -17%;
  right: -12%;
  min-width: 43%;
  height: 43%;
  display: grid;
  place-items: center;
  padding: 0 2px;
  border: 2px solid white;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .25);
  font-size: clamp(9px, calc(52px / var(--board-size)), 15px);
  font-weight: 1000;
  transform: rotate(calc(-1 * var(--rotation)));
}

.van.is-fragile .van-badge {
  background: var(--violet);
}

.van.is-locked .van-body {
  filter: saturate(.25) brightness(.72);
}

.van.is-hint .van-body {
  animation: hint-pulse .8s ease-in-out infinite alternate;
}

.van.is-blocker .van-body {
  animation: blocker-pulse .42s ease-in-out 2;
}

.van.is-shaking .van-body {
  animation: van-shake .36s ease;
}

.van.exit-n { transform: translateY(-1000%); opacity: 0; }
.van.exit-e { transform: translateX(1000%); opacity: 0; }
.van.exit-s { transform: translateY(1000%); opacity: 0; }
.van.exit-w { transform: translateX(-1000%); opacity: 0; }

.board.is-paused .van {
  pointer-events: none;
}

.game-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tool-button {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 9px;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 253, 245, .96);
  box-shadow: 0 5px 0 rgba(21, 36, 59, .15), var(--small-shadow);
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.tool-button:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(21, 36, 59, .15);
}

.tool-button:disabled {
  opacity: .48;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: white;
  background: var(--mint-dark);
  font-size: 17px;
}

.route-status {
  position: absolute;
  z-index: 6;
  top: 10px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 8px 13px;
  border-radius: 999px;
  color: white;
  background: rgba(21, 36, 59, .9);
  box-shadow: var(--small-shadow);
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.combo-pop {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 48%;
  color: var(--sun);
  font-size: clamp(25px, 8vw, 52px);
  font-weight: 1000;
  text-shadow: 0 4px 0 #9c6718, 0 8px 22px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
  animation: combo-fly .68s ease-out both;
  pointer-events: none;
}

.modal-root {
  position: absolute;
  z-index: 40;
  inset: 0;
  pointer-events: none;
}

.modal-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(10, 24, 42, .65);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  animation: fade-in .18s ease both;
}

.modal {
  width: min(100%, 440px);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border: 3px solid white;
  border-radius: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 26px 70px rgba(4, 17, 31, .45);
  text-align: center;
  animation: modal-pop .28s cubic-bezier(.2, 1.1, .3, 1) both;
}

.modal-hero {
  position: relative;
  width: 106px;
  height: 90px;
  margin: -8px auto 14px;
}

.modal-cat {
  position: absolute;
  inset: 10px 7px 0;
  display: grid;
  place-items: center;
  border: 5px solid var(--ink);
  border-radius: 38% 38% 46% 46%;
  color: var(--ink);
  background: #f7b976;
  font-size: 32px;
  font-weight: 1000;
}

.modal-cat::before,
.modal-cat::after {
  content: "";
  position: absolute;
  top: -13px;
  width: 28px;
  height: 28px;
  border: 5px solid var(--ink);
  border-radius: 6px;
  background: #f7b976;
  transform: rotate(45deg);
  z-index: -1;
}

.modal-cat::before { left: 6px; }
.modal-cat::after { right: 6px; }

.modal h2 {
  margin: 0;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1;
  letter-spacing: -.035em;
}

.modal p {
  margin: 10px 0 0;
  color: #536171;
  font-weight: 700;
  line-height: 1.35;
}

.modal .reward-line {
  margin: 15px 0;
  color: var(--mint-dark);
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 1000;
}

.star-result {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 15px 0 6px;
  color: #d7dde0;
  font-size: clamp(35px, 10vw, 54px);
  line-height: 1;
}

.star-result .earned {
  color: var(--sun);
  text-shadow: 0 4px #c18d24;
  animation: star-pop .45s cubic-bezier(.2, 1.5, .4, 1) both;
}

.star-result .earned:nth-child(2) { animation-delay: .12s; }
.star-result .earned:nth-child(3) { animation-delay: .24s; }

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.streak-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin: 18px 0 6px;
}

.streak-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 12px;
  color: #596772;
  background: #e9eeee;
  font-size: 11px;
  font-weight: 1000;
}

.streak-day.is-past {
  color: var(--ink);
  background: var(--mint);
}

.streak-day.is-today {
  color: var(--ink);
  background: var(--sun);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, .25);
  transform: scale(1.08);
}

.tutorial-hand {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  color: white;
  background: var(--coral);
  font-size: 34px;
  animation: tap-hand .8s ease-in-out infinite alternate;
}

.toast-root {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  width: min(calc(100% - 30px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  justify-self: center;
  max-width: 100%;
  padding: 11px 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  color: white;
  background: rgba(21, 36, 59, .95);
  box-shadow: var(--small-shadow);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  animation: toast-in 2.5s ease both;
}

.confetti {
  position: absolute;
  z-index: 45;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 10px;
  height: 17px;
  border-radius: 3px;
  background: var(--c);
  animation: confetti-fall var(--d) linear var(--delay) both;
}

@media (min-width: 760px) and (min-height: 620px) and (orientation: landscape) {
  .menu-screen {
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    padding: 22px;
  }

  .menu-panel {
    align-content: center;
  }

  .menu-actions {
    grid-template-columns: 1fr;
  }

  .game-screen {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    column-gap: 18px;
    padding: 18px;
  }

  .level-strip {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .board-wrap {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .board-shell {
    width: min(100%, 65vw, 72vh, 650px);
    height: min(100%, 65vw, 72vh, 650px);
  }

  .game-tools {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
    align-self: end;
  }

  .tool-button {
    min-height: 58px;
  }
}

@media (max-height: 570px) and (orientation: landscape) {
  .topbar {
    height: calc(52px + env(safe-area-inset-top));
    padding-top: calc(5px + env(safe-area-inset-top));
    padding-bottom: 5px;
  }

  .screen-root {
    height: calc(100% - 52px - env(safe-area-inset-top));
  }

  .game-screen {
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 7px 12px;
  }

  .level-strip {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    padding: 7px 9px;
    border-radius: 15px;
  }
  .level-title p { display: none; }
  .hearts { min-width: 0; font-size: 16px; }
  .board-wrap { grid-column: 2; grid-row: 1 / span 2; }
  .game-tools { grid-column: 1; grid-row: 2; grid-template-columns: 1fr; gap: 4px; }
  .tool-button { min-height: 46px; padding: 5px 7px; }
  .tool-icon { width: 27px; height: 27px; }

  .board-shell {
    width: min(68vw, 78vh, 500px);
    height: min(68vw, 78vh, 500px);
  }

  .town-heading h1 { font-size: 24px; }
  .menu-screen { grid-template-columns: 1fr 310px; grid-template-rows: 1fr; padding: 7px 12px; }
  .menu-panel { gap: 6px; }
  .progress-card { gap: 7px; padding: 7px 9px; }
  .progress-copy h2 { font-size: 15px; }
  .progress-card .button { min-height: 44px; padding: 7px 9px; font-size: 12px; }
  .menu-actions { grid-template-columns: 1fr; gap: 6px; }
  .menu-actions .button { min-height: 52px; padding: 8px 12px; }
  .daily-button small { display: none; }
}

@media (max-width: 390px) {
  .menu-actions { grid-template-columns: 1fr; }
  .brand-mini { max-width: 86px; }
  .wallet-pill { min-width: 48px; padding: 0 7px; }
  .daily-button { min-height: 62px; }
  .game-tools { gap: 5px; }
  .tool-button { padding: 7px 5px; gap: 4px; }
  .tool-icon { width: 27px; height: 27px; }
}

@media (max-width: 390px) and (orientation: portrait) {
  .game-screen {
    padding-right: max(2px, env(safe-area-inset-right));
    padding-left: max(2px, env(safe-area-inset-left));
  }

  .board-shell {
    width: min(calc(100vw - 4px), calc(100dvh - 214px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 580px);
    height: min(calc(100vw - 4px), calc(100dvh - 214px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 580px);
    padding: 4px;
    border-width: 2px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@keyframes boot-bob { to { transform: translateY(-10px) rotate(1deg); } }
@keyframes dot-pulse { 0%, 100% { opacity: .25; transform: scale(.75); } 50% { opacity: 1; transform: scale(1); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(9px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: scale(.88) translateY(20px); } }
@keyframes build-pop { 0% { opacity: .15; transform: scale(.2) translateY(-30px); } 55% { opacity: 1; transform: scale(1.12); } }
@keyframes cat-walk { from { transform: translateX(-22px); } to { transform: translateX(22px); } }
@keyframes hint-pulse { to { filter: brightness(1.35); transform: rotate(var(--rotation)) scale(1.12); box-shadow: 0 5px 0 var(--van-dark), 0 0 0 7px rgba(255, 209, 102, .42); } }
@keyframes blocker-pulse { 50% { filter: brightness(1.5); transform: rotate(var(--rotation)) scale(1.1); } }
@keyframes van-shake { 20% { transform: rotate(calc(var(--rotation) - 8deg)) translateX(-5%); } 45% { transform: rotate(calc(var(--rotation) + 7deg)) translateX(5%); } 70% { transform: rotate(calc(var(--rotation) - 4deg)); } }
@keyframes combo-fly { 0% { opacity: 0; transform: translate(-50%, -25%) scale(.55) rotate(-4deg); } 35% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); } 100% { opacity: 0; transform: translate(-50%, -125%) scale(.9); } }
@keyframes star-pop { from { opacity: 0; transform: scale(.2) rotate(-35deg); } }
@keyframes tap-hand { to { transform: translateY(8px) scale(.92); } }
@keyframes toast-in { 0% { opacity: 0; transform: translateY(16px) scale(.94); } 12%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes confetti-fall { to { transform: translate3d(var(--drift), 110vh, 0) rotate(720deg); } }
