/* ============================================================
   hero.css — 質問入力画面（ヒーロー）の完成デザイン
   夜空の中に金タイトル・ガラスフォーム・魔法使い・占星術装飾を配した2カラム構図。
   金枠と夜空トーンは全画面共通。DOM契約は不変・装飾は pointer-events:none。
   ============================================================ */

:root {
  /* ヒーローは横に広く使う。他画面（layout.css）は --content-max-width のまま。 */
  --hero-max-width: 1360px;
  --frame-inset: clamp(10px, 1.4vw, 22px);
  --frame-gold: rgba(224, 190, 122, 0.72);
  --frame-gold-soft: rgba(217, 178, 106, 0.38);
}

/* ============================================================
   1. 全画面共通: 夜空の深みと金の額縁
   ============================================================ */

/* 夜空を深く。左の紫星雲を主役に、中央上のオーラと右下の藍で奥行きを作る */
body {
  background:
    /* 左の紫の星雲を主役に。中央上のオーラ、右下の藍、右上のほのかな暖色で奥行き */
    radial-gradient(760px 680px at 12% 34%, rgba(116, 62, 188, 0.40), transparent 60%),
    radial-gradient(620px 560px at 4% 70%, rgba(88, 50, 162, 0.34), transparent 60%),
    radial-gradient(1100px 640px at 50% -8%, rgba(84, 60, 146, 0.40), transparent 62%),
    radial-gradient(900px 720px at 90% 10%, rgba(70, 48, 120, 0.28), transparent 60%),
    radial-gradient(820px 640px at 88% 96%, rgba(58, 40, 116, 0.34), transparent 60%),
    linear-gradient(178deg, #0A0817 0%, #130B28 46%, #0C0819 100%);
  background-attachment: fixed;
}

/* 画面四辺の細い金の装飾ライン（内側にオフセットした二重枠 + 発光 + 四隅飾り）。 */
.page-frame {
  position: fixed;
  inset: var(--frame-inset);
  z-index: -1;
  pointer-events: none;
  border: 1px solid var(--frame-gold);
  border-radius: 6px;
  /* 枠自体をほのかに発光させて「高級な額縁」に見せる */
  box-shadow:
    inset 0 0 0 0.5px rgba(233, 212, 161, 0.18),
    inset 0 0 34px rgba(217, 178, 106, 0.10),
    0 0 22px rgba(217, 178, 106, 0.10);
  /* 四隅の金コーナー飾り（L字＋ダイヤ）を background で四隅に配置 */
  background:
    var(--frame-corner-svg) top left / 40px 40px no-repeat,
    var(--frame-corner-svg) top right / 40px 40px no-repeat,
    var(--frame-corner-svg) bottom left / 40px 40px no-repeat,
    var(--frame-corner-svg) bottom right / 40px 40px no-repeat;
  --frame-corner-svg:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M2 14 V2 H14 M2 8 H8 V2' stroke='%23E4C67F' stroke-width='1' fill='none' stroke-linecap='round' opacity='0.85'/%3E%3Crect x='11' y='11' width='4' height='4' fill='%23E9D4A1' transform='rotate(45 13 13)' opacity='0.9'/%3E%3C/svg%3E");
}
.page-frame::before {
  /* 二重の内枠（発光する細線） */
  content: '';
  position: absolute;
  inset: 7px;
  border: 0.5px solid var(--frame-gold-soft);
  border-radius: 4px;
  box-shadow: inset 0 0 18px rgba(217, 178, 106, 0.06);
}

.page-frame::after {
  /* 上下の中央に細い金線と光沢（中央に集光した装飾線） */
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 38%, var(--frame-gold) 50%, transparent 62%) top / 100% 1.5px no-repeat,
    linear-gradient(90deg, transparent 38%, var(--frame-gold) 50%, transparent 62%) bottom / 100% 1.5px no-repeat,
    linear-gradient(0deg, transparent 40%, var(--frame-gold-soft) 50%, transparent 60%) left / 1.5px 100% no-repeat,
    linear-gradient(0deg, transparent 40%, var(--frame-gold-soft) 50%, transparent 60%) right / 1.5px 100% no-repeat;
  opacity: 0.85;
}

