/* 占いガール ― 見た目の設定
 * 天使（ange）がモチーフ。ミルク色の地に、ピンク・ラベンダー・金の差し色。
 */
:root {
  --milk: #fffaf7;
  --surface: #ffffff;
  --blush: #fdeef2;
  --lilac-soft: #f2edfb;
  --pink: #e0628c;
  --pink-deep: #c84874;
  --lilac: #9b80cf;
  --gold: #c59a3e;
  --gold-soft: #ead7a6;
  --ink: #4b3550;
  --ink-soft: #85718a;
  --line: #eadde6;
  --shadow: 0 6px 22px rgba(120, 72, 110, 0.10);

  --f-display: "Kiwi Maru", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --f-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --f-script: "Parisienne", "Snell Roundhand", cursive;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--milk);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(253, 222, 232, 0.9), transparent 32%),
    radial-gradient(circle at 92% 30%, rgba(234, 225, 250, 0.9), transparent 30%),
    radial-gradient(rgba(197, 154, 62, 0.22) 1px, transparent 1.4px);
  background-size: auto, auto, 34px 34px;
  background-attachment: scroll;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pink-deep); }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; text-wrap: balance; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  max-width: 920px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: rgba(255, 250, 247, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo svg { width: 46px; height: 36px; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-script { font-family: var(--f-script); color: var(--pink); font-size: 17px; }
.logo-name { font-family: var(--f-display); font-size: 20px; letter-spacing: 0.06em; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; color: var(--ink);
}
.menu-btn span.bars { width: 16px; height: 10px; position: relative; display: inline-block; }
.menu-btn span.bars::before, .menu-btn span.bars::after, .menu-btn span.bars i {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--pink);
}
.menu-btn span.bars::before { top: 0; }
.menu-btn span.bars i { top: 4px; }
.menu-btn span.bars::after { bottom: 0; }

.menu-panel { border-top: 1px solid var(--line); background: var(--milk); max-height: 70vh; overflow-y: auto; }
.menu-panel .wrap { padding-block: 16px 24px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.menu-cat h3 { margin: 0 0 6px; font-size: 14px; color: var(--lilac); letter-spacing: 0.1em; }
.menu-cat ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu-cat a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 10px; text-decoration: none; color: var(--ink);
}
.menu-cat a:hover { background: var(--blush); }
.menu-cat a svg { width: 22px; height: 22px; flex: none; }
.menu-cat a[aria-current="page"] { background: var(--blush); color: var(--pink-deep); }

/* ---------- アイコン ---------- */
.ic { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blush); color: var(--pink);
}
.ic-badge svg { width: 26px; height: 26px; }
.ic-badge.lilac { background: var(--lilac-soft); color: var(--lilac); }
.ic-badge.gold { background: #fbf3df; color: var(--gold); }

/* ---------- トップ ---------- */
.hero { text-align: center; padding-block: 36px 12px; }
.hero-art { width: min(260px, 70%); height: auto; display: block; margin: 0 auto 4px; }
.hero .eyebrow {
  display: inline-block; margin: 0 0 10px; padding: 2px 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--gold-soft);
  color: var(--gold); font-size: 13px; letter-spacing: 0.12em;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 6vw, 40px); line-height: 1.45; letter-spacing: 0.04em; }
.hero h1 em { font-style: normal; color: var(--pink); }
.hero .lead { margin: 0 auto; max-width: 34em; color: var(--ink-soft); }

