/* The views, the path view (参道) and its drawings, the spots, the hint and the toast. */

/* ---------- views: only one is shown; the others stay in the page, hidden and inert ---------- */
.view { position: fixed; inset: 0; z-index: 1; visibility: hidden; }
.view.on { visibility: visible; }
.view-spot { z-index: 3; }
/* nothing in a hidden view keeps animating */
.view:not(.on) * { animation-play-state: paused !important; }

/* ---------- the path ---------- */
.path-scroll {
  position: absolute; inset: 0;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y;
}
.path-scroll::-webkit-scrollbar { display: none; }
/* the world is the whole window width and clips sideways (never a sideways scroll); the scene is the
   centred column, and its drawings carry on past the column's edges on a wide window */
.path-world { position: relative; width: 100%; overflow-x: clip; }
.path-scene {
  --par: 0px;
  position: relative; width: 100%; max-width: var(--col); margin: 0 auto;
}
.path-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* far away: clouds, kites, birds, far mountains, hills; moved by the scroll (parallax, transform only) */
.path-far {
  position: absolute; left: 0; right: 0; top: 0; pointer-events: none;
  transform: translate3d(0, var(--par), 0); will-change: transform;
}
.far-svg { width: 100%; height: 100%; overflow: visible; }
.far-cloud { fill: rgba(255, 255, 255, .94); animation: farCloud 18s ease-in-out infinite alternate; }
@keyframes farCloud { from { transform: translateX(-34px); } to { transform: translateX(38px); } }
.far-hill.h1 { fill: #e6e0fb; } .far-hill.h2 { fill: #dceef6; } .far-hill.h3 { fill: #efe9fb; }
/* far mountains: pale, partly behind the hills; the season's colours, patches and snow (css/season.css) */
.far-mtn { fill: var(--mt-body); }
.far-mtn-cap { fill: #fbfdff; opacity: var(--mt-snow); }
.far-mtn-cap-sm { fill: #fbfdff; opacity: var(--mt-snow-sm); }
.far-mtn-line { fill: none; stroke: var(--mt-edge); stroke-width: 2; stroke-linejoin: round; }
.far-mtn, .far-mtn-cap, .far-mtn-cap-sm, .far-mtn-line { transition: fill .6s ease, stroke .6s ease, opacity .6s ease; }
/* a kite on its string of wind, and a few birds flapping */
.far-kite { transform-box: fill-box; transform-origin: 50% 30%; animation: kiteFly 5.2s ease-in-out infinite alternate; }
.far-kite.fk2 { animation-duration: 6.4s; animation-delay: -2.3s; }
.far-kite.fk2 .kt-body { fill: #d4f3e6; stroke: #a9e2cb; } .far-kite.fk2 .kt-shade { fill: #e6f8ef; } .far-kite.fk2 .kt-spar { stroke: #a9e2cb; }
.far-kite.fk2 .kt-tail { stroke: #ffc8ba; } .far-kite.fk2 .kt-bow { fill: #ffc8ba; }
.far-birds { animation: birdsGlide 9s ease-in-out infinite alternate; }
@keyframes birdsGlide { 0% { transform: translate(-30px, 6px); } 50% { transform: translate(20px, -8px); } 100% { transform: translate(64px, 2px); } }
.bird { fill: none; stroke: #ab9eea; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  transform-box: fill-box; transform-origin: 50% 100%; animation: birdFlap .5s ease-in-out infinite alternate; }
.bird.b2 { animation-delay: -.2s; } .bird.b3 { animation-delay: -.35s; }
@keyframes birdFlap { from { transform: scaleY(1); } to { transform: scaleY(-.5); } }

/* ground and the stone path */
.ground { fill: var(--grass-1); }
.ground-edge { fill: none; stroke: var(--grass-edge); stroke-width: 2.5; }
.ground-patch { fill: var(--grass-2); }
.path-edge { fill: none; stroke: #e6dccf; stroke-width: 72; stroke-linecap: round; }
.path-fill { fill: none; stroke: #f6efe5; stroke-width: 67; stroke-linecap: round; }
.path-slabs { fill: none; stroke: #fdf9f2; stroke-width: 52; stroke-dasharray: 30 5; }
[data-season="winter"] .path-fill { stroke: #f4f1f6; }
[data-season="winter"] .path-slabs { stroke: #fdfcff; }

/* props */
.pt-shadow { fill: rgba(90, 80, 140, .1); }
.tr-trunk { fill: #efd0b6; stroke: #ddb394; stroke-width: 2; }
.tr-o { fill: var(--leaf-1); stroke: var(--leaf-edge); stroke-width: 4; }
.tr-f { fill: var(--leaf-1); }
.tr-hi { fill: var(--leaf-2); }
.tree.alt { --leaf-1: var(--leafb-1); --leaf-2: var(--leafb-2); --leaf-edge: var(--leafb-edge); }
.bu-o { fill: var(--bush-1); stroke: var(--bush-edge); stroke-width: 4; }
.bu-f { fill: var(--bush-1); }
.bu-hi { fill: var(--bush-2); }
.sway { animation: treeSway 4.2s ease-in-out infinite; }
@keyframes treeSway { 0%, 100% { transform: rotate(-2.6deg); } 50% { transform: rotate(2.6deg); } }
.st { fill: #f1edf6; stroke: #d9d1e5; stroke-width: 2; stroke-linejoin: round; }
.st-line { fill: none; stroke: #e2dbec; stroke-width: 1.6; stroke-linecap: round; }
.lan-light { fill: #fff1bd; animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { fill: #fff1bd; } 50% { fill: #ffe39a; } }
.flw { fill: var(--flower-1); }
.f2 .flw, use.f2 { fill: var(--flower-2); }
.flw-c { fill: #fff6d6; }
[data-season="winter"] .flw-c { fill: transparent; }
.to-name { font-family: var(--kanji); font-weight: 600; font-size: 17px; fill: var(--coral-ink); writing-mode: vertical-rl; letter-spacing: .02em; }

/* drawings inside the spots */
.wd { fill: #fbe3cc; stroke: #e8c29f; stroke-width: 2; stroke-linejoin: round; }
.wd-dark { fill: #f3cfae; stroke: #e2b58f; stroke-width: 2; }
.wd-line { fill: none; stroke: #f0d1b3; stroke-width: 1.6; }
.gold { fill: #f8dc96; stroke: #e5c070; stroke-width: 1.5; }
.water { fill: var(--water); stroke: var(--water-edge); stroke-width: 2; }
.water-hi { fill: var(--water-hi); }
.pond-edge { fill: #ece7f3; stroke: #d9d1e5; stroke-width: 2; }
.bamboo { fill: none; stroke: #bfe3c4; stroke-width: 7; stroke-linecap: round; }
.bamboo-joint { fill: none; stroke: #9fcfa8; stroke-width: 7; stroke-dasharray: 1.5 12; }
.drip { fill: var(--water-edge); animation: drip 1.4s ease-in infinite; transform-box: fill-box; }
@keyframes drip { 0% { transform: translateY(-3px) scale(.4); opacity: 0; } 20% { opacity: 1; } 80% { transform: translateY(5px) scale(1); opacity: 1; } 100% { transform: translateY(7px) scale(1); opacity: 0; } }
.ripple-line { fill: none; stroke: #fff; stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: ripple 1.4s ease-out infinite; }
.ladle { fill: #fbe3cc; stroke: #e8c29f; stroke-width: 1.6; }
.ladle-h { fill: none; stroke: #e8c29f; stroke-width: 2.4; stroke-linecap: round; }
.rk-post { fill: #fff4e2; stroke: var(--straw-deep); stroke-width: 1.6; }
.kn-paper { fill: #fffdf8; stroke: #e4dcef; stroke-width: 1.2; }
.bx-stick-out-line { stroke: #bfe3c4; stroke-width: 3.4; stroke-linecap: round; }
.ema-p { fill: #fff1dc; stroke: #eac39f; stroke-width: 1.4; stroke-linejoin: round; }
.ema-cord { stroke: #f0a797; stroke-width: 1.6; }
.ema { transform-origin: 8px 0; animation: emaSway 2.4s ease-in-out infinite; }
@keyframes emaSway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.koi-swim { animation: koiSwim 22s linear infinite; }
.koi-swim.slow { animation-duration: 15s; animation-direction: reverse; }
@keyframes koiSwim { to { transform: rotate(360deg); } }
.koi-body { stroke-width: 1.6; }
.k1 .koi-body, .k1 .koi-tail { fill: #fffdf9; stroke: #f2c6b6; }
.k1 .koi-spot { fill: #ffc4ae; }
.k2 .koi-body, .k2 .koi-tail { fill: #ffd9c2; stroke: #f0b393; }
.k2 .koi-spot { fill: #fff3e8; }
.k3 .koi-body, .k3 .koi-tail { fill: #fbeaa9; stroke: #e6cc78; }
.k3 .koi-spot { fill: #fffbe8; }
.koi-tail { stroke-width: 1.4; stroke-linejoin: round; }
.koi-fin { fill: none; stroke: #f2c6b6; stroke-width: 1.6; stroke-linecap: round; }
.ripple { fill: none; stroke: #fff; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ripple 2.8s ease-out infinite; }
.ripple.r2 { animation-delay: -1.4s; }
@keyframes ripple { 0% { transform: scale(.3); opacity: .95; } 100% { transform: scale(2.4); opacity: 0; } }
.pad { fill: #c4ebcf; stroke: #9fd3ad; stroke-width: 1.6; }
.lotus { fill: #ffd6e0; stroke: #f4b6c4; stroke-width: 1.2; }
[data-season="winter"] .lotus { display: none; }
.parasol { fill: #ffc8ba; stroke: #f0a797; stroke-width: 2; stroke-linejoin: round; }
.parasol-rib { fill: none; stroke: #ffe6dd; stroke-width: 1.6; stroke-linecap: round; }
.parasol-pole { stroke: #e8c29f; stroke-width: 3.5; stroke-linecap: round; }
.tea-cloth { fill: #ffd0c3; stroke: #f0a797; stroke-width: 2; }
.cup { fill: #d4f3e6; stroke: #a9e2cb; stroke-width: 1.6; stroke-linejoin: round; }
.steam { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: .95; } 100% { opacity: 0; transform: translateY(-8px); } }
.dango-stick { stroke: #e8c29f; stroke-width: 2; stroke-linecap: round; }
.dango { stroke-width: 1.5; }
.dango.d1 { fill: #ffd3dc; stroke: #f4b6c4; } .dango.d2 { fill: #fffdf8; stroke: #e7dccd; } .dango.d3 { fill: #cdeec8; stroke: #a9d8a6; }
.noren { transform-origin: 52px 42px; animation: noren 3s ease-in-out infinite; }
@keyframes noren { 0%, 100% { transform: skewX(-5deg); } 50% { transform: skewX(5deg); } }
.noren-p { fill: #d4f3e6; stroke: #a9e2cb; stroke-width: 1.6; }
.noren-t { font-family: var(--kanji); font-weight: 600; font-size: 12px; fill: var(--mint-ink); }

/* ---------- the spots: buttons laid over the drawing ---------- */
.path-spots { position: absolute; z-index: 3; inset: 0; pointer-events: none; }   /* over the people of the path (css/avatar.css): a spot wins a tap */
.spot {
  position: absolute; pointer-events: auto; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  border-radius: 22px; -webkit-tap-highlight-color: transparent;
}
.spot-art { position: relative; width: 100%; height: auto; overflow: visible; }
.spot-sign {
  position: relative; z-index: 1; margin-top: -10px;
  display: inline-flex; align-items: baseline; white-space: nowrap;
  padding: 5px 14px 6px; border-radius: 12px;
  background: #fff6ea; border: 2.5px solid #f6cdb9; box-shadow: 0 3px 0 #f6cdb9, 0 6px 12px rgba(110, 95, 170, .12);
  color: var(--coral-ink); font-size: 15px; font-weight: 700; line-height: 1.1;
}
.spot-sign::before, .spot-sign::after {
  content: ''; position: absolute; top: -9px; width: 3px; height: 8px; border-radius: 2px; background: var(--straw-deep);
}
.spot-sign::before { left: 14px; } .spot-sign::after { right: 14px; }
.ss-soon { font-weight: 600; color: var(--ink-soft); }
/* open spots bob and glow so they read as something to tap */
.spot.open .spot-sign { animation: signBob 1.7s ease-in-out infinite; background: #fffaf2; }
@keyframes signBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.spot-glow {
  position: absolute; left: 50%; top: 46%; width: 112%; aspect-ratio: 1.45; translate: -50% -50%;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, #fffbe6 0, rgba(255, 240, 186, .95) 38%, rgba(255, 220, 196, .6) 68%, rgba(255, 220, 196, 0) 100%);
  animation: spotGlow 2s ease-in-out infinite;
}
@keyframes spotGlow { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.08); } }
/* the hall's glow: a wide soft halo whose bright ring shows around the roof and the walls */
.spot[data-spot="haiden"] .spot-glow {
  width: 132%; aspect-ratio: 1.3; top: 44%;
  background: radial-gradient(closest-side, rgba(255, 246, 204, .95) 0 58%, rgba(255, 236, 178, .85) 72%, rgba(255, 214, 190, .45) 86%, rgba(255, 214, 190, 0) 100%);
}
/* the hall drawn on the path: its rope a little thinner, its bell swinging from the beam */
.spot .hl-rope, .spot .hl-rope-twist { stroke-width: 8; }
.spot .hl-bellrope, .spot .hl-bellrope-stripe { stroke-width: 9; }
.spot .hl-bellrope-stripe { stroke-dasharray: 4 7; }
.spot .hl-bell.sm { transform-origin: 150px 110px; }
/* closed spots: a little dimmed */
.spot.closed .spot-art { opacity: .72; filter: saturate(.75); }
.spot.closed .spot-sign { background: #fbf7f3; border-color: #ead9cf; box-shadow: 0 3px 0 #ead9cf; color: #9a7d74; }
.spot.wiggle .spot-art, .spot.wiggle .spot-sign { animation: spotWiggle .55s ease-in-out; }
@keyframes spotWiggle {
  0%, 100% { transform: rotate(0); } 18% { transform: rotate(-5deg); } 36% { transform: rotate(4.5deg); }
  54% { transform: rotate(-3deg); } 72% { transform: rotate(2deg); }
}
.spot:active .spot-art { transform: scale(.97); }
.spot:focus-visible { outline-offset: 2px; }
.spot[data-spot="haiden"] .spot-sign { margin-top: -26px; font-size: 16px; }

/* ---------- "Swipe up to walk in" ---------- */
.path-hint {
  position: absolute; z-index: 3; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); translate: -50% 0;
  margin: 0; padding: 8px 16px 9px 12px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: rgba(255, 255, 255, .92); border: 2px solid #e6dfff; box-shadow: 0 4px 0 #e6dfff, 0 8px 18px rgba(110, 95, 170, .16);
  font-size: 15px; font-weight: 600; color: var(--ink);
  animation: hintBob 1.3s ease-in-out infinite;
  transition: opacity .35s, visibility .35s;
  pointer-events: none;
}
.path-hint.gone { opacity: 0; visibility: hidden; }
.ph-arrow {
  width: 22px; height: 22px; border-radius: 50%; background: var(--lilac); position: relative;
}
.ph-arrow::before {
  content: ''; position: absolute; left: 7px; top: 8px; width: 7px; height: 7px;
  border-left: 2.5px solid var(--lilac-ink); border-top: 2.5px solid var(--lilac-ink); rotate: 45deg;
}
@keyframes hintBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 35; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); translate: -50% 0;
  margin: 0; padding: 10px 18px; border-radius: 999px;
  background: #fff6ea; border: 2.5px solid #f6cdb9; box-shadow: 0 4px 0 #f6cdb9, 0 10px 20px rgba(110, 95, 170, .18);
  color: var(--coral-ink); font-size: 16px; font-weight: 700; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.toast.show { visibility: visible; animation: toast 1.5s ease both; }
@keyframes toast {
  0% { opacity: 0; transform: translateY(14px) scale(.9); }
  14% { opacity: 1; transform: translateY(0) scale(1.04); }
  22%, 82% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* the sign in the header changes with the view */
.sign .sign-en, .sign .sign-ja { transition: opacity .2s; }

@media (prefers-reduced-motion: reduce) {
  .path-far { transform: none; }
  .sway, .far-cloud, .ema, .noren, .koi-swim, .ripple, .ripple-line, .drip, .steam, .lan-light,
  .spot.open .spot-sign, .spot-glow, .path-hint, .far-kite, .far-birds, .bird, .hl-chochin, .to-shide, .spot.wiggle .spot-art, .spot.wiggle .spot-sign { animation: none !important; }
  .spot-glow { opacity: .8; }
  .toast.show { animation: none; opacity: 1; }
}

/* the gate: flower on the plaque, straw rope with paper strips */
.to-flower-eye { fill: var(--gold-1); stroke: var(--gold-2); stroke-width: 1; }
.to-rope { fill: none; stroke: var(--straw-deep); stroke-width: 5.5; stroke-linecap: round; }

/* ---------- the season button (every view, bottom-left; js/season-button.js) ---------- */
/* Under the toast and every overlay (stick card 40, drawers 45, slip 50). --sb-bottom is set per view so
   it clears that view's hint, dots, coins, hands, "See today's slip" and the credit line. */
.season-btn {
  position: fixed; z-index: 25; left: calc(12px + env(safe-area-inset-left));
  bottom: calc(var(--sb-bottom, 72px) + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.season-btn { transition: opacity .3s, visibility .3s; }
/* in the spot views: the omikuji corner's button sits beside the coin row, above the credit line; the
   hall's and the basin's in the corner under the hint, left of the hands */
body[data-view="omikuji"] { --sb-bottom: 44px; }
body[data-view="haiden"], body[data-view="temizu"] { --sb-bottom: 14px; }
@media (max-height: 620px) { body[data-view="omikuji"] { --sb-bottom: 30px; } body[data-view="haiden"] { --sb-bottom: 6px; } }
/* the narrowest phones: with "See today's slip" beside the coin, the row moves over a little to clear it */
@media (max-width: 344px) { .view-omikuji .coin-row:has(#todayBtn:not([hidden])) { padding-left: 40px; } }
/* out of the way mid-action: while the omikuji box is zoomed for shaking, and while a coin flies (or is dragged) */
body[data-view="omikuji"][data-state="offering"] .season-btn, body[data-view="omikuji"][data-state="shake"] .season-btn,
body:has(#scene.focus) .season-btn, body:has(.coin.flying, .coin.dragging) .season-btn { visibility: hidden; opacity: 0; pointer-events: none; }
.season-btn .season-icon { width: 34px; height: 34px; overflow: visible; }
.season-now { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 2px #fff; display: none; }
.season-btn.is-now .season-now { display: block; }
.si-blossom ellipse { fill: #ffd3dc; stroke: #f4b6c4; stroke-width: 1.2; }
.si-eye { fill: #fff6d6; stroke: #f6cf63; stroke-width: 1; }
.si-leaf path:first-child { fill: #c9ecd0; stroke: #8fcb9d; stroke-width: 1.4; stroke-linejoin: round; }
.si-maple path:first-child { fill: none; stroke: #e99d80; stroke-width: 1.6; stroke-linecap: round; }
.si-maple path:nth-child(2) { fill: #ffc9b0; stroke: #e99d80; stroke-width: 1.3; stroke-linejoin: round; }
.si-vein { fill: none; stroke: #fff; stroke-width: 1.2; stroke-linecap: round; opacity: .9; }
.si-flake path { fill: none; stroke: #9fc3e6; stroke-width: 2; stroke-linecap: round; }
/* the light wash while the colours change */
.season-wash { position: fixed; inset: 0; z-index: 24; pointer-events: none; background: radial-gradient(circle at 20% 90%, #fffdf6 0, #fff6fb 60%, #f6f3ff 100%); opacity: 0; }
