:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #5d654f;
  --green: #3f9d50;
  --deep-green: #24793f;
  --pink: #dd5d8f;
  --cream: #fff9e9;
  --paper: rgba(255, 255, 255, 0.82);
  --line: rgba(128, 112, 68, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Comic Sans MS", "Yu Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.95) 0 13rem, transparent 13.2rem),
    radial-gradient(circle at 84% 3%, rgba(255, 255, 255, 0.86) 0 14rem, transparent 14.3rem),
    linear-gradient(115deg, #fff7df 0%, #fffdf3 42%, #edf6d1 100%);
  overflow-x: hidden;
  zoom: 0.9;
}

button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.app {
  position: relative;
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 28px;
  min-height: 100vh;
  padding: 24px 24px 34px;
}

.app::before {
  position: fixed;
  inset: auto -8vw -9vw -8vw;
  height: 18vw;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #b6db72, #78b656);
  content: "";
  pointer-events: none;
}

.side-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 48px);
  padding: 28px 24px 18px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 18px 58px rgba(113, 96, 45, 0.14);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 8px 2px;
}

.brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  line-height: 0.96;
  letter-spacing: 0;
}

.brand p {
  margin-top: 12px;
  font-size: 15px;
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-weight: 700;
}

.camera-card {
  position: relative;
  margin-top: 8px;
  padding-top: 34px;
}

.camera-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  min-width: 210px;
  padding: 9px 22px 11px;
  border-radius: 18px 0 0 0;
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.camera-ribbon::after {
  position: absolute;
  right: -22px;
  top: 0;
  border-top: 20px solid var(--green);
  border-bottom: 20px solid var(--green);
  border-right: 22px solid transparent;
  content: "";
}

.viewer {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.53 / 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #172d2c, #203b36),
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(255, 255, 255, 0.05) 16px 32px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

video,
canvas,
.empty-state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

video {
  object-fit: cover;
  opacity: 0;
  transform: scaleX(-1);
}

canvas {
  background: #172d2c;
  pointer-events: none;
}

.empty-state {
  display: grid;
  place-items: center;
  color: #f8ffe8;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 224, 91, 0.2), transparent 10rem),
    linear-gradient(135deg, rgba(47, 125, 92, 0.76), rgba(24, 48, 44, 0.96));
  font-size: 20px;
  font-weight: 900;
}

.empty-state.is-hidden {
  display: none;
}

.detect-badge {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 999px;
  background: #77bd58;
  color: white;
  box-shadow: 0 7px 20px rgba(47, 107, 42, 0.25);
  font-size: 15px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-weight: 900;
  letter-spacing: 0.1em;
  opacity: 0.88;
}

.detect-badge.is-hot {
  background: #4aa94d;
}

.score-card {
  padding: 2px 10px 0;
}

.label {
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 900;
}

.score-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.score-row strong {
  color: #42945a;
  font-size: 56px;
  line-height: 1;
}

.meter-track {
  overflow: hidden;
  height: 18px;
  border-radius: 999px;
  background: #e3ead1;
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54a65b, #d7d95d, #ff7b62);
  transition: width 160ms ease;
}

.meter-flower {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #ffeff4;
  color: #e76d93;
  font-size: 28px;
}

.score-copy {
  min-height: 20px;
  overflow: hidden;
  margin-top: 8px;
  color: #222;
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 6px;
}

.controls button {
  min-height: 46px;
  color: white;
  background: linear-gradient(180deg, #3f9d50, #2b7d3d);
  box-shadow: 0 10px 22px rgba(39, 125, 61, 0.2);
}

.controls .secondary {
  color: #111;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: none;
}

.status {
  height: 54px;
  overflow: hidden;
  padding: 11px 14px;
  border: 1px solid rgba(63, 157, 80, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #4f5c43;
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.hint-card {
  margin: 4px 0 0;
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(244, 246, 203, 0.62);
  font-family: "Yu Gothic", system-ui, sans-serif;
}

.hint-card p {
  margin-bottom: 7px;
  font-weight: 900;
}

.hint-card ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
}

.mascot-note {
  display: grid;
  grid-template-columns: 128px 1fr;
  align-items: end;
  gap: 8px;
  margin-top: auto;
}

.mascot-note img {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

.mascot-note p {
  position: relative;
  margin-bottom: 8px;
  padding: 18px 20px;
  border-radius: 50%;
  background: rgba(246, 247, 225, 0.96);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.7;
  transform: rotate(-8deg);
}

.main-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr) auto auto;
  gap: 22px;
  min-width: 0;
  padding: 34px 0 0;
}

.headline {
  text-align: center;
}

.headline h2 {
  display: inline;
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: 1;
  background: linear-gradient(transparent 60%, #ffe56a 60%);
}

.headline p {
  margin-top: 18px;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 900;
}

.garden-card {
  position: relative;
  overflow: hidden;
  contain: layout paint;
  min-height: 520px;
  margin-top: 8px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 54px rgba(111, 95, 52, 0.13);
}

.garden-card::before {
  position: absolute;
  inset: 90px 36px 86px;
  background:
    repeating-linear-gradient(90deg, transparent 0 110px, rgba(219, 206, 148, 0.36) 111px 112px),
    repeating-linear-gradient(0deg, transparent 0 84px, rgba(219, 206, 148, 0.2) 85px 86px);
  content: "";
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 84%, transparent);
}

.garden-meta {
  position: absolute;
  top: 34px;
  left: 34px;
  z-index: 4;
}

.garden-meta span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf0d6;
  color: #374231;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.garden-meta strong {
  display: block;
  min-width: 220px;
  margin-top: 8px;
  color: var(--pink);
  font-size: clamp(42px, 5vw, 62px);
  line-height: 1;
}

.garden-meta p {
  margin-top: 8px;
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-weight: 900;
}

.garden {
  position: absolute;
  inset: 0;
  overflow: hidden;
  contain: layout paint;
}

.garden::after {
  position: absolute;
  right: 24px;
  bottom: 54px;
  left: 24px;
  height: 86px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, rgba(199, 223, 141, 0.92), rgba(154, 204, 107, 0.92));
  content: "";
}

