:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #243f30;
  background: #f6f5f0;
  font-synthesis: none;
  --green: #1c7a4a;
  --ink: #122b1e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  max-height: 100vh;
  position: relative;
  isolation: isolate;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid #c97718;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
header {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  padding: 0 6%;
  margin: auto;
  gap: 18px;
}
.wordmark {
  font-family: Georgia, serif;
  font-size: 48px;
  letter-spacing: -3px;
  font-weight: bold;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.brand-tagline {
  margin: 0;
  color: #52664c;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.1;
}
.brand-dot {
  color: var(--green);
}
.header-note {
  font-size: 12px;
  color: #657464;
  display: flex;
  align-items: center;
  gap: 9px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #699461;
}
.text-button {
  border: 0;
  background: transparent;
  color: #34543c;
  padding: 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.text-button:hover {
  text-decoration: underline;
}
.message {
  text-align: center;
  padding: 45px 20px 15px;
  position: relative;
  z-index: 1;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 2.5px;
  font-weight: 600;
  color: #66755f;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -5px;
  font-size: clamp(64px, 8vw, 112px);
  line-height: 1.1;
  font-weight: 400;
  margin: 22px 0;
}
h1 span {
  color: var(--green);
}
.intro {
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.55;
  color: #405744;
  font-weight: 500;
  margin: 0;
}
.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 20px auto 8px;
}
.invitation {
  font-size: 15px;
  margin: 0;
  color: #2f4e37;
  font-weight: 700;
  text-align: right;
}
.tiny-sprout {
  color: #719663;
  font-size: 22px;
  vertical-align: middle;
  margin-right: 7px;
}
.primary {
  border: 1px solid var(--green);
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  padding: 15px 23px;
  box-shadow: 0 4px 0 #155d39;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}
#start {
  white-space: nowrap;
}
.primary:hover {
  background: #15613a;
}
.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #155d39;
}
.micro {
  font-size: 13px;
  line-height: 1.45;
  color: #5a6b5c;
  margin: 0;
  font-weight: 600;
}
.landscape {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.sun {
  position: absolute;
  top: 42%;
  right: 12%;
  width: 85px;
  height: 85px;
  background: #eee5b3;
  border-radius: 50%;
  opacity: 0.6;
}
.hill {
  position: absolute;
  width: 150%;
  height: 420px;
  bottom: 0;
  left: -25%;
  border-radius: 50% 50% 0 0;
}
.hill-back {
  background: #e8eddf;
  transform: rotate(-5deg);
  bottom: -90px;
}
.hill-front {
  background: #dce5cf;
  transform: rotate(6deg);
  bottom: -240px;
}
.garden {
  max-width: 1160px;
  margin: 20px auto 0;
  position: relative;
  padding: 0 30px;
}
.game-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}
.game-name {
  font: 10px monospace;
  letter-spacing: 1.5px;
  color: #758369;
  display: flex;
  gap: 10px;
  align-items: center;
}
.edition {
  letter-spacing: 0;
  color: #84917b;
}
.hud {
  position: absolute;
  top: 48px;
  left: 40px;
  right: 40px;
  display: flex;
  justify-content: space-between;
  font: 11px monospace;
  color: #3c6244;
  pointer-events: none;
}
.hud strong {
  font-size: 17px;
}
#plants {
  color: #c07035;
  letter-spacing: 4px;
}
canvas {
  display: block;
  width: 100%;
  height: 270px;
  outline: none;
  touch-action: pan-y;
}
.game-caption {
  text-align: center;
  font: 11px monospace;
  color: #748367;
  margin-top: -8px;
  min-height: 20px;
}
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: #425a47;
  font-weight: 700;
  letter-spacing: 0.025em;
  margin: 24px 0;
}
.controls > span {
  white-space: nowrap;
}
kbd {
  font: 10px monospace;
  border: 1px solid #bfc9b3;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 5px 7px;
  margin-right: 6px;
  background: #f6f5f080;
}
.controls-note {
  margin-left: 14px;
  font-size: 12px;
  color: #52664c;
  font-weight: 800;
}
.touch-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px;
}
.touch-controls button {
  min-height: 48px;
  border: 1px solid #92aa85;
  background: #f6f5f0;
  border-radius: 8px;
  padding: 12px 26px;
  color: var(--ink);
  touch-action: manipulation;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 6%;
  font-size: 10px;
  color: #708166;
  max-width: 1440px;
  margin: auto;
}
footer strong {
  font-family: Georgia, serif;
  font-size: 17px;
  margin-left: 4px;
}
dialog {
  border: 1px solid #e3e6da;
  border-radius: 16px;
  padding: 36px;
  width: min(440px, calc(100% - 30px));
  color: var(--ink);
  background: #fbfaf6;
  box-shadow: 0 20px 100px #122b1e26;
  max-height: 85svh;
}
dialog::backdrop {
  background: #122b1e66;
  backdrop-filter: blur(4px);
}
h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 32px;
  margin: 16px 0;
}
dialog p {
  font-size: 14px;
  line-height: 1.6;
}
.close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: none;
  font-size: 27px;
  color: #52664c;
  padding: 4px 10px;
}
label {
  display: block;
  font-size: 13px;
  margin: 24px 0 9px;
}
input {
  width: 100%;
  border: 1px solid #bdc9b6;
  padding: 12px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
#board {
  padding: 0;
  list-style: none;
  counter-reset: rank;
}
#board li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #e3e6da;
  font-size: 13px;
}
#board li:before {
  content: counter(rank, decimal-leading-zero);
  font: 12px monospace;
  color: #87937c;
}
#board li strong {
  margin-left: auto;
  font: 600 14px monospace;
}
.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;
}
body.playing .message {
  opacity: 0.65;
}
body.playing .garden {
  background: #f6f5f040;
  border-radius: 12px;
}
@media (min-height: 900px) {
  .message {
    padding-top: 65px;
  }
  .garden {
    margin-top: 45px;
  }
  canvas {
    height: 300px;
  }
}
@media (max-width: 650px) {
  header {
    height: 86px;
    padding: 0 6%;
  }
  .wordmark {
    font-size: 39px;
  }
  .brand-tagline {
    font-size: 11px;
    letter-spacing: 0.02em;
  }
  .header-note {
    display: none;
  }
  .message {
    padding-top: 28px;
  }
  h1 {
    letter-spacing: -3px;
    margin: 22px 0;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.6px;
  }
  .intro {
    font-size: 16px;
    line-height: 1.45;
    max-width: 340px;
    margin: auto;
  }
  .intro br {
    display: none;
  }
  .invitation {
    font-size: 13px;
    margin: 0;
  }
  .micro {
    font-size: 11px;
  }
  .cta-row {
    gap: 12px;
    margin: 12px auto 4px;
  }
  .garden {
    padding: 0 12px;
    margin-top: 25px;
  }
  .edition,
  .controls-note {
    display: none;
  }
  canvas {
    height: 230px;
  }
  .controls {
    gap: 15px;
    margin: 20px 0;
    font-size: 12px;
  }
  .hud {
    left: 22px;
    right: 22px;
  }
  .game-name {
    font-size: 9px;
    letter-spacing: 1px;
  }
  footer {
    padding-top: 16px;
    font-size: 9px;
  }
  .sun {
    right: 4%;
    width: 55px;
    height: 55px;
    top: 49%;
  }
  .hill-back {
    bottom: -55px;
  }
  .hill-front {
    bottom: -210px;
  }
  dialog {
    padding: 28px;
  }
}
/* Budget vertical space by viewport height, including a narrow laptop panel.
   Preserve the full jump area and readable controls instead of clipping overflow. */
