@charset "UTF-8";

/* =========================
   Theme: Goshuin-cho Omikuji
   ========================= */
:root{
  --washi-0:#f7f2e8;
  --washi-1:#efe7d9;

  --sumi:#2f2a24;            /* 墨 */
  --sumi-soft:#5a524a;

  --shuiro:#b11f2d;          /* 朱 */
  --shuiro-2:#d13a46;

  --lacquer-0:#0f0d0a;       /* 黒漆/表紙 */
  --lacquer-1:#1c1813;

  --gold-0:#fff1b8;
  --gold-1:#e3c46a;
  --gold-2:#c89a3a;
  --gold-ink:#3b2a10;

  --header-font:'Kiwi Maru', serif;
  --body-font:'Zen Maru Gothic', system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
              "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", sans-serif;

  --shadow: 0 22px 50px rgba(15,13,10,.20);
  --page-shadow: 0 16px 32px rgba(15,13,10,.18);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  padding:30px 18px 70px;
  min-height:100vh;
  color:var(--sumi);
  font-family:var(--body-font);
  overflow-x:hidden;

  /* 柔らかな和紙 + うっすら雲母 + 繊維 */
  background:
    radial-gradient(1200px 720px at 20% 0%, rgba(255,255,255,.90), rgba(255,255,255,0) 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 35% 35%, rgba(90,82,74,.06) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 65%, rgba(90,82,74,.05) 0 1px, transparent 2px),
    repeating-linear-gradient(120deg, rgba(90,82,74,.03) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, var(--washi-0), var(--washi-1));
  background-attachment: fixed;
}

.container{
  width:100%;
  max-width:560px;
  margin:54px auto 0;
  position:relative;
  padding:30px 18px 26px;
  text-align:center;

  /* “朱印帳の表紙”っぽい黒布 */
  background:
    radial-gradient(800px 420px at 30% 0%, rgba(255,255,255,.10), rgba(255,255,255,0) 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, rgba(255,255,255,0) 1px 7px),
    linear-gradient(135deg, rgba(15,13,10,.96), rgba(28,24,19,.92));
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(200,154,58,.22);
  overflow: hidden;
}

/* 表紙の縁（金） */
.container::before{
  content:"";
  position:absolute;
  inset:10px;
  border-radius: 18px;
  border: 1px solid rgba(247,239,183,.35);
  box-shadow: 0 0 0 1px rgba(200,154,58,.12) inset;
  pointer-events:none;
}

/* 角の“朱印”飾り */
.container::after{
  content:"奉拝";
  position:absolute;
  top:14px;
  right:14px;
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  font-family: var(--header-font);
  letter-spacing:.18em;
  color: rgba(255,255,255,.88);
  background: linear-gradient(135deg, rgba(177,31,45,.92), rgba(177,31,45,.62));
  border-radius: 18px;
  transform: rotate(10deg);
  box-shadow: 0 14px 28px rgba(177,31,45,.18);
  opacity:.55;
  pointer-events:none;
}

/* =========================
   Title (Gold foil label)
   ========================= */
h1{
  margin:0 0 18px;
  display:inline-block;
  padding:12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(200,154,58,.38);
  box-shadow:
    0 10px 22px rgba(0,0,0,.22),
    0 1px 0 rgba(255,255,255,.10) inset;
  background:
    radial-gradient(260px 120px at 30% 10%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(12,10,8,.86), rgba(18,15,12,.92));
}

h1{
  font-family:var(--header-font);
  font-weight:700;
  letter-spacing:.08em;
  font-size:2.2rem;
  color: transparent;
  background-image: linear-gradient(135deg, var(--gold-2), var(--gold-0) 45%, var(--gold-1));
  -webkit-background-clip:text;
  background-clip:text;
  text-shadow: 0 0 18px rgba(247,239,183,.10);
}

h1::after{
  content:"⛩";
  margin-left:10px;
  font-size:1.1rem;
  color: rgba(247,239,183,.70);
  text-shadow: 0 0 18px rgba(247,239,183,.18);
}

