@font-face {
  font-family: Garden;
  src: local("Avenir Next"), local("Avenir"), local("Arial");
  font-display: swap;
}
:root {
  --ink: #f1f4e8;
  --muted: #b6beae;
  --lime: #d4ed8a;
  --line: rgba(234, 242, 216, 0.2);
  --dark: #18261edb;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #19251c;
  color: var(--ink);
  font-family: Garden, Arial, sans-serif;
}
body,
button {
  text-transform: uppercase;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 5px;
}
.about-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  width: fit-content;
  min-height: 36px;
  margin-top: 10px;
  color: #e3eacf;
  font-size: 9px;
  letter-spacing: .08em;
  text-decoration: none;
  pointer-events: auto;
}
.about-link span { color: var(--lime); }
.about-link:hover span { text-decoration: underline; text-underline-offset: 4px; }
.about-link:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.pause-about { margin-inline: auto; justify-content: center; text-align: center; }
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.hidden {
  display: none !important;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(7, 20, 14, 0.38),
      transparent 22%,
      transparent 70%,
      rgba(7, 20, 14, 0.62)
    ),
    radial-gradient(ellipse at center, transparent 45%, #081a1729 100%);
}
#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  border: 0 solid #e0edb244;
  transition: border-width 0.1s;
}
#flash.hit {
  border-width: 5px;
}
.topbar {
  position: absolute;
  inset: 28px 34px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}
