:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #e6e9d9;
  background: #111c19;
  font-synthesis: none;
  --muted: #95a99b;
  --line: #314238;
  --cream: #e4e9cf;
  --accent: #b8cf89;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a,
summary,
input,
label {
  -webkit-tap-highlight-color: transparent;
}
button,
summary,
.file-button {
  font: inherit;
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  color: inherit;
  background: #1b2b24;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 16px;
}
button:hover {
  background: #2b3d30;
  border-color: #66805c;
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
label:focus-within,
canvas:focus-visible {
  outline: 2px solid #d3e9a0;
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
.app {
  min-height: 100dvh;
  max-width: 1560px;
  margin: auto;
  padding: 20px 28px max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.identity {
  display: flex;
  gap: 26px;
  align-items: center;
}
.brand {
  font-size: 11px;
  letter-spacing: 0.19em;
  font-weight: 700;
  white-space: nowrap;
}
.brand span {
  color: #c2d492;
  margin-left: 8px;
  border-left: 1px solid #5d6e54;
  padding-left: 10px;
}
h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.03em;
  margin: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.study,
.menu-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
details {
  position: relative;
  z-index: 5;
}
summary {
  list-style: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  letter-spacing: 3px;
}
summary::-webkit-details-marker {
  display: none;
}
.menu {
  position: absolute;
  right: 0;
  top: 52px;
  background: #1b2a23;
  box-shadow: 0 16px 50px #0007;
  border: 1px solid #475a46;
  border-radius: 12px;
  padding: 14px;
  width: 270px;
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
}
.menu button,
.file-button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  min-height: 42px;
  padding: 8px;
}
.menu button:hover,
.file-button:hover {
  background: #2b3c2e;
}
.menu p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 6px 8px;
}
.menu .menu-label {
  font-size: 9px;
  margin-bottom: 8px;
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px;
}
.menu form {
  margin: 12px 8px;
}
.menu form label {
  font-size: 12px;
  color: var(--cream);
}
.seed-entry {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.seed-entry input {
  width: 0;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px;
  color: var(--cream);
  background: #111c19;
  border: 1px solid #657458;
  border-radius: 6px;
  font:
    13px ui-monospace,
    monospace;
}
.seed-entry button {
  width: auto;
  background: #31432b;
  min-height: 44px;
}
.menu #seed-help,
.menu #seed-error {
  margin: 6px 0 0;
}
.menu #seed-error {
  color: #edb48f;
}
#seed-error:empty {
  display: none;
}
.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.stage {
  position: relative;
  flex: 1 0 clamp(320px, 53svh, 620px);
  min-height: 180px;
  border: 1px solid #43513c;
  border-radius: 14px;
  overflow: hidden;
  background: #17261f;
  isolation: isolate;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  position: absolute;
  inset: 0;
}
.field-label {
  position: absolute;
  top: 18px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #b1c0a6;
  pointer-events: none;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c4d88a;
  box-shadow: 0 0 10px #b4d08266;
}
.prototype {
  border-left: 1px solid #657458;
  padding-left: 10px;
  color: #8fa184;
  font-size: 9px;
}
.view-controls {
  position: absolute;
  right: 14px;
  top: 12px;
  display: flex;
  gap: 6px;
}
.view-controls button {
  background: #18251ed9;
  backdrop-filter: blur(6px);
  border-color: #4c604955;
  font-size: 11px;
  padding: 6px 12px;
  min-height: 38px;
}
.invitation {
  position: absolute;
  left: 22px;
  top: 66px;
  pointer-events: none;
}
.invitation p {
  font-family: Georgia, serif;
  color: #e1e7ce;
  font-size: 20px;
  line-height: 1.35;
  margin: 0 0 14px;
  text-shadow: 0 2px 12px #0d1712;
}
.invitation button {
  pointer-events: auto;
  background: var(--cream);
  border-color: var(--cream);
  color: #243324;
  font-size: 12px;
  font-weight: 650;
  padding: 9px 14px;
  box-shadow: 0 4px 20px #0002;
}
.invitation button:hover {
  background: #f1f4db;
}
.invitation button span {
  margin-left: 16px;
  font-size: 18px;
}
.readout {
  position: absolute;
  bottom: 15px;
  left: 20px;
  display: flex;
  gap: 20px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: #b6c1a7;
  background: #16231dd9;
  padding: 8px 11px;
  border-radius: 6px;
  pointer-events: none;
}
.readout span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.readout b {
  font-weight: 500;
  color: #e3e8d0;
}
.readout i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 3px;
}
.water-dot {
  background: #82b6bb;
}
.plant-dot {
  background: #a5c574;
}
#toast {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  background: #e4e9d1;
  color: #213021;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  max-width: calc(100% - 24px);
  width: max-content;
  box-shadow: 0 5px 30px #0004;
  pointer-events: none;
}
#toast:empty {
  display: none;
}
.soil-reading {
  position: absolute;
  top: 58px;
  right: 14px;
  max-width: 210px;
  padding: 7px 9px;
  border: 1px solid #52665399;
  border-radius: 6px;
  background: #15231dd9;
  color: #b9c8ab;
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
  pointer-events: none;
}
.soil-reading:empty {
  display: none;
}
.toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.tools {
  display: flex;
  gap: 6px;
}
.tools button {
  border-color: transparent;
  background: transparent;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 17px;
}
.tools button[aria-pressed='true'] {
  background: #31432b;
  border-color: #6c8151;
  color: #e2edba;
}
.tool-icon {
  font-size: 27px;
  line-height: 1;
  width: 24px;
  font-weight: 400;
  color: #bcc3a8;
}
.water-icon {
  color: #8ab9c1;
}
.seed-icon {
  color: #a6c775;
}
.fire-icon {
  color: #e4a477;
}
.divider {
  width: 1px;
  height: 30px;
  background: var(--line);
  margin: 0 5px;
}
#size,
#rain {
  font-size: 12px;
  background: transparent;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brush-mark {
  font-size: 13px;
  color: #a4b48f;
}
#rain > span {
  font-size: 23px;
  color: #94bec0;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  min-height: 16px;
}
.explore-hint {
  font-size: 9px;
  letter-spacing: 0.1em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 760px) {
  .app {
    padding: 12px 12px max(10px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .identity {
    gap: 12px;
  }
  .brand {
    font-size: 9px;
    letter-spacing: 0.12em;
  }
  .brand span {
    margin-left: 4px;
    padding-left: 6px;
  }
  h1 {
    font-size: 25px;
  }
  .study,
  .explore-hint {
    display: none;
  }
  .header-actions {
    gap: 0;
  }
  .stage {
    border-radius: 11px;
  }
  .field-label {
    top: 15px;
    left: 14px;
    font-size: 9px;
  }
  .prototype {
    display: none;
  }
  .view-controls {
    top: 8px;
    right: 8px;
    gap: 3px;
  }
  .soil-reading {
    top: 52px;
    right: 9px;
    max-width: 165px;
    font-size: 9px;
  }
  body[data-lens='true'] #hint {
    visibility: hidden;
  }
  .view-controls button {
    font-size: 10px;
    padding: 5px 9px;
  }
  .invitation {
    top: 58px;
    left: 15px;
  }
  .invitation p {
    font-size: 18px;
    margin-bottom: 10px;
  }
  .invitation button {
    font-size: 11px;
    padding: 7px 11px;
    min-height: 40px;
  }
  .readout {
    left: 12px;
    bottom: 12px;
    gap: 12px;
    font-size: 9px;
  }
  .toolbar {
    gap: 7px;
    flex-wrap: wrap;
  }
  .tools {
    width: 100%;
    justify-content: space-between;
    gap: 3px;
  }
  .tools button {
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 7px 4px;
    font-size: 10px;
    min-height: 60px;
  }
  .tools .tool-icon {
    font-size: 25px;
    width: auto;
  }
  .divider {
    display: none;
  }
  #size,
  #rain {
    min-height: 36px;
    border: 0;
    font-size: 11px;
    padding: 4px 18px;
  }
  footer {
    justify-content: center;
    font-size: 10px;
    text-align: center;
  }
  #toast {
    bottom: 48px;
    font-size: 11px;
  }
  .menu {
    width: min(280px, calc(100vw - 32px));
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .app {
    padding: 8px 14px;
    gap: 7px;
    min-height: 0;
  }
  .header h1 {
    font-size: 23px;
  }
  .brand {
    font-size: 9px;
  }
  .study,
  footer {
    display: none;
  }
  .identity {
    gap: 15px;
  }
  .header-actions summary {
    height: 34px;
  }
  .toolbar {
    flex-wrap: nowrap;
  }
  .tools {
    width: auto;
  }
  .tools button {
    flex-direction: row;
    min-height: 40px;
    padding: 6px 10px;
    font-size: 11px;
  }
  .toolbar #size,
  .toolbar #rain {
    min-height: 36px;
  }
  .invitation {
    top: 50px;
  }
  .invitation p {
    font-size: 15px;
  }
  .field-label {
    top: 13px;
  }
  .readout {
    bottom: 9px;
  }
  .stage {
    min-height: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  button:active {
    transform: none;
  }
}

