:root {
  color-scheme: light;
  --ink: #2a2117;
  --muted: #66553d;
  --forest: #173d2d;
  --forest-2: #28563b;
  --leaf: #3f7547;
  --grass: #8ea765;
  --cream: #fff1c5;
  --paper: #fffaf0;
  --gold: #e4b947;
  --gold-light: #ffe38a;
  --gold-dark: #765019;
  --wood: #6f4928;
  --wood-dark: #3c291b;
  --line: #806344;
  --bad: #b6433e;
  --bad-dark: #742c2a;
  --good: #39764b;
  --good-dark: #205234;
  --sky: #9fc7bd;
  --shadow: #4c321e;
  --radius: 4px;
  --font-rpg: "MS Gothic", "Osaka-Mono", "Noto Sans Mono CJK JP", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  background: #7f9659;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--grass);
  background-image:
    linear-gradient(90deg, rgba(61, 92, 48, 0.13) 50%, transparent 50%),
    linear-gradient(rgba(255, 241, 197, 0.11) 50%, transparent 50%);
  background-size: 16px 16px;
  font-family:
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

#app {
  min-height: 100vh;
}

.page-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 12px 10px 36px;
}

.start-wrap {
  width: min(100%, 660px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 12px 38px;
  display: grid;
  align-items: center;
}

.start-card,
.content-card,
.milestone-card,
.result-card {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--wood-dark);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 2px var(--gold),
    6px 6px 0 var(--shadow);
}

.start-card {
  overflow: hidden;
}

.start-banner {
  position: relative;
  min-height: 188px;
  overflow: hidden;
  padding: 28px 24px 30px;
  color: #fff8d9;
  background-color: var(--forest);
  background-image:
    linear-gradient(90deg, rgba(255, 227, 138, 0.08) 50%, transparent 50%),
    linear-gradient(rgba(255, 227, 138, 0.06) 50%, transparent 50%);
  background-size: 12px 12px;
  border-bottom: 4px solid var(--wood-dark);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.start-banner::before,
.start-banner::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.82;
}

.start-banner::before {
  top: 12px;
  right: 12px;
  border-width: 4px 4px 0 0;
}

.start-banner::after {
  right: 12px;
  bottom: 14px;
  border-width: 0 4px 4px 0;
}

.version-badge,
.screen-kicker,
.scene-badge,
.tone-badge,
.action-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  font-family: var(--font-rpg);
  font-size: 0.875rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.02em;
  box-shadow: 2px 2px 0 rgba(60, 41, 27, 0.65);
}

.version-badge {
  color: var(--wood-dark);
  background: var(--gold-light);
}

.start-banner h1 {
  position: relative;
  z-index: 1;
  margin: 15px 0 5px;
  font-family: var(--font-rpg);
  font-size: clamp(2.3rem, 10vw, 4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.07em;
  text-shadow: 4px 4px 0 #091f17;
}

.start-banner p {
  position: relative;
  z-index: 1;
  max-width: 30rem;
  margin: 0;
  color: #f8edbd;
  font-size: 1rem;
  font-weight: 700;
}

.start-body {
  padding: 24px 20px 26px;
  background: var(--paper);
}

.fixed-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 23px;
}

.fixed-rule {
  min-width: 0;
  padding: 10px 11px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--cream);
  box-shadow: inset -3px -3px 0 rgba(111, 73, 40, 0.12);
}

.fixed-rule span {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.fixed-rule strong {
  display: block;
  margin-top: 1px;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.start-note {
  margin: -11px 0 20px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.name-label {
  display: block;
  margin-bottom: 8px;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-weight: 900;
}

.name-input {
  width: 100%;
  min-height: 54px;
  padding: 11px 13px;
  border: 3px solid var(--wood-dark);
  border-radius: 2px;
  color: var(--ink);
  background: #fffdf4;
  font-size: 1rem;
  box-shadow: inset 3px 3px 0 rgba(111, 73, 40, 0.13);
}

.name-input::placeholder {
  color: #887b69;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 15px;
  padding: 12px 18px;
  border: 3px solid var(--wood-dark);
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-rpg);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 5px 0 var(--shadow);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end), background-color 90ms steps(2, end);
}

.primary-button::before {
  content: "▶";
  margin-right: 0.55em;
  color: var(--gold-light);
}

.primary-button {
  color: #fffbe8;
  background: var(--forest-2);
}

.secondary-button {
  color: var(--wood-dark);
  background: var(--gold-light);
}

.primary-button:hover,
.secondary-button:hover,
.villager-choice:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  background: var(--leaf);
}