/* ============================================================
   2. ヘッダー: 金の大タイトル + 装飾ライン + サブタイトル
   ============================================================ */

header {
  position: relative;
  max-width: var(--hero-max-width);
  padding: clamp(1.6rem, 3vh, 3rem) var(--space-lg) var(--space-md);
  z-index: 2;
}

.site-title {
  font-family: var(--font-display), var(--font-heading-ja);
  font-weight: 600;
  font-size: clamp(3rem, 2rem + 4.2vw, 5.6rem);
  letter-spacing: 0.12em;
  padding-bottom: 0;
  background: linear-gradient(178deg, #F6E7BD 0%, #E4C67F 40%, #C89A4C 72%, #E9D4A1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 34px rgba(217, 178, 106, 0.28);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

/* Cormorant のグロー用に、擬似要素で発光の下地を敷く（clip:text はシャドウを弱めるため） */
.site-title::after {
  /* layout.css の下線は上書きする（金線＋ダイヤは title-ornament が担う） */
  display: none;
}

/* タイトル上下の細い金線 + ダイヤ・星の装飾 */
.title-ornament {
  display: block;
  width: min(340px, 60vw);
  height: 14px;
  margin: 0.5rem auto;
  position: relative;
}

.title-ornament::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--accent-gold) 30%, var(--accent-gold-soft) 50%, var(--accent-gold) 70%, transparent);
  opacity: 0.85;
}

/* 中央のダイヤ（回転した小四角）＋左右の星 */
.title-ornament::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--accent-gold-soft);
  box-shadow:
    0 0 8px rgba(217, 178, 106, 0.7),
    -26px 0 0 -2px var(--accent-gold),
    26px 0 0 -2px var(--accent-gold);
}

.title-ornament--top { margin-bottom: 0.9rem; }
.title-ornament--bottom { margin-top: 0.9rem; }

/* タイトル上部の半円アーチ + 星（ロゴ化） */
.title-arch {
  display: block;
  width: min(240px, 46vw);
  height: auto;
  margin: 0 auto 0.2rem;
  color: var(--accent-gold);
  filter: drop-shadow(0 0 8px rgba(217, 178, 106, 0.35));
}

.site-tagline {
  color: #D9CEF0;
  letter-spacing: 0.28em;
  font-size: clamp(0.8rem, 0.7rem + 0.4vw, 1rem);
  text-transform: none;
}

/* ============================================================
   3. ヒーロー2カラム: フォーム（左寄り）と魔法使い（右）
   ============================================================ */

/* main はヒーロー時のみ広げる（他画面は layout.css の max-width を維持） */
main:has(#screen-question:not([hidden])) {
  max-width: var(--hero-max-width);
}

#screen-question {
  position: relative;
  width: 100%;
  padding-top: var(--space-sm);
  align-items: stretch;
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
}

.hero-form-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  /* フォームを中央やや左に置くため、右カラム側に少しだけ寄せる余白 */
  padding-left: clamp(0px, 3vw, 48px);
}

/* ---- ガラスモーフィズムのフォームカード ---- */
#screen-question #question-form {
  max-width: 520px;
  width: 100%;
  position: relative;
  isolation: isolate;
  /* 面色 + 微細ノイズ（SVG feTurbulence）で質感を滲ませる */
  background:
    linear-gradient(165deg, rgba(46, 28, 84, 0.62) 0%, rgba(26, 16, 52, 0.72) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  border: 1px solid transparent;
  border-radius: 22px;
  padding: clamp(1.5rem, 2.4vw, 2.4rem);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow:
    0 24px 60px rgba(6, 3, 18, 0.6),
    0 0 60px rgba(122, 92, 200, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* 金〜紫のグラデ枠（1px 外枠、border-image 相当を擬似要素マスクで） */
#screen-question #question-form::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(150deg, rgba(244, 226, 178, 0.95), rgba(150, 122, 226, 0.7) 48%, rgba(228, 194, 127, 0.9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* 内側 1px の淡いハイライト線（二重枠の内側）＋ 上部の光沢 */
#screen-question #question-form::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 18px;
  border: 1px solid rgba(233, 212, 161, 0.14);
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* 四隅の L字コーナー装飾（金線）のインラインSVGを変数化 */
.hero-form-col #question-form {
  --corner-svg:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M1 1 H14 M1 1 V14' stroke='%23E4C67F' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3Crect x='3.4' y='3.4' width='3.2' height='3.2' fill='%23E9D4A1' transform='rotate(45 5 5)'/%3E%3C/svg%3E");
}

/* 四隅の小片を絶対配置（擬似要素は枠に使用済みのため実要素で持つ） */
#screen-question #question-form .form-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  background-image: var(--corner-svg);
  background-repeat: no-repeat;
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
}