.wordmark {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.21em;
  text-shadow: 0 2px 10px #15251866;
}
.brand-mark {
  color: var(--lime);
  font-size: 43px;
  font-weight: 400;
  line-height: 1;
}
.wordmark small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.25em;
  line-height: 2;
  color: #d5dcca;
}
.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}
.top-actions button {
  color: var(--ink);
  background: #1a2a2355;
  border: 1px solid var(--line);
  height: 37px;
  padding: 0 14px;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0.09em;
  backdrop-filter: blur(10px);
}
.top-actions button:hover {
  background: #34412bd9;
}
#pause {
  font-size: 18px;
  padding: 0 13px;
}
.weather {
  font-size: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: 14px;
  color: #f3e9b1;
}
.weather span {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--ink);
}
.screen {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    90deg,
    #071b17c9 0%,
    #14281a55 45%,
    transparent 85%
  );
}
.intro {
  position: absolute;
  left: 8%;
  top: 27%;
  max-width: 650px;
}
.pill {
  display: inline-block;
  border: 1px solid #e4eed13b;
  background: #b6d06b11;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #e1eacb;
}
.intro h1 {
  font-size: clamp(48px, 6.4vw, 98px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin: 24px 0;
}
.intro em,
.victory em {
  font-style: normal;
  color: var(--lime);
}
.intro p {
  font-size: 12px;
  letter-spacing: 0.07em;
  line-height: 1.9;
  color: #e5eada;
  font-weight: 500;
  margin: 24px 0;
}
.primary {
  border: 0;
  border-radius: 5px;
  background: var(--lime);
  color: #233023;
  padding: 19px 24px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  min-width: 240px;
  text-align: left;
  box-shadow: 0 6px 30px #12220a22;
  transition:
    background 0.15s,
    transform 0.15s;
}
.primary:hover {
  background: #e7ffaa;
  transform: translateY(-2px);
}
.primary span {
  float: right;
  margin-left: 35px;
  font-size: 19px;
  line-height: 12px;
}
.intro-foot {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #bec9b1;
  margin-top: 20px;
}
.field-note {
  position: absolute;
  bottom: 47px;
  right: 39px;
  border-left: 1px solid #e8eec57a;
  padding-left: 18px;
}
.field-note span {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #cfdbb8;
}
.field-note p {
  font-size: 12px;
  letter-spacing: 0.04em;
  margin: 12px 0 5px;
}
.field-note small {
  font-size: 9px;
  letter-spacing: 0.025em;
  color: #d2dbc4;
}
.glass {
  background: linear-gradient(125deg, #203325c9, #15251edd);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px #06170922;
  backdrop-filter: blur(16px);
}
.mission {
  position: absolute;
  left: 34px;
  top: 115px;
  width: 270px;
  padding: 21px 20px 15px;
  border-radius: 8px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.19em;
  color: var(--muted);
}
.mission-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0 13px;
}
.mission h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0;
}
.mission-title > span {
  font-size: 24px;
  letter-spacing: -0.045em;
  color: var(--lime);
  font-weight: 600;
}
.progress {
  height: 4px;
  background: #ffffff1a;
  border-radius: 2px;
  overflow: hidden;
}
.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width 0.5s;
}
.mission-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.07em;
  color: #becbb7;
}
.mission-stats b {
  font-size: 13px;
  color: #f2f3e7;
  margin-right: 4px;
}
.mission p {
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid #c2d9b516;
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: #c9d9b6;
}
.field-status {
  position: absolute;
  right: 35px;
  top: 115px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 6px #0008;
}
.field-status span:first-child {
  font-size: 9px;
  color: #d6dfc2;
}
.field-status #timer {
  font-size: 24px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.field-status #score {
  color: var(--lime);
  font-size: 10px;
}
#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1px 2px #0008);
  pointer-events: none;
}
#crosshair i {
  position: absolute;
  background: #f1f4e8b0;
  width: 5px;
  height: 1px;
  top: 12px;
  left: 0;
}
#crosshair i:nth-child(2) {
  left: 21px;
}
#crosshair i:nth-child(3) {
  top: 0;
  left: 12px;
  width: 1px;
  height: 5px;
}
#crosshair i:nth-child(4) {
  top: 21px;
  left: 12px;
  width: 1px;
  height: 5px;
}
#crosshair span {
  position: absolute;
  top: 11px;
  left: 11px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
}
#crosshair.ready span {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}
#target {
  position: absolute;
  top: calc(50% + 32px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: 160px;
  text-shadow: 0 1px 5px #001600cc;
  pointer-events: none;
}
#target-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
#target-action {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: #e6edcc;
}
.target-meter {
  height: 3px;
  width: 110px;
  margin: 10px auto;
  background: #13251444;
  border-radius: 3px;
  overflow: hidden;
}
.target-meter i {
  height: 100%;
  display: block;
  background: var(--lime);
  transition: width 0.08s;
}
#toast {
  position: absolute;
  top: 23%;
  left: 50%;
  transform: translate(-50%, -10px);
  background: #172c23df;
  border: 1px solid #dbea934a;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.3s;
  text-align: center;
  pointer-events: none;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#combo {
  position: absolute;
  top: 40%;
  left: 55%;
  font-size: 20px;
  font-weight: 700;
  color: var(--lime);
  text-shadow: 0 2px 8px #091f12;
  pointer-events: none;
}
.bottom-left {
  position: absolute;
  bottom: 31px;
  left: 34px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.1em;
}
#map {
  display: block;
  width: 116px;
  height: 116px;
  margin-bottom: 12px;
  opacity: 0.92;
  filter: drop-shadow(0 2px 15px #0003);
}
.key {
  display: inline-block;
  border: 1px solid #c8d5bd88;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 9px;
  margin-right: 4px;
}
.equipment {
  position: absolute;
  bottom: 29px;
  left: 50%;
  transform: translateX(-50%);
  width: min(575px, 65vw);
}
.tool-heading {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 8px #07200b;
}
.tool-heading #tool-name {
  font-weight: 800;
}
.tool-heading #tool-hint {
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #dce6cd;
}
.tools {
  display: flex;
  gap: 6px;
}
.tool {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 89px;
  border: 1px solid #eaf2d72e;
  border-radius: 6px;
  background: #18281ecc;
  color: #d8decc;
  backdrop-filter: blur(10px);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tool:hover {
  background: #344733e6;
}
.tool.active {
  background: linear-gradient(135deg, #d5ec95, #b4cd72);
  color: #243421;
  box-shadow: 0 0 22px #cde88c16;
  border-color: #e8f8b7;
}
.tool kbd {
  position: absolute;
  left: 9px;
  top: 7px;
  font-size: 9px;
  font-family: inherit;
  opacity: 0.65;
}
.tool svg {
  display: block;
  width: 49px;
  height: 37px;
  margin: 5px auto 8px;
  fill: currentColor;
}
.tool svg .handle {
  opacity: 0.6;
}
.tool span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
}
.equipment-foot {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.02em;
  color: #cdd8c2;
  margin-top: 13px;
}
.equipment-foot b {
  font-weight: 500;
  color: #f3f7e9;
  margin-right: 3px;
}
#heat {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 2px;
  background: #edebdb25;
  display: none;
}
#heat i {
  display: block;
  height: 100%;
  width: 0;
  background: #efc064;
}
#heat span {
  position: absolute;
  right: 0;
  bottom: -12px;
  font-size: 7px;
  letter-spacing: 0.1em;
  color: #edc880;
}
.bottom-right {
  position: absolute;
  bottom: 41px;
  right: 35px;
  text-align: right;
}
.bottom-right b {
  display: block;
  font-size: 32px;
  letter-spacing: -0.05em;
  line-height: 1.4;
}
.bottom-right span {
  font-size: 9px;
  letter-spacing: 0.11em;
  color: #c6d2b7;
}
.modal {
  max-width: 460px;
  width: calc(100% - 32px);
  border-radius: 13px;
  padding: 32px;
  box-shadow: 0 30px 120px #0005;
}
.modal h2 {
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 17px 0;
}
.modal p {
  font-size: 10px;
  line-height: 1.9;
  color: #d3ddc8;
  letter-spacing: 0.04em;
}
.modal .primary {
  width: 100%;
  text-align: center;
  margin-top: 14px;
}
.quiet {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: #c0cdb5;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 18px 0 0;
}
.quiet:hover {
  color: var(--lime);
}
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 9px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 18px 0;
}
.control-grid span {
  color: #e6f0d6;
}
.control-grid b {
  font-weight: 400;
  color: #b9c5ac;
  text-align: right;
}
.modal .small {
  font-size: 9px;
}
.victory {
  text-align: center;
  max-width: 510px;
}
.victory h2 {
  font-size: 64px;
  letter-spacing: -0.06em;
}
.victory .pill {
  font-size: 9px;
}
.win-stats {
  display: flex;
  justify-content: space-around;
  margin: 27px 0;
}
.win-stats b {
  display: block;
  font-size: 29px;
  color: var(--lime);
  font-weight: 500;
}
.win-stats span {
  display: block;
  font-size: 9px;
  color: #bac9ad;
  margin-top: 7px;
}
#best {
  font-size: 9px;
  letter-spacing: 0.07em;
  color: #d5dfc3;
  margin-bottom: 8px;
}
#touch-controls {
  display: none;
}
#error {
  position: fixed;
  z-index: 20;
  inset: 25% 10% auto;
  background: #203327;
  padding: 35px;
  border: 1px solid var(--lime);
  border-radius: 10px;
  line-height: 1.7;
  font-size: 16px;
}
@media (max-width: 850px) {
  .topbar {
    inset: 20px 20px auto;
  }
  .weather {
    display: none;
  }
  .mission {
    left: 20px;
    top: 90px;
    width: 220px;
    padding: 16px;
  }
  .mission h2 {
    font-size: 14px;
  }
  .mission-title > span {
    font-size: 21px;
  }
  .mission p {
    font-size: 8px;
  }
  .field-status {
    right: 20px;
    top: 95px;
  }
  .equipment {
    width: 65vw;
    bottom: 20px;
  }
  .equipment-foot {
    font-size: 7px;
  }
  .bottom-left {
    left: 20px;
    bottom: 25px;
  }
  #map {
    width: 88px;
    height: 88px;
  }
  .bottom-right {
    right: 20px;
    bottom: 30px;
  }
  .tool {
    height: 76px;
  }
  .tool svg {
    height: 30px;
    width: 40px;
  }
  .tool span {
    font-size: 7px;
  }
  .tool-heading #tool-hint {
    display: none;
  }
  .intro {
    left: 7%;
    top: 25%;
  }
  .field-note {
    bottom: 25px;
    right: 25px;
  }
  .intro p {
    font-size: 11px;
  }
  .intro h1 {
    font-size: 66px;
  }
}
@media (pointer: coarse) {
  #touch-controls {
    display: block;
  }
  #joystick {
    position: absolute;
    width: 100px;
    height: 100px;
    left: 22px;
    bottom: 155px;
    border: 1px solid #ddebba55;
    background: #13281933;
    border-radius: 50%;
    touch-action: none;
  }
  #joystick i {
    position: absolute;
    left: 32px;
    top: 32px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #d5e8ab88;
    border: 1px solid #ebf2dc55;
  }
  #touch-use {
    position: absolute;
    right: 24px;
    bottom: 151px;
    width: 89px;
    height: 89px;
    border-radius: 50%;
    background: #d4ed8ad9;
    color: #243421;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #e6fac1;
    touch-action: none;
  }
  #touch-vision {
    position: absolute;
    right: 39px;
    bottom: 257px;
    border: 1px solid #c9ddb288;
    background: #172e1eb0;
    color: #e8f4d3;
    border-radius: 20px;
    padding: 10px;
    font-size: 9px;
  }
  .equipment-foot {
    display: none;
  }
  .bottom-left {
    bottom: 270px;
  }
  .bottom-left > div {
    display: none;
  }
  .bottom-right {
    display: none;
  }
  .equipment {
    width: calc(100% - 40px);
    bottom: 23px;
  }
  #movement-hint {
    display: none;
  }
}
@media (max-width: 520px) {
  .topbar {
    inset: 16px 16px auto;
  }
  .wordmark {
    font-size: 16px;
    gap: 8px;
  }
  .brand-mark {
    font-size: 32px;
  }
  .wordmark small {
    font-size: 7px;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions button {
    height: 32px;
    padding: 0 9px;
    font-size: 8px;
  }
  #pause {
    font-size: 15px;
  }
  .mission {
    top: 82px;
    left: 16px;
    width: 205px;
    padding: 13px;
  }
  .mission .eyebrow {
    font-size: 8px;
  }
  .mission p {
    display: none;
  }
  .mission-title {
    margin: 9px 0;
  }
  .mission-stats {
    margin-top: 10px;
    font-size: 8px;
  }
  .field-status {
    top: 87px;
    right: 16px;
  }
  .field-status #timer {
    font-size: 20px;
  }
  .intro {
    top: 26%;
    left: 7%;
    right: 7%;
  }
  .intro h1 {
    font-size: 58px;
  }
  .intro p {
    font-size: 9px;
    line-height: 1.9;
  }
  .intro .pill {
    font-size: 8px;
  }
  .field-note {
    left: 7%;
    right: auto;
    bottom: 25px;
  }
  .field-note small {
    font-size: 8px;
  }
  .intro-foot {
    font-size: 8px;
  }
  .primary {
    font-size: 10px;
    padding: 18px 20px;
  }
  .modal {
    padding: 25px;
  }
  .victory h2 {
    font-size: 54px;
  }
  .tool span {
    font-size: 7px;
  }
  .tools {
    gap: 4px;
  }
  .equipment {
    width: calc(100% - 24px);
  }
  .tool-heading {
    font-size: 9px;
  }
  #toast {
    top: 30%;
    font-size: 9px;
    width: max-content;
  }
  #combo {
    top: 39%;
    font-size: 16px;
  }
}
@media (max-height: 600px) {
  .intro {
    top: 23%;
  }
  .intro h1 {
    font-size: 48px;
    margin: 15px 0;
  }
  .intro p {
    font-size: 9px;
    margin: 15px 0;
  }
  .intro-foot {
    display: none;
  }
  .field-note {
    font-size: 8px;
  }
  .mission {
    top: 86px;
  }
  .modal {
    padding: 22px;
    max-height: 88vh;
    overflow: auto;
  }
  .modal h2 {
    font-size: 24px;
  }
  .control-grid {
    gap: 7px;
    margin: 8px 0;
    padding: 10px 0;
  }
  .modal p {
    margin: 8px 0;
  }
  .victory h2 {
    font-size: 40px;
  }
  .win-stats {
    margin: 12px 0;
  }
  .equipment {
    bottom: 18px;
  }
  .bottom-left {
    bottom: 22px;
  }
  #joystick {
    bottom: 130px !important;
  }
  #touch-use {
    bottom: 125px !important;
  }
  #touch-vision {
    bottom: 230px !important;
  }
  .bottom-left #map {
    width: 70px;
    height: 70px;
  }
}