.primary-button:active,
.secondary-button:active,
.villager-choice:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--shadow);
}

.fine-print {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.game-header {
  overflow: hidden;
  margin-bottom: 12px;
  border: 3px solid var(--wood-dark);
  border-radius: var(--radius);
  color: white;
  background: var(--forest);
  box-shadow: 5px 5px 0 var(--shadow);
}

.game-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 3px solid var(--gold);
  background: var(--forest);
}

.game-titlebar strong {
  flex: 0 0 auto;
  font-family: var(--font-rpg);
  font-size: 1.08rem;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 #081c15;
}

.player-label {
  min-width: 0;
  overflow: hidden;
  color: #f5e9b9;
  font-family: var(--font-rpg);
  font-size: 0.875rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: var(--wood-dark);
}

.hud-item {
  min-width: 0;
  padding: 9px 10px 10px;
  background: #224837;
  box-shadow: inset 0 0 0 1px #4f765e;
}

.hud-item span {
  display: block;
  color: #e9dca6;
  font-family: var(--font-rpg);
  font-size: 0.875rem;
  font-weight: 800;
}

.hud-item strong {
  display: block;
  min-width: 0;
  color: white;
  font-family: var(--font-rpg);
  font-size: clamp(0.95rem, 4.4vw, 1.24rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-shadow: 2px 2px 0 #0b251b;
  white-space: nowrap;
}

.hud-item .gain-positive,
.gain-positive {
  color: #267246;
}

.hud-item .gain-negative,
.gain-negative {
  color: #b13b38;
}

.hud-item strong.gain-positive {
  color: #9ee5a6;
}

.hud-item strong.gain-negative {
  color: #ffaca6;
}

.scene-layout {
  display: grid;
  gap: 11px;
  margin-bottom: 13px;
}

.map-card,
.house-card {
  position: relative;
  min-width: 0;
  background: var(--cream);
  border: 3px solid var(--wood-dark);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--shadow);
}

.map-card {
  padding: 7px;
}

.scene-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 2px 3px 7px;
}

.scene-topline strong {
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.scene-badge {
  color: var(--wood-dark);
  background: var(--gold-light);
}

.map-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--wood-dark);
  border-radius: 2px;
  background: var(--sky);
  box-shadow: inset 0 0 0 2px rgba(255, 250, 222, 0.55);
}

