/* AI占いお守り / AI Fortune Charm
   "Mystic Gilded Shrine" — 深夜の社、24K金箔、緋色の灯
*/

:root {
  --ink:        #1A123A;         /* 深紫紺（黒に近かったところを夜明け前へ） */
  --ink-2:      #2A1D55;         /* 夜紫 */
  --ink-3:      #3D2A75;         /* 紫紺 */
  --ink-mist:   #4A3690;
  --gold:       #D4AF37;         /* 本金 */
  --gold-bright:#F6E2A0;         /* 光金 */
  --gold-pale:  #EFCF7A;
  --gold-deep:  #8B6F1E;         /* 古金 */
  --gold-line:  rgba(212,175,55,0.35);
  --vermilion:  #C8161D;         /* 朱 */
  --vermilion-bright: #E84149;
  --vermilion-deep:   #6B0F11;
  --silver:     #D7D2B8;
  --text:       #EBDFB4;         /* 淡金（本文） */
  --text-bright:#FBF1CE;
  --text-dim:   #978363;
  --line:       rgba(212,175,55,0.15);
  --line-strong:rgba(212,175,55,0.35);
  --shadow:     0 30px 80px rgba(0,0,0,0.55);
  --shadow-gold:0 0 40px rgba(212,175,55,0.20);
  --r-md: 14px;
  --r-lg: 24px;
  --maxw: 520px;
  --t-fast: 0.15s ease;
  --t: 0.20s cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ink); }

body {
  font-family: "Shippori Mincho", "Cinzel", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  color: var(--text);
  background: transparent;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "palt";
  letter-spacing: 0.04em;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* タップ即応：300ms遅延キャンセル＋ダブルタップズーム抑止 */
button, a, .chip, .figure-card, .lang-list button {
  touch-action: manipulation;
}

/* ====== Mystical background — multi-layer parallax ====== */
body::before {
  /* L1: 夜明け前の藍紫グラデ + 月光 */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(200,160,240,0.40), transparent 70%),
    radial-gradient(ellipse 60% 30% at 50% 105%, rgba(232,90,80,0.25), transparent 70%),
    radial-gradient(circle at 50% 25%, rgba(75,55,135,0.85), rgba(26,18,58,1) 75%);
}
body::after {
  /* L2: きらめく星屑（最奥） */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -9;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(246,226,160,0.95), transparent 60%),
    radial-gradient(1px 1px at 28% 70%, rgba(246,226,160,0.75), transparent 60%),
    radial-gradient(1.4px 1.4px at 60% 18%, rgba(246,226,160,0.9), transparent 60%),
    radial-gradient(1px 1px at 76% 50%, rgba(246,226,160,0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 80%, rgba(246,226,160,0.85), transparent 60%),
    radial-gradient(1px 1px at 40% 88%, rgba(246,226,160,0.65), transparent 60%),
    radial-gradient(1px 1px at 8% 50%, rgba(246,226,160,0.75), transparent 60%),
    radial-gradient(1.5px 1.5px at 50% 12%, rgba(246,226,160,1), transparent 60%),
    radial-gradient(1px 1px at 92% 30%, rgba(246,226,160,0.8), transparent 60%),
    radial-gradient(1px 1px at 18% 92%, rgba(246,226,160,0.7), transparent 60%);
  animation: starShimmer 8s ease-in-out infinite;
}
@keyframes starShimmer {
  0%,100% { opacity: 0.55; }
  50%     { opacity: 1.0; }
}

/* ====== Background stage (multi-depth) ====== */
.bg-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -8;
  overflow: hidden;
}
.bg-layer {
  position: absolute;
  left: 0; right: 0;
  will-change: transform;
}

/* L3: 月（右上に小さく退避） */
.bg-moon {
  top: 4%;
  right: 6%;
  left: auto;
  width: 96px; height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 38%, #FBF1CE, #F6E2A0 35%, #C9A24C 75%, transparent 85%);
  filter: blur(0.5px);
  box-shadow:
    0 0 40px rgba(246,226,160,0.35),
    0 0 80px rgba(246,226,160,0.18),
    0 0 140px rgba(212,175,55,0.12);
  animation: moonFloat 18s ease-in-out infinite;
  opacity: 0.85;
}
.bg-moon::before {
  /* 月のクレーター */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(2px 2px at 30% 60%, rgba(180,140,60,0.35), transparent 60%),
    radial-gradient(3px 3px at 60% 35%, rgba(180,140,60,0.25), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 70%, rgba(180,140,60,0.3), transparent 60%);
}
.bg-moon::after {
  /* 月暈 */
  content: "";
  position: absolute;
  inset: -22px;
  border: 1px solid rgba(246,226,160,0.18);
  border-radius: 50%;
  animation: pulseHalo 6s ease-in-out infinite;
}
@keyframes moonFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
@keyframes pulseHalo {
  0%,100% { opacity: 0.4; transform: scale(1); }
  50%     { opacity: 0.7; transform: scale(1.05); }
}

/* L4: 流れる雲・霧（ヒーローには被らない位置に） */
.bg-mist {
  top: 45%;
  height: 200px;
  background:
    radial-gradient(ellipse 30% 40% at 20% 50%, rgba(200,160,240,0.22), transparent 70%),
    radial-gradient(ellipse 25% 35% at 70% 30%, rgba(232,200,120,0.14), transparent 70%),
    radial-gradient(ellipse 28% 40% at 50% 70%, rgba(170,130,220,0.18), transparent 70%);
  filter: blur(20px);
  animation: mistDrift 26s ease-in-out infinite;
  opacity: 0.85;
}
@keyframes mistDrift {
  0%,100% { transform: translateX(-3%); }
  50%     { transform: translateX(3%); }
}

