:root {
  --ink: #1d2722;
  --muted: #65736b;
  --paper: #fffaf1;
  --panel: #ffffff;
  --line: #dcd8cd;
  --leaf: #2f7d58;
  --leaf-dark: #205a41;
  --sun: #e6a536;
  --rose: #c95f6a;
  --sky: #577fa8;
  --pond: #7eb7c9;
  --soil: #b78255;
  --shadow: 0 18px 48px rgba(45, 41, 33, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 250, 241, 0.9), rgba(255, 250, 241, 0.72) 45%, rgba(255, 250, 241, 0.86)),
    linear-gradient(180deg, rgba(255, 250, 241, 0.78), rgba(255, 250, 241, 0.9)),
    url("./assets/ui/garden-page-background.png") center top / cover fixed,
    var(--paper);
}

body.is-diagnosing {
  background:
    linear-gradient(90deg, rgba(255, 250, 241, 0.22), rgba(255, 250, 241, 0.1) 48%, rgba(255, 250, 241, 0.24)),
    linear-gradient(180deg, rgba(255, 250, 241, 0.12), rgba(255, 250, 241, 0.3)),
    url("./assets/ui/garden-question-background-mobile.png") center top / cover fixed,
    var(--paper);
}

.app {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.top {
  padding: 10px 0 22px;
}

.back-link {
  color: var(--leaf-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.eyebrow,
h1,
.lead,
p {
  margin: 0;
}

.eyebrow {
  margin-top: 28px;
  color: var(--leaf-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin-top: 8px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.12;
  color: #263421;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 720px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.intro-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 48px);
  margin-top: 0;
  padding: 10px 0 28px;
}

.intro-poster-wrap {
  position: relative;
  width: min(430px, 100%);
  border-radius: 8px;
  overflow: hidden;
  background: #fffaf1;
  box-shadow: 0 22px 56px rgba(70, 55, 38, 0.2);
}

.intro-poster-wrap picture {
  display: block;
}

.intro-poster {
  display: block;
  width: 100%;
  height: auto;
}

.intro-start {
  position: absolute;
  left: 16.8%;
  right: 16.8%;
  bottom: 2.05%;
  height: 4.8%;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0);
  cursor: pointer;
}

.intro-start:focus-visible {
  outline: 4px solid rgba(47, 125, 88, 0.42);
  outline-offset: 3px;
}

.progress {
  margin: 8px 0 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 800;
}

.bar {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7dd;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--sun));
  transition: width 0.25s ease;
}

.panel,
.result {
  border: 1px solid rgba(29, 39, 34, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 28px);
  overflow: hidden;
}

.garden-board {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  min-height: 158px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 125, 88, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(139, 201, 218, 0.28), rgba(255, 255, 255, 0.08) 42%),
    linear-gradient(180deg, #f9f2d7 0%, #e6f3db 58%, #d5e9bf 100%);
}

.garden-board::before {
  content: "";
  position: absolute;
  inset: auto -40px -48px -40px;
  height: 72px;
  background:
    radial-gradient(ellipse at 20% 18%, rgba(47, 125, 88, 0.28), transparent 34%),
    radial-gradient(ellipse at 72% 28%, rgba(47, 125, 88, 0.24), transparent 38%);
  pointer-events: none;
}

.garden-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sun {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f2bd4b;
  box-shadow: 0 0 0 8px rgba(242, 189, 75, 0.18);
}

.cloud {
  position: absolute;
  width: 54px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 8px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 8px;
  width: 20px;
  height: 20px;
}

.cloud::after {
  right: 9px;
  width: 25px;
  height: 25px;
}

.cloud-a {
  top: 24px;
  left: 24px;
}

.cloud-b {
  top: 56px;
  right: 106px;
  transform: scale(0.68);
}

.board-path {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  max-width: 820px;
  margin: 28px auto 0;
}

.board-path::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 33px;
  height: 10px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(183, 130, 85, 0.55) 0 24px, rgba(183, 130, 85, 0.32) 24px 42px);
  transform: rotate(-2deg);
}

.board-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.step-dot {
  display: grid;
  place-items: center;
  width: clamp(34px, 5vw, 46px);
  aspect-ratio: 1;
  border: 2px solid #fff8e9;
  border-radius: 50%;
  background: #efe4c5;
  color: #72533e;
  box-shadow: 0 5px 12px rgba(76, 58, 39, 0.14);
  font-weight: 900;
  font-size: 14px;
}

.board-step.visited .step-dot {
  background: #f7cf79;
}

.board-step.active .step-dot {
  color: #fff;
  background: var(--rose);
  animation: hop 0.65s ease both;
}

.board-step.phase-child.visited .step-dot,
.board-step.phase-child.active .step-dot {
  background: #76a8ca;
  color: #fff;
}

.board-step.phase-result.visited .step-dot,
.board-step.phase-result.active .step-dot {
  background: var(--leaf);
}

