:root {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
  --cream: #fff8e5;
  --ink: #215d60;
  --accent: #ffd17d;
  --muted: #b9d9ce;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  background: #153f46;
  color: var(--cream);
}
body.candy {
  --cream: #fffaf0;
  --ink: #705064;
  --accent: #bd5574;
  --muted: #937282;
  background: #e6cdd7;
  color: var(--ink);
}
button,
a,
input {
  touch-action: manipulation;
}
button,
a {
  min-height: 48px;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #fca657;
  outline-offset: 3px;
}
button:active {
  transform: scale(0.96);
}
[hidden] {
  display: none !important;
}
.game-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 390px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(
    ellipse at 50% 25%,
    #41999a,
    #246770 75%,
    #225b67
  );
}
.candy .game-shell {
  background: radial-gradient(
    ellipse at 40% 20%,
    #fff0dd,
    #f3d8dc 70%,
    #ebc4d6
  );
}
header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(13px + env(safe-area-inset-top))
    max(15px, env(safe-area-inset-right)) 13px
    max(15px, env(safe-area-inset-left));
  z-index: 3;
}
.round-button {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid #d9efdd30;
  display: grid;
  place-items: center;
  background: #ffffff09;
  color: inherit;
  text-decoration: none;
  font-size: 22px;
}
.candy .round-button {
  background: #fffbf34d;
  border-color: #b98f9a30;
}
.round-button[aria-pressed="true"] {
  opacity: 0.5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand > span {
  font-size: 25px;
}
.brand small {
  display: block;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin-top: 5px;
}
.mission-card {
  margin: 0 19px;
  padding: 16px 18px;
  background: #123e493b;
  border: 1px solid #d7f1d824;
  border-radius: 19px;
  z-index: 2;
  flex-shrink: 0;
}
.candy .mission-card {
  background: #fffcf589;
  border-color: #fff7edb3;
}
.mission-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.mission-card strong {
  font-size: 11px;
  white-space: nowrap;
  color: var(--accent);
}
.candy .mission-card strong {
  color: #b35773;
}
.progress-track {
  height: 6px;
  background: #062f432e;
  border-radius: 6px;
  margin: 12px 0;
  overflow: hidden;
}
.candy .progress-track {
  background: #dec0c84f;
}
#progress {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #f9d38a, #b4dfb1);
  border-radius: 6px;
  transition: width 0.25s;
}
.candy #progress {
  background: linear-gradient(90deg, #e78898, #b899d9);
}
.stats {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: none;
  isolation: isolate;
}
#stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.scene-caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  text-align: center;
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b7e5b4;
}
.candy .live-dot {
  background: #bf82a2;
}
#targets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.world-target {
  position: absolute;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 1px dashed #fff7cebb;
  background: #fff2c92b;
  color: #fffadc;
  font-size: 26px;
  font-weight: 400;
  display: grid;
  place-items: center;
  transition:
    background 0.2s,
    opacity 0.2s;
}
.world-target:active {
  transform: translate(-50%, -50%) scale(0.9);
}
.world-target:disabled {
  pointer-events: none;
}
.litter-target {
  background: #f4eee2de;
  border: 2px solid #f5b29c;
  color: #48877b;
  font-size: 21px;
  box-shadow: 0 4px 12px #10415325;
}
.plot-target {
  color: #4b897b;
  background: #fff5d496;
  border-color: #fffbedcc;
}
.plot-target.planted {
  opacity: 0.15;
  background: transparent;
  border-color: transparent;
  color: white;
  font-size: 18px;
}
.plot-target.planted:hover,
.plot-target.planted:focus-visible {
  opacity: 1;
  background: #275e537d;
}
.dock {
  padding: 14px max(19px, env(safe-area-inset-right))
    calc(12px + env(safe-area-inset-bottom))
    max(19px, env(safe-area-inset-left));
  border-top: 1px solid #c8e5d523;
  background: #163f493d;
  z-index: 3;
  flex-shrink: 0;
}
.candy .dock {
  background: #fff5e978;
  border-color: #fff9ed;
}
.dock-label {
  display: block;
  font-size: 8px;
  letter-spacing: 1.2px;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}
