:root {
  color-scheme: light;
  --ink: #18201b;
  --muted: #647067;
  --line: #d7ddd4;
  --paper: #fbfcf7;
  --panel: #ffffff;
  --field: #eef5df;
  --green: #2f7d45;
  --green-dark: #1f5e32;
  --gold: #b8791a;
  --red: #b63d2f;
  --blue: #3469a6;
  --shadow: 0 18px 42px rgba(32, 48, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(238, 245, 223, 0.88), rgba(246, 241, 224, 0.72)),
    repeating-linear-gradient(90deg, rgba(47, 125, 69, 0.12) 0 2px, transparent 2px 68px),
    var(--paper);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

.rotate-prompt,
.mobile-hud {
  display: none;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.progress-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.progress-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.topbar h1,
.panel h2,
.panel h3,
.start-screen h2,
.final-screen h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.82fr) minmax(420px, 1.62fr) minmax(250px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.stats-list {
  margin: 14px 0 0;
}

.stats-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stats-list dt {
  color: var(--muted);
  font-size: 14px;
}

.stats-list dd {
  margin: 0;
  font-weight: 800;
}

.compact div {
  grid-template-columns: minmax(100px, 1fr) auto;
}

.compact .rule-note {
  grid-template-columns: 1fr;
  gap: 4px;
}

.compact .rule-note dd {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.title-count {
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(62, 95, 49, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.abilities-box,
.log-box,
.actions-box,
.event-box,
.rule-box {
  margin-top: 18px;
}

.rule-box {
  padding: 12px;
  border: 1px solid rgba(47, 125, 69, 0.18);
  border-radius: 8px;
  background: rgba(238, 245, 223, 0.38);
}

.rule-box h3,
.rule-box summary {
  color: var(--green-dark);
}

.rule-box summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.rule-box .stats-list {
  margin-top: 8px;
}

.abilities-box ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.abilities-box li {
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--field);
  color: var(--green-dark);
  font-weight: 700;
}

.abilities-box h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.abilities-box h3 span {
  color: var(--muted);
  font-size: 12px;
}

.abilities-box li strong,
.abilities-box li small {
  display: block;
}

.abilities-box li small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.abilities-box li.locked {
  background: rgba(238, 245, 223, 0.55);
  color: var(--muted);
}

.ability-notice {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 5;
  min-width: 210px;
  padding: 10px 14px;
  border: 3px solid rgba(184, 121, 26, 0.55);
  border-radius: 8px;
  background: rgba(255, 249, 220, 0.96);
  color: var(--green-dark);
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 22px rgba(49, 71, 55, 0.18);
  animation: abilityBloom 1.15s cubic-bezier(.2, 1.35, .24, 1) both;
}

.ability-notice span,
.ability-notice strong,
.ability-notice small {
  display: block;
}

.ability-notice span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.ability-notice strong {
  margin-top: 3px;
  font-size: 20px;
}

.ability-notice small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
}

.start-screen,
.final-screen {
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.screen-start .topbar,
.screen-start .status-panel,
.screen-start .data-panel {
  display: none;
}

.screen-start .game-grid {
  grid-template-columns: 1fr;
}

.screen-start .main-panel {
  padding: 0;
  overflow: hidden;
}

.title-screen {
  min-height: min(760px, calc(100vh - 44px));
  justify-content: stretch;
  gap: 0;
}

.title-hero {
  position: relative;
  min-height: inherit;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  align-items: stretch;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(252, 250, 233, 0.3), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, #f4f9e9 0%, #e9f5cf 42%, #f9e7ad 100%);
}

.title-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(28px, 6vw, 76px);
}

.title-copy .eyebrow {
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(47, 125, 69, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.title-screen h2 {
  max-width: 8em;
  color: #183a25;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  text-shadow: 0 5px 0 rgba(226, 186, 69, 0.35), 0 18px 34px rgba(34, 57, 35, 0.14);
}

.title-subcopy {
  max-width: 640px;
  margin: 0;
  color: #2d4033;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.75;
}

.title-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.title-badges span {
  padding: 9px 12px;
  border: 1px solid rgba(49, 71, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(47, 69, 43, 0.08);
}

.start-button {
  width: min(320px, 100%);
  min-height: 64px;
  font-size: 22px;
  box-shadow: 0 18px 34px rgba(47, 125, 69, 0.28);
}

.title-field-scene {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 46px);
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 13%, rgba(255, 216, 73, 0.56) 0 38px, transparent 39px),
    radial-gradient(circle at 86% 12%, rgba(255, 236, 121, 0.6) 0 46px, transparent 47px),
    linear-gradient(135deg, #fff1a6 0%, #dff2bf 48%, #ffd47a 100%);
  image-rendering: pixelated;
}

.title-field-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.1) 50%, transparent 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 50%, transparent 50%);
  background-size: 8px 8px;
  pointer-events: none;
}

.title-sky,
.title-mountains,
.title-field,
.title-farmer,
.title-truck {
  position: absolute;
}

.title-sky {
  inset: 0 0 45%;
}

.title-sun {
  position: absolute;
  right: 12%;
  top: 12%;
  width: 56px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5b637;
  box-shadow: 0 0 0 10px rgba(245, 182, 55, 0.16), 0 0 34px rgba(245, 182, 55, 0.42);
}

.title-cloud {
  position: absolute;
  width: 108px;
  height: 32px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 24px -10px 0 rgba(255, 255, 255, 0.86), 58px 0 0 rgba(255, 255, 255, 0.86);
}

.title-cloud-a {
  left: 12%;
  top: 22%;
  animation: titleCloud 7s linear infinite;
}

.title-cloud-b {
  right: 22%;
  top: 28%;
  transform: scale(0.78);
  opacity: 0.8;
  animation: titleCloud 9s linear infinite reverse;
}

.title-mountains {
  left: -8%;
  right: -8%;
  top: 23%;
  height: 150px;
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(58, 112, 63, 0.62) 35% 50%, transparent 50%) 0 0 / 180px 150px repeat-x,
    linear-gradient(45deg, transparent 0 35%, rgba(81, 132, 74, 0.58) 35% 50%, transparent 50%) 78px 0 / 210px 150px repeat-x;
}

.title-field {
  left: 6%;
  right: 6%;
  bottom: 10%;
  height: 46%;
  border: 4px solid #314737;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(49, 71, 55, 0.28) 0 9px, transparent 9px 42px),
    repeating-linear-gradient(90deg, rgba(255, 230, 111, 0.45) 0 22px, rgba(87, 141, 65, 0.48) 22px 44px),
    #69a94f;
  box-shadow: inset 0 -38px 0 rgba(42, 91, 48, 0.5), 0 18px 30px rgba(49, 71, 55, 0.16);
}

.title-field span {
  position: absolute;
  left: 4%;
  right: 4%;
  height: 11px;
  background: rgba(245, 228, 139, 0.72);
  box-shadow: 0 4px 0 rgba(49, 71, 55, 0.18);
}

.title-field span:nth-child(1) { top: 16%; }
.title-field span:nth-child(2) { top: 34%; }
.title-field span:nth-child(3) { top: 52%; }
.title-field span:nth-child(4) { top: 70%; }

.title-farmer {
  left: 15%;
  bottom: 18%;
  width: 104px;
  height: 128px;
  background:
    linear-gradient(#e3ba55 0 0) 20px 0 / 64px 18px,
    linear-gradient(#e3ba55 0 0) 8px 18px / 88px 16px,
    linear-gradient(#2f7d45 0 0) 35px 34px / 36px 48px,
    linear-gradient(#f1c184 0 0) 38px 18px / 30px 28px,
    linear-gradient(#263629 0 0) 30px 82px / 16px 32px,
    linear-gradient(#263629 0 0) 58px 82px / 16px 32px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 10px 0 rgba(49, 71, 55, 0.16));
  animation: titleFarmer 1.4s steps(2) infinite;
}

.title-truck {
  right: 12%;
  bottom: 22%;
  width: 150px;
  height: 82px;
  background:
    linear-gradient(#ffffff 0 0) 10px 26px / 90px 42px,
    linear-gradient(#e6b24a 0 0) 88px 12px / 46px 56px,
    linear-gradient(#314737 0 0) 19px 62px / 26px 18px,
    linear-gradient(#314737 0 0) 104px 62px / 26px 18px;
  background-repeat: no-repeat;
}

.title-truck::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 34px;
  width: 64px;
  height: 20px;
  background: repeating-linear-gradient(90deg, #f6f2d8 0 12px, #d7ddd4 12px 16px);
}

.title-phone {
  position: relative;
  z-index: 1;
  width: min(390px, 88%);
  aspect-ratio: 9 / 16;
  padding: 16px 13px 18px;
  border: 4px solid #1e3028;
  border-radius: 42px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 22%),
    #24342c;
  box-shadow:
    0 28px 42px rgba(34, 45, 32, 0.28),
    inset 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.phone-speaker {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 86px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-50%);
}

.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 3px solid rgba(24, 58, 37, 0.72);
  border-radius: 30px;
  background:
    linear-gradient(#83c9ee 0 36%, #9ed96a 36% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.phone-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 50%, transparent 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 50%, transparent 50%);
  background-size: 5px 5px;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.phone-sky {
  position: absolute;
  inset: 0 0 42%;
}

.phone-sky .title-cloud {
  width: 58px;
  height: 18px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 15px -8px 0 rgba(255, 255, 255, 0.92), 34px 0 0 rgba(255, 255, 255, 0.86);
}

.phone-sky .title-cloud-a {
  left: 18%;
  top: 13%;
}

.phone-sky .title-cloud-b {
  right: 20%;
  top: 22%;
}

.phone-mountains {
  position: absolute;
  left: -12%;
  right: -12%;
  top: 22%;
  height: 145px;
  background:
    linear-gradient(135deg, transparent 0 38%, #4f8a54 38% 55%, transparent 55%) 0 0 / 126px 100% repeat-x,
    linear-gradient(45deg, transparent 0 36%, #67a15c 36% 54%, transparent 54%) 56px 16px / 154px 100% repeat-x;
  opacity: 0.92;
}

.phone-game-title {
  position: absolute;
  z-index: 3;
  top: 34px;
  left: 16px;
  right: 16px;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #1d4028;
  text-align: center;
  text-shadow: 0 3px 0 #ffe575, 0 6px 0 rgba(44, 89, 43, 0.18);
}

.phone-game-title strong {
  font-size: clamp(33px, 4vw, 45px);
  line-height: 0.95;
  letter-spacing: 0;
}

.phone-game-title span {
  padding: 3px 18px 4px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background: #2f8d49;
  color: #fff2a5;
  font-size: 18px;
  font-weight: 1000;
  text-shadow: none;
  box-shadow: 0 5px 0 rgba(25, 72, 36, 0.22);
}

.phone-rice {
  position: absolute;
  z-index: 3;
  top: 82px;
  width: 54px;
  height: 88px;
  background:
    linear-gradient(60deg, transparent 0 46%, #e8bd31 46% 55%, transparent 55%) 2px 10px / 20px 32px repeat-y,
    linear-gradient(-60deg, transparent 0 46%, #e8bd31 46% 55%, transparent 55%) 25px 10px / 20px 32px repeat-y,
    linear-gradient(#327744 0 0) 25px 18px / 5px 70px no-repeat;
}

.phone-rice-left { left: 14px; }
.phone-rice-right { right: 14px; transform: scaleX(-1); }

.phone-field {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  height: 52%;
  background:
    repeating-linear-gradient(0deg, rgba(45, 92, 47, 0.42) 0 6px, transparent 6px 34px),
    repeating-linear-gradient(90deg, rgba(206, 166, 57, 0.5) 0 17px, rgba(81, 161, 73, 0.78) 17px 34px),
    #79c455;
  border-top: 5px solid rgba(52, 92, 47, 0.84);
  box-shadow: inset 0 22px 0 rgba(122, 195, 86, 0.45);
}

.phone-field span {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 9px;
  background:
    repeating-linear-gradient(90deg, #f7df73 0 5px, transparent 5px 20px);
  filter: drop-shadow(0 4px 0 rgba(33, 74, 38, 0.22));
}

.phone-field span:nth-child(1) { top: 12%; }
.phone-field span:nth-child(2) { top: 29%; }
.phone-field span:nth-child(3) { top: 46%; }
.phone-field span:nth-child(4) { top: 63%; }
.phone-field span:nth-child(5) { top: 80%; }

.phone-house {
  position: absolute;
  z-index: 4;
  left: 22px;
  top: 39%;
  width: 68px;
  height: 54px;
  background:
    linear-gradient(135deg, transparent 0 36%, #8d4b26 36% 64%, transparent 64%) 0 0 / 68px 28px no-repeat,
    linear-gradient(#f2dfad 0 0) 11px 23px / 46px 28px no-repeat,
    linear-gradient(#4b3422 0 0) 29px 35px / 12px 16px no-repeat;
  filter: drop-shadow(0 7px 0 rgba(38, 74, 35, 0.14));
}

.phone-farmer {
  position: absolute;
  z-index: 4;
  left: 41%;
  bottom: 128px;
  width: 66px;
  height: 86px;
  transform: translateX(-50%);
  background:
    linear-gradient(#e6bd52 0 0) 14px 0 / 38px 11px,
    linear-gradient(#e6bd52 0 0) 4px 11px / 58px 11px,
    linear-gradient(#f4c38a 0 0) 22px 16px / 21px 22px,
    linear-gradient(#205832 0 0) 18px 37px / 30px 30px,
    linear-gradient(#193024 0 0) 14px 67px / 11px 18px,
    linear-gradient(#193024 0 0) 39px 67px / 11px 18px,
    linear-gradient(#f4c38a 0 0) 5px 43px / 12px 8px,
    linear-gradient(#f4c38a 0 0) 48px 43px / 12px 8px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 9px 0 rgba(28, 66, 34, 0.2));
  animation: titleFarmer 1.35s steps(2) infinite;
}

.phone-status-card {
  position: absolute;
  z-index: 4;
  right: 14px;
  top: 155px;
  width: 120px;
  padding: 10px 10px 9px;
  border: 2px solid rgba(44, 71, 55, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #1f3627;
  font-weight: 900;
  box-shadow: 0 8px 0 rgba(45, 78, 43, 0.16);
}

.phone-status-card span,
.phone-status-card small {
  display: block;
}

.phone-status-card span {
  margin-bottom: 7px;
  color: var(--green-dark);
  font-size: 15px;
}

.phone-status-card small {
  font-size: 12px;
  line-height: 1.55;
}

.phone-start-chip {
  position: absolute;
  z-index: 4;
  left: 52px;
  right: 52px;
  bottom: 48px;
  padding: 12px 10px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background: #2f8d49;
  color: white;
  text-align: center;
  font-size: 14px;
  font-weight: 1000;
  box-shadow: 0 6px 0 rgba(32, 91, 44, 0.34);
}

.phone-nav {
  position: absolute;
  z-index: 4;
  left: 14px;
  right: 14px;
  bottom: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.phone-nav span {
  min-height: 30px;
  padding-top: 7px;
  border: 1px solid rgba(40, 77, 49, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--green-dark);
  text-align: center;
  font-size: 11px;
  font-weight: 1000;
  box-shadow: 0 3px 0 rgba(49, 71, 55, 0.12);
}

.final-screen h2 {
  color: #1f3d2b;
  font-size: 72px;
  line-height: 0.95;
  text-shadow: 0 4px 0 rgba(224, 189, 85, 0.42), 0 12px 24px rgba(49, 71, 55, 0.18);
  animation: titleBoom 0.72s cubic-bezier(.2, 1.42, .28, 1) both;
}

.final-screen #finalShareButton {
  background: var(--gold);
}

.start-screen p,
.final-screen p,
.event-box p {
  line-height: 1.75;
}

.period-theme {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.dot-stage {
  position: relative;
  height: 214px;
  margin-top: 18px;
  overflow: hidden;
  border: 3px solid #314737;
  border-radius: 8px;
  background: #8fc4e8;
  image-rendering: pixelated;
  cursor: pointer;
  box-shadow: inset 0 -36px 0 rgba(255, 255, 255, 0.1);
}

.dot-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12) 50%, transparent 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 50%, transparent 50%);
  background-size: 8px 8px;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.dot-stage::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 22px;
  width: 18px;
  height: 18px;
  background: #f3c34d;
  box-shadow:
    -18px 6px 0 -6px #f3c34d,
    18px 6px 0 -6px #f3c34d,
    0 -16px 0 -7px #f3c34d,
    0 16px 0 -7px #f3c34d,
    -70px 18px 0 2px rgba(255, 255, 255, 0.78),
    -52px 18px 0 4px rgba(255, 255, 255, 0.78),
    -34px 20px 0 1px rgba(255, 255, 255, 0.78);
  z-index: 1;
  animation: sunBlink 1.4s steps(2) infinite;
}

.field-layer {
  position: absolute;
  inset: 56px 0 0;
  background: #6fa853;
}

.field-layer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -32px;
  height: 34px;
  background:
    linear-gradient(135deg, transparent 0 42%, #73994c 43% 56%, transparent 57%),
    linear-gradient(45deg, transparent 0 46%, #5f8645 47% 60%, transparent 61%);
  background-size: 92px 34px, 118px 34px;
  opacity: 0.74;
}

.field-layer::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 82px;
  width: 28px;
  height: 20px;
  background: #f1dfb4;
  border: 3px solid #6b5132;
  box-shadow:
    6px -8px 0 -2px #b85c38,
    -8px -8px 0 -2px #b85c38,
    8px 20px 0 -8px #6b5132;
}

.paddy {
  position: absolute;
  left: 4%;
  right: 4%;
  height: 34px;
  border: 3px solid rgba(57, 78, 47, 0.55);
  border-radius: 2px;
  background-size: 22px 100%, 100% 100%;
}

.paddy-back {
  top: 14px;
}

.paddy-mid {
  top: 58px;
}

.paddy-front {
  top: 102px;
}

.field-idle .paddy {
  background: repeating-linear-gradient(90deg, #6e9a46 0 4px, #7dad4f 4px 10px);
}

.field-tilled .paddy {
  background: repeating-linear-gradient(90deg, #7b5635 0 8px, #8f6944 8px 16px);
}

.field-water .paddy {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 2px, transparent 2px 18px),
    #6cb6c7;
  animation: waterShimmer 0.9s steps(2) infinite;
}

.field-seedlings .paddy {
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, #245f35 8px 11px, transparent 11px 20px),
    #6cb6c7;
}

.field-growing .paddy {
  background: repeating-linear-gradient(90deg, #2f7d45 0 5px, #54a24f 5px 11px);
}

.field-ripe .paddy {
  background: repeating-linear-gradient(90deg, #c69a31 0 5px, #e0bd55 5px 11px);
}

.field-harvested .paddy {
  background: repeating-linear-gradient(90deg, #a87945 0 8px, #c2965c 8px 16px);
}

.ridge {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(90deg, #486333 0 12px, #58753f 12px 24px);
}

.ridge-top {
  top: 48px;
}

.ridge-bottom {
  top: 92px;
}

.sprite {
  position: absolute;
  image-rendering: pixelated;
  z-index: 3;
}

.actor {
  width: 30px;
  height: 44px;
  left: 48px;
  bottom: 32px;
  background: transparent;
  filter: drop-shadow(0 3px 0 rgba(34, 34, 34, 0.22));
  animation: actorIdle 0.9s steps(2) infinite;
}

.actor::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  width: 6px;
  height: 6px;
  background: #2e5f9e;
  box-shadow:
    -6px 0 0 #2e5f9e,
    0 0 0 #2e5f9e,
    6px 0 0 #2e5f9e,
    -12px 6px 0 #2e5f9e,
    -6px 6px 0 #263f78,
    0 6px 0 #263f78,
    6px 6px 0 #263f78,
    12px 6px 0 #2e5f9e,
    -6px 12px 0 #3a2520,
    0 12px 0 #f1c27a,
    6px 12px 0 #f1c27a,
    -6px 18px 0 #f1c27a,
    0 18px 0 #f1c27a,
    6px 18px 0 #f1c27a,
    12px 18px 0 #e0a765,
    -12px 24px 0 #315a36,
    -6px 24px 0 #315a36,
    0 24px 0 #4f7f45,
    6px 24px 0 #4f7f45,
    12px 24px 0 #315a36,
    -12px 30px 0 #315a36,
    -6px 30px 0 #4f7f45,
    0 30px 0 #4f7f45,
    6px 30px 0 #315a36,
    12px 30px 0 #315a36,
    -6px 36px 0 #283a52,
    6px 36px 0 #283a52,
    -6px 42px 0 #252525,
    6px 42px 0 #252525;
}

.actor::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 27px;
  width: 6px;
  height: 6px;
  background: #f1c27a;
  box-shadow:
    20px 0 0 #f1c27a,
    2px 5px 0 #e0a765,
    18px 5px 0 #e0a765;
}

.actor::before {
  background: #d7b35a;
  box-shadow:
    -6px 0 0 #d7b35a,
    0 0 0 #d7b35a,
    6px 0 0 #d7b35a,
    -18px 6px 0 #d7b35a,
    -12px 6px 0 #e6c66e,
    -6px 6px 0 #e6c66e,
    0 6px 0 #e6c66e,
    6px 6px 0 #e6c66e,
    12px 6px 0 #e6c66e,
    18px 6px 0 #d7b35a,
    -6px 12px 0 #3a2520,
    0 12px 0 #f1c27a,
    6px 12px 0 #f1c27a,
    -6px 18px 0 #3a2520,
    0 18px 0 #2d2d2d,
    6px 18px 0 #f1c27a,
    12px 18px 0 #2d2d2d,
    18px 18px 0 #e8897a,
    -12px 24px 0 #315a36,
    -6px 24px 0 #315a36,
    0 24px 0 #f4f0d4,
    6px 24px 0 #4f7f45,
    12px 24px 0 #4f7f45,
    18px 24px 0 #315a36,
    -12px 30px 0 #315a36,
    -6px 30px 0 #4f7f45,
    0 30px 0 #4f7f45,
    6px 30px 0 #315a36,
    12px 30px 0 #315a36,
    -6px 36px 0 #283a52,
    6px 36px 0 #283a52,
    -6px 42px 0 #252525,
    6px 42px 0 #252525;
}

.actor::after {
  box-shadow:
    20px 0 0 #f1c27a,
    2px 5px 0 #e0a765,
    18px 5px 0 #e0a765,
    12px -9px 0 #f7d993,
    16px -9px 0 #f7d993;
}

.actor.walk {
  animation: none;
}

.machine {
  width: 58px;
  height: 34px;
  left: -70px;
  bottom: 44px;
  background: #d14d35;
  border: 4px solid #592f27;
  box-shadow:
    inset 12px -8px 0 #a8322a,
    8px 24px 0 -4px #222,
    38px 24px 0 -4px #222;
}

.machine.planter {
  background: #3d8f67;
  border-color: #214a38;
}

.machine.combine {
  width: 70px;
  height: 42px;
  background: #d49a2c;
  border-color: #5f451f;
  box-shadow:
    inset 16px -10px 0 #a9761f,
    8px 30px 0 -4px #222,
    48px 30px 0 -4px #222;
}

.effect-layer,
.weather-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.stage-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 2px solid rgba(49, 71, 55, 0.65);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 13px;
}

.stage-caption span {
  color: var(--muted);
  font-weight: 700;
}

.dot-stage.animating .actor.walk {
  animation: actorWalk 1.45s steps(4) both;
}

.dot-stage.animating .actor.walk::before,
.dot-stage.animating .actor.walk::after {
  animation: actorStep 0.36s steps(2) infinite;
}

.dot-stage.animating .machine.move {
  animation: machineMove 1.45s linear both;
}

.dot-stage.animating .effect-tools::before,
.dot-stage.animating .effect-tools::after {
  content: "!";
  position: absolute;
  left: 47%;
  top: 68px;
  color: #315a36;
  font-weight: 900;
  font-size: 24px;
  animation: blinkPop 0.45s steps(2) infinite;
}

.dot-stage.animating .effect-tools::after {
  content: "+";
  left: 54%;
  color: #b8791a;
}

.dot-stage.animating .effect-pest::before {
  content: "× × ×";
  position: absolute;
  left: 44%;
  top: 70px;
  color: #1f5e32;
  font-size: 24px;
  font-weight: 900;
  animation: clearAway 1.2s steps(3) both;
}

.dot-stage.animating .effect-money::before {
  content: "¥";
  position: absolute;
  left: 52%;
  top: 64px;
  color: #b8791a;
  font-size: 34px;
  font-weight: 900;
  animation: blinkPop 0.55s steps(2) infinite;
}

.dot-stage.animating .effect-layer::after {
  content: "";
  position: absolute;
  left: 34%;
  top: 52px;
  width: 6px;
  height: 6px;
  background: #fff7bf;
  box-shadow:
    28px -12px 0 #fff7bf,
    68px 10px 0 #f3c34d,
    104px -2px 0 #fff7bf,
    142px 18px 0 #f3c34d,
    176px 4px 0 #fff7bf;
  animation: sparkleTrail 0.9s steps(3) infinite;
}

.weather-sunny::before,
.weather-hot::before,
.weather-rain::before,
.weather-typhoon::before {
  position: absolute;
  right: 20px;
  top: 16px;
  font-weight: 900;
  font-size: 30px;
}

.weather-sunny::before {
  content: "SUN";
  color: #d28a1e;
}

.weather-hot::before {
  content: "HOT";
  color: #b63d2f;
  animation: blinkPop 0.7s steps(2) infinite;
}

.weather-rain {
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(36, 88, 145, 0.34) 14px 18px);
  animation: rainFall 0.5s linear infinite;
}

.weather-rain::before {
  content: "RAIN";
  color: #3469a6;
}

.weather-typhoon {
  background: repeating-linear-gradient(20deg, transparent 0 20px, rgba(36, 88, 145, 0.34) 20px 26px);
  animation: rainFall 0.32s linear infinite;
}

.weather-typhoon::before {
  content: "STORM";
  color: #3469a6;
}

.primary-button,
.ghost-button,
.action-button,
.choice-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.primary-button {
  width: fit-content;
  position: relative;
  overflow: hidden;
  padding: 0 22px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.primary-button.tap-hint {
  border-color: rgba(184, 92, 56, 0.22);
  background: linear-gradient(135deg, #f2a33b, #d86a2e);
  animation: tapPulse 1.05s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(216, 106, 46, 0.5), 0 10px 24px rgba(184, 92, 56, 0.3);
}

.primary-button.result-continue {
  border: 2px solid rgba(184, 121, 26, 0.44);
  background: linear-gradient(135deg, #f3b23f, #2f8a50);
  animation: resultPulse 1.2s ease-in-out infinite;
  box-shadow: 0 12px 26px rgba(47, 125, 69, 0.26), 0 0 0 0 rgba(242, 163, 59, 0.42);
}

.primary-button.tap-hint::after,
.primary-button.result-continue::after {
  content: "";
  position: absolute;
  inset: -60%;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.52) 50%, transparent 65%);
  transform: translateX(-72%) rotate(12deg);
  animation: tapShine 1.35s ease-in-out infinite;
  pointer-events: none;
}

.play-screen.result-first {
  display: flex;
  flex-direction: column;
}

.play-screen.result-first .harvest-card,
.play-screen.result-first .settlement-card {
  order: -1;
}

.play-screen.result-first .actions-box {
  order: 3;
}

.play-screen.result-first .actions-box h3,
.play-screen.result-first .action-grid {
  display: none;
}

.play-screen.result-first .actions-box .primary-button {
  width: 100%;
  min-height: 58px;
  font-size: 18px;
}

.ghost-button {
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
  color: var(--green-dark);
  font-weight: 800;
}

.primary-button:hover,
.ghost-button:hover,
.action-button:hover,
.choice-button:hover {
  transform: translateY(-1px);
}

.year-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.mobile-hud {
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(47, 125, 69, 0.24);
  border-radius: 8px;
  background: rgba(248, 251, 241, 0.95);
}

.mobile-turn {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--green-dark);
  font-weight: 900;
}

.mobile-turn span {
  font-size: 15px;
}

.mobile-turn strong {
  font-size: 13px;
}

.mobile-stat-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(48px, 1fr));
  gap: 6px;
  margin: 0;
}

.mobile-stat-grid div {
  min-height: 43px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid rgba(215, 221, 212, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
}

.mobile-stat-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mobile-stat-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.mobile-data-panel {
  display: none;
}

.mobile-data-panel h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 16px;
}

.mobile-data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.mobile-data-grid div {
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
}

.mobile-data-grid .mobile-rice-price-tile {
  border-color: rgba(184, 121, 26, 0.42);
  background: linear-gradient(135deg, #fff0ad, #f7fbe9);
  box-shadow: 0 8px 18px rgba(184, 121, 26, 0.14);
}

.mobile-data-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mobile-data-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 900;
}

.mobile-rice-price-tile strong {
  color: #8f5200;
}

.season-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.season-cards div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.season-cards .rice-price-card {
  border-color: rgba(184, 121, 26, 0.38);
  background: linear-gradient(135deg, #fff4bf, #ecf5d8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), 0 8px 18px rgba(184, 121, 26, 0.12);
}

.season-cards span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.season-cards strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.rice-price-card strong {
  color: #8f5200;
}

.event-box {
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf1;
}

.turn-result {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 125, 69, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  animation: popIn 0.22s ease;
}

.turn-result-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--green-dark);
  font-weight: 800;
}

.turn-result-head span {
  color: var(--muted);
  font-size: 13px;
}

.turn-result ul {
  margin: 10px 0;
  padding-left: 18px;
}

.turn-result li {
  margin-bottom: 4px;
  line-height: 1.5;
}

.delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.delta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--field);
  font-size: 13px;
  font-weight: 800;
}

.rice-price-announcement {
  margin: 10px 0;
  padding: 12px;
  border: 2px solid rgba(184, 121, 26, 0.45);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(135deg, #fff0ad, #f8fbeb);
  box-shadow: 0 10px 22px rgba(184, 121, 26, 0.15);
}

.rice-price-announcement span,
.rice-price-announcement strong {
  display: block;
}

.rice-price-announcement span {
  color: #8f5200;
  font-size: 13px;
  font-weight: 900;
}

.rice-price-announcement strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.choice-row,
.action-grid {
  display: grid;
  gap: 10px;
}

.choice-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.action-grid {
  grid-template-columns: repeat(5, minmax(92px, 1fr));
}

.action-grid.few-actions {
  grid-template-columns: repeat(2, minmax(180px, 260px));
  justify-content: center;
}

.action-grid.few-actions .action-button {
  min-height: 72px;
  border: 2px solid rgba(47, 125, 69, 0.26);
  background: linear-gradient(180deg, #fffdf2, #f3f8e9);
  box-shadow: 0 10px 22px rgba(47, 125, 69, 0.13);
  font-size: 18px;
}

.action-button,
.choice-button {
  padding: 10px;
  background: white;
  border-color: var(--line);
  color: var(--ink);
  font-weight: 800;
}

.action-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0 0 6px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.action-badge.recommend {
  background: var(--green);
}

.action-badge.caution {
  background: var(--red);
}

.temporary-action {
  border-color: rgba(184, 121, 26, 0.42);
  background: #fff9df;
}

.temporary-action::before {
  content: "臨時 ";
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.action-button small,
.choice-button small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.action-button:disabled,
.choice-button:disabled {
  cursor: wait;
  opacity: 0.52;
  transform: none;
}

.harvest-card {
  margin-top: 18px;
  border-radius: 8px;
  border: 2px solid rgba(184, 121, 26, 0.42);
  background: linear-gradient(135deg, #fff9df, #f4f8df);
  padding: 18px;
  animation: popIn 0.32s ease;
}

.harvest-card h3 {
  color: var(--gold);
}

.settlement-card {
  margin-top: 14px;
  border-radius: 8px;
  border: 1px solid rgba(52, 105, 166, 0.28);
  background: #f2f7fc;
  padding: 18px;
  animation: popIn 0.24s ease;
}

.settlement-card h3 {
  color: var(--blue);
}

.stars {
  margin-top: 6px;
  color: var(--gold);
  font-size: 22px;
  font-weight: 900;
}

.harvest-grid,
.final-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.harvest-grid div,
.final-summary div {
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settlement-comment {
  margin: 6px 0 12px;
  color: var(--green-dark);
  font-weight: 900;
}

.final-summary .life-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 178px;
  padding-left: 162px;
  border: 2px solid rgba(184, 121, 26, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 247, 210, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 14px 34px rgba(184, 121, 26, 0.14);
}

.final-summary .life-card p {
  margin: 10px 0 14px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.7;
}

.final-summary .life-card .ending-joke {
  margin-bottom: 0;
  color: var(--green-dark);
  font-size: 17px;
}

.ending-farmer {
  --hat: #d7b35a;
  --hat-light: #e8ca74;
  --hair: #3a2520;
  --skin: #f1c27a;
  --skin-dark: #d99b63;
  --shirt: #4f7f45;
  --shirt-dark: #315a36;
  --shirt-light: #f4f0d4;
  --pants: #283a52;
  --boots: #252525;
  --tool: #7b5635;
  position: absolute;
  left: 28px;
  top: 38px;
  width: 108px;
  height: 124px;
  image-rendering: pixelated;
  animation: endingBounce 1.1s steps(4) infinite;
}

.ending-farmer span {
  position: absolute;
  left: 34px;
  top: 6px;
  width: 4px;
  height: 4px;
  transform: scale(1.55);
  transform-origin: top left;
  background: var(--hat);
  box-shadow:
    -4px 0 0 var(--hat),
    4px 0 0 var(--hat),
    -8px 4px 0 var(--hat),
    -4px 4px 0 var(--hat-light),
    0 4px 0 var(--hat-light),
    4px 4px 0 var(--hat-light),
    8px 4px 0 var(--hat),
    -20px 8px 0 var(--hat),
    -16px 8px 0 var(--hat-light),
    -12px 8px 0 var(--hat-light),
    -8px 8px 0 var(--hat-light),
    -4px 8px 0 var(--hat-light),
    0 8px 0 var(--hat-light),
    4px 8px 0 var(--hat-light),
    8px 8px 0 var(--hat-light),
    12px 8px 0 var(--hat-light),
    16px 8px 0 var(--hat-light),
    20px 8px 0 var(--hat),
    -8px 12px 0 var(--hair),
    -4px 12px 0 var(--skin),
    0 12px 0 var(--skin),
    4px 12px 0 var(--skin),
    8px 12px 0 var(--skin-dark),
    -8px 16px 0 var(--hair),
    -4px 16px 0 var(--skin),
    0 16px 0 #2d2d2d,
    4px 16px 0 var(--skin),
    8px 16px 0 #2d2d2d,
    12px 16px 0 var(--skin-dark),
    -4px 20px 0 var(--skin),
    0 20px 0 var(--skin),
    4px 20px 0 var(--skin-dark),
    -12px 24px 0 var(--shirt-dark),
    -8px 24px 0 var(--shirt-dark),
    -4px 24px 0 var(--shirt),
    0 24px 0 var(--shirt-light),
    4px 24px 0 var(--shirt),
    8px 24px 0 var(--shirt),
    12px 24px 0 var(--shirt-dark),
    -16px 28px 0 var(--skin),
    -12px 28px 0 var(--shirt-dark),
    -8px 28px 0 var(--shirt),
    -4px 28px 0 var(--shirt),
    0 28px 0 var(--shirt-light),
    4px 28px 0 var(--shirt),
    8px 28px 0 var(--shirt-dark),
    12px 28px 0 var(--shirt-dark),
    16px 28px 0 var(--skin),
    -16px 32px 0 var(--skin-dark),
    -8px 32px 0 var(--shirt-dark),
    -4px 32px 0 var(--shirt),
    0 32px 0 var(--shirt),
    4px 32px 0 var(--shirt),
    8px 32px 0 var(--shirt-dark),
    16px 32px 0 var(--skin-dark),
    -8px 36px 0 var(--pants),
    -4px 36px 0 var(--pants),
    4px 36px 0 var(--pants),
    8px 36px 0 var(--pants),
    -8px 40px 0 var(--pants),
    -4px 40px 0 var(--pants),
    4px 40px 0 var(--pants),
    8px 40px 0 var(--pants),
    -8px 44px 0 var(--boots),
    -4px 44px 0 var(--boots),
    4px 44px 0 var(--boots),
    8px 44px 0 var(--boots),
    -20px 30px 0 var(--tool),
    20px 30px 0 var(--tool);
}

.ending-farmer::before {
  content: "";
  position: absolute;
  left: 48px;
  top: 20px;
  width: 4px;
  height: 4px;
  transform: scale(1.55);
  transform-origin: top left;
  background: var(--tool);
  box-shadow:
    4px 4px 0 var(--tool),
    8px 8px 0 var(--tool),
    12px 12px 0 var(--tool),
    16px 16px 0 var(--tool);
}

.ending-farmer::after {
  content: none;
  display: none;
}

.ending-debt .ending-farmer { --hat: #7b5635; --hat-light: #a36e3e; --shirt: #8f4a41; --shirt-dark: #673238; --shirt-light: #f4d9cd; --pants: #3e3a45; --tool: #b85c38; }
.ending-solid .ending-farmer { --hat: #d7b35a; --hat-light: #e8ca74; --shirt: #4f7f45; --shirt-dark: #315a36; --shirt-light: #f4f0d4; --pants: #283a52; --tool: #7b5635; }
.ending-craft .ending-farmer { --hat: #c79a31; --hat-light: #f0cd63; --shirt: #2f7d45; --shirt-dark: #245f35; --shirt-light: #e9f5db; --pants: #2d405f; --tool: #6b5132; }
.ending-business .ending-farmer { --hat: #3469a6; --hat-light: #72a7dd; --shirt: #1f4d7a; --shirt-dark: #1b3658; --shirt-light: #edf4fc; --pants: #1f2937; --tool: #d7b35a; }
.ending-community .ending-farmer { --hat: #5fa35d; --hat-light: #a0d17c; --shirt: #2f7d45; --shirt-dark: #245f35; --shirt-light: #fff0b8; --pants: #34505f; --tool: #b85c38; }
.ending-brand .ending-farmer { --hat: #b8791a; --hat-light: #f2c75a; --shirt: #8f6a22; --shirt-dark: #5f4a16; --shirt-light: #fff6cc; --pants: #2b3d4f; --tool: #c69a31; }
.ending-king .ending-farmer { --hat: #f2c75a; --hat-light: #fff2a8; --shirt: #c2962d; --shirt-dark: #7d611a; --shirt-light: #fff8d8; --pants: #243c63; --tool: #f2c75a; }

.harvest-grid span,
.final-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.harvest-grid strong,
.final-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.harvest-grid .yield-compare {
  border-color: rgba(52, 105, 166, 0.28);
  background: linear-gradient(135deg, #f4f8ff, #ffffff);
}

.yield-compare small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 900;
}

.net-worth-breakdown strong {
  line-height: 1.5;
}

.final-summary .wide {
  grid-column: 1 / -1;
}

.timeline strong {
  line-height: 1.7;
}

.log-box ol {
  max-height: 390px;
  overflow: auto;
  padding-left: 20px;
  margin: 12px 0 0;
}

.log-box li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.previous-log {
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.hidden {
  display: none !important;
}

.negative {
  color: var(--red);
}

.positive {
  color: var(--green-dark);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes abilityBloom {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.76);
  }
  62% {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes endingBounce {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-5px) rotate(-2deg);
  }
}

@keyframes actorWalk {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(210px) translateY(-2px);
  }
  100% {
    transform: translateX(360px);
  }
}

@keyframes actorIdle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes actorStep {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}

@keyframes titleCloud {
  0%, 100% {
    translate: -10px 0;
  }

  50% {
    translate: 10px 0;
  }
}

@keyframes titleFarmer {
  0%, 100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -4px;
  }
}

@keyframes machineMove {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(760px);
  }
}

@keyframes waterShimmer {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 12px 0;
  }
}

@keyframes blinkPop {
  0%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.35;
    transform: translateY(-4px);
  }
}

@keyframes clearAway {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(90px);
  }
}

@keyframes rainFall {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -24px 36px;
  }
}

@keyframes titleBoom {
  0% {
    opacity: 0;
    transform: scale(0.72) translateY(16px);
  }
  72% {
    opacity: 1;
    transform: scale(1.06) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sunBlink {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}

@keyframes sparkleTrail {
  0%, 100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

@keyframes tapPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(216, 106, 46, 0.46), 0 10px 24px rgba(184, 92, 56, 0.24);
  }

  50% {
    transform: translateY(-1px) scale(1.045);
    box-shadow: 0 0 0 10px rgba(216, 106, 46, 0), 0 14px 28px rgba(184, 92, 56, 0.36);
  }
}

@keyframes resultPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(242, 163, 59, 0.42), 0 12px 26px rgba(47, 125, 69, 0.24);
  }

  50% {
    transform: translateY(-2px) scale(1.025);
    box-shadow: 0 0 0 12px rgba(242, 163, 59, 0), 0 16px 32px rgba(47, 125, 69, 0.34);
  }
}

@keyframes tapShine {
  0% {
    transform: translateX(-72%) rotate(12deg);
  }

  48%, 100% {
    transform: translateX(72%) rotate(12deg);
  }
}

@media (max-width: 1020px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .start-screen,
  .final-screen {
    min-height: 420px;
  }

  .title-hero {
    grid-template-columns: 1fr;
  }

  .title-copy {
    min-height: 390px;
    padding: 34px 24px 22px;
  }

  .title-field-scene {
    min-height: 470px;
  }

  .title-phone {
    width: min(320px, 76vw);
  }

  .title-screen h2 {
    max-width: 7.6em;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  body {
    min-height: 100svh;
    overflow: auto;
  }

  .app-shell {
    width: 100%;
    min-height: 100svh;
    padding: 8px;
  }

  .topbar,
  .year-row {
    display: none;
  }

  body:not(.screen-start) .status-panel,
  body:not(.screen-start) .data-panel {
    display: none;
  }

  .game-grid {
    display: block;
    min-height: 100%;
  }

  .panel {
    box-shadow: none;
  }

  .main-panel {
    min-height: calc(100svh - 16px);
    padding: 8px;
    overflow: visible;
  }

  .start-screen,
  .final-screen {
    min-height: calc(100svh - 34px);
    gap: 10px;
  }

  .title-screen {
    min-height: calc(100svh - 16px);
  }

  .title-hero {
    min-height: inherit;
    grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  }

  .title-copy {
    min-height: 0;
    padding: 28px;
  }

  .title-field-scene {
    min-height: inherit;
  }

  .title-phone {
    width: min(300px, 42vw);
  }

  .title-subcopy {
    font-size: 16px;
    line-height: 1.55;
  }

  .play-screen {
    min-height: calc(100svh - 34px);
    display: grid;
    grid-template-columns: minmax(150px, 0.72fr) minmax(250px, 1fr) minmax(330px, 1.35fr);
    grid-template-rows: minmax(158px, auto) minmax(104px, auto) auto auto;
    grid-template-areas:
      "hud stage event"
      "actions actions actions"
      "mobiledata mobiledata mobiledata"
      "feedback feedback feedback";
    align-items: stretch;
    gap: 7px;
    overflow: visible;
  }

  .play-screen.result-first {
    grid-template-rows: minmax(158px, auto) auto minmax(86px, auto) auto;
    grid-template-areas:
      "hud stage event"
      "feedback feedback feedback"
      "actions actions actions"
      "mobiledata mobiledata mobiledata";
  }

  .mobile-hud {
    display: grid;
    grid-area: hud;
    align-content: start;
    gap: 6px;
    padding: 7px;
  }

  .mobile-turn {
    display: grid;
    gap: 2px;
    align-items: start;
  }

  .mobile-turn span {
    font-size: 13px;
    line-height: 1.2;
  }

  .mobile-turn strong {
    font-size: 12px;
  }

  .mobile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 5px;
  }

  .mobile-stat-grid div {
    min-height: 35px;
    padding: 3px;
  }

  .mobile-stat-grid dt {
    font-size: 10px;
    line-height: 1.1;
  }

  .mobile-stat-grid dd {
    font-size: 13px;
    line-height: 1.15;
  }

  .dot-stage {
    grid-area: stage;
    height: 100%;
    min-height: 158px;
    max-height: none;
    margin-top: 0;
  }

  .field-layer {
    inset: 42px 0 0;
  }

  .actor {
    bottom: 22px;
  }

  .machine {
    bottom: 34px;
  }

  .stage-caption {
    left: 8px;
    right: 8px;
    bottom: 6px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .event-box,
  .actions-box {
    margin-top: 0;
    padding: 9px;
  }

  .event-box {
    grid-area: event;
    min-height: 158px;
    max-height: none;
    overflow: auto;
  }

  .actions-box {
    grid-area: actions;
    position: static;
    z-index: 9;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
  }

  .event-box h3,
  .actions-box h3 {
    font-size: 15px;
  }

  .actions-box h3 {
    max-width: 126px;
    margin-top: 2px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.16;
    white-space: normal;
  }

  .event-box p {
    margin: 4px 0;
    line-height: 1.45;
  }

  .turn-result {
    margin-top: 6px;
    padding: 7px;
  }

  .turn-result ul {
    margin: 5px 0;
  }

  .delta-row {
    gap: 4px;
  }

  .delta-row span {
    min-height: 22px;
    padding: 0 7px;
    font-size: 12px;
  }

  .action-grid,
  .choice-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .choice-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 6px;
  }

  .action-button,
  .choice-button {
    min-height: 44px;
    padding: 6px;
    font-size: 13px;
  }

  .action-button small,
  .choice-button small {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.25;
  }

  .action-badge {
    min-height: 17px;
    margin-bottom: 3px;
    padding: 0 5px;
    font-size: 10px;
  }

  .primary-button,
  .ghost-button {
    min-height: 40px;
  }

  .actions-box .primary-button {
    width: auto;
    min-width: 120px;
    padding: 0 14px;
    justify-self: end;
  }

  .mobile-data-panel {
    grid-area: mobiledata;
    display: grid;
    gap: 7px;
    padding: 8px;
    border: 1px solid rgba(47, 125, 69, 0.18);
    border-radius: 8px;
    background: rgba(248, 251, 241, 0.96);
  }

  .mobile-data-panel h3 {
    font-size: 15px;
  }

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

  .action-grid.few-actions {
    grid-template-columns: repeat(2, minmax(190px, 260px));
    justify-content: center;
  }

  .play-screen.result-first .actions-box {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .play-screen.result-first .actions-box h3,
  .play-screen.result-first .action-grid {
    display: none;
  }

  .play-screen.result-first .actions-box .primary-button {
    width: 100%;
    min-height: 56px;
    justify-self: stretch;
    font-size: 18px;
  }

  .harvest-card,
  .settlement-card {
    grid-area: feedback;
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 0;
    padding: 10px;
  }

  .harvest-card h3,
  .settlement-card h3 {
    font-size: 16px;
  }

  .stars {
    margin: 4px 0 8px;
    font-size: 22px;
  }

  .harvest-grid,
  .final-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .harvest-grid div {
    min-height: 58px;
    padding: 8px;
  }

  .harvest-grid span {
    font-size: 11px;
  }

  .harvest-grid strong {
    font-size: 16px;
  }

  .final-screen h2 {
    font-size: 44px;
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  .play-screen {
    grid-template-columns: minmax(132px, 0.7fr) minmax(190px, 1fr) minmax(230px, 1.15fr);
    grid-template-rows: minmax(142px, auto) minmax(104px, auto) auto auto;
  }

  .mobile-hud {
    padding: 6px;
  }

  .mobile-stat-grid div {
    min-height: 32px;
  }

  .dot-stage,
  .event-box {
    min-height: 142px;
  }

  .action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-grid.few-actions {
    grid-template-columns: repeat(2, minmax(160px, 220px));
  }

  .mobile-data-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .mobile-data-grid div {
    min-height: 43px;
    padding: 5px 7px;
  }

  .mobile-data-grid strong {
    font-size: 13px;
  }

  .harvest-grid,
  .final-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  .app-shell {
    padding: 4px 4px calc(76px + env(safe-area-inset-bottom));
  }

  .main-panel {
    min-height: auto;
    padding: 5px;
  }

  .play-screen {
    min-height: auto;
    grid-template-columns: minmax(132px, 0.72fr) minmax(220px, 1fr) minmax(260px, 1.05fr);
    grid-template-rows: minmax(138px, auto) minmax(74px, auto) auto auto;
    gap: 5px;
  }

  .play-screen.result-first {
    grid-template-rows: minmax(138px, auto) auto minmax(58px, auto) auto;
  }

  .mobile-hud {
    gap: 4px;
    padding: 5px;
  }

  .mobile-turn span {
    font-size: 12px;
  }

  .mobile-turn strong {
    font-size: 11px;
  }

  .mobile-stat-grid {
    gap: 4px;
  }

  .mobile-stat-grid div {
    min-height: 27px;
    padding: 2px;
  }

  .mobile-stat-grid dt {
    font-size: 9px;
  }

  .mobile-stat-grid dd {
    font-size: 12px;
  }

  .dot-stage,
  .event-box {
    min-height: 138px;
  }

  .field-layer {
    inset: 34px 0 0;
  }

  .actor {
    bottom: 18px;
  }

  .machine {
    bottom: 28px;
  }

  .stage-caption {
    padding: 4px 6px;
    font-size: 11px;
  }

  .stage-caption span {
    font-size: 10px;
  }

  .event-box,
  .actions-box {
    padding: 7px;
  }

  .event-box h3,
  .actions-box h3 {
    font-size: 14px;
  }

  .actions-box {
    grid-template-columns: minmax(92px, auto) 1fr auto;
    gap: 5px;
  }

  .actions-box h3 {
    max-width: 96px;
    margin-top: 3px;
    font-size: 16px;
    line-height: 1.12;
  }

  .action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .action-grid.few-actions {
    grid-template-columns: repeat(2, minmax(170px, 230px));
    justify-content: center;
  }

  .action-button,
  .choice-button {
    min-height: 42px;
    padding: 5px;
    font-size: 12px;
  }

  .action-button small,
  .choice-button small {
    font-size: 9px;
  }

  .actions-box .primary-button {
    min-height: 42px;
  }

  .play-screen.result-first .actions-box .primary-button {
    min-height: 54px;
  }

  .mobile-data-panel {
    padding: 6px;
    gap: 5px;
  }

  .mobile-data-panel h3 {
    font-size: 14px;
  }

  .mobile-data-grid {
    gap: 5px;
  }

  .mobile-data-grid div {
    min-height: 39px;
    padding: 4px 6px;
  }

  .mobile-data-grid span {
    font-size: 10px;
  }

  .mobile-data-grid strong {
    font-size: 12px;
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  .rotate-prompt {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(248, 251, 241, 0.94);
  }

  .rotate-prompt div {
    max-width: 320px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
    text-align: center;
  }

  .rotate-prompt strong,
  .rotate-prompt span {
    display: block;
  }

  .rotate-prompt strong {
    color: var(--green-dark);
    font-size: 22px;
  }

  .rotate-prompt span {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
  }

  body.screen-start .rotate-prompt,
  body.screen-final .rotate-prompt {
    display: none;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .year-row {
    flex-direction: column;
    align-items: stretch;
  }

  .season-cards,
  .choice-row,
  .action-grid,
  .harvest-grid,
  .final-summary {
    grid-template-columns: 1fr;
  }

  .final-screen h2 {
    font-size: 44px;
  }

  .final-summary .life-card {
    min-height: 214px;
    padding: 152px 14px 14px;
  }

  .ending-farmer {
    left: 34px;
    top: 22px;
  }

  .dot-stage {
    height: 188px;
  }

  .stage-caption {
    flex-direction: column;
    gap: 2px;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
