:root {
  color-scheme: light;
  --ink: #241d17;
  --muted: #6f665a;
  --paper: #faf5e6;
  --panel: #fffdf5;
  --leaf: #286741;
  --leaf-dark: #183f2a;
  --apple: #cf2f25;
  --gold: #e69d26;
  --line: #d9dfbf;
  --shadow: 0 18px 48px rgba(38, 31, 20, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(230, 157, 38, 0.18), transparent 320px),
    linear-gradient(180deg, #eef4dc 0%, var(--paper) 48%, #f4ecd4 100%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
}

.splash,
.ending {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: stretch;
}

.splash-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #dfe9c7;
}

.splash-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(250, 245, 230, 0) 50%, var(--paper) 100%);
}

.splash-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 44% center;
  filter: saturate(1.06);
}

.splash-copy,
.ending {
  padding: clamp(28px, 6vw, 72px);
}

.splash-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  background: rgba(250, 245, 230, 0.82);
}

.logo-mark {
  width: 104px;
  height: 104px;
  border: 4px solid #89ba28;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f2d8;
  box-shadow: 0 10px 22px rgba(39, 69, 20, 0.22);
}

.eyebrow {
  margin: 18px 0 8px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-block-start: 0;
}

h1 {
  max-width: 9ch;
  margin-block-end: 16px;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-block-end: 10px;
  font-size: clamp(1.45rem, 4vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

p {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.primary-button,
.icon-button,
.home-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fffaf0;
  font-weight: 900;
  background: var(--leaf-dark);
  text-decoration: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  padding: 0 22px;
  margin-block-start: 10px;
}

.primary-button:hover,
.primary-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.home-link:hover,
.home-link:focus-visible {
  outline: 3px solid rgba(230, 157, 38, 0.36);
  outline-offset: 3px;
}

.game {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  width: min(1240px, 100%);
  margin: 0 auto 18px;
}

.topbar h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.topbar .eyebrow {
  margin-block-start: 0;
}

.home-link {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
}

.icon-button {
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  gap: 18px;
  width: min(1240px, 100%);
  margin: 0 auto;
}

.orchard-panel,
.ledger {
  border: 1px solid rgba(98, 122, 56, 0.28);
  border-radius: 8px;
  background: rgba(255, 253, 245, 0.82);
  box-shadow: var(--shadow);
}

.orchard-panel {
  overflow: hidden;
}

.stage-feature {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(223, 233, 199, 0.7), rgba(255, 253, 245, 0.4)),
    #eef4dc;
}

.solo-card,
.person-card,
.specialist-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.solo-card {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.94fr);
  gap: 18px;
  align-items: stretch;
  padding: 12px;
}

.solo-image-wrap {
  display: grid;
  min-height: 430px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.65), transparent 260px),
    #dfe9c7;
  place-items: center;
}

.solo-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: cover;
  object-position: center;
}

.solo-card-copy {
  display: grid;
  gap: 14px;
  padding: 10px;
}

.solo-card-copy h3 {
  margin: 0;
  font-size: 2.15rem;
  line-height: 1;
}

.solo-card-copy p {
  margin: 0;
}

.mood-badge {
  justify-self: start;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--leaf);
}

.mood-badge.tired {
  background: var(--gold);
}

.mood-badge.broken {
  background: var(--apple);
}

.tutorial-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.tutorial-list li {
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: #f7f2df;
}

.band-grid,
.specialist-grid {
  display: grid;
  gap: 12px;
}

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

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

.person-card,
.specialist-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  padding: 10px;
}

.person-card {
  grid-template-rows: minmax(160px, 220px) 1fr auto;
  min-height: 360px;
}

.person-card img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center top;
  background: #e9ecd4;
}

.specialist-open {
  display: grid;
  grid-template-rows: minmax(145px, 178px) auto auto auto auto;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.specialist-open img {
  width: 100%;
  height: 100%;
  min-height: 145px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center top;
  background: #e9ecd4;
}

.specialist-open span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.specialist-open strong {
  font-size: 1.18rem;
  line-height: 1.08;
}

.specialist-open small {
  color: var(--muted);
  line-height: 1.25;
}

.specialist-card .segmented-control {
  min-height: 34px;
}

.specialist-card .segmented-control button {
  min-width: 0;
}

.detail-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 360px);
}

.person-copy,
.specialist-copy {
  display: grid;
  gap: 5px;
}

.person-copy span,
.specialist-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.person-copy strong,
.specialist-copy strong {
  font-size: 1.18rem;
}

.person-copy small,
.specialist-copy small,
.specialist-copy p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.specialist-copy p {
  margin: 0;
}

.hierarchy-view {
  display: grid;
  gap: 12px;
}

.focus-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(280px, 1.05fr);
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.focus-panel > img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center top;
  background: #e9ecd4;
}

.focus-copy {
  display: grid;
  align-content: center;
  gap: 12px;
}

.focus-copy span,
.tile-open span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.focus-copy h3 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 0.98;
}

.focus-copy p {
  margin: 0;
}

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

.summary-stats div {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f2df;
}

.summary-stats dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.summary-stats dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.2;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.individual-tile-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.nav-tile {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 154px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf7;
}

.tile-open {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.tile-open img {
  grid-row: span 5;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  background: #e9ecd4;
}

.tile-open strong {
  font-size: 1.08rem;
  line-height: 1.1;
}

.tile-open small {
  color: var(--muted);
  line-height: 1.3;
}

.nav-tile .segmented-control {
  min-height: 36px;
}

.nav-tile .segmented-control button {
  min-width: 0;
}

.individual-tile-grid .nav-tile {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.54fr);
  align-items: center;
  min-height: 82px;
  padding: 8px;
}

