/* 雪平コーヒー 好み診断（試作）
   世界観: 白地・黒の太い英字・くすんだ青のアクセント・小さな赤い判子・余白多め（Instagram より） */

:root {
  --bg: #f6f6f4;
  --paper: #ffffff;
  --ink: #1c1c1c;
  --ink-2: #5d5d5a;
  --ink-3: #8f8f8a;
  --line: #e4e4df;
  --blue: #3f6eae;
  --blue-soft: #edf2f9;
  --red: #c8372d;
  --radius: 14px;
  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mark: "Oswald", "Arial Narrow", sans-serif;
  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }

/* 日本語の改行を自然に（「一杯。」の「杯。」だけが落ちる、などを防ぐ） */
p, li, h1, h2, h3 { word-break: auto-phrase; text-wrap: pretty; }
.keep { display: inline-block; }

.shell {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

/* ---------- ブランド帯 ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
}
.brand__mark {
  font-family: var(--font-mark);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.02;
  letter-spacing: 0.02em;
}
.brand__seal {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  align-self: flex-end;
  margin-bottom: 2px;
}
.brand__store {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

main { flex: 1; padding-top: 8px; }

.foot {
  margin-top: 40px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
}
.foot__badge {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 4px;
  border: 1px solid var(--ink-3);
  border-radius: 99px;
}

.loading-text { color: var(--ink-3); text-align: center; margin-top: 30vh; }

/* ---------- 共通 ---------- */
.eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--blue);
  margin: 0;
  line-height: 1.2;
}
.btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn + .btn { margin-top: 12px; }
a.btn { text-align: center; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--bg);
  font-size: 12px;
  color: var(--ink-2);
}

.fade-in { animation: fadeIn 0.35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- スタート ---------- */
.start { padding-top: 28px; }
.start__art { display: block; width: 120px; height: 120px; margin: 8px auto 20px; }
.start h1 {
  font-size: 26px;
  line-height: 1.5;
  margin: 10px 0 14px;
  letter-spacing: 0.02em;
}
.start p { color: var(--ink-2); margin: 0 0 18px; }
.start__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }

/* ---------- 質問 ---------- */
.qbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.qbar__back {
  border: none;
  background: none;
  padding: 6px 6px 6px 0;
  cursor: pointer;
  color: var(--ink-2);
}
.progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--blue); transition: width 0.3s ease; }

.question { padding-top: 26px; }
.question h2 { font-size: 22px; line-height: 1.55; margin: 6px 0 22px; }
.options { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover { border-color: var(--ink-3); }
.option[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.option__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 21px;
}

/* ---------- 探している演出 ---------- */
.seeking { text-align: center; padding-top: 28vh; color: var(--ink-2); }
.seeking__dots { display: inline-flex; gap: 8px; margin-bottom: 16px; }
.seeking__dots span {
  width: 10px; height: 14px; border-radius: 50%;
  background: var(--ink);
  animation: bounce 0.9s ease-in-out infinite;
}
.seeking__dots span:nth-child(2) { animation-delay: 0.15s; background: var(--blue); }
.seeking__dots span:nth-child(3) { animation-delay: 0.3s; background: var(--red); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- 結果 ---------- */
.result { padding-top: 26px; }
.section { margin-top: 36px; }
.section__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section__head h2 { font-size: 15px; margin: 0; color: var(--ink-2); font-weight: 500; }

.type { text-align: center; padding: 8px 0 4px; }
.type__lead { font-size: 13px; color: var(--ink-2); margin: 0; }
.type__name {
  font-size: 27px;
  font-weight: 700;
  margin: 4px 0 12px;
  line-height: 1.4;
}
.type__name::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 4px;
  background: var(--type-color, var(--blue));
}
.type__desc { color: var(--ink-2); margin: 0; font-size: 15px; text-align: left; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--paper);
}
.card--main { border-color: var(--ink); }
.cup__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cup__name { font-size: 22px; line-height: 1.45; margin: 0; }
.cup__sub { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.match {
  flex: none;
  text-align: center;
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.2;
}
.match b {
  display: block;
  font-family: var(--font-mark);
  font-size: 30px;
  font-weight: 500;
  color: var(--blue);
  line-height: 1.1;
}
.match b small { font-size: 15px; }
.cup__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.notes { margin: 14px 0 0; font-size: 14px; }
.notes span + span::before { content: "・"; color: var(--ink-3); }
.cup__desc { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }

.radar { display: block; width: 100%; max-width: 260px; margin: 18px auto 4px; }
.radar text { font-family: var(--font-ja); font-size: 11px; fill: var(--ink-2); }
.legend { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }

.reasons { margin: 16px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--bg); list-style: none; }
.reasons li { position: relative; padding-left: 18px; font-size: 14px; }
.reasons li + li { margin-top: 6px; }
.reasons li::before { content: "✓"; position: absolute; left: 0; color: var(--blue); font-weight: 700; }

.cup__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.badge-cup { color: var(--blue); font-weight: 700; }

.lesson { border-left: 3px solid var(--blue); padding: 4px 0 4px 14px; font-size: 14px; color: var(--ink-2); }
.lesson b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 2px; }

.next__diff { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
.next__diff b { color: var(--ink); }

.staff {
  margin-top: 36px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  text-align: center;
  font-size: 15px;
}
.staff b { display: block; font-size: 17px; margin-bottom: 4px; }

details.more { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
details.more summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
.rank { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.rank li { display: grid; grid-template-columns: 1fr 44px; gap: 4px 10px; font-size: 14px; align-items: center; }
.rank__bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rank__bar i { display: block; height: 100%; background: var(--ink); }
.rank__pct { text-align: right; font-family: var(--font-mark); color: var(--blue); }

.actions { margin-top: 32px; }

/* ---------- 開発用（?debug=1） ---------- */
.debug { margin-top: 28px; font-size: 12px; background: #fafafa; border: 1px dashed var(--ink-3); border-radius: 8px; padding: 12px; overflow-x: auto; }
.debug table { border-collapse: collapse; width: 100%; }
.debug th, .debug td { border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: right; white-space: nowrap; }
.debug th:first-child, .debug td:first-child { text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