/* L5: 山並みシルエット（遠景） */
.bg-mountains-far {
  bottom: 0;
  height: 32vh;
  background:
    linear-gradient(180deg, transparent 0%, rgba(45,28,80,0.65) 60%, rgba(26,18,58,0.92) 100%);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'><path d='M0,200 L0,140 L60,110 L120,135 L180,90 L240,120 L300,80 L360,130 L420,95 L480,115 L540,75 L600,125 L660,100 L720,140 L780,85 L840,120 L900,95 L960,130 L1000,110 L1000,200 Z' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'><path d='M0,200 L0,140 L60,110 L120,135 L180,90 L240,120 L300,80 L360,130 L420,95 L480,115 L540,75 L600,125 L660,100 L720,140 L780,85 L840,120 L900,95 L960,130 L1000,110 L1000,200 Z' fill='black'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  opacity: 0.85;
}

/* L6: 山並みシルエット（中景） */
.bg-mountains-near {
  bottom: 0;
  height: 24vh;
  background: linear-gradient(180deg, transparent 0%, rgba(30,20,65,0.95) 70%);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'><path d='M0,200 L0,170 L80,120 L160,160 L240,100 L320,140 L400,90 L480,150 L560,110 L640,160 L720,120 L800,150 L880,100 L960,140 L1000,120 L1000,200 Z' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'><path d='M0,200 L0,170 L80,120 L160,160 L240,100 L320,140 L400,90 L480,150 L560,110 L640,160 L720,120 L800,150 L880,100 L960,140 L1000,120 L1000,200 Z' fill='black'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  opacity: 1;
}

/* L7: 鳥居シルエット（前景・中央・小さめ） */
.bg-torii {
  bottom: 4vh;
  height: 13vh;
  display: flex;
  justify-content: center;
  opacity: 0.28;
  filter: drop-shadow(0 0 10px rgba(200,22,29,0.35));
}
.bg-torii::before {
  content: "";
  width: 160px;
  height: 100%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='%23B8141A'><rect x='12' y='28' width='176' height='14' rx='2'/><rect x='4' y='20' width='192' height='8' rx='2'/><rect x='28' y='42' width='144' height='6'/><rect x='40' y='48' width='12' height='150'/><rect x='148' y='48' width='12' height='150'/><rect x='40' y='80' width='120' height='8'/></g></svg>") center bottom / contain no-repeat;
  filter: brightness(0.6);
}

/* L8: 舞い落ちる粒子（季節で形・色が変わる） */
.bg-petals {
  inset: 0;
  pointer-events: none;
}
.bg-petals span {
  position: absolute;
  top: -10%;
  width: 8px; height: 8px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  border-radius: 60% 40% 50% 50% / 50%;
  opacity: 0.7;
  filter: drop-shadow(0 0 6px rgba(246,226,160,0.5));
  animation: petalFall linear infinite;
}
/* 個々の落下軌道 */
.bg-petals span:nth-child(1)  { left:  8%; animation-duration: 18s; animation-delay:  0s; }
.bg-petals span:nth-child(2)  { left: 22%; animation-duration: 24s; animation-delay:  3s; }
.bg-petals span:nth-child(3)  { left: 38%; animation-duration: 22s; animation-delay:  7s; }
.bg-petals span:nth-child(4)  { left: 55%; animation-duration: 28s; animation-delay: 11s; }
.bg-petals span:nth-child(5)  { left: 68%; animation-duration: 20s; animation-delay:  2s; }
.bg-petals span:nth-child(6)  { left: 82%; animation-duration: 26s; animation-delay:  9s; }
.bg-petals span:nth-child(7)  { left: 92%; animation-duration: 23s; animation-delay: 14s; }
.bg-petals span:nth-child(8)  { left: 14%; animation-duration: 30s; animation-delay: 17s; }
.bg-petals span:nth-child(9)  { left: 30%; animation-duration: 21s; animation-delay:  5s; }
.bg-petals span:nth-child(10) { left: 46%; animation-duration: 27s; animation-delay: 12s; }
.bg-petals span:nth-child(11) { left: 60%; animation-duration: 19s; animation-delay: 16s; }
.bg-petals span:nth-child(12) { left: 75%; animation-duration: 25s; animation-delay:  4s; }

@keyframes petalFall {
  0%   { transform: translateY(0)     rotate(0deg)    scale(1); opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(115vh)  rotate(720deg)  scale(1); opacity: 0; }
}
/* 雪用：横揺れがやさしい */
@keyframes snowFall {
  0%   { transform: translate(0, 0)         rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(20px, 50vh)   rotate(180deg); opacity: 1; }
  100% { transform: translate(-15px, 115vh) rotate(360deg); opacity: 0; }
}
/* 蛍用：明滅しながら浮遊して落ちる */
@keyframes fireflyFall {
  0%   { transform: translate(0, 0);          opacity: 0;   }
  8%   { opacity: 0.6; }
  20%  { transform: translate(8px, 18vh);     opacity: 1;   }
  35%  { transform: translate(-6px, 38vh);    opacity: 0.35;}
  50%  { transform: translate(10px, 55vh);    opacity: 1;   }
  68%  { transform: translate(-8px, 75vh);    opacity: 0.4; }
  85%  { transform: translate(6px, 95vh);     opacity: 1;   }
  100% { transform: translate(0, 115vh);      opacity: 0;   }
}