.form-corner--tl { top: 9px; left: 9px; transform: rotate(0deg); }
.form-corner--tr { top: 9px; right: 9px; transform: rotate(90deg); }
.form-corner--br { bottom: 9px; right: 9px; transform: rotate(180deg); }
.form-corner--bl { bottom: 9px; left: 9px; transform: rotate(270deg); }

#screen-question #question-form label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  text-align: center;
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.5rem);
  color: var(--accent-gold-soft);
}

.label-mark {
  color: var(--accent-mystic);
  font-size: 0.7em;
  opacity: 0.9;
  text-shadow: 0 0 10px rgba(138, 111, 214, 0.6);
}

#screen-question #question-input {
  min-height: 140px;
  background: rgba(9, 5, 18, 0.7);
  border: 1px solid rgba(217, 178, 106, 0.35);
  border-radius: 14px;
  color: var(--text);
  transition:
    border-color var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo),
    background-color var(--duration-normal) var(--ease-out-expo);
}

#screen-question #question-input::placeholder {
  color: rgba(178, 164, 214, 0.82);
}

/* focus 時: 上品な二段の金グロー（内側の輪郭 + 柔らかな外周発光） */
#screen-question #question-input:focus-visible {
  outline: none;
  border-color: rgba(233, 212, 161, 0.85);
  background: rgba(12, 7, 24, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(233, 212, 161, 0.4),
    0 0 0 1px rgba(217, 178, 106, 0.3),
    0 0 22px rgba(217, 178, 106, 0.3);
}

/* ---- 「占う」ボタン: 多段金グラデ・ベベル・光沢スイープ ---- */
#screen-question #btn-divine {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: clamp(250px, 60%, 320px);
  padding: 0.95rem var(--space-lg);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.3rem);
  letter-spacing: 0.36em;
  border-radius: 14px;
  color: #2A1B08;
  /* 上端ハイライト→中間金→下端深金の多段グラデーション */
  background: linear-gradient(180deg, #FCF3D8 0%, #F3E1AB 26%, #E4C67F 52%, #D2A659 78%, #B8863C 100%);
  border: 1px solid #A8792F;
  text-shadow: 0 1px 0 rgba(255, 248, 224, 0.7);
  /* inset ハイライト（上端）＋ inset シャドウ（下端）でベベル感、外周に発光 */
  box-shadow:
    0 10px 28px rgba(120, 84, 24, 0.42),
    0 0 0 1px rgba(248, 236, 198, 0.35),
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.85),
    inset 0 -2px 3px rgba(120, 84, 24, 0.45);
  transition:
    transform var(--duration-fast) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo);
}

/* 斜めの光沢帯（hover で左→右へ走らせる。transform のみ） */
#screen-question #btn-divine::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -60%;
  width: 40%;
  height: 140%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.15) 60%,
    transparent 100%
  );
  transform: translateX(0) skewX(-16deg);
  opacity: 0;
  transition: opacity var(--duration-fast) linear;
}

#screen-question #btn-divine:hover::before {
  opacity: 1;
  animation: btn-gloss-sweep 720ms var(--ease-out-expo);
}

@keyframes btn-gloss-sweep {
  0% { transform: translateX(0) skewX(-16deg); }
  100% { transform: translateX(420%) skewX(-16deg); }
}

#screen-question #btn-divine:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 36px rgba(150, 108, 32, 0.52),
    0 0 34px rgba(233, 212, 161, 0.6),
    0 0 0 1px rgba(248, 236, 198, 0.5),
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.95),
    inset 0 -2px 3px rgba(120, 84, 24, 0.4);
}