.static-flower,
.flower {
  position: absolute;
  z-index: 2;
  contain: layout paint style;
  width: var(--size, 112px);
  transform: translateX(-50%) rotate(var(--tilt, 0deg));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 7px rgba(53, 104, 56, 0.15));
  animation: sprout 620ms cubic-bezier(0.2, 0.9, 0.2, 1.1) both;
  cursor: crosshair;
  will-change: transform, opacity;
}

.flower img {
  display: block;
  width: 100%;
}

.static-flower.is-destroyed,
.flower.is-destroyed {
  pointer-events: none;
  animation: flower-collapse 160ms ease-in both;
}

.burst-particle,
.burst-ring {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.burst-particle {
  width: var(--piece-size, 10px);
  height: var(--piece-size, 10px);
  border-radius: 38% 62% 52% 48%;
  background: var(--piece-color, #e94424);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.26);
  animation: burst-piece 780ms cubic-bezier(0.12, 0.82, 0.24, 1) forwards;
}

.burst-ring {
  width: 28px;
  height: 28px;
  border: 4px solid rgba(255, 35, 12, 0.74);
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.48),
    0 0 26px rgba(228, 46, 18, 0.7);
  transform: translate(-50%, -50%) scale(0.35);
  animation: burst-ring 460ms ease-out forwards;
}

.f1 {
  --size: 118px;
  left: 18%;
  bottom: 58px;
}

.f2 {
  --size: 136px;
  left: 28%;
  bottom: 78px;
}

.f3 {
  --size: 150px;
  left: 48%;
  bottom: 98px;
}

.f4 {
  --size: 106px;
  left: 66%;
  bottom: 70px;
}

.f5 {
  --size: 132px;
  left: 78%;
  bottom: 112px;
}

.f6 {
  --size: 118px;
  left: 91%;
  bottom: 70px;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 26px;
  padding: 24px 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 42px rgba(111, 95, 52, 0.13);
}

.summary-bar article {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding: 0 22px;
  border-right: 1px solid var(--line);
}

.summary-bar article:last-child {
  border-right: 0;
}

.summary-bar img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.summary-bar h3 {
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 900;
}

.summary-bar p {
  min-height: 48px;
  overflow: hidden;
  margin-top: 9px;
  font-family: "Yu Gothic", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.privacy-line {
  color: white;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 4px rgba(53, 104, 56, 0.26);
}

.share-button {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  padding: 17px 33px;
  border-radius: 16px;
  background: #e95d8d;
  color: white;
  box-shadow: 0 16px 32px rgba(211, 75, 123, 0.28);
}

@keyframes sprout {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(22px) scale(0.34) rotate(var(--tilt, 0deg));
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(var(--tilt, 0deg));
  }
}

@keyframes flower-collapse {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.1) rotate(var(--tilt, 0deg));
    filter: saturate(0) brightness(0.45);
  }
}

@keyframes burst-piece {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }
  58% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.08) rotate(var(--rot));
  }
}

@keyframes burst-ring {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(7);
  }
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: auto;
  }

}

@media (max-width: 760px) {
  .app {
    padding: 14px;
  }

  .side-panel {
    border-radius: 22px;
  }

  h1 {
    font-size: 32px;
  }

  .headline h2 {
    font-size: 36px;
  }

  .garden-card {
    min-height: 470px;
  }

  .summary-bar {
    grid-template-columns: 1fr;
    margin: 0;
    padding: 18px;
  }

  .summary-bar article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }

  .summary-bar article:last-child {
    border-bottom: 0;
  }

  .privacy-line {
    font-size: 15px;
  }
}