/* =========================
   Button (Gold + Shrine glow)
   ========================= */
#draw-button{
  font-family:var(--body-font);
  font-weight:700;
  font-size:1.10rem;
  letter-spacing:.06em;
  cursor:pointer;
  border:none;
  border-radius: 14px;
  padding:14px 34px;
  color: var(--gold-ink);
  background: linear-gradient(135deg, var(--gold-2), var(--gold-0) 45%, var(--gold-1));
  box-shadow:
    0 14px 30px rgba(200,154,58,.22),
    0 2px 0 rgba(255,255,255,.60) inset,
    0 -6px 18px rgba(59,42,16,.12) inset;
  position:relative;
  overflow:hidden;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
  margin: 8px 0 22px;
}

#draw-button::before{
  /* 光の筋（御神灯っぽい） */
  content:"";
  position:absolute;
  top:-40%;
  left:-70%;
  width:60%;
  height:180%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.70), transparent);
  opacity:0;
  transition: opacity .25s ease;
}

#draw-button:hover{
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow:
    0 18px 40px rgba(200,154,58,.30),
    0 0 26px rgba(247,239,183,.30),
    0 2px 0 rgba(255,255,255,.68) inset,
    0 -6px 18px rgba(59,42,16,.12) inset;
}

#draw-button:hover::before{
  opacity:1;
  animation: sheen 1.05s ease-out forwards;
}

@keyframes sheen{
  0%{ left:-70%; }
  100%{ left:150%; }
}

#draw-button:disabled{
  cursor:not-allowed;
  opacity:.65;
  filter: grayscale(.25);
}

/* =========================
   Result (Goshuin page)
   ========================= */
#result{
  width:100%;
  opacity:0;
  transform: translateY(12px);
  visibility:hidden;
}

#result.visible{
  visibility:visible;
  animation: resultIn .6s ease-out forwards;
}

@keyframes resultIn{
  from{ opacity:0; transform: translateY(12px); }
  to  { opacity:1; transform: translateY(0); }
}

/* “開いた朱印帳のページ” */
.scroll-content-wrapper{
  position:relative;
  margin-top: 10px;
  border-radius: 18px;
  box-shadow: var(--page-shadow);
  overflow:hidden;

  /* 和紙ページ */
  background:
    radial-gradient(900px 420px at 25% 0%, rgba(255,255,255,.75), transparent 60%),
    repeating-linear-gradient(90deg, rgba(90,82,74,.03) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.52));
  border: 1px solid rgba(120,105,88,.18);
}

/* 左の“綴じ”（朱布） */
.scroll-content-wrapper::before{
  content:"";
  position:absolute;
  top:0; left:0;
  width:18px;
  height:100%;
  background:
    radial-gradient(70px 260px at 50% 10%, rgba(255,255,255,.12), transparent 60%),
    linear-gradient(180deg, rgba(177,31,45,.95), rgba(140,16,28,.90));
  box-shadow:
    1px 0 0 rgba(255,255,255,.18) inset,
    -1px 0 0 rgba(0,0,0,.10) inset;
}

/* 金の細線（綴じの縁） */
.scroll-content-wrapper::after{
  content:"";
  position:absolute;
  top:0; left:18px;
  width:2px;
  height:100%;
  background: linear-gradient(180deg, rgba(247,239,183,.65), rgba(200,154,58,.35));
  opacity:.75;
}

/* スタンプ（朱印） */
.scroll-content{
  position:relative;
  padding: 22px 18px 22px 26px; /* 左綴じ分 */
  text-align:left;
}

.scroll-content::after{
  content:"御朱印";
  position:absolute;
  right:14px;
  bottom:14px;
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  font-family: var(--header-font);
  letter-spacing:.12em;
  color: rgba(255,255,255,.88);
  background: linear-gradient(135deg, rgba(177,31,45,.92), rgba(177,31,45,.58));
  border-radius: 18px;
  transform: rotate(-10deg) scale(.94);
  box-shadow: 0 14px 26px rgba(177,31,45,.18);
  opacity:0;
}

