/* ==========================================================================
   The Light Nation scenes: the barrier, daily life, the castle, the people.
   The shared pieces (boards, slips, characters, cards) are in scenes.css.
   ========================================================================== */
.light .stage{background:#120d0c}
.light .frame{z-index:6}

.wash-gold{background:radial-gradient(circle at 50% 42%,#fffdf3 0%,#ffeec0 24%,#f6cf84 60%,#d3a04b 100%)}

/* soft shade at the edges so the paper slips and headlines read against the paintings */
.ln-shade{background:linear-gradient(90deg,rgba(14,10,22,.36),rgba(14,10,22,0) 34%,rgba(14,10,22,0) 66%,rgba(14,10,22,.34))}
.law-shade{background:linear-gradient(90deg,rgba(20,10,6,.3),rgba(20,10,6,0) 40%),linear-gradient(0deg,rgba(20,10,6,.42),rgba(20,10,6,0) 36%)}

/* ---------- the barrier: light climbing the painted lines ---------- */
.ln-lines{position:absolute;inset:0;pointer-events:none;mix-blend-mode:screen;opacity:0;
  -webkit-mask:url(/home/img/bg/light-barrier-lines.webp) center/100% 100% no-repeat;mask:url(/home/img/bg/light-barrier-lines.webp) center/100% 100% no-repeat}
/* a band of light travelling up the lines: only its position changes, so nothing is repainted */
.ln-lines::before{content:"";position:absolute;left:0;right:0;top:96%;height:68%;will-change:transform;
  background:linear-gradient(0deg,rgba(255,246,214,0),rgba(255,253,240,1) 50%,rgba(255,246,214,0));
  animation:ln-rise 5.2s linear infinite}
@keyframes ln-rise{to{transform:translateY(-236%)}}

/* ---------- the castle: the hall is revealed as if its doors slid apart ---------- */
.doors{position:absolute;inset:0;z-index:2;visibility:hidden;clip-path:inset(0 50% 0 50%);will-change:clip-path}
.doors::before,.doors::after{content:"";position:absolute;top:0;bottom:0;width:3px;z-index:6;background:linear-gradient(180deg,transparent,#fff3cf 20%,#fff3cf 80%,transparent);
  box-shadow:0 0 24px 4px rgba(255,220,150,.7);opacity:var(--edge,0);pointer-events:none}
.doors::before{left:var(--gap,50%)}
.doors::after{right:var(--gap,50%)}

/* ---------- the bakery: what stands in front of the people ---------- */
.fore-table{clip-path:polygon(0% 100%,0% 49%,33.6% 49%,33.8% 42.6%,50.6% 42.8%,50.7% 56.7%,56.9% 57.1%,57.1% 52.7%,63.1% 52.7%,63.3% 57.7%,69.3% 58%,60% 100%)}
.fore-door{clip-path:polygon(69.2% 0%,72.4% 0%,72.4% 70.6%,69.2% 70.6%,69.2% 0%,88.1% 4%,100% 2%,100% 84%,88.3% 80.5%,88.1% 4%)}

@media (prefers-reduced-motion:reduce){ .ln-lines::before{animation:none;top:16%} }

/* ---------- a few words spoken in the picture: a paper speech bubble, its tail towards the speaker ---------- */
.speech{position:absolute;left:var(--x);top:var(--y);translate:-100% -100%;z-index:3;margin:0;padding:.5em 1.05em .55em;pointer-events:none;
  font:italic 500 clamp(1rem,1.45vw,1.32rem)/1.2 var(--f-display);letter-spacing:.01em;color:#3b2a1c;white-space:nowrap;
  background:linear-gradient(180deg,#fffaf0,#f4e8d2);border:1px solid rgba(185,138,60,.55);border-radius:1.3em;
  box-shadow:0 10px 26px rgba(40,24,10,.26),inset 0 0 0 3px rgba(255,250,240,.6);visibility:hidden;opacity:0}
.speech::after{content:"";position:absolute;right:16%;bottom:-7px;width:12px;height:12px;background:#f4e8d2;
  border-right:1px solid rgba(185,138,60,.55);border-bottom:1px solid rgba(185,138,60,.55);transform:rotate(45deg) skew(8deg,8deg)}

/* a bubble to the right of the speaker and a little above her: anchored at the middle of its left end, the tail coming
   out of that end and pointing down and back to her mouth (drawn, so it can point any way; sized in em with the words) */
.speech.is-right{translate:0 -50%}
.speech.is-right::after{left:-.84375em;top:calc(52% - .375em);right:auto;bottom:auto;width:1.0625em;height:1.125em;border:0;transform:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 18'%3E%3Cpath d='M17 1.6H14.2L.5 16.8 14.2 10.6H17Z' fill='%23f8efde'/%3E%3Cpath d='M14.2 1.6.5 16.8 14.2 10.6' fill='none' stroke='rgb(185,138,60)' stroke-opacity='.55' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat}
/* while someone's card is open the bubble steps aside (the scene's own fade sets opacity, so this uses a filter), and returns when it closes */
.speech{transition:filter .35s ease}
.stage.is-talking .speech{filter:opacity(0)}
/* phones: the castle's title stands a little higher than the others, clear of Sayuri's "Follow me." beneath it */
@media (max-width:760px){#avilon-castle .cap.headline[data-side]{top:40%}}
