/* びゅーふる美容お悩み診断 ── 見た目
 * 公式Instagram（@beautyfulence_）の世界観に合わせて：アイボリーの紙、深紅のサテンリボン、金の差し色、
 * 出展ブランド紹介の「赤白キャンディストライプ＋ピンクのアーチ＋二重線の赤枠」。
 * Layout: 1カラムのスマホ画面。結果は「リボンをかけたギフトカード」1枚にまとめてスクショしやすく。 */
:root {
  --bg: #fbf4ea;          /* アイボリー */
  --paper: #fffdf9;       /* カード */
  --blush: #fbe3e7;       /* 淡いピンク（アーチ・選択中・☆の行） */
  --blush-deep: #f1c0ca;  /* ピンクの線・飾り */
  --ribbon: #b8122f;      /* 深紅のサテンリボン */
  --ribbon-dark: #8a0c22;
  --on-ribbon: #ffffff;
  --gold: #b8913f;        /* 金の差し色 */
  --ink: #45212a;         /* 文字（ボルドーブラウン） */
  --muted: #866770;
  --line: #ecd8d4;
  --shadow: 0 12px 30px -18px rgba(138, 12, 34, 0.4);
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-script: "Great Vibes", "Snell Roundhand", "Apple Chancery", cursive;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 999px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1013; --paper: #28161b; --blush: #3b1d25; --blush-deep: #5a2a36;
    --ribbon: #ff5a6e; --ribbon-dark: #d83a50; --on-ribbon: #1c1013; --gold: #d9b56a;
    --ink: #fbecef; --muted: #cfa9b1; --line: #46262d;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1013; --paper: #28161b; --blush: #3b1d25; --blush-deep: #5a2a36;
  --ribbon: #ff5a6e; --ribbon-dark: #d83a50; --on-ribbon: #1c1013; --gold: #d9b56a;
  --ink: #fbecef; --muted: #cfa9b1; --line: #46262d;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 雪のような小さな水玉（ピンクと金） */
  background-image:
    radial-gradient(var(--blush-deep) 1px, transparent 1.6px),
    radial-gradient(color-mix(in srgb, var(--gold) 45%, transparent) 1px, transparent 1.6px);
  background-size: 24px 24px, 24px 24px;
  background-position: 0 0, 12px 12px;
  background-attachment: fixed;
}
a { color: inherit; }
.script {
  font-family: var(--font-script); font-weight: 400; font-size: 26px; line-height: 1.1;
  color: var(--ribbon); text-align: center; letter-spacing: .01em;
}
.ig { width: 1em; height: 1em; flex: none; vertical-align: -0.12em; }
.official {
  align-self: center; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ribbon); text-decoration: none; padding: 8px 12px; min-height: 44px;
}
.official:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ribbon); outline-offset: 2px; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.screen { display: flex; flex-direction: column; gap: 18px; animation: fade .28s ease both; }
@keyframes fade { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.eyebrow {
  font-size: 12px; letter-spacing: .08em; color: var(--muted);
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center;
}

/* ---------- ギフトカード（表紙・結果） ---------- */
.gift {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-top: 14px; /* リボンの輪がカードの上にはみ出す分 */
}
.gift__band { /* 赤白のキャンディストライプ＋金の縁 */
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--ribbon) 0 9px, var(--paper) 9px 18px);
  position: relative;
  border-radius: calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px) 0 0;
  border-bottom: 2px solid var(--gold);
}
.bow {
  display: block; width: 104px; height: 64px; margin: -48px auto 2px; position: relative; z-index: 1;
  color: var(--ribbon);
  filter: drop-shadow(0 3px 3px rgba(120, 10, 30, .18));
}
/* 日本語を文節で改行（対応ブラウザのみ） */
h1, h2, p, .opt__label, .chip { word-break: auto-phrase; }
.gift__body { padding: 8px 22px 26px; display: flex; flex-direction: column; gap: 14px; }

.cover .gift__body { text-align: center; align-items: center; padding-top: 6px; }
.cover h1 {
  margin: 4px 0 0; font-size: 26px; line-height: 1.4; font-weight: 700; letter-spacing: .02em;
  text-wrap: balance;
}
.cover p { margin: 0; color: var(--ink); text-wrap: balance; }
.flow {
  list-style: none; margin: 4px 0 0; padding: 0; width: 100%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  counter-reset: flow;
}
.flow li {
  counter-increment: flow;
  background: var(--blush); border-radius: 14px; padding: 10px 6px 9px;
  font-size: 12px; line-height: 1.45; color: var(--ink); text-align: center; word-break: auto-phrase;
}
.flow li::before {
  content: counter(flow); display: block; margin: 0 auto 4px; width: 22px; height: 22px; line-height: 22px;
  border-radius: 50%; background: var(--paper); color: var(--ribbon); font-weight: 700; font-size: 12px;
}

