:root {
  color-scheme: dark;
  --ink: #fffaf2;
  --muted: #c5b9aa;
  --panel: rgba(33, 28, 24, 0.9);
  --panel-2: #2d261f;
  --line: rgba(255, 250, 242, 0.16);
  --leaf: #83d66e;
  --teal: #73d7ca;
  --gold: #f7c85f;
  --rose: #f06d9e;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% 10%, rgba(115, 215, 202, 0.14), transparent 24rem),
    radial-gradient(circle at 92% 86%, rgba(247, 200, 95, 0.13), transparent 28rem),
    linear-gradient(145deg, #14120f 0%, #2a231d 46%, #15120f 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  min-height: 2.75rem;
  border: 1px solid rgba(255, 250, 242, 0.24);
  border-radius: 8px;
  background: #fffaf2;
  color: #211b16;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.48);
}

button:focus-visible {
  outline: 3px solid rgba(115, 215, 202, 0.6);
  outline-offset: 3px;
}

.app {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(340px, 780px) minmax(280px, 350px);
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  padding: 28px 0;
}

.garden-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: calc(100svh - 56px);
  overflow: hidden;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background: #17130f;
  box-shadow: 0 28px 82px rgba(0, 0, 0, 0.42);
}

#garden {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.panel {
  display: grid;
  align-content: center;
  gap: 14px;
}

.brand p,
.stats span,
.section-title span,
.best-row span,
.result p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 3px 0 0;
  font-size: clamp(2.35rem, 5.8vw, 4.35rem);
  line-height: 0.9;
  letter-spacing: 0;
}

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

.stats div,
.goals-block,
.patterns-block,
.best-row,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

.stats div {
  min-width: 0;
  padding: 12px;
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  line-height: 1;
  white-space: nowrap;
}

.goals-block,
.patterns-block {
  padding: 14px;
}

.section-title,
.best-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title strong,
.best-row strong {
  color: var(--teal);
  font-size: 0.95rem;
  white-space: nowrap;
}

.goals {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.goal {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.05);
}

.goal.is-done {
  opacity: 0.48;
}

.swatch {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.82), transparent 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, var(--light), var(--color) 55%, var(--dark));
  box-shadow: inset 0 4px 8px rgba(255, 255, 255, 0.16);
}

.goal span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.patterns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.patterns div {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 250, 242, 0.09);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.045);
}

.patterns span,
.patterns strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.patterns strong {
  color: var(--gold);
}

.patterns i {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
}

.patterns i::before,
.patterns i::after {
  content: "";
  position: absolute;
  background: var(--leaf);
}

.patterns .line::before {
  inset: 10px 2px;
  border-radius: 999px;
}

.patterns .bed::before {
  inset: 4px;
  border-radius: 5px;
}

.patterns .corner::before {
  width: 6px;
  height: 18px;
  left: 5px;
  top: 3px;
  border-radius: 999px;
}

.patterns .corner::after {
  width: 16px;
  height: 6px;
  left: 5px;
  bottom: 3px;
  border-radius: 999px;
}

.patterns .cross::before {
  width: 6px;
  height: 20px;
  left: 9px;
  top: 2px;
  border-radius: 999px;
}

.patterns .cross::after {
  width: 20px;
  height: 6px;
  left: 2px;
  top: 9px;
  border-radius: 999px;
}

.best-row {
  padding: 13px 14px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.controls button:last-child {
  background: transparent;
  color: var(--ink);
}

.result {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 18, 15, 0.64);
  backdrop-filter: blur(10px);
}

.result.is-hidden {
  display: none;
}

.result-panel {
  width: min(350px, 100%);
  padding: 24px;
  text-align: center;
}

.result h2 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 6vw, 3.15rem);
  line-height: 0.95;
}

.result button {
  width: 100%;
  margin-top: 18px;
}

@media (max-width: 880px) {
  .app {
    width: min(100vw - 20px, 660px);
    grid-template-columns: 1fr;
    align-content: start;
    padding: 10px 0 18px;
  }

  .garden-shell {
    max-height: none;
  }

  .panel {
    order: -1;
    gap: 10px;
  }

  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .brand h1 {
    font-size: clamp(2rem, 12vw, 3.25rem);
  }
}

@media (max-width: 480px) {
  .stats div,
  .goals-block,
  .patterns-block,
  .best-row {
    padding: 10px;
  }

  .goal {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    padding: 6px;
  }

  .swatch {
    width: 26px;
    height: 26px;
  }
}
