:root{
  --accent: #d13b2c; /* 朱色 */
  --ink: #2b2b2b;    /* 墨色 */
  --paper: #fcfaf5;  /* 生成り */
  --gold: #BF953F;
  --muted: rgba(43, 43, 43, 0.72);
  --panel: rgba(255, 255, 255, 0.85);
  --panel-weak: rgba(255, 255, 255, 0.72);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.08);
  --bg-image-mobile: none;
  --bg-image-pc: none;
  --body-overlay: radial-gradient(1200px 800px at 50% 10%, rgba(252,250,245,0.70) 0%, rgba(252,250,245,0.28) 55%, rgba(252,250,245,0.35) 100%);
}

*{ box-sizing: border-box; }
html, body{ height:100%; }

body{
  margin:0;
  min-height: 100svh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--bg-image-mobile);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: "Zen Old Mincho", ui-serif, Georgia, "Times New Roman", serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 769px){
  body{
    background-image: var(--bg-image-pc);
  }
}

body.theme-a{
  --bg-image-mobile: none;
  --bg-image-pc: none;
  --body-overlay: radial-gradient(1200px 800px at 50% 10%, rgba(252,250,245,0.70) 0%, rgba(252,250,245,0.28) 55%, rgba(252,250,245,0.35) 100%);
}
body.theme-b{
  --bg-image-mobile: radial-gradient(1200px 900px at 50% 0%, rgba(235,230,255,0.62) 0%, rgba(247,244,255,0.86) 38%, rgba(255,255,255,0.94) 100%);
  --bg-image-pc: radial-gradient(1400px 900px at 50% 0%, rgba(235,230,255,0.62) 0%, rgba(247,244,255,0.86) 38%, rgba(255,255,255,0.94) 100%);
  --body-overlay: radial-gradient(1200px 800px at 50% 8%, rgba(255,255,255,0.50) 0%, rgba(255,255,255,0.12) 55%, rgba(255,255,255,0.20) 100%);
}
body.theme-c{
  --bg-image-mobile: linear-gradient(160deg, rgba(255,255,255,0.95) 0%, rgba(241,235,255,0.85) 58%, rgba(229,244,255,0.82) 100%);
  --bg-image-pc: linear-gradient(160deg, rgba(255,255,255,0.95) 0%, rgba(241,235,255,0.85) 58%, rgba(229,244,255,0.82) 100%);
  --body-overlay: radial-gradient(1200px 800px at 50% 14%, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.08) 58%, rgba(255,255,255,0.20) 100%);
}
body.theme-d{
  --bg-image-mobile: radial-gradient(1400px 1000px at 50% 45%, rgba(255,255,255,0.96) 0%, rgba(247,247,255,0.94) 60%, rgba(236,228,255,0.80) 100%);
  --bg-image-pc: radial-gradient(1400px 1000px at 50% 45%, rgba(255,255,255,0.96) 0%, rgba(247,247,255,0.94) 60%, rgba(236,228,255,0.80) 100%);
  --body-overlay: radial-gradient(1200px 800px at 50% 10%, rgba(255,255,255,0.36) 0%, rgba(255,255,255,0.12) 55%, rgba(255,255,255,0.22) 100%);
}
body.theme-e{
  --bg-image-mobile:
    radial-gradient(1200px 920px at 14% 10%, rgba(198,168,235,0.28) 0%, rgba(198,168,235,0.06) 48%, transparent 72%),
    radial-gradient(1100px 900px at 86% 90%, rgba(183,205,255,0.24) 0%, rgba(183,205,255,0.05) 50%, transparent 72%),
    linear-gradient(170deg, rgba(252,250,255,0.98) 0%, rgba(246,240,255,0.96) 46%, rgba(240,247,255,0.94) 100%);
  --bg-image-pc:
    radial-gradient(1200px 920px at 14% 10%, rgba(198,168,235,0.28) 0%, rgba(198,168,235,0.06) 48%, transparent 72%),
    radial-gradient(1100px 900px at 86% 90%, rgba(183,205,255,0.24) 0%, rgba(183,205,255,0.05) 50%, transparent 72%),
    linear-gradient(170deg, rgba(252,250,255,0.98) 0%, rgba(246,240,255,0.96) 46%, rgba(240,247,255,0.94) 100%);
  --body-overlay: radial-gradient(1200px 800px at 50% 18%, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0.08) 55%, rgba(255,255,255,0.18) 100%);
}
body.theme-e input,
body.theme-e textarea{
  border: none;
  border-radius: 0;
  clip-path: polygon(
    12px 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    12px 100%,
    0 calc(100% - 12px),
    0 12px
  );
  background:
    linear-gradient(154deg, rgba(255,255,255,0.98) 0%, rgba(246,240,255,0.94) 35%, rgba(235,244,255,0.90) 100%),
    linear-gradient(26deg, rgba(200,172,240,0.34) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(328deg, rgba(176,219,255,0.26) 0%, rgba(255,255,255,0) 58%);
  background-blend-mode: screen, normal, normal;
  box-shadow:
    inset 0 0 0 1px rgba(164, 138, 214, 0.72),
    inset 0 1px 0 rgba(255,255,255,0.96),
    inset 1px 0 0 rgba(255,255,255,0.72),
    inset -1px 0 0 rgba(168, 188, 236, 0.30),
    inset 0 -1px 0 rgba(169, 138, 214, 0.20),
    0 12px 24px rgba(98, 82, 146, 0.14);
}
body.theme-e input:focus,
body.theme-e textarea:focus{
  box-shadow:
    0 0 0 3px rgba(163, 134, 223, 0.24),
    inset 0 0 0 1px rgba(144, 112, 202, 0.84),
    inset 0 1px 0 rgba(255,255,255,0.98),
    inset 1px 0 0 rgba(255,255,255,0.76),
    inset -1px 0 0 rgba(168, 188, 236, 0.36),
    inset 0 -1px 0 rgba(169, 138, 214, 0.24),
    0 14px 30px rgba(98, 82, 146, 0.16);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  background: var(--body-overlay);
  z-index: 0;
  pointer-events: none;
}

.design-switcher{
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(43,43,43,0.20);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}
.design-switcher label{
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(43,43,43,0.75);
}
.design-switcher select{
  border: 1px solid rgba(43,43,43,0.25);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  background: rgba(255,255,255,0.95);
  color: var(--ink);
}

.page{
  position: relative;
  z-index: 2;
  padding: 44px 18px 64px;
}

.container{
  max-width: 520px;
  margin: 0 auto;
}

#state-form{
  text-align: center;
}