/* 結果表示時にスタンプが“ポン” */
#result.visible .scroll-content::after{
  animation: stampPop .55s ease-out .18s forwards;
}

@keyframes stampPop{
  from{ opacity:0; transform: rotate(-12deg) scale(.70); }
  to  { opacity:.45; transform: rotate(-10deg) scale(.94); }
}

.fortune-level{
  font-family:var(--header-font);
  font-size: 3.1rem;
  font-weight: 800;
  color: var(--shuiro);
  text-align:center;
  margin: 4px 0 14px;
  letter-spacing:.10em;
  opacity:0;
  transform: translateY(6px);
}

#result.visible .fortune-level{
  animation: fadeUp .55s ease-out .08s forwards;
}

.details-list{
  list-style:none;
  padding:0;
  margin:0;
  font-size:1.05rem;
  line-height:1.75;
  color: var(--sumi-soft);
  opacity:0;
  transform: translateY(10px);
}

#result.visible .details-list{
  animation: fadeUp .6s ease-out .16s forwards;
}

@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to  { opacity:1; transform: translateY(0); }
}

.details-list li{
  padding: 12px 0;
  border-bottom: 1px dashed rgba(90,82,74,.22);
}

.details-list li:last-child{
  border-bottom:none;
  padding-bottom: 2px;
}

.details-list li span{
  font-weight:700;
  color: var(--sumi);
  display:inline-block;
  width: 5.6em;
}
/* =========================================================
   Meditative / Cinematic Omikuji Overlay (ADD AT END)
   - Phase1 (0-8s): breathing light + subtle float
   - Phase2 (after 8s): glow burst + stick rise + paper unfurl
   ========================================================= */

:root{
  --zen-trigger: 3s; /* 8秒トリガー */
}

/* --- Overlay base --- */
#animation-container{
  position:fixed;
  inset:0;
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:100;

  /* 深い紺〜紫＋柔らかい光（派手すぎない） */
  background:
    radial-gradient(1200px 800px at 35% 18%, rgba(170,140,255,.10), transparent 60%),
    radial-gradient(900px 700px at 70% 55%, rgba(190,225,255,.08), transparent 58%),
    radial-gradient(700px 600px at 50% 80%, rgba(200,154,58,.07), transparent 55%),
    linear-gradient(180deg, #050716, #070b22 55%, #040513);

  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition: opacity .55s ease, visibility 0s linear .55s;
  backdrop-filter: blur(10px) saturate(1.15);
  isolation:isolate;
}

#animation-container.visible{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition: opacity .55s ease;

  /* 背景も呼吸 */
  animation: zenBgBreathe 9.5s ease-in-out infinite;
}

/* 中央の“光の核”（呼吸する小さな光） */
#animation-container::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width: 120px;
  height: 120px;
  border-radius:999px;
  transform: translate(-50%, -50%) translateY(-120px) scale(.78);
  opacity:.85;
  z-index:0;

  background:
    radial-gradient(circle at 50% 50%,
      rgba(190,225,255,.34) 0%,
      rgba(190,225,255,.14) 26%,
      rgba(200,154,58,.10) 44%,
      transparent 72%);
  mix-blend-mode: screen;
  animation: zenOrbBreath 5.8s ease-in-out infinite;
}

/* 微細な光粒（漂う） */
#animation-container::after{
  content:"";
  position:absolute;
  inset:-10%;
  z-index:1;
  pointer-events:none;

  background:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.12) 0 1px, transparent 2px),
    radial-gradient(circle at 28% 76%, rgba(190,225,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 66% 34%, rgba(200,154,58,.09) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 70%, rgba(255,255,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 46% 52%, rgba(170,140,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 54% 18%, rgba(255,255,255,.08) 0 1px, transparent 2px);

  opacity:.55;
  filter: blur(.2px);
  animation: zenDustDrift 14s ease-in-out infinite;
}

/* --- Phase2（8秒後）：光が覚醒してフォーカス --- */
#animation-container.phase2::before{
  animation:
    zenOrbBurst 1.9s cubic-bezier(.16,.84,.22,1.08) forwards,
    zenOrbAfter 9s ease-in-out 1.9s infinite;
}

#animation-container.phase2::after{
  opacity:.26; /* 紙が出た後は邪魔しない */
  animation: zenDustDriftSlow 20s ease-in-out infinite;
}

