:root {
  --bg: #f4f7f2;
  --card: #ffffff;
  --text: #162016;
  --muted: #6b756d;
  --green: #2f8a24;
  --green-soft: #e6f3e3;
  --border: #dfe7dc;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: linear-gradient(180deg, #2f8a24, #2c7d22);
  color: #fff;
  padding: 18px 0 22px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.header-text h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.header-text p {
  margin: 0.4rem 0 0;
  opacity: 0.92;
  max-width: 60ch;
}

.header-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.back-btn,
.info-btn,
.primary {
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-btn,
.info-btn {
  background: #f0f7ee;
  color: #245f1e;
}

.primary {
  background: var(--green);
  color: #fff;
}

.header-image {
  display: block;
  width: min(1100px, calc(100% - 32px));
  margin: 18px auto 0;
  border-radius: 22px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.intro {
  padding: 18px 0 8px;
}

.intro h3 {
  font-size: 1.65rem;
  margin: 0 0 8px;
}

.intro p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1.03rem;
}

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

.choice {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 15px;
  text-align: left;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
  transition: 0.18s ease;
}

.choice strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.choice span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.choice.active {
  border-color: var(--green);
  background: linear-gradient(180deg, #f5fbf3, #eef8ec);
}

.choices.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choices.compact .choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  min-height: 64px;
}

.choices.compact .choice .icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  background: #f3f7f1;
  border: 1px solid #e1eadc;
  border-radius: 12px;
  color: var(--green);
}

.choices.compact .choice .icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.choices.compact .choice div {
  min-width: 0;
}

.choices.compact .choice strong {
  margin-bottom: 2px;
  font-size: 0.98rem;
  display: block;
}

.choices.compact .choice span {
  font-size: 0.86rem;
  line-height: 1.25;
  display: block;
}

.stepcard,
.resultcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}

.stephead h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.stephead p {
  margin: 0;
  color: var(--muted);
}

.stepform {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill,
.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}

.pill.active {
  background: var(--green-soft);
  border-color: var(--green);
  color: #1f5d19;
  font-weight: 700;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-bottom: 2px;
}

.preset-chips .chip {
  background: #eef4ea;
  color: #203220;
}

.preset-chips .chip:hover {
  border-color: var(--green);
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.resultbox {
  margin-top: 14px;
}

.menu-gang {
  background: #f6faf5;
  border: 1px solid #e3ece0;
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}

.gang-title {
  margin: 0 0 8px;
  color: #215f1c;
}

.recipe-title,
.menu-title {
  margin: 0 0 8px;
}

.recipe-desc {
  color: var(--muted);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: #eef4ea;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.5rem;
  cursor: pointer;
}

.popup-box {
  position: relative;
  background: #fff;
  border-radius: 22px;
  max-width: 920px;
  width: calc(100% - 28px);
  margin: 6vh auto;
  padding: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  max-height: 88vh;
  overflow: auto;
}

.popup-actions,
.info-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.popup-actions .primary {
  background: #2f8a24;
}

.popup-content .menu-gang {
  break-inside: avoid;
}

#popup,
#infoPopup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 60;
}

#popup.open,
#infoPopup.open {
  opacity: 1;
  pointer-events: auto;
}

.info-text {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #223122;
}

@media (max-width: 780px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .choices,
  .choices.compact {
    grid-template-columns: 1fr;
  }

  .header-image {
    width: calc(100% - 20px);
    border-radius: 18px;
  }

  .wrap {
    width: min(1100px, calc(100% - 20px));
  }

  .choices.compact .choice {
    padding: 12px 13px;
  }
}