/* The expanded field kit stays compact; the full arsenal is one button away. */
.tools {
  overflow-x: auto;
  justify-content: flex-start;
  scrollbar-width: thin;
  scrollbar-color: #b3c987 #19271d;
  max-width: 760px;
}
.tools .tool {
  min-width: 67px;
  flex: 0 0 67px;
}
.tool .tool-icon {
  font-size: 26px;
  line-height: 34px;
  color: #d9eeb5;
}
.tool span {
  font-size: 8px;
}
.equipment {
  width: min(760px, calc(100vw - 380px));
}
.tool-heading {
  gap: 15px;
}
.tool-heading #tool-hint {
  text-align: right;
  font-size: 9px;
}
.quick-actions {
  position: absolute;
  right: 25px;
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: auto;
}
.quick-actions button,
.audio-options button,
.zen-picker button {
  background: #16281de8;
  border: 1px solid #c3d89e44;
  padding: 10px 14px;
  color: #e2edcf;
  border-radius: 8px;
  font-size: 10px;
  cursor: pointer;
}
.quick-actions button:hover {
  border-color: #cce49b;
}
#announcer {
  position: absolute;
  top: 27%;
  left: 50%;
  transform: translate(-50%, -12px) scale(0.9);
  text-align: center;
  width: min(900px, 88vw);
  font-size: clamp(22px, 3.5vw, 48px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -2px;
  color: #e2ffb3;
  text-shadow:
    0 3px 0 #314822,
    0 0 34px #91c95780;
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
  white-space: normal;
  text-wrap: balance;
}
#announcer.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
#machine-hud {
  position: absolute;
  right: 25px;
  top: 270px;
  width: 225px;
  padding: 17px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.8;
}
#machine-hud strong {
  display: block;
  color: #e4cc76;
}
#machine-hud small {
  display: block;
  color: #b7c3ac;
}
#garden-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-width: 410px;
  margin: 22px 0;
}
#garden-picker button {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #cedcb349;
  background: #17291ee6;
  border-radius: 7px;
  color: #dae6cc;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.5px;
}
#garden-picker button small {
  display: block;
  font-size: 8px;
  color: #a7b59b;
  margin-top: 5px;
}
#garden-picker button.selected {
  border-color: #d5ed91;
  background: #364832;
}
.intro {
  padding-top: 70px;
}
.intro h1 {
  font-size: clamp(50px, 7vw, 104px);
  margin: 18px 0;
}
.intro > p {
  font-size: 11px;
}
.intro-foot {
  margin-top: 15px;
}
.arsenal-modal {
  width: min(960px, 95vw);
  max-height: 86dvh;
  overflow: auto;
  padding: 27px;
  border-radius: 20px;
  pointer-events: auto;
}
.arsenal-modal h2 {
  font-size: 30px;
  margin: 10px 0;
}
.arsenal-modal > p {
  font-size: 10px;
  color: #b7c5ae;
}
.arsenal-modal > small {
  display: block;
  font-size: 9px;
  margin-top: 14px;
  color: #c4d0b9;
}
#arsenal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 20px 0;
}
#arsenal-grid button,
.machine-cards button {
  border: 1px solid #b7d39433;
  border-radius: 9px;
  background: #203025;
  padding: 13px;
  text-align: left;
  color: #e7eddf;
  cursor: pointer;
}
#arsenal-grid button strong {
  font-size: 11px;
  display: block;
  margin: 8px 0;
}
#arsenal-grid button small {
  font-size: 9px;
  line-height: 1.6;
  color: #aabc9f;
  display: block;
}
#arsenal-grid button i {
  font-style: normal;
  font-size: 24px;
  color: #d2ed98;
}
#arsenal-grid button.active {
  border-color: #d0ef92;
}
.machine-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 20px;
}
.machine-cards button {
  background: #3a3524;
  border-color: #b89c4855;
}
.machine-cards strong {
  font-size: 12px;
  display: block;
}
.machine-cards span {
  font-size: 9px;
  display: block;
  margin-top: 9px;
  color: #cfbf90;
}
.audio-options {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.zen-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d4ed8a26;
  border-radius: 8px;
  background: #10241e55;
}
.zen-picker .eyebrow { display: block; font-size: 8px; margin-bottom: 6px; }
#zen-track { font-size: 15px; font-weight: 500; color: #e2edc5; }
.zen-picker button { flex-shrink: 0; font-size: 10px; padding: 10px; }
@media(max-width:480px) {
  .zen-picker { gap: 8px; }
  #zen-track { font-size: 13px; }
}
button.pad-focus,
a.pad-focus,
button:focus-visible {
  outline: 3px solid #e2ffa3 !important;
  outline-offset: 3px;
}
.modal {
  max-height: 85dvh;
  overflow: auto;
}
.modal .control-grid {
  font-size: 10px;
  margin: 16px 0;
}
.top-actions {
  gap: 8px;
}
.top-actions button {
  white-space: nowrap;
}
#controller-status {
  font-size: 9px;
  max-width: 150px;
}
.screen {
  overflow-y: auto;
}
.arsenal-modal .primary {
  font-size: 11px;
  min-height: 42px;
}
@media (max-width: 1000px) {
  .equipment {
    width: calc(100vw - 230px);
    left: 57%;
  }
  .quick-actions {
    top: 125px;
    right: 15px;
  }
  .quick-actions button {
    font-size: 9px;
    padding: 9px;
  }
  #machine-hud {
    top: 246px;
    right: 15px;
    width: 185px;
  }
  .top-actions .weather {
    display: none;
  }
  #arsenal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .intro h1 {
    font-size: 68px;
  }
  .field-note {
    display: none;
  }
}
@media (max-width: 680px) {
  .equipment {
    width: calc(100vw - 24px);
    left: 50%;
  }
  .tools .tool {
    min-width: 57px;
    flex-basis: 57px;
  }
  .quick-actions {
    top: 165px;
    right: 10px;
    gap: 5px;
  }
  .quick-actions button {
    font-size: 8px;
    padding: 8px;
  }
  .tool-heading #tool-hint {
    font-size: 8px;
    max-width: 55%;
  }
  #machine-hud {
    top: 275px;
    width: 163px;
    padding: 10px;
    font-size: 9px;
  }
  #arsenal-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .arsenal-modal {
    padding: 18px;
    max-height: 84dvh;
  }
  .arsenal-modal h2 {
    font-size: 24px;
  }
  #arsenal-grid button {
    padding: 9px;
  }
  .machine-cards {
    grid-template-columns: 1fr;
  }
  .intro {
    padding-top: 55px;
  }
  .intro h1 {
    font-size: 58px;
  }
  .intro > p {
    font-size: 9px;
  }
  #garden-picker {
    margin: 14px 0;
    gap: 5px;
  }
  #garden-picker button {
    padding: 9px;
    font-size: 9px;
  }
  .intro-foot {
    font-size: 9px;
  }
  .top-actions button {
    font-size: 8px;
    padding: 8px;
  }
  .wordmark {
    font-size: 14px;
  }
  .brand-mark {
    font-size: 25px;
  }
  #announcer {
    top: 37%;
    letter-spacing: -1px;
  }
  .modal .control-grid {
    font-size: 8px;
    gap: 9px;
  }
  .modal h2 {
    font-size: 24px;
  }
}
@media (max-height: 650px) and (min-width: 681px) {
  .intro h1 {
    font-size: 57px;
  }
  .intro {
    padding-top: 35px;
  }
  .intro > p {
    font-size: 10px;
  }
  #garden-picker {
    margin: 10px 0;
  }
  .intro-foot {
    display: none;
  }
  .intro .primary {
    min-height: 44px;
  }
}

