@font-face {
  font-family: "CuteFantasy";
  src: url("../../Cute Fantasy Sprites/Cute_Fantasy_UI/Fonts/CuteFantasy-5x9.ttf?v=154") format("truetype");
  font-display: swap;
}

:root {
  --ink: #203229;
  --deep-green: #24543c;
  --leaf: #5eaa58;
  --leaf-dark: #397a47;
  --island-edge: #2f6a43;
  --island-cliff: #704a36;
  --soil: #9f6441;
  --soil-dark: #70452f;
  --cream: #fff7df;
  --cream-dark: #eed89d;
  --sky: #71c7d8;
  --coral: #d9665a;
  --gold: #eac45e;
  --shadow: rgba(33, 36, 24, 0.25);
  --screen-width: min(430px, calc(100vw - 24px));
}

@supports (width: 100dvw) {
  :root {
    --screen-width: min(430px, calc(100dvw - 24px));
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

body {
  color: var(--ink);
  font-family: "CuteFantasy", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  letter-spacing: 0;
  background-color: #1499d3;
  background-image: url("../../Cute Fantasy Sprites/Cute_Fantasy/Tiles/Water/Water_Middle.png?v=154");
  background-position: 0 0;
  background-size: 32px 32px;
  image-rendering: pixelated;
}

body.scoring-lab {
  min-height: 100%;
  height: auto;
  overflow: auto;
  background-color: #3d8d49;
  background-image:
    linear-gradient(rgba(255, 247, 223, 0.08), rgba(36, 84, 60, 0.06)),
    url("../../Cute Fantasy Sprites/Cute_Fantasy/Tiles/Grass/Grass_1_Middle.png?v=154");
  background-size: auto, 48px 48px;
}

button {
  color: inherit;
  font: inherit;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.lab-shell {
  width: max-content;
  min-width: 100vw;
  min-height: 100vh;
  padding: 32px;
}

.lab-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  width: min(1040px, calc(100vw - 64px));
  margin-bottom: 18px;
}

.lab-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.lab-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 3px solid var(--deep-green);
  border-radius: 6px;
  background: rgba(249, 234, 191, 0.94);
  color: var(--leaf-dark);
  box-shadow: inset 0 -4px 0 rgba(112, 69, 47, 0.16);
}

.lab-control select {
  max-width: 190px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.lab-results-row {
  display: grid;
  grid-template-columns: max-content minmax(240px, 320px) minmax(620px, 720px);
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.lab-stats {
  display: grid;
  grid-template-columns: repeat(6, 136px);
  gap: 10px;
}

.lab-session,
.lab-comparison {
  min-width: 250px;
  padding: 9px 12px;
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  background: rgba(255, 253, 241, 0.92);
  color: var(--ink);
}

.lab-comparison {
  max-height: min(680px, calc(100vh - 180px));
  overflow: auto;
  overscroll-behavior: contain;
}

.lab-session h2,
.lab-comparison h2 {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1;
}

.lab-session-table,
.lab-comparison-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.lab-comparison-table {
  min-width: 640px;
}

.lab-session-table th,
.lab-session-table td,
.lab-comparison-table th,
.lab-comparison-table td {
  padding: 3px 0;
  border-top: 2px solid rgba(32, 70, 45, 0.16);
  text-align: left;
}

.lab-session-table th,
.lab-comparison-table th {
  color: var(--leaf-dark);
  font-weight: 400;
}

.lab-comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgb(255, 253, 241);
}

.lab-session-table td,
.lab-comparison-table td:not(:first-child) {
  text-align: right;
}

.lab-comparison-table tr.is-best td {
  color: #1d6b43;
}

.lab-status {
  width: min(1040px, calc(100vw - 64px));
  min-height: 38px;
  margin-bottom: 28px;
  padding: 9px 12px;
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  background: rgba(255, 253, 241, 0.92);
  color: var(--leaf-dark);
}

.lab-board-grid {
  display: grid;
  grid-template-columns: repeat(5, max-content);
  gap: 64px;
  align-items: start;
  padding-bottom: 32px;
}

.lab-board-card {
  width: 176px;
}

.lab-board-meta {
  margin-bottom: 6px;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(21, 64, 39, 0.62);
  font-size: 14px;
}

.lab-board {
  --lab-pad: 24px;
  --lab-cell: calc(100% / 5);
  position: relative;
  width: 176px;
  height: 176px;
  background-image: url("assets/bed/farm-bed-garden.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  image-rendering: pixelated;
}

.lab-tile-layer {
  position: absolute;
  inset: var(--lab-pad);
  overflow: visible;
}

.lab-tile {
  position: absolute;
  left: calc(var(--tile-col) * var(--lab-cell));
  top: calc(var(--tile-row) * var(--lab-cell));
  z-index: 1;
  display: block;
  width: var(--lab-cell);
  height: var(--lab-cell);
  transition:
    left 64ms steps(4, end),
    top 64ms steps(4, end),
    opacity 100ms steps(3, end),
    transform 100ms steps(3, end);
  will-change: left, top, opacity, transform;
}

.lab-tile.is-new {
  animation: crop-pop 160ms steps(2, end);
}

.lab-tile.is-vanishing {
  opacity: 0;
  transform: scale(0.68);
}

.lab-board.is-crops-hidden .lab-tile-layer {
  display: none;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.island-layout-stage {
  display: none;
  width: min(704px, 100%);
}

.island-layout-image {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

body.layout-only .app-shell {
  display: grid;
  place-items: center;
}

body.layout-only .island-layout-stage {
  display: block;
}

body.layout-only .game-frame {
  display: none;
}

.game-frame {
  --scene-width: 1920px;
  --scene-height: 1792px;
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.game-frame::before {
  display: none;
}

.game-frame > * {
  position: relative;
  z-index: 2;
}

.world-layer {
  --camera-x: 0px;
  --camera-y: 0px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: var(--scene-width);
  height: var(--scene-height);
  background-image: url("assets/world/play-island@2x.png?v=154");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
  image-rendering: pixelated;
  overflow: visible;
  transform: translate3d(var(--camera-x), var(--camera-y), 0);
  will-change: transform;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.game-frame.is-camera-transitioning .world-layer {
  transition: transform 420ms steps(12, end);
}

.island-decor {
  display: none;
}

.world-prop {
  position: absolute;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 0 rgba(28, 62, 38, 0.18));
}

.world-occluder {
  --occluder-x: 0px;
  --occluder-y: 0px;
  --occluder-w: 32px;
  --occluder-h: 32px;
  --occluder-z: 5;
  position: absolute;
  left: var(--occluder-x);
  top: var(--occluder-y);
  z-index: var(--occluder-z);
  display: block;
  width: var(--occluder-w);
  height: var(--occluder-h);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
  image-rendering: pixelated;
  pointer-events: none;
  opacity: 1;
  transition: opacity 120ms steps(3, end);
  will-change: opacity;
}

.world-occluder.is-faded {
  opacity: 0.42;
}

.prop-tree-a {
  width: 128px;
  height: 160px;
  left: 5%;
  top: 8%;
  background-image: url("assets/world/oak-big.png?v=154");
}

.prop-tree-b {
  width: 86px;
  height: 96px;
  right: 8%;
  top: 12%;
  background-image: url("assets/world/oak-medium.png?v=154");
}

.prop-well {
  width: 62px;
  height: 78px;
  left: 10%;
  bottom: 18%;
  background-image: url("assets/world/well.png?v=154");
}

.prop-rock-a {
  width: 34px;
  height: 34px;
  right: 15%;
  bottom: 16%;
  background-image: url("assets/world/rock-gray.png?v=154");
}

.prop-rock-b {
  width: 28px;
  height: 28px;
  left: 21%;
  top: 27%;
  background-image: url("assets/world/rock-small.png?v=154");
}

.prop-flower-a {
  width: 24px;
  height: 24px;
  left: 19%;
  bottom: 10%;
  background-image: url("assets/world/flower-red.png?v=154");
}

.prop-flower-b {
  width: 24px;
  height: 24px;
  right: 18%;
  top: 31%;
  background-image: url("assets/world/flower-blue.png?v=154");
}

.prop-flower-c {
  width: 24px;
  height: 24px;
  right: 9%;
  bottom: 28%;
  background-image: url("assets/world/flower-yellow.png?v=154");
}

.prop-fence {
  width: 96px;
  height: 38px;
  background-image: url("assets/world/fence-rail.png?v=154");
}

.prop-fence-a {
  left: 13%;
  top: 38%;
}

.prop-fence-b {
  right: 13%;
  bottom: 9%;
}

.top-bar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: var(--screen-width);
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms steps(8, end);
}

.game-frame.is-field-ready .top-bar,
.game-frame.is-playing-field .top-bar {
  opacity: 1;
  pointer-events: auto;
}

.game-frame.is-playing-field .top-bar {
  top: max(8px, env(safe-area-inset-top));
  gap: 6px;
  width: min(420px, calc(100vw - 176px));
}

.game-frame.is-playing-field .title-block {
  display: none;
}

.game-frame.is-playing-field .stat {
  padding: 6px 8px;
}

.game-frame.is-playing-field .stat dt {
  font-size: 11px;
}

.game-frame.is-playing-field .stat dd {
  font-size: 16px;
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #f4e4a4;
  font-size: 14px;
  text-transform: uppercase;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(21, 64, 39, 0.62);
}

h2 {
  font-size: 18px;
  line-height: 1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.stat {
  padding: 8px 10px;
  border: 3px solid var(--deep-green);
  border-radius: 6px;
  background: rgba(249, 234, 191, 0.94);
  box-shadow: inset 0 -4px 0 rgba(112, 69, 47, 0.16);
}

.stat dt {
  color: var(--leaf-dark);
  font-size: 12px;
  line-height: 1;
}

.stat dd {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.main-grid {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.game-frame.is-playing-field .main-grid {
  z-index: 6;
}

.board-column,
.side-panel {
  min-width: 0;
}

.board-column {
  display: contents;
}

.field-topline {
  position: absolute;
  top: 142px;
  left: 50%;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: var(--screen-width);
  margin: 0;
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 320ms steps(8, end);
}

.game-frame.is-field-ready .field-topline,
.game-frame.is-playing-field .field-topline {
  opacity: 1;
  pointer-events: auto;
}

.game-frame.is-playing-field .field-topline {
  top: max(72px, calc(env(safe-area-inset-top) + 72px));
  width: min(420px, calc(100vw - 176px));
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  pointer-events: none;
}

.game-frame.is-playing-field .field-topline button,
.game-frame.is-playing-field .field-topline a,
.game-frame.is-playing-field .field-topline select {
  pointer-events: auto;
}

.game-frame.is-playing-field .field-topline .small-action {
  min-height: 34px;
  padding: 5px 8px;
  border-width: 3px;
  font-size: 15px;
}

.field-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  overflow: hidden;
  background: var(--deep-green);
}

.segment,
.small-action,
.farm-button,
.tool-button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.segment {
  min-width: 96px;
  padding: 10px 12px;
  background: #f9eabf;
}

.skin-segmented .segment {
  min-width: 92px;
}

.segment.is-active {
  color: var(--cream);
  background: var(--coral);
}

.small-action {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 9px 13px;
  border: 3px solid var(--deep-green);
  border-radius: 6px;
  background: var(--sky);
  box-shadow: inset 0 -4px 0 rgba(36, 84, 60, 0.2);
  text-align: center;
  text-decoration: none;
}

.small-action[aria-pressed="true"] {
  color: var(--cream);
  background: var(--coral);
}

.plot-select.is-active {
  color: var(--cream);
  background: var(--coral);
}

.lab-link {
  background: #f9eabf;
}

.board {
  --board-size: 280px;
  --bed-padding: 40px;
  position: absolute;
  top: 512px;
  left: 564px;
  z-index: 4;
  width: var(--board-size);
  max-width: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  justify-content: center;
  padding: var(--bed-padding);
  margin: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  touch-action: none;
  user-select: none;
  pointer-events: none;
}

.game-frame.is-main-plot.is-playing-field #board,
.game-frame.is-rock-plot.is-playing-field #rockBoard,
.game-frame.is-gem-plot.is-playing-field #gemBoard,
.game-frame.is-grow-plot.is-playing-field #growBoard {
  pointer-events: auto;
}

.rock-board {
  --board-size: 240px;
  --bed-padding: 40px;
  top: 512px;
  left: 1164px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gem-board {
  --board-size: 360px;
  --bed-padding: 36px;
  top: 928px;
  left: 1360px;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  background-image: url("assets/bed/farm-bed-garden-gem.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.grow-board {
  --board-size: 360px;
  --bed-padding: 36px;
  top: 928px;
  left: 524px;
  display: none;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  background-image: url("assets/bed/farm-bed-garden-gem.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.mobile-joystick {
  --joystick-x: 50vw;
  --joystick-y: 50vh;
  --joystick-nub-x: 0px;
  --joystick-nub-y: 0px;
  position: fixed;
  top: var(--joystick-y);
  left: var(--joystick-x);
  z-index: 2147483000;
  width: 156px;
  height: 156px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.74);
  transform-origin: center;
  transition:
    opacity 90ms steps(3, end),
    transform 90ms steps(3, end);
  image-rendering: pixelated;
  filter:
    drop-shadow(0 7px 0 rgba(24, 31, 36, 0.44))
    drop-shadow(0 0 16px rgba(255, 247, 223, 0.32));
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.mobile-joystick.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.mobile-joystick.is-field {
  opacity: 1;
}

.mobile-joystick.is-commit-ready {
  opacity: 1;
  filter:
    drop-shadow(0 5px 0 rgba(24, 31, 36, 0.34))
    drop-shadow(0 0 9px rgba(234, 196, 94, 0.62));
}

.mobile-joystick-pad,
.mobile-joystick-nub,
.mobile-joystick-direction {
  position: absolute;
  display: block;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-joystick-pad {
  inset: 0;
  background-image: url("assets/ui/mobile-controls/joystick-circle-pad-a.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 1;
  transition: opacity 70ms steps(3, end);
  filter:
    brightness(1.34)
    contrast(1.18)
    drop-shadow(0 0 0 rgba(255, 247, 223, 0.9));
}

.mobile-joystick.is-commit-ready .mobile-joystick-pad {
  opacity: 0.5;
}

.mobile-joystick.dir-up .mobile-joystick-pad,
.mobile-joystick.dir-right .mobile-joystick-pad,
.mobile-joystick.dir-down .mobile-joystick-pad,
.mobile-joystick.dir-left .mobile-joystick-pad {
  opacity: 0.5;
}

.mobile-joystick-nub {
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  background-image: url("assets/ui/mobile-controls/joystick-polygon-nub-b.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: translate(calc(-50% + var(--joystick-nub-x)), calc(-50% + var(--joystick-nub-y)));
  transition: transform 55ms linear;
  filter:
    brightness(1.28)
    contrast(1.12)
    drop-shadow(0 3px 0 rgba(24, 31, 36, 0.46));
}

.mobile-joystick-direction {
  display: none;
}

.mobile-joystick.is-visible .mobile-joystick-direction {
  display: none;
}

.mobile-joystick-direction-up {
  top: 22px;
  left: 50%;
}

.mobile-joystick-direction-right {
  top: 50%;
  left: calc(100% - 22px);
}

.mobile-joystick-direction-down {
  top: calc(100% - 22px);
  left: 50%;
}

.mobile-joystick-direction-left {
  top: 50%;
  left: 22px;
}

.mobile-joystick.dir-up .mobile-joystick-direction-up,
.mobile-joystick.dir-right .mobile-joystick-direction-right,
.mobile-joystick.dir-down .mobile-joystick-direction-down,
.mobile-joystick.dir-left .mobile-joystick-direction-left {
  display: none;
}

.game-frame.skin-ui .board {
  border: 4px solid #4d2932;
  border-radius: 6px;
  background-color: #e5a66f;
  background-image:
    linear-gradient(180deg, rgba(255, 213, 154, 0.86), rgba(185, 104, 70, 0.52));
  box-shadow:
    inset 0 0 0 4px rgba(255, 211, 153, 0.64),
    inset 0 -7px 0 rgba(83, 42, 48, 0.22),
    0 0 0 3px #ffd09a,
    0 9px 0 #5a3035,
    0 16px 18px rgba(36, 40, 31, 0.24);
}

.auto-controls {
  position: absolute;
  top: 244px;
  left: 50%;
  z-index: 5;
  width: var(--screen-width);
  margin: 0;
  display: grid;
  grid-template-columns: 92px 92px 92px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 320ms steps(8, end);
}

.game-frame.is-field-ready .auto-controls,
.game-frame.is-playing-field .auto-controls {
  opacity: 1;
  pointer-events: auto;
}

.game-frame.is-playing-field .auto-controls {
  top: calc(50% - 132px);
  left: max(10px, calc(50% - 560px));
  width: 220px;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  transform: none;
}

.game-frame.is-playing-field .auto-stat {
  grid-column: 1 / -1;
}

.help-mode-button.is-active {
  background: #7ac46d;
  color: #183f28;
  box-shadow:
    inset 0 -7px 0 rgba(37, 105, 54, 0.28),
    0 0 0 3px #255f42,
    0 7px 0 rgba(25, 61, 38, 0.45);
}

.tutorial-start-button {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
  z-index: 6;
  min-width: 136px;
  pointer-events: auto;
}

.tutorial-start-button.is-active {
  color: var(--cream);
  background: var(--coral);
}

.game-frame.is-story-dialogue-open .tutorial-start-button {
  display: none;
}

.auto-stat {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 3px solid var(--deep-green);
  border-radius: 6px;
  background: rgba(249, 234, 191, 0.94);
  color: var(--leaf-dark);
  font-size: 13px;
  line-height: 1;
  box-shadow: inset 0 -4px 0 rgba(112, 69, 47, 0.16);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-field-button {
  position: absolute;
  top: 304px;
  left: 50%;
  z-index: 6;
  min-width: 150px;
  min-height: 54px;
  padding: 12px 22px;
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  background: #f9eabf;
  color: var(--ink);
  box-shadow:
    inset 0 -5px 0 rgba(36, 84, 60, 0.18),
    0 6px 0 rgba(33, 36, 24, 0.18);
  cursor: pointer;
  font: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 320ms steps(8, end), transform 120ms steps(3, end);
}

.game-frame.is-field-ready .play-field-button,
.game-frame.is-playing-field .play-field-button {
  opacity: 1;
  pointer-events: auto;
}

.game-frame.is-playing-field .play-field-button {
  top: calc(50% - 132px);
  left: min(calc(50% + 166px), calc(100vw - 58px));
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  transform: none;
}

.play-field-button:active {
  transform: translateX(-50%) translateY(2px);
}

.game-frame.is-playing-field .play-field-button:active {
  transform: translateY(2px);
}

.board:focus-visible {
  outline: 4px solid rgba(113, 199, 216, 0.72);
  outline-offset: 4px;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  padding: 0;
}

.game-frame.skin-ui .cell {
  border-radius: 0;
  background-color: transparent;
  background-image: url("assets/ui/slot-c.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  box-shadow: none;
}

.cell.is-filled {
  background: transparent;
}

.game-frame.skin-ui .cell.is-filled {
  background-image: url("assets/ui/slot-c.png?v=154");
}

.gem-board .cell,
.grow-board .cell {
  cursor: grab;
  touch-action: none;
}

.gem-board .cell:disabled,
.grow-board .cell:disabled {
  cursor: default;
}

.gem-board .cell:active,
.grow-board .cell:active {
  cursor: grabbing;
}

.gem-board .cell.is-selected::after,
.grow-board .cell.is-selected::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 3px solid rgba(255, 247, 223, 0.92);
  box-shadow:
    0 0 0 2px rgba(36, 84, 60, 0.7),
    0 0 9px rgba(234, 196, 94, 0.86);
  content: "";
  pointer-events: none;
}

.grow-board .cell.is-harvestable::after {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(88%, 38px);
  height: min(88%, 38px);
  border: 3px solid rgba(246, 220, 117, 0.95);
  box-shadow:
    0 0 0 2px rgba(36, 84, 60, 0.74),
    0 0 10px rgba(255, 237, 143, 0.82);
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.cell.is-tool-target::after,
.cell.is-tool-selected::after {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(92%, 48px);
  height: min(92%, 48px);
  background-image: url("assets/ui/source/ui-selectors.png?v=154");
  background-repeat: no-repeat;
  background-position: 0 -192px;
  background-size: 400% 2000%;
  content: "";
  image-rendering: pixelated;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.cell.tool-target-water::after {
  background-position: 0 21.0526%;
}

.cell.tool-target-axe::after {
  background-position: 0 42.1053%;
}

.cell.tool-target-hoe::after,
.cell.tool-selected-hoe::after {
  background-position: 66.6667% 21.0526%;
}

.cell.is-tool-selected::after {
  filter:
    drop-shadow(0 0 0 rgba(255, 247, 223, 0.95))
    drop-shadow(0 2px 0 rgba(32, 50, 41, 0.54));
}

.cell.is-tutorial-highlight::before {
  position: absolute;
  inset: 5%;
  z-index: 3;
  border: 3px solid rgba(255, 247, 223, 0.96);
  box-shadow:
    0 0 0 2px rgba(54, 122, 71, 0.72),
    0 0 12px rgba(234, 196, 94, 0.72);
  content: "";
  pointer-events: none;
}

.cell.is-tutorial-space::before {
  position: absolute;
  inset: 15%;
  z-index: 3;
  border: 2px dashed rgba(255, 247, 223, 0.82);
  box-shadow: 0 0 8px rgba(113, 199, 216, 0.45);
  content: "";
  pointer-events: none;
}

.cell.is-hint-static::before,
.cell.is-hint-primary::before {
  position: absolute;
  inset: 4px;
  z-index: 5;
  background:
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) left top / 14px 4px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) left top / 4px 14px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) right top / 14px 4px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) right top / 4px 14px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) left bottom / 14px 4px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) left bottom / 4px 14px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) right bottom / 14px 4px no-repeat,
    linear-gradient(var(--hint-corner-color), var(--hint-corner-color)) right bottom / 4px 14px no-repeat;
  content: "";
  filter: drop-shadow(2px 2px 0 rgba(77, 41, 50, 0.88));
  image-rendering: pixelated;
  pointer-events: none;
}

.cell.is-hint-static::before {
  --hint-corner-color: rgba(255, 247, 223, 0.98);
}

.cell.is-hint-primary::before {
  --hint-corner-color: rgba(86, 216, 82, 0.5);
  animation: hint-pulse 720ms steps(2, end) infinite;
  filter:
    drop-shadow(2px 2px 0 rgba(77, 41, 50, 0.88))
    drop-shadow(0 0 7px rgba(86, 216, 82, 0.42));
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.76;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.gem-tile {
  --gem-col: 0;
  --gem-row: 0;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.gem-tile::before {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 32px;
  height: 32px;
  background-image: url("assets/gems/ores.png?v=154");
  background-repeat: no-repeat;
  background-position: calc(var(--gem-col) * -32px) calc(var(--gem-row) * -32px);
  background-size: 256px 256px;
  content: "";
  filter:
    drop-shadow(0 2px 0 rgba(32, 50, 41, 0.55))
    saturate(1.16)
    contrast(1.08);
  image-rendering: pixelated;
  transform: translateX(-50%);
}

.gem-tile.gem-rock::before {
  bottom: 2px;
  width: 34px;
  height: 34px;
  background-image: url("assets/world/rock-small.png?v=154");
  background-position: center;
  background-size: contain;
}

.gem-tile.is-fresh {
  animation: crop-pop 130ms steps(3, end);
}

.gem-tile.is-sliding {
  z-index: 2;
  animation: crop-slide 150ms steps(6, end);
  will-change: transform;
}

.gem-tile.is-dragging {
  z-index: 8;
  transform: translate(var(--drag-x, 0), var(--drag-y, 0));
  will-change: transform;
}

.gem-tile.is-clearing {
  z-index: 5;
  opacity: 1;
}

.gem-tile.is-clearing::before {
  animation: gem-clear-vanish 430ms steps(4, end) forwards;
}

.gem-tile.is-clearing::after {
  position: absolute;
  left: 50%;
  bottom: 50%;
  z-index: 6;
  width: 72px;
  height: 72px;
  background-image: url("assets/effects/white-cloud-vfx.png?v=154");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 432px 72px;
  content: "";
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 50%);
  animation: merge-cloud-puff 430ms steps(6, end) forwards;
}

.crop-tile {
  --wet-patch: url("assets/bed/wet-wheat.png?v=154");
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.crop-tile.family-wheat {
  --wet-patch: url("assets/bed/wet-wheat.png?v=154");
}

.crop-tile.family-tomato {
  --wet-patch: url("assets/bed/wet-tomato.png?v=154");
}

.crop-tile.family-carrot {
  --wet-patch: url("assets/bed/wet-carrot.png?v=154");
}

.crop-tile.family-rock {
  --wet-patch: none;
}

.crop-tile::before {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background-image: var(--wet-patch);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
  content: "";
  image-rendering: pixelated;
}

.crop-tile.family-rock::before {
  left: 15%;
  bottom: 9%;
  width: 70%;
  height: 56%;
  border-radius: 45% 52% 48% 42%;
  background: rgba(82, 65, 52, 0.3);
}

.crop-tile.is-fresh {
  animation: crop-flash 160ms steps(2, end);
}

.crop-tile.is-sliding {
  z-index: 2;
  animation: crop-slide 150ms steps(6, end);
  will-change: transform;
}

.board.is-mobile-preview .crop-tile {
  opacity: 0.68;
  filter: saturate(0.72) brightness(1.08);
}

.board.is-mobile-preview .cell.is-hint-static::before,
.board.is-mobile-preview .cell.is-hint-primary::before,
.board.is-mobile-preview .cell.is-tutorial-highlight::before,
.board.is-mobile-preview .cell.is-tutorial-space::before {
  opacity: 0.16 !important;
  animation: none;
  filter: drop-shadow(1px 1px 0 rgba(77, 41, 50, 0.2));
}

.board.is-mobile-preview .crop-tile.is-preview-result {
  opacity: 0.86;
  filter:
    saturate(0.86)
    brightness(1.12)
    drop-shadow(0 0 5px rgba(234, 196, 94, 0.38));
}

.board.is-mobile-preview .cell > .merge-stationary-sprite {
  opacity: 0.58;
  filter: saturate(0.72) brightness(1.08);
}

.board.is-mobile-preview .crop-tile.is-merging::after {
  filter: saturate(0.65);
}

.board.is-mobile-preview-resetting .crop-tile {
  animation: preview-reset-pulse 85ms steps(2, end);
}

.crop-tile.is-dragging {
  z-index: 8;
  transform: translate(var(--drag-x, 0), var(--drag-y, 0));
  will-change: transform;
}

.cell > .merge-stationary-sprite {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: merge-before-swap 270ms step-end 150ms forwards;
}

.crop-tile.is-merging {
  z-index: 3;
}

.crop-tile.is-merging::after {
  position: absolute;
  left: 50%;
  bottom: 50%;
  z-index: 5;
  width: 72px;
  height: 72px;
  background-image: url("assets/effects/white-cloud-vfx.png?v=154");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 432px 72px;
  content: "";
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 50%);
  animation: merge-cloud-puff 270ms steps(6, end) 150ms forwards;
}

.crop-tile.is-grow-watered::after {
  position: absolute;
  left: 50%;
  bottom: 50%;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 70%, rgba(151, 226, 255, 0.86) 0 12%, transparent 13%),
    radial-gradient(circle at 36% 46%, rgba(99, 201, 239, 0.76) 0 10%, transparent 11%),
    radial-gradient(circle at 66% 42%, rgba(209, 246, 255, 0.82) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, rgba(75, 174, 220, 0.2) 0 42%, transparent 43%);
  content: "";
  image-rendering: pixelated;
  pointer-events: none;
  transform: translate(-50%, 50%) scale(0.6);
  animation: grow-water-splash 520ms steps(5, end) forwards;
}

.crop-tile.is-merging .merge-before-moving {
  z-index: 2;
  animation: merge-before-swap 270ms step-end 150ms forwards;
}

.crop-tile.is-merging .merge-after-sprite {
  z-index: 3;
  opacity: 0;
  animation: merge-after-swap 270ms step-end 150ms forwards;
}

.crop-sprite {
  position: relative;
  display: block;
  width: min(56px, calc(var(--cell-size, 56px) - 6px));
  height: min(56px, calc(var(--cell-size, 56px) - 6px));
}

.crop-tile .crop-sprite {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.crop-sprite img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 2px 0 rgba(32, 50, 41, 0.55))
    saturate(1.14)
    contrast(1.08);
  image-rendering: pixelated;
}

.crop-sprite.is-missing-sprite {
  display: none;
}

.lab-board .crop-tile .crop-sprite {
  left: -14%;
  bottom: -6%;
  width: 128%;
  height: 128%;
}

.rock-sprite img {
  width: 82%;
  height: 82%;
  margin: 8% auto 0;
}

.player {
  --player-x: 704px;
  --player-y: 1568px;
  --player-frame-x: 0px;
  --player-frame-y: -192px;
  --player-flip: 1;
  --player-sheet: url("assets/player/farmer-composite.png?v=154");
  --player-sheet-size: 1152px 7168px;
  position: absolute;
  left: var(--player-x);
  top: var(--player-y);
  z-index: 6;
  display: block;
  width: 128px;
  height: 128px;
  background-image: var(--player-sheet);
  background-repeat: no-repeat;
  background-position: var(--player-frame-x) var(--player-frame-y);
  background-size: var(--player-sheet-size);
  filter: drop-shadow(0 6px 0 rgba(26, 58, 38, 0.22));
  image-rendering: pixelated;
  pointer-events: none;
  transform: translate(-50%, -100%) scaleX(var(--player-flip));
  transform-origin: center bottom;
  will-change: left, top, background-position;
}

.player.is-moving {
  filter: drop-shadow(0 7px 0 rgba(26, 58, 38, 0.2));
}

.player.is-downed {
  filter: drop-shadow(0 4px 0 rgba(26, 58, 38, 0.16));
}

.pig-companion {
  --pig-x: 646px;
  --pig-y: 1576px;
  --pig-frame-x: 0px;
  --pig-frame-y: 0px;
  --pig-flip: 1;
  position: absolute;
  left: var(--pig-x);
  top: var(--pig-y);
  z-index: 6;
  display: block;
  width: 64px;
  height: 64px;
  background-image: url("assets/animals/pig-01.png?v=154");
  background-repeat: no-repeat;
  background-position: var(--pig-frame-x) var(--pig-frame-y);
  background-size: 576px 960px;
  filter: drop-shadow(0 4px 0 rgba(26, 58, 38, 0.2));
  image-rendering: pixelated;
  pointer-events: none;
  transform: translate(-50%, -100%) scaleX(var(--pig-flip));
  transform-origin: center bottom;
  will-change: left, top, background-position;
}

.pig-companion.is-moving {
  filter: drop-shadow(0 5px 0 rgba(26, 58, 38, 0.18));
}

.pig-companion.is-faded {
  opacity: 0.42;
}

.crop-tile.is-harvest-ready .crop-sprite img {
  filter:
    drop-shadow(0 2px 0 rgba(32, 50, 41, 0.55))
    drop-shadow(0 0 6px rgba(234, 196, 94, 0.82))
    saturate(1.18)
    contrast(1.1);
}

.crop-tile.is-manured::before {
  filter:
    sepia(0.22)
    saturate(1.28)
    brightness(0.92);
}

.crop-tile.is-manured .crop-sprite img {
  filter:
    drop-shadow(0 2px 0 rgba(32, 50, 41, 0.55))
    drop-shadow(0 0 5px rgba(180, 128, 55, 0.78))
    saturate(1.18)
    contrast(1.08);
}

.small-action:active,
.farm-button:active,
.segment:active {
  transform: translateY(2px);
}

.side-panel {
  position: absolute;
  left: 50%;
  bottom: 4.8%;
  z-index: 5;
  width: min(930px, 100%);
  margin: 0;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  pointer-events: auto;
  transform: translateX(-50%);
}

.game-frame.is-playing-field .side-panel {
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 1fr;
}

.game-frame.is-playing-field .side-panel > :not(.tool-panel) {
  display: none;
}

.game-frame.is-playing-field .tool-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.game-frame.is-playing-field .tool-panel .panel-heading {
  display: none;
}

.queue-panel,
.farm-panel,
.tool-panel,
.growth-panel {
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  padding: 12px;
  background: rgba(255, 247, 223, 0.9);
  box-shadow: inset 0 -5px 0 rgba(112, 69, 47, 0.12);
}

.game-frame.skin-ui .stat,
.game-frame.skin-ui .queue-panel,
.game-frame.skin-ui .farm-panel,
.game-frame.skin-ui .tool-panel,
.game-frame.skin-ui .growth-panel,
.game-frame.skin-ui .status-line {
  border-color: #4d2932;
  background: rgba(231, 169, 111, 0.94);
  box-shadow:
    inset 0 0 0 3px rgba(255, 212, 151, 0.56),
    inset 0 -5px 0 rgba(83, 42, 48, 0.18),
    0 4px 0 rgba(72, 39, 38, 0.24);
}

.game-frame.skin-ui .queue-slot,
.game-frame.skin-ui .growth-step {
  border-color: #6b3740;
  background: rgba(255, 205, 138, 0.76);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.panel-heading span {
  color: var(--leaf-dark);
  font-size: 13px;
  white-space: nowrap;
}

.queue {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.queue-slot {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 3px solid var(--cream-dark);
  border-radius: 7px;
  background: #fffdf1;
}

.queue-slot span:last-child {
  max-width: 100%;
  font-size: 11px;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-align: center;
}

.pasture {
  position: relative;
  min-height: 112px;
  border: 3px solid var(--leaf-dark);
  border-radius: 7px;
  overflow: hidden;
  background-color: var(--leaf);
  background-image:
    linear-gradient(rgba(255, 247, 223, 0.18), rgba(36, 84, 60, 0.08)),
    url("../../Cute Fantasy Sprites/Cute_Fantasy/Tiles/Grass/Grass_1_Middle.png?v=154");
  background-size: auto, 48px 48px;
}

.animal {
  position: absolute;
  width: 64px;
  height: 64px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.animal-chicken {
  left: 24px;
  bottom: 12px;
  background-image: url("../../Cute Fantasy Sprites/Cute_Fantasy/Animals/Chicken/Chicken_01.png?v=154");
  background-size: 512px 1024px;
}

.animal-cow {
  right: 22px;
  bottom: 12px;
  background-image: url("../../Cute Fantasy Sprites/Cute_Fantasy/Animals/Cow/Cow_01.png?v=154");
  background-size: 512px 960px;
}

.hay-bale {
  display: inline-block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  background-image: url("../../Cute Fantasy Sprites/Cute_Fantasy/Outdoor decoration/Hay_Bales.png?v=154");
  background-repeat: no-repeat;
  background-size: 96px 32px;
  vertical-align: middle;
}

.hay-bale.big {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

.meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.meter span {
  height: 12px;
  border: 2px solid var(--deep-green);
  border-radius: 5px;
  background: #e4d6a2;
}

.meter span.is-on {
  background: var(--gold);
}

.farm-actions {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.farm-button {
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  background: #f9eabf;
  box-shadow: inset 0 -4px 0 rgba(36, 84, 60, 0.16);
}

.farm-button:disabled,
.tool-button:disabled,
.small-action:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.65;
}

.tool-belt {
  width: min(100%, 326px);
  aspect-ratio: 492 / 168;
  margin: 0 auto;
  padding: clamp(6px, 2.4%, 8px) clamp(7px, 2.4%, 9px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  background-image: url("assets/ui/bar.png?v=154");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  image-rendering: pixelated;
}

.tool-button {
  position: relative;
  min-width: 0;
  grid-row: 1;
  width: min(82%, 48px);
  aspect-ratio: 1;
  min-height: 0;
  justify-self: center;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--leaf-dark);
  box-shadow: none;
}

.tool-button.is-active {
  background: rgba(255, 223, 138, 0.22);
  box-shadow: inset 0 0 0 2px rgba(255, 247, 223, 0.7);
}

.tool-icon {
  width: min(118%, 56px);
  aspect-ratio: 1;
  background-image: url("assets/ui/tool-icons.png?v=154");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 1000% 100%;
  filter: drop-shadow(0 2px 0 rgba(32, 50, 41, 0.42));
  font-size: 0;
  image-rendering: pixelated;
  line-height: 0;
  transform: translateY(-1px);
}

.tool-button[data-tool="water"] .tool-icon {
  background-position: 66.6667% 0;
}

.tool-button[data-tool="hoe"] .tool-icon {
  background-position: 0 0;
}

.tool-button[data-tool="axe"] .tool-icon {
  background-position: 55.5556% 0;
}

.tool-count {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 18px;
  padding: 2px 4px;
  border: 2px solid #4d2932;
  border-radius: 3px;
  background: #fff7df;
  color: #203229;
  font-size: 10px;
  line-height: 0.9;
  text-align: center;
  box-shadow: 0 2px 0 rgba(32, 50, 41, 0.22);
}

.growth-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.growth-step {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 2px solid var(--cream-dark);
  border-radius: 6px;
  background: #fffdf1;
}

.status-line {
  position: absolute;
  left: 50%;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 170px);
  z-index: 5;
  width: var(--screen-width);
  min-height: 24px;
  margin: 0;
  padding: 8px 10px;
  border: 3px solid var(--deep-green);
  border-radius: 7px;
  background: rgba(255, 253, 241, 0.92);
  color: var(--leaf-dark);
  font-size: 15px;
  line-height: 1.2;
  transform: translateX(-50%);
}

.game-frame.is-story-dialogue-open .status-line {
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--story-panel-height, 170px) + 6px);
  z-index: 19;
  width: var(--screen-width);
  padding: 8px 14px;
  border-color: var(--deep-green);
  background: rgba(255, 253, 241, 0.96);
  box-shadow:
    inset 0 0 0 2px rgba(234, 196, 94, 0.18),
    0 4px 0 rgba(32, 50, 41, 0.2);
}

.status-line.is-tutorial {
  border-color: #4d2932;
  background: rgba(255, 247, 223, 0.96);
  color: #24543c;
  box-shadow:
    inset 0 0 0 3px rgba(234, 196, 94, 0.28),
    0 5px 0 rgba(32, 50, 41, 0.22);
}

.story-panel {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 18;
  width: var(--screen-width);
  padding: 16px 14px 14px;
  border: 4px solid var(--deep-green);
  border-radius: 7px;
  background: rgba(255, 253, 241, 0.98);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 3px rgba(234, 196, 94, 0.18),
    0 7px 0 rgba(32, 50, 41, 0.28);
  pointer-events: auto;
  transform: translateX(-50%);
}

.game-frame.is-story-dialogue-open .story-panel {
  bottom: max(14px, env(safe-area-inset-bottom));
}

.story-panel.is-hidden {
  display: none;
}

.story-speaker {
  margin: 0 0 8px;
  color: var(--leaf);
  font-size: 15px;
  line-height: 1;
}

.story-text {
  margin: 0;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.story-choice {
  min-width: 124px;
  padding: 12px 16px;
  border: 3px solid var(--deep-green);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(32, 50, 41, 0.28);
  cursor: pointer;
  font-size: 13px;
}

.story-choice.is-primary {
  background: var(--sky);
}

.story-choice:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(32, 50, 41, 0.28);
}

@keyframes crop-pop {
  0% {
    transform: scale(0.78);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes crop-flash {
  0% {
    filter: brightness(1.28);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes crop-slide {
  0% {
    transform: translate(var(--slide-x, 0), var(--slide-y, 0));
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes preview-reset-pulse {
  0% {
    opacity: 0.72;
    transform: scale(0.97);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes merge-before-swap {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes merge-after-swap {
  0%,
  49% {
    opacity: 0;
  }
  50%,
  100% {
    opacity: 1;
  }
}

@keyframes merge-cloud-puff {
  0% {
    background-position: 0 0;
    opacity: 1;
  }
  99% {
    background-position: -432px 0;
    opacity: 1;
  }
  100% {
    background-position: -432px 0;
    opacity: 0;
  }
}

@keyframes grow-water-splash {
  0% {
    opacity: 0;
    transform: translate(-50%, 50%) scale(0.48);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 50%) scale(0.88);
  }
  64% {
    opacity: 0.88;
    transform: translate(-50%, 50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 50%) scale(1.16);
  }
}

@keyframes gem-clear-vanish {
  0%,
  38% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  58%,
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(0.76);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crop-tile.is-sliding,
  .crop-tile.is-dragging,
  .crop-tile.is-grow-watered::after,
  .crop-tile.is-merging,
  .crop-tile.is-merging::after,
  .crop-tile.is-merging .merge-before-moving,
  .crop-tile.is-merging .merge-after-sprite,
  .gem-tile.is-fresh,
  .gem-tile.is-sliding,
  .gem-tile.is-clearing,
  .gem-tile.is-clearing::after,
  .board.is-mobile-preview-resetting .crop-tile,
  .cell > .merge-stationary-sprite {
    animation: none;
  }

  .mobile-joystick,
  .mobile-joystick-nub,
  .mobile-joystick-direction {
    transition: none;
  }

  .cell > .merge-stationary-sprite,
  .crop-tile.is-merging .merge-before-moving,
  .crop-tile.is-merging::after,
  .crop-tile.is-grow-watered::after,
  .gem-tile.is-clearing::after {
    display: none;
  }

  .crop-tile.is-merging .merge-after-sprite {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .segment {
    min-width: 84px;
  }

  .lab-results-row {
    grid-template-columns: 1fr;
    width: min(100%, calc(100vw - 64px));
  }

  .lab-stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

}

@media (max-width: 640px) {
  h1 {
    font-size: 26px;
  }

  .game-frame.is-field-ready .title-block,
  .game-frame.is-playing-field .title-block {
    display: none;
  }

  .game-frame.is-field-ready .top-bar,
  .game-frame.is-playing-field .top-bar {
    top: max(10px, env(safe-area-inset-top));
    width: var(--screen-width);
  }

  .game-frame.is-playing-field .top-bar {
    left: 12px;
    width: min(360px, calc(100vw - 82px));
    transform: none;
  }

  .stats {
    gap: 6px;
  }

  .stat {
    padding: 7px 6px;
  }

  .stat dd {
    font-size: 15px;
  }

  .field-topline {
    top: max(72px, calc(env(safe-area-inset-top) + 72px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .game-frame.is-playing-field .field-topline {
    display: none;
  }

  .field-toggles {
    flex-wrap: nowrap;
  }

  .segmented,
  .small-action {
    min-width: 0;
  }

  .small-action {
    min-height: 40px;
    padding: 7px 8px;
    font-size: 15px;
  }

  .segment {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .auto-controls {
    top: max(120px, calc(env(safe-area-inset-top) + 120px));
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr);
    gap: 6px;
  }

  .game-frame.is-playing-field .auto-controls {
    display: none;
  }

  .game-frame.is-playing-field .tutorial-start-button {
    display: none;
  }

  .auto-stat {
    padding: 7px 8px;
    font-size: 12px;
  }

  .tutorial-start-button,
  .play-field-button {
    top: max(168px, calc(env(safe-area-inset-top) + 168px));
    min-width: 0;
    min-height: 44px;
    padding: 9px 10px;
  }

  .tutorial-start-button {
    left: 12px;
    right: auto;
    width: calc(50vw - 16px);
    max-width: 211px;
  }

  .play-field-button {
    right: 12px;
    left: auto;
    width: calc(50vw - 16px);
    max-width: 211px;
    transform: none;
  }

  .game-frame.is-playing-field .play-field-button {
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    left: auto;
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    transform: none;
  }

  .play-field-button:active {
    transform: translateY(2px);
  }

  .status-line {
    bottom: calc(max(126px, env(safe-area-inset-bottom) + 126px));
  }

  .game-frame.is-playing-field .status-line {
    top: max(70px, calc(env(safe-area-inset-top) + 70px));
    bottom: auto;
    z-index: 7;
  }

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

  .game-frame.is-playing-field .side-panel {
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(340px, calc(100vw - 24px));
  }

}