/* =========================================================
   Box / Stick（構造はそのまま、演出のみ）
   ========================================================= */

/* 箱：激しい揺れは廃止 → “静かな浮遊” */
#omikuji-box{
  position:relative;
  z-index:3;
  transform-origin: 50% 80%;
  will-change: transform, filter, opacity;
}

/* 口（スリット）：棒の根元が入ってる感（既にあっても上書きOK） */
#omikuji-box::before{
  content:"";
  position:absolute;
  top:10px;
  left:50%;
  transform:translateX(-50%);
  width:76px;
  height:14px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,.16));
  box-shadow: inset 0 2px 4px rgba(255,255,255,.12);
  opacity:.72;
  z-index:6;
}

/* Phase1：箱はほのかに浮く */
.shaking{
  animation: zenBoxFloat 6.6s ease-in-out infinite;
  filter:
    drop-shadow(0 18px 34px rgba(0,0,0,.32))
    drop-shadow(0 0 18px rgba(190,225,255,.10));
  opacity:.98;
}

/* 棒：初期は箱の中に沈めて隠す（重要） */
#omikuji-stick{
  position:absolute;
  left:50%;
  bottom:14px;
  transform: translateX(-50%) translateY(180px);
  opacity:0;
  z-index:3;
  will-change: transform, opacity, filter;
}

/* おみくじの紙（DOM追加なし：棒から出す） */
#omikuji-stick::before{
  content:"御神籤";
  position:absolute;
  left:50%;
  top:-14px;
  width: 56px;
  height: 190px;
  border-radius: 14px;

  writing-mode: vertical-rl;
  text-align:center;
  font-family: var(--header-font, 'Kiwi Maru', serif);
  letter-spacing:.22em;
  font-weight:700;
  font-size:16px;
  color: rgba(25,23,20,.78);

  background:
    radial-gradient(220px 120px at 35% 15%, rgba(255,255,255,.75), rgba(255,255,255,0) 60%),
    repeating-linear-gradient(90deg, rgba(90,82,74,.04) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(232,223,205,.92));
  border: 1px solid rgba(200,154,58,.22);
  box-shadow:
    0 20px 44px rgba(0,0,0,.22),
    0 0 26px rgba(190,225,255,.10);

  transform: translateX(-50%) scaleY(.03);
  transform-origin: 50% 0%;
  opacity:0;
  filter: blur(10px);
}

/* Phase2：箱がフォーカス → 棒が引き上がり → 紙がスッと伸びる */
.tilting{
  animation:
    zenBoxFocus 2.2s cubic-bezier(.18,.86,.22,1.02) forwards,
    zenBoxAfter 10s ease-in-out 2.2s infinite;
}

.tilting #omikuji-stick{
  opacity:1;
  animation: zenStickRise 1.85s cubic-bezier(.16,.84,.22,1.08) .08s forwards;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.30));
}

.tilting #omikuji-stick::before{
  animation: zenPaperUnfurl 1.55s cubic-bezier(.16,.86,.22,1.06) .38s forwards;
}

/* =========================================================
   Keyframes
   ========================================================= */
@keyframes zenBgBreathe{
  0%   { filter: brightness(.98) saturate(1.04); }
  50%  { filter: brightness(1.05) saturate(1.10); }
  100% { filter: brightness(.98) saturate(1.04); }
}