@media (max-height: 899px) {
  header {
    height: clamp(54px, 8svh, 66px);
  }
  .wordmark {
    font-size: 38px;
  }
  .message {
    padding: 0 20px;
  }
  .message .eyebrow {
    margin: 6px 0;
  }
  h1 {
    font-size: clamp(48px, 8svh, 68px);
    letter-spacing: -3px;
    margin: 6px 0 10px;
  }
  .intro {
    font-size: clamp(15px, 2.4svh, 18px);
    line-height: 1.5;
  }
  .cta-row {
    margin: 8px auto 4px;
  }
  .invitation {
    margin: 0;
  }
  .message .primary {
    padding: 10px 21px;
    min-height: 40px;
  }
  .message .micro {
    margin: 0;
  }
  .garden {
    margin-top: 0;
  }
  .game-topline {
    min-height: 44px;
  }
  canvas {
    height: 225px;
  }
  .controls {
    flex-wrap: wrap;
    row-gap: 14px;
    margin: 10px 0;
    min-height: 24px;
  }
  .touch-controls {
    margin: 10px 0;
  }
  footer {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}
@media (min-width: 651px) and (pointer: fine) {
  .touch-controls {
    display: none;
  }
}
.pause-button {
  border: 1px solid #92aa85;
  border-radius: 8px;
  background: #fbfaf6;
  color: #243f30;
  padding: 10px 18px;
  min-height: 44px;
  font-weight: 600;
}
.pause-overlay {
  position: absolute;
  inset: 100px 20px auto;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #f6f5f0ed;
  border: 1px solid #d4dfc9;
  border-radius: 12px;
  z-index: 2;
}
#spray {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 650px) {
  .hud {
    font-size: 9px;
    gap: 8px;
    top: 58px;
  }
  .hud strong {
    font-size: 14px;
  }
  #plants {
    letter-spacing: 1px;
  }
}
#board-sort {
  width: 100%;
  padding: 10px;
  border: 1px solid #bdc9b6;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}
#board-sort:focus-visible {
  outline: 3px solid #c97718;
  outline-offset: 3px;
}
.board-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
#board li strong {
  white-space: nowrap;
}
.board-time {
  flex-shrink: 0;
  min-width: 5ch;
  text-align: right;
  font: 13px monospace;
  color: #52664c;
}

/* Every screen is one viewport: the canvas yields space to the instructions.
   min-height: 0 lets the flex/grid children shrink below their content size. */

body {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
header,
footer {
  flex: none;
  width: 100%;
  margin: 0 auto;
}
main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.message {
  flex: none;
}
.garden {
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) auto auto auto;
}
canvas {
  height: 100%;
  min-height: 0;
}
.game-caption {
  margin-top: 0;
}
.controls {
  flex-wrap: wrap;
  margin: 10px 0;
  row-gap: 12px;
  min-height: 24px;
}
.pause-overlay {
  top: 64px;
  min-height: 0;
  padding: 12px;
}

@media (max-height: 560px) {
  header {
    height: 40px;
  }
  .wordmark {
    font-size: 30px;
  }
  .brand-tagline {
    font-size: 9px;
  }
  .message .eyebrow {
    margin: 2px 0;
  }
  h1 {
    font-size: 34px;
    margin: 2px 0 4px;
  }
  .intro {
    font-size: 13px;
    line-height: 1.3;
  }
  .cta-row {
    margin: 4px auto 2px;
    gap: 10px;
  }
  .invitation {
    margin: 4px 0;
    font-size: 11px;
  }
  .message .primary {
    min-height: 32px;
    padding: 6px 16px;
  }
  .message .micro {
    margin: 0;
    font-size: 10px;
  }
  .controls {
    font-size: 10px;
    gap: 8px;
    margin: 6px 0;
  }
  .touch-controls {
    margin: 4px 0;
  }
  footer {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}