/* === 春：桜の花びら === */
body.season-spring .bg-petals span {
  width: 12px; height: 12px;
  background: linear-gradient(135deg, #FFE6EE 0%, #FFB7C9 50%, #FF7A9E 100%);
  border-radius: 100% 0% 100% 0% / 50% 50% 50% 50%;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(255,180,210,0.55));
}

/* === 夏：蛍 === */
body.season-summer .bg-petals span {
  width: 10px; height: 10px;
  background: radial-gradient(circle, #FFFFB0 0%, #B8FF60 50%, transparent 95%);
  border-radius: 50%;
  opacity: 0.9;
  filter:
    drop-shadow(0 0 12px rgba(180,255,80,0.85))
    drop-shadow(0 0 24px rgba(255,255,140,0.55));
  animation-name: fireflyFall;
  animation-timing-function: ease-in-out;
}

/* === 秋：紅葉 === */
body.season-autumn .bg-petals span {
  width: 16px; height: 16px;
  background: linear-gradient(135deg, #FFB060 0%, #E8551A 50%, #A02810 100%);
  border-radius: 0;
  /* もみじ風 5葉 */
  clip-path: polygon(
    50% 0%, 60% 25%, 90% 18%, 75% 45%, 100% 60%,
    70% 65%, 80% 100%, 50% 75%, 20% 100%, 30% 65%,
    0% 60%, 25% 45%, 10% 18%, 40% 25%
  );
  opacity: 0.9;
  filter: drop-shadow(0 0 5px rgba(232,80,30,0.55));
}

/* === 冬：雪 === */
body.season-winter .bg-petals span {
  width: 9px; height: 9px;
  background: radial-gradient(circle, #FFFFFF 0%, #DDE8FF 70%, transparent 100%);
  border-radius: 50%;
  opacity: 0.95;
  filter:
    drop-shadow(0 0 6px rgba(255,255,255,0.85))
    drop-shadow(0 0 12px rgba(200,220,255,0.4));
  animation-name: snowFall;
}

/* ====== Time-of-day theme tints ====== */

/* 朝：曙・桜茶・薄紅 */
body.tod-morning::before { background:
  linear-gradient(180deg, rgba(255,180,140,0.55) 0%, rgba(255,150,160,0.25) 25%, transparent 55%),
  radial-gradient(ellipse 80% 50% at 50% 5%, rgba(255,200,150,0.5), transparent 65%),
  radial-gradient(circle at 50% 40%, rgba(110,75,90,0.75), rgba(40,25,40,1) 70%); }
body.tod-morning .bg-moon {
  background: radial-gradient(circle at 38% 38%, #FFF1D8, #FFB89E 50%, #E07A5F 80%, transparent 90%);
  box-shadow: 0 0 50px rgba(255,140,120,0.5), 0 0 100px rgba(232,90,80,0.25);
}
body.tod-morning .bg-mist { opacity: 0.5; filter: blur(20px) hue-rotate(-30deg); }
body.tod-morning .bg-torii { filter: drop-shadow(0 0 12px rgba(232,90,80,0.5)) hue-rotate(-10deg); opacity: 0.42; }

/* 昼：澄んだ紺青・金陽 */
body.tod-noon::before { background:
  linear-gradient(180deg, rgba(150,180,230,0.38) 0%, transparent 50%),
  radial-gradient(ellipse 70% 40% at 50% 0%, rgba(220,200,140,0.35), transparent 65%),
  radial-gradient(circle at 50% 30%, rgba(50,70,140,0.7), rgba(15,20,55,1) 70%); }
body.tod-noon .bg-moon {
  background: radial-gradient(circle at 38% 38%, #FFFFE0, #FBE49C 60%, transparent 90%);
  box-shadow: 0 0 60px rgba(255,240,180,0.55), 0 0 120px rgba(255,220,140,0.3);
}
body.tod-noon .bg-mist { opacity: 0.45; }

/* 夕：茜・橙・紫 */
body.tod-evening::before { background:
  linear-gradient(180deg, rgba(255,140,90,0.65) 0%, rgba(220,80,120,0.5) 25%, rgba(120,50,150,0.35) 50%, transparent 75%),
  radial-gradient(ellipse 100% 60% at 50% 5%, rgba(255,100,80,0.55), transparent 60%),
  radial-gradient(circle at 50% 40%, rgba(100,30,60,0.85), rgba(20,5,20,1) 70%); }
body.tod-evening .bg-moon {
  background: radial-gradient(circle at 38% 38%, #FFE8C0, #FFB489 50%, #E84149 80%, transparent 90%);
  box-shadow: 0 0 60px rgba(232,65,73,0.6), 0 0 130px rgba(232,65,73,0.35);
}
body.tod-evening .bg-mist { opacity: 0.7; filter: blur(20px) hue-rotate(40deg) saturate(1.4); }
body.tod-evening .bg-torii { filter: drop-shadow(0 0 14px rgba(232,65,73,0.7)); opacity: 0.5; }

/* 宵：標準の夜紫（既定） — 全体を夜明け前まで持ち上げ */
body.tod-night::before { background:
  radial-gradient(ellipse 80% 50% at 50% -10%, rgba(200,160,240,0.45), transparent 70%),
  radial-gradient(ellipse 60% 30% at 50% 105%, rgba(232,90,80,0.30), transparent 70%),
  radial-gradient(circle at 50% 25%, rgba(85,60,150,0.85), rgba(26,18,58,1) 75%); }
body.tod-night .bg-moon {
  background: radial-gradient(circle at 38% 38%, #FBF1CE, #F6E2A0 35%, #C9A24C 75%, transparent 85%);
  box-shadow: 0 0 40px rgba(246,226,160,0.35), 0 0 80px rgba(246,226,160,0.18);
}

/* 深夜：藍紺・銀月・冷涼 — 黒を抜いて藍紫に */
body.tod-midnight::before { background:
  radial-gradient(ellipse 50% 30% at 50% -5%, rgba(150,170,240,0.35), transparent 60%),
  radial-gradient(ellipse 60% 25% at 50% 105%, rgba(90,60,180,0.30), transparent 70%),
  radial-gradient(circle at 50% 25%, rgba(35,40,95,0.95), rgba(15,18,45,1) 75%); }
body.tod-midnight .bg-moon {
  background: radial-gradient(circle at 38% 38%, #F0F4FF, #C8D8FF 50%, #6488C8 80%, transparent 90%);
  box-shadow: 0 0 60px rgba(180,200,255,0.55), 0 0 130px rgba(120,140,220,0.3);
  filter: blur(0.3px);
}
body.tod-midnight .bg-mist { opacity: 0.55; filter: blur(24px) hue-rotate(180deg); }
body.tod-midnight .bg-torii { opacity: 0.18; filter: drop-shadow(0 0 8px rgba(80,100,180,0.4)); }

/* 季節バッジ（ヘッダ右） */
.season-badge {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 0.5em;
  color: var(--gold-pale);
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  margin-right: 10px;
  text-shadow: 0 0 8px rgba(212,175,55,0.4);
  white-space: nowrap;
}
.season-badge.sim-on {
  border-color: var(--vermilion-bright);
  color: var(--vermilion-bright);
  text-shadow: 0 0 10px rgba(232,65,73,0.5);
}

/* ====== Omikuji explainer (QR card) ====== */
.omikuji-explain {
  text-align: center;
}
.omikuji-card-wrap {
  margin: 4px auto 14px;
  max-width: 320px;
  position: relative;
}
.omikuji-card-wrap img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  filter:
    drop-shadow(0 12px 28px rgba(0,0,0,0.55))
    drop-shadow(0 0 24px rgba(212,175,55,0.18));
  user-select: none;
  -webkit-user-drag: none;
}
.omikuji-points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 22px auto 0;
  max-width: 380px;
  text-align: left;
}
.omikuji-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(31,20,60,0.55), rgba(17,8,38,0.55));
  border: 1px solid var(--gold-line);
  border-radius: var(--r-md);
}
.omikuji-point .num {
  font-family: "Cinzel", serif;
  font-size: 16px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  width: 26px;
  text-shadow: 0 0 10px var(--gold);
}
.omikuji-point .txt {
  font-size: 13.5px;
  color: #FFF6DC;
  line-height: 1.8;
  letter-spacing: 0.03em;
  font-weight: 500;
}
.omikuji-point .txt strong {
  color: var(--gold-bright);
  font-weight: 700;
}

/* ====== Customize features grid ====== */
.customize-lead {
  font-size: 14px;
  color: #FFF6DC;
  text-align: center;
  margin: 0 0 26px;
  letter-spacing: 0.04em;
  line-height: 2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  font-weight: 500;
}
.customize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
@media (max-width: 380px) {
  .customize-grid { grid-template-columns: 1fr; }
}
.customize-cell {
  background: linear-gradient(135deg, rgba(45,30,95,0.85), rgba(28,18,65,0.85));
  border: 1px solid var(--gold-line);
  border-radius: var(--r-md);
  padding: 18px 14px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.customize-cell::before {
  content: "";
  position: absolute;
  top: -30px; left: -30px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(212,175,55,0.18), transparent 70%);
  pointer-events: none;
}
.customize-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(212,175,55,0.4));
  margin-bottom: 8px;
}
.customize-cell-title {
  font-family: "Shippori Mincho", serif;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: #FFF1CE;
  margin-bottom: 8px;
  font-weight: 600;
}
.customize-cell-desc {
  font-size: 12.5px;
  color: #FFF6DC;
  line-height: 1.75;
  letter-spacing: 0.03em;
  opacity: 1;
}

/* ====== Demo simulator panel ====== */
.demo-control {
  margin-top: 8px;
  background:
    linear-gradient(180deg, rgba(31,20,60,0.5), rgba(17,8,38,0.5));
  border: 1px dashed var(--gold-line);
  border-radius: var(--r-lg);
  padding: 22px 20px 20px;
  position: relative;
}
.demo-control::before {
  content: "DEMO";
  position: absolute;
  top: -10px; left: 22px;
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 0.5em;
  color: var(--vermilion-bright);
  background: var(--ink);
  padding: 2px 10px;
  border: 1px solid var(--vermilion-bright);
  border-radius: 4px;
}
.demo-control-title {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  margin: 0 0 4px;
  text-shadow: 0 0 12px rgba(212,175,55,0.3);
}
.demo-control-note {
  font-size: 12px;
  color: #FFF6DC;
  margin: 0 0 16px;
  letter-spacing: 0.04em;
  line-height: 1.75;
  opacity: 0.92;
}
.demo-control-group {
  margin-bottom: 14px;
}
.demo-control-group:last-child { margin-bottom: 0; }
.demo-control-group .label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold-pale);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.demo-control-group .chip-grid .chip {
  font-size: 12px;
  padding: 7px 12px;
  letter-spacing: 0.06em;
}

/* 御簾風の薄い縦縞のテクスチャ */
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 6px,
      rgba(212,175,55,0.025) 6px,
      rgba(212,175,55,0.025) 7px
    );
  mix-blend-mode: screen;
  z-index: 0;
}