.individual-tile-grid .tile-open {
  grid-template-columns: 56px minmax(0, 1fr);
  min-height: 64px;
  gap: 8px;
  padding: 2px;
}

.individual-tile-grid .tile-open img {
  grid-row: span 4;
  width: 56px;
  height: 56px;
  border-radius: 7px;
}

.individual-tile-grid .tile-open strong {
  font-size: 1rem;
}

.individual-tile-grid .tile-open small {
  line-height: 1.2;
}

.individual-tile-grid .nav-tile .segmented-control {
  min-height: 34px;
}

.tile-open:hover,
.tile-open:focus-visible,
.specialist-open:hover,
.specialist-open:focus-visible,
.breadcrumb-row button:hover,
.breadcrumb-row button:focus-visible {
  border-color: var(--leaf);
  outline: 3px solid rgba(40, 103, 65, 0.16);
  outline-offset: 2px;
}

.breadcrumb-row {
  display: flex;
}

.breadcrumb-row button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--leaf-dark);
  font-weight: 900;
  background: #fffdf7;
}

.orchard-copy {
  padding: 22px 22px 0;
}

.orchard-copy .eyebrow {
  margin-block-start: 0;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px 22px 22px;
}

.stat span,
.meter-label span,
.georgie-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ece6d2;
}

.segmented-control.option-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control button {
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
  background: transparent;
}

.segmented-control button:disabled {
  color: rgba(111, 102, 90, 0.48);
  background: transparent;
}

.segmented-control button.is-active {
  color: #fffaf0;
  background: var(--leaf-dark);
  box-shadow: 0 3px 10px rgba(36, 29, 23, 0.14);
}

.segmented-control button:hover,
.segmented-control button:focus-visible {
  outline: 3px solid rgba(40, 103, 65, 0.16);
  outline-offset: 1px;
}

.chief-policy {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f2df;
}

.chief-policy p {
  max-width: none;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.resource-policy-row {
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr;
  gap: 8px;
  align-items: center;
}

.resource-policy-row > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.resource-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.resource-toggle {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  background: #fffdf7;
}

.resource-toggle.is-active {
  color: #fffaf0;
  border-color: var(--leaf-dark);
  background: var(--leaf-dark);
}

.resource-toggle:hover,
.resource-toggle:focus-visible {
  outline: 3px solid rgba(40, 103, 65, 0.16);
  outline-offset: 1px;
}

.end-day-button {
  display: grid;
  min-height: 142px;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  color: #fffaf0;
  text-align: left;
  background: var(--leaf-dark);
}

.end-day-button span,
.end-day-button small {
  color: rgba(255, 250, 240, 0.78);
}

.end-day-button strong {
  font-size: 1.2rem;
}

.end-day-button:focus-visible,
.end-day-button:hover {
  outline: 3px solid rgba(230, 157, 38, 0.36);
  outline-offset: 3px;
}

.ledger {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

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

.stat {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.stat strong {
  display: block;
  margin-block-start: 4px;
  font-size: 1.9rem;
  line-height: 1;
}

.meter-block {
  display: grid;
  gap: 8px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5dfcb;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--apple), var(--gold), #82ad2d);
  transition: width 220ms ease;
}

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

.status-strip span {
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fffdf7;
}

.status-strip strong {
  color: var(--ink);
}

.georgie-list h2,
.log h2 {
  margin-block-end: 10px;
  font-size: 1.08rem;
}

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

.georgie-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.georgie-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.georgie-card strong {
  display: block;
}

.georgie-card.happy {
  border-color: rgba(111, 160, 28, 0.42);
}

.georgie-card.tired {
  border-color: rgba(230, 157, 38, 0.5);
}

.georgie-card.broken {
  border-color: rgba(207, 47, 37, 0.48);
}

.log ol {
  display: grid;
  gap: 8px;
  max-height: 170px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.log li {
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  color: var(--muted);
  background: #fffdf7;
  line-height: 1.35;
}

.debug-panel h2 {
  margin-block-end: 10px;
  font-size: 1.08rem;
}

.debug-panel pre {
  max-height: 280px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(98, 122, 56, 0.28);
  border-radius: 8px;
  color: #123121;
  background: #edf5e2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ending {
  grid-template-columns: minmax(320px, 720px);
  align-content: center;
  justify-content: center;
  text-align: left;
}

.ending h1 {
  max-width: 11ch;
}

.ending-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 20px;
}

.ending-stats span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

[hidden] {
  display: none !important;
}

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

  .splash-art {
    min-height: 42vh;
  }

  .splash-art::after {
    background: linear-gradient(180deg, rgba(250, 245, 230, 0), var(--paper));
  }

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

  .solo-card,
  .focus-panel,
  .specialist-grid {
    grid-template-columns: 1fr;
  }

  .solo-image-wrap {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  .game {
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .home-link {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .action-grid,
  .stat-grid,
  .georgie-grid,
  .status-strip,
  .band-grid,
  .tile-grid,
  .individual-tile-grid,
  .summary-stats {
    grid-template-columns: 1fr;
  }

  .stage-feature {
    padding: 10px;
  }

  .individual-tile-grid .nav-tile {
    grid-template-columns: 1fr;
  }

  .solo-card-copy h3 {
    font-size: 1.75rem;
  }

  .splash-copy,
  .ending {
    padding: 24px 18px;
  }

  h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }
}