@keyframes zenOrbBreath{
  0%   { transform: translate(-50%, -50%) translateY(-120px) scale(.76); opacity:.75; }
  50%  { transform: translate(-50%, -50%) translateY(-125px) scale(.92); opacity:.95; }
  100% { transform: translate(-50%, -50%) translateY(-120px) scale(.76); opacity:.75; }
}

@keyframes zenOrbBurst{
  0%   { transform: translate(-50%, -50%) translateY(-120px) scale(.82); opacity:.85; }
  35%  { transform: translate(-50%, -50%) translateY(-120px) scale(1.55); opacity:1; }
  70%  { transform: translate(-50%, -50%) translateY(-120px) scale(3.60); opacity:.55; }
  100% { transform: translate(-50%, -50%) translateY(-120px) scale(2.20); opacity:.35; }
}

@keyframes zenOrbAfter{
  0%   { transform: translate(-50%, -50%) translateY(-120px) scale(2.20); opacity:.34; }
  50%  { transform: translate(-50%, -50%) translateY(-120px) scale(2.32); opacity:.42; }
  100% { transform: translate(-50%, -50%) translateY(-120px) scale(2.20); opacity:.34; }
}

@keyframes zenDustDrift{
  0%   { transform: translate3d(-1.0%, -0.5%, 0) scale(1.02); }
  50%  { transform: translate3d( 1.2%,  0.8%, 0) scale(1.04); }
  100% { transform: translate3d(-1.0%, -0.5%, 0) scale(1.02); }
}
@keyframes zenDustDriftSlow{
  0%   { transform: translate3d(-0.6%, -0.3%, 0) scale(1.01); }
  50%  { transform: translate3d( 0.7%,  0.4%, 0) scale(1.02); }
  100% { transform: translate3d(-0.6%, -0.3%, 0) scale(1.01); }
}

@keyframes zenBoxFloat{
  0%   { transform: translateY(0px) scale(1); opacity:.98; }
  50%  { transform: translateY(-6px) scale(1.01); opacity:1; }
  100% { transform: translateY(0px) scale(1); opacity:.98; }
}

@keyframes zenBoxFocus{
  0%   { transform: translateY(0px) scale(1); filter: drop-shadow(0 18px 34px rgba(0,0,0,.32)); }
  55%  { transform: translateY(-10px) scale(1.06); filter: drop-shadow(0 26px 58px rgba(0,0,0,.40)) drop-shadow(0 0 26px rgba(190,225,255,.16)); }
  100% { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 22px 46px rgba(0,0,0,.36)) drop-shadow(0 0 18px rgba(190,225,255,.12)); }
}
@keyframes zenBoxAfter{
  0%   { transform: translateY(-8px) scale(1.04); }
  50%  { transform: translateY(-10px) scale(1.045); }
  100% { transform: translateY(-8px) scale(1.04); }
}

@keyframes zenStickRise{
  0%   { opacity:0; transform: translateX(-50%) translateY(180px); }
  35%  { opacity:1; transform: translateX(-50%) translateY(70px); }
  72%  { opacity:1; transform: translateX(-50%) translateY(-60px); }
  88%  { opacity:1; transform: translateX(-50%) translateY(-46px); }
  100% { opacity:1; transform: translateX(-50%) translateY(-52px); }
}