#touch-lift {
  position: absolute;
  right: 98px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#touch-lift button {
  padding: 9px;
  background: #233620dc;
  border: 1px solid #d6e6b855;
  color: #e3edcf;
  border-radius: 7px;
  font-size: 9px;
  pointer-events: auto;
}

.intro {
  top: 18%;
  padding-top: 0;
}
.tool .tool-icon {
  display: block;
  font-style: normal;
  margin: 6px auto 4px;
}
.tool.active .tool-icon {
  color: #314622;
}
#touch-lift {
  bottom: 158px;
  right: 124px;
}
@media (max-width: 680px) {
  .intro {
    top: 17%;
    padding-top: 0;
  }
  .intro h1 {
    font-size: 55px;
  }
  .intro p {
    margin: 16px 0;
  }
  .field-note {
    display: none;
  }
}
@media (max-height: 650px) {
  .intro {
    top: 16%;
    padding-top: 0;
  }
  .intro h1 {
    font-size: 47px;
  }
  .intro p {
    margin: 12px 0;
  }
  .intro .pill {
    font-size: 8px;
    padding: 6px;
  }
  .intro-foot {
    display: none;
  }
}

.intro {
  max-width: 760px;
  width: 80%;
}
.intro h1 {
  font-size: clamp(44px, 6.2vw, 88px);
}
#enable-audio {
  position: fixed;
  bottom: 185px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 12px 20px;
  background: #d5ed91;
  color: #20321d;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  cursor: pointer;
}
@media (max-width: 680px) {
  .intro {
    width: 88%;
  }
  .intro h1 {
    font-size: clamp(42px, 11vw, 58px);
  }
  .audio-options {
    flex-wrap: wrap;
  }
  .quick-actions {
    max-width: 155px;
  }
}