.kicker{
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(43,43,43,0.55);
}

h1{
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

h2{
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.lead{
  margin: 0 auto 18px;
  max-width: 28em;
  color: var(--muted);
  font-size: 14px;
}

.card{
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.form{
  max-width: 420px;
  margin: 0 auto;
}

label{
  display:block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 18px 0 10px;
  text-align: center;
}
.label-sub{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(43,43,43,0.60);
}

input,
select{
  width: 100%;
  height: 56px;
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
}
input[type="date"]{
  text-align: center;
}
#email{
  text-align: center;
}
input:focus,
select:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(209, 59, 44, 0.18), 0 10px 26px rgba(0,0,0,0.06);
}

textarea{
  width: 100%;
  border: 1px solid rgba(209, 59, 44, 0.55);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
  resize: vertical;
  min-height: 92px;
  font-family: inherit;
  line-height: 1.7;
}
textarea:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(209, 59, 44, 0.18), 0 10px 26px rgba(0,0,0,0.06);
}

.form-hint{
  margin: 8px 0 0;
  color: rgba(43,43,43,0.62);
  font-size: 12px;
  text-align: center;
}

.wish-free-wrap{
  display: none;
}
.wish-free-wrap.is-visible{
  display: block;
}

button{
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#submit-button{
  width: min(340px, 86vw);
  aspect-ratio: 1024 / 550;
  height: auto;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: transparent;
  background-image: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  color: #111;
  font-weight: 900;
  font-size: clamp(24px, 5.6vw, 32px);
  letter-spacing: 0.18em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.70), 0 6px 18px rgba(0,0,0,0.12);
  transition: all 0.3s ease;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.10));
}
#submit-button:hover{
  filter: brightness(1.06) drop-shadow(0 14px 24px rgba(0,0,0,0.10));
  transform: scale(1.02);
}
#submit-button:active{
  transform: scale(1.00);
}
#submit-button:disabled{
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(0.2) drop-shadow(0 14px 24px rgba(0,0,0,0.06));
}