.coral-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.coral-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 55px;
  border-radius: 15px;
  background: #bddacf0b;
  color: #e2ecdc;
  border: 1px solid #d6eacd30;
  font-size: 12px;
  font-weight: 600;
}
.coral-options button[aria-pressed="true"] {
  border-color: #f8d892;
  background: #f8d89216;
  box-shadow: inset 0 0 0 1px #f8d89250;
}
.coral-swatch {
  font-size: 30px;
  line-height: 1;
}
.peach {
  color: #ffa27b;
}
.lilac {
  color: #c7b1f4;
}
.honey {
  color: #f5d088;
}
.bottom-note {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 7px;
}
.bottom-note > span {
  font-size: 6px;
  letter-spacing: 0.8px;
  color: var(--muted);
}
#restart {
  min-height: 34px;
  font-size: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
}
.steering-row {
  display: flex;
  gap: 15px;
  align-items: center;
}
.steering-row > span {
  font-size: 21px;
  color: #bd829b;
}
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  height: 48px;
  background: transparent;
  margin: 0;
  touch-action: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 8px;
  background: #ddbac8;
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 8px;
  background: #ddbac8;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 40px;
  background: #bd6684;
  border: 5px solid #fff1de;
  box-shadow: 0 3px 9px #bb7b9633;
  border-radius: 20px;
  margin-top: -16px;
}
input[type="range"]::-moz-range-thumb {
  width: 38px;
  height: 30px;
  background: #bd6684;
  border: 5px solid #fff1de;
  border-radius: 20px;
}
.intro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 23px calc(27px + env(safe-area-inset-bottom));
  background: linear-gradient(
    transparent 22%,
    #1948510a 42%,
    #1b4b53eb 68%,
    #1b4b53 100%
  );
}
.candy .intro {
  background: linear-gradient(
    transparent 20%,
    #f4dce300 40%,
    #f3d8e3eb 65%,
    #f3d8e3 100%
  );
}
.intro-card {
  text-align: center;
  max-width: 440px;
  width: 100%;
  padding: 14px 0 4px;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: var(--muted);
}
h1 {
  font-size: clamp(29px, 7.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.6px;
  margin: 13px auto;
  max-width: 320px;
}
.intro p {
  font-size: 12px;
  line-height: 1.8;
  margin: 0 auto 22px;
  color: #d1e3d7;
}
.candy .intro p {
  color: #967386;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 17px 22px;
  min-height: 58px;
  width: 100%;
  border: 0;
  border-radius: 17px;
  background: #fbd48c;
  color: #315a56;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 7px 16px #0e373329;
}
.primary:disabled {
  opacity: 0.5;
}
.candy .primary {
  background: #b75d7d;
  color: #fff4ed;
  box-shadow: 0 7px 16px #ab52782b;
}
.primary > span {
  font-size: 20px;
}
.intro-foot {
  display: block;
  font-size: 6px;
  letter-spacing: 1.3px;
  margin-top: 19px;
  color: var(--muted);
}
.playing .intro {
  display: none;
}
#announcement {
  position: absolute;
  left: 50%;
  bottom: calc(163px + env(safe-area-inset-bottom));
  transform: translate(-50%, 7px);
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  z-index: 4;
  padding: 11px 16px;
  border-radius: 18px;
  color: #346963;
  background: #fff8e9f5;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  width: max-content;
  max-width: 86%;
  box-shadow: 0 4px 16px #123f3922;
}
#announcement.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #123a4b8a;
  backdrop-filter: blur(9px);
  display: grid;
  place-items: center;
  padding: 23px;
}
.dialog-backdrop > section {
  width: 100%;
  max-width: 400px;
  border-radius: 26px;
  background: #fff6e7;
  color: #396862;
  padding: 28px 24px;
  text-align: center;
  max-height: 90%;
  overflow: auto;
}
.candy .dialog-backdrop {
  background: #71536b66;
}
.candy .dialog-backdrop > section {
  color: #79546c;
}
.dialog-art {
  font-size: 45px;
  margin-bottom: 15px;
}
h2 {
  font-size: 27px;
  letter-spacing: -0.7px;
  line-height: 1.15;
  margin: 0 0 14px;
}
.dialog-backdrop p {
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 24px;
  opacity: 0.8;
}
.secondary {
  border: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: inherit;
  font-size: 12px;
  text-decoration: none;
  margin-top: 8px;
  width: 100%;
  min-height: 48px;
}
#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
@media (min-width: 650px) and (min-height: 650px) {
  .game-shell {
    height: calc(100dvh - 32px);
    margin: 16px auto;
    border-radius: 28px;
    box-shadow: 0 20px 70px #16343d33;
    border: 1px solid #ffffff1a;
    max-width: 520px;
  }
  .brand {
    font-size: 19px;
  }
  .intro {
    padding-bottom: 32px;
  }
  h1 {
    font-size: 38px;
  }
}
@media (max-width: 360px) {
  header {
    gap: 5px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .brand {
    font-size: 15px;
    gap: 4px;
  }
  .brand > span {
    font-size: 21px;
  }
  .round-button {
    width: 44px;
  }
  .mission-card {
    margin: 0 12px;
    padding: 12px;
  }
  .mission-card > div:first-child {
    font-size: 11px;
  }
  .dock {
    padding-left: 12px;
    padding-right: 12px;
  }
  .world-target {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .coral-options {
    gap: 6px;
  }
  .coral-options button {
    font-size: 11px;
  }
  .bottom-note > span {
    font-size: 5px;
  }
}
@media (max-height: 650px) {
  header {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .mission-card {
    padding: 10px 15px;
  }
  .progress-track {
    margin: 8px 0;
  }
  .dock {
    padding-top: 9px;
    padding-bottom: 6px;
  }
  .dock-label {
    margin-bottom: 4px;
    font-size: 7px;
  }
  .coral-options button {
    min-height: 48px;
  }
  .bottom-note {
    margin-top: 0;
  }
  .scene-caption {
    top: 9px;
  }
  .intro {
    padding-bottom: 20px;
  }
  .intro h1 {
    font-size: 29px;
    margin: 10px auto;
  }
  .intro p {
    margin-bottom: 14px;
    font-size: 11px;
  }
  .intro-foot {
    margin-top: 13px;
  }
  .eyebrow {
    font-size: 7px;
  }
}
@media (orientation: landscape) and (max-height: 550px) {
  .game-shell {
    max-width: none;
    min-height: 320px;
  }
  header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }
  .brand {
    max-width: 220px;
  }
  .mission-card {
    position: absolute;
    top: 74px;
    left: 0;
    width: 240px;
  }
  .dock {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 270px;
    border: 0;
    background: transparent;
  }
  .scene-caption {
    display: none;
  }
  #stage {
    margin-left: 270px;
    margin-top: 55px;
    margin-bottom: 15px;
  }
  .intro {
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(90deg, #205760 30%, #20576000 70%);
    padding: 60px 20px 10px;
  }
  .candy .intro {
    background: linear-gradient(90deg, #f3d8e3 30%, #f3d8e300 70%);
  }
  .intro-card {
    max-width: 260px;
  }
  .intro h1 {
    font-size: 26px;
  }
  .intro-foot {
    display: none;
  }
  .mission-card .stats {
    font-size: 9px;
  }
  .playing .mission-card {
    width: 230px;
  }
  #announcement {
    bottom: 12px;
    left: 68%;
  }
  .dialog-backdrop > section {
    max-height: 96%;
    padding: 16px 22px;
  }
  .dialog-art {
    display: none;
  }
  .dialog-backdrop p {
    margin-bottom: 10px;
  }
  .dialog-backdrop h2 {
    font-size: 22px;
    margin-bottom: 8px;
  }
  .dialog-backdrop .primary {
    min-height: 48px;
    padding: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
