/* ============================================================
   MUDAパーソナル診断
   ============================================================ */

:root {
  /* くすみアース・カフェラテ調 */
  --paper: #faf8f5;
  --paper-2: #ffffff;
  --paper-soft: #f4efea;
  --ink: #3a3530;
  --ink-soft: #6e665c;
  --ink-faint: #9a9186;
  --line: #ebe4dc;
  --line-strong: #ddd4c8;

  /* タイプ別アクセント（彩度を抑えた4色） */
  --violet: #c97a63;           /* テラコッタ */
  --violet-tint: #f6ebe6;
  --sage: #7f9a83;             /* セージグリーン */
  --sage-tint: #ebf0ec;
  --azure: #6b8ba4;            /* フェードブルー */
  --azure-tint: #e8eef2;
  --amber: #d4a359;            /* スモーキーマスタード */
  --amber-tint: #f6efe3;

  --accent: var(--violet);
  --accent-tint: var(--violet-tint);

  --radius: 22px;
  --radius-lg: 30px;
  --shadow-sm: 0 2px 0 rgba(58, 53, 48, .04), 0 8px 22px -14px rgba(58, 53, 48, .28);
  --shadow-md: 0 3px 0 rgba(58, 53, 48, .04), 0 24px 48px -30px rgba(58, 53, 48, .36);

  --font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN",
             "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-code: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .01em;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* うっすらしたカフェラテの光 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 12% -10%, rgba(201, 122, 99, .08), transparent 60%),
    radial-gradient(110% 60% at 92% 4%, rgba(212, 163, 89, .10), transparent 58%),
    radial-gradient(90% 60% at 50% 104%, rgba(127, 154, 131, .09), transparent 60%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}
.wrap-narrow { max-width: 680px; }

/* ---------- header / footer ---------- */

.site-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 20px 6px;
}

.brand { text-decoration: none; color: inherit; display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: clamp(15px, 3.8vw, 18px);
  letter-spacing: .04em;
}

.site-foot {
  position: relative;
  z-index: 1;
  margin-top: 46px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
}
.foot-heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.foot-text { margin: 0; font-size: 11.5px; color: var(--ink-faint); line-height: 1.95; }

/* ---------- buttons ---------- */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  min-height: 62px;
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #5a5048, #3f3934);
  color: #faf8f5;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 5px 0 #2e2925, 0 18px 30px -18px rgba(58, 53, 48, .55);
  transition: transform .12s ease, box-shadow .12s ease;
}
.primary-btn:hover { transform: translateY(-1px); }
.primary-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #2e2925; }

.ghost-btn {
  padding: 9px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ghost-btn:hover { border-color: var(--ink-soft); color: var(--ink); }

.icon-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  cursor: pointer;
  line-height: 1;
}
.icon-btn:hover { border-color: var(--ink-soft); }

.center-actions { display: flex; justify-content: center; margin: 34px 0 8px; }

/* ---------- screens ---------- */

.screen { position: relative; z-index: 1; padding: 8px 0 24px; }
.screen[hidden] { display: none; }

.screen-enter { animation: screen-in .42s cubic-bezier(.22, .68, .36, 1) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- A. intro ---------- */

.hero { text-align: center; padding: 18px 0 8px; }
.hero-eyebrow {
  margin: 0;
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.hero-title {
  margin: 8px 0 0;
  font-family: var(--font-jp);
  font-size: clamp(28px, 8.2vw, 44px);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.35;
  background: linear-gradient(110deg, #c97a63 6%, #7f9a83 36%, #6b8ba4 66%, #d4a359 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-catch {
  margin: 22px auto 0;
  max-width: 30em;
  font-size: 16px;
  font-weight: 500;
  line-height: 2;
  color: var(--ink-soft);
}
.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 26px 0 28px;
}
.hero-strip img {
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: .92;
}
.hero-note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-faint); }

