:root {
  --ink: #4a3b4f;
  --ink-soft: #7a6a7e;
  --gold: #b8924a;
  --gold-soft: #e9c77b;
  --peach: #f6d9cf;
  --lilac: #e7d3ea;
  --mint: #bfe0df;
  --paper: rgba(255, 255, 255, .72);
  --line: rgba(184, 146, 74, .35);
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --card-w: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--round);
  color: var(--ink);
  background: linear-gradient(180deg, var(--peach) 0%, var(--lilac) 48%, var(--mint) 100%) fixed #ecdde6;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
button { font: inherit; }

/* 背景：夜明けのグラデーション＋光の粒 */
.sky {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(255, 246, 214, .9), transparent 70%),
    linear-gradient(180deg, var(--peach) 0%, var(--lilac) 48%, var(--mint) 100%);
}
.sky::before, .sky::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255,255,255,.6) 0 1.5px, transparent 2.5px);
  background-size: 140px 160px, 90px 110px;
  background-position: 0 0, 40px 60px;
  animation: twinkle 6s ease-in-out infinite alternate;
  opacity: .5;
}
.sky::after { background-position: 70px 30px, 10px 90px; animation-delay: -3s; }
@keyframes twinkle { from { opacity: .15; } to { opacity: .6; } }

#app { max-width: 640px; margin: 0 auto; padding: 0 16px; overflow-x: clip; }

