:root {
  --paper: #F9F6F2;
  --surface: #FFFFFF;
  --ink: #1E1A26;
  --ink-2: #5C5568;
  --muted: #8C8496;
  --line: #E4DED9;
  --rose: #A8456A;
  --rose-wash: #F5E4EA;
  --indigo: #5B5AA0;
  --indigo-wash: #E7E6F5;
  --gold: #B5760E;
  --gold-wash: #F6E9D2;
  --danger: #b3261e;
  --shadow: 0 2px 10px rgba(30,26,38,0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #120F1A;
    --surface: #1B1723;
    --ink: #EDE8F2;
    --ink-2: #B8B0C4;
    --muted: #7C7488;
    --line: #2C2438;
    --rose: #C85F87;
    --rose-wash: #35202A;
    --indigo: #8886D4;
    --indigo-wash: #262246;
    --gold: #C08128;
    --gold-wash: #362a12;
    --shadow: 0 2px 10px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(1.5px 1.5px at 10% 8%, var(--gold) 0%, transparent 60%),
    radial-gradient(1px 1px at 85% 14%, var(--rose) 0%, transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 4%, var(--gold) 0%, transparent 60%),
    radial-gradient(1px 1px at 25% 22%, var(--indigo) 0%, transparent 60%),
    radial-gradient(1.5px 1.5px at 92% 30%, var(--gold) 0%, transparent 60%),
    radial-gradient(1px 1px at 5% 40%, var(--rose) 0%, transparent 60%),
    var(--paper);
  background-attachment: fixed;
  opacity: 1;
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic Medium", "Noto Sans JP", "Meiryo", sans-serif;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.previewbar {
  width: 100%;
  background: var(--indigo);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  padding: 7px 12px;
  line-height: 1.5;
}
.previewbar .pb-short { display: inline; }
.previewbar .pb-long { display: none; }
@media (min-width: 640px) {
  .previewbar .pb-short { display: none; }
  .previewbar .pb-long { display: inline; }
}

.wrap {
  width: 100%;
  max-width: 560px;
  padding: 32px 20px 80px;
}

header.brand {
  text-align: center;
  margin-bottom: 28px;
}
header.brand .moon {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 14px rgba(30,26,38,0.25);
  overflow: hidden;
}
header.brand .moon img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.18); }
header.brand h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
header.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ===== character intro (Yorika portrait + speech bubble) ===== */
.character-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 0 0 30px;
}
.character-portrait {
  position: relative;
  width: 100%;
  max-width: 320px;
  flex: none;
}
.character-portrait::after {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  background: radial-gradient(circle, var(--rose-wash) 0%, transparent 70%);
  filter: blur(2px);
  opacity: 0.9;
}
.character-video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  border-radius: 26px;
  box-shadow: 0 18px 44px rgba(30,26,38,0.32);
  border: 3px solid var(--gold-wash);
}
.character-sparkle {
  position: absolute;
  top: -12px;
  right: -6px;
  font-size: 26px;
  color: var(--gold);
  animation: sparkle 2.4s ease-in-out infinite;
}
.character-sparkle-2 {
  top: auto; right: auto;
  bottom: 10%; left: -10px;
  font-size: 18px;
  color: var(--rose);
  animation-delay: 1.1s;
}
@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(15deg); }
}
.character-bubble {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  text-align: left;
}
.character-bubble::before {
  content: "";
  position: absolute;
  top: -8px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  rotate: 45deg;
}
.character-name {
  margin: 0 0 10px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em;
  color: var(--rose);
}
.character-say {
  margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.95; text-wrap: pretty;
  overflow-wrap: break-word;
}
.character-say:last-child { margin-bottom: 0; }

/* ===== decorative dividers ===== */
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin: 30px 0;
  color: var(--gold); font-size: 12px; letter-spacing: 0.3em;
}
.divider span:nth-child(2) { color: var(--rose); font-size: 10px; }

.section-icon { margin-right: 6px; font-size: 13px; }
.usecase-icon { margin-right: 8px; font-size: 15px; vertical-align: -2px; }
.menu-icon { font-size: 24px; margin-bottom: 6px; }

.login-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.login-avatar {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none;
  box-shadow: 0 4px 10px rgba(30,26,38,0.25);
}
.login-card-head h2 { margin: 0 0 4px; }
.login-card-head .lead { margin: 0; }