/* 出現アニメ中の基準位置を “上げた位置” に合わせる */
@keyframes zenPaperUnfurl{
  0%   { opacity:0; transform: translateX(-50%) translateY(0px) scaleY(.03); filter: blur(10px); }
  45%  { opacity:1; transform: translateX(-50%) translateY(0px) scaleY(.85); filter: blur(3px); }
  100% { opacity:1; transform: translateX(-50%) translateY(0px) scaleY(1);   filter: blur(0px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  #animation-container, #animation-container.visible{ animation:none !important; }
  #animation-container::before, #animation-container::after{ animation:none !important; }
  .shaking, .tilting, .tilting #omikuji-stick, .tilting #omikuji-stick::before{ animation:none !important; }
  #omikuji-stick{ opacity:1; transform: translateX(-50%) translateY(-52px); }
  #omikuji-stick::before{ opacity:1; transform: translateX(-50%) scaleY(1); filter:none; }
}
/* おみくじ文字を大きく（箱の中の縦文字） */
.fortune-char{
  font-size: 38px;      /* ←ここを好みで 32〜48px くらいで調整 */
  line-height: 1;
  letter-spacing: .18em;
  font-weight: 800;

  /* 既に縦書きを使っているなら不要ですが、念のため */
  writing-mode: vertical-rl;
  text-align: center;

  /* 箱内で見切れにくく */
  display: inline-block;
  transform: translateY(2px);
}

/* =========================
   PATCH: 明るさUP + orbと文字が重ならない配置
   （style.css末尾に追記）
   ========================= */

/* orb（光）を上へ、箱を下へずらすための基準値 */
:root{
  --zen-orb-y: -230px; /* 光の核：上方向（数値大きいほど上へ） */
  --zen-box-y: -110px;  /* 箱全体：下方向（数値大きいほど下へ） */
}

/* 背景を少し明るく（濃紺は維持しつつ、沈み過ぎを防ぐ） */
#animation-container{
  background:
    radial-gradient(1200px 820px at 35% 18%, rgba(170,140,255,.16), transparent 62%),
    radial-gradient(900px 720px at 70% 55%, rgba(190,225,255,.13), transparent 60%),
    radial-gradient(760px 640px at 50% 80%, rgba(200,154,58,.10), transparent 58%),
    linear-gradient(180deg, #071033, #0a1642 55%, #05071c);
}

/* visible時に全体をほんのり明るく（やり過ぎない） */
#animation-container.visible{
  filter: brightness(1.18) saturate(1.08);
}

/* 光の核：位置を上げる（重なり回避） */
#animation-container::before{
  transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(.80);
}

/* orb系のkeyframesを“上げた位置”に合わせて上書き */
@keyframes zenOrbBreath{
  0%   { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(.76); opacity:.78; }
  50%  { transform: translate(-50%, -50%) translateY(calc(var(--zen-orb-y) - 6px)) scale(.92); opacity:.98; }
  100% { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(.76); opacity:.78; }
}

@keyframes zenOrbBurst{
  0%   { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(.82); opacity:.88; }
  35%  { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(1.55); opacity:1; }
  70%  { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(3.60); opacity:.58; }
  100% { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(2.20); opacity:.38; }
}

@keyframes zenOrbAfter{
  0%   { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(2.20); opacity:.36; }
  50%  { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(2.32); opacity:.44; }
  100% { transform: translate(-50%, -50%) translateY(var(--zen-orb-y)) scale(2.20); opacity:.36; }
}

/* 箱（と中の文字）を下げて、orbと距離を取る */
@keyframes zenBoxFloat{
  0%   { transform: translateY(var(--zen-box-y)) scale(1); opacity:.98; }
  50%  { transform: translateY(calc(var(--zen-box-y) - 6px)) scale(1.01); opacity:1; }
  100% { transform: translateY(var(--zen-box-y)) scale(1); opacity:.98; }
}

@keyframes zenBoxFocus{
  0%   { transform: translateY(var(--zen-box-y)) scale(1); }
  55%  { transform: translateY(calc(var(--zen-box-y) - 10px)) scale(1.06); }
  100% { transform: translateY(calc(var(--zen-box-y) - 8px)) scale(1.04); }
}

@keyframes zenBoxAfter{
  0%   { transform: translateY(calc(var(--zen-box-y) - 8px)) scale(1.04); }
  50%  { transform: translateY(calc(var(--zen-box-y) - 10px)) scale(1.045); }
  100% { transform: translateY(calc(var(--zen-box-y) - 8px)) scale(1.04); }
}

/* 念のため：文字が光の上に乗って見える場合の視認性 */
.fortune-char{
  position: relative;
  z-index: 4;
  text-shadow:
    0 2px 10px rgba(0,0,0,.35),
    0 0 18px rgba(190,225,255,.14);
}

