:root {
  color-scheme: light;
  --ink: #1e2b2e;
  --muted: #657374;
  --paper: #fff8df;
  --paper-strong: #fffdf0;
  --panel: rgba(255, 248, 222, 0.9);
  --panel-strong: rgba(255, 252, 238, 0.98);
  --line: rgba(73, 69, 44, 0.16);
  --line-strong: rgba(96, 73, 34, 0.28);
  --teal: #1faaa0;
  --teal-dark: #116865;
  --grass: #6ebf4f;
  --leaf: #358f45;
  --soil: #6e422c;
  --gold: #f4ba37;
  --sun: #f6d96e;
  --coral: #e85d4a;
  --rose: #ca3e63;
  --blue: #3f86c8;
  --shadow: 0 24px 70px rgba(35, 54, 38, 0.23);
  --soft-shadow: 0 12px 28px rgba(38, 58, 40, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 228, 119, 0.58), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(62, 170, 202, 0.34), transparent 29%),
    linear-gradient(145deg, #8fd3df 0%, #d6e984 48%, #f1bf65 100%);
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 14px;
}

.auth-screen {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 28px));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 430px);
  gap: 16px;
  align-items: stretch;
}

.auth-art,
.auth-card,
.game-frame {
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-art {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(105, 205, 224, 0.92) 0 38%, rgba(167, 223, 98, 0.98) 39% 100%);
}

.auth-art::before {
  content: "";
  position: absolute;
  inset: 40% -10% auto -8%;
  height: 42%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(135deg, #98d46c, #57a944 62%, #438b39);
  box-shadow: inset 0 28px 60px rgba(255, 255, 255, 0.26);
}

.auth-art::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 8%;
  bottom: 10%;
  height: 15%;
  border-radius: 50%;
  background: rgba(31, 60, 43, 0.17);
  filter: blur(14px);
}

.mini-map {
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(620px, 82%);
  aspect-ratio: 1.58;
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-38deg);
  transform-style: preserve-3d;
}

.mini-map span {
  position: absolute;
  transform-style: preserve-3d;
}

.mini-field {
  inset: 18% 8% 12% 8%;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255, 221, 150, 0.72) 2px, transparent 2px) 0 0 / 12% 100%,
    linear-gradient(0deg, rgba(255, 221, 150, 0.72) 2px, transparent 2px) 0 0 / 100% 16%,
    linear-gradient(145deg, #9c6742, #593622);
  box-shadow:
    18px 18px 0 #4d3021,
    32px 32px 34px rgba(22, 44, 38, 0.28),
    inset 0 0 0 3px rgba(255, 232, 184, 0.32);
}

.mini-barn {
  left: 3%;
  top: 2%;
  width: 24%;
  height: 31%;
  border-radius: 8px;
  background: linear-gradient(135deg, #f6e0aa, #cc633a);
  box-shadow: 12px 12px 0 #8d4932, 18px 18px 28px rgba(36, 50, 42, 0.2);
}

.mini-barn::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: -35%;
  height: 46%;
  background: linear-gradient(135deg, #263a42, #11191f);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.mini-tree {
  width: 8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #d9f994, #3b944b 70%);
  box-shadow: 7px 7px 0 #7d5838, 14px 14px 18px rgba(27, 52, 39, 0.2);
}

.mini-tree.one {
  right: 8%;
  top: 4%;
}

.mini-tree.two {
  right: 18%;
  bottom: 5%;
}

.mini-pond {
  right: 1%;
  bottom: 1%;
  width: 25%;
  height: 15%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d5fbff, #35b6ce 68%, #1c7895);
  box-shadow: 8px 8px 0 rgba(16, 85, 100, 0.22);
}

.mini-cart {
  left: 42%;
  top: 2%;
  width: 13%;
  height: 11%;
  border-radius: 5px;
  background: linear-gradient(135deg, #fbfbf1, #b9cdd2);
  box-shadow: 7px 8px 0 rgba(49, 65, 62, 0.2);
}

.auth-card {
  display: grid;
  align-content: center;
  gap: 20px;
  padding: clamp(22px, 4vw, 34px);
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 254, 244, 0.98), rgba(248, 240, 211, 0.91));
}