.asset-slot {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.asset-slot img,
.map-asset img,
.house-asset img,
.villager-asset img,
.haribee-asset img,
.effect-asset img {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.asset-slot img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-slot.has-image .asset-fallback {
  visibility: hidden;
}

.asset-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: #355d4d;
  background-color: #b6d2be;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 50%, transparent 50%),
    linear-gradient(rgba(23, 61, 45, 0.08) 50%, transparent 50%);
  background-size: 24px 24px;
  text-align: center;
  font-family: var(--font-rpg);
  font-size: 0.8rem;
  font-weight: 900;
}

.map-asset {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-asset img {
  object-fit: contain;
}

.effect-asset {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  animation: event-effect-in 320ms steps(3, end) both;
}

.effect-asset img {
  object-fit: contain;
}

.effect-asset .asset-fallback {
  align-content: end;
  color: white;
  background: rgba(28, 38, 31, 0.72);
  text-shadow: 2px 2px 0 #14100d;
}

.region-labels {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.region-label {
  position: absolute;
  display: flex;
  min-width: 4.25rem;
  max-width: calc(100% - 8px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  color: #fff6cf;
  background: rgba(28, 55, 40, 0.93);
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 1px rgba(228, 185, 71, 0.72),
    2px 2px 0 rgba(30, 20, 13, 0.82);
  font-family: var(--font-rpg);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  text-align: center;
  text-shadow: 1px 1px 0 #091f17;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.region-label span {
  font-size: clamp(0.68rem, 1.7vw, 0.78rem);
  font-weight: 800;
}

.region-label strong {
  margin-top: 2px;
  color: var(--gold-light);
  font-size: clamp(0.78rem, 2vw, 0.96rem);
  font-weight: 900;
}

.region-label--america {
  left: 20%;
  top: 20%;
}

.region-label--canada {
  left: 57%;
  top: 13%;
}

.region-label--uk {
  left: 86%;
  top: 22%;
}

.region-label--japan {
  left: 54%;
  top: 47%;
}

.region-label--taiwan {
  left: 81%;
  top: 61%;
}

.region-label--other {
  left: 54%;
  top: 81%;
}

.map-composition-note {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45;
}

.house-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 36px 10px 10px;
}

.house-card::before {
  content: "HOUSE STATUS";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 27px;
  padding: 3px 9px;
  color: #fff4c7;
  background: var(--forest);
  border-bottom: 3px solid var(--wood-dark);
  font-family: var(--font-rpg);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0.05em;
}

.house-asset {
  width: 100%;
  max-width: 240px;
  justify-self: center;
  aspect-ratio: 1;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  background: #d8e0bd;
}

.house-asset .asset-fallback {
  background-color: #d8e0bd;
}

.house-asset .house-previous {
  z-index: 3;
  background: #d8e0bd;
}

.house-asset.has-image .house-previous {
  animation: house-swap 560ms steps(1, end) both;
}

.house-copy {
  min-width: 0;
}

.house-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.house-copy strong {
  display: block;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1.04rem;
  line-height: 1.4;
}

.house-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.content-card {
  padding: 22px 16px;
}

.screen-kicker {
  margin-bottom: 9px;
  color: #fff8dc;
  background: var(--forest-2);
}

.screen-title {
  margin: 0;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: clamp(1.55rem, 7vw, 2.3rem);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: 0.025em;
}

.screen-lead {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.tutorial-box,
.year-result,
.comparison-box,
.article-box {
  margin-top: 17px;
  padding: 14px;
  border: 3px solid var(--wood-dark);
  border-radius: 2px;
}

.tutorial-box {
  background: #fff0b6;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.tutorial-haribee-box {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.tutorial-copy {
  min-width: 0;
}

.tutorial-box strong,
.comparison-box > strong {
  color: var(--forest);
  font-family: var(--font-rpg);
}

.tutorial-box ol {
  margin: 8px 0 0;
  padding-left: 1.45rem;
}

.tutorial-box li + li {
  margin-top: 5px;
}

.event-title-window {
  padding: 14px;
  color: #fff8da;
  background: var(--forest);
  border: 3px solid var(--wood-dark);
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.event-title-window .screen-title {
  margin-top: 9px;
  color: #fff8da;
  text-shadow: 3px 3px 0 #0a2118;
}

.tone-badge.bad {
  color: #fff4e0;
  background: var(--bad);
  border-color: #4f1e1d;
}

.tone-badge.good {
  color: #fff8d7;
  background: var(--good);
  border-color: #173d28;
}

.choice-prompt {
  margin-top: 18px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--cream);
  border-left: 5px solid var(--gold);
  font-weight: 700;
}

.decision-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  background: #eee3c4;
  box-shadow: 2px 2px 0 rgba(60, 41, 27, 0.45);
}

.decision-assets-title {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: var(--font-rpg);
  font-size: 0.76rem;
  font-weight: 800;
}

.decision-asset {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.decision-asset strong {
  color: var(--forest);
  font-size: 0.88rem;
  white-space: nowrap;
}

.villager-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.villager-choice {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 138px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 11px 11px 34px;
  border: 3px solid var(--wood-dark);
  border-radius: 2px;
  color: var(--ink);
  background: #fff9e7;
  cursor: pointer;
  text-align: left;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end), background-color 90ms steps(2, end);
}

.villager-choice::before {
  content: "▶";
  position: absolute;
  left: 10px;
  top: 50%;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1rem;
  opacity: 0.32;
  transform: translateY(-50%);
}

.villager-choice:hover,
.villager-choice:focus-visible {
  background: #fff0b8;
}

.villager-choice:hover::before,
.villager-choice:focus-visible::before {
  opacity: 1;
}

.villager-choice:disabled,
.villager-choice:disabled:hover,
.villager-choice:disabled:active {
  opacity: 0.58;
  cursor: not-allowed;
  background: #fff9e7;
  box-shadow: 4px 4px 0 var(--shadow);
  transform: none;
}

.villager-choice:disabled::before {
  opacity: 0.16;
}

.villager-asset {
  width: 84px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  background: #d9e5ca;
}

.villager-asset .asset-fallback {
  padding: 7px;
  background-color: #d9e5ca;
  font-size: 0.74rem;
}

.villager-copy {
  min-width: 0;
}

.villager-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.villager-name-row strong {
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1.04rem;
}

.action-chip {
  color: var(--gold-dark);
  background: var(--gold-light);
  box-shadow: 2px 2px 0 rgba(60, 41, 27, 0.45);
}

.villager-quote {
  display: block;
  margin-top: 7px;
  font-size: 1rem;
  line-height: 1.55;
}

.villager-action-detail {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.villager-amount-detail {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed #a68b5d;
  color: #49614d;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.45;
}

.article-box {
  background: #f3ead0;
  border-color: var(--line);
  border-style: dashed;
}

.article-label {
  display: block;
  color: var(--muted);
  font-family: var(--font-rpg);
  font-size: 0.82rem;
  font-weight: 900;
}

.article-box a,
.article-title {
  display: inline-block;
  margin-top: 3px;
  color: #165272;
  font-weight: 800;
}

.article-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.year-result {
  color: #fff8d9;
  background: #203b2f;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.year-result > strong {
  display: block;
  color: #fff4bf;
  font-family: var(--font-rpg);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.year-result > strong .gain-positive {
  color: #a8e5a6;
}

.year-result > strong .gain-negative {
  color: #ffaaa4;
}

.year-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  align-items: baseline;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed rgba(255, 244, 191, 0.48);
  color: #e9dfbd;
  font-size: 0.82rem;
  line-height: 1.5;
}

.year-result-meta span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
}

.year-result-meta strong {
  color: #fff4bf;
  font-family: var(--font-rpg);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.year-result-meta strong.gain-positive {
  color: #a8e5a6;
}

.year-result-meta strong.gain-negative {
  color: #ffaaa4;
}

.result-grid,
.summary-grid,
.action-count-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.year-result .result-grid {
  grid-template-columns: 1fr;
}

.metric {
  min-width: 0;
  padding: 10px 11px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: #fffaf0;
  box-shadow: inset -2px -2px 0 rgba(111, 73, 40, 0.1);
}

.year-result .metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-color: #d0b46c;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1.04rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.metric strong.gain-positive {
  color: #267246;
}

.metric strong.gain-negative {
  color: #b13b38;
}

.year-result .metric strong {
  flex: 0 0 auto;
  margin-top: 0;
  font-size: 1.08rem;
  text-align: right;
}

.haribee-box {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 15px;
  padding: 13px;
  border: 3px solid var(--forest);
  border-radius: 2px;
  background: #f2eed1;
  box-shadow: 4px 4px 0 var(--shadow);
}

.haribee-asset {
  width: 76px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  background: #c9d8c5;
}

.haribee-asset .asset-fallback {
  padding: 6px;
  color: #244a3b;
  background-color: #c9d8c5;
  font-size: 0.68rem;
}

.haribee-box strong {
  display: inline-block;
  color: #fff6d0;
  background: var(--forest);
  padding: 2px 7px;
  font-family: var(--font-rpg);
  font-size: 0.92rem;
}

.haribee-box p {
  margin: 6px 0 0;
  color: #344b3e;
  font-size: 0.96rem;
  line-height: 1.6;
}

.action-summary {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 3px solid var(--wood-dark);
  border-left: 7px solid var(--gold);
  border-radius: 2px;
  background: #fff2be;
  box-shadow: 3px 3px 0 var(--shadow);
}

.house-level-up {
  position: relative;
  margin-top: 15px;
  padding: 11px 12px 11px 44px;
  color: #fff8d7;
  background: var(--forest);
  border: 3px solid var(--wood-dark);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 2px var(--gold),
    4px 4px 0 var(--shadow);
  animation: level-up 480ms steps(3, end) both;
}

.house-level-up::before {
  content: "★";
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--gold-light);
  font-size: 1.25rem;
  transform: translateY(-50%);
}

.house-level-up span,
.house-level-up strong,
.house-level-up small {
  display: block;
}

.house-level-up span {
  color: var(--gold-light);
  font-family: var(--font-rpg);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.house-level-up strong {
  font-family: var(--font-rpg);
  font-size: 1.04rem;
}

.house-level-up small {
  margin-top: 2px;
  color: #efe3ae;
  font-size: 0.8rem;
}

.milestone-card,
.result-card {
  padding: 23px 16px;
}

.milestone-card {
  text-align: center;
}

.milestone-number {
  margin: 5px 0 0;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: clamp(2.5rem, 12vw, 4.8rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 3px 3px 0 #d8bd70;
}

.milestone-copy {
  margin: 11px 0 0;
  color: var(--muted);
}

.result-heading {
  padding: 14px 10px;
  color: #fff8d9;
  text-align: center;
  background: var(--forest);
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.result-heading .screen-title {
  margin-top: 7px;
  color: #fff8d9;
  text-shadow: 3px 3px 0 #0b241a;
}

.title-ribbon {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 13px;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  color: var(--gold-dark);
  background: var(--gold-light);
  font-family: var(--font-rpg);
  font-weight: 900;
  box-shadow: 3px 3px 0 #0c281d;
}

.play-style-summary {
  margin-top: 12px;
}

.play-style-label,
.play-style-summary small {
  display: block;
}

.play-style-label {
  color: #efe3ae;
  font-family: var(--font-rpg);
  font-size: 0.78rem;
  font-weight: 800;
}

.play-style-summary .title-ribbon {
  margin-top: 5px;
}

.play-style-summary small {
  margin-top: 7px;
  color: #e9dfbd;
  font-size: 0.78rem;
  line-height: 1.45;
}

.summary-grid {
  margin-top: 20px;
}

.summary-grid .metric {
  padding: 12px;
  background: #fff5d9;
}

.summary-grid .metric strong {
  font-size: clamp(1rem, 4.5vw, 1.2rem);
}

.result-allocation {
  margin-top: 10px;
  padding: 10px 12px;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  background: #eee3c4;
  box-shadow: 3px 3px 0 rgba(60, 41, 27, 0.48);
}

.result-allocation-title {
  display: block;
  color: var(--muted);
  font-family: var(--font-rpg);
  font-size: 0.8rem;
  font-weight: 900;
}

.result-allocation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: 7px;
}

.result-allocation-item {
  min-width: 0;
  padding: 7px 9px;
  border: 2px solid #aa9870;
  border-radius: 2px;
  background: #fff8e3;
  text-align: center;
}

.result-allocation-item span,
.result-allocation-item strong {
  display: block;
}

.result-allocation-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.result-allocation-item strong {
  margin-top: 2px;
  color: var(--forest);
  font-family: var(--font-rpg);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.result-allocation-symbol {
  color: var(--wood-dark);
  font-family: var(--font-rpg);
  font-size: 1rem;
  font-weight: 900;
}

.result-allocation > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: center;
}

.result-village-intro {
  margin-top: 27px;
}

.result-village-intro .section-heading {
  margin: 0;
}

.result-village-intro p {
  margin: 10px 2px 12px;
  color: var(--muted);
}

.result-card > .scene-layout {
  margin-bottom: 22px;
}

.comparison-box {
  background: #efe8ca;
  border-color: var(--wood-dark);
  box-shadow: inset 0 0 0 2px #b6a574;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 2px dashed #aa9870;
}

.comparison-row:last-of-type {
  border-bottom: 0;
}

.comparison-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.comparison-row strong {
  text-align: right;
  font-family: var(--font-rpg);
  font-variant-numeric: tabular-nums;
}

.section-heading {
  margin: 26px 0 10px;
  padding: 7px 10px;
  color: #fff8d6;
  background: var(--forest);
  border: 3px solid var(--wood-dark);
  border-left: 7px solid var(--gold);
  border-radius: 2px;
  font-family: var(--font-rpg);
  font-size: 1.15rem;
  line-height: 1.4;
  box-shadow: 3px 3px 0 var(--shadow);
}

.result-detail-section {
  margin-top: 28px;
  padding-top: 3px;
  border-top: 2px dashed rgba(105, 82, 47, 0.42);
}

.result-detail-section .section-heading {
  margin-top: 0;
}

.action-count-grid .metric {
  text-align: center;
}

.timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--wood-dark);
  border-radius: 2px;
  background: #fff8e3;
  box-shadow: 3px 3px 0 rgba(76, 50, 30, 0.72);
}

.timeline-year {
  color: var(--forest);
  font-family: var(--font-rpg);
  font-weight: 900;
}

.timeline-event {
  min-width: 0;
}

.timeline-event strong,
.timeline-event span {
  display: block;
}

.timeline-event strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-event span {
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline-return {
  font-family: var(--font-rpg);
  font-size: 0.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.related-list {
  display: grid;
  gap: 8px;
}

.related-item {
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: #f5ecd4;
}

.related-item a,
.related-item span {
  color: #165272;
  font-weight: 800;
}

.result-house {
  margin-top: 19px;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes event-effect-in {
  0% {
    opacity: 0;
  }
  55% {
    opacity: 0.72;
  }
  100% {
    opacity: 1;
  }
}

@keyframes house-swap {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  35% {
    opacity: 1;
    filter: brightness(1.4);
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes level-up {
  0% {
    filter: brightness(1);
    transform: translateY(4px);
  }
  50% {
    filter: brightness(1.35);
  }
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }
}

.screen-enter {
  animation: screen-in 180ms steps(3, end) both;
}

@media (max-width: 380px) {
  .page-shell {
    padding-inline: 8px;
  }

  .start-wrap {
    padding-inline: 9px;
  }

  .start-banner,
  .start-body,
  .content-card,
  .milestone-card,
  .result-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .fixed-rule {
    padding-inline: 8px;
  }

  .house-card {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .region-label {
    min-width: 3.7rem;
    padding: 2px 4px;
    border-width: 1px;
    box-shadow:
      inset 0 0 0 1px rgba(228, 185, 71, 0.72),
      1px 1px 0 rgba(30, 20, 13, 0.82);
  }

  .region-label span {
    font-size: 0.63rem;
  }

  .region-label strong {
    margin-top: 1px;
    font-size: 0.74rem;
  }

  .map-composition-note {
    font-size: 0.7rem;
  }

  .decision-assets {
    grid-template-columns: 1fr;
  }

  .villager-choice {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 9px;
    padding-left: 30px;
  }

  .villager-asset {
    width: 72px;
  }

  .result-grid,
  .summary-grid,
  .action-count-grid {
    gap: 7px;
  }

  .metric {
    padding-inline: 8px;
  }

  .timeline-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .timeline-return {
    grid-column: 2;
    justify-self: start;
  }
}

@media (min-width: 700px) {
  .page-shell {
    padding: 22px 20px 48px;
  }

  .start-body,
  .content-card,
  .milestone-card,
  .result-card {
    padding: 28px;
  }

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

  .scene-layout {
    grid-template-columns: minmax(0, 4fr) minmax(210px, 1.15fr);
    gap: 14px;
  }

  .map-card {
    padding: 9px;
  }

  .house-card {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .house-asset {
    width: 100%;
  }

  .result-house {
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  }

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

  .villager-choice {
    grid-template-columns: 1fr;
    align-content: start;
    padding: 35px 13px 14px;
  }

  .villager-choice::before {
    top: 12px;
    left: 14px;
    transform: none;
  }

  .villager-asset {
    width: 100%;
    max-width: 138px;
    margin: 0 auto;
  }

  .year-result .result-grid,
  .result-grid,
  .summary-grid,
  .action-count-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .year-result .metric {
    display: block;
  }

  .year-result .metric strong {
    margin-top: 3px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