.step-label {
  min-height: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #4d5d49;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.garden-note {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: fit-content;
  max-width: 100%;
  margin: 12px auto 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.garden-note strong {
  color: var(--leaf-dark);
}

.question-card {
  min-width: 0;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid rgba(29, 39, 34, 0.08);
  border-radius: 8px;
  background: #fffefb;
}

.question-meta {
  color: var(--leaf-dark);
  font-weight: 900;
}

.question {
  margin-top: 10px;
  font-size: clamp(23px, 4vw, 34px);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
  overflow-wrap: anywhere;
}

.choice-key {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 36px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f2df;
  color: var(--leaf-dark);
  font-size: 13px;
  text-transform: uppercase;
}

.choice-label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.choice:hover,
.choice:focus-visible {
  border-color: var(--leaf);
  outline: none;
  box-shadow: 0 0 0 4px rgba(47, 125, 88, 0.12);
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  min-width: 0;
}

.nav button,
.restart,
.copy {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--leaf);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.nav button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.result {
  padding: clamp(20px, 4vw, 36px);
}

.result-garden {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(47, 125, 88, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(139, 201, 218, 0.22), transparent 46%),
    linear-gradient(180deg, #fbf1cd 0%, #e7f0d0 58%, #cadeb0 100%);
}

.result-visual {
  position: relative;
  min-height: 280px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(47, 125, 88, 0.18);
  border-radius: 8px;
  background: #eef5df;
}

.result-visual img {
  display: block;
  width: 100%;
  height: clamp(260px, 38vw, 430px);
  object-fit: cover;
}

.result-visual p {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--leaf-dark);
  font-weight: 900;
  line-height: 1.55;
}

.result-garden::after {
  content: "";
  position: absolute;
  inset: auto -20px -52px -20px;
  height: 120px;
  background: #9fc879;
  border-radius: 50% 50% 0 0;
}

.place-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--leaf-dark);
  font-weight: 900;
}

.result-garden p {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--leaf-dark);
  font-weight: 900;
  line-height: 1.55;
}

.bloom {
  position: relative;
  z-index: 1;
  width: 158px;
  height: 232px;
  margin-top: 38px;
  animation: grow 0.8s ease both;
}

.petal,
.center,
.stem,
.leaf {
  position: absolute;
  display: block;
}

.petal {
  left: 55px;
  top: 18px;
  width: 52px;
  height: 74px;
  border-radius: 52px 52px 20px 20px;
  background: #f3c84f;
  transform-origin: 24px 58px;
}

.bloom.F .petal {
  background: #e36f81;
}

.bloom.G .petal {
  background: #7c68b0;
}

.bloom.H .petal {
  background: #e98bb7;
}

.p1 {
  transform: rotate(0deg) translateY(-18px);
}

.p2 {
  transform: rotate(90deg) translateY(-18px);
}

.p3 {
  transform: rotate(180deg) translateY(-18px);
}

.p4 {
  transform: rotate(270deg) translateY(-18px);
}

.center {
  left: 63px;
  top: 66px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8a5a2b;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.14);
}

.stem {
  left: 78px;
  top: 98px;
  width: 10px;
  height: 122px;
  border-radius: 999px;
  background: var(--leaf);
}

.leaf {
  top: 152px;
  width: 48px;
  height: 26px;
  border-radius: 50% 0 50% 0;
  background: #4f9b65;
}

.leaf.left {
  left: 36px;
  transform: rotate(28deg);
}

.leaf.right {
  right: 28px;
  transform: rotate(-28deg) scaleX(-1);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.type-card,
.advice {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.type-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
  font-weight: 900;
}

.type-card h2,
.advice h2 {
  margin: 14px 0 8px;
  font-size: 23px;
}

.type-card p,
.advice p {
  color: var(--muted);
  line-height: 1.8;
}

.advice {
  margin-top: 16px;
  border-color: rgba(201, 95, 106, 0.32);
  background: #fff9f7;
}

.quote {
  margin: 12px 0;
  color: var(--rose);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.copy {
  background: var(--sky);
}

@media (max-width: 720px) {
  .app {
    width: 100%;
    padding: 18px 10px 40px;
    padding-top: 18px;
  }

  .progress,
  .panel,
  .result {
    width: 100%;
    max-width: 100%;
  }

  .garden-board,
  .question-card {
    max-width: 100%;
    overflow: hidden;
  }

  .lead {
    font-size: 15px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 64px;
    font-size: 16px;
  }

  .garden-board {
    min-height: 220px;
    padding: 12px;
  }

  .board-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 30px;
  }

  .board-path::before {
    top: 48%;
    left: 17%;
    right: 17%;
    transform: rotate(90deg);
  }

  .garden-note {
    width: 100%;
    font-size: 12px;
  }

  .step-label {
    font-size: 9px;
    max-width: 58px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .question {
    font-size: 22px;
  }

  .nav button,
  .restart,
  .copy {
    min-width: 0;
    padding: 0 12px;
  }
}

@media (min-width: 760px) {
  body.is-diagnosing {
    background:
      linear-gradient(90deg, rgba(255, 250, 241, 0.24), rgba(255, 250, 241, 0.08) 48%, rgba(255, 250, 241, 0.24)),
      linear-gradient(180deg, rgba(255, 250, 241, 0.1), rgba(255, 250, 241, 0.28)),
      url("./assets/ui/garden-question-background-desktop.png") center center / cover fixed,
      var(--paper);
  }

  .intro-screen {
    min-height: calc(100vh - 56px);
    padding: 22px 0 34px;
  }

  .intro-poster-wrap {
    width: min(1120px, 100%);
  }

  .intro-start {
    left: 69.1%;
    right: 15.2%;
    bottom: 7.8%;
    height: 20.8%;
    border-radius: 50%;
  }
}

@keyframes hop {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-10px) scale(1.08);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes grow {
  from {
    transform: translateY(18px) scale(0.86);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