.sec { padding-block: 28px 8px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 21px; }
.sec-title::before {
  content: ""; width: 18px; height: 18px; flex: none;
  background: var(--pink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 8.4L23 12l-8.4 2.6L12 23l-2.6-8.4L1 12l8.4-2.6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 8.4L23 12l-8.4 2.6L12 23l-2.6-8.4L1 12l8.4-2.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sec-title small { font-family: var(--f-body); font-size: 13px; color: var(--ink-soft); margin-left: auto; }
.sec-title small a { text-decoration: none; }

.fortune-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.fortune-link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.fortune-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #f3c3d3; }
.fortune-link strong { display: block; font-family: var(--f-display); font-weight: 500; font-size: 17px; }
.fortune-link span.d { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.fortune-link > div { min-width: 0; }

/* ---------- 各占いページ ---------- */
.page-hero { text-align: center; padding-block: 30px 6px; }
.page-hero .ic-badge { width: 64px; height: 64px; margin-bottom: 6px; }
.page-hero .ic-badge svg { width: 36px; height: 36px; }
.page-hero h1 { margin: 0 0 6px; font-size: clamp(26px, 6vw, 36px); letter-spacing: 0.05em; }
.page-hero p { margin: 0 auto; max-width: 34em; color: var(--ink-soft); }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 32px);
  margin-block: 22px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 26px; border-radius: 999px;
  background: var(--surface); border: 1px solid #e9c6d3; color: var(--pink-deep);
  font-size: 15px; text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--blush); }
.btn:active { transform: scale(0.98); }
.btn-main {
  background: linear-gradient(180deg, #ec7ea2, var(--pink));
  border-color: transparent; color: #fff; font-size: 17px; padding: 12px 38px;
  box-shadow: 0 6px 16px rgba(224, 98, 140, 0.3);
}
.btn-main:hover { background: linear-gradient(180deg, #e66f96, var(--pink-deep)); }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* タブ */
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 7px 18px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 生年月日フォーム */
.birth-form { display: grid; gap: 16px; justify-items: center; text-align: center; }
.birth-form > p { margin: 0; color: var(--ink-soft); }
.birth-fields { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; }
.birth-fields label { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.birth-fields select {
  padding: 9px 30px 9px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--milk);
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--pink) 50%), linear-gradient(135deg, var(--pink) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  font-size: 16px;
}
.form-error { color: var(--pink-deep); font-size: 14px; min-height: 1.4em; margin: 0; }

/* タイプ一覧 */
.type-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.type-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}
.type-btn:hover { border-color: #f0b9cb; background: #fffafb; }
.type-btn b { font-family: var(--f-display); font-weight: 500; font-size: 16px; }
.type-btn small { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.type-btn[aria-current="true"] { border-color: var(--pink); background: var(--blush); }

/* 結果 */
.result-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.emblem {
  flex: none; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff, var(--blush) 70%);
  border: 2px solid var(--gold-soft);
  color: var(--pink); font-family: var(--f-display); font-size: 30px;
}
.emblem svg { width: 40px; height: 40px; }
.result-head > div { min-width: 0; }
.result-label { margin: 0; font-size: 13px; color: var(--lilac); letter-spacing: 0.08em; }
.result-name { margin: 0; font-size: clamp(22px, 5vw, 28px); line-height: 1.4; }
.result-catch { margin: 2px 0 0; color: var(--pink-deep); font-weight: 500; }
.result-sec { padding-block: 14px; border-top: 1px dashed var(--line); }
.result-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 17px; }
.result-sec h3 svg { width: 20px; height: 20px; color: var(--pink); }
.result-sec p { margin: 0; }
.year-box {
  margin-top: 8px; padding: 18px 20px; border-radius: 18px;
  background: linear-gradient(135deg, var(--lilac-soft), var(--blush));
}
.year-box h3 { margin: 0 0 6px; font-size: 18px; }
.year-box p { margin: 0 0 10px; }
.stars-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 4px 16px; margin: 0; }
.stars-table div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.stars-table dt { color: var(--ink-soft); }
.stars-table dd { margin: 0; color: var(--gold); letter-spacing: 0.1em; }
.lucky { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: 999px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line);
}
.chip i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.08); }