.button-secondary{
  width: auto;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(209, 59, 44, 0.75);
  background: rgba(255,255,255,0.55);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: all 0.25s ease;
}
.button-secondary:hover{
  background: rgba(255,255,255,0.72);
}

.note{
  margin: 10px 0 0;
  color: rgba(43,43,43,0.62);
  font-size: 12px;
  text-align: center;
}

.message{
  margin: 12px 0 0;
  font-size: 13px;
  color: rgba(43,43,43,0.70);
  text-align: center;
}
.message--error{
  color: #b42318;
}
.message--ok{
  color: #067647;
}

.loading-panel{
  margin: 0 auto;
  max-width: 520px;
  padding: 18px 16px 16px;
  background: var(--panel-weak);
  border-radius: 14px;
  border: 3px double rgba(209, 59, 44, 0.55);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.loading__animation{
  border-radius: 12px;
  border: 1px solid rgba(209, 59, 44, 0.30);
  background: rgba(255,255,255,0.55);
  overflow: hidden;
  margin-bottom: 10px;
}
.loading__text{
  margin: 2px 0 0;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.result-panel{
  margin: 0 auto;
  max-width: 520px;
  padding: 18px 16px 16px;
  background: var(--panel);
  border-radius: 14px;
  border: 3px double rgba(209, 59, 44, 0.65);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.result-header{
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.result-stats{
  font-size: 10px;
  line-height: 1.35;
  color: rgba(43,43,43,0.65);
  text-align: center;
  white-space: pre-line;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(209, 59, 44, 0.25);
  background: rgba(255,255,255,0.65);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.result-meta{
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0;
  white-space: pre-wrap;
  text-align: center;
}

.result-stone-visual{
  margin: 8px auto 4px;
  text-align: center;
}

#result-stone-image{
  width: min(90px, 27vw);
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 10px 18px rgba(43, 43, 43, 0.18));
}

.result-grid{
  margin-top: 12px;
}
.result-item{
  padding: 12px 2px;
  border-bottom: 1px solid rgba(209, 59, 44, 0.20);
}
.result-item:last-child{
  border-bottom: none;
}
.result-item__title{
  font-weight: 900;
  font-size: 14px;
  margin: 0 0 8px;
  letter-spacing: 0.10em;
  color: var(--accent);
}
.result-item__body{
  margin: 0;
  white-space: pre-wrap;
  font-size: 16px;
  color: var(--ink);
}

.actions{
  margin-top: 14px;
  display:flex;
  justify-content: center;
}

@media (min-width: 769px){
  .page{
    padding: 64px 20px 80px;
  }
  h1{
    font-size: 40px;
  }
  .lead{
    font-size: 15px;
  }
}

.loading-note{
  margin-top: 12px;
}

/* ===== Fortune Cookie Animation ===== */

#fortune-animation {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 75vh;
  max-height: 600px;
  min-height: 420px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(900px 620px at 50% 12%, rgba(93, 61, 133, 0.28) 0%, rgba(38, 23, 56, 0.08) 48%, rgba(25, 14, 35, 0) 70%),
    linear-gradient(180deg, rgba(25, 14, 35, 0.96) 0%, rgba(16, 9, 25, 0.98) 100%);
  border-radius: 10px;
  box-shadow: 0 20px 58px rgba(8, 4, 12, 0.45), inset 0 0 0 1px rgba(255,255,255,0.08);
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#bg-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  opacity: 0;
  z-index: 2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,236,182,0.92) 0%, rgba(255,220,154,0.50) 38%, rgba(255,220,154,0.00) 72%);
  filter: blur(0.2px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s ease;
}
@keyframes stone-cushion-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.72; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 0.95; }
}
#bg-glow.stone-cushion {
  opacity: 0.9;
  animation: stone-cushion-pulse 2.2s ease-in-out infinite;
}

#split-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.82);
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.96) 0%, rgba(255,236,182,0.82) 20%, rgba(255,214,142,0.38) 38%, rgba(255,214,142,0) 62%);
}
@keyframes split-flash-burst {
  0% { opacity: 0; transform: scale(0.82); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.36); }
}
#split-flash.active {
  animation: split-flash-burst 0.38s ease-out forwards;
}