.quick-actions {
  top: 211px;
}
#machine-hud {
  top: 340px;
}
@media (max-width: 680px) {
  .quick-actions {
    top: 180px;
  }
  #machine-hud {
    top: 294px;
  }
  .quick-actions button {
    font-size: 8px;
  }
  .equipment {
    bottom: 17px;
  }
  .tool-heading {
    padding-bottom: 7px;
  }
}

.arsenal-modal {
  background: #203026f7;
  touch-action: pan-y;
}
.tools {
  touch-action: pan-x;
}
.modal {
  touch-action: pan-y;
}

.spread-settings {
  max-width: 410px;
  padding: 12px 15px 10px;
  margin: 14px 0 18px;
  border: 1px solid #cbdc9c45;
  border-radius: 8px;
  background: #14231ee8;
}
.spread-heading,
.spread-ends {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.07em;
}
.spread-heading strong {
  color: #dcf4a5;
  font-size: 10px;
}
.spread-ends {
  color: #aebfa4;
  font-size: 8px;
}
.spread-settings input {
  display: block;
  appearance: none;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  border-radius: 4px;
}
.spread-settings input::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #d5ed91 var(--spread),
    #4c5b41 var(--spread)
  );
}
.spread-settings input::-webkit-slider-thumb {
  appearance: none;
  width: 19px;
  height: 19px;
  margin-top: -7px;
  background: #edffd0;
  border: 3px solid #70854f;
  border-radius: 50%;
}
.spread-settings input::-moz-range-track {
  height: 5px;
  border-radius: 4px;
  background: #4c5b41;
}
.spread-settings input::-moz-range-progress {
  height: 5px;
  background: #d5ed91;
}
.spread-settings input::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid #70854f;
  border-radius: 50%;
  background: #edffd0;
}
.spread-settings input:focus-visible,
.spread-settings input.pad-focus {
  outline: 2px solid #e2ffa3;
  outline-offset: 2px;
}
.spread-settings p,
.modal .spread-settings p,
.intro .spread-settings p {
  margin: 9px 0 0;
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.035em;
  color: #c1cdb2;
}
#pause-spread {
  max-width: none;
}
#spread-button {
  position: absolute;
  top: 13px;
  right: 12px;
  color: #d5ed91;
  background: #d5ed9112;
  border: 1px solid #d5ed9140;
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 8px;
  cursor: pointer;
}
.mission > .eyebrow {
  max-width: 135px;
}
#start-screen {
  align-items: flex-start;
  justify-content: flex-start;
}
.intro {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  margin: max(95px, 11dvh) 0 36px 8%;
}
@media (max-height: 800px) {
  .intro h1 {
    font-size: clamp(42px, 5.2vw, 68px);
    margin: 14px 0;
  }
  .intro > p {
    margin: 14px 0;
  }
  #garden-picker {
    margin: 14px 0;
  }
}
@media (max-width: 680px) {
  .intro {
    margin-left: 6%;
    margin-top: 102px;
  }
  .spread-heading strong {
    font-size: 9px;
  }
  .mission > .eyebrow {
    max-width: 80px;
    line-height: 1.4;
  }
  #spread-button {
    top: 11px;
    right: 9px;
    font-size: 7px;
    padding: 5px;
  }
}
/* Couch co-op shares the garden while every viewport has its own readable HUD. */
.team-settings {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid #d2e4b738;
  border-radius: 8px;
  background: #14231cbd;
}
.team-setting-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-bottom: 9px;
}
.team-setting-title span {
  color: #b9c7ab;
  font-size: 8px;
}
.crew-options {
  display: flex;
  gap: 6px;
}
.crew-options button {
  flex: 1;
  padding: 9px 6px;
  border: 1px solid #d2e4b738;
  background: #24372c;
  color: #dce7ce;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.crew-options button[aria-pressed="true"] {
  color: #192b20;
  background: #d9ed91;
  border-color: #d9ed91;
}
.crew-input {
  margin-top: 8px;
}
.crew-input p.crew-seats {
  margin: 8px 0 4px;
  font-size: 9px;
  line-height: 1.5;
  color: #e2ebd2;
}
.crew-input small {
  font-size: 8px;
  color: #b9c7ab;
  line-height: 1.5;
}
.team-playing > .topbar,
.team-playing > .vignette {
  display: none;
}
.team-playing #hud > .mission,
.team-playing #hud > .field-status,
.team-playing #hud > #crosshair,
.team-playing #hud > #target,
.team-playing #hud > .quick-actions,
.team-playing #hud > .bottom-left,
.team-playing #hud > .equipment,
.team-playing #hud > .bottom-right,
.team-playing #hud > #touch-controls,
.team-playing #hud > #machine-hud,
.team-playing #hud > #combo {
  display: none;
}
#team-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.team-scorebar {
  position: absolute;
  inset: 0 0 auto;
  height: 40px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: #102119;
  color: #e3edcf;
  font-size: 10px;
  letter-spacing: 0.07em;
}
.team-scorebar strong {
  color: #d9ed91;
  font-size: 11px;
}
.team-scorebar button {
  pointer-events: auto;
  border: 1px solid #d2e4b745;
  border-radius: 4px;
  background: #253b2e;
  color: #e3edcf;
  padding: 6px 10px;
  font-size: 9px;
}
.player-hud {
  position: absolute;
  container-type: size;
  container-name: player;
  box-sizing: border-box;
  border: 1px solid #102119;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #06160e6b,
    transparent 23%,
    transparent 73%,
    #06160e94
  );
}
.player-heading {
  position: absolute;
  top: 12px;
  left: 13px;
  right: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  text-shadow: 0 2px 5px #000;
}
.player-heading b {
  background: var(--player-color);
  color: #102119;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  text-shadow: none;
}
.player-roots {
  margin-left: auto;
  color: var(--player-color);
  font-size: 8px;
}
.player-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font: 22px Arial;
  color: #eff4db;
  text-shadow: 0 1px 3px #000;
}
.player-target {
  position: absolute;
  top: calc(50% + 27px);
  left: 12%;
  width: 76%;
  text-align: center;
  color: #e8eddc;
  text-shadow: 0 2px 4px #000;
}
.player-target strong {
  display: block;
  font-size: 10px;
  letter-spacing: 0.03em;
}
.player-target small {
  display: block;
  font-size: 8px;
  line-height: 1.5;
  margin-top: 3px;
}
.player-target i {
  display: block;
  height: 2px;
  width: 100px;
  background: #17291c70;
  margin: 5px auto 0;
}
.player-target i span {
  display: block;
  height: 100%;
  background: var(--player-color);
}
.player-equipment {
  position: absolute;
  bottom: 14px;
  left: 15px;
  right: 15px;
  border-left: 3px solid var(--player-color);
  background: #11251cde;
  border-radius: 4px;
  padding: 7px 8px;
  box-sizing: border-box;
}
.player-equipment-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.player-tool-details { flex: 1; min-width: 0; }
.player-tool-name, .player-tool-controls { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-options, .player-arsenal {
  pointer-events: auto;
  flex-shrink: 0;
  border: 1px solid #d2e4b745;
  border-radius: 4px;
  background: #152a21ed;
  color: #e3edcf;
  font: inherit;
  font-size: 8px;
  letter-spacing: .035em;
  padding: 7px 8px;
  cursor: pointer;
  touch-action: manipulation;
}
.player-options { margin-left: auto; }
.player-inventory { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.player-tool {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 42px;
  padding: 3px 0;
  border: 1px solid #d2e4b729;
  border-radius: 4px;
  background: #d2e4b70a;
  color: #c2cfbb;
  cursor: pointer;
  touch-action: manipulation;
}
.player-tool i { display: grid; place-items: center; font: normal 22px/24px Arial, sans-serif; height: 24px; }
.player-tool i .panda-tool-icon { width: 24px; height: 24px; }
.player-tool > span { font-size: 7px; line-height: 9px; letter-spacing: 0; }
.player-tool[aria-pressed="true"] { background: var(--player-color); border-color: var(--player-color); color: #102119; box-shadow: 0 0 12px #0003; }
.player-tool:hover, .player-options:hover, .player-arsenal:hover { border-color: var(--player-color); }
.player-tool:focus-visible, .player-options:focus-visible, .player-arsenal:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.player-tool-icon {
  display: grid;
  place-items: center;
  height: 30px;
  flex-shrink: 0;
  font-size: 22px;
  line-height: 30px;
  color: var(--player-color);
  min-width: 24px;
  text-align: center;
}
.player-tool-name {
  display: block;
  color: #f0f3e4;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.player-tool-controls {
  display: block;
  color: #c3d0b4;
  font-size: 8px;
  line-height: 1.7;
}
.player-heat {
  position: absolute;
  height: 3px;
  bottom: 0;
  left: 0;
  right: 0;
  background: #223524;
}
.player-heat i {
  display: block;
  height: 100%;
  background: #efc064;
}
.player-heat.hot i {
  background: #f18755;
}
.player-wait {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #0b1e14ae;
  color: var(--player-color);
  font-size: 16px;
  letter-spacing: 0.1em;
}
.player-wait small {
  font-size: 9px;
  color: #d9e6cb;
  letter-spacing: 0.02em;
}
#team-overview {
  position: absolute;
  box-sizing: border-box;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at top, #294533, #102119 80%);
  text-align: center;
  border: 1px solid #14221b;
}
#team-overview h2 {
  font-size: clamp(18px, 3vw, 37px);
  line-height: 1.03;
  margin: 12px 0;
  color: #d9ed91;
}
#team-overview canvas {
  width: clamp(75px, 13vh, 155px);
  height: auto;
}
#team-overview p {
  font-size: 10px;
  line-height: 1.8;
  color: #dce7ce;
  margin: 10px 0;
}
#team-overview small,
#team-overview .eyebrow {
  font-size: 8px;
  line-height: 1.8;
  color: #abc09e;
}
.team-playing #announcer {
  top: 58px;
  font-size: clamp(20px, 3vw, 38px);
}
.team-playing #toast {
  top: 43px;
  max-width: 65vw;
  font-size: 9px;
}
.team-playing #enable-audio {
  bottom: 4px;
  font-size: 9px;
  padding: 8px 10px;
}
@media (max-height: 850px) {
  #start-screen {
    overflow-y: auto;
    align-items: flex-start;
  }
  #start-screen .intro {
    margin-top: 80px;
    padding-bottom: 25px;
  }
  #start-screen h1 {
    font-size: clamp(36px, 6vw, 68px);
  }
  #start-screen .intro > p {
    margin: 12px 0;
  }
  #start-screen .spread-settings {
    margin-top: 12px;
    margin-bottom: 10px;
  }
  #team-overview .eyebrow {
    display: none;
  }
}
@media (max-width: 650px) {
  .team-scorebar {
    padding: 0 8px;
    gap: 6px;
    font-size: 8px;
  }
  .team-scorebar strong {
    display: none;
  }
  .team-scorebar button {
    font-size: 8px;
    padding: 6px;
  }
  .player-heading {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 5px;
  }
  .player-input {
    font-size: 7px;
  }
  .player-roots {
    display: none;
  }
  .player-equipment {
    left: 6px;
    right: 6px;
    bottom: 6px;
    gap: 5px;
    padding: 6px;
  }
  .player-tool-icon {
    min-width: 20px;
    font-size: 20px;
  }
  .player-tool-name {
    font-size: 9px;
  }
  .player-tool-controls {
    font-size: 6px;
  }
  .player-target small {
    font-size: 7px;
  }
  .player-target strong {
    font-size: 8px;
  }
  .player-wait {
    font-size: 10px;
    letter-spacing: 0;
  }
  .player-wait small {
    font-size: 7px;
    text-align: center;
    padding: 10px;
  }
  #team-overview {
    padding: 8px;
  }
  #team-overview h2 {
    font-size: 21px;
  }
  #team-overview small {
    font-size: 7px;
  }
  .team-setting-title span {
    display: none;
  }
}

