/* Layout: ルルヘアの店内（ベージュの壁・オリーブのいす・金のミラー枠）をそのままアプリの色に。
   上にロゴのアプリバー、ホームは店内写真のヒーロー＋写真つき診断カード、質問中は店内写真をうすく背景に。
   店のベージュの世界観に合わせて、あえてライトテーマ1つで統一。 */
:root {
  --bg: #f1efe4;        /* 店のベージュ */
  --surface: #fbfaf5;
  --ink: #2b2a27;
  --muted: #6b675c;
  --line: #ddd8c8;
  --accent: #6f7744;    /* いすのオリーブ */
  --accent-ink: #ffffff;
  --accent-soft: #e7e8d6;
  --gold: #b49a5f;      /* ミラー枠の金 */
  /* 文字はすべてゴシック体で統一 */
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-latin: var(--font-body);
  --font-display: var(--font-body);
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.75;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }

/* 店内写真の背景（質問・結果画面でうすく見せる） */
.bgphoto {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(241,239,228,.86), rgba(241,239,228,.93)), url("img/bg.jpg") center / cover no-repeat;
  opacity: 0; transition: opacity .4s ease;
}
body[data-view="quiz"] .bgphoto, body[data-view="result"] .bgphoto { opacity: 1; }

/* アプリバー */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(241,239,228,.92); }
.appbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: rgba(241,239,228,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
.appbar-in { max-width: 560px; margin: 0 auto; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { height: 30px; width: auto; }
.appbar-title { font-family: var(--font-display); font-size: .9rem; color: var(--muted); letter-spacing: .08em; }

.wrap {
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18px max(48px, env(safe-area-inset-bottom, 0px));
}
.view { display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.45; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
code { font-size: .85em; }
.eyebrow { font-family: var(--font-latin); font-size: .78rem; letter-spacing: .16em; color: var(--gold); font-weight: 700; }
.eyebrow.light { color: #f4e8c8; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.note { font-size: .82rem; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  padding: 13px 22px; border-radius: 999px; text-align: center; text-decoration: none; display: inline-block;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn:focus-visible, .opt:focus-visible, .card:focus-visible, a:focus-visible, summary:focus-visible, .linkish:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ヒーロー */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; background: #3a3a30; }
.hero img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,30,22,0) 25%, rgba(30,30,22,.72) 100%); }
.hero-text { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; color: #fff; display: flex; flex-direction: column; gap: 6px; }
.hero-text h1 { color: #fff; }
.hero-text p { font-size: .88rem; color: rgba(255,255,255,.9); }

/* 診断カード */
.cards { display: flex; flex-direction: column; gap: 14px; }
.card {
  appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: grid; grid-template-columns: 38% 1fr;
}
.card:hover { border-color: var(--accent); }
.card.done { border-color: var(--gold); }
.card-photo { position: relative; min-height: 132px; }
.card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-label { position: absolute; left: 8px; bottom: 8px; background: rgba(251,250,245,.92); color: var(--ink); font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card .ttl { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.card .sub { font-size: .82rem; color: var(--muted); line-height: 1.6; }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .meta { font-size: .78rem; color: var(--muted); }
.card .go { font-size: .85rem; font-weight: 700; color: var(--accent); }
.status { font-size: .8rem; font-weight: 700; color: var(--gold); }

/* まとめ */
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.result-list li > span { color: var(--muted); }
.linkish { appearance: none; background: none; border: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; padding: 0; text-align: right; }
.linkish.muted { color: var(--muted); font-weight: 500; }

/* 今月のトレンド */
.trends { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.trends li.trend { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: .9rem; }
.trends li.trend img { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; }
.trends li.trend div { display: flex; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.6; }
.trends li.trend b { color: var(--ink); }

/* お店 */
.shop-logo { height: 34px; width: auto; }

/* 質問 */
.quiz { background: rgba(251,250,245,.94); }
.progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.qmeta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.qmeta span:first-child { font-family: var(--font-display); color: var(--ink); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 14px 8px 8px;
  display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center;
}
.opt:hover { border-color: var(--accent); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt-pic { width: 76px; height: 76px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.opt-pic svg { width: 68px; height: 68px; }
.opt-pic img { width: 100%; height: 100%; object-fit: cover; }
.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-weight: 500; line-height: 1.5; }
.opt-text small { color: var(--muted); font-size: .8rem; font-weight: 400; }
.hint { background: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: .88rem; color: var(--muted); }

/* 結果 */
.result-hero { border-top: 4px solid var(--gold); }
.result-name { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.3; }
.result-name .en { font-family: var(--font-latin); font-size: 1.1rem; color: var(--gold); margin-left: .5em; font-weight: 700; letter-spacing: .06em; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.palette div { aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 1px solid rgba(0,0,0,.06); }
.face-big { width: 130px; height: 130px; align-self: center; background: var(--bg); border-radius: 50%; display: grid; place-items: center; }
.face-big svg { width: 104px; height: 104px; }
dl.facts { margin: 0; display: grid; grid-template-columns: 6.8em 1fr; gap: 8px 12px; font-size: .92rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; }
.scores { display: flex; flex-direction: column; gap: 8px; }
.score { display: grid; grid-template-columns: 9em 1fr 3em; gap: 10px; align-items: center; font-size: .84rem; }
.score .track { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.score .track i { display: block; height: 100%; background: #b9b3a2; border-radius: 8px; }
.score.top .track i { background: var(--accent); }
.score.top { font-weight: 700; }
.score .pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.products { display: flex; flex-direction: column; gap: 12px; }
.product { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; background: #fff; }
.product img.thumb { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; }
.product div.thumb { width: 96px; height: 96px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.15rem; color: #fff; }
.product .body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.product .cat { font-size: .72rem; color: var(--gold); letter-spacing: .08em; font-weight: 700; }
.product .name { font-weight: 700; }
.product .price { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); }
.product a { font-weight: 700; font-size: .9rem; text-decoration: none; }
.product a:hover { text-decoration: underline; }
.summary { white-space: pre-wrap; font-size: .88rem; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; font-family: var(--font-body); overflow-x: auto; }
details { font-size: .85rem; }
summary { cursor: pointer; font-weight: 700; }
details ul { padding-left: 1.2em; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
details a { word-break: break-all; }
.foot { background: transparent; border: 0; padding: 8px 4px; }
.copy { font-family: var(--font-latin); letter-spacing: .14em; color: var(--muted); text-align: center; font-size: .85rem; }

@media (max-width: 420px) {
  h1 { font-size: 1.35rem; }
  .hero img { aspect-ratio: 4 / 4.2; }
  .score { grid-template-columns: 7.6em 1fr 2.6em; }
  .opt { grid-template-columns: 64px 1fr; }
  .opt-pic { width: 64px; height: 64px; }
  .opt-pic svg { width: 58px; height: 58px; }
}
/* ===== アニメーション（CSSだけで作成。素材ファイルは使っていない） ===== */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --gold-glow: rgba(180, 154, 95, .45); }

/* 選択肢：触れると浮き、選ぶとズーム＋金色に光ってチェック */
.opt { position: relative; grid-template-columns: 76px 1fr 28px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s, background .25s; }
.opt:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(43, 42, 39, .08); }
.opt:active { transform: scale(.98); }
.opt-pic { transition: transform .35s var(--ease); }
.opt:hover .opt-pic { transform: scale(1.05); }
.opt-check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; transition: background .25s, border-color .25s, transform .3s var(--ease); }
.opt-check svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.opt[aria-pressed="true"] .opt-check { background: var(--gold); border-color: var(--gold); }
.opt[aria-pressed="true"] .opt-check svg { stroke-dashoffset: 0; }
.opt.picked { animation: pick .48s var(--ease) both; border-color: var(--gold); background: #fffaf0; z-index: 1; }
.opt.picked .opt-check { animation: pop .4s var(--ease) both; }
.opt.picked .opt-check svg { transition: stroke-dashoffset .35s .1s var(--ease); stroke-dashoffset: 0; }
.opt.picked::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 190, .65) 50%, transparent 70%); background-size: 250% 100%; animation: sweep .6s ease-out both; }
.opts.locked .opt:not(.picked) { opacity: .45; transform: scale(.98); transition: opacity .3s, transform .3s; }
@keyframes pick { 0% { transform: scale(1); } 45% { transform: scale(1.045); box-shadow: 0 0 0 4px var(--gold-glow), 0 12px 28px rgba(180, 154, 95, .3); } 100% { transform: scale(1.03); box-shadow: 0 0 0 2px var(--gold-glow), 0 10px 24px rgba(180, 154, 95, .25); } }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* 質問の切り替え：見出し→選択肢の順にふわっと登場 */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.quiz.enter h2, .quiz.enter .hint { animation: rise .45s var(--ease) both; }
.quiz.enter .opt { animation: rise .45s var(--ease) both; animation-delay: calc(.08s + var(--i, 0) * .06s); }
.quiz.enter .opt.picked { animation: pick .48s var(--ease) both; animation-delay: 0s; }
.quiz.enter .opts.locked .opt:not(.picked) { animation: none; opacity: .45; transform: scale(.98); }
@media (max-width: 420px) { .opt { grid-template-columns: 64px 1fr 26px; } }
.progress i { transition: width .45s var(--ease); background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* ホーム：ヒーローとカードの登場、カードは触れると浮く */
.hero img { animation: zoomout 1.6s var(--ease) both; }
@keyframes zoomout { from { transform: scale(1.08); } to { transform: none; } }
.hero-text > * { animation: rise .7s var(--ease) both; }
.hero-text > *:nth-child(2) { animation-delay: .12s; }
.hero-text > *:nth-child(3) { animation-delay: .24s; }
.card { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; animation: rise .55s var(--ease) both; }
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(43, 42, 39, .1); }
.card:active { transform: scale(.985); }
.card-photo img { transition: transform .6s var(--ease); }
.card:hover .card-photo img { transform: scale(1.06); }

/* 結果画面：順番に登場、結果名に金の光、キラッと光るアイコン */
#result > section { animation: rise .6s var(--ease) both; }
#result > section:nth-child(2) { animation-delay: .15s; }
#result > section:nth-child(3) { animation-delay: .25s; }
#result > section:nth-child(4) { animation-delay: .35s; }
#result > section:nth-child(5) { animation-delay: .45s; }
.result-title { display: flex; align-items: center; gap: 12px; }
.badge-glow { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #f6e7bf, var(--gold)); box-shadow: 0 0 0 0 var(--gold-glow); animation: badge-in .7s .2s var(--ease) both, glow 2.4s 1s ease-in-out infinite; }
.badge-glow svg { width: 24px; height: 24px; fill: #fff; animation: twinkle 2.4s 1s ease-in-out infinite; }
@keyframes badge-in { from { opacity: 0; transform: scale(.3) rotate(-60deg); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); } 50% { box-shadow: 0 0 0 10px rgba(180, 154, 95, 0), 0 0 22px 4px var(--gold-glow); } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(15deg); } }
.result-name { background: linear-gradient(100deg, var(--ink) 0 40%, #c9a961 48%, #f3e2b3 50%, #c9a961 52%, var(--ink) 60% 100%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 3.2s .6s ease-in-out infinite; }
.result-name .en { -webkit-text-fill-color: var(--gold); }
@keyframes shine { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0 0; } }
.palette div { animation: dot .5s var(--ease) both; animation-delay: calc(.35s + var(--i, 0) * .07s); }
@keyframes dot { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
.face-big { animation: dot .6s .35s var(--ease) both; }
.score .track i { transform-origin: left; animation: grow 1s .4s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.product, .trends li.trend { animation: rise .55s var(--ease) both; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.product:nth-child(2), .trends li.trend:nth-child(2) { animation-delay: .1s; }
.product:nth-child(3), .trends li.trend:nth-child(3) { animation-delay: .2s; }
.trends li.trend:nth-child(4) { animation-delay: .3s; }
.product:hover, .trends li.trend:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(43, 42, 39, .08); }

/* 予約ボタンなど：ときどき光が走る */
.btn { position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .25s; }
.btn:not(.ghost)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%); background-size: 250% 100%; animation: sheen 4.5s 1.5s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 65% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.btn:hover { box-shadow: 0 8px 20px rgba(111, 119, 68, .25); }
.btn:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
  .progress i, .bgphoto { transition: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .result-name { color: var(--ink); background: none; }
  .opt-check svg { stroke-dashoffset: 0; }
}