/* ===== landing hero (screen-login) ===== */
.hero-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 160px;
  margin: 8px 0 22px;
}
.hero-cards .hc {
  width: 74px;
  margin: 0 -14px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(30,26,38,0.3);
  transition: transform 0.25s ease;
}
.hero-cards .hc svg { width: 100%; height: auto; display: block; }
.hero-cards .hc:nth-child(1) { transform: rotate(-18deg) translateY(14px); z-index: 1; }
.hero-cards .hc:nth-child(2) { transform: rotate(-9deg) translateY(4px); z-index: 2; }
.hero-cards .hc:nth-child(3) { transform: rotate(0deg) translateY(-6px); z-index: 3; width: 84px; }
.hero-cards .hc:nth-child(4) { transform: rotate(9deg) translateY(4px); z-index: 2; }
.hero-cards .hc:nth-child(5) { transform: rotate(18deg) translateY(14px); z-index: 1; }

.hero-headline {
  text-align: left;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-emphasis {
  text-align: left;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--rose);
  margin: 0 0 16px;
  text-wrap: balance;
}
.hero-lead {
  text-align: left;
  margin: 0 0 26px;
  font-size: 14px;
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.nowrap { white-space: nowrap; }

.section-block { margin-bottom: 26px; }
.section-title {
  font-size: 13px; font-weight: 800; color: var(--rose);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 10px; text-align: left;
}
.section-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.95; margin: 0; text-wrap: pretty; overflow-wrap: break-word; }

.usecase-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
}
.usecase-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--ink);
  position: relative; padding-left: 30px; text-wrap: pretty;
}
.usecase-list li::before {
  content: "◆"; position: absolute; left: 12px; top: 10px;
  color: var(--gold); font-size: 10px;
}

.menu-preview { display: grid; gap: 10px; }
.menu-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.menu-item.highlight { border-color: var(--rose); background: var(--rose-wash); }
.menu-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.menu-name { font-weight: 800; font-size: 14.5px; }
.menu-name small { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.menu-price { font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.menu-price.free { color: var(--rose); }
.menu-item p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; text-wrap: pretty; }

.feature-list { display: grid; gap: 10px; margin-bottom: 26px; }
.feature-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow);
}
.feature-emoji { font-size: 22px; flex: none; }
.feature-item b { display: block; font-size: 14px; }
.feature-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.how-it-works {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px; margin-top: 14px;
}
.how-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-2);
  background: var(--indigo-wash); border-radius: 10px; padding: 10px 12px;
}
.how-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}

.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.faq-q {
  margin: 0 0 6px; font-size: 13.5px; font-weight: 800; color: var(--ink);
  display: flex; gap: 8px;
}
.faq-q::before { content: "Q"; color: var(--rose); flex: none; }
.faq-a {
  margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.8;
  padding-left: 20px; text-wrap: pretty;
}

.steps {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-bottom: 30px; flex-wrap: wrap;
}
.step {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100px; font-size: 11.5px; color: var(--ink-2); gap: 6px;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--rose); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
}
.step-arrow { color: var(--muted); font-size: 14px; padding-bottom: 22px; }

.login-card { margin-top: 4px; }

.screen { display: none; }
.screen.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

h2 { font-size: 19px; margin: 0 0 6px; font-weight: 800; }
.lead { color: var(--ink-2); font-size: 13.5px; margin: 0 0 18px; }

label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  margin-bottom: 16px;
  resize: vertical;
}
textarea { min-height: 90px; }
input[type="text"]:focus, textarea:focus { outline: 2px solid var(--rose); outline-offset: 1px; }