.auth-brand,
.brand,
.profile-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  color: #fff9dc;
  font-weight: 950;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(135deg, #15766d 0 48%, #dc5e45 49% 100%);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 12px 24px rgba(25, 92, 84, 0.24), inset 0 -5px 0 rgba(0, 0, 0, 0.16);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 242, 0.75);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.auth-tab.active {
  color: #fffdf0;
  background: linear-gradient(180deg, #2fc5b5, #16877f);
  box-shadow: 0 10px 22px rgba(22, 135, 127, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  font-weight: 850;
}

.field span,
.eyebrow,
.muted {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 830;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(43, 71, 68, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 244, 0.94);
  color: var(--ink);
  font-weight: 800;
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.field input:focus {
  border-color: rgba(32, 166, 154, 0.72);
  box-shadow: 0 0 0 4px rgba(32, 166, 154, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.auth-status {
  min-height: 22px;
  color: #9b3b2f;
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-status.success {
  color: #13786f;
}

.primary-action {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #2f2418;
  cursor: pointer;
  font-weight: 950;
  background: linear-gradient(180deg, #ffd36b, #ee9136);
  box-shadow: 0 14px 30px rgba(195, 111, 33, 0.25), inset 0 -4px 0 rgba(97, 55, 15, 0.16);
}

.game-frame {
  width: min(1760px, 100%);
  min-height: min(980px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(239, 248, 222, 0.58);
}

.game-tabs {
  min-height: 38px;
  display: flex;
  align-items: stretch;
  padding: 0 8px;
  border-bottom: 1px solid rgba(97, 72, 34, 0.2);
  background: linear-gradient(180deg, #f8dfa2, #d9a956);
  box-shadow: inset 0 -2px 0 rgba(100, 68, 25, 0.14);
}

.tab-button {
  min-width: 88px;
  border: 0;
  border-left: 1px solid rgba(103, 70, 31, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #4f341b;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 8px 12px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
}

.tab-button.active,
.tab-button:hover {
  background: rgba(255, 249, 224, 0.52);
}

.hud,
.tooldock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255, 253, 236, 0.95), rgba(247, 239, 207, 0.78));
  border-color: rgba(43, 71, 68, 0.1);
}

.hud {
  border-bottom: 1px solid rgba(43, 71, 68, 0.1);
}

.tooldock {
  border-top: 1px solid rgba(43, 71, 68, 0.12);
}

.brand {
  min-width: 240px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.18rem, 2.2vw, 1.72rem);
  line-height: 1.05;
}

h2 {
  font-size: 0.92rem;
  line-height: 1.2;
}

.resource-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.stat,
.pill,
.level-chip,
.energy-stat {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(73, 69, 44, 0.15);
  border-radius: 8px;
  background: rgba(255, 253, 241, 0.84);
  padding: 6px 10px;
  font-weight: 870;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 18px rgba(33, 52, 44, 0.08);
}

.level-chip {
  min-width: 178px;
  padding-left: 7px;
}

.level-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff9dd;
  background: radial-gradient(circle at 35% 28%, #fff6a6 0 20%, #f0a627 52%, #a85517 100%);
  box-shadow: 0 3px 0 #77401a, inset 0 -5px 0 rgba(117, 56, 13, 0.28);
  font-size: 1.05rem;
}

.level-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.xp-track,
.energy-track {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(44, 76, 63, 0.14);
}

.xp-track {
  width: 104px;
  height: 9px;
}

.xp-track span,
.energy-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1faaa0, #7acb52, #f3b634);
}

.energy-stat {
  min-width: 250px;
  padding-right: 5px;
}

.energy-track {
  width: 92px;
  height: 15px;
}

.energy-track span {
  background: linear-gradient(90deg, #27c2e5, #3ca4db, #5c7fd0);
}

.bolt {
  position: relative;
  width: 18px;
  height: 26px;
  filter: drop-shadow(0 2px 2px rgba(120, 72, 13, 0.22));
}

.bolt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffe987, #f0a927);
  clip-path: polygon(54% 0, 15% 55%, 45% 55%, 28% 100%, 88% 38%, 57% 38%, 76% 0);
}

.add-energy,
.mini-command,
.tiny-button,
.icon-button,
.top-icon,
.tool,
.rail-button {
  border: 1px solid rgba(59, 75, 54, 0.14);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 890;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 18px rgba(39, 61, 54, 0.1);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.add-energy,
.mini-command,
.tiny-button {
  color: #fffdf0;
  background: linear-gradient(180deg, #32bdb0, #15867c);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 7px 12px rgba(22, 116, 105, 0.16);
}

.add-energy {
  min-height: 31px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.top-icon {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 34px;
  background: rgba(255, 253, 242, 0.86);
}

.top-icon::before,
.top-icon::after,
.stat-icon,
.rail-icon,
.tool-icon {
  content: "";
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.mail-icon::before {
  position: absolute;
  inset: 8px 7px;
  border: 2px solid #8b6b3d;
  border-radius: 2px;
}

.mail-icon::after {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 10px;
  height: 12px;
  border-left: 2px solid #8b6b3d;
  border-bottom: 2px solid #8b6b3d;
  transform: rotate(-45deg);
}

.cog-icon::before {
  position: absolute;
  inset: 9px;
  border: 4px solid #75806a;
  border-radius: 50%;
}

.cog-icon::after {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 15px;
  height: 4px;
  background: #75806a;
  box-shadow: 0 -7px 0 #75806a, 0 7px 0 #75806a;
}

.exit-icon::before {
  position: absolute;
  left: 9px;
  top: 8px;
  width: 17px;
  height: 17px;
  border: 3px solid #b24b3b;
  border-left-color: transparent;
  border-radius: 50%;
}

.exit-icon::after,
.close-icon::before,
.close-icon::after {
  position: absolute;
  background: #b24b3b;
  border-radius: 99px;
}

.exit-icon::after {
  right: 8px;
  top: 15px;
  width: 14px;
  height: 3px;
}

.close-icon::before,
.close-icon::after {
  left: 10px;
  top: 16px;
  width: 17px;
  height: 3px;
}

.close-icon::before {
  transform: rotate(45deg);
}

.close-icon::after {
  transform: rotate(-45deg);
}

.stat-icon {
  width: 22px;
  height: 22px;
}

.coin-icon {
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff7bd 0 20%, #f5bb37 52%, #a96b12 100%);
  box-shadow: inset -4px -5px 0 rgba(134, 87, 14, 0.22), 0 2px 5px rgba(120, 73, 6, 0.22);
}

.gem-icon {
  background: linear-gradient(135deg, #ffd1df, #d13270 60%, #7f1840);
  clip-path: polygon(50% 0, 90% 25%, 74% 100%, 26% 100%, 10% 25%);
  box-shadow: 0 3px 6px rgba(118, 25, 61, 0.2);
}

.water-icon-small {
  border-radius: 55% 55% 60% 60%;
  background: linear-gradient(150deg, #e8fbff 8%, #58cde2 54%, #2b96b1 100%);
  transform: rotate(45deg);
  box-shadow: inset -4px -3px 0 rgba(24, 119, 146, 0.18), 0 2px 7px rgba(40, 152, 178, 0.18);
}

.play-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 82px minmax(242px, 292px) minmax(520px, 1fr) minmax(270px, 318px) 84px;
  gap: 10px;
  padding: 10px;
}

.rail {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.rail-button {
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 7px 5px;
  background: linear-gradient(180deg, #fff8df, #e8cf91);
  color: #4f361f;
  font-size: 0.72rem;
  text-align: center;
}

.rail-button strong {
  min-width: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d94450;
  color: #fffdf0;
  font-size: 0.78rem;
}

.rail-button.active,
.rail-button:hover,
.tool.active,
.icon-button:hover,
.mini-command:hover,
.tiny-button:hover,
.seed-row:hover,
.shop-row:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 153, 145, 0.58);
}

.rail-button.compact {
  min-height: 70px;
}

.shop-cta {
  min-height: 100px;
  background: linear-gradient(180deg, #ffe27f, #ee9a34);
  font-size: 0.92rem;
}

.rail-icon,
.tool-icon {
  width: 28px;
  height: 28px;
}

.goals-icon::before {
  content: "";
  position: absolute;
}

.goals-icon,
.market-icon,
.buddies-icon,
.tools-icon,
.animal-icon,
.basket-icon,
.gift-icon,
.stall-icon {
  position: relative;
}

.goals-icon::before {
  inset: 4px 5px;
  border: 3px solid #8b6b3d;
  border-radius: 4px;
  background: #fff6d2;
}

.goals-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 11px;
  height: 6px;
  border-left: 3px solid #34a05f;
  border-bottom: 3px solid #34a05f;
  transform: rotate(-45deg);
}

.market-icon::before,
.stall-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 15px;
  border-radius: 3px;
  background: #f6dc9a;
  border: 2px solid #8b6236;
}

.market-icon::after,
.stall-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 3px;
  height: 12px;
  border-radius: 8px 8px 2px 2px;
  background: repeating-linear-gradient(90deg, #df4b4b 0 9px, #fff5d9 9px 18px);
  border: 2px solid #8b6236;
}

.buddies-icon::before,
.buddies-icon::after,
.animal-icon::before,
.animal-icon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #f2c08b;
  border: 2px solid #8a5237;
}

.buddies-icon::before {
  left: 4px;
  top: 5px;
  width: 13px;
  height: 13px;
}

.buddies-icon::after {
  right: 4px;
  top: 8px;
  width: 13px;
  height: 13px;
}

.animal-icon::before {
  left: 3px;
  top: 9px;
  width: 21px;
  height: 15px;
  background: #fff9e8;
}

.animal-icon::after {
  left: 13px;
  top: 5px;
  width: 9px;
  height: 9px;
  background: #3d2a24;
  border: 0;
}

.tools-icon::before,
.tools-icon::after {
  content: "";
  position: absolute;
  border-radius: 3px;
  background: #6a777b;
}

.tools-icon::before {
  left: 13px;
  top: 2px;
  width: 5px;
  height: 24px;
  transform: rotate(35deg);
}

.tools-icon::after {
  left: 5px;
  top: 7px;
  width: 18px;
  height: 6px;
  transform: rotate(-30deg);
}

.basket-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 17px;
  border-radius: 4px 4px 7px 7px;
  background: linear-gradient(90deg, #b46b32, #e0a552);
  border: 2px solid #7c4b2c;
}

.basket-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 5px;
  height: 14px;
  border: 3px solid #7c4b2c;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.gift-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0c333 0 39%, #2f92d1 40% 60%, #f0c333 61% 100%);
  border: 2px solid #9d681c;
}

.gift-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 3px solid #2f92d1;
  border-radius: 50%;
}

.panel-stack {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.profile-panel {
  padding: 11px;
}

.panel-heading {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(45, 70, 65, 0.1);
}

.compact-list {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.scroll-list {
  max-height: 236px;
  overflow: auto;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 660px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 12px;
  background: #86c755;
  box-shadow: inset 0 0 0 1px rgba(22, 77, 69, 0.08), 0 18px 48px rgba(24, 74, 61, 0.14);
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), transparent 22%),
    radial-gradient(circle at 50% 64%, transparent 0 48%, rgba(28, 54, 42, 0.16) 100%);
}

#farmCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 660px;
  cursor: pointer;
}

.action-hint,
.toast,
.tile-pop {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(41, 66, 61, 0.13);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.93);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(31, 48, 39, 0.18);
  font-weight: 850;
  backdrop-filter: blur(16px);
}

.action-hint {
  left: 12px;
  top: 12px;
  max-width: min(360px, calc(100% - 24px));
  padding: 9px 12px;
  font-size: 0.84rem;
}

.toast {
  left: 50%;
  bottom: 16px;
  max-width: min(460px, calc(100% - 32px));
  padding: 10px 14px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tile-pop {
  min-width: 190px;
  padding: 10px;
  font-size: 0.84rem;
}

.tile-pop strong,
.tile-pop span {
  display: block;
}

.row,
.seed-row,
.shop-row,
.goal-row,
.order-row,
.inventory-row,
.animal-row,
.buddy-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 50px;
  padding: 8px;
  border: 1px solid rgba(42, 69, 66, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 242, 0.73);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.seed-row,
.shop-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.seed-row.active,
.shop-row.active {
  outline: 2px solid rgba(32, 166, 154, 0.24);
  border-color: rgba(32, 166, 154, 0.52);
  background: linear-gradient(180deg, rgba(239, 255, 249, 0.94), rgba(255, 253, 242, 0.78));
}

.seed-row:disabled,
.shop-row:disabled,
.tiny-button:disabled,
.mini-command:disabled {
  cursor: not-allowed;
  filter: saturate(0.68);
  opacity: 0.7;
  transform: none;
}

.swatch,
.product-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.15), 0 4px 10px rgba(35, 50, 40, 0.14);
}

.product-dot.square {
  border-radius: 8px;
}

.row-main {
  min-width: 0;
}

.row-main strong,
.row-main span {
  display: block;
}

.row-main strong {
  overflow-wrap: anywhere;
  line-height: 1.14;
}

.row-main span,
.row-note {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 770;
}

.row-note {
  text-align: right;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(36, 82, 68, 0.12);
  margin-top: 5px;
}

.progress-line span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1faaa0, #80bc4b, #f4ba37);
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool,
.icon-button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 253, 242, 0.84);
  padding: 8px 11px;
}

.tool {
  min-width: 92px;
}

.tool.active {
  background: linear-gradient(180deg, #e5fff7, #d2f6ec);
}

.icon-button.subtle,
.subtle {
  background: rgba(246, 241, 224, 0.86);
}

.danger {
  background: #ffe4dc;
  color: #8d2d22;
}

.tool-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30, 38, 38, 0.42);
  backdrop-filter: blur(10px);
}