.stone-caption {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(92%, 430px);
  padding: 10px 14px;
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  border-radius: 10px;
  border: 1px solid rgba(238, 208, 150, 0.38);
  background: linear-gradient(180deg, rgba(39, 23, 58, 0.76) 0%, rgba(24, 14, 38, 0.60) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.stone-caption.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.stone-caption__lead {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(232, 213, 176, 0.88);
}
.stone-caption__name {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffe9bf;
  text-shadow: 0 0 14px rgba(255, 205, 136, 0.42);
}
.stone-caption__line {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.06em;
  color: rgba(239, 228, 206, 0.94);
}
.stone-caption__next {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: rgba(232, 213, 176, 0.90);
}
.stone-caption__next-sub {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: rgba(232, 213, 176, 0.72);
}

#cookie-stage {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(62vw, 248px);
  height: min(62vw, 248px);
  z-index: 3;
  pointer-events: none;
}

.cookie-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.36));
  transition: filter 0.65s ease, transform 0.8s ease;
}
.cookie-img.active { opacity: 1; }
.cookie-img.charged {
  filter: brightness(1.12) saturate(1.08) drop-shadow(0 0 22px rgba(255, 184, 92, 0.45)) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.35));
}

@keyframes cookie-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.cookie-img.float { animation: cookie-float 3s ease-in-out infinite; }

@keyframes cookie-pulse {
  0%, 100% { filter: brightness(1.0) drop-shadow(0 0 10px rgba(255,160,85,0.22)) drop-shadow(0 18px 24px rgba(0,0,0,0.34)); }
  50% { filter: brightness(1.3) drop-shadow(0 0 28px rgba(255,170,90,0.60)) drop-shadow(0 20px 30px rgba(0,0,0,0.34)); }
}
.cookie-img.pulse { animation: cookie-pulse 2s ease-in-out infinite; }

.cookie-half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.6s ease-out;
}
#cookie-left {
  left: 0;
  transform: translateX(0) rotate(0deg);
  transform-origin: right center;
}
#cookie-right {
  right: 0;
  transform: translateX(0) rotate(0deg);
  transform-origin: left center;
}
.cookie-half.split {
  opacity: 1;
}
#cookie-left.split {
  transform: translateX(-60px) rotate(-5deg);
}
#cookie-right.split {
  transform: translateX(60px) rotate(5deg);
}

#powerstone {
  position: absolute;
  top: 14%;
  left: 24%;
  width: 52%;
  height: 52%;
  object-fit: contain;
  z-index: 5;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease-out, opacity 0.3s ease;
  filter: drop-shadow(0 0 24px rgba(201,168,76,0.45)) drop-shadow(0 18px 24px rgba(0,0,0,0.30));
  pointer-events: none;
}
#powerstone.appear {
  opacity: 1;
  transform: scale(1);
}
@keyframes stone-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.03); }
}
#powerstone.float {
  animation: stone-float 2.5s ease-in-out infinite;
}

.paper-strip {
  position: absolute;
  width: 42px;
  height: 62px;
  object-fit: contain;
  top: 50%;
  left: 50%;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}
@keyframes paper-flutter-a {
  0% { transform: translate(-22px, -10px) rotate(0deg); opacity: 0.9; }
  45% { transform: translate(-60px, -90px) rotate(-25deg); opacity: 0.75; }
  100% { transform: translate(-84px, -168px) rotate(-40deg); opacity: 0; }
}
@keyframes paper-flutter-b {
  0% { transform: translate(18px, -6px) rotate(0deg); opacity: 0.9; }
  45% { transform: translate(58px, -100px) rotate(22deg); opacity: 0.72; }
  100% { transform: translate(80px, -176px) rotate(36deg); opacity: 0; }
}
#paper-a.flutter-a { animation: paper-flutter-a 2.5s ease-out forwards; }
#paper-b.flutter-b { animation: paper-flutter-b 2.8s ease-out forwards; }

.fortune-text {
  position: absolute;
  bottom: 84px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  text-align: center;
  color: #e8d5b0;
  font-family: "Zen Old Mincho", serif;
  font-size: 16px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  opacity: 1;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 16px rgba(201,168,76,0.28);
}
.fortune-text.fade-out {
  opacity: 0;
}
.fortune-text.is-hidden {
  opacity: 0;
}