.spread-list { display: grid; gap: 10px; margin-bottom: 18px; }
.spread-option {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  cursor: pointer;
}
.spread-option.selected { border-color: var(--rose); background: var(--rose-wash); }
.spread-option input { margin: 0; }
.spread-option .meta { flex: 1; }
.spread-option .name { font-weight: 700; font-size: 14px; }
.spread-option .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.debug-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--indigo); font-weight: 700;
  cursor: pointer; margin-bottom: 4px;
}
.debug-toggle input { margin: 0; }
.debug-cards { display: none; flex-direction: column; gap: 8px; margin: 10px 0 16px; }
.debug-cards.show { display: flex; }
.debug-card-row {
  display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 8px;
  background: var(--indigo-wash); border-radius: 10px; padding: 8px 10px;
}
.debug-card-row .pos-label { font-size: 11.5px; color: var(--indigo); font-weight: 700; grid-column: 1 / -1; }
.debug-thumb { width: 34px; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 4px rgba(30,26,38,0.3); }
.debug-thumb svg { width: 100%; height: auto; display: block; }
.debug-card-row select {
  font-family: inherit; font-size: 13px; padding: 7px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.debug-card-row label.rev { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.spread-option .price { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.spread-option .price.free { color: var(--rose); }

button.primary {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost {
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
}

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.badge.first { background: var(--gold-wash); color: var(--gold); }

.price-box {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
}
.price-box .amount { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--rose);
  animation: spin 0.8s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cards-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.card-chip {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
  font-size: 11.5px; font-weight: 700; color: var(--ink);
}
.card-art-wrap {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(30,26,38,0.25);
  margin-bottom: 6px;
  transition: transform 0.4s ease;
}
.card-art-wrap.reversed { transform: rotate(180deg); }
.card-art { width: 100%; height: auto; display: block; }
.card-art.card-art-photo { aspect-ratio: 2 / 3; object-fit: cover; }
.card-art.art-major { color: #E8D9B8; }
.card-art.art-ワンド { color: #EFB07C; }
.card-art.art-カップ { color: #8FD8C2; }
.card-art.art-ソード { color: #C3BFF0; }
.card-art.art-ペンタクル { color: #D8CE8E; }
.card-chip .orient { display: block; font-weight: 500; font-size: 10px; margin-top: 2px; color: var(--muted); }

.reading-text {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.9;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}

.error-box {
  background: #FBEAE9; color: var(--danger); border-radius: 10px;
  padding: 12px 14px; font-size: 13px; margin-bottom: 16px; display: none;
}
.error-box.show { display: block; }

/* ===================== PC(デスクトップ)向けレスポンシブ =====================
   参考: フェリシモ タロット占い(https://www.felissimo.co.jp/contents/tarot/tarot_fc.html)
   単一カラム・中央寄せ・余白を活かした構成、カード類は整列グリッドで並べる、
   という考え方を踏襲しつつ、Yorika独自の配色・カード扇イラストは維持する。 */
@media (min-width: 860px) {
  .wrap { max-width: 760px; padding: 56px 40px 110px; }

  header.brand { margin-bottom: 40px; }
  header.brand .moon { width: 76px; height: 76px; }
  header.brand h1 { font-size: 32px; }
  header.brand p { font-size: 14px; }

  .character-intro { flex-direction: row; align-items: center; gap: 40px; margin-bottom: 44px; }
  .character-portrait { width: 340px; max-width: 340px; }
  .character-bubble { flex: 1; padding: 30px 36px; }
  .character-bubble::before {
    top: 50%; left: -8px; transform: translateY(-50%) rotate(45deg);
    border-left: none; border-top: none;
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  .character-name { font-size: 14px; }
  .character-say { font-size: 16px; line-height: 2; }

  .hero-cards { height: 250px; margin: 8px 0 34px; }
  .hero-cards .hc { width: 112px; margin: 0 -22px; }
  .hero-cards .hc:nth-child(3) { width: 130px; }

  .hero-headline { font-size: 40px; }
  .hero-emphasis { font-size: 26px; }
  .hero-lead { font-size: 16px; }
  .section-title { font-size: 14px; }
  .section-text { font-size: 15px; }

  /* minmaxを広めに取り、短い文章がグリッドの中で不自然に2行折り返さないようにする */
  .feature-list { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
  .feature-item { flex-direction: column; align-items: flex-start; text-align: left; padding: 22px; gap: 10px; }
  .feature-emoji { font-size: 30px; }

  .usecase-list { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

  .menu-preview { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
  .menu-item p { min-height: 3.4em; }

  .steps { justify-content: space-between; }
  .step { width: 150px; font-size: 12.5px; }

  .card, .login-card { padding: 34px; }

  .cards-row { gap: 18px; }
  .card-chip { width: 120px; font-size: 12.5px; }

  .spread-list, .checklist, .debug-cards { gap: 12px; }

  .price-box .amount { font-size: 26px; }

  .faq-list { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .how-it-works { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* 大画面(ノートPC〜ワイドモニタ)では、コンテンツ幅そのものをしっかり広げる。
   参考にしたフェリシモのページも単一カラムだが、余白だけが間延びしないよう
   コンテンツの実質幅を確保している構成を踏襲する。 */
@media (min-width: 1240px) and (max-width: 1399.98px) {
  .wrap { max-width: 900px; }
}

@media (min-width: 1400px) {
  .wrap { max-width: 1080px; padding: 64px 48px 120px; }

  .character-portrait { width: 400px; max-width: 400px; }
  .character-say { font-size: 16.5px; }

  .hero-headline { font-size: 46px; }
  .hero-emphasis { font-size: 28px; }
  .hero-lead { font-size: 17px; }
  .section-text { font-size: 15.5px; }

  .hero-cards { height: 280px; }
  .hero-cards .hc { width: 124px; margin: 0 -24px; }
  .hero-cards .hc:nth-child(3) { width: 144px; }

  .feature-list { grid-template-columns: repeat(3, 1fr); }
  .menu-preview { grid-template-columns: repeat(3, 1fr); }
  .usecase-list { grid-template-columns: repeat(2, 1fr); }
  .faq-list { grid-template-columns: repeat(2, 1fr); }
}

.footnote { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