.dialog {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 16px;
  box-shadow: var(--shadow);
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dialog-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.dialog p {
  margin-top: 8px;
  color: var(--muted);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}


.sign-editor {
  display: grid;
  gap: 8px;
}

.sign-editor span {
  font-weight: 900;
  color: var(--ink);
}

.sign-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(131, 94, 48, 0.42);
  border-radius: 7px;
  background: rgba(255, 253, 242, 0.92);
  padding: 9px 11px;
  color: var(--ink);
  font: 900 1rem Arial, sans-serif;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.62);
}

.sign-input:focus {
  border-color: rgba(29, 143, 129, 0.72);
  box-shadow: 0 0 0 3px rgba(39, 167, 150, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.62);
}

@media (max-width: 1460px) {
  .play-layout {
    grid-template-columns: 76px minmax(220px, 272px) minmax(480px, 1fr) minmax(248px, 298px);
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 1120px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-art {
    min-height: 330px;
  }

  .game-frame {
    min-height: auto;
  }

  .game-tabs {
    overflow-x: auto;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .left-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rail-button {
    min-height: 58px;
    grid-template-columns: auto 1fr auto;
    text-align: left;
    padding: 8px 10px;
  }

  .left-panels,
  .right-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage,
  #farmCanvas {
    min-height: 590px;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 0;
  }

  .auth-screen {
    min-height: 100vh;
    gap: 0;
  }

  .auth-art {
    min-height: 230px;
    border-radius: 0;
  }

  .auth-card {
    order: -1;
    min-height: calc(100vh - 230px);
    border-radius: 0;
  }

  .game-frame {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .hud,
  .tooldock {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .resource-strip,
  .tools {
    justify-content: stretch;
  }

  .stat,
  .level-chip,
  .energy-stat,
  .tool,
  .icon-button {
    flex: 1 1 136px;
  }

  .left-rail,
  .left-panels,
  .right-panels {
    grid-template-columns: 1fr;
  }

  .play-layout {
    padding: 8px;
  }

  .stage,
  #farmCanvas {
    min-height: 500px;
  }
}