a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  color: inherit;
}
input, select {
  font-family: inherit;
  font-size: 16px;
}

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px 80px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ====== Header ====== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 26px;
  position: relative;
}
.site-brand {
  font-size: 13px;
  letter-spacing: 0.32em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-brand::before {
  content: "✦";
  font-size: 11px;
  color: var(--gold-bright);
  text-shadow: 0 0 10px var(--gold);
}
.site-brand:has(.brand-logo)::before { display: none; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--gold-line);
  background: rgba(17,8,38,0.6);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-pale);
  cursor: pointer;
  transition: var(--t-fast);
}
.lang-switch:hover { border-color: var(--gold); color: var(--gold-bright); box-shadow: var(--shadow-gold); }

/* ====== Hero ====== */
.hero {
  text-align: center;
  padding: 30px 0 18px;
  position: relative;
}
.hero-logo {
  margin: 12px auto 6px;
  max-width: 300px;
  width: 78%;
  position: relative;
  z-index: 1;
}
.hero-logo img {
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 4px 16px rgba(0,0,0,0.7))
    drop-shadow(0 0 28px rgba(212,175,55,0.25));
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 360px) {
  .hero-logo { max-width: 240px; }
}

/* ヘッダーの小ロゴ */
.brand-logo {
  height: 28px;
  width: 28px;
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.hero::before {
  /* ヒーロー周辺の柔らかいビネット（可読性確保しつつ明度を保つ） */
  content: "";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  height: calc(100% + 60px);
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(26,18,58,0.55) 0%, rgba(26,18,58,0.30) 60%, transparent 100%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.45em;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  padding: 6px 18px 5px;
  border-radius: 999px;
  margin-bottom: 24px;
  background: rgba(6,4,12,0.7);
  text-shadow: 0 0 12px rgba(246,226,160,0.5);
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.hero-title {
  font-family: "Shippori Mincho", serif;
  font-size: 42px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.14em;
  line-height: 1.18;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 2px 0 rgba(0,0,0,0.6))
    drop-shadow(0 4px 14px rgba(0,0,0,0.7))
    drop-shadow(0 0 24px rgba(212,175,55,0.35));
  position: relative;
  z-index: 1;
}
.hero-title-en {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--gold-pale);
  margin-top: 14px;
  text-transform: uppercase;
  opacity: 0.9;
}
.hero-lead {
  margin-top: 30px;
  font-size: 15px;
  color: #FFF6DC;
  line-height: 2.2;
  letter-spacing: 0.06em;
  opacity: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85), 0 0 4px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
  font-weight: 500;
}
.hero-tagline {
  margin-top: 26px;
  font-size: 13px;
  color: var(--gold-bright);
  letter-spacing: 0.28em;
  font-feature-settings: "palt";
  position: relative;
  display: inline-block;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85), 0 0 14px rgba(212,175,55,0.35);
  font-weight: 500;
}
.hero-tagline::before, .hero-tagline::after {
  content: "❖";
  margin: 0 14px;
  font-size: 8px;
  color: var(--gold);
  vertical-align: middle;
  text-shadow: 0 0 8px var(--gold);
}

