/* The worship hall (view #haiden) and the hall drawn on the path. */

/* the hall's drawing keeps its proportions and fills the scene: as wide as the column allows, as
   tall as the scene allows (cq units = the scene, see .scene in shrine.css) */
.hall-wrap {
  position: absolute; left: 50%; bottom: 0; translate: -50% 0;
  width: min(100cqw + 8px, 62.5cqh); aspect-ratio: 400 / 640;
}
.hall { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hd-scene .saisen {
  position: absolute; z-index: 2; left: 50%; bottom: 3.4%; width: 44%; translate: -50% 0;
}
.saisen-slot { position: absolute; left: 30%; width: 40%; top: 20%; height: 14%; }

.hl-step { fill: #f1edf6; stroke: #d9d1e5; stroke-width: 2; }
.hl-base { fill: #f3cfae; stroke: #e2b58f; stroke-width: 2; }
.hl-floor { fill: #fbe3cc; stroke: #e8c29f; stroke-width: 2; }
.hl-wall { fill: #fff6ea; stroke: #f3d3b8; stroke-width: 2; }
.hl-lattice { fill: none; stroke: #f6dcc6; stroke-width: 3; }
.hl-rail { fill: #fbe3cc; stroke: #f0d0b2; stroke-width: 1.5; }
.hl-pillar { fill: #ffd3c8; stroke: #f5b6a7; stroke-width: 2; }
.hl-beam { fill: #ffc8ba; stroke: #f5b6a7; stroke-width: 2; }
.hl-crest { fill: #f8dc96; stroke: #e5c070; stroke-width: 2; }
.hl-knob { fill: #f8dc96; stroke: #e5c070; stroke-width: 2; }
.hl-rope { fill: none; stroke: var(--straw); stroke-width: 11; stroke-linecap: round; }
.hl-rope-twist { fill: none; stroke: var(--straw-deep); stroke-width: 11; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .7; }
.hl-bell-cord { stroke: var(--straw-deep); stroke-width: 3; stroke-linecap: round; }
.hl-bell-ring { stroke: #e5c070; stroke-width: 3; }
.hl-bell-ball { fill: #ffe9a3; stroke: #e5c070; stroke-width: 2.4; }
.hl-bell-band { stroke: #f6cf63; stroke-width: 3; stroke-linecap: round; }
.hl-bell-slit { stroke: #c9a24e; stroke-width: 3; stroke-linecap: round; }
.hl-bell-hole { fill: #d9b45e; }
.hl-bellrope { stroke: #ffc8ba; stroke-width: 12; stroke-linecap: round; }
.hl-bellrope-stripe { stroke: #fffaf2; stroke-width: 12; stroke-dasharray: 5 9; }
.hl-tassel { fill: #cfc4ff; stroke: #b9acf0; stroke-width: 2; stroke-linejoin: round; }
.hall .hl-bellrope, .hall .hl-bellrope-stripe { stroke-width: 14; }
/* ---------- the richer hall (js/hall-art.js) ---------- */
.hl-step-top { fill: none; stroke: #fbf9fd; stroke-width: 2.5; stroke-linecap: round; }
.hl-base-line { fill: none; stroke: #e7bf9c; stroke-width: 2; stroke-linecap: round; opacity: .7; }
.hl-floor-line { fill: none; stroke: #f0cfae; stroke-width: 1.6; stroke-dasharray: 22 4; }
.hl-inner-line { fill: none; stroke: #cbbfee; stroke-width: 2; }
.hl-lattice-fine { fill: none; stroke: #f9e6d6; stroke-width: 1.6; }
.hl-panel { fill: #fdeedd; }
.hl-altar { fill: #ffd3c8; stroke: #f0a797; stroke-width: 1.6; }
.hl-altar-leg { stroke: #f0a797; stroke-width: 3; stroke-linecap: round; }
.hl-sakaki { fill: none; stroke: #a9d7b0; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.hl-mirror { fill: #f8dc96; stroke: #e5c070; stroke-width: 2; }
.hl-mirror-in { fill: #fff6d6; }
.hl-rail-bar { fill: none; stroke: #f5b6a7; stroke-width: 4; stroke-linecap: round; }
.hl-rail-post { fill: #ffd3c8; stroke: #f5b6a7; stroke-width: 1.6; }
.hl-pillar-hi { fill: none; stroke: #ffe4dc; stroke-width: 3; stroke-linecap: round; }
.hl-bracket { fill: #ffd9cd; stroke: #f0a797; stroke-width: 1.8; }
.hl-beam-line { fill: none; stroke: #ffdcd2; stroke-width: 2; stroke-linecap: round; }
.hl-rope-end { fill: var(--straw); stroke: var(--straw-deep); stroke-width: 2; }
.hl-fringe { transform-box: fill-box; transform-origin: 50% 0; animation: shideSway 3s ease-in-out infinite; }
.hl-fringe:nth-of-type(2n) { animation-delay: -1.3s; }
.hl-fringe-cap { fill: var(--straw-deep); stroke: #d6b468; stroke-width: 1.2; stroke-linejoin: round; }
.hl-fringe-straw { fill: none; stroke: var(--straw-deep); stroke-width: 2; stroke-linecap: round; }
.ch-glow { fill: url(#hlGlow); animation: lanternGlow 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes lanternGlow { 0%, 100% { opacity: .55; transform: scale(.92); } 40% { opacity: 1; transform: scale(1.06); } 55% { opacity: .8; } 70% { opacity: .95; } }
.ch-shine { fill: #fffaf3; opacity: .9; }
.hl-bellrope-stripe2 { stroke: #d6ccff; stroke-width: 14; stroke-dasharray: 3 11; stroke-dashoffset: -7; }
.hl-tassel-cap { fill: #f8dc96; stroke: #e5c070; stroke-width: 1.6; }
.hl-tassel-line { fill: none; stroke: #b9acf0; stroke-width: 1.6; stroke-linecap: round; }
.hl-knot { fill: #ffc8ba; stroke: #f0a797; stroke-width: 1.6; }
.hl-bell-shade { fill: none; stroke: #f6cf63; stroke-width: 4; stroke-linecap: round; opacity: .55; }
.hl-bell-band.thin { stroke-width: 1.6; opacity: .8; }
.hl-bell-spark { fill: #fff; }
.hl-crest-petal { fill: #fff6d6; }
.hl-crest-eye { fill: #f6cf63; }
.km-base { fill: #f1edf6; stroke: #d9d1e5; stroke-width: 2; }
.km-base-line { fill: none; stroke: #e2dbec; stroke-width: 1.6; }
.km-body { fill: #fffaf2; stroke: #e6d5c4; stroke-width: 2; stroke-linejoin: round; }
.km-tail, .km-mane { fill: #ffe1c9; stroke: #efc3a3; stroke-width: 1.6; }
.km-mane-line { fill: none; stroke: #efc3a3; stroke-width: 1.6; stroke-linecap: round; }
.km-eye { fill: var(--ink); }
.km-nose { fill: #ffc8ba; }
.km-blush { fill: #ffd3dc; opacity: .9; }
.km-paw { fill: #fffaf2; stroke: #e6d5c4; stroke-width: 1.6; }
.km-bib { fill: none; stroke: #ffb9a8; stroke-width: 3; stroke-linecap: round; }
.km { transform-box: fill-box; transform-origin: 50% 100%; animation: kmBreathe 3.6s ease-in-out infinite; }
@keyframes kmBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025, .975); } }

/* ---------- roofs (js/roof-art.js): the hall, the hall and stands on the path, the temizu pavilion ---------- */
.rf-face { fill: #ddd5ff; }
.rf-face-line { fill: none; stroke: #b9acf0; stroke-width: 2; stroke-linejoin: round; }
.rf-tiles { fill: none; stroke: #cbc1f7; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rf-ridge-shade { fill: none; stroke: #c8bdf6; stroke-width: 4; opacity: .55; }
.rf-end { fill: #e9e3ff; stroke: #c3b7f4; stroke-width: 1.5; }
.rf-fascia { fill: #ffc8ba; stroke: #f0a797; stroke-width: 2; stroke-linejoin: round; }
.rf-fascia-hi { fill: none; stroke: #ffdcd2; stroke-width: 1.8; stroke-linecap: round; }
.rf-shadow { fill: none; stroke: #ebc0b4; stroke-width: 3.5; stroke-linecap: round; opacity: .8; }
.rf-soffit { fill: #f8dcd2; stroke: #efc1b3; stroke-width: 1.4; stroke-linejoin: round; }
.rf-gable-sill { fill: none; stroke: #f0a797; stroke-width: 6; stroke-linecap: round; }
.snow.rf-gable-snow { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 .6px #d9ddef); }
.rf.sm .snow.rf-gable-snow { stroke-width: 3.6; }
.rf-rafter { fill: #fff2e4; stroke: #e8b89f; stroke-width: 1.4; }
.rf-ridge { fill: #ffc8ba; stroke: #f0a797; stroke-width: 2; stroke-linejoin: round; }
.rf-ridge-hi { fill: none; stroke: #ffe0d7; stroke-width: 2; stroke-linecap: round; }
.rf-gable { fill: #ebe6ff; }
.rf-gable-base { fill: none; stroke: #c8bdf6; stroke-width: 1.7; stroke-linecap: round; }
.rf-gable-board { fill: none; stroke: #f0a797; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.rf-gable-board-hi { fill: none; stroke: #ffc8ba; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
/* the small roofs on the path: finer lines */
.rf.sm .rf-tiles { stroke-width: 1.3; }
.rf.sm .rf-end { stroke-width: 1.1; }
.rf.sm .rf-gable-board { stroke-width: 5; }
.rf.sm .rf-gable-board-hi { stroke-width: 2.2; }
.rf.sm .rf-gable-sill { stroke-width: 4.4; }

/* the bell and its rope sway on their own; a pull rings it (haiden.js animates .hl-bell-swing) */
.hl-bell { transform-origin: 200px 208px; animation: bellSway 3.2s ease-in-out infinite; }
.hl-bell-swing { transform-origin: 200px 208px; }
.hl-pull { transform-origin: 200px 304px; }
.hl-bell.sm { transform-origin: 150px 156px; }
@keyframes bellSway { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
.hl-chochin { animation: lanternSway 3.8s ease-in-out infinite; }
/* while the bell waits to be rung its tassel beckons */
.view-haiden[data-state="ring"] .hl-bell { animation-duration: 1.6s; }
.view-haiden[data-state="ring"] .hl-tassel { animation: tasselBeckon 1.1s ease-in-out infinite; }
@keyframes tasselBeckon { 0%, 100% { fill: #cfc4ff; } 50% { fill: #fff3c4; } }

/* the rope button: a wide, tall target over the rope */
.bell-rope {
  position: absolute; z-index: 1; left: 50%; translate: -50% 0; top: 46%; height: 24%; width: max(64px, 22%);
  padding: 0; border: 0; background: none; border-radius: 22px; cursor: grab; touch-action: none;
}
.bell-rope:focus-visible { outline: none; }   /* the pulsing dashed ring below marks it */
.bell-rope:disabled { pointer-events: none; cursor: default; }
.view-haiden[data-state="ring"] .bell-rope::after {
  content: ''; position: absolute; left: 50%; bottom: -4%; width: 62px; height: 62px; translate: -50% 0; border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .95); box-shadow: 0 0 0 4px rgba(207, 196, 255, .5);
  animation: ropeCall 1.3s ease-in-out infinite;
}
@keyframes ropeCall { 0%, 100% { transform: scale(.85); opacity: .5; } 50% { transform: scale(1.1); opacity: 1; } }

/* the controls under the hall: step dots, the hint, a quiet line, the coin; the hands rise from below */
.hd-controls, .tz-controls { height: calc(var(--ctl) + 18px + env(safe-area-inset-bottom)); gap: 6px; padding-top: 8px; }
/* the hall: the step dots a little lower, so the visitor's avatar stands on the ground in front of the hall, its head clear of the 奉納 plate */
.view-haiden { --hd-pad: clamp(16px, 7.7vw, 30px); }
@media (max-height: 640px) { .view-haiden { --hd-pad: 20px; } }
/* (the controls grow by the same amount, so the dots, the hint, the coin and the prayer's effects keep their places at the bottom; the hall above gives up the room) */
.hd-controls { padding-top: var(--hd-pad); height: calc(var(--ctl) + 10px + var(--hd-pad) + env(safe-area-inset-bottom)); }
.hd-controls .hint { min-height: 24px; font-size: 16px; }
.view-haiden[data-state="wish"], .view-haiden.holding { touch-action: none; }

/* ---------- the prayer's effects, low in the middle (#hdFx; no hands in the hall for now) ----------
   clap: two soft arcs swing in from the sides and meet in a star with a ring ripple; wish: a warm glow
   gathers, a thin ring round it fills while held. The step's own resting look shows where to tap. */
.pray-fx {
  position: absolute; z-index: 2; left: 50%; translate: -50% 0;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: 112px; height: 112px; outline: none; touch-action: none; pointer-events: none;
}
.pray-fx:focus-visible { outline: none; }
/* short phones: the controls are lower, the effects a little smaller under the hint */
@media (max-height: 640px) { .pray-fx { width: 80px; height: 80px; bottom: calc(4px + env(safe-area-inset-bottom)); } .pf-glow { width: 170px; height: 170px; } }
.pf-glow {
  position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; border-radius: 50%; opacity: 0;
  transform: translate(-50%, -50%) scale(.3); pointer-events: none;
  background: radial-gradient(circle, rgba(255, 246, 205, .98) 0 16%, rgba(255, 226, 150, .62) 36%, rgba(255, 220, 160, .22) 56%, rgba(255, 220, 160, 0) 70%);
}
.pf-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity .3s; transform: rotate(-90deg); }
.pf-track { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 3.4; }
.pf-prog { fill: none; stroke: var(--gold-2, #f6cf63); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 3px rgba(255, 236, 170, .9)); }
.pray-fx[data-step="wish"] .pf-ring { opacity: 1; }
.pf-orb {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 40% 38%, #fffdf2, #ffeaa8 60%, #f8d77c); box-shadow: 0 0 14px 4px rgba(255, 228, 150, .55);
  transition: opacity .3s;
}
.pray-fx[data-step="wish"] .pf-orb { opacity: 1; animation: orbCall 1.6s ease-in-out infinite; }
.pray-fx.wishing .pf-orb { animation: none; transform: scale(1.25); transition: transform 2.4s ease-out, opacity .3s; }
@keyframes orbCall { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.12); } }
/* the two arcs: soft crescents, resting apart while the claps wait */
.pf-arc {
  position: absolute; top: 50%; left: 50%; width: 30px; height: 62px; margin: -31px 0 0 -15px; opacity: 0;
  border-radius: 50%; border: 6px solid transparent; transition: opacity .3s;
}
.pf-arc.l { border-left-color: #f6c46e; translate: -8px 0; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px rgba(255, 214, 120, .8)); }
.pf-arc.r { border-right-color: #f6c46e; translate: 8px 0; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px rgba(255, 214, 120, .8)); }
.pray-fx[data-step="clap"] .pf-arc { opacity: .7; }
.pray-fx[data-step="clap"] .pf-arc.l { transform: translateX(-40px) rotate(-18deg); animation: arcCallL 1.4s ease-in-out infinite; }
.pray-fx[data-step="clap"] .pf-arc.r { transform: translateX(40px) rotate(18deg); animation: arcCallR 1.4s ease-in-out infinite; }
@keyframes arcCallL { 0%, 100% { transform: translateX(-40px) rotate(-18deg); } 50% { transform: translateX(-32px) rotate(-12deg); } }
@keyframes arcCallR { 0%, 100% { transform: translateX(40px) rotate(18deg); } 50% { transform: translateX(32px) rotate(12deg); } }
/* the star and the ripple where the arcs meet (in the fly layer) */
.pf-star {
  position: fixed; z-index: 71; width: 58px; height: 58px; pointer-events: none;
  background: radial-gradient(circle, #fffbe6 0 14%, #ffdf7e 34%, #f7bd52 70%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}
.pf-ripple { position: fixed; z-index: 70; width: 74px; height: 74px; border-radius: 50%; border: 4px solid #f6c46e; box-shadow: 0 0 0 3px rgba(255, 255, 255, .8), 0 0 14px rgba(255, 214, 120, .7); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .hl-bell, .hl-chochin, .hl-fringe, .ch-glow, .km, .hl-tassel, .bell-rope::after, .pf-orb, .pf-arc { animation: none !important; }
}