/* =========================
   PATCH: おみくじ文字を見やすく（濃い金＋縁取り＋発光）
   ========================= */
.fortune-char{
  /* 濃い金〜明るい金のグラデで“金箔感”＋読みやすさ */
  color: transparent;
  background-image: linear-gradient(180deg,
    rgba(255,246,210,.98),
    rgba(227,196,106,.98) 55%,
    rgba(200,154,58,.98)
  );
  -webkit-background-clip: text;
  background-clip: text;

  /* 文字の輪郭を出す（背景が暗くても負けない） */
  -webkit-text-stroke: 1px rgba(20,16,10,.55);

  /* 立体感＋ほんのり発光（派手すぎない） */
  text-shadow:
    0 2px 10px rgba(0,0,0,.55),
    0 0 18px rgba(255,246,210,.20),
    0 0 26px rgba(200,154,58,.18);

  opacity: 1; /* 念のため */
}

/* =========================
   PATCH: 紙（御神籤）を上に重ねる
   ========================= */
:root{
  --paper-y: -88px; /* ←マイナスを大きくすると上へ（例: -48px / -60px） */
}

#omikuji-stick::before{
  /* 既存の top:-14px を上書き */
  top: var(--paper-y);
}

/* =========================
   PATCH: 紙を少し大きく + 「御神籤」と「おみくじ」が重ならない
   ========================= */
:root{
  /* 紙（御神籤）のサイズ */
  --paper-w: 56px;     /* 56 → 64 */
  --paper-h: 190px;    /* 190 → 230 */

  /* 紙の出現位置：上に出し過ぎると「おみくじ」と重なるので少し“下げる” */
  --paper-y: -44px;    /* 例：-44（上に出す）→ -26（少し下げる） */

  /* 「おみくじ」文字の位置微調整（必要な場合だけ） */
  --fortune-char-y:  170px; /* 以前 28px などなら、少し上げて重なり回避 */
}

/* 紙（御神籤） */
#omikuji-stick::before{
  width: var(--paper-w);
  height: var(--paper-h);
  top: var(--paper-y);
  border-radius: 16px;       /* 少し大きくした分、角も上品に */
  font-size: 16px;           /* 文字が小さく感じるなら 17〜18 に */
}

/* 「おみくじ」文字（上下だけ変える） */
.fortune-char{
  transform: translate(-50%, -50%) translateY(var(--fortune-char-y));
}

:root{
  --fortune-char-x: 10px; /* ←右に寄せたい量（例: 6〜18px） */
}

/* 既に absolute + transform で位置決めしている前提 */
.fortune-char{
  transform: translate(-50%, -50%)
            translateX(var(--fortune-char-x))
            translateY(var(--fortune-char-y, 0px));
}
/* 新しいボタンスタイル (index.html から移植) */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #eaf0ff; /* var(--text) を直接値に置換 */
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  will-change: transform;
  font-weight:700;
  position:relative;
  overflow:hidden;
  text-decoration: none; /* aタグのデフォルト下線を消す */
}
.btn::before{
  content:"";
  position:absolute; inset:-2px;
  /* var(--mx), var(--my) は omikuji/style.css にはないので、グラデーションを固定値に */
  background: radial-gradient(240px 140px at 50% 50%,
    rgba(80,200,255,.25), rgba(168,85,247,.20), transparent 60%);
  opacity:0;
  transition: opacity .15s ease;
  pointer-events:none;
}
.btn:hover::before{opacity:1;}
.btn:hover{
  /* transform: translateY(-2px); */
  background: rgba(255,255,255,.10);
  box-shadow: 0 22px 70px rgba(0,0,0,.38);
}
.btn.primary{
  /* var(--a1) は omikuji/style.css にはないので、直接値に置換 */
  border-color: rgba(80,200,255,.38);
  background: linear-gradient(135deg, rgba(80,200,255,.22), rgba(168,85,247,.18));
}
.btn .mini{opacity:.8; font-weight:400; margin-left:8px; font-size:12px;}
