:root {
  --cream: #fff8ef;
  --paper: #fffdf8;
  --card: rgba(255, 253, 248, 0.86);
  --card-strong: rgba(255, 255, 255, 0.94);
  --ink: #352a22;
  --muted: #79695a;
  --soft: #bfa78d;
  --line: rgba(154, 128, 98, 0.18);
  --green: #9dbd94;
  --green-deep: #58744e;
  --orange: #efa863;
  --orange-deep: #bf6d2f;
  --brown: #8d6747;
  --shadow: 0 22px 60px rgba(92, 66, 39, 0.13);
  --shadow-soft: 0 14px 34px rgba(92, 66, 39, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 222, 177, 0.55), transparent 28%),
    radial-gradient(circle at 92% 14%, rgba(190, 218, 176, 0.45), transparent 30%),
    linear-gradient(140deg, #fff8ef 0%, #f8ead8 48%, #eef5e7 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.42;
}

.ambient-a {
  width: 180px;
  height: 180px;
  left: -72px;
  top: 120px;
  background: rgba(239, 168, 99, 0.22);
}

.ambient-b {
  width: 220px;
  height: 220px;
  right: -92px;
  bottom: 130px;
  background: rgba(157, 189, 148, 0.22);
}

.ambient-c {
  width: 120px;
  height: 120px;
  left: 58%;
  top: 30px;
  background: rgba(255, 255, 255, 0.48);
}

.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 10;
  display: flex;
  width: min(100%, 980px);
  align-items: center;
  gap: 10px;
  padding: 16px 20px 10px;
  transform: translateX(-50%);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
  font-size: 22px;
}

.brand-name {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-sub {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 84px 18px 48px;
}

.screen {
  display: grid;
  min-height: calc(100vh - 132px);
  align-items: center;
}

.hero-layout {
  display: grid;
  gap: 22px;
  align-items: center;
}

.hero-card,
.quiz-card,
.result-card,
.mini-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  overflow: hidden;
  border-radius: 30px;
  padding: 28px 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brown);
  font-size: 12px;
  font-weight: 900;
}

.title {
  margin: 0;
  font-size: clamp(34px, 9vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.subtitle {
  max-width: 600px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.8;
}

.copyright-card {
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.copyright-card h2 {
  margin: 0 0 12px;
  color: var(--brown);
  font-size: 18px;
  font-weight: 1000;
  text-align: center;
}

.copyright-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.8;
}

.copyright-card strong {
  color: var(--ink);
  font-weight: 1000;
}

.copyright-note {
  margin-top: 12px;
}

.agree-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.5;
}

.agree-row input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--orange);
}

.pet-cloud {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 24px 0;
}

.pet-chip {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 25px;
  box-shadow: 0 8px 20px rgba(92, 66, 39, 0.06);
}

.invite-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.invite-actions {
  display: grid;
  gap: 10px;
}

.input-row {
  display: grid;
  gap: 10px;
}

.input-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.invite-input {
  width: 100%;
  height: 54px;
  border: 1.5px solid rgba(141, 103, 71, 0.2);
  border-radius: 18px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 16px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.invite-input:focus {
  border-color: rgba(157, 189, 148, 0.95);
  box-shadow: 0 0 0 4px rgba(157, 189, 148, 0.18);
}

.status-text {
  min-height: 22px;
  margin: 0;
  color: var(--orange-deep);
  font-size: 14px;
  font-weight: 900;
}

.status-text.success {
  color: var(--green-deep);
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #d98b46 52%, var(--green));
  box-shadow: 0 14px 28px rgba(191, 109, 47, 0.22);
  font-weight: 900;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(191, 109, 47, 0.28);
}

.button:active {
  transform: scale(0.98);
}

.button.secondary {
  color: var(--brown);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.button.ghost {
  color: var(--green-deep);
  background: rgba(238, 245, 231, 0.88);
  box-shadow: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.quiz-card {
  width: min(100%, 720px);
  margin: 0 auto;
  border-radius: 28px;
  padding: 20px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #c7d89a, var(--orange));
  transition: width 0.25s ease;
}

.question-title {
  margin: 22px 0 18px;
  font-size: clamp(23px, 6vw, 34px);
  line-height: 1.35;
  letter-spacing: 0;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border: 1.5px solid rgba(141, 103, 71, 0.14);
  border-radius: 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.66);
  padding: 14px;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 24px rgba(92, 66, 39, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.option:hover {
  transform: translateY(-2px);
  border-color: rgba(157, 189, 148, 0.72);
}

.option.selected {
  border-color: rgba(191, 109, 47, 0.58);
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.96), rgba(238, 245, 231, 0.84));
}

.option-key {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 13px;
  background: rgba(157, 189, 148, 0.2);
  color: var(--green-deep);
  font-weight: 1000;
}

.option.selected .option-key {
  background: var(--orange);
  color: #fff;
}

.option-text {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.result-wrap {
  display: grid;
  gap: 16px;
  width: min(100%, 860px);
  margin: 0 auto;
}

.result-card {
  overflow: hidden;
  border-radius: 32px;
  padding: 22px;
}

.result-hero {
  display: grid;
  gap: 18px;
}

.result-icon {
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  border-radius: 34px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(135deg, rgba(239, 168, 99, 0.32), rgba(157, 189, 148, 0.32));
  box-shadow: var(--shadow-soft);
  font-size: 60px;
}

.result-title {
  margin: 0;
  font-size: clamp(30px, 7vw, 48px);
  line-height: 1.14;
  letter-spacing: 0;
}

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

.badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brown);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 950;
}

.match-badge {
  background: rgba(157, 189, 148, 0.22);
  color: var(--green-deep);
}

.analysis-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.mini-card {
  border-radius: 22px;
  padding: 16px;
}

.mini-card h3 {
  margin: 0 0 8px;
  color: var(--brown);
  font-size: 16px;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.8;
}

.alternatives {
  display: grid;
  gap: 12px;
}

.alt-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  padding: 12px;
}

.alt-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: rgba(157, 189, 148, 0.18);
  font-size: 30px;
}

.alt-card h3 {
  margin: 0;
  font-size: 16px;
}

.alt-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score {
  color: var(--orange-deep);
  font-size: 16px;
  font-weight: 1000;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 50;
  border-radius: 999px;
  background: rgba(53, 42, 34, 0.88);
  color: #fff;
  padding: 11px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 900;
  transform: translate(-50%, 100px);
  transition: transform 0.22s ease;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (min-width: 760px) {
  .app {
    padding-inline: 28px;
  }

  .hero-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .hero-card {
    padding: 38px;
  }

  .invite-box {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .pet-cloud {
    grid-template-columns: repeat(3, 1fr);
    align-self: stretch;
    margin: 0;
  }

  .pet-chip {
    min-height: 90px;
    border-radius: 26px;
    font-size: 38px;
  }

  .quiz-card {
    padding: 28px;
  }

  .result-hero {
    grid-template-columns: 136px 1fr;
    align-items: center;
  }

  .analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 380px) {
  .app {
    padding-inline: 12px;
  }

  .pet-cloud {
    grid-template-columns: repeat(3, 1fr);
  }

  .quiz-actions {
    grid-template-columns: 1fr;
  }
}