#screen-question #btn-divine:active {
  transform: translateY(0);
  box-shadow:
    0 5px 14px rgba(120, 84, 24, 0.4),
    inset 0 2px 5px rgba(120, 84, 24, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#screen-question #btn-divine:focus-visible {
  outline: none;
  box-shadow:
    0 12px 30px rgba(150, 108, 32, 0.5),
    0 0 0 3px rgba(217, 178, 106, 0.55),
    0 0 30px rgba(233, 212, 161, 0.5),
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.9);
}

/* ---- 注意書き ---- */
#screen-question .note {
  max-width: 520px;
  text-align: center;
  color: #C7BAE6;
  line-height: 1.7;
}

.note-mark {
  color: var(--accent-gold);
  margin: 0 0.4em;
  opacity: 0.8;
}

/* ---- 魔法使い ---- */
.hero-wizard-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  min-height: 0;
}

.hero-wizard {
  width: auto;
  height: auto;
  max-height: min(74vh, 680px);
  max-width: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 20px 45px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 40px rgba(122, 92, 200, 0.4));
  /* 切り出し境界（左下の直線）を斜めグラデーションで自然にフェードさせる */
  -webkit-mask-image: linear-gradient(52deg, transparent 1%, #000 16%);
  mask-image: linear-gradient(52deg, transparent 1%, #000 16%);
  transform: translateX(-6%);
  animation: wizard-float 7s var(--ease-in-out-soft) infinite;
}

@keyframes wizard-float {
  0%, 100% { transform: translateX(-6%) translateY(0); }
  50% { transform: translateX(-6%) translateY(-10px); }
}

/* 魔法使い背後の紫グロー（背景から浮かせる） */
.hero-wizard-col::before {
  content: '';
  position: absolute;
  bottom: 6%;
  left: 50%;
  width: 82%;
  aspect-ratio: 1 / 1.2;
  transform: translateX(-54%);
  background:
    radial-gradient(circle at 50% 42%, rgba(146, 108, 224, 0.5), transparent 62%),
    radial-gradient(circle at 66% 60%, rgba(190, 120, 150, 0.22), transparent 60%);
  filter: blur(12px);
  z-index: -1;
  pointer-events: none;
}

/* 魔法使い上方の暖色星雲（参考画像の右側の温かい靄を再現） */
.hero-wizard-col::after {
  content: '';
  position: absolute;
  top: 2%;
  right: -6%;
  width: 70%;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 55% 45%, rgba(176, 116, 168, 0.22), transparent 60%),
    radial-gradient(circle at 40% 60%, rgba(126, 90, 200, 0.20), transparent 62%);
  filter: blur(14px);
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   4. 装飾レイヤー（月・円盤・星座・カード扇）
   ============================================================ */

.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* 三日月まわりの星雲グロー。ノイズで雲の質感を与え radial マスクで矩形の縁を消す */
.decor-moon-halo {
  position: absolute;
  top: clamp(-90px, -6vw, -40px);
  left: clamp(-70px, -3vw, -10px);
  width: clamp(280px, 30vw, 480px);
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 40% 44%, rgba(158, 100, 220, 0.34), transparent 56%),
    radial-gradient(circle at 62% 60%, rgba(112, 70, 194, 0.26), transparent 62%),
    radial-gradient(circle at 30% 72%, rgba(92, 58, 172, 0.20), transparent 60%);
  background-blend-mode: screen, screen, screen;
  /* 円形マスクで四角い縁をフェードアウトさせ、雲を自然に溶かす */
  -webkit-mask-image: radial-gradient(circle at 45% 50%, #000 32%, transparent 68%);
  mask-image: radial-gradient(circle at 45% 50%, #000 32%, transparent 68%);
  filter: blur(10px);
  opacity: 0.85;
}

/* 左上: 金の三日月（輝度アルファ焼き込み済み・黒=透明。drop-shadowで発光）。
   画像全面にごく薄く残る紫霞の正方形を円形マスクで羽化して消す */
.decor-moon {
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 76%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 76%);
  position: absolute;
  top: clamp(-24px, -2vw, 6px);
  left: clamp(6px, 3vw, 60px);
  width: clamp(104px, 11vw, 176px);
  height: auto;
  filter:
    drop-shadow(0 0 26px rgba(233, 212, 161, 0.5))
    drop-shadow(0 0 48px rgba(217, 178, 106, 0.28));
  opacity: 1;
}

/* 月まわりの小星クラスタ（点＋にじみ） */
.decor-star-cluster {
  position: absolute;
  pointer-events: none;
}

.decor-star-cluster--moon {
  top: clamp(-10px, 0vw, 20px);
  left: clamp(120px, 13vw, 210px);
  width: clamp(120px, 14vw, 200px);
  height: clamp(120px, 14vw, 200px);
  background-image:
    radial-gradient(1.6px 1.6px at 12% 20%, var(--accent-gold-soft) 45%, transparent 100%),
    radial-gradient(1.2px 1.2px at 40% 8%, var(--star) 45%, transparent 100%),
    radial-gradient(2px 2px at 62% 30%, var(--accent-gold-soft) 42%, transparent 100%),
    radial-gradient(1.2px 1.2px at 30% 52%, var(--star) 45%, transparent 100%),
    radial-gradient(1.6px 1.6px at 78% 60%, var(--star) 45%, transparent 100%),
    radial-gradient(1.2px 1.2px at 52% 78%, var(--accent-gold-soft) 45%, transparent 100%),
    radial-gradient(1.4px 1.4px at 88% 18%, var(--star) 45%, transparent 100%);
  background-repeat: no-repeat;
  opacity: 0.85;
  animation: star-twinkle-a 5s var(--ease-in-out-soft) infinite;
}

/* フォーム周辺の小星・光（フォームの左右・上に散らす） */
.decor-star-cluster--form {
  top: 30%;
  left: 0;
  right: 0;
  bottom: 6%;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 30%, var(--star) 45%, transparent 100%),
    radial-gradient(1.8px 1.8px at 4% 58%, var(--accent-gold-soft) 42%, transparent 100%),
    radial-gradient(1.2px 1.2px at 12% 80%, var(--star) 45%, transparent 100%),
    radial-gradient(1.4px 1.4px at 30% 92%, var(--accent-gold-soft) 45%, transparent 100%),
    radial-gradient(1.2px 1.2px at 46% 24%, var(--star) 45%, transparent 100%),
    radial-gradient(1.6px 1.6px at 55% 88%, var(--star) 45%, transparent 100%),
    radial-gradient(1.2px 1.2px at 60% 40%, var(--accent-gold-soft) 45%, transparent 100%);
  background-repeat: no-repeat;
  opacity: 0.7;
  animation: star-twinkle-b 7s var(--ease-in-out-soft) infinite;
}

