:root {
  --ink: #294d45;
  --muted: #69877b;
  --cream: #f8faec;
  --line: #dce6cb;
  --orange: #fa8b5d;
  --mint: #a6dba3;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #d8eddb;
  font-synthesis: none;
  font-weight: 550;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}
body {
  min-width: 280px;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 42%,
    #fcfbe7 0%,
    #eaf3dc 44%,
    #cae8db 100%
  );
}
#app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
  touch-action: manipulation;
  user-select: none;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button:focus-visible {
  outline: 3px solid #df8554;
  outline-offset: 3px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
small {
  font-weight: 550;
}
img {
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}
.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  margin: auto;
  max-width: 1050px;
  padding: calc(12px + var(--safe-top)) max(16px, env(safe-area-inset-right))
    calc(12px + var(--safe-bottom)) max(16px, env(safe-area-inset-left));
  isolation: isolate;
}
.scene-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.cloud {
  position: absolute;
  background: #ffffedcc;
  border-radius: 100px;
  width: 140px;
  height: 35px;
  filter: blur(0.2px);
  opacity: 0.8;
}
.cloud:before,
.cloud:after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud:before {
  width: 65px;
  height: 65px;
  left: 23px;
  bottom: 3px;
}
.cloud:after {
  width: 45px;
  height: 45px;
  right: 18px;
  bottom: 4px;
}
.cloud-a {
  left: -35px;
  top: 26%;
  scale: 0.85;
}
.cloud-b {
  right: -25px;
  top: 17%;
  scale: 0.65;
}
.cloud-c {
  left: 60%;
  top: 64%;
  scale: 0.45;
  opacity: 0.6;
}
.sky-spark {
  position: absolute;
  color: #edc36a;
  font-size: 23px;
}
.spark-a {
  left: 17%;
  top: 26%;
}
.spark-b {
  right: 15%;
  top: 42%;
  font-size: 30px;
}
.spark-c {
  left: 26%;
  top: 64%;
  font-size: 14px;
}
.distant-island {
  position: absolute;
  width: 95px;
  opacity: 0.35;
  filter: blur(0.6px);
}
.island-a {
  left: -26px;
  top: 45%;
  rotate: -13deg;
}
.island-b {
  right: -29px;
  top: 59%;
  width: 85px;
  rotate: 10deg;
}
.menu-hud,
.screen-hud,
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.menu-hud {
  width: 100%;
  max-width: 580px;
  margin: auto;
}
.hud-tools {
  display: flex;
  gap: 10px;
}
.icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: #fffdee;
  border: 2px solid #fffef5;
  box-shadow:
    0 4px 0 #b6cbb0,
    0 6px 10px #3b66520e;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.icon-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b6cbb0;
}
.currency-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: #fff8d9;
  border: 2px solid #fffdf1;
  padding: 7px 12px;
  border-radius: 30px;
  box-shadow: 0 3px 0 #d4d8ab;
  font-size: 16px;
  white-space: nowrap;
}
.currency-pill .icon {
  fill: #f5bf53;
  stroke: #d69b37;
  width: 21px;
  height: 21px;
}
.currency-pill small {
  font-size: 10px;
  color: #a2925f;
}
.currency-pill b {
  font-weight: 850;
}
.stars,
.hearts {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stars .icon {
  width: 20px;
  height: 20px;
}
.stars .filled {
  fill: #f5c459;
  stroke: #d3a13d;
}
.stars .empty {
  fill: #dce4cb;
  stroke: #c2ceb1;
}
.hearts .icon {
  width: 22px;
  height: 22px;
}
.hearts .filled {
  fill: #ee8979;
  stroke: #d97668;
}
.hearts .empty {
  fill: #e2ddcf;
  stroke: #cccabb;
}
.button {
  min-height: 55px;
  padding: 12px 21px;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 850;
  border: 2px solid #fff6d5;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.button.primary {
  color: #fffef1;
  text-shadow: 0 1px 1px #97662a2b;
  background: linear-gradient(#ffac68, #f28a4f);
  box-shadow:
    0 6px 0 #c96e3c,
    0 10px 20px #b48b4026;
}
.button.primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #c96e3c;
}
.button.secondary {
  background: #ecf3dd;
  box-shadow: 0 4px 0 #b3c9a5;
  border-color: #fafeee;
}
.button span {
  display: block;
}
.button small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 4px;
}
.button:has(> span) > .icon:last-child {
  margin-left: auto;
}
.button:has(> span) > .icon:first-child {
  margin-right: auto;
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  font-size: 12px;
  font-weight: 650;
  min-height: 44px;
}
.eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
}
.notification-dot {
  position: absolute;
  right: -5px;
  top: -4px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #f57959;
  color: #fff;
  border: 2px solid #fff9df;
  font-style: normal;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.notification-dot.complete {
  background: #7db889;
}
.menu-screen {
  display: grid;
  grid-template-rows: 48px 112px minmax(120px, 1fr) 226px 24px;
  gap: 8px;
  max-width: 800px;
}
.game-logo {
  text-align: center;
  position: relative;
  align-self: center;
}
.game-logo h1 {
  font-weight: 950;
  font-size: clamp(36px, 5.4vh, 55px);
  letter-spacing: 3px;
  color: #426b45;
  -webkit-text-stroke: 1px #3c6639;
  text-shadow:
    0 3px 0 #ffffed,
    0 6px 0 #bdd99a,
    0 9px 18px #69955b20;
  line-height: 1.2;
}
.logo-en {
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #cf9849;
  margin-top: 5px;
}
.game-logo p {
  font-size: 11px;
  color: #799365;
  margin-top: 8px;
  letter-spacing: 2px;
}
.logo-orbit {
  position: absolute;
  left: calc(50% - 134px);
  top: -13px;
  font-size: 28px;
  color: #f5c463;
  rotate: -15deg;
}
.menu-scene {
  position: relative;
  width: min(100%, 420px);
  height: 100%;
  min-height: 0;
  margin: auto;
}
.menu-island {
  position: absolute;
  height: min(100%, 340px);
  width: auto;
  max-width: 95%;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  object-fit: contain;
  filter: drop-shadow(0 17px 12px #588b5e1e);
  animation: island-float 5s ease-in-out infinite;
}
.island-shadow {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: 65%;
  height: 12%;
  border-radius: 50%;
  background: #a5c99825;
  filter: blur(12px);
}
.menu-duo {
  position: absolute;
  left: 50%;
  top: 30%;
  translate: -50% 0;
  width: min(60%, 240px);
  height: 40%;
  min-height: 65px;
  max-height: 125px;
  filter: drop-shadow(0 6px 2px #435d452b);
  animation: float 4s ease-in-out infinite;
}
.menu-duo svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.menu-duo path {
  fill: none;
  stroke: #e4ba6c;
  stroke-width: 5;
  stroke-linecap: round;
}
.menu-duo img {
  position: absolute;
  width: 43%;
  height: 100%;
  object-fit: contain;
  top: -24%;
}
.menu-coral {
  left: 0;
  rotate: -10deg;
}
.menu-mint {
  right: 0;
  rotate: 10deg;
}
.scene-bubble {
  position: absolute;
  right: 6%;
  top: 13%;
  padding: 8px 13px;
  border-radius: 18px 18px 18px 3px;
  background: #fffdee;
  box-shadow: 0 3px 0 #d4deb9;
  font-size: 12px;
  rotate: 8deg;
  color: #729055;
}
.menu-controls {
  width: min(100%, 420px);
  margin: auto;
  align-self: end;
  display: grid;
  gap: 23px;
}
.start-button {
  height: 76px;
  font-size: 22px;
  border-radius: 24px;
}
.start-button .icon {
  width: 25px;
  height: 25px;
}
.start-button small {
  font-size: 11px;
  margin-top: 6px;
}
.menu-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.menu-modes > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding: 0 0 5px;
}
.mode-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 62px;
  border-radius: 21px;
  border: 3px solid #fffef3;
  box-shadow:
    0 5px 0 #bdcea6,
    0 8px 10px #2b523d0c;
  transition: transform 0.15s;
}
.mode-emblem > .icon {
  width: 32px;
  height: 32px;
  stroke-width: 1.9;
}
.map-emblem {
  background: linear-gradient(#bde5a2, #9bca84);
  color: #477948;
}
.daily-emblem {
  background: linear-gradient(#ffe49b, #f4c46d);
  color: #bc8237;
  box-shadow:
    0 5px 0 #d4ad66,
    0 8px 10px #2b523d0c;
}
.endless-emblem {
  background: linear-gradient(#d9c9ee, #bda6d9);
  color: #8765af;
  box-shadow:
    0 5px 0 #a48aba,
    0 8px 10px #2b523d0c;
}
.menu-modes > button:active .mode-emblem {
  transform: translateY(4px);
}
.menu-modes b {
  font-size: 13px;
  margin-top: 3px;
}
.menu-modes small {
  font-size: 10px;
  color: #849575;
}
.menu-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  color: #819474;
}
.menu-rank > .icon {
  width: 15px;
  height: 15px;
  color: #b9a267;
}
.menu-rank i {
  height: 3px;
  width: 3px;
  border-radius: 50%;
  background: #a0b18d;
}
.map-screen {
  display: grid;
  grid-template-rows: 58px 52px minmax(0, 1fr) 86px;
  gap: 7px;
  max-width: 650px;
}
.map-screen .scene-atmosphere {
  opacity: 0.65;
}
.map-title {
  text-align: center;
}
.map-title small {
  font-size: 9px;
  letter-spacing: 2px;
  color: #799375;
}
.map-title h1 {
  font-size: 22px;
  font-weight: 900;
  margin-top: 3px;
}
.map-screen .currency-pill {
  padding: 7px 9px;
  font-size: 14px;
}
.map-screen .currency-pill small {
  font-size: 9px;
}
.world-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.world-switcher > .icon-button {
  height: 38px;
  width: 38px;
  border-radius: 13px;
}
.next-world .icon {
  rotate: 180deg;
}
.world-picker-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-size: 11px;
  color: var(--world-ink);
  background: #fffdef99;
  border-radius: 20px;
  padding: 0 16px;
}
.world-picker-button .icon {
  width: 17px;
  height: 17px;
}
.map-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  border-radius: 32px;
  background: linear-gradient(#ffffff00, #f7f8e470);
  box-shadow: inset 0 -20px 15px -15px #7c9a6320;
}
.map-scroll::-webkit-scrollbar {
  display: none;
}
.map-track {
  position: relative;
  height: 1120px;
  max-width: 420px;
  margin: auto;
}
.map-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.route-shadow {
  fill: none;
  stroke: #aebf9173;
  stroke-width: 18;
  stroke-linecap: round;
}
.route-dots {
  fill: none;
  stroke: #fffff4;
  stroke-width: 10;
  stroke-dasharray: 1 20;
  stroke-linecap: round;
}
.map-world-art {
  position: absolute;
  top: 12px;
  left: calc(50% - 68px);
  width: 136px;
  filter: drop-shadow(0 8px 5px #56724a1e);
}
.map-trial-title {
  position: absolute;
  top: 124px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--world-ink);
}
.map-trial-title .icon {
  width: 16px;
  height: 16px;
}
.level-node {
  position: absolute;
  translate: -50% -50%;
  width: 75px;
  min-height: 72px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 0;
  overflow: visible;
}
.level-disc {
  display: grid;
  place-items: center;
  position: relative;
  min-width: 58px;
  height: 55px;
  background: linear-gradient(#f9faf0, #e9efd5);
  border: 3px solid #fffdec;
  border-radius: 50%;
  box-shadow:
    0 6px 0 #a3b48a,
    0 9px 12px #46603615;
  font-size: 22px;
  font-weight: 900;
  color: #7d9471;
}
.level-node.completed .level-disc {
  background: linear-gradient(#c6e8a4, #a6d089);
  color: #527947;
  box-shadow:
    0 6px 0 #7ca663,
    0 9px 12px #46603615;
}
.level-node.current .level-disc {
  background: linear-gradient(#ffd084, #f6a45d);
  color: #fff9e6;
  box-shadow:
    0 6px 0 #c98742,
    0 0 0 7px #ffe4a76b,
    0 10px 18px #dcaa5940;
  border-color: #fff5ce;
  animation: node-pulse 2.5s ease-in-out infinite;
}
.level-node.locked .level-disc {
  background: #d9e3c8;
  box-shadow: 0 4px 0 #b4c29f;
  color: #a3b28f;
  border-color: #e8eedb;
}
.level-node.locked .icon {
  width: 22px;
  height: 22px;
}
.level-node.boss .level-disc {
  border-radius: 19px;
  rotate: 5deg;
}
.level-node:active .level-disc {
  transform: translateY(4px);
}
.level-stars {
  margin-top: 8px;
  display: block;
  height: 14px;
}
.level-stars .icon {
  width: 14px;
  height: 14px;
}
.level-node.locked .level-stars {
  opacity: 0.5;
}
.level-name {
  font-size: 9px;
  color: #7d9471;
  white-space: nowrap;
  margin-top: 4px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.level-crown {
  position: absolute;
  left: calc(50% - 11px);
  top: -16px;
  z-index: 3;
  color: #ba8b35;
  rotate: -10deg;
}
.level-crown .icon {
  fill: #ffda73;
  width: 23px;
  height: 23px;
}
.you-are-here {
  position: absolute;
  top: -27px;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 10px;
  background: #fff6da;
  color: #b47a37;
  padding: 4px 9px;
  border-radius: 9px;
  box-shadow: 0 2px 0 #d9caa0;
}
.map-scenery {
  position: absolute;
  width: 100px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}
.map-scenery-a {
  top: 420px;
  right: -17px;
  rotate: 15deg;
  width: 98px;
}
.map-scenery-b {
  top: 770px;
  left: -17px;
  width: 94px;
  rotate: -10deg;
}
.map-flower {
  position: absolute;
  color: #eeb77a;
  font-size: 25px;
}
.flower-a {
  top: 340px;
  left: 18%;
}
.flower-b {
  top: 890px;
  right: 15%;
}
.map-dock {
  padding: 7px 4px 6px;
  align-self: center;
  width: min(100%, 400px);
  margin: auto;
}
.map-dock .button {
  width: 100%;
  height: 67px;
}
.map-dock .button span {
  text-align: center;
}
.world-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.world-picker-grid button {
  padding: 6px 6px 12px;
  background: #edf3df;
  border: 2px solid #e2eacb;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.world-picker-grid button.chosen {
  border-color: #f2b26a;
  background: #fcf0d3;
}
.world-picker-grid img {
  width: 87px;
  height: 83px;
  object-fit: contain;
}
.world-picker-grid b {
  font-size: 12px;
}
.world-picker-grid small {
  font-size: 9px;
  color: #839771;
  margin-top: 5px;
}
.challenge-screen {
  display: grid;
  grid-template-rows: 52px 105px minmax(100px, 1fr) 90px 116px;
  gap: 12px;
  max-width: 700px;
}
.challenge-hud-title {
  font-size: 14px;
  font-weight: 800;
}
.event-heading {
  text-align: center;
  align-self: center;
}
.event-ribbon {
  background: #fff3ce;
  color: #bc9050;
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 10px;
  display: inline-block;
}
.event-heading h1 {
  font-size: 36px;
  color: #8a9b50;
  font-weight: 950;
  margin-top: 10px;
  text-shadow: 0 3px 0 #fff8d9;
}
.endless-screen .event-heading h1 {
  color: #9373aa;
}
.event-heading p {
  font-size: 11px;
  color: #8a9b79;
  margin-top: 9px;
}
.event-scene {
  position: relative;
  height: 100%;
  min-height: 0;
  width: min(100%, 350px);
  margin: auto;
}
.event-world {
  height: 100%;
  width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 7px #5678461b);
  animation: island-float 5s ease-in-out infinite;
}
.event-friend {
  position: absolute;
  top: 12%;
  right: 18%;
  width: 27%;
  height: 38%;
  object-fit: contain;
  rotate: 12deg;
  animation: float 4s ease-in-out infinite;
}
.event-spark {
  position: absolute;
  top: 21%;
  left: 18%;
  font-size: 28px;
  color: #e9bf66;
}
.event-ticket {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #fff9e6;
  border: 3px solid #fffdf1;
  border-radius: 22px;
  box-shadow: 0 5px 0 #d1dbb5;
  width: min(100%, 420px);
  margin: auto;
  height: 84px;
}
.event-ticket > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  flex: 1;
  min-width: 0;
}
.event-ticket > div + div {
  border-left: 1px dashed #dce2c7;
}
.event-ticket small {
  font-size: 10px;
  color: #91a17b;
}
.event-ticket b {
  font-size: 24px;
  font-weight: 850;
  color: #6b8558;
}
.event-ticket em {
  font-style: normal;
  font-size: 10px;
  color: #91a17b;
}
.ticket-hearts {
  color: #e78b7b;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.ticket-hearts .icon {
  fill: currentColor;
  width: 21px;
  height: 24px;
}
.event-controls {
  width: min(100%, 420px);
  margin: auto;
}
.event-controls .button {
  height: 63px;
  width: 100%;
}
.event-controls p {
  text-align: center;
  font-size: 10px;
  color: #91a07b;
  min-height: 24px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  margin-top: 17px;
}
.event-controls .stars .icon {
  width: 15px;
  height: 15px;
}
.play-screen {
  --board-size: min(
    calc(100vw - 44px),
    calc(100dvh - var(--safe-top) - var(--safe-bottom) - 326px),
    520px
  );
  display: grid;
  grid-template-rows: 62px 57px minmax(0, 1fr) 30px 43px 112px;
  gap: 0;
  max-width: 850px;
  padding-bottom: calc(12px + var(--safe-bottom));
}
.play-screen .scene-atmosphere {
  opacity: 0.45;
}
.game-top,
.board-stats {
  width: min(100%, 560px);
  margin: auto;
}
.game-level-title {
  text-align: center;
  min-width: 0;
  flex: 1;
}
.level-world-label {
  font-size: 10px;
  color: #7f946f;
  min-height: 24px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.level-world-label .icon {
  width: 12px;
  height: 12px;
}
.game-level-title h1 {
  font-size: 18px;
  font-weight: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  line-height: 1.3;
}
.game-level-title h1 > b {
  font-size: 18px;
  color: #a2b58b;
  font-weight: 850;
}
.game-level-title h1 > em {
  font-style: normal;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 2px;
  color: #ac924e;
  background: #f3e9c5;
  padding: 4px 5px;
  border-radius: 8px;
}
.game-level-title h1 > em .icon {
  width: 12px;
  height: 12px;
}
.board-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  align-items: center;
  width: min(100%, 410px);
  padding: 3px 2px;
}
.board-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.board-stats > div + div {
  border-left: 1px solid #bdcfa863;
}
.board-stats span:not(.stars):not(.hearts) {
  font-size: 9px;
  color: #8b9b7c;
}
.board-stats b {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 850;
}
.board-stats b small {
  font-size: 10px;
  color: #8b9b7c;
}
#live-rating {
  height: 27px;
  display: flex;
  align-items: center;
}
.arena {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 7px 0 13px;
}
.board-scene {
  position: relative;
  width: var(--board-size);
  height: var(--board-size);
  max-width: 100%;
  aspect-ratio: 1;
  isolation: isolate;
}
.board-edge {
  position: absolute;
  inset: -10px -10px -14px;
  background: color-mix(in srgb, var(--world) 72%, #c5d2a0);
  border-radius: 27px;
  border: 3px solid #ffffed;
  box-shadow:
    0 8px 0 color-mix(in srgb, var(--world) 72%, #7f986d),
    0 15px 26px #4c75451a;
  z-index: -1;
}
.board {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  border-radius: 17px;
  background: color-mix(in srgb, var(--world) 40%, var(--world-bg));
  padding: 0;
}
.board-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  align-self: center;
  text-align: center;
  color: #7b916c;
  font-size: 11px;
  line-height: 1.35;
  padding: 0 4px;
}
.board-message .icon {
  width: 16px;
  height: 16px;
  color: #b39b57;
}
.partner-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}
.partner-strip {
  display: flex;
  gap: 5px;
  align-items: center;
}
.partner-strip > button {
  height: 39px;
  width: 39px;
  border-radius: 50%;
  padding: 3px;
  background: #eff3de;
  border: 2px solid #d4dfbd;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.partner-strip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.partner-strip > button.selected {
  border-color: var(--orb-color);
  background: #fffceb;
  box-shadow: 0 0 0 2px #ffffec;
}
.partner-bar #docked-count {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #82956f;
  white-space: nowrap;
}
.partner-bar #docked-count .icon {
  width: 14px;
  height: 14px;
}
.endless-inline-score {
  font-size: 9px;
  color: #879d76;
  white-space: nowrap;
}
.endless-inline-score b {
  font-size: 11px;
}
.control-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 420px);
  margin: auto;
  align-self: center;
  padding: 4px 6px;
}
.game-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
}
.game-actions button {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 7px 3px;
  min-height: 69px;
  border: 2px solid #fffef3;
  border-radius: 18px;
  background: #fbfbed;
  box-shadow: 0 4px 0 #bfcea8;
}
.game-actions .icon {
  width: 23px;
  height: 23px;
  color: #819c65;
}
.game-actions span {
  font-size: 10px;
}
.game-actions small {
  font-size: 8px;
  color: #c38479;
  display: block;
  margin-top: 2px;
}
.game-actions button:active:not(:disabled) {
  translate: 0 3px;
  box-shadow: 0 1px 0 #bfcea8;
}
.direction-pad {
  display: grid;
  grid-template-columns: repeat(3, 35px);
  grid-template-rows: repeat(3, 32px);
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  isolation: isolate;
}
.direction-pad:before {
  content: "";
  position: absolute;
  inset: 12px;
  background: #c9d6b4;
  border-radius: 30px;
  z-index: -1;
}
.direction {
  display: grid;
  place-items: center;
  border: 2px solid #fffdf1;
  background: linear-gradient(#f3f7df, #e4edca);
  border-radius: 11px;
  box-shadow: 0 3px 0 #a6bb8f;
  min-height: 32px;
}
.direction:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 #a6bb8f;
}
.direction.up {
  grid-area: 1/2;
}
.direction.right {
  grid-area: 2/3;
}
.direction.down {
  grid-area: 3/2;
}
.direction.left {
  grid-area: 2/1;
}
.direction .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}
.direction.up .icon {
  rotate: -90deg;
}
.direction.down .icon {
  rotate: 90deg;
}
.direction.left .icon {
  rotate: 180deg;
}
.pad-center {
  grid-area: 2/2;
  display: grid;
  place-items: center;
  color: #96aa7b;
  font-size: 19px;
}
@keyframes island-float {
  50% {
    translate: -50% -7px;
  }
}
.event-world {
  animation-name: event-float;
}
@keyframes event-float {
  50% {
    transform: translateY(-7px);
  }
}
@keyframes node-pulse {
  50% {
    box-shadow:
      0 6px 0 #c98742,
      0 0 0 11px #ffe4a73b,
      0 10px 18px #dcaa5940;
  }
}
.tiles {
  display: grid;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--size), minmax(0, 1fr));
  position: absolute;
  inset: 0;
  gap: 4px;
}
.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 14%;
  background: #f9fcf0;
}
.floor {
  border: 1px solid #ffffffbf;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--world) 48%, #d5dfc6);
  background: linear-gradient(145deg, #fffff8, #f4f7e9);
}
.wall {
  background: color-mix(in srgb, var(--world) 25%, var(--world-bg));
  border: 1px solid #6171560b;
  box-shadow: inset 0 2px 3px #243c3710;
}
.pebble {
  width: 77%;
  height: 76%;
  display: block;
  border-radius: 35% 44% 28% 40%;
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--world) 45%, #fff4de),
    color-mix(in srgb, var(--world) 85%, #a8aa82)
  );
  box-shadow:
    inset 2px 2px 0 #ffffff65,
    inset -3px -5px 0 #52684513,
    0 3px 2px #2b4c321a;
  transform: rotate(-5deg);
}
.pebble:after {
  content: "";
  position: absolute;
  left: 25%;
  top: 25%;
  width: 20%;
  height: 9%;
  background: #fff8;
  border-radius: 100%;
  transform: rotate(-30deg);
}
.wall:nth-child(3n) .pebble {
  transform: rotate(24deg);
  width: 64%;
  height: 64%;
}
.socket {
  width: 66%;
  height: 66%;
  border: 4px solid color-mix(in srgb, var(--orb-color) 75%, white);
  border-radius: 50%;
  background: color-mix(in srgb, var(--orb-color) 20%, #fffdf5);
  box-shadow:
    inset 0 3px 4px #3c59451d,
    0 1px 0 #fff;
  display: grid;
  place-items: center;
  color: var(--orb-color);
  font-size: 21px;
  font-weight: 600;
}
.tethers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.tether {
  fill: none;
  stroke: #e4a45b;
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.7;
  filter: drop-shadow(0 1px 1px #b885511a);
  transition: d 0.18s ease;
}
.tether-1 {
  stroke: #ae91d3;
}
.orb {
  position: absolute;
  padding: 2px;
  z-index: 3;
  transition:
    left 0.18s cubic-bezier(0.25, 0.8, 0.35, 1.1),
    top 0.18s cubic-bezier(0.25, 0.8, 0.35, 1.1);
  display: grid;
  place-items: center;
  cursor: grab;
  outline-offset: -2px !important;
}
.orb:active {
  cursor: grabbing;
}
.orb img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 4px 2px #263e3424);
  pointer-events: none;
  transition: transform 0.2s;
  position: relative;
  z-index: 1;
}
.orb.selected img {
  transform: translateY(-3px) scale(1.035);
}
.orb.docked img {
  filter: drop-shadow(0 0 5px var(--orb-color));
}
.orb-halo {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.orb.selected .orb-halo {
  border-color: var(--orb-color);
  background: #fff5;
  box-shadow: 0 0 0 3px #fff7;
  inset: 1%;
}
.orb-symbol {
  position: absolute;
  bottom: 7%;
  right: 9%;
  font-size: 9px;
  border-radius: 50%;
  height: 15px;
  width: 15px;
  display: grid;
  place-items: center;
  background: var(--orb-color);
  border: 1px solid #fff9;
  color: #ffffff;
  z-index: 2;
}
.selected-dot {
  display: none;
  position: absolute;
  left: calc(50% - 3px);
  bottom: -6%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.orb.selected .selected-dot {
  display: block;
}
.gate {
  background: repeating-linear-gradient(
    135deg,
    #dab477 0px,
    #dab477 6px,
    #edce9b 6px,
    #edce9b 12px
  );
  box-shadow: 0 4px 0 #bb9055;
  color: #92703f;
}
.gate-bars {
  font-size: 30px;
}
.gate-open .gate {
  background: #e8e9ce;
  box-shadow: inset 0 0 0 2px #bdc59b;
  color: #b6bd93;
}
.gate-open .gate-bars {
  opacity: 0.3;
}
.switch {
  background: #fff0c7;
}
.switch-glyph {
  font-size: 35px;
  color: #bb8b48;
  font-weight: 700;
  line-height: 1;
}
.gate-open .switch {
  background: #e1efc7;
}
.gate-open .switch-glyph {
  color: #789752;
}
.portal {
  background: #e9dcf9;
  box-shadow:
    0 4px 0 #c8b5db,
    inset 0 0 8px #a98ece40;
}
.portal-glyph {
  font-size: 35px;
  line-height: 1;
  color: #aa83c8;
  animation: rotate 12s linear infinite;
}
.ice {
  background: linear-gradient(
    135deg,
    #e8f8ff 20%,
    #c7e9f3 21%,
    #e3f8ff 35%,
    #d0eafa 70%,
    #edfaff 71%
  );
  box-shadow: 0 4px 0 #a6d1e0;
}
.ice-glyph {
  font-size: 30px;
  color: #92bdce;
}
dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid #e1e7d8;
  border-radius: 26px;
  padding: 37px 32px 30px;
  background: #fcfcf3;
  color: var(--ink);
  box-shadow: 0 30px 100px #142d3833;
  overflow: visible;
  max-height: calc(100dvh - 40px);
}
dialog::backdrop {
  background: #173c365e;
  backdrop-filter: blur(7px);
}
.dialog-content {
  overflow-y: auto;
  max-height: calc(100dvh - 115px);
  scrollbar-width: thin;
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
}
.dialog-close .icon {
  width: 17px;
  height: 17px;
}
.dialog-content > .eyebrow {
  font-size: 8px;
  color: #96a086;
  margin-bottom: 10px;
}
.dialog-content h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
  line-height: 1.4;
}
.dialog-content > p {
  font-size: 11px;
  color: #8d9a80;
  line-height: 1.9;
  margin: 15px 0;
}
.dialog-content > .button {
  width: 100%;
  margin-top: 10px;
}
.dialog-content > .text-button {
  display: flex;
  margin: 16px auto 0;
}
.result-dialog {
  text-align: center;
  isolation: isolate;
}
.result-friends {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 20px auto 12px;
}
.result-friends img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  transform: rotate(-14deg);
  animation: bounce-in 0.6s cubic-bezier(0.17, 0.8, 0.33, 1.2) both;
}
.result-friends img + img {
  transform: rotate(14deg);
  margin-left: -5px;
  animation-delay: 0.1s;
}
.result-stars {
  margin: 20px 0 10px;
}
.result-stars .icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.3;
}
.result-stars .stars {
  gap: 10px;
}
.crown-earned {
  font-size: 10px;
  color: #ab8f41;
  background: #f6edce;
  border: 1px solid #e8dba9;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 30px;
  padding: 6px 11px;
  margin-top: 2px;
}
.crown-earned .icon {
  width: 14px;
  height: 14px;
}
.result-metrics {
  display: flex;
  justify-content: center;
  margin: 23px 0 15px;
}
.result-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 35px;
}
.result-metrics > div + div {
  border-left: 1px solid var(--line);
}
.result-metrics span {
  font-size: 9px;
  color: #95a086;
}
.result-metrics b {
  font-size: 30px;
  line-height: 1;
  font-weight: 550;
}
.result-secondary {
  display: flex;
  justify-content: space-between;
  padding: 15px 10px 0;
}
.result-secondary .text-button {
  font-size: 10px;
}
.result-icon {
  margin: 10px auto 15px;
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8e3ef;
  color: #9c89b0;
}
.result-icon .icon {
  width: 50px;
  height: 50px;
}
.result-score {
  font-size: 55px;
  letter-spacing: -2px;
  margin: 25px 0;
}
.result-score small {
  font-size: 15px;
  letter-spacing: 0;
}
.help-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #becaa9;
  background: #edf2df;
  border-radius: 17px;
  margin: 20px 0 25px;
  padding: 7px;
}
.help-duo img {
  height: 70px;
  width: 70px;
  object-fit: contain;
}
.help-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.help-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  margin: 19px 0;
}
.help-steps li:before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 23px;
  height: 23px;
  background: #e7edde;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  color: #8a9d77;
}
.help-steps b {
  font-size: 12px;
}
.help-steps p {
  font-size: 10px;
  color: #8d9b81;
  line-height: 1.9;
  margin-top: 5px;
}
.help-scoring {
  font-size: 9px;
  color: #a59c6b;
  border-top: 1px solid var(--line);
  padding: 15px 0;
}
.help-scoring .icon {
  width: 13px;
  height: 13px;
  margin: 0 5px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 25px 0;
}
.setting-row > span {
  font-size: 13px;
}
.setting-row .icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}
.setting-row small {
  display: block;
  font-size: 10px;
  color: #95a28c;
  margin-top: 7px;
}
.toggle {
  width: 43px;
  height: 25px;
  background: #d9e0ce;
  border-radius: 20px;
  padding: 3px;
  transition: background 0.2s;
}
.toggle i {
  display: block;
  height: 19px;
  width: 19px;
  background: #fcfcf5;
  border-radius: 50%;
  box-shadow: 0 1px 4px #0001;
  transition: transform 0.2s;
}
.toggle.on {
  background: #83a475;
}
.toggle.on i {
  transform: translateX(18px);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: all 0.22s;
  max-width: calc(100% - 30px);
  width: max-content;
  z-index: 9999;
  background: #29453f;
  color: #fafbeb;
  padding: 12px 20px;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 5px 30px #213d3626;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.loading {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #edf1e4;
}
.loading h1 {
  font-size: 28px;
}
.loading p {
  font-size: 13px;
  color: #91a17f;
}
.loading code {
  font-size: 12px;
  background: #fff;
  padding: 10px 15px;
  border-radius: 8px;
}
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 26px;
  pointer-events: none;
  z-index: -1;
}
.confetti i {
  position: absolute;
  left: calc(var(--i) * 5%);
  top: -10px;
  width: 6px;
  height: 12px;
  background: var(--color);
  opacity: 0;
  animation: confetti 2.5s calc(var(--i) * 0.06s) ease-out forwards;
}
.bump {
  animation: bump 0.2s;
}
.brand-mark {
  height: 45px;
  width: 70px;
  background:
    radial-gradient(circle at 23px 20px, #f88162 0 18px, transparent 19px),
    radial-gradient(circle at 50px 25px, #55c8bb 0 18px, transparent 19px);
}
@keyframes float {
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}
@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}
@keyframes bump {
  25%,
  75% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
}
@keyframes bounce-in {
  from {
    opacity: 0;
    scale: 0.3;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes confetti {
  0% {
    opacity: 0.8;
    transform: translateY(0) rotate(0);
  }
  80% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(530px) rotate(450deg);
  }
}
[data-motion="off"] *,
[data-motion="off"] *:before,
[data-motion="off"] *:after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Game dialogs use readable text and touch-sized controls. */
dialog {
  padding: 34px 24px 25px;
  border: 3px solid #fffef1;
  box-shadow:
    0 8px 0 #aabf91,
    0 30px 100px #142d3833;
  background: #fcfbe9;
  border-radius: 28px;
}
.dialog-close {
  width: 44px;
  height: 44px;
  top: 3px;
  right: 3px;
  box-shadow: none;
  background: transparent;
}
.dialog-content > p,
.help-steps p {
  font-size: 12px;
  color: #7c906e;
  line-height: 1.8;
}
.dialog-content > .eyebrow {
  font-size: 10px;
  color: #9aa780;
}
.help-steps b {
  font-size: 14px;
}
.help-scoring {
  font-size: 11px;
  line-height: 1.8;
}
.result-metrics span {
  font-size: 11px;
}
.crown-earned {
  font-size: 11px;
}
.result-secondary .text-button {
  font-size: 12px;
}
.setting-row small {
  font-size: 11px;
}
.setting-row > span {
  font-size: 14px;
}
.setting-row {
  padding: 20px 0;
}
.toggle {
  width: 48px;
  height: 30px;
}
.toggle i {
  width: 24px;
  height: 24px;
}
.toggle.on i {
  transform: translateX(18px);
}
#toast {
  bottom: calc(15px + var(--safe-bottom));
  padding: 12px 18px;
  font-size: 12px;
  text-align: center;
  border: 2px solid #fff7d9;
  background: #42674ae8;
  color: #fffde6;
  border-radius: 18px;
  box-shadow: 0 4px 12px #244b3420;
  pointer-events: none;
}
.loading {
  height: 100%;
}
@media (min-width: 700px) and (min-height: 700px) {
  .menu-screen {
    padding-bottom: 24px;
    grid-template-rows: 52px 130px minmax(180px, 1fr) 244px 24px;
    gap: 12px;
  }
  .menu-controls {
    gap: 27px;
  }
  .mode-emblem {
    width: 72px;
    height: 70px;
  }
  .menu-modes b {
    font-size: 14px;
  }
  .menu-modes small {
    font-size: 11px;
  }
  .cloud-a {
    left: 4%;
  }
  .cloud-b {
    right: 4%;
  }
  .island-a {
    left: 2%;
    width: 130px;
  }
  .island-b {
    right: 2%;
    width: 110px;
  }
  .play-screen {
    --board-size: min(calc(100dvh - 326px), 520px);
  }
  .map-track {
    max-width: 400px;
  }
  .map-title h1 {
    font-size: 24px;
  }
}
@media (max-height: 690px) and (orientation: portrait) {
  .menu-screen {
    grid-template-rows: 44px 90px minmax(100px, 1fr) 197px 20px;
    gap: 5px;
    padding-top: calc(8px + var(--safe-top));
    padding-bottom: calc(8px + var(--safe-bottom));
  }
  .game-logo h1 {
    font-size: 36px;
  }
  .game-logo p {
    margin-top: 5px;
    font-size: 10px;
  }
  .logo-en {
    font-size: 11px;
  }
  .menu-controls {
    gap: 18px;
  }
  .start-button {
    height: 64px;
    font-size: 20px;
  }
  .mode-emblem {
    width: 55px;
    height: 53px;
    border-radius: 18px;
  }
  .mode-emblem > .icon {
    width: 28px;
    height: 28px;
  }
  .menu-modes {
    gap: 9px;
  }
  .menu-modes > button {
    gap: 5px;
  }
  .menu-modes b {
    font-size: 12px;
  }
  .scene-bubble {
    font-size: 10px;
    top: 8%;
    right: 5%;
    padding: 6px 9px;
  }
  .play-screen {
    grid-template-rows: 54px 51px minmax(0, 1fr) 28px 40px 103px;
    --board-size: min(
      calc(100vw - 44px),
      calc(100dvh - var(--safe-top) - var(--safe-bottom) - 298px),
      480px
    );
  }
  .game-top .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
  .game-level-title h1 {
    font-size: 16px;
  }
  .game-level-title h1 > b {
    font-size: 16px;
  }
  .board-stats b {
    font-size: 21px;
  }
  .board-message {
    font-size: 10px;
  }
  .control-dock {
    gap: 12px;
    padding: 4px;
  }
  .game-actions {
    gap: 7px;
  }
  .direction-pad {
    grid-template-columns: repeat(3, 32px);
    grid-template-rows: repeat(3, 30px);
  }
  .direction {
    min-height: 30px;
  }
  .game-actions button {
    min-height: 63px;
  }
  .partner-strip > button {
    width: 36px;
    height: 36px;
  }
  .challenge-screen {
    grid-template-rows: 45px 98px minmax(90px, 1fr) 78px 106px;
    gap: 8px;
  }
  .event-heading h1 {
    font-size: 31px;
  }
  .event-ticket {
    height: 74px;
  }
  .event-controls .button {
    height: 58px;
  }
  .event-controls p {
    margin-top: 14px;
  }
  .map-screen {
    grid-template-rows: 53px 46px minmax(0, 1fr) 78px;
    gap: 4px;
  }
  .map-dock .button {
    height: 62px;
  }
}
@media (max-width: 359px) {
  .game-shell {
    padding-left: 13px;
    padding-right: 13px;
  }
  .menu-modes small {
    font-size: 9px;
  }
  .game-level-title h1 {
    font-size: 15px;
    gap: 4px;
  }
  .game-level-title h1 > b {
    font-size: 14px;
  }
  .game-level-title h1 > em {
    padding: 3px;
    font-size: 8px;
  }
  .control-dock {
    gap: 10px;
  }
  .game-actions {
    gap: 6px;
  }
  .game-actions button {
    border-radius: 14px;
  }
  .partner-bar {
    gap: 8px;
  }
  .partner-strip {
    gap: 3px;
  }
  .endless-inline-score {
    font-size: 8px;
  }
  .board-message {
    font-size: 9px;
  }
  .map-title h1 {
    font-size: 19px;
  }
  .map-screen .currency-pill {
    gap: 4px;
    padding: 6px 7px;
  }
  .map-screen .currency-pill .icon {
    width: 16px;
  }
  .dialog-content h2 {
    font-size: 22px;
  }
  .result-metrics > div {
    padding: 0 25px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .game-shell {
    padding: calc(10px + var(--safe-top)) max(20px, env(safe-area-inset-right))
      calc(10px + var(--safe-bottom)) max(20px, env(safe-area-inset-left));
  }
  .menu-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 45px 1fr 25px;
    column-gap: 28px;
    max-width: 900px;
  }
  .menu-hud {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .game-logo {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    z-index: 2;
    margin-top: 4px;
  }
  .game-logo h1 {
    font-size: 35px;
  }
  .game-logo p {
    display: none;
  }
  .logo-en {
    font-size: 10px;
  }
  .logo-orbit {
    left: calc(50% - 105px);
    font-size: 22px;
  }
  .menu-scene {
    grid-column: 1;
    grid-row: 2;
    margin-top: 58px;
    height: calc(100% - 58px);
    min-height: 0;
    align-self: end;
  }
  .scene-bubble {
    display: none;
  }
  .menu-controls {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    gap: 22px;
  }
  .start-button {
    height: 64px;
    font-size: 19px;
  }
  .mode-emblem {
    width: 51px;
    height: 49px;
    border-radius: 16px;
  }
  .mode-emblem > .icon {
    width: 25px;
    height: 25px;
  }
  .menu-modes {
    gap: 8px;
  }
  .menu-modes b {
    font-size: 11px;
  }
  .menu-modes small {
    font-size: 8px;
  }
  .menu-rank {
    grid-column: 1/-1;
    grid-row: 3;
  }
  .cloud-a {
    scale: 0.6;
    top: 52%;
  }
  .cloud-b {
    scale: 0.4;
    top: 33%;
  }
  .distant-island {
    opacity: 0.16;
  }
  .play-screen {
    --board-size: min(
      calc(100dvh - var(--safe-top) - var(--safe-bottom) - 96px),
      calc(58vw - 56px),
      440px
    );
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(215px, 0.9fr);
    grid-template-rows: 56px 52px minmax(0, 1fr) 38px 102px;
    column-gap: 26px;
    max-width: 940px;
  }
  .game-top {
    grid-area: 1/1/2/3;
    max-width: none;
    justify-content: space-between;
  }
  .game-level-title {
    flex: 0 1 auto;
  }
  .game-level-title h1 {
    font-size: 17px;
  }
  .board-stats {
    grid-area: 2/2;
    width: 100%;
  }
  .arena {
    grid-area: 2/1/6/2;
    padding: 10px 0 15px;
  }
  .board-message {
    grid-area: 3/2;
    font-size: 11px;
    align-self: center;
  }
  .partner-bar {
    grid-area: 4/2;
    gap: 8px;
    flex-wrap: wrap;
    align-content: center;
  }
  .partner-strip > button {
    width: 34px;
    height: 34px;
  }
  .endless-inline-score {
    font-size: 8px;
  }
  .control-dock {
    grid-area: 5/2;
    width: 100%;
    gap: 10px;
    padding: 0;
  }
  .game-actions {
    gap: 6px;
  }
  .game-actions button {
    min-height: 61px;
    border-radius: 14px;
  }
  .game-actions .icon {
    width: 20px;
    height: 20px;
  }
  .direction-pad {
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(3, 28px);
  }
  .direction {
    min-height: 28px;
  }
  .direction .icon {
    width: 18px;
    height: 18px;
  }
  .board-edge {
    border-radius: 23px;
  }
  .challenge-screen {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 45px 77px minmax(0, 1fr) 90px;
    column-gap: 24px;
    row-gap: 7px;
    max-width: 880px;
  }
  .screen-hud {
    grid-column: 1/-1;
  }
  .event-heading {
    grid-area: 2/1;
    z-index: 1;
  }
  .event-heading h1 {
    font-size: 27px;
    margin-top: 6px;
  }
  .event-heading p {
    display: none;
  }
  .event-ribbon {
    font-size: 9px;
  }
  .event-scene {
    grid-area: 3/1/5/2;
    height: 100%;
  }
  .event-ticket {
    grid-area: 2/2/4/3;
    height: 84px;
    width: 100%;
    align-self: center;
  }
  .event-ticket b {
    font-size: 20px;
  }
  .event-ticket small {
    font-size: 9px;
  }
  .event-controls {
    grid-area: 4/2;
    align-self: center;
    width: 100%;
  }
  .event-controls .button {
    height: 54px;
    min-height: 54px;
    font-size: 14px;
  }
  .event-controls p {
    font-size: 9px;
    margin-top: 12px;
  }
  .map-screen {
    max-width: 680px;
    grid-template-rows: 47px 0 minmax(0, 1fr) 63px;
    gap: 5px;
  }
  .world-switcher {
    position: absolute;
    right: 19px;
    top: 66px;
    z-index: 5;
    flex-direction: column;
    gap: 10px;
  }
  .world-picker-button {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0;
  }
  .world-picker-button .icon:last-child {
    display: none;
  }
  .map-scroll {
    margin-right: 55px;
  }
  .map-track {
    max-width: 350px;
  }
  .map-dock {
    width: 360px;
    padding: 0 0 5px;
  }
  .map-dock .button {
    height: 56px;
    min-height: 56px;
    font-size: 14px;
  }
  .map-title h1 {
    font-size: 19px;
  }
  .map-title small {
    font-size: 8px;
  }
  .screen-hud > .icon-button {
    width: 38px;
    height: 38px;
  }
  .map-screen .currency-pill {
    padding: 5px 9px;
  }
  .world-picker-dialog {
    width: min(680px, calc(100% - 40px));
  }
  .world-picker-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .world-picker-grid img {
    width: 65px;
    height: 57px;
  }
  .result-friends {
    margin: 8px auto 3px;
  }
  .result-friends img {
    width: 75px;
    height: 75px;
  }
  .result-stars {
    margin: 9px 0;
  }
  .result-stars .icon {
    width: 27px;
    height: 27px;
  }
  .result-metrics {
    margin: 13px 0;
  }
  .result-metrics b {
    font-size: 24px;
  }
  .result-secondary {
    padding-top: 7px;
  }
}
/* Keep every explicit mobile control large enough for a thumb. */
.play-screen {
  grid-template-rows: 62px 57px minmax(0, 1fr) 30px 48px 146px;
  --board-size: min(
    calc(100vw - 44px),
    calc(100dvh - var(--safe-top) - var(--safe-bottom) - 397px),
    520px
  );
}
.direction-pad {
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
}
.direction {
  min-height: 44px;
}
.partner-strip > button {
  width: 44px;
  height: 44px;
}
.world-switcher > .icon-button {
  width: 44px;
  height: 44px;
}
.control-dock {
  gap: 14px;
}
.game-actions {
  gap: 8px;
}
@media (max-height: 690px) and (orientation: portrait) {
  .play-screen {
    grid-template-rows: 54px 51px minmax(0, 1fr) 28px 48px 146px;
    --board-size: min(
      calc(100vw - 44px),
      calc(100dvh - var(--safe-top) - var(--safe-bottom) - 373px),
      480px
    );
  }
}
@media (max-width: 359px) {
  .control-dock {
    gap: 10px;
    padding: 0;
  }
  .game-actions {
    gap: 6px;
  }
  .partner-bar {
    gap: 6px;
  }
  .partner-strip > button {
    width: 44px;
    height: 44px;
  }
  .game-actions .icon {
    width: 21px;
    height: 21px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .play-screen {
    grid-template-rows: 48px 48px minmax(0, 1fr) 48px 144px;
    --board-size: min(
      calc(100dvh - var(--safe-top) - var(--safe-bottom) - 96px),
      calc(58vw - 56px),
      440px
    );
  }
  .game-actions {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 44px);
    gap: 4px;
  }
  .game-actions button {
    flex-direction: row;
    gap: 5px;
    min-height: 44px;
    padding: 5px 3px;
    border-radius: 12px;
  }
  .game-actions span {
    font-size: 9px;
  }
  .game-actions small {
    display: inline;
    margin-left: 3px;
  }
  .game-actions .icon {
    width: 18px;
    height: 18px;
  }
  .control-dock {
    gap: 14px;
  }
  .partner-bar {
    gap: 5px;
  }
  .partner-strip > button {
    width: 44px;
    height: 44px;
  }
  .partner-strip {
    gap: 4px;
  }
  .partner-bar #docked-count {
    font-size: 9px;
  }
  .endless-inline-score {
    font-size: 8px;
  }
  .world-picker-button {
    width: 44px;
    height: 44px;
  }
  .world-switcher {
    top: 62px;
  }
}

.orb:focus-visible {
  outline: none;
}
.orb:focus-visible .orb-halo {
  border-color: var(--orb-color);
  box-shadow: 0 0 0 3px #fff9;
}
.mechanic-world {
  display: block;
  width: 144px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 12px;
  filter: drop-shadow(0 6px 4px #43653915);
}
.mechanic-dialog .dialog-content {
  text-align: center;
}
.mechanic-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #edf2da;
  padding: 10px;
  border-radius: 16px;
  font-size: 11px;
  color: #7d916e;
}
.legend-tile {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  font-size: 23px;
  color: #9cad7a;
  box-shadow: 0 3px 0 #cbd8b0;
}
@media (orientation: landscape) and (max-height: 600px) {
  .mechanic-world {
    width: 95px;
    height: 76px;
    margin-bottom: 6px;
  }
  .mechanic-dialog .dialog-content > p {
    margin: 8px 0;
    font-size: 11px;
  }
  .mechanic-legend {
    padding: 7px;
  }
  .help-duo {
    margin: 10px 0;
  }
  .help-duo img {
    width: 52px;
    height: 52px;
  }
}

@media (orientation: landscape) and (max-height: 350px) {
  .board-message {
    font-size: 9px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
  }
  .board-message span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.map-trial-title {
  top: 52px;
  right: 8px;
  width: auto;
  background: #fff8deaa;
  border: 2px solid #fffce6;
  border-radius: 13px;
  padding: 7px 9px;
  box-shadow: 0 3px 0 #cbd6b8;
  font-size: 10px;
  rotate: 6deg;
}

/* Dense boards retain their square cells on short phones. */
.board {
  --cell-size: calc(var(--board-size) / var(--size));
}
.cell {
  min-height: 0;
}
.socket {
  font-size: clamp(9px, calc(var(--cell-size) * 0.32), 21px);
  border-width: clamp(2px, calc(var(--cell-size) * 0.06), 4px);
}
.switch-glyph,
.portal-glyph {
  font-size: clamp(16px, calc(var(--cell-size) * 0.55), 35px);
}
.gate-bars,
.ice-glyph {
  font-size: clamp(14px, calc(var(--cell-size) * 0.5), 30px);
}

/* MEOW SWEET HOME — illustrated cottage, plush cats and soft yarn. */
:root {
  --ink: #72523f;
  --muted: #a0856a;
  --cream: #fff1db;
  --line: #dfc5a3;
  background: #ead3b4;
}
body {
  background: radial-gradient(ellipse at 50% 40%, #fff2dc, #e7caa6);
}
.game-shell {
  max-width: 760px;
}
.cat-atmosphere {
  background:
    linear-gradient(#fff1d02e, #f6e4c660),
    url("assets/cat-room.webp") center 46% / cover;
  opacity: 1;
}
.play-screen .cat-atmosphere {
  opacity: 1;
  background:
    linear-gradient(#fff2daeb, #fae8ccf2),
    url("assets/cat-room.webp") center / cover;
}
.room-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 40% 35%, #fff7d04a, transparent 70%);
}
.floating-paw {
  position: absolute;
  color: #e8af7b;
  font-size: 23px;
  opacity: 0.45;
}
.paw-a {
  left: 5%;
  top: 46%;
  rotate: -20deg;
}
.paw-b {
  right: 6%;
  top: 63%;
}
.icon-button {
  background: linear-gradient(#fff8e5, #f3debd);
  border: 2px solid #fff5d8;
  border-radius: 50%;
  box-shadow:
    0 4px 0 #b39475,
    0 5px 8px #78512a18;
  color: #907052;
}
.icon-button:active {
  box-shadow: 0 1px 0 #b39475;
}
.currency-pill {
  background: #fff1cc;
  box-shadow: 0 3px 0 #c5a478;
  border-color: #fff5db;
  color: #96704c;
}
.button.primary {
  background: linear-gradient(#ffb376 2%, #f39460 47%, #e88654);
  border: 3px solid #ffe4ad;
  color: #fff9e8;
  border-radius: 24px;
  box-shadow:
    inset 0 3px 0 #ffd6a17d,
    inset 0 -3px 0 #df714580,
    0 6px 0 #aa6842,
    0 9px 0 #e4b68d70,
    0 13px 15px #7143271b;
  font-size: 18px;
  text-shadow: 0 2px 0 #b5704f;
}
.button.primary:active {
  box-shadow:
    inset 0 2px 0 #ffd6a17d,
    0 2px 0 #aa6842;
}
.button.secondary {
  background: #f4e2c9;
  box-shadow: 0 4px 0 #c3a17e;
  border-color: #fff3d7;
}
.menu-screen {
  max-width: 640px;
  grid-template-rows: 48px 126px minmax(120px, 1fr) 216px 24px;
  gap: 8px;
}
.menu-screen .cat-atmosphere {
  background:
    linear-gradient(#fff4d515, transparent 52%, #fff0d143),
    url("assets/cat-room.webp") center 48% / cover;
}
.game-logo h1 {
  color: #b97343;
  -webkit-text-stroke: 1.5px #955731;
  font-size: clamp(43px, 6.7vh, 62px);
  letter-spacing: 1px;
  text-shadow:
    0 3px 0 #fff2cc,
    0 6px 0 #ffe4b5,
    0 8px 0 #a2744e,
    0 10px 10px #613f3140;
  rotate: -3deg;
}
.game-logo h1 span {
  color: #81966a;
  -webkit-text-stroke-color: #566c47;
  display: inline-block;
  rotate: 5deg;
}
.logo-en {
  font-size: 10px;
  letter-spacing: 3px;
  color: #80593d;
  background: #ffedcfdd;
  display: table;
  margin: 10px auto 0;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 0 #d2b086;
  font-weight: 850;
}
.logo-orbit {
  color: #b88656;
  font-size: 32px;
  left: calc(50% - 126px);
  top: -23px;
}
.game-logo p {
  color: #795a40;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 8px;
  text-shadow: 0 1px 0 #fff6de;
}
.menu-scene {
  width: min(100%, 420px);
}
.menu-cats {
  position: absolute;
  bottom: 12%;
  height: min(88%, 230px);
  width: 94%;
  left: 3%;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  filter: drop-shadow(0 8px 3px #80562f25);
}
.menu-cat {
  position: relative;
  width: 47%;
  aspect-ratio: 1;
  max-height: 100%;
  animation: cat-breathe 3.6s ease-in-out infinite;
  z-index: 2;
}
.cat-gray {
  animation-delay: -1.7s;
  rotate: 4deg;
}
.cat-orange {
  rotate: -5deg;
}
.cat-sprite {
  display: block;
  background-image: url("assets/cats.webp");
  background-size: 500% 400%;
  background-position: calc(var(--cat-col, 0) * 25%)
    calc(var(--cat-row, 0) * 100% / 3);
  background-repeat: no-repeat;
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
}
.cat-name-tag {
  position: absolute;
  bottom: -10px;
  left: 50%;
  translate: -50% 0;
  font-size: 11px;
  color: #846041;
  border: 2px solid #fff0cd;
  background: #efd5ae;
  padding: 3px 12px;
  border-radius: 10px;
  box-shadow: 0 3px 0 #b6936f;
  white-space: nowrap;
}
.welcome-rug {
  position: absolute;
  bottom: 2%;
  width: 98%;
  height: 20%;
  left: 1%;
  background: radial-gradient(
    ellipse,
    #a1b78ca8 15%,
    #e9dfbd 16%,
    #a4b48d 24%,
    #c5c5a0 25%,
    #c5c5a045 62%,
    transparent 64%
  );
  border-radius: 50%;
  filter: blur(0.4px);
}
.menu-yarn {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 48%;
  overflow: visible;
  z-index: 1;
}
.menu-yarn path {
  stroke: #dfa891;
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 3px 0 #89594044);
}
.menu-yarn .yarn-shine {
  stroke: #ffead1;
  stroke-width: 1.4;
  stroke-dasharray: 2 4;
}
.scene-bubble {
  top: 0;
  right: 4%;
  rotate: 6deg;
  color: #a16a49;
  box-shadow: 0 3px 0 #c7a37a;
  background: #fff6df;
  border: 2px solid #ffebc4;
  font-size: 11px;
}
.scene-bubble:after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 18px;
  border: 5px solid transparent;
  border-top-color: #fff6df;
}
.home-yarn-ball {
  position: absolute;
  right: 2%;
  bottom: 0;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: repeating-linear-gradient(35deg, #cf8775 0 3px, #e8b3a0 3px 5px);
  box-shadow:
    inset -4px -4px 0 #aa73684d,
    0 3px 2px #7e593933;
  rotate: -20deg;
}
.menu-controls {
  width: min(100%, 370px);
}
.menu-modes {
  gap: 12px;
  margin-top: 21px;
}
.menu-modes > button {
  background: none;
}
.menu-modes b {
  color: #7f573a;
  text-shadow: 0 1px 0 #fff6df;
  font-size: 12px;
}
.menu-modes small {
  color: #927453;
  font-size: 10px;
}
.mode-emblem {
  border: 3px solid #fff1ce;
  background: linear-gradient(#f3d4a5, #dfb68b);
  box-shadow:
    inset 0 2px 0 #ffedcb,
    0 5px 0 #a98765;
  rotate: -5deg;
  color: #917151;
}
.daily-emblem {
  background: linear-gradient(#fae49e, #edc673);
  box-shadow:
    inset 0 2px 0 #fff3c3,
    0 5px 0 #b99b58;
  rotate: 4deg;
  color: #b08036;
}
.endless-emblem {
  background: linear-gradient(#ddbfcd, #c5a2ba);
  box-shadow:
    inset 0 2px 0 #eedcde,
    0 5px 0 #94748c;
  rotate: -3deg;
  color: #8f6a87;
}
.menu-rank {
  color: #8b6747;
  font-weight: 700;
  text-shadow: 0 1px 0 #fff6dc;
}
.menu-rank i {
  background: #af8c69;
}
.start-button {
  min-height: 72px;
}
.map-screen .cat-atmosphere {
  background:
    linear-gradient(#fff0d9dc, #f3ddbcf5),
    url("assets/cat-room.webp") center/cover;
}
.map-track {
  background: radial-gradient(ellipse at 45% 40%, #faf0d2aa, transparent 70%);
}
.map-title h1 {
  color: #95734f;
}
.map-title small,
.level-name {
  color: #ad8b66;
}
.world-picker-button {
  background: #f5e1bd;
  box-shadow: 0 3px 0 #c4a37d;
  color: #98714c;
  border-color: #fff2d6;
}
.route-shadow {
  stroke: #d8b592;
  stroke-width: 18;
}
.route-dots {
  stroke: #fff0ce;
  stroke-width: 9;
  stroke-dasharray: 1 18;
}
.level-disc {
  background: linear-gradient(#fff2cc, #eacba0);
  color: #9c7c56;
  border-color: #fff6dc;
  box-shadow:
    0 6px 0 #b28c63,
    0 9px 12px #7a573625;
}
.level-node.locked .level-disc {
  background: #e1cab0;
  border-color: #f0dcc1;
  box-shadow: 0 4px 0 #bd9f7f;
  color: #b09577;
}
.level-node.completed .level-disc {
  background: linear-gradient(#d7ddb0, #b6c68f);
  box-shadow: 0 6px 0 #8c9d6a;
  color: #6d8150;
}
.you-are-here {
  background: #fff0ce;
  color: #a7794b;
  box-shadow: 0 2px 0 #caa87e;
}
.world-picker-grid button {
  background: #f8ead2;
  border-color: #e5cfad;
}
.world-picker-grid button.chosen {
  background: #ffe5bd;
  border-color: #d59a62;
}
.world-picker-grid small {
  color: #a88a65;
}
.cat-home-art {
  background: url("assets/cat-homes.webp") 0 0/200% 200%;
  aspect-ratio: 1;
  display: block;
}
.world-picker-grid .cat-home-art {
  width: 90px;
  height: 90px;
}
.event-cat-home {
  position: absolute;
  width: min(90%, 280px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  background: url("assets/cat-homes.webp") 0 0/200% 200%;
  filter: drop-shadow(0 12px 6px #8e5c3329);
}
.endless-screen .event-cat-home {
  background-position: 0 100%;
}
.event-friend.cat-sprite {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  width: 49%;
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 5px 3px #6b483544);
  animation: cat-breathe 3s ease-in-out infinite;
}
.event-heading h1 {
  color: #bd8253;
}
.event-heading p,
.event-controls p {
  color: #9d7e5b;
}
.event-ticket {
  background: #fff0d1;
  border-color: #fff8e5;
  box-shadow: 0 4px 0 #cbad86;
}
.event-ticket small {
  color: #a78c68;
}
.event-ticket b {
  color: #947252;
}
.play-screen {
  max-width: 850px;
}
.game-level-title h1 {
  color: #865b3d;
  text-shadow: 0 1px 0 #fff4dc;
}
.game-level-title h1 > b {
  color: #c0956e;
}
.level-world-label {
  color: #a48460;
}
.board-stats {
  background: #fff3d6c9;
  border: 2px solid #fffae9;
  border-radius: 21px;
  box-shadow: 0 3px 0 #d8be96;
  padding: 5px 7px;
  width: min(100%, 410px);
}
.board-stats > div + div {
  border-color: #d6b98f60;
}
.board-stats span:not(.stars):not(.hearts),
.board-stats b small {
  color: #b08e67;
}
.board-stats b {
  color: #94734e;
}
.board-edge {
  background: repeating-linear-gradient(
    0deg,
    #d5ae83 0 8px,
    #ddbb91 9px 11px,
    #d9b389 12px 30px
  );
  border: 3px solid #fae7c6;
  border-radius: 24px;
  box-shadow:
    inset 0 0 0 4px #b890671f,
    0 8px 0 #a77d57,
    0 11px 0 #d6b58c,
    0 18px 23px #85532f2b;
}
.board {
  background: #d9be9d;
  border-radius: 14px;
}
.tiles {
  gap: 3px;
}
.cell {
  border-radius: 12%;
}
.floor {
  background: repeating-linear-gradient(
    0deg,
    #f5e5c9 0 32%,
    #efddbe 33%,
    #f5e5c9 35% 67%,
    #efddbe 68%,
    #f5e5c9 70%
  );
  border: 1px solid #fff6de;
  box-shadow: 0 3px 0 #cbaf8a;
}
.floor:nth-child(3n) {
  background-color: #edd9ba;
  filter: brightness(0.99);
}
.wall {
  background: #cebd9d;
  border: 1px solid #bba58244;
  box-shadow: inset 0 3px 2px #93755222;
}
.pebble {
  width: 66%;
  height: 66%;
  border-radius: 14% 14% 30% 30%;
  background: linear-gradient(
    #c69a76 0 15%,
    #e4b292 16% 26%,
    #c99475 27% 90%,
    #b48167 91%
  );
  box-shadow:
    inset -3px -3px 0 #a2694828,
    0 3px 3px #77523830;
  rotate: 0deg;
}
.pebble:before {
  content: "";
  position: absolute;
  top: 8%;
  left: 35%;
  width: 30%;
  height: 28%;
  border-radius: 50% 0 50% 0;
  background: #95a96f;
  rotate: -25deg;
  box-shadow: 8px -3px 0 #acb983;
}
.pebble:after {
  left: 22%;
  top: 39%;
  height: 25%;
  width: 8%;
  background: #fff0d64d;
  rotate: 0deg;
}
.wall:nth-child(3n) .pebble {
  transform: rotate(4deg);
  width: 64%;
  height: 64%;
}
.cat-home {
  position: relative;
  display: block;
  width: 92%;
  height: 92%;
  background-image: url("assets/cat-homes.webp");
  background-size: 200% 200%;
  background-position: calc(var(--home-x) * 100%) calc(var(--home-y) * 100%);
  filter: drop-shadow(0 3px 1px #83593238);
}
.home-symbol {
  position: absolute;
  bottom: 5%;
  left: 3%;
  font-size: clamp(7px, calc(var(--cell-size) * 0.17), 13px);
  background: #fff0d9;
  border: 1px solid var(--orb-color);
  color: var(--orb-color);
  width: 22%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.home-heart {
  position: absolute;
  top: -4%;
  right: -1%;
  color: var(--orb-color);
  font-size: clamp(10px, calc(var(--cell-size) * 0.24), 19px);
  opacity: 0;
  translate: 0 5px;
  transition: 0.25s;
}
.home-occupied .home-heart {
  opacity: 1;
  translate: 0 -3px;
  animation: cat-heart 2s ease-in-out infinite;
}
.orb {
  transition:
    left 0.24s cubic-bezier(0.22, 0.9, 0.35, 1),
    top 0.24s cubic-bezier(0.22, 0.9, 0.35, 1);
  z-index: 4;
  padding: 0;
}
.orb .cat-sprite {
  position: absolute;
  left: 2%;
  bottom: 0;
  width: 96%;
  height: 96%;
  filter: drop-shadow(0 3px 1px #6143263d);
  transform-origin: 50% 85%;
}
.orb.selected .cat-sprite {
  filter: drop-shadow(0 3px 1px #6143263d) drop-shadow(0 0 2px #fff4cd);
}
.orb-halo {
  inset: 15% 7% 1%;
  width: auto;
  height: auto;
  border: none;
  opacity: 0;
  background: radial-gradient(
    ellipse,
    #ffdba52b 40%,
    #fff2cda1 65%,
    #d7b487 68%,
    transparent 72%
  );
  border-radius: 50%;
}
.orb.selected .orb-halo {
  opacity: 1;
  box-shadow: none;
  border: 0;
}
.orb:focus-visible .orb-halo {
  box-shadow: 0 0 0 2px #c49b70;
}
.selected-dot {
  display: none;
}
.cat-reaction {
  position: absolute;
  right: 0;
  top: -12%;
  min-width: 0;
  font-size: clamp(10px, calc(var(--cell-size) * 0.27), 23px);
  font-weight: 900;
  color: #d8897a;
  text-shadow: 0 1px 0 #fff6db;
  z-index: 5;
  pointer-events: none;
}
.cat-reaction:empty {
  display: none;
}
.tethers {
  z-index: 3;
}
.tether {
  stroke: #d9a18b;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: none;
  opacity: 1;
  filter: none;
}
.yarn-shadow {
  stroke: #88604345;
  stroke-width: 2.3;
  fill: none;
  stroke-linecap: round;
  transform: translateY(0.45px);
}
.yarn-highlight {
  stroke: #ffe7c9;
  stroke-width: 0.45;
  fill: none;
  stroke-linecap: round;
  transform: translateY(-0.3px);
}
.yarn-stitch {
  stroke: #b7816c;
  stroke-width: 0.45;
  fill: none;
  stroke-dasharray: 0.15 1.25;
  stroke-linecap: round;
  opacity: 0.5;
}
.yarn-pair-1 .tether {
  stroke: #bba2c4;
}
.yarn-pair-1 .yarn-stitch {
  stroke: #957caa;
}
.yarn-pair-1 .yarn-highlight {
  stroke: #f0deee;
}
.yarn-knot circle {
  fill: #ffe4c4;
  stroke: #cc9976;
  stroke-width: 0.4;
}
.yarn-knot path {
  fill: #d99585;
  stroke: none;
}
.yarn-tug {
  animation: yarn-tug 0.4s ease-out;
  transform-origin: center;
}
.board-message {
  color: #ab805b;
}
.partner-bar #docked-count {
  color: #a1815e;
}
.partner-strip > button {
  background: #f2dfc0;
  border-color: #e2c6a2;
  padding: 1px;
}
.partner-strip > button.selected {
  background: #fff1d6;
  border-color: var(--orb-color);
  box-shadow: 0 3px 0 #bd9470;
}
.partner-strip .cat-sprite {
  width: 100%;
  height: 100%;
}
.game-actions button {
  background: linear-gradient(#fff6dc, #eddbbc);
  border-color: #fff2d0;
  box-shadow: 0 4px 0 #baa07e;
  border-radius: 20px;
}
.game-actions .icon {
  color: #a38663;
}
.game-actions span {
  color: #a38663;
}
.game-actions button:active:not(:disabled) {
  box-shadow: 0 1px 0 #baa07e;
}
.direction {
  background: linear-gradient(#d9dfba, #bfcd9c);
  border-color: #edf0ce;
  box-shadow: 0 3px 0 #91a16e;
  color: #778c57;
  border-radius: 14px;
}
.direction:active {
  box-shadow: 0 1px 0 #91a16e;
}
.direction-pad:before {
  background: #c8c79f;
}
.pad-center {
  color: #8a9e70;
  font-size: 26px;
}
.gate {
  background: #f0d4a8;
}
.gate-bars {
  color: #af8b59;
}
.switch {
  background: #fbe2ab;
}
.switch-glyph {
  color: #c39a48;
}
.portal {
  background: #e5d4e6;
}
.ice {
  background: #dceaea;
}
dialog {
  background: #fff0d6;
  border: 4px solid #fff6dd;
  box-shadow:
    0 7px 0 #c3a17a,
    0 20px 80px #55382155;
  border-radius: 30px;
  color: #846043;
}
dialog::backdrop {
  background: #65483273;
  backdrop-filter: blur(5px);
}
.dialog-content > p,
.result-secondary {
  color: #a68865;
}
.dialog-content h2 {
  color: #9e6d49;
}
.eyebrow {
  color: #ba9972;
  letter-spacing: 2px;
}
.result-friends {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 0;
  height: 120px;
  margin: 4px 0 12px;
}
.result-friends .cat-sprite {
  width: 120px;
  height: 120px;
  flex: 0 1 120px;
  animation: cat-victory 0.8s ease-in-out infinite;
}
.result-friends .cat-sprite:nth-child(2n) {
  animation-delay: -0.4s;
}
.result-friends:has(.cat-sprite:nth-child(4)) .cat-sprite {
  width: 80px;
  height: auto;
  flex: 0 1 80px;
  min-width: 0;
}
.result-friends:has(.cat-sprite:nth-child(4)) {
  padding-inline: 6px;
}
.sad-friends .cat-sprite {
  animation: cat-breathe 3s ease-in-out infinite;
}
.result-dialog h2 {
  font-size: 25px;
}
.result-metrics {
  background: #f8e4c4;
}
.crown-earned {
  color: #bd9355;
  background: #fff1c6;
}
.result-score {
  color: #a98150;
}
.help-duo .cat-sprite {
  width: 82px;
  height: 82px;
}
.help-duo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.help-scoring {
  background: #f4e0bd;
  color: #a28056;
}
.setting-row {
  border-color: #e3cba9;
}
.settings-note {
  color: #ab8d6b;
}
.toggle {
  background: #d9c4a5;
}
.toggle.on {
  background: #a8b487;
}
.mechanic-legend {
  background: #f0ddbc;
  color: #a3835b;
}
.legend-tile {
  box-shadow: 0 3px 0 #c7a982;
}
#toast {
  background: #fff0dceb;
  color: #966d4a;
  border: 2px solid #fff8e1;
  box-shadow:
    0 4px 0 #c2a17b,
    0 8px 20px #61422724;
}
.cat-hop .cat-sprite {
  animation: cat-hop 0.32s ease-out;
}
.cat-pout .cat-sprite {
  animation: cat-pout 0.5s ease-in-out;
}
.cat-cheer .cat-sprite {
  animation: cat-victory 0.6s ease-in-out infinite;
}
.board-celebration {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: visible;
}
.board-celebration span {
  position: absolute;
  left: var(--x);
  top: 80%;
  font-size: 22px;
  color: #de9a82;
  opacity: 0;
  animation: cat-confetti 1.8s var(--delay) ease-out forwards;
}
.board-celebration span:nth-child(2n) {
  color: #c4a45b;
}
.board-celebration span:nth-child(3n) {
  color: #a2af7f;
}
.home-party .board-edge {
  box-shadow: 0 0 35px #fff2b9;
}
.cat-setback {
  animation: cat-setback 1.2s ease-out;
}
@keyframes cat-breathe {
  50% {
    transform: translateY(-3px) rotate(1deg);
  }
}
@keyframes cat-hop {
  40% {
    transform: translateY(-15%) scale(1.05, 0.94);
  }
  75% {
    transform: translateY(2%) scale(0.98, 1.03);
  }
}
@keyframes cat-pout {
  20%,
  60% {
    transform: rotate(-7deg);
  }
  40%,
  80% {
    transform: rotate(6deg);
  }
}
@keyframes cat-victory {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-9px) rotate(3deg);
  }
}
@keyframes cat-heart {
  50% {
    transform: translateY(-4px) scale(1.14);
  }
}
@keyframes cat-confetti {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-15deg) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc((var(--i) - 8) * 7px), -170px) rotate(35deg)
      scale(1.2);
  }
}
@keyframes yarn-tug {
  50% {
    opacity: 0.72;
  }
}
@keyframes cat-setback {
  20% {
    filter: saturate(0.65);
  }
  100% {
    filter: saturate(1);
  }
}
@media (min-width: 700px) and (min-height: 700px) {
  .menu-screen {
    max-width: 620px;
    grid-template-rows: 54px 154px minmax(160px, 1fr) 240px 24px;
  }
  .menu-cats {
    height: min(90%, 270px);
  }
  .result-friends {
    height: 140px;
  }
  .result-friends .cat-sprite {
    width: 140px;
    height: 140px;
  }
}
@media (max-height: 690px) and (orientation: portrait) {
  .menu-screen {
    grid-template-rows: 44px 105px minmax(100px, 1fr) 184px 20px;
    gap: 4px;
  }
  .game-logo h1 {
    font-size: 42px;
  }
  .logo-en {
    margin-top: 7px;
    font-size: 9px;
  }
  .game-logo p {
    font-size: 10px;
    margin-top: 5px;
  }
  .menu-cats {
    height: min(100%, 170px);
    bottom: 8%;
  }
  .scene-bubble {
    font-size: 9px;
    padding: 5px 9px;
    top: -8px;
  }
  .start-button {
    min-height: 61px;
  }
  .menu-modes {
    margin-top: 16px;
  }
  .menu-rank {
    font-size: 9px;
  }
  .result-friends {
    height: 95px;
  }
  .result-friends .cat-sprite {
    width: 95px;
    height: 95px;
  }
}
@media (max-width: 359px) {
  .game-logo h1 {
    font-size: 38px;
  }
  .menu-modes b {
    font-size: 11px;
  }
  .menu-modes small {
    font-size: 8px;
  }
  .game-logo p {
    font-size: 10px;
  }
  .menu-cats {
    width: 98%;
    left: 1%;
  }
  .scene-bubble {
    right: 0;
  }
  .result-dialog h2 {
    font-size: 22px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .menu-screen {
    max-width: 850px;
    grid-template-rows: 44px minmax(0, 1fr) 20px;
  }
  .game-logo {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding-top: 5px;
  }
  .game-logo h1 {
    font-size: 35px;
  }
  .game-logo p {
    font-size: 9px;
  }
  .logo-en {
    font-size: 8px;
    margin-top: 4px;
  }
  .menu-scene {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    height: 63%;
    width: 90%;
  }
  .menu-cats {
    height: 95%;
    bottom: 0;
  }
  .scene-bubble {
    font-size: 9px;
    padding: 4px 8px;
    top: -3px;
    right: 0;
  }
  .menu-controls {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
  .menu-rank {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .menu-hud {
    grid-column: 1 / -1;
  }
  .menu-screen .cat-atmosphere {
    background-position: center 40%;
  }
  .cat-name-tag {
    font-size: 8px;
    padding: 1px 8px;
    bottom: -2px;
  }
  .welcome-rug {
    bottom: -5%;
  }
  .result-friends {
    height: 75px;
  }
  .result-friends .cat-sprite {
    width: 75px;
    height: 75px;
  }
  .help-duo .cat-sprite {
    width: 52px;
    height: 52px;
  }
  .event-friend.cat-sprite {
    width: 45%;
  }
  .home-yarn-ball {
    display: none;
  }
}
html[data-motion="off"] .cat-sprite,
html[data-motion="off"] .menu-cat,
html[data-motion="off"] .yarn-pair,
html[data-motion="off"] .home-heart,
html[data-motion="off"] .board-celebration span,
html[data-motion="off"] .cat-setback {
  animation: none !important;
}
html[data-motion="off"] .board-celebration {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .cat-sprite,
  .menu-cat,
  .yarn-pair,
  .home-heart,
  .board-celebration span,
  .cat-setback {
    animation: none !important;
  }
  .board-celebration {
    display: none;
  }
}