.screen { display: none; min-height: calc(100vh - 60px); padding: 48px 0 32px; text-align: center; }
.screen.is-active { display: block; animation: fadeIn .8s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 2px 16px;
  font-size: 13px; letter-spacing: .2em; color: var(--gold);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.title {
  font-family: var(--mincho); font-weight: 700;
  font-size: clamp(30px, 8vw, 44px); line-height: 1.45; margin: 8px 0 28px;
  letter-spacing: .06em;
}
.title span {
  display: inline-block; margin-top: 6px;
  font-size: 1.15em; color: #c0698a;
  text-shadow: 0 2px 0 #fff, 0 0 18px rgba(255,255,255,.9);
}
.lead { font-size: 15px; color: var(--ink-soft); margin: 28px 0 32px; }
.pc { display: none; }
@media (min-width: 560px) { .pc { display: inline; } }

.btn {
  appearance: none; border: 0; cursor: pointer;
  min-width: 240px; padding: 16px 32px; border-radius: 999px;
  font-size: 17px; font-weight: 700; letter-spacing: .12em; color: #fff;
  background: linear-gradient(135deg, #d7a24f, #c0698a);
  box-shadow: 0 8px 24px rgba(192, 105, 138, .35), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(192, 105, 138, .45); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  color: var(--ink); background: rgba(255,255,255,.7);
  box-shadow: inset 0 0 0 1.5px var(--gold-soft);
}

/* トップ画像 */
.hero { display: block; width: min(52vw, 230px); margin: -12px auto 0; }
.hero img {
  width: 100%; height: auto;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 6%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 6%, #000 88%, transparent);
          mask-composite: intersect;
  animation: float 6s ease-in-out infinite;
}
.hero + .lead { margin: 4px 0 20px; }
.btn-start {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 280px; padding: 14px 36px 12px; font-size: 19px;
  animation: pulse 2.4s ease-in-out infinite;
}
.btn-main { display: inline-flex; align-items: center; gap: 10px; }
.btn-arrow {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: #c0698a; font-size: 11px; letter-spacing: 0;
}
.btn-sub { font-size: 12px; font-weight: 500; letter-spacing: .08em; opacity: .92; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(192, 105, 138, .35), 0 0 0 0 rgba(192, 105, 138, .35); }
  50% { box-shadow: 0 8px 24px rgba(192, 105, 138, .35), 0 0 0 12px rgba(192, 105, 138, 0); }
}

@keyframes float { 50% { translate: 0 -8px; } }

/* 選択画面 */
.pick-title { font-family: var(--mincho); font-size: clamp(22px, 6vw, 28px); margin: 4px 0 8px; min-height: 1.6em; }
.pick-note { color: var(--ink-soft); font-size: 14px; margin: 8px 0 0; min-height: 1.9em; }

.table {
  position: relative; height: 300px; margin: 8px auto 0; max-width: 560px;
}
.pcard {
  position: absolute; left: 50%; bottom: 40px;
  width: var(--card-w); aspect-ratio: 5 / 7; margin-left: calc(var(--card-w) / -2);
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 9px;
  transform-origin: 50% 330%;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), filter .3s, opacity .5s;
  -webkit-tap-highlight-color: transparent;
}
.pcard img {
  width: 100%; height: 100%; border-radius: 9px;
  box-shadow: 0 6px 16px rgba(74, 59, 79, .22);
  transition: transform .25s, box-shadow .25s;
}
.table.is-shuffling .pcard { cursor: default; }
.table.is-shuffling .pcard { animation: riffle .5s ease-in-out infinite alternate; }
@keyframes riffle {
  from { translate: calc(var(--dx) * -1) 0; }
  to   { translate: var(--dx) var(--dy); }
}
.table.is-ready .pcard:hover img,
.table.is-ready .pcard:focus-visible img {
  transform: translateY(-22px);
  box-shadow: 0 0 0 2px #fff, 0 0 24px 6px rgba(255, 236, 170, .9);
}
.pcard:focus-visible { outline: none; }
.table.is-chosen .pcard { pointer-events: none; }
.table.is-chosen .pcard:not(.is-picked) { opacity: 0; filter: blur(2px); }
.pcard.is-picked img { box-shadow: 0 0 0 2px #fff, 0 0 40px 12px rgba(255, 236, 170, .95); }

@media (min-width: 560px) {
  :root { --card-w: 104px; }
  .table { height: 400px; }
}

/* 結果：カードがめくれる */
.reveal { padding-top: 8px; }
.flip { width: min(72vw, 300px); aspect-ratio: 1260 / 1748; margin: 0 auto; perspective: 1400px; }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.3, .7, .2, 1);
}
.flip.is-open .flip-inner { transform: rotateY(180deg); }
.flip-back, .flip-front {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 3px #fff, 0 18px 50px rgba(74, 59, 79, .3);
}
.flip-back img, .flip-front img { width: 100%; height: 100%; object-fit: cover; }
.flip-front { transform: rotateY(180deg); }
.flip.is-open .flip-front { animation: halo 2.4s ease-out 1s both; }
@keyframes halo {
  from { box-shadow: 0 0 0 3px #fff, 0 0 80px 30px rgba(255, 240, 190, 1); }
  to   { box-shadow: 0 0 0 3px #fff, 0 18px 50px rgba(74, 59, 79, .3); }
}

.reveal-name { opacity: 0; transform: translateY(12px); transition: all .9s ease 1.1s; }
.reveal-name.is-show { opacity: 1; transform: none; }
.r-no { margin: 24px 0 0; font-size: 13px; letter-spacing: .25em; color: var(--gold); }
.r-name { font-family: var(--mincho); font-size: clamp(24px, 6.4vw, 34px); margin: 4px 0 0; letter-spacing: .08em; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.r-sub { margin: 0; color: var(--ink-soft); font-size: 14px; min-height: 0; }
.r-sub:empty { display: none; }

.result { opacity: 0; transition: opacity 1s ease 1.8s; text-align: left; margin-top: 28px; }
.result.is-show { opacity: 1; }

.label { margin: 0 0 6px; font-size: 12px; letter-spacing: .2em; color: var(--gold); text-align: center; }

.oracle { text-align: center; padding: 8px 0 28px; }
.oracle-text {
  font-family: var(--mincho); font-weight: 700; margin: 0;
  font-size: clamp(24px, 6.6vw, 34px); line-height: 1.6; letter-spacing: .08em;
  color: #9a5a78;
}

.panel {
  background: var(--paper); border-radius: 18px; padding: 24px 22px;
  margin-bottom: 16px; box-shadow: 0 4px 20px rgba(74, 59, 79, .06);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.panel h3 {
  font-family: var(--mincho); font-size: 18px; margin: 0 0 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.prose p { margin: 0 0 1em; font-size: 15.5px; }
.prose p:last-child { margin-bottom: 0; }

.zubari { text-align: center; background: linear-gradient(135deg, rgba(255,248,230,.9), rgba(255,255,255,.75)); box-shadow: inset 0 0 0 1px var(--line); }
.zubari-text { font-family: var(--mincho); font-weight: 700; font-size: 22px; margin: 0; line-height: 1.6; }

.hints { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hints li {
  padding: 6px 14px; border-radius: 999px; font-size: 14px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
}
.hint-note { margin: 14px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.hint-note:empty { display: none; }

.word { text-align: center; padding: 32px 8px 8px; }
.word-text {
  font-family: var(--mincho); font-size: clamp(20px, 5.4vw, 26px); margin: 0; line-height: 1.8; white-space: pre-line;
  word-break: keep-all; overflow-wrap: anywhere;
}

/* ステップメール案内 */
.mail {
  margin: 40px -4px 0; padding: 36px 20px 28px; text-align: center;
  border-radius: 24px;
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(255, 238, 186, .75), transparent 70%),
    rgba(255, 255, 255, .62);
  box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(184, 146, 74, .18);
}
.mail-eyebrow { margin: 0 0 8px; font-size: 13px; letter-spacing: .14em; color: var(--gold); }
.mail-title {
  font-family: var(--mincho); font-weight: 700; margin: 0 0 24px;
  font-size: clamp(22px, 6vw, 28px); line-height: 1.6; letter-spacing: .04em;
}
.mail-lead p { margin: 0 0 1.2em; font-size: 15.5px; line-height: 2; }
.mail-lead strong { font-family: var(--mincho); font-size: 1.15em; color: #9a5a78; }
.mail-lead em { font-style: normal; background: linear-gradient(transparent 62%, rgba(233, 199, 123, .55) 62%); }

.mail-box {
  margin: 28px 0 0; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, #fffaf0, #fff);
  box-shadow: inset 0 0 0 1.5px var(--gold-soft), 0 8px 28px rgba(184, 146, 74, .18);
}
.mail-banner { width: 100%; height: auto; }
.mail-box-body { padding: 22px 18px 24px; }
.mail-box-badge {
  display: inline-block; margin: 0 0 18px; padding: 3px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #fff;
  background: linear-gradient(135deg, #d7a24f, #c0698a);
}
.mail-tease p { margin: 0 0 1.1em; font-family: var(--mincho); font-size: 16px; line-height: 2; }
.mail-tease em { font-style: normal; background: linear-gradient(transparent 62%, rgba(233, 199, 123, .55) 62%); }
.mail-tease-end { color: #9a5a78; font-weight: 700; }
.mail-note { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.9; }

.mail-form { margin-top: 28px; text-align: left; }
.mail-form-title { text-align: center; font-weight: 700; color: #9a5a78; margin: 0 0 14px; letter-spacing: .06em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; margin-bottom: 4px; color: var(--ink-soft); }
.field input {
  width: 100%; padding: 13px 14px; border-radius: 12px; font: inherit; font-size: 16px; color: var(--ink);
  border: 1.5px solid #e6d6c6; background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--gold-soft); box-shadow: 0 0 0 3px rgba(233, 199, 123, .35); }
.field input[aria-invalid="true"] { border-color: #d88a9f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-mail { display: block; width: 100%; min-width: 0; margin: 8px 0 0; font-size: 16px; letter-spacing: .06em; }
.btn-mail[disabled] { opacity: .6; cursor: wait; transform: none; }
.form-msg { min-height: 1.6em; margin: 10px 0 0; font-size: 14px; text-align: center; color: #b4566f; }
.mail-fine { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); text-align: center; line-height: 1.9; }
.mail-fine a { color: var(--gold); }

.mail-done { margin-top: 28px; padding: 24px 16px; border-radius: 18px; background: #fffaf0; box-shadow: inset 0 0 0 1.5px var(--gold-soft); }
.mail-done-title { font-family: var(--mincho); font-weight: 700; font-size: 20px; margin: 0 0 10px; color: #9a5a78; }
.mail-done p { margin: 0 0 10px; font-size: 15px; }

.actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 36px 0 8px; }
/* シェア */
.share-card {
  margin: 36px 0 0; padding: 30px 18px 22px; text-align: center; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,248,236,.9));
  box-shadow: 0 0 0 1.5px var(--gold-soft), 0 10px 32px rgba(184, 146, 74, .18);
}
.share-heading { font-family: var(--mincho); font-size: 18px; margin: 0 0 8px; color: #8a6a2e; letter-spacing: .08em; }
.share-lead { margin: 0 0 20px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.8; }
.share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .share-buttons { grid-template-columns: repeat(4, 1fr); } }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 10px; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 700; letter-spacing: .04em; color: #fff; text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14); transition: transform .2s, box-shadow .2s;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .2); }
.share-btn:active { transform: translateY(0); }
.share-icon { display: inline-flex; flex: none; }
.share-wide { grid-column: 1 / -1; }
.share-line { background: linear-gradient(135deg, #06c755, #04a847); }
.share-x, .share-threads { background: linear-gradient(135deg, #2a2a2a, #000); }
.share-fb { background: linear-gradient(135deg, #2188ff, #1664d6); }
.share-copy { background: linear-gradient(135deg, #c9a0c8, #a77fb0); }
.share-instagram { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%); }
.share-message { min-height: 1.6em; margin: 14px 0 0; font-size: 13.5px; color: #8a6a2e; }

.foot { text-align: center; font-size: 12px; color: var(--ink-soft); padding: 16px 0 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