/* 4方向に光条を伸ばす煌めき星（十字グロー）。参考画像の輝星を再現。 */
.decor-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-gold-soft);
  box-shadow: 0 0 6px 1px rgba(233, 212, 161, 0.9);
  opacity: 0.9;
  animation: sparkle-pulse 4.5s var(--ease-in-out-soft) infinite;
}
.decor-sparkle::before,
.decor-sparkle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.decor-sparkle::before {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 212, 161, 0.85) 50%, transparent);
}
.decor-sparkle::after {
  width: 1px;
  height: 26px;
  background: linear-gradient(180deg, transparent, rgba(233, 212, 161, 0.85) 50%, transparent);
}

.decor-sparkle--1 { top: 24%; left: 7%; }
.decor-sparkle--2 { top: 12%; right: 20%; left: auto; }
.decor-sparkle--3 { top: 46%; right: 8%; left: auto; width: 4px; height: 4px; }
.decor-sparkle--4 { bottom: 26%; right: 24%; left: auto; animation-delay: -2s; }

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* 右上: 金の黄道十二宮円盤（キャラクター背後・ゆっくり自転）。 */
.decor-astrolabe {
  position: absolute;
  top: clamp(-56px, -4vw, -8px);
  right: clamp(-60px, -4vw, 0px);
  width: clamp(260px, 32vw, 460px);
  height: auto;
  opacity: 0.42;
  animation: astrolabe-spin 120s linear infinite;
}

/* 左下: 二枚目の小さな円盤（逆回転で左側を補強。カード扇の背後） */
.decor-astrolabe--2 {
  top: auto;
  right: auto;
  bottom: clamp(-70px, -5vw, -20px);
  left: clamp(-70px, -5vw, -10px);
  width: clamp(180px, 22vw, 320px);
  opacity: 0.24;
  animation: astrolabe-spin-rev 150s linear infinite;
}