.season-strip {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  padding: 10px 14px;
  border: 1px solid #43513c;
  border-radius: 10px;
  background: #18251f;
}
.season-mark {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 9px;
}
.season-kicker {
  grid-column: 1 / -1;
  color: #91a68f;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.season-mark strong {
  color: var(--cream);
  font:
    400 24px Georgia,
    'Times New Roman',
    serif;
}
#season-year {
  color: var(--muted);
  font-size: 11px;
}
.season-track {
  min-width: 0;
}
#season-progress {
  display: block;
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}
#season-progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #27382e;
}
#season-progress::-webkit-progress-value {
  border-radius: 99px;
  background: var(--accent);
}
#season-progress::-moz-progress-bar {
  border-radius: 99px;
  background: var(--accent);
}
#season-note {
  margin: 6px 0 0;
  color: #b9c6af;
  font-size: 12px;
  line-height: 1.35;
}
#fast {
  min-width: 62px;
  min-height: 38px;
  color: #dbe7bd;
  background: #2b3d2d;
  border-color: #6b8157;
  font:
    600 12px ui-monospace,
    monospace;
}
body[data-season='rain'] .season-strip {
  border-color: #4f7980;
  background: linear-gradient(100deg, #182a28, #19251f);
}
body[data-season='rain'] #season-progress {
  accent-color: #8abfc3;
}
body[data-season='rain'] #season-progress::-webkit-progress-value {
  background: #8abfc3;
}
body[data-season='dry'] .season-strip {
  border-color: #806d49;
  background: linear-gradient(100deg, #2b281c, #202319);
}
body[data-season='dry'] #season-progress {
  accent-color: #d2ad68;
}
body[data-season='dry'] #season-progress::-webkit-progress-value {
  background: #d2ad68;
}
body[data-season='recovery'] .season-strip {
  border-color: #6f8060;
  background: linear-gradient(100deg, #202d22, #19251f);
}
body[data-season='recovery'] #season-progress {
  accent-color: #b8cf89;
}
.journal-panel {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: 20px;
  padding: 14px 16px;
  border: 1px solid #43513c;
  border-radius: 10px;
  background: #16221c;
}
.journal-lead h2 {
  margin: 4px 0 10px;
  color: var(--cream);
  font:
    400 22px/1.1 Georgia,
    'Times New Roman',
    serif;
}
.journal-lead label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #b3c1aa;
  font-size: 12px;
}
#intention {
  min-height: 38px;
  max-width: 100%;
  padding: 7px 30px 7px 9px;
  color: var(--cream);
  background: #223127;
  border: 1px solid #5a7050;
  border-radius: 6px;
  font: inherit;
}
#intention:focus-visible {
  outline: 2px solid #d3e9a0;
  outline-offset: 3px;
}
#intention-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.journal-ledger {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
#journal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}
#journal li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 8px 9px;
  border: 1px solid #344a3a;
  border-radius: 6px;
  background: #1d2c23;
}
#journal li span {
  color: #9bb37d;
  font:
    10px ui-monospace,
    monospace;
  white-space: nowrap;
}
#journal li strong,
#journal li p {
  grid-column: 2;
}
#journal li strong {
  color: #dce8c3;
  font-size: 12px;
  font-weight: 600;
}
#journal li p {
  margin: -3px 0 0;
  color: #9caf9d;
  font-size: 11px;
  line-height: 1.35;
}
#journal-empty {
  margin: 8px 0 0;
  color: #829584;
  font-size: 12px;
  font-style: italic;
}
@media (max-width: 760px) {
  .stage {
    flex-basis: clamp(285px, 48svh, 460px);
  }
  .season-strip {
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 58px;
    padding: 8px 10px;
  }
  .season-mark strong {
    font-size: 20px;
  }
  #season-note {
    font-size: 10px;
  }
  .journal-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .journal-ledger {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }
  #journal {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 430px) {
  .season-strip {
    grid-template-columns: 1fr auto;
  }
  .season-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .season-mark {
    grid-column: 1;
  }
  #fast {
    grid-column: 2;
    grid-row: 1;
  }
}