/* ランキング */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank-item {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.rank-item > div { min-width: 0; }
.rank-no {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lilac-soft); color: var(--lilac); font-family: var(--f-display); font-size: 18px;
}
.rank-item.top .rank-no { background: linear-gradient(135deg, #f7e2a8, var(--gold)); color: #fff; }
.rank-item.top { border-color: var(--gold-soft); }
.rank-sign { margin: 0; font-family: var(--f-display); font-size: 18px; }
.rank-sign small { font-family: var(--f-body); font-size: 12px; color: var(--ink-soft); margin-left: 6px; }
.rank-msg { margin: 2px 0 6px; font-size: 15px; }
.rank-item .lucky { margin-top: 0; }
.rank-date { text-align: center; color: var(--ink-soft); margin: -6px 0 14px; font-size: 14px; }

/* おみくじ */
.omikuji-stage { display: grid; justify-items: center; gap: 18px; text-align: center; }
.omikuji-box { width: 130px; height: 180px; }
.omikuji-box.shake { animation: shake 0.9s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-14deg); } 30% { transform: rotate(12deg); }
  45% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); }
}
.slip {
  width: min(100%, 520px); margin: 0 auto; text-align: left;
  border: 1px solid #efc9d6; border-radius: 6px; background: #fffdfb;
  box-shadow: var(--shadow); overflow: hidden;
  animation: rise 0.6s ease-out;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.slip-head { text-align: center; padding: 18px 16px 12px; background: var(--blush); border-bottom: 1px solid #efc9d6; }
.slip-head p { margin: 0; font-size: 13px; color: var(--ink-soft); letter-spacing: 0.2em; }
.slip-head .slip-rank { margin: 0; font-family: var(--f-display); font-size: 46px; color: var(--pink-deep); letter-spacing: 0.15em; line-height: 1.3; }
.slip-body { padding: 14px 20px 18px; }
.slip-body > p { margin: 0 0 10px; }
.slip-body dl { margin: 0; display: grid; gap: 6px; }
.slip-body dl div { display: grid; grid-template-columns: 4.5em 1fr; gap: 8px; padding-top: 6px; border-top: 1px dotted var(--line); }
.slip-body dt { color: var(--lilac); font-weight: 500; }
.slip-body dd { margin: 0; }

/* ---------- タロット ---------- */
.reading-guide { text-align: center; color: var(--ink-soft); margin: 0 0 16px; min-height: 1.85em; }
.slots { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: clamp(8px, 2.5vw, 28px); margin-bottom: 18px; }
.slot { width: clamp(84px, 24vw, 140px); text-align: center; }
.slots.single .slot { width: clamp(140px, 42vw, 180px); }
.slot-label { margin: 0 0 6px; font-size: 13px; color: var(--pink-deep); white-space: nowrap; }
@media (max-width: 480px) { .slot-label { font-size: 12px; } }
.card { position: relative; width: 100%; max-width: 100%; aspect-ratio: 3 / 5; perspective: 900px; }
.card.empty { border: 2px dashed #ecd0dc; border-radius: 12px; background: rgba(255, 255, 255, 0.6); }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1); }
.card.flipped .card-inner { transform: rotateY(180deg); }
.card-back, .card-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 6px 10px rgba(120, 72, 110, 0.16));
}
.card-face { transform: rotateY(180deg); }
.card svg, .deck-card svg, .mini-card svg { display: block; width: 100%; height: 100%; }
.card svg text, .deck-card svg text, .mini-card svg text { font-family: var(--f-display); }
.card-face.is-rev svg, .mini-card.is-rev svg { transform: rotate(180deg); }
.card.placed { animation: place 0.45s ease-out; }
@keyframes place { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.deck { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); max-width: 720px; margin: 18px auto 0; }
.deck-card { padding: 0; border: none; background: none; aspect-ratio: 3 / 5; transition: transform 0.2s, opacity 0.3s; }
.deck-card:hover:not(:disabled) { transform: translateY(-6px); }
.deck-card:disabled { opacity: 0.2; cursor: default; }
.deck.done .deck-card:not(:disabled) { opacity: 0.45; cursor: default; }
.deck.shuffling .deck-card { animation: shuffle 0.6s ease-in-out; }
.deck.shuffling .deck-card:nth-child(odd) { animation-direction: reverse; }
@keyframes shuffle { 40% { transform: translateX(10px) rotate(4deg); } 70% { transform: translateX(-8px) rotate(-3deg); } }

.tarot-result { margin-top: 10px; display: grid; gap: 12px; }
.tarot-item {
  display: grid; grid-template-columns: 76px 1fr; gap: 16px;
  padding: 18px; border-radius: 18px; background: var(--milk); border: 1px solid var(--line);
}
.tarot-item > div { min-width: 0; }
.mini-card { width: 76px; aspect-ratio: 3 / 5; }
.pos { margin: 0; font-size: 13px; color: var(--lilac); }
.tarot-name { margin: 0 0 4px; font-size: 20px; }
.badge { display: inline-block; margin-left: 8px; padding: 0 10px; border-radius: 999px; font-family: var(--f-body); font-size: 12px; vertical-align: 3px; }
.badge.up { background: var(--lilac-soft); color: var(--lilac); }
.badge.rev { background: var(--blush); color: var(--pink-deep); }
.kw { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); }
.tarot-item p:last-child { margin: 0; }
.summary-box { padding: 18px 20px; border-radius: 18px; background: linear-gradient(135deg, var(--lilac-soft), var(--blush)); }
.summary-box h3 { margin: 0 0 4px; font-size: 17px; }
.summary-box p { margin: 0; }