.paper {
  margin: 34px 0 0;
  padding: 26px 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.paper p { margin: 0 0 1.2em; font-size: 14.5px; line-height: 2.05; color: #524c45; }
.paper p:last-child { margin-bottom: 0; }

.section-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--ink-soft);
  text-align: center;
}
.axis-intro { margin-top: 40px; }
.axis-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.axis-list li {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.6;
}
.axis-list .pole { display: flex; align-items: center; gap: 7px; min-width: 0; }
.axis-list .pole.right { justify-content: flex-end; text-align: right; }
.axis-list .pole em {
  font-family: var(--font-code);
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .06em;
}
.axis-list .pole b { font-weight: 700; font-size: 13px; }
.axis-list .pole small { display: block; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.axis-list .vs { font-family: var(--font-code); font-size: 10px; color: var(--ink-faint); letter-spacing: .1em; }
.axis-list li:nth-child(1) .pole em { color: var(--violet); }
.axis-list li:nth-child(2) .pole em { color: var(--sage); }
.axis-list li:nth-child(3) .pole em { color: var(--azure); }
.axis-list li:nth-child(4) .pole em { color: var(--amber); }

/* ---------- B. question ---------- */

.q-head { padding: 12px 0 18px; }
.q-progress { display: flex; align-items: center; gap: 12px; }
.q-count { font-family: var(--font-code); font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.q-count b { font-size: 22px; font-weight: 700; color: var(--ink); }
.q-count i { font-style: normal; }
.q-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #ebe4dc;
  overflow: hidden;
}
.q-bar-fill {
  height: 100%;
  width: 12.5%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c97a63, #7f9a83, #6b8ba4, #d4a359);
  background-size: 800% 100%;
  transition: width .45s cubic-bezier(.3, .7, .3, 1);
}
.q-axis { margin: 12px 0 0; font-size: 11.5px; letter-spacing: .1em; color: var(--ink-faint); }

.q-card {
  padding: 26px 22px 28px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.q-id {
  margin: 0 0 10px;
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--accent);
}
.q-text { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.85; letter-spacing: 0; }

.q-card.swap { animation: card-swap .38s cubic-bezier(.22, .68, .36, 1) both; }
@keyframes card-swap {
  from { opacity: 0; transform: translateX(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.q-choices { display: grid; gap: 10px; margin: 18px 0 0; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 12px 18px 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 20px;
  background: var(--paper-2);
  text-align: left;
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.choice .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--ink-soft);
  font-family: var(--font-code);
  font-size: 15px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
}
.choice.picked { border-color: var(--accent); background: var(--accent-tint); }
.choice.picked .num { background: var(--accent); color: #fff; }
.choice[data-level="1"] { font-size: 14.5px; }
.choice[data-level="4"] { font-weight: 700; }

/* マウス環境のみ。タッチではタップ後に :hover が次の質問まで張り付く */
@media (hover: hover) and (pointer: fine) {
  .choice:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }
  .choice:hover .num { background: var(--accent); color: #fff; }
}

.q-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.q-hint { font-size: 11px; color: var(--ink-faint); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 24px 12px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.back-btn .back-arrow {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper-soft);
  font-size: 13px;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.back-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--ink);
}
.back-btn:hover .back-arrow { background: var(--accent); color: #fff; }
.back-btn:active { transform: translateY(1px); }

/* ---------- D. result ---------- */

.result-note {
  margin: 6px 0 18px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .2em;
  color: var(--ink-faint);
  font-family: var(--font-code);
}

.type-card {
  padding: 24px 20px 26px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
}
.type-code {
  display: inline-block;
  margin: 0;
  font-family: var(--font-code);
  font-size: clamp(44px, 15vw, 76px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .06em;
  color: var(--accent);
}
.type-no {
  margin: 8px 0 0;
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--ink-faint);
}
.type-name { margin: 12px 0 0; font-size: 25px; font-weight: 700; line-height: 1.5; }
.type-tagline {
  display: inline-block;
  max-width: 30em;
  margin: 14px 0 0;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.85;
  text-align: center;
}
.type-figure {
  margin: 20px -20px 0;
  padding: 10px 0;
  background: var(--accent-tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.type-figure img { width: 100%; max-width: 460px; margin: 0 auto; }

.common-message {
  margin: 18px 0 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .72);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.95;
  color: #524c45;
}

.axis-result { margin: 26px 0 0; display: grid; gap: 12px; }
.axis-row {
  padding: 13px 16px 15px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.axis-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-faint);
}
.axis-row-head span { display: flex; align-items: baseline; gap: 5px; }
.axis-row-head em {
  font-family: var(--font-code);
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
}
.axis-row-head .won { color: var(--ink); }
.axis-row-head .won em { color: var(--accent); }
.axis-track {
  position: relative;
  height: 10px;
  margin: 10px 0 0;
  border-radius: 999px;
  background: var(--paper-soft);
}
.axis-track::after {
  content: "";
  position: absolute;
  left: 50%; top: -4px; bottom: -4px;
  width: 1px;
  background: var(--line-strong);
}
.axis-knob {
  position: absolute;
  top: 50%;
  width: 20px; height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper-2);
  box-shadow: 0 2px 8px -2px rgba(58, 53, 48, .4);
  transform: translateY(-50%);
  transition: left .6s cubic-bezier(.3, .7, .3, 1);
}
.axis-score { margin: 9px 0 0; font-size: 11.5px; color: var(--ink-faint); }
.axis-score b { color: var(--ink-soft); font-family: var(--font-code); }
.axis-score .tie {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-tint);
  font-size: 10.5px;
}

.detail-block {
  margin: 14px 0 0;
  padding: 20px 20px 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.detail-block h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.detail-block h3 .tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
}
.detail-block p { margin: 0; font-size: 14.5px; line-height: 2.05; color: #524c45; }
.detail-block .detail-lead {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--accent);
}

.match-grid { display: grid; gap: 14px; margin: 14px 0 0; }
.match-card {
  padding: 18px 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.match-label {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-soft);
}
.match-body { display: flex; align-items: flex-start; gap: 14px; }
.match-thumb {
  flex: none;
  width: 104px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.match-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.match-meta { min-width: 0; }
.match-code {
  margin: 0;
  font-family: var(--font-code);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .06em;
}
.match-name { margin: 2px 0 6px; font-size: 14px; font-weight: 700; line-height: 1.6; }
.match-relation {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper-soft);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.7;
}
.match-text { margin: 0; font-size: 13px; line-height: 1.9; color: #524c45; }
.match-card.best .match-code { color: var(--sage); }
.match-card.worst .match-code { color: var(--violet); }

/* ---------- E. share ---------- */

/* 公式アナウンス風の注記。主張しすぎないよう小さく、控えめなグレーで */
.official-note {
  margin: 24px 0 0;
  padding: 15px 16px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .45);
}
.official-note-title {
  margin: 0 0 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #888;
  text-align: center;
}
.official-note-text {
  margin: 0;
  font-size: 12.5px;   /* ≒0.78rem */
  line-height: 1.9;
  color: #777;
}

.share-block {
  margin: 26px 0 0;
  padding: 22px 18px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.share-block h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.share-block .share-lead { margin: 0 0 16px; font-size: 12.5px; color: var(--ink-faint); }
.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.share-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  background: var(--paper-2);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.share-btn:hover { transform: translateY(-1px); border-color: var(--ink-soft); }
.share-btn svg { width: 18px; height: 18px; flex: none; }
.share-btn.x {
  min-height: 58px;
  font-size: 15px;
  letter-spacing: .02em;
  background: #1a1a1c;
  border-color: #1a1a1c;
  color: #fff;
  box-shadow: 0 4px 14px -8px rgba(26, 26, 28, .55);
}
.share-btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.share-link {
  margin-top: 2px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.share-link:hover { color: var(--ink-soft); }

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 30px 0 0;
}
.text-btn {
  margin-top: 2px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink-soft); }

/* ---------- gallery ---------- */

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(58, 53, 48, .4);
  backdrop-filter: blur(3px);
  animation: fade-in .2s ease both;
}
.sheet-overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet-panel {
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px -30px rgba(58, 53, 48, .55);
  animation: sheet-up .32s cubic-bezier(.22, .68, .36, 1) both;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.sheet-body { overflow-y: auto; padding: 18px 20px 30px; -webkit-overflow-scrolling: touch; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gallery-item {
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-2);
  cursor: pointer;
  text-align: center;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.gallery-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.gallery-item img { border-radius: 14px; }
.gallery-item .g-code {
  margin: 9px 0 0;
  font-family: var(--font-code);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
}
.gallery-item .g-name { margin: 1px 0 0; font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; }
.gallery-item[data-hue="violet"] .g-code { color: var(--violet); }
.gallery-item[data-hue="sage"] .g-code { color: var(--sage); }
.gallery-item[data-hue="azure"] .g-code { color: var(--azure); }
.gallery-item[data-hue="amber"] .g-code { color: var(--amber); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(86vw, 420px);
  padding: 12px 20px;
  border-radius: 22px;
  background: rgba(58, 53, 48, .92);
  color: #faf8f5;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  box-shadow: 0 14px 30px -14px rgba(58, 53, 48, .7);
  animation: toast-in .22s ease both;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- hue themes ---------- */

[data-hue="violet"] { --accent: var(--violet); --accent-tint: var(--violet-tint); }
[data-hue="sage"]   { --accent: var(--sage);   --accent-tint: var(--sage-tint); }
[data-hue="azure"]  { --accent: var(--azure);  --accent-tint: var(--azure-tint); }
[data-hue="amber"]  { --accent: var(--amber);  --accent-tint: var(--amber-tint); }

/* ---------- tablet / desktop ---------- */

@media (min-width: 640px) {
  body { font-size: 16.5px; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .q-text { font-size: 21px; }
  .type-figure { margin-left: -20px; margin-right: -20px; }
  .match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .site-head { padding-top: 24px; }
  .hero { padding-top: 34px; }
  .hero-strip { gap: 12px; }
  .paper { padding: 34px 38px; }
  .paper p { font-size: 15px; }
  .q-card { padding: 38px 36px 40px; }
  .q-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { min-height: 74px; }
  .type-card { padding: 34px 34px 36px; }
  .type-figure { margin: 26px -34px 0; }
  .detail-block { padding: 26px 30px 28px; }
  .axis-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet-overlay { align-items: center; padding: 24px; }
  .sheet-panel { border-radius: 28px; max-height: 86vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 印刷時は結果だけ */
@media print {
  .grain, .site-head, .site-foot, .share-block, .result-actions, .sheet-overlay { display: none !important; }
  body { background: #fff; }
}