/* ====== Section ====== */
.section { padding: 44px 0 8px; }
.section-title-wrap {
  text-align: center;
  margin-bottom: 28px;
}
.section-title {
  font-family: "Shippori Mincho", serif;
  font-size: 14px;
  letter-spacing: 0.42em;
  text-align: center;
  position: relative;
  display: inline-block;
  margin: 0 auto;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(212,175,55,0.4);
}
.section-title::before, .section-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 32px; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.section-title::before { left: -50px; }
.section-title::after  { right: -50px; }

/* ====== How list ====== */
.how-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: howcounter;
}
.how-list li {
  counter-increment: howcounter;
  background: linear-gradient(135deg, rgba(45,30,95,0.85) 0%, rgba(28,18,65,0.85) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-md);
  padding: 17px 18px 17px 60px;
  margin-bottom: 12px;
  position: relative;
  font-size: 14.5px;
  color: #FFF6DC;
  letter-spacing: 0.04em;
  line-height: 1.7;
  box-shadow: inset 0 1px 0 rgba(212,175,55,0.06);
  font-weight: 500;
}
.how-list li::before {
  content: counter(howcounter, decimal-leading-zero);
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 18px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px var(--gold);
}

/* ====== Figures grid ====== */
.figures-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 4px;
}
@media (min-width: 480px) {
  .figures-grid { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
}
.figure-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(212,175,55,0.10), transparent 70%),
    linear-gradient(180deg, rgba(61,42,117,0.80), rgba(26,18,58,0.85));
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
  padding: 26px 14px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.figure-card::before {
  /* 角の金箔装飾 */
  content: "";
  position: absolute;
  top: 8px; left: 8px;
  width: 22px; height: 22px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  border-top-left-radius: 6px;
  opacity: 0.7;
}
.figure-card::after {
  content: "";
  position: absolute;
  bottom: 8px; right: 8px;
  width: 22px; height: 22px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  border-bottom-right-radius: 6px;
  opacity: 0.7;
}
@media (hover: hover) {
  .figure-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow), var(--shadow-gold);
    border-color: var(--gold);
  }
}
.figure-card:active {
  transform: scale(0.985);
  border-color: var(--gold);
}
.figure-card .charm {
  width: 140px; height: 150px;
  margin: 0 auto 12px;
  position: relative;
}
.figure-card .charm-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  filter:
    drop-shadow(0 0 18px rgba(246,226,160,0.55))
    drop-shadow(0 6px 14px rgba(0,0,0,0.5));
  animation: yura 4.6s ease-in-out infinite;
  transform-origin: 50% 0%;
  z-index: 2;
}
.charm-emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
/* 画像が入る場合、紐・結び目・フレーム円は非表示（画像内にあるため） */
.charm:has(.charm-emoji img) .charm-string,
.charm:has(.charm-emoji img) .charm-knot,
.charm:has(.charm-emoji img) .charm-frame,
.charm-large:has(.charm-emoji img) .charm-string,
.charm-large:has(.charm-emoji img) .charm-knot,
.charm-large:has(.charm-emoji img) .charm-frame {
  display: none;
}
/* 画像版は font-size 0 で絵文字テキストの空白を消す */
.charm:has(.charm-emoji img) .charm-emoji,
.charm-large:has(.charm-emoji img) .charm-emoji {
  font-size: 0;
}
.figure-card .charm-frame {
  position: absolute;
  inset: 14px 18px 24px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 25%, rgba(246,226,160,0.25), transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(31,20,60,0.6), rgba(6,4,12,0.9));
  box-shadow:
    inset 0 0 24px rgba(212,175,55,0.25),
    0 0 30px rgba(212,175,55,0.12);
}
.figure-card .charm-halo {
  /* 後光（軽量化：放射グラデの静止光輪） */
  position: absolute;
  inset: 14px 18px 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(246,226,160,0.32) 0%, transparent 65%);
  opacity: 0.7;
}
.figure-card .charm-string {
  position: absolute;
  top: -2px; left: 50%;
  width: 2px; height: 20px;
  background: linear-gradient(to bottom, var(--gold-bright), var(--vermilion));
  transform: translateX(-50%);
  border-radius: 2px;
  z-index: 3;
}
.figure-card .charm-knot {
  position: absolute;
  top: 12px; left: 50%;
  width: 12px; height: 12px;
  background: radial-gradient(circle at 35% 35%, var(--vermilion-bright), var(--vermilion-deep));
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px var(--gold), 0 0 12px var(--vermilion);
  z-index: 3;
}
.figure-card .figure-name {
  font-size: 14px;
  letter-spacing: 0.18em;
  margin: 8px 0 4px;
  color: var(--gold-bright);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(212,175,55,0.35);
}
.figure-card .figure-theme {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  min-height: 32px;
  line-height: 1.6;
}
.figure-card .demo-btn {
  display: inline-block;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  padding: 6px 18px;
  border-radius: 999px;
  margin-top: 10px;
  transition: var(--t-fast);
  background: linear-gradient(180deg, rgba(212,175,55,0.0), rgba(212,175,55,0.12));
}
.figure-card:hover .demo-btn {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--ink);
  text-shadow: none;
  box-shadow: 0 0 18px rgba(212,175,55,0.6);
}