#wait-notice {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(232,213,176,0.56);
  font-family: "Zen Old Mincho", serif;
  z-index: 10;
  transition: opacity 0.25s ease;
}
#wait-notice.is-hidden {
  opacity: 0;
}

#progress-dots {
  position: absolute;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(201,168,76,0.3);
  transition: background 0.8s ease, box-shadow 0.8s ease;
}
.dot.active {
  background: #c9a84c;
  box-shadow: 0 0 10px rgba(201,168,76,0.58);
}

@media (max-width: 480px) {
  #fortune-animation {
    max-height: 560px;
    min-height: 400px;
  }
  .fortune-text {
    font-size: 15px;
    padding: 0 14px;
  }
}

/* ====================================
   社殿演出 (shrine-animation)
   ==================================== */
.shrine-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 720 / 1052;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.shrine-layer {
  position: absolute;
  inset: 0;
}

.shrine-hidden {
  display: none;
}

.shrine-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.shrine-silhouette {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.shrine-silhouette.fade-in {
  transition: opacity 2s ease-in-out;
  opacity: 0.7;
}

.shrine-silhouette.pulsing {
  animation: shrine-glow 2.5s ease-in-out infinite;
}

@keyframes shrine-glow {
  0% {
    opacity: 0.4;
    filter: drop-shadow(0 0 0px transparent);
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(160, 100, 240, 0.8))
           drop-shadow(0 0 60px rgba(120, 60, 200, 0.4));
  }
  100% {
    opacity: 0.4;
    filter: drop-shadow(0 0 0px transparent);
  }
}

.shrine-layer.fade-out {
  transition: opacity 0.5s ease-out;
  opacity: 0;
}

#shrine-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.shrine-caption {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  pointer-events: none;
  font-family: 'Zen Old Mincho', serif;
}

.shrine-caption.show {
  opacity: 1;
}

.shrine-caption-top {
  top: 5%;
  font-size: clamp(14px, 3.5vw, 18px);
  color: #e8dff0;
  letter-spacing: 0.15em;
  text-shadow:
    0 0 12px rgba(120, 80, 180, 0.8),
    0 0 24px rgba(80, 40, 140, 0.5);
  z-index: 10;
}

.shrine-caption-bottom {
  bottom: 6%;
  padding: 0 10%;
  z-index: 12;
}

#shrine-caption-bottom {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(92%, 430px);
  padding: 8px 12px 6px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(1px);
}

#shrine-stone-name {
  font-family: 'Zen Old Mincho', serif;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: bold;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 0.1em;
  text-shadow:
    0 0 16px rgba(140, 100, 200, 0.9),
    0 0 32px rgba(100, 60, 160, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

#shrine-stone-line1,
#shrine-stone-line2 {
  font-family: 'Zen Old Mincho', serif;
  font-size: clamp(12px, 3vw, 16px);
  color: #d4c8e8;
  margin: 0;
  padding: 2px 0;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 8px rgba(100, 60, 160, 0.7),
    0 1px 3px rgba(0, 0, 0, 0.5);
}

#shrine-stone-note {
  margin: 8px 0 0;
  font-family: 'Zen Old Mincho', serif;
  font-size: clamp(12px, 2.8vw, 14px);
  color: #f2ecde;
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: pre-line;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

.shrine-status-box {
  position: absolute;
  left: 50%;
  bottom: 3.5%;
  transform: translateX(-50%);
  width: min(92%, 430px);
  min-height: 78px;
  padding: 14px 34px;
  border: none;
  border-radius: 0;
  background: url("./images/design-g-scroll-frame.png") center center / 100% 100% no-repeat;
  box-shadow: none;
  z-index: 12;
  display: flex;
  align-items: center;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.shrine-status-box.is-hidden {
  opacity: 0;
}

#shrine-status-text {
  margin: 0;
  width: 100%;
  color: #2f2418;
  font-size: clamp(22px, 5.4vw, 27px);
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: none;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  transition: opacity 0.65s ease;
}

@media (max-width: 640px) {
  .shrine-status-box {
    width: min(94%, 430px);
    padding: 12px 24px;
  }

  #shrine-status-text {
    font-size: clamp(18px, 4.9vw, 24px);
    line-height: 1.45;
    letter-spacing: 0.02em;
  }
}
