:root {
  color-scheme: light;
  --ink: #211f24;
  --muted: #6f6870;
  --paper: #fffaf3;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(58, 50, 48, 0.14);
  --tomato: #df5d46;
  --mustard: #e8b83e;
  --mint: #5aa876;
  --blue: #4a91b8;
  --plum: #725096;
  --shadow: 0 24px 60px rgba(43, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(255, 255, 255, 0.97) 48%, #f8fbf8),
    radial-gradient(circle at 12% 12%, rgba(223, 93, 70, 0.16), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(74, 145, 184, 0.18), transparent 25%),
    radial-gradient(circle at 50% 92%, rgba(90, 168, 118, 0.14), transparent 30%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.lang-toggle {
  position: fixed;
  z-index: 20;
  top: 14px;
  right: 14px;
  min-width: 54px;
  min-height: 34px;
  border: 1px solid rgba(35, 25, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #5d5258;
  box-shadow: 0 8px 24px rgba(73, 45, 34, 0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 880;
  backdrop-filter: blur(14px);
}

.app {
  width: min(100%, 840px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 18px;
  display: grid;
  place-items: center;
}

body.is-result-view .app {
  width: min(100%, 450px);
  padding: 14px 24px 28px;
  display: block;
}

.view {
  display: none;
  width: 100%;
}

.view.is-active {
  display: block;
}

.view-home {
  text-align: center;
}

.mini-label {
  margin: 0 0 10px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  width: min(100%, 620px);
  margin: 0 auto;
  color: #2c2528;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 76px;
  font-weight: 760;
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(232, 184, 62, 0.66), 0 18px 34px rgba(44, 37, 40, 0.12);
}

.food-wall {
  width: min(100%, 470px);
  margin: 18px auto 24px;
  display: grid;
  gap: 9px;
  overflow: hidden;
  padding: 4px 0;
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.food-row {
  width: 100%;
  overflow: hidden;
}

.food-track {
  width: max-content;
  display: flex;
  gap: 9px;
  animation: slide-left var(--duration, 24s) linear infinite;
}

.food-row.is-reverse .food-track {
  animation-name: slide-right;
}

@keyframes slide-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes slide-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.home-copy {
  width: min(100%, 520px);
  margin: 0 auto;
}

.home-copy h2,
.question-title,
.result-name,
.mix-name {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
}

.home-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 720;
}

.primary-action,
.secondary-action,
.nav-action {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
  font-weight: 880;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-action {
  width: min(100%, 360px);
  margin-top: 22px;
  background: #252227;
  color: #fff;
  box-shadow: 0 10px 0 rgba(37, 34, 39, 0.17), 0 18px 36px rgba(37, 34, 39, 0.14);
}

.primary-action:hover,
.secondary-action:hover,
.nav-action:hover,
.option-button:hover {
  transform: translateY(-2px);
}

.primary-action:active,
.secondary-action:active,
.nav-action:active,
.option-button:active {
  transform: translateY(1px);
}

.play-mark,
.lab-mark,
.save-mark {
  width: 24px;
  height: 24px;
  position: relative;
  flex: 0 0 24px;
}

.play-mark {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.play-mark::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.lab-mark {
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.lab-mark::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -3px;
  width: 6px;
  height: 9px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.lab-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
}

.save-mark {
  width: 18px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-width: 6px;
  border-radius: 4px;
}

.save-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 4px;
  background: currentColor;
}

.fine-print {
  margin: 34px 0 0;
  color: #948b91;
  font-size: 13px;
  font-weight: 820;
}

.quiz-shell {
  width: min(100%, 462px);
  margin: 0 auto;
}

.quiz-topbar {
  margin-bottom: 30px;
}

.progress-wrap {
  display: grid;
  gap: 12px;
  text-align: center;
}

.progress-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 840;
}

.progress-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(111, 104, 112, 0.18);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--tomato), var(--mustard), var(--mint), var(--blue), var(--plum));
  transition: width 240ms ease;
}

.question-meta {
  min-height: 60px;
  margin-bottom: 24px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(14px);
}

.question-kicker {
  color: #9d4c3e;
  font-size: 14px;
  font-weight: 860;
}

.question-title {
  margin-bottom: 10px;
}

.question-body {
  margin: 0 0 26px;
  color: #676066;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 690;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-button {
  min-height: 62px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(111, 104, 112, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 26px rgba(43, 35, 31, 0.06);
  backdrop-filter: blur(12px);
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(232, 184, 62, 0.22);
  color: #32262a;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
}

.option-text {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.option-button.is-selected {
  border-color: rgba(223, 93, 70, 0.76);
  background: rgba(255, 247, 235, 0.98);
  box-shadow: 0 9px 0 rgba(223, 93, 70, 0.15);
}

.quiz-nav {
  width: 100%;
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nav-action {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid transparent;
  font-size: 14px;
  box-shadow: none;
  overflow: hidden;
}

.nav-action.is-primary {
  background: linear-gradient(135deg, #2b282e, #17161a);
  color: #fff;
  box-shadow: 0 7px 0 rgba(37, 34, 39, 0.14), 0 14px 28px rgba(37, 34, 39, 0.12);
}

.nav-action.is-secondary {
  border-color: rgba(111, 104, 112, 0.24);
  background: rgba(255, 255, 255, 0.78);
  color: #5a5258;
}

.nav-action:disabled {
  cursor: not-allowed;
  background: #ded9d1;
  color: rgba(49, 45, 42, 0.52);
  box-shadow: none;
  opacity: 0.75;
}

.food-avatar {
  width: 82px;
  aspect-ratio: 1;
  border: 1px solid rgba(111, 104, 112, 0.18);
  border-radius: 8px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 243, 0.72)),
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.88), transparent 38%);
  box-shadow: 0 12px 26px rgba(43, 35, 31, 0.08);
}

.food-avatar::before {
  content: "";
  position: absolute;
  inset: auto 10px 9px;
  height: 8px;
  border-radius: 50%;
  background: rgba(35, 25, 29, 0.08);
}

.emoji-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 7px 12px rgba(35, 25, 29, 0.12));
}

.meta-food .emoji-symbol {
  font-size: 24px;
}

.wall-food .emoji-symbol {
  font-size: 38px;
}

.result-avatar .emoji-symbol {
  font-size: 86px;
}

.reaction-stage .emoji-symbol {
  font-size: 72px;
}

.meta-food {
  width: 44px;
  flex: 0 0 44px;
}

.wall-food {
  width: 78px;
  flex: 0 0 78px;
}

.result-avatar {
  width: 166px;
  margin: 0 auto 28px;
  box-shadow: 0 18px 44px rgba(43, 35, 31, 0.12);
}

.view-result {
  width: 100%;
  max-width: 372px;
  margin: 0 auto;
}

.result-card {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

.result-topline {
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #9d949a;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 720;
}

.result-kicker {
  margin: 0 0 8px;
  color: #9d949a;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 850;
}

.result-name,
.mix-name {
  max-width: 100%;
  margin: 0 auto;
  color: #111;
  font-size: 31px;
  line-height: 1.1;
  font-weight: 930;
  overflow-wrap: anywhere;
}

.result-subtitle,
.mix-subtitle {
  margin: 8px 0 0;
  color: #9d949a;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 850;
}

.result-punchline {
  margin: 28px 0 0;
  padding: 15px 18px;
  border-radius: 8px;
  background: #f4f4f4;
  color: #252525;
  font-size: 17px;
  line-height: 1.48;
  font-weight: 560;
  text-align: left;
}

.tag-heading {
  margin: 24px 0 12px;
  color: #9d949a;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 850;
  text-align: left;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.tag-row span,
.food-ideas span,
.chem-grid span {
  padding: 8px 12px;
  border-radius: 8px;
  background: #f5f5f5;
  color: #171717;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 850;
}

.tag-row span:nth-child(2n),
.food-ideas span:nth-child(2n),
.chem-grid span:nth-child(2n) {
  background: #edf5f1;
}

.tag-row span:nth-child(3n),
.food-ideas span:nth-child(3n),
.chem-grid span:nth-child(3n) {
  background: #fff1d0;
}

.result-desc {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #ececec;
  color: #49464a;
  font-size: 16px;
  line-height: 1.58;
  font-weight: 450;
  text-align: left;
  overflow-wrap: anywhere;
}

.food-ideas {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-start;
}

.food-ideas::before {
  content: attr(data-label);
  width: 100%;
  color: #9d949a;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
  text-align: left;
}

.view:not(.is-active) .food-ideas::before {
  content: none;
}

.result-actions {
  width: 100%;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.result-actions .primary-action,
.result-actions .secondary-action {
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding-inline: 20px;
}

.primary-action.compact {
  background: #111;
  color: #fff;
  box-shadow: none;
  font-size: 17px;
}

.secondary-action {
  border: 1px solid rgba(111, 104, 112, 0.22);
  background: #fff;
  color: #5a5258;
}

.reaction-stage {
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  gap: 8px;
}

.reaction-stage .food-avatar {
  width: 142px;
}

.plus-sign {
  color: #df5d46;
  font-size: 34px;
  font-weight: 950;
}

.reaction-meter {
  margin: 22px 0 0;
  min-height: 62px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reaction-meter span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 850;
}

.reaction-meter strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

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

.mix-line {
  margin-top: 18px;
}

@media (max-width: 620px) {
  .app {
    padding: 26px 16px;
  }

  body.is-result-view .app {
    padding: 12px 22px 26px;
  }

  h1 {
    font-size: 48px;
  }

  .home-copy h2,
  .question-title {
    font-size: 26px;
  }

  .food-wall {
    width: min(100%, 354px);
  }

  .wall-food {
    width: 70px;
    flex-basis: 70px;
  }

  .result-avatar {
    width: 150px;
  }

  .reaction-stage .food-avatar {
    width: min(31vw, 132px);
  }
}

@media (min-width: 760px) and (max-height: 780px) {
  .app {
    padding-block: 18px;
  }

  h1 {
    font-size: 66px;
  }

  .food-wall {
    margin: 12px auto 16px;
  }

  .home-copy h2 {
    font-size: 28px;
  }

  .home-copy p {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
