:root {
  --fuji: #cdbfe0;
  --fuji-deep: #b3a0cf;
  --washi: #fffcf8;
  --ink: #2b1d3a;
  --ink-soft: #5a4a6b;
  --shu: #c23b22;
  --shu-deep: #9e2d18;
  --line: rgb(43 29 58 / 0.18);

  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--fuji);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 1rem;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--shu);
  outline-offset: 3px;
}

.page {
  max-width: 34rem;
  margin-inline: auto;
  padding: 2.5rem 1rem 3rem;
}

/* ---------- ボタン ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn--primary {
  border: 0;
  background: var(--shu);
  color: var(--washi);
}

.btn--primary:hover {
  background: var(--shu-deep);
}

.btn--plain {
  border: 1.5px solid var(--line);
  background: var(--washi);
  color: var(--ink);
}

.btn--plain:hover {
  border-color: var(--ink);
}

.link-btn {
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.link-btn[hidden] {
  display: none;
}

/* ---------- 紙片（おみくじ） ---------- */

.slip {
  position: relative;
  width: min(19rem, 100%);
  margin-inline: auto;
  background: var(--washi);
  box-shadow: 0 1px 0 var(--line), 0 1.25rem 2.5rem -1.5rem rgb(43 29 58 / 0.45);
}

.slip__head {
  padding: 0.75rem 1rem 0.625rem;
  border-bottom: 3px double var(--shu);
  color: var(--shu);
  font-family: var(--mincho);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
}

.slip__body {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 17rem;
  padding: 1.75rem 1rem 2rem;
}

.slip__title {
  writing-mode: vertical-rl;
  font-family: var(--mincho);
  font-weight: 800;
  line-height: 1.5;
}

.slip__catch {
  display: block;
  color: var(--ink-soft);
  font-size: 1.25rem;
  font-weight: 600;
}

.slip__main {
  display: block;
  font-size: 3.25rem;
  letter-spacing: 0.08em;
}

.seal {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.375rem;
  background: var(--shu);
  color: var(--washi);
  font-family: var(--mincho);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-6deg);
}

.slip__omens {
  padding: 0.25rem 1.25rem 1rem;
  border-top: 1px solid var(--line);
}

.slip__omens div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--line);
}

.slip__omens div:last-child {
  border-bottom: 0;
}

.slip__omens dt {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.slip__omens dd {
  font-family: var(--mincho);
  font-weight: 800;
}

/* ---------- トップ ---------- */

.intro {
  display: grid;
  gap: 1.5rem;
  text-align: center;
}

.intro .slip__body {
  min-height: 15rem;
}

.intro .slip__main {
  font-size: 2.25rem;
}

.intro__lead {
  margin-top: 0.5rem;
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.7;
}

.intro__note {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ---------- 質問 ---------- */

.quiz {
  display: grid;
  gap: 1.5rem;
  scroll-margin-top: 1rem;
}

.quiz[hidden] {
  display: none;
}

.quiz__progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.quiz__bar {
  flex: 1;
  height: 0.25rem;
  border-radius: 1rem;
  background: rgb(255 252 248 / 0.6);
  overflow: hidden;
}

.quiz__bar span {
  display: block;
  height: 100%;
  background: var(--shu);
  transition: width 0.25s ease-out;
}

.quiz__question {
  min-height: 5.5rem;
  padding-top: 1rem;
  font-family: var(--mincho);
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.5;
}

.quiz__question:focus {
  outline: none;
}

.quiz__choices {
  display: grid;
  gap: 0.75rem;
}

.quiz .link-btn {
  justify-self: start;
}

/* ---------- 結果 ---------- */

.result {
  display: grid;
  gap: 2.5rem;
}

.result__lead {
  margin-bottom: -1.25rem;
  font-family: var(--mincho);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.result .slip {
  animation: unroll 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes unroll {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.share {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.share__x {
  border: 0;
  background: var(--ink);
  color: var(--washi);
}

.share__x:hover {
  background: #000;
}

.share__line {
  border: 0;
  background: #06c755;
  color: #fff;
}

.share__line:hover {
  background: #05a648;
}

.share .btn svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.5rem;
  fill: currentColor;
}

.detail {
  display: grid;
  gap: 2rem;
  padding: 1.75rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--washi);
}

.detail h2 {
  margin-bottom: 0.75rem;
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 800;
}

.detail ul {
  padding-left: 1.25rem;
}

.detail li + li {
  margin-top: 0.25rem;
}

.detail li::marker {
  color: var(--shu);
}

.partner {
  display: grid;
  gap: 0.75rem;
}

.partner h2 {
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 800;
}

.partner__link {
  display: block;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--line);
  border-radius: 0.5rem;
  background: var(--washi);
  text-decoration: none;
  transition: border-color 0.2s;
}

.partner__link:hover {
  border-color: var(--ink);
}

.partner__name {
  display: block;
  font-family: var(--mincho);
  font-size: 1.375rem;
  font-weight: 800;
}

.partner__name small {
  margin-right: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
}

.partner__note {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ---------- みくじ屋トップ ---------- */

.portal {
  display: grid;
  gap: 3rem;
}

.shelf {
  display: grid;
  gap: 1rem;
}

.shelf h2 {
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 800;
}

.shelf__list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.shelf__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--line);
  border-radius: 0.5rem;
  background: var(--washi);
  text-decoration: none;
  transition: border-color 0.2s;
}

.shelf__item:hover {
  border-color: var(--ink);
}

.shelf__seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.375rem;
  background: var(--shu);
  color: var(--washi);
  font-family: var(--mincho);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.shelf__name {
  display: block;
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 800;
}

.shelf__desc {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.shelf__note {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ---------- プライバシーポリシーなどの文書ページ ---------- */

.doc {
  display: grid;
  gap: 1rem;
}

.doc h1 {
  margin-bottom: 0.5rem;
  font-family: var(--mincho);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
}

.doc h2 {
  margin-top: 1.5rem;
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.5;
}

.doc a {
  text-underline-offset: 0.2em;
}

.doc__table {
  overflow-x: auto;
  border-radius: 0.5rem;
  background: var(--washi);
}

.doc__table table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.6;
}

.doc__table th,
.doc__table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc__table tr:last-child td {
  border-bottom: 0;
}

.doc__info {
  border-radius: 0.5rem;
  background: var(--washi);
}

.doc__info div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.doc__info div:last-child {
  border-bottom: 0;
}

.doc__info dt {
  color: var(--ink-soft);
}

.doc__info dd {
  overflow-wrap: anywhere;
}

.doc__date {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ---------- フッター ---------- */

.footer {
  display: grid;
  gap: 0.5rem;
  padding: 2rem 1rem 2.5rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-align: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
}

@media (min-width: 48rem) {
  .page {
    padding-top: 4rem;
  }
}

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