#fortune, #b-result, .tarot-result, #o-result { scroll-margin-top: 84px; }

/* 解説 */
.about { padding-block: 8px 4px; }
.about h2 { font-size: 20px; margin: 0 0 8px; }
.about p { margin: 0 0 12px; max-width: 42em; }

/* ---------- フッター ---------- */
.site-footer { margin-top: 48px; padding-block: 28px 36px; background: var(--surface); border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--ink-soft); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 12px; }
.site-footer nav a { color: var(--ink-soft); }
.site-footer p { margin: 0 0 6px; }
.site-footer .logo-script { font-size: 22px; display: block; }

@media (max-width: 480px) {
  .tarot-item { grid-template-columns: 60px 1fr; gap: 12px; padding: 14px; }
  .mini-card { width: 60px; }
  .result-head { gap: 12px; }
  .emblem { width: 64px; height: 64px; font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* トップのカテゴリ：項目数に合わせて横いっぱいに並べる */
.fortune-grid.cat { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
@media (min-width: 600px) {
  .fortune-grid.cat:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 追加の占い ---------- */
.field-who { font-size: 14px; color: var(--lilac); min-width: 3.5em; }
.birth-fields input[type="text"] {
  width: min(16em, 100%); padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--milk); font-size: 16px; text-align: center;
}
.multi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 8px; }
.multi-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}
.multi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.multi-card > div { min-width: 0; }
.multi-card .emblem { width: 58px; height: 58px; }
.multi-card .emblem svg { width: 30px; height: 30px; }
.multi-name { margin: 0; font-family: var(--f-display); font-size: 19px; line-height: 1.4; }
.multi-catch { margin: 2px 0 4px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.multi-card .more { font-size: 13px; color: var(--pink-deep); }
.aishou { text-align: center; }
.aishou .result-sec { text-align: left; }
.score-heart { position: relative; width: 150px; height: 140px; margin: 6px auto 2px; }
.score-heart svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--blush); stroke: var(--pink); stroke-width: 0.8; }
.score-heart span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; padding-bottom: 14px; color: var(--pink-deep); font-size: 16px; }
.score-heart b { font-family: var(--f-display); font-size: 44px; font-weight: 500; }
.aishou-el { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.rune-bag { width: 120px; height: 130px; }
.rune-bag.shake { animation: shake 0.9s ease-in-out; }
.rune-result { padding: 20px; text-align: center; }
.rune-result .rune-stone { width: 96px; height: 120px; display: block; margin: 0 auto 6px; }
.rune-result > p:last-child { text-align: left; margin: 0; }