/* ---------- ボタン ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  min-height: 56px; padding: 14px 20px; border-radius: var(--r-sm);
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--ribbon); color: var(--on-ribbon); box-shadow: 0 8px 18px -10px var(--ribbon); }
.btn--primary:hover { background: var(--ribbon-dark); }
.btn--ghost { background: var(--paper); color: var(--ribbon); border: 1.5px solid var(--blush-deep); }
.btn[disabled] { background: var(--blush-deep); color: var(--paper); cursor: default; box-shadow: none; }
.btn-row { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* ---------- 質問 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.back {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--muted);
  font-size: 15px; padding: 10px 12px 10px 4px; min-height: 44px; display: inline-flex; align-items: center; gap: 4px;
}
.progress-label { font-size: 15px; font-weight: 700; color: var(--ribbon); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.progress-label small { color: var(--muted); font-weight: 500; }
.progress { height: 6px; border-radius: 6px; background: var(--blush); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ribbon); border-radius: 6px; transition: width .3s ease; }

.qtitle { margin: 6px 0 0; font-size: 21px; line-height: 1.55; font-weight: 700; text-wrap: balance; }
.hint { margin: -8px 0 0; font-size: 14px; color: var(--muted); }

.options { display: flex; flex-direction: column; gap: 10px; }
.section-head {
  font-size: 13px; font-weight: 700; color: var(--ribbon); letter-spacing: .06em;
  margin: 10px 0 -2px; display: flex; align-items: center; gap: 8px;
}
.section-head::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.opt {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  min-height: 58px; padding: 14px 16px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-md);
  display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.5;
  transition: border-color .15s ease, background .15s ease;
}
.opt:hover { border-color: var(--blush-deep); }
.opt__icon { font-size: 22px; width: 28px; text-align: center; flex: none; }
.opt__label { flex: 1; min-width: 0; }
.opt__mark {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--blush-deep); display: grid; place-items: center;
  font-size: 13px; color: transparent;
}
.opt.is-multi .opt__mark { border-radius: 7px; }
.opt[aria-pressed="true"] { background: var(--blush); border-color: var(--ribbon); font-weight: 700; }
.opt[aria-pressed="true"] .opt__mark { background: var(--ribbon); border-color: var(--ribbon); color: var(--on-ribbon); }
.opt--none { border-style: dashed; }

/* Q7 のジャンル（開いて選ぶ） */
.acc { border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--paper); overflow: hidden; }
.acc__head {
  appearance: none; border: 0; background: none; cursor: pointer; width: 100%; text-align: left;
  min-height: 56px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 700;
}
.acc__head .chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.acc.is-open .acc__head .chev { transform: rotate(180deg); }
.acc__pick { font-size: 12px; font-weight: 700; color: var(--on-ribbon); background: var(--ribbon); border-radius: 999px; padding: 2px 8px; }
.acc__body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.acc__body .opt { min-height: 52px; border-radius: 12px; }

.next-wrap { position: sticky; bottom: 0; padding-top: 6px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--bg) 30%); }