@keyframes astrolabe-spin {
  to { transform: rotate(360deg); }
}
@keyframes astrolabe-spin-rev {
  to { transform: rotate(-360deg); }
}

/* 左側の星座ライン群 */
.decor-constellation {
  position: absolute;
  color: var(--star);
}

.decor-constellation--a {
  top: 30%;
  left: clamp(4px, 2.5vw, 52px);
  width: clamp(96px, 11vw, 156px);
  opacity: 0.6;
}

.decor-constellation--b {
  bottom: 20%;
  left: clamp(2px, 4vw, 84px);
  width: clamp(84px, 10vw, 140px);
  color: var(--accent-gold-soft);
  opacity: 0.5;
}

/* 右側フォーム上の小星座 */
.decor-constellation--c {
  top: 14%;
  right: clamp(30px, 20vw, 300px);
  width: clamp(70px, 8vw, 116px);
  opacity: 0.4;
}

/* 左下: タロットカード裏面の扇（画面左端・最下部で大きく開き視認性を確保） */
.decor-fan {
  position: absolute;
  bottom: clamp(-24px, -1vw, 12px);
  left: clamp(-8px, 1vw, 32px);
  width: clamp(160px, 18vw, 250px);
  aspect-ratio: 1 / 1.1;
  opacity: 0.72;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.6));
}

.decor-fan__card {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60%;
  transform-origin: bottom center;
  border-radius: 8px;
  border: 1px solid rgba(217, 178, 106, 0.4);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(122, 92, 200, 0.25);
}

.decor-fan__card--1 { transform: rotate(-16deg) translateX(6%); }
.decor-fan__card--2 { transform: rotate(-2deg) translateX(30%); z-index: 1; }
.decor-fan__card--3 { transform: rotate(12deg) translateX(56%); }

/* ============================================================
   5. レスポンシブ
   ============================================================ */

/* タブレット以下: 魔法使いを小さく、フォーム優先 */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .hero-form-col {
    padding-left: 0;
    order: 1;
  }

  .hero-wizard-col {
    order: 2;
    align-items: center;
  }

  .hero-wizard {
    max-height: min(42vh, 380px);
    transform: none;
    animation-name: wizard-float-c;
  }

  @keyframes wizard-float-c {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  .hero-wizard-col::before { transform: translateX(-50%); }

  /* 装飾は控えめに（本文と被らないよう縮小・後退） */
  .decor-astrolabe { opacity: 0.42; }
  .decor-fan { opacity: 0.2; }
  .decor-constellation { opacity: 0.35; top: 20%; }
}

/* スマホ: 魔法使いは背景側へ回し、フォームの可読性を最優先 */
@media (max-width: 560px) {
  header {
    padding-top: var(--space-md);
  }

  .site-title {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .hero-form-col { gap: var(--space-sm); }

  #screen-question #question-form {
    padding: var(--space-md);
    border-radius: 18px;
  }

  #screen-question #btn-divine {
    min-width: min(280px, 100%);
    letter-spacing: 0.24em;
  }

  /* 魔法使いは薄く背景へ */
  .hero-wizard-col {
    position: absolute;
    inset: 0;
    z-index: 0;
    align-items: flex-start;
    justify-content: center;
    pointer-events: none;
  }

  .hero-wizard {
    max-height: 46vh;
    opacity: 0.16;
    margin-top: 8vh;
    animation: none;
  }

  .hero-wizard-col::before { display: none; }

  .hero-grid { z-index: 2; }

  .decor-moon { width: 72px; }
  .decor-fan { width: 96px; opacity: 0.16; }
  .decor-constellation { opacity: 0.28; }
  .decor-astrolabe { opacity: 0.34; }
}

/* ============================================================
   6. reduced-motion: 浮遊・回転を停止（opacity 演出は base 側で維持）
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-wizard,
  .decor-astrolabe,
  .decor-sparkle,
  .decor-star-cluster {
    animation: none !important;
  }

  /* hover の光沢スイープも停止（静止したハイライトのみ残す） */
  #screen-question #btn-divine:hover::before {
    animation: none !important;
  }
}