@keyframes yura {
  0%, 100% { transform: rotate(-3.5deg); }
  50%      { transform: rotate(3.5deg); }
}

/* ====== Demo lead / muted btn ====== */
.demo-lead {
  font-size: 13.5px;
  color: #FFF6DC;
  text-align: center;
  margin: 0 0 22px;
  letter-spacing: 0.05em;
  line-height: 1.95;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  opacity: 0.95;
}
.text-center { text-align: center; }
.muted-btn {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--gold-line);
  padding: 8px 4px;
  margin-top: 28px;
  transition: var(--t-fast);
  text-transform: uppercase;
}
.muted-btn:hover { color: var(--gold-bright); border-color: var(--gold); }

/* デモ履歴リセット：目立たせる朱色のボタン */
.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 11.5px;
  letter-spacing: 0.32em;
  color: var(--vermilion-bright);
  background: linear-gradient(135deg, rgba(232,65,73,0.18), rgba(200,22,29,0.10));
  border: 1.5px dashed var(--vermilion-bright);
  border-radius: 999px;
  padding: 13px 26px;
  margin-top: 28px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--t-fast);
  text-shadow: 0 0 10px rgba(232,65,73,0.35);
  box-shadow: 0 0 24px rgba(232,65,73,0.18);
}
.reset-btn::before {
  content: "↻";
  font-size: 17px;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgba(232,65,73,0.6);
}
@media (hover: hover) {
  .reset-btn:hover {
    background: var(--vermilion-bright);
    color: var(--ink);
    text-shadow: none;
    box-shadow: 0 0 30px rgba(232,65,73,0.6);
    border-style: solid;
  }
  .reset-btn:hover::before { text-shadow: none; }
}
.reset-btn:active { transform: scale(0.96); }

/* ====== Footer ====== */
.site-footer {
  margin-top: 56px;
  text-align: center;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold-pale);
  opacity: 0.85;
}

/* ====== Lang chooser overlay ====== */
.lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,4,12,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lang-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(212,175,55,0.12), transparent 70%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 40px 28px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow), var(--shadow-gold);
  position: relative;
}
.lang-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--gold-bright), transparent 50%, var(--gold));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}
.lang-card h2 {
  font-size: 14px;
  letter-spacing: 0.32em;
  margin: 0 0 6px;
  color: var(--gold-bright);
  text-shadow: 0 0 16px var(--gold);
}
.lang-card .sub {
  font-family: "Cinzel", serif;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.32em;
  margin-bottom: 26px;
  text-transform: uppercase;
}
.lang-list {
  display: grid;
  gap: 10px;
}
.lang-list button {
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(212,175,55,0.04), rgba(212,175,55,0.0));
  padding: 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--text);
  transition: var(--t-fast);
}
.lang-list button:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(212,175,55,0.25);
  background: linear-gradient(180deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
}