/* Companion dismissal stays accessible with any equipped tool. */
#dismiss-pandas, #team-dismiss-pandas { border-color: #d4ed8a88; color: #e3f4c0; }
.team-buttons { display: flex; gap: 8px; flex-shrink: 0; }
#pause-dismiss-pandas { display: block; width: 100%; margin: 12px 0; }
.pandas-present #machine-hud { top: 386px; }
@media(max-width:680px) { .pandas-present #machine-hud { top: 345px; } }
@media(max-width:800px) {
  .team-scorebar { gap: 8px; padding: 0 8px; }
  .team-scorebar > strong { display: none; }
  .team-buttons { gap: 4px; }
  .team-scorebar button { font-size: 8px; padding: 6px; }
}

#pull-root { touch-action: manipulation; }

/* Keep every tool in view. Controls above the kit follow its measured height. */
:root {
  --equipment-bottom: max(16px, env(safe-area-inset-bottom));
  --equipment-clearance: calc(var(--equipment-height, 150px) + var(--equipment-bottom) + 14px);
}
.brand-mark svg { display: block; width: .82em; height: 1.1em; }
.equipment {
  width: min(1056px, calc(100% - 320px));
  left: 50%;
  bottom: var(--equipment-bottom);
}
.tools {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  max-width: none;
  overflow: visible;
  touch-action: manipulation;
}
.tools .tool { min-width: 0; height: 80px; padding: 4px 2px; }
.tool-heading { align-items: center; gap: 12px; padding-bottom: 9px; }
.tool-heading #tool-name { flex-shrink: 0; }
.tool-heading #tool-hint { line-height: 1.4; }
.tool .tool-icon { height: 34px; line-height: 34px; margin: 7px auto 4px; }
.panda-tool-icon { display: block; width: 34px; height: 34px; flex-shrink: 0; }
.tool .panda-tool-icon { width: 34px; height: 34px; margin: 0 auto; }
#arsenal-grid button i { display: block; height: 34px; line-height: 34px; }
.player-tool-icon .panda-tool-icon { width: 30px; height: 30px; }
.equipment-foot { gap: 8px; margin-top: 9px; }
#heat { position: relative; inset: auto; margin-top: 17px; height: 3px; }
#heat span { bottom: 6px; }
#enable-audio { bottom: var(--equipment-clearance); }
@media (max-width: 1149px) {
  .equipment { width: min(760px, calc(100% - 320px)); }
  .tools { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tools .tool { height: 62px; }
  .tool kbd { top: 4px; left: 6px; font-size: 8px; }
  .tool .tool-icon { margin: 2px auto; }
  .tool span { font-size: 7px; letter-spacing: .02em; }
  .tool-heading #tool-hint { display: none; }
}
@media (max-width: 850px) {
  .equipment { width: calc(100% - 240px); }
}
@media (max-width: 680px) {
  .equipment { width: calc(100% - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right))); }
  .tools { gap: 4px; }
  #movement-hint { display: none; }
  .bottom-left { bottom: var(--equipment-clearance); left: max(16px, env(safe-area-inset-left)); }
  .bottom-right { display: none; }
}
@media (pointer: coarse) {
  .equipment { width: calc(100% - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right))); }
  #joystick, #touch-use { bottom: var(--equipment-clearance) !important; }
  #touch-vision { bottom: calc(var(--equipment-clearance) + 105px) !important; }
  #touch-lift { bottom: var(--equipment-clearance); }
  .bottom-left { bottom: calc(var(--equipment-clearance) + 112px); }
}
@media (max-height: 500px) and (min-width: 700px) {
  .equipment { width: calc(100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))); }
  .tools { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tools .tool { height: 56px; }
  .tool-heading { padding-bottom: 6px; }
  .tool-heading #tool-hint, .equipment-foot, .bottom-right { display: none; }
  .bottom-left { bottom: var(--equipment-clearance); left: 140px; }
  .bottom-left > div { display: none; }
  .mission { top: 80px; width: 220px; padding: 10px; }
  .mission > .eyebrow, .mission p { display: none; }
  .mission-title { margin: 0 0 6px; padding-right: 77px; }
  .mission h2 { font-size: 11px; }
  .mission-title > span { font-size: 17px; }
  .mission-stats { margin-top: 6px; font-size: 7px; }
  #spread-button { top: 10px; right: 10px; font-size: 7px; }
  .field-status { top: 78px; flex-direction: row; align-items: center; gap: 10px; }
  .field-status #timer { font-size: 18px; }
  .quick-actions { top: auto; bottom: var(--equipment-clearance); right: 135px; max-width: 170px; }
  .quick-actions button { padding: 7px; font-size: 8px; }
}
@media (pointer: coarse) and (max-height: 680px) and (max-width: 699px) {
  .bottom-left { left: 50%; transform: translateX(-50%); bottom: var(--equipment-clearance); }
  .bottom-left #map { width: 60px; height: 60px; margin-bottom: 0; }
  #touch-vision { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(var(--equipment-clearance) + 68px) !important; }
}