/* ---------- 結果（スマホ1画面に収まる密度） ---------- */
.result { gap: 14px; }
.result .gift__body { padding: 2px 14px 16px; gap: 9px; }
.result .eyebrow { font-size: 11px; gap: 6px; margin-top: -4px; }
.result .script { font-size: 22px; }
.r-title { padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.r-title { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 700; text-align: center; text-wrap: balance; }
.r-lead { margin: -2px 0 0; text-align: center; font-size: 14px; line-height: 1.6; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.chip {
  font-size: 11px; line-height: 1.4; padding: 3px 9px; border-radius: 999px;
  background: var(--blush); color: var(--ink); border: 1px solid var(--line);
}
.stars { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.star { /* 出展ブランド紹介の「二重線の赤枠」 */
  border: 3px double var(--ribbon); border-radius: 12px; padding: 8px 12px 10px;
  display: flex; flex-direction: column; gap: 2px; background: var(--paper);
}
.star__head { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.star__mark { color: var(--ribbon); font-weight: 700; font-size: 17px; }
.star__name { font-size: 17px; font-weight: 700; line-height: 1.4; }
.is-link {
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  border-bottom: 1.5px solid var(--blush-deep);
}
.is-link .ig { color: var(--ribbon); width: .85em; height: .85em; }
.is-link:hover, .is-link:focus-visible { border-bottom-color: var(--ribbon); }
.star__booth { font-size: 12px; font-weight: 700; color: var(--on-ribbon); background: var(--ribbon); border-radius: 999px; padding: 1px 8px; }
.star__genre { font-size: 11px; color: var(--muted); margin-left: auto; }
.star__why { font-size: 12px; color: var(--ribbon); font-weight: 700; margin: 0; line-height: 1.5; }
.star__ask { font-size: 14px; margin: 0; line-height: 1.6; }
.star__meta { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.star__meta b { color: var(--ink); font-weight: 700; }
.r-foot { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--ribbon); text-wrap: balance; }
.r-tags { margin: -4px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.shot-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- びゅーふるのうさぎ「◯◯うさぎ」タイプ ---------- */
.type {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px; border-radius: 20px;
  background: var(--blush); border: 1.5px dashed var(--blush-deep);
  position: relative;
}
.type::after { /* きらきら */
  content: "✦"; position: absolute; right: 12px; top: 6px; color: var(--gold); font-size: 16px;
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle { 50% { transform: scale(.7) rotate(20deg); opacity: .5; } }
.type__ring {
  width: 92px; height: 92px; border-radius: 50%; padding: 4px; flex: none;
  background: var(--paper); box-shadow: 0 0 0 3px var(--ribbon), 0 0 0 6px var(--gold);
  margin: 6px;
}
.type__bunny {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background-color: #f9ecef; background-repeat: no-repeat;
  animation: hop 3.2s ease-in-out infinite;
}
@keyframes hop { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-5px) rotate(-3deg); } 86% { transform: translateY(0) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .type::after, .type__bunny { animation: none; } }
.type__text { min-width: 0; }
.type__label { margin: 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.type__name { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 700; color: var(--ribbon); letter-spacing: .02em; word-break: keep-all; overflow-wrap: anywhere; }
.type__line { margin: 2px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink); }

/* ---------- シェア ---------- */
.share {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-lg);
  background: var(--paper); border: 1.5px solid var(--line);
}
.share__h { margin: 0; text-align: center; font-weight: 700; color: var(--ribbon); font-size: 15px; }
.share__h::before, .share__h::after { content: "♡"; color: var(--blush-deep); margin: 0 8px; }
.share__sub { margin: -6px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.share__row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.share__row .btn { white-space: nowrap; }
@media (min-width: 420px) { .share__row { grid-template-columns: 1fr 1fr; } .share__row .btn { font-size: 15px; padding-inline: 10px; } }
.share__save { min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.btn--ig {
  color: #fff; background: linear-gradient(45deg, #f7b24a 0%, #ee5a4f 30%, #d6297a 60%, #8a3ab9 100%);
  box-shadow: 0 8px 18px -10px #d6297a;
}
.btn--ig .ig { width: 19px; height: 19px; }
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1.5; text-align: center; box-shadow: var(--shadow);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.btn--x { background: #111; color: #fff; text-decoration: none; }
.btn--x:hover { background: #333; }
.xi { width: 18px; height: 18px; flex: none; }
.btn--plain { background: none; color: var(--muted); min-height: 48px; font-size: 15px; font-weight: 500; }
.btn--ghost { text-decoration: none; }
.btn.is-busy { opacity: .7; cursor: progress; }
a.btn--primary { text-decoration: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--x { background: #fff; color: #111; } }
:root[data-theme="dark"] .btn--x { background: #fff; color: #111; }

.sheet {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(69, 33, 42, .55); animation: fade .2s ease both;
}
.sheet__panel {
  width: min(420px, 100%); max-height: 100%; overflow: auto; background: var(--paper); border-radius: var(--r-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.sheet__title { margin: 0; text-align: center; font-weight: 700; color: var(--ribbon); }
.sheet__img { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); }
.sheet__img { -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
.sheet__hint { margin: 0; text-align: center; font-size: 13px; color: var(--muted); white-space: pre-line; }
.sheet__hint:has(+ .btn-row .btn--x), .sheet__hint.is-steps { text-align: left; }
a.btn--x { text-decoration: none; }

/* ---------- ブース一覧 ---------- */
.page-title { margin: 0; font-size: 22px; font-weight: 700; }
.note { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
.map { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--line); background: var(--paper); max-width: 100%; }
.map img { display: block; width: 100%; height: auto; }
.map__pin {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--ribbon); color: var(--on-ribbon); font-weight: 700; font-size: 14px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--paper);
}
.cat { display: flex; flex-direction: column; gap: 6px; }
.cat h3 { margin: 8px 0 2px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.cat h4 { margin: 6px 0 0; font-size: 13px; color: var(--ribbon); letter-spacing: .06em; }
.booth {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line);
}
.booth__mark { color: var(--blush-deep); font-weight: 700; }
.booth__name { font-weight: 700; min-width: 0; justify-self: start; }
a.booth__name { min-height: 28px; }
.booth__no { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.booth__concern { grid-column: 2 / 4; font-size: 13px; color: var(--muted); line-height: 1.55; }
.booth.is-star { background: var(--blush); border-color: var(--ribbon); }
.booth.is-star .booth__mark { color: var(--ribbon); }