/* ====== Fortune flow ====== */
.flow { padding-top: 8px; }
.step-indicator {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  color: var(--gold-bright);
  text-align: center;
  margin: 0 0 20px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(212,175,55,0.5);
}
.step-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px;
  text-align: center;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(212,175,55,0.35);
}
.step-note {
  font-size: 13px;
  color: #FFF6DC;
  text-align: center;
  margin: 0 0 28px;
  letter-spacing: 0.05em;
  line-height: 1.95;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  opacity: 0.95;
}

.field { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--gold-pale);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.field-input {
  width: 100%;
  background: linear-gradient(180deg, rgba(61,42,117,0.55), rgba(42,29,85,0.55));
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-bright);
  outline: none;
  transition: var(--t-fast);
  letter-spacing: 0.06em;
}
.field-input::placeholder { color: var(--text-dim); }
.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18), 0 0 20px rgba(212,175,55,0.2);
}

/* デモ通知（朱色の点線パネル） */
.demo-notice {
  background: linear-gradient(135deg, rgba(232,65,73,0.18), rgba(200,22,29,0.10));
  border: 1px dashed var(--vermilion-bright);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--vermilion-bright);
  margin-bottom: 22px;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.7;
}
/* より目立つ強調版 */
.demo-notice-strong {
  margin: 8px auto 28px;
  padding: 16px 18px;
  font-size: 13.5px;
  background: linear-gradient(135deg, rgba(232,65,73,0.28), rgba(200,22,29,0.16));
  border: 1.5px dashed var(--vermilion-bright);
  box-shadow: 0 0 24px rgba(232,65,73,0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.demo-notice-tag {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.36em;
  color: var(--ink);
  background: var(--vermilion-bright);
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
  text-shadow: none;
}
.demo-notice-text {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--vermilion-bright);
  text-shadow: 0 0 10px rgba(232,65,73,0.35);
}
.demo-sample-hint {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold-pale);
  text-transform: uppercase;
  text-align: center;
  margin: 4px 0 10px;
  opacity: 0.85;
}
.demo-samples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}
.demo-sample {
  background: linear-gradient(180deg, rgba(212,175,55,0.10), rgba(212,175,55,0.04));
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Cinzel", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  cursor: pointer;
  transition: var(--t-fast);
}
@media (hover: hover) {
  .demo-sample:hover { border-color: var(--gold); background: rgba(212,175,55,0.18); }
}
.demo-sample:active { transform: scale(0.95); }

/* AI免責文言（結果画面の最下部） */
.ai-disclaimer {
  margin: 38px 14px 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  line-height: 1.8;
  opacity: 0.65;
  font-style: italic;
}

/* 個別ナンバー入力欄：カードと同じ見た目に */
.number-input {
  font-family: "Cinzel", "Cormorant Garamond", "Courier New", monospace;
  font-size: 22px;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  color: var(--gold-bright);
  padding: 18px 14px;
}
.number-input::placeholder {
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: none;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(61,42,117,0.45), rgba(42,29,85,0.45));
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: var(--t-fast);
  letter-spacing: 0.06em;
}
@media (hover: hover) {
  .chip:hover { border-color: var(--gold); color: var(--gold-bright); }
}
.chip:active { transform: scale(0.96); }
.chip.active {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-color: var(--gold-bright);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 0 18px rgba(212,175,55,0.5);
  text-shadow: none;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}
.btn {
  flex: 1;
  padding: 16px 18px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.32em;
  text-align: center;
  transition: var(--t);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(212,175,55,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
  text-shadow: none;
}
.btn-primary::before {
  /* 金箔のシマー */
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.6) 50%, transparent 70%);
  animation: shimmer 3.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { left: -75%; }
  60%  { left: 130%; }
  100% { left: 130%; }
}
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(212,175,55,0.5); }
}
.btn:active { transform: scale(0.97); }
.btn-secondary {
  background: linear-gradient(180deg, rgba(31,20,60,0.7), rgba(17,8,38,0.7));
  color: var(--gold-bright);
  border-color: var(--gold);
}
.btn-secondary:hover { background: rgba(31,20,60,0.9); box-shadow: 0 0 18px rgba(212,175,55,0.25); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--gold-bright); }

/* ====== Charm display large ====== */
.charm-large {
  width: 240px;
  height: 260px;
  margin: 18px auto 26px;
  position: relative;
}
.charm-large .charm-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  filter:
    drop-shadow(0 0 28px rgba(246,226,160,0.65))
    drop-shadow(0 12px 24px rgba(0,0,0,0.6));
  animation: yura 4.6s ease-in-out infinite;
  transform-origin: 50% 0%;
  z-index: 2;
}
.charm-large .charm-frame {
  position: absolute;
  inset: 22px 30px 38px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 25%, rgba(246,226,160,0.32), transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(31,20,60,0.7), rgba(6,4,12,0.95));
  box-shadow:
    inset 0 0 32px rgba(212,175,55,0.32),
    0 0 50px rgba(212,175,55,0.18);
}
.charm-large .charm-halo {
  position: absolute;
  inset: 22px 30px 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(246,226,160,0.4) 0%, transparent 65%);
  opacity: 0.8;
}
.charm-large .charm-string {
  position: absolute;
  top: -6px; left: 50%;
  width: 3px; height: 28px;
  background: linear-gradient(to bottom, var(--gold-bright), var(--vermilion));
  transform: translateX(-50%);
  border-radius: 3px;
  z-index: 3;
}
.charm-large .charm-knot {
  position: absolute;
  top: 16px; left: 50%;
  width: 18px; height: 18px;
  background: radial-gradient(circle at 35% 35%, var(--vermilion-bright), var(--vermilion-deep));
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold), 0 0 18px var(--vermilion);
  z-index: 3;
}