/* The photo pair stays readable and scrollable on phones and short screens. */
#comparison-screen { z-index: 9; background: #06140eef; padding: 18px; }
.comparison-modal { width: min(1180px, 100%); max-height: calc(100dvh - 36px); overflow: auto; border-radius: 18px; padding: clamp(18px,3vw,34px); touch-action: pan-y; }
.comparison-modal h2 { font-size: clamp(22px,3vw,36px); margin: 12px 0; letter-spacing: -.035em; }
#comparison-caption, .comparison-note { color: #b7c3a4; font-size: 11px; line-height: 1.7; }
.comparison-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0 14px; }
.comparison-photos figure { margin: 0; min-width: 0; background: #17251a; border-radius: 9px; overflow: hidden; border: 1px solid #cedbb922; }
.comparison-photos figcaption { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 13px 15px; font-size: 12px; color: #e4f7b3; font-weight: 700; }
.comparison-photos figcaption span { font-size: 9px; color: #acbaa7; align-self: center; }
.comparison-photos img { display: block; width: 100%; aspect-ratio: 3/2; object-fit: contain; }
.comparison-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.comparison-actions button { padding: 15px 22px; }
#compare:disabled { opacity: .5; cursor: wait; }
@media (max-width: 700px) { .comparison-photos { grid-template-columns: 1fr; gap: 14px; } .comparison-actions { flex-direction: column; } }

/* Inventory adapts to each split viewport, not the overall browser width. */
@container player (max-width: 540px) {
  .player-equipment { left: 7px; right: 7px; bottom: 7px; padding: 6px; }
  .player-tool-name { font-size: 10px; }
  .player-tool-controls { font-size: 7px; }
  .player-equipment-heading { gap: 5px; }
  .player-tool > span { font-size: 6px; }
}
@container player (max-width: 460px) {
  .player-inventory { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .player-tool { height: 36px; }
  .player-tool i { font-size: 20px; line-height: 21px; height: 21px; }
  .player-tool i .panda-tool-icon { width: 21px; height: 21px; }
  .player-tool > span { font-size: 7px; }
  .player-tool-icon { display: none; }
  .player-arsenal { font-size: 7px; padding: 6px; }
  .player-tool-controls { font-size: 6px; }
}
@container player (max-width: 300px) {
  .player-input, .player-roots, .player-tool-controls, .player-tool > span { display: none; }
  .player-heading { left: 7px; right: 7px; top: 7px; }
  .player-options { font-size: 7px; padding: 6px; }
  .player-tool { height: 28px; }
  .player-tool-name { font-size: 8px; }
}
@container player (max-height: 300px) and (min-width: 360px) {
  .player-inventory { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .player-tool { height: 28px; }
  .player-tool > span, .player-tool-controls, .player-tool-icon { display: none; }
  .player-equipment-heading { margin-bottom: 4px; }
  .player-equipment { padding: 4px 6px; bottom: 5px; }
  .player-arsenal { padding: 4px 6px; }
}
@container player (max-height: 260px) {
  .player-target { top: auto; bottom: calc(50% + 18px); }
  .player-target small { display: none; }
}

/* A compact garden recipe, available before play and in the pause menu. */
.garden-seed-panel { margin:14px 0; padding:13px 15px; border:1px solid #cfe7b32e; border-radius:12px; background:#10241bd6; max-width:620px; }
.seed-heading,.seed-controls,.pause-garden-seed { display:flex; gap:9px; align-items:center; }
.seed-heading { justify-content:space-between; margin-bottom:12px; }
.seed-heading strong { font-size:17px; font-weight:500; color:#e5efce; }
.garden-seed-panel label { display:block; font-size:11px; letter-spacing:.12em; color:#bdcaaa; margin-bottom:5px; }
.garden-seed-panel button,.pause-garden-seed button { padding:9px 11px; border:1px solid #bdd69755; border-radius:7px; background:#d0ecad10; color:#d5ebbb; font-size:11px; font-weight:650; white-space:nowrap; cursor:pointer; }
.garden-seed-panel button:hover,.pause-garden-seed button:hover { background:#d0ecad27; }
.seed-controls input { width:0; min-width:0; flex:1; padding:10px; border:1px solid #bdd69755; border-radius:6px; background:#061b13; color:#e7f3d4; font:14px monospace; letter-spacing:.03em; }
.garden-seed-panel small { display:block; font-size:12px; line-height:1.4; letter-spacing:0; margin-top:8px; color:#b1bea1; text-transform:none; }
.pause-garden-seed { justify-content:space-between; padding:12px 0; border-bottom:1px solid #bdd69733; }
.pause-garden-seed span { font-size:11px; letter-spacing:.08em; color:#bccdab; }
.pause-garden-seed code { display:block; font-size:14px; margin-top:5px; color:#e7f3d4; user-select:all; }
@media(max-width:500px) { .garden-seed-panel{padding:11px;} .seed-controls{flex-wrap:wrap;} .seed-controls input{flex-basis:100%;} .seed-controls button{flex:1;} .seed-heading strong{font-size:15px;} }

.victory-crew { margin:16px 0; padding:12px 14px 0; border:1px solid #cedbb92c; border-radius:12px; background:#13291f; overflow:hidden; }
.victory-crew figcaption { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; color:#e4f7b3; font-size:14px; font-weight:650; letter-spacing:.035em; }
.victory-crew figcaption span { color:#adbea5; font-size:12px; font-weight:400; }
.victory-crew img { display:block; width:100%; height:210px; object-fit:contain; }
#win-crew img { height:170px; }
@media(max-width:500px) { .victory-crew img { height:160px; } #win-crew img { height:140px; } }

/* Compact menus: settings and actions, with controls available on demand. */
#start-screen .intro h1 { font-size:32px; margin:0 0 20px; letter-spacing:-.025em; }
#start-screen .intro { max-width:620px; }
#garden-seed-status:empty, #best:empty { display:none; }
.controls-disclosure { margin:16px 0; padding:13px 0; border-block:1px solid var(--line); }
.controls-disclosure summary { cursor:pointer; color:var(--cream); font-size:13px; letter-spacing:.08em; }
.controls-disclosure summary:focus-visible, summary.pad-focus { outline:3px solid var(--lime); outline-offset:4px; }
.controls-disclosure .control-grid { margin-bottom:0; border:0; }
.mission-title { margin-top:0; }
.mission-stats { margin-bottom:4px; }
@media(max-width:680px) { #start-screen .intro h1 { font-size:26px; margin-bottom:16px; } }

.mission { display:grid; gap:10px; }
.mission .mission-title, .mission .mission-stats { margin:0; }
.mission #spread-button { position:static; justify-self:end; }
#pause-screen #resume { margin:0 0 8px; }
.audio-disclosure .audio-options { margin-top:14px; }

#leave-victory-screen { z-index: 10; background: #06140eee; padding: 18px; }
#leave-victory-screen .modal { width: min(520px, 100%); }
#leave-victory-title { font-size: clamp(30px, 5vw, 48px); }
#leave-victory-screen button { min-height: 46px; }
#leave-victory-note { color: var(--muted, #b7c3a4); line-height: 1.6; margin-bottom: 24px; }
.comparison-actions button { min-height: 48px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.comparison-actions button:not(.primary) { color: #eff0d9; background: #21392c; border: 1px solid #b7c3a447; }
.comparison-actions button:not(.primary):hover { background: #304b39; }
.comparison-actions button:disabled { opacity: .5; cursor: wait; }
.photo-privacy, #comparison-share-status { font-size: 12px; line-height: 1.6; color: #b7c3a4; }
.photo-privacy { margin: 16px 0 0; }
#comparison-share-status { min-height: 1.6em; margin: 4px 0 0; }
