:root {
  --ink: #2a2024;
  --muted: #74676c;
  --wine: #a56d78;
  --wine-dark: #8f5b66;
  --rose: #a56d78;
  --pale: #f7eef1;
  --paper: #fffdfd;
  --line: #e8dce0;
  --shadow: 0 20px 70px rgba(165, 109, 120, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(165, 109, 120, .16), transparent 34%),
    linear-gradient(160deg, #fbf7f8 0%, #f2e7eb 100%);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.8;
}

button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(100% - 28px, 680px);
  margin: 0 auto;
  padding: 24px 0 56px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 4px 18px;
  color: var(--wine-dark);
}

.brand-mark { font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: .12em; font-weight: 700; }
.brand-sub { font-size: .65rem; letter-spacing: .16em; color: var(--muted); }

.panel, .result-view {
  background: rgba(255, 253, 253, .96);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.intro-view { padding: 48px 42px 36px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--rose); font-size: .72rem; font-weight: 700; letter-spacing: .16em; }
h1 { margin: 0; color: var(--wine-dark); font-family: Georgia, "Yu Mincho", serif; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.3; letter-spacing: .03em; }
.lead { max-width: 31rem; margin: 22px auto 25px; color: #55484d; font-size: 1rem; }

.character-stage { position: relative; width: min(100%, 590px); margin: 15px auto 2px; aspect-ratio: 2 / 1; }
.character-stage img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 25px rgba(70, 38, 50, .10)); }
.intro-meta { display: flex; justify-content: center; gap: 22px; margin-bottom: 24px; color: var(--muted); font-size: .82rem; }

.primary-button, .cta-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 17px 22px;
  color: white;
  background: linear-gradient(135deg, var(--wine), var(--wine-dark));
  box-shadow: 0 12px 28px rgba(76, 38, 53, .22);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.primary-button:hover, .cta-button:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(76, 38, 53, .27); }
.primary-button:focus-visible, .cta-button:focus-visible, .answer-button:focus-visible, .back-button:focus-visible { outline: 3px solid rgba(101,52,71,.28); outline-offset: 3px; }
.fine-print { margin: 18px 0 0; color: #8b7f83; font-size: .72rem; line-height: 1.65; }

.quiz-view { min-height: 560px; padding: 26px 34px 40px; }
.progress-row { display: grid; grid-template-columns: 34px 1fr 48px; gap: 12px; align-items: center; margin-bottom: 52px; }
.back-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--pale); color: var(--wine); cursor: pointer; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--line); }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--wine)); transition: width .3s ease; }
.progress-label { color: var(--muted); font-size: .78rem; text-align: right; }
.quiz-view h2 { margin: 0; font-size: clamp(1.3rem, 5vw, 1.7rem); line-height: 1.65; }
.question-note { min-height: 1.7em; margin: 8px 0 24px; color: var(--muted); font-size: .84rem; }
.answer-list { display: grid; gap: 11px; }
.answer-button { width: 100%; padding: 15px 17px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: white; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.answer-button:focus, .answer-button:focus-visible { outline: none; border-color: var(--line); }
.answer-button.is-selected { border-color: var(--rose); background: #f9edf0; color: var(--wine); }
@media (hover: hover) {
  .answer-button:hover { border-color: #c898a7; background: #fcf5f7; transform: translateX(3px); }
}

.result-view { overflow: hidden; }
.result-hero { padding: 34px 40px 34px; background: linear-gradient(150deg, #ad7883, #91606a); color: white; text-align: center; }
.result-hero .eyebrow { color: #f8e9ed; }
.result-animal { display: block; width: min(210px, 58vw); height: min(210px, 58vw); margin: 0 auto 4px; object-fit: contain; filter: drop-shadow(0 12px 22px rgba(80, 42, 54, .12)); }
.result-type { margin: 4px 0 8px; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(1.8rem, 7vw, 2.7rem); line-height: 1.35; }
.result-tagline { margin: 0; color: #f4dde4; font-size: .94rem; }
.result-body { padding: 34px 40px 40px; }
.result-section { padding: 0 0 27px; margin: 0 0 27px; border-bottom: 1px solid var(--line); }
.result-section:last-of-type { border-bottom: 0; }
.result-section h3 { margin: 0 0 10px; color: var(--wine); font-size: 1.04rem; }
.result-section p { margin: 0; color: #51464a; }
.result-section ul { margin: 9px 0 0; padding-left: 1.25rem; color: #51464a; }
.result-section li + li { margin-top: 5px; }
.care-card { padding: 20px; border-radius: 18px; background: var(--pale); }
.care-card strong { display: block; margin-bottom: 6px; color: var(--wine-dark); }
.consult-box { margin-top: 4px; padding: 27px 22px; border-radius: 20px; background: #fbf7f8; text-align: center; }
.consult-box h3 { margin: 0 0 9px; font-family: Georgia, "Yu Mincho", serif; color: var(--wine-dark); font-size: 1.35rem; }
.consult-box p { margin: 0 0 20px; color: #605459; font-size: .9rem; }
.restart-button { display: block; margin: 23px auto 0; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; }

[hidden] { display: none !important; }

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 680px); padding-top: 15px; }
  .brand { padding-left: 8px; }
  .intro-view { padding: 38px 22px 28px; border-radius: 23px; }
  .character-stage { width: calc(100% + 22px); margin-left: -11px; }
  .quiz-view { min-height: calc(100vh - 100px); padding: 22px 20px 32px; border-radius: 23px; }
  .progress-row { margin-bottom: 40px; }
  .result-view { border-radius: 23px; }
  .result-hero { padding: 36px 22px 29px; }
  .result-body { padding: 28px 21px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