/* ====== Drawing ====== */
.drawing-wrap {
  text-align: center;
  padding: 60px 0;
  position: relative;
}
.drawing-circle {
  width: 110px; height: 110px;
  margin: 30px auto;
  position: relative;
}
.drawing-circle::before, .drawing-circle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
}
.drawing-circle::before {
  border-top-color: var(--gold-bright);
  border-right-color: var(--gold);
  animation: spin 2.4s linear infinite;
  filter: drop-shadow(0 0 12px var(--gold));
}
.drawing-circle::after {
  inset: 18px;
  border-bottom-color: var(--gold-bright);
  border-left-color: var(--gold-pale);
  animation: spinReverse 3.2s linear infinite;
  filter: drop-shadow(0 0 8px var(--gold));
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinReverse { to { transform: rotate(-360deg); } }

.drawing-text {
  font-size: 13px;
  color: var(--gold-pale);
  letter-spacing: 0.32em;
  text-shadow: 0 0 12px var(--gold);
  font-family: "Cinzel", "Shippori Mincho", serif;
}

/* ====== Result ====== */
.rank-display {
  text-align: center;
  margin-top: 20px;
  position: relative;
}
.rank-display::before, .rank-display::after {
  content: "❖";
  position: absolute;
  top: 50%;
  font-size: 12px;
  color: var(--gold);
  text-shadow: 0 0 12px var(--gold);
  opacity: 0.7;
}
.rank-display::before { left: 25%; }
.rank-display::after  { right: 25%; }
.rank-label {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.rank-value {
  font-family: "Shippori Mincho", serif;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.1;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(212,175,55,0.5));
}
.rank-divider {
  width: 48px; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 18px auto 0;
}

.result-title {
  font-family: "Shippori Mincho", serif;
  margin-top: 26px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  line-height: 1.6;
  padding: 0 8px;
  text-shadow: 0 0 24px rgba(212,175,55,0.3);
}
.result-summary {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.06em;
  line-height: 2.0;
  font-style: italic;
}

.result-card {
  background:
    linear-gradient(180deg, rgba(61,42,117,0.65), rgba(42,29,85,0.65));
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
  padding: 28px 22px;
  margin-top: 26px;
  box-shadow: var(--shadow);
  position: relative;
}
.result-card::before {
  /* 金箔の枠 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--gold) 0%, transparent 30%, transparent 70%, var(--gold-bright) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}
.result-main {
  font-size: 15px;
  line-height: 2.2;
  color: var(--text-bright);
  white-space: pre-line;
  letter-spacing: 0.06em;
  font-feature-settings: "palt";
}

.result-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gold-line);
  align-items: start;
}
.result-row:last-child { border-bottom: 0; }
.result-row .label {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--gold-bright);
  padding-top: 4px;
  text-shadow: 0 0 12px rgba(212,175,55,0.3);
}
.result-row .val {
  font-size: 14px;
  line-height: 1.95;
  color: var(--text);
  letter-spacing: 0.04em;
}

.lucky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 26px;
}
.lucky-cell {
  background:
    radial-gradient(circle at 50% 0%, rgba(212,175,55,0.12), transparent 70%),
    linear-gradient(180deg, rgba(31,20,60,0.7), rgba(6,4,12,0.7));
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 16px 8px 14px;
  text-align: center;
  position: relative;
}
.lucky-cell .lucky-label {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold-pale);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.lucky-cell .lucky-val {
  font-family: "Shippori Mincho", serif;
  font-size: 17px;
  color: var(--gold-bright);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(212,175,55,0.3);
}

.action-card {
  margin-top: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(212,175,55,0.18), transparent 60%),
    linear-gradient(135deg, var(--ink-3) 0%, var(--ink-2) 100%);
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  box-shadow: 0 0 30px rgba(212,175,55,0.15);
}
.action-label {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 0.5em;
  color: var(--gold-bright);
  margin-bottom: 8px;
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--gold);
}
.action-text {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-bright);
  letter-spacing: 0.04em;
}

.closing {
  margin: 32px 14px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--gold-pale);
  letter-spacing: 0.1em;
  line-height: 2.0;
  font-style: italic;
  position: relative;
}
.closing::before, .closing::after {
  content: "";
  display: block;
  width: 80px; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 14px auto;
}

.share-row {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

/* ====== Toast ====== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: var(--gold-bright);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.32em;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
  box-shadow: var(--shadow), var(--shadow-gold);
  border: 1px solid var(--gold);
}
.toast.show { opacity: 1; }

/* ====== Status (used / invalid) ====== */
.status-box {
  text-align: center;
  padding: 60px 20px;
}
.status-title {
  font-size: 18px;
  margin: 18px 0 10px;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(212,175,55,0.3);
}
.status-note {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  line-height: 1.95;
}

/* ====== Reveal animation ====== */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 1.0s var(--t) forwards;
}
.reveal-2 { animation-delay: 0.18s; }
.reveal-3 { animation-delay: 0.36s; }
.reveal-4 { animation-delay: 0.55s; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* mobile spacing */
@media (max-width: 360px) {
  .hero-title { font-size: 34px; }
  .charm-large { width: 200px; height: 220px; }
  .charm-large .charm-emoji { font-size: 100px; }
  .rank-value { font-size: 52px; }
}
