/* Lichtige Chanukah — The Chanukah Story (animated storybook) */

/* ---------- home banner ---------- */
.tale-banner{position:relative;display:flex;align-items:center;gap:14px;margin:6px 0 22px;padding:14px 16px;border-radius:24px;text-decoration:none;color:var(--text);overflow:hidden;
  background:radial-gradient(120% 140% at 0% 0%,rgba(255,215,120,.28),transparent 55%),linear-gradient(120deg,#1a3a8f 0%,#13296a 55%,#0d1d4d 100%);
  border:1.5px solid rgba(245,201,92,.7);box-shadow:0 10px 30px rgba(0,0,0,.35),inset 0 0 0 1px rgba(255,240,190,.08)}
.tale-banner::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(255,240,190,.16) 45%,transparent 60%);transform:translateX(-100%);animation:tb-shine 5.5s ease-in-out 1.5s infinite;pointer-events:none}
@keyframes tb-shine{0%{transform:translateX(-100%)}35%,100%{transform:translateX(100%)}}
.tb-art{width:84px;height:63px;flex:none;border-radius:16px;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,.35)}
.tb-art svg{width:100%;height:100%;display:block}
.tb-text{flex:1;display:flex;flex-direction:column;min-width:0}
.tb-kicker{font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#ffe39a}
.tb-text strong{font-family:var(--serif);font-size:1.24rem;line-height:1.15;color:var(--gold);margin:2px 0}
.tb-sub{font-size:.88rem;color:var(--muted);line-height:1.3}
.tb-play{width:42px;height:42px;flex:none;border-radius:50%;display:grid;place-items:center;background:linear-gradient(180deg,#ffe39a,#e0a93a);color:#3a2606;box-shadow:0 4px 14px rgba(245,201,92,.45)}
.tb-play svg{width:20px;height:20px;margin-left:3px}
.tale-banner:active{transform:scale(.99)}
@media (min-width:700px){ .tale-banner{padding:18px 22px;gap:20px} .tb-art{width:132px;height:99px} .tb-text strong{font-size:1.7rem} .tb-sub{font-size:1rem} .tb-play{width:58px;height:58px} }

/* ---------- the player ---------- */
.tale-screen .tale-h1{margin-bottom:10px}
.tale{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:780px;margin:0 auto}
.tale-frame{position:relative;width:min(100%,760px,calc((100vh - 350px) * 4 / 3));width:min(100%,760px,calc((100dvh - 350px) * 4 / 3));min-width:min(100%,300px);aspect-ratio:4/3;border-radius:22px;overflow:hidden;
  background:#0a1633;border:1.5px solid rgba(245,201,92,.45);box-shadow:0 14px 40px rgba(0,0,0,.45)}
.tale-stage{position:absolute;inset:0;touch-action:pan-y;-webkit-user-select:none;user-select:none}
.tale-stage .tl-scene{position:absolute;inset:0;width:100%;height:100%;display:block}
.tl-defs{position:absolute;width:0;height:0;overflow:hidden}
.tale-cover:not([hidden])~.tale-count{display:none}
.tale-count{position:absolute;top:10px;right:12px;font-size:.78rem;font-weight:600;color:#fff3c4;background:rgba(6,16,42,.55);padding:3px 9px;border-radius:999px;pointer-events:none}
.tale-cover{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:16px;text-align:center;
  background:radial-gradient(90% 80% at 50% 48%,rgba(6,16,42,.62),rgba(6,16,42,.86))}
.tale-cover-kicker{margin:0;font-family:var(--serif);font-size:1.1rem;color:#ffe39a}
.tale-cover-title{margin:0;font-family:var(--serif);font-weight:800;font-size:clamp(1.7rem,6vw,2.8rem);line-height:1.05;color:var(--gold);text-shadow:0 2px 14px rgba(0,0,0,.6)}
.tale-cover-sub{margin:0 0 8px;color:var(--cream);font-size:.95rem;text-shadow:0 1px 8px rgba(0,0,0,.6)}
.tale-watch{display:inline-flex;align-items:center;gap:10px}
.tale-watch svg{width:20px;height:20px}
.tale-self{background:none;border:0;color:#fff3c4;text-decoration:underline;text-underline-offset:3px;font-size:.95rem;padding:8px 10px;min-height:44px}
.tale-cap{width:min(100%,760px);min-height:6.4em;text-align:center;padding:2px 6px}
.tale-text{margin:0;font-family:var(--serif);font-size:clamp(1.12rem,2.9vw,1.42rem);line-height:1.38;color:var(--cream)}
.tale-heb{margin:6px 0 0;font-family:var(--serif);font-size:clamp(1.15rem,3vw,1.5rem);color:var(--gold);direction:rtl}
.tale-cap.in{animation:tale-cap .7s ease both}
@keyframes tale-cap{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.tale-dots{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;max-width:100%}
.tale-dot{position:relative;width:22px;height:22px;padding:0;border:0;background:none;display:grid;place-items:center}
.tale-dot i{display:block;width:10px;height:10px;border-radius:999px;background:rgba(255,231,160,.25);border:1px solid rgba(255,231,160,.5);position:relative;overflow:hidden;transition:width .3s}
.tale-dot.done i{background:var(--gold-2);border-color:var(--gold-2)}
.tale-dot.on i{width:22px;background:rgba(255,231,160,.3);border-color:var(--gold)}
.tale-dot.on i::after{content:"";position:absolute;inset:0;background:var(--gold);transform-origin:0 50%}
.tale-dot.on.run i::after{animation:tale-dot var(--dur,7s) linear both}
@keyframes tale-dot{from{transform:scaleX(0)}to{transform:scaleX(1)}}
.tale-ctrl{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;width:min(100%,560px)}
.tale-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:58px;padding:0 18px;border-radius:999px;font-weight:700;font-size:1.08rem;border:1.5px solid rgba(245,201,92,.55);background:rgba(23,53,127,.7);color:var(--cream)}
.tale-btn svg{width:22px;height:22px;flex:none}
.tale-btn:disabled{opacity:.38;cursor:default}
.tale-next{background:linear-gradient(180deg,#ffe39a,#e9b949 55%,#d39a2c);color:#2b1c04;border-color:#ffe7a0;box-shadow:0 6px 18px rgba(245,201,92,.35)}
.tale-next .ic-replay{display:none}.tale-next.is-replay .ic-next{display:none}.tale-next.is-replay .ic-replay{display:block}
.tale-auto{display:inline-flex;flex-direction:column;align-items:center;gap:2px;min-width:70px;min-height:58px;padding:6px 8px;border-radius:16px;border:1.5px solid rgba(245,201,92,.35);background:rgba(6,16,42,.5);color:#fff3c4;font-size:.74rem;font-weight:600}
.tale-auto svg{width:22px;height:22px}
.tale-auto .ta-pause{display:none}.tale-auto.on .ta-play{display:none}.tale-auto.on .ta-pause{display:block}
.tale-auto.on{background:rgba(245,201,92,.18);border-color:var(--gold)}
.tale-end{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.tale-link{display:inline-flex;align-items:center;min-height:46px;padding:0 16px;border-radius:999px;color:var(--gold);text-decoration:none;border:1px solid rgba(245,201,92,.45);background:rgba(6,16,42,.4);font-weight:600}

/* ---------- scene motion ---------- */
.tl-t{font-family:var(--serif)}
.tl-enter{animation:tl-in .6s ease both}
.tl-leave{animation:tl-out .6s ease both}
@keyframes tl-in{from{opacity:0}to{opacity:1}}
@keyframes tl-out{from{opacity:1}to{opacity:0}}
.tl-in{animation:tl-in var(--t,1s) ease var(--d,0s) both}
.tl-out{opacity:0;animation:tl-out var(--t,1s) ease var(--d,0s) both}
@keyframes tl-tw{0%,100%{opacity:.25}50%{opacity:1}}
.tl-tw{animation:tl-tw 3s ease-in-out var(--d,0s) infinite}
@keyframes tl-fl{0%,100%{transform:scale(1,1)}30%{transform:scale(.93,1.07)}65%{transform:scale(1.05,.95)}}
.tl-fl{transform-box:fill-box;transform-origin:50% 100%;animation:tl-fl .95s ease-in-out var(--d,0s) infinite}
@keyframes tl-rise{from{opacity:0;transform:translateY(var(--y,24px))}to{opacity:1;transform:none}}
.tl-rise{animation:tl-rise var(--t,1.1s) ease-out var(--d,0s) both}
@keyframes tl-slide{from{transform:translateX(var(--x,-200px))}to{transform:none}}
.tl-slide{animation:tl-slide var(--t,3s) var(--e,ease-out) var(--d,0s) both}
@keyframes tl-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2.5px)}}
.tl-bob{animation:tl-bob .55s ease-in-out var(--d,0s) infinite}
@keyframes tl-pulse{0%,100%{opacity:.6}50%{opacity:1}}
.tl-pulse{animation:tl-pulse 2.6s ease-in-out infinite}
@keyframes tl-drift{from{transform:translateX(-30px)}to{transform:translateX(40px)}}
.tl-drift{animation:tl-drift 14s ease-in-out infinite alternate}
@keyframes tl-pop{0%{opacity:0;transform:scale(.2)}65%{opacity:1;transform:scale(1.14)}100%{opacity:1;transform:scale(1)}}
.tl-pop{transform-box:fill-box;transform-origin:50% 50%;animation:tl-pop var(--t,.7s) ease-out var(--d,0s) both}
@keyframes tl-flee{from{opacity:1;transform:none}to{opacity:0;transform:translateX(var(--x,220px))}}
.tl-flee{opacity:0;animation:tl-flee var(--t,2.4s) ease-in var(--d,2s) both}
@keyframes tl-turn{from{transform:scaleX(1)}to{transform:scaleX(-1)}}
.tl-turn{transform:scaleX(-1);animation:tl-turn .3s ease var(--d,0s) both}
@keyframes tl-sweep{0%{opacity:0;transform:none}15%,80%{opacity:1}100%{opacity:0;transform:translateX(var(--x,560px))}}
.tl-sweep{opacity:0;animation:tl-sweep var(--t,2.8s) ease-in-out var(--d,0s) both}
@keyframes tl-flyoff{0%{opacity:1;transform:none}100%{opacity:0;transform:translate(10px,-34px) rotate(50deg)}}
.tl-flyoff{opacity:0;transform-box:fill-box;transform-origin:50% 50%;animation:tl-flyoff .9s ease-in var(--d,0s) both}
@keyframes tl-broom{from{transform:rotate(-22deg)}to{transform:rotate(16deg)}}
.tl-broom{animation:tl-broom .7s ease-in-out infinite alternate}
@keyframes tl-search{0%{transform:translate(50px,110px)}22%{transform:translate(210px,96px)}44%{transform:translate(120px,196px)}66%{transform:translate(250px,170px)}84%,100%{transform:translate(306px,240px)}}
.tl-search{transform:translate(306px,240px);animation:tl-search 4.6s ease-in-out both}
@keyframes tl-spin{to{transform:rotate(360deg)}}
.tl-spin{animation:tl-spin 40s linear infinite}
@keyframes tl-dn{0%,100%{fill:#0d1d4a}50%{fill:#9cc6ff}}
.tl-dn{animation:tl-dn .7s ease-in-out .25s 8}
@keyframes tl-blink{0%{opacity:0}8%,92%{opacity:1}100%{opacity:0}}
.tl-num{opacity:0;animation:tl-blink var(--w,.7s) linear var(--d,0s) 1}
@keyframes tl-snow{from{transform:translateY(0)}to{transform:translateY(310px)}}
.tl-snow{animation:tl-snow var(--t,6s) linear var(--d,0s) infinite}
@keyframes tl-face{0%,12.5%{opacity:1}12.6%,87.4%{opacity:0}87.5%,100%{opacity:1}}
.tl-face{opacity:0;animation:tl-face 2.4s linear var(--d,0s) infinite}
@keyframes tl-dspin{0%,100%{transform:scaleX(1)}50%{transform:scaleX(.3)}}
.tl-dspin{animation:tl-dspin .6s ease-in-out -.3s infinite}
@keyframes tl-wob{0%,100%{transform:rotate(-6deg)}50%{transform:rotate(6deg)}}
.tl-wob{transform-origin:0 72px;animation:tl-wob 1.2s ease-in-out infinite}
@keyframes tl-burst{0%{opacity:0;transform:translate(0,0) rotate(0)}10%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(320deg)}}
.tl-burst{opacity:0;animation:tl-burst 2.2s ease-out var(--d,0s) infinite}

@media (prefers-reduced-motion:reduce){
  .tale-banner::after{animation:none;display:none}
  .tale-stage .tl-scene *{animation:none!important}
  .tale-stage .tl-scene .tl-in,.tale-stage .tl-scene .tl-rise,.tale-stage .tl-scene .tl-pop{animation:tl-in 1.1s ease var(--d,0s) both!important}
  .tale-stage .tl-scene .tl-flee,.tale-stage .tl-scene .tl-out,.tale-stage .tl-scene .tl-flyoff{animation:tl-out 1.1s ease var(--d,0s) both!important}
  .tale-stage .tl-scene .tl-face:first-of-type{opacity:1}
  .tale-cap.in{animation:tl-in .6s ease both}
  .tale-dot.on.run i::after{animation:none;transform:scaleX(1);opacity:.5}
}

/* ---------- video export layout (used only when recording the MP4) ---------- */
body.tale-capture .topbar,body.tale-capture .tale-ctrl,body.tale-capture .tale-end,body.tale-capture .tale-cover,body.tale-capture .tale-count,body.tale-capture .skip,body.tale-capture .tablet-note{display:none!important}
body.tale-capture main{padding:0!important}
body.tale-capture .tale-screen{min-height:100vh;display:flex;flex-direction:column;justify-content:center;padding:0 0 28px!important;margin:0!important}
body.tale-capture .tale-h1{font-size:1.9rem!important;margin:0 0 18px!important;text-align:center}
body.tale-capture .tale-frame{width:100%!important;border-radius:0;border-left:0;border-right:0}
body.tale-capture .tale-cap{min-height:9.5em;padding:14px 18px 0}
body.tale-capture .tale-text{font-size:1.32rem}
body.tale-capture .tale-heb{font-size:1.5rem}
body.tale-capture .tale-dot.on i::after{animation:none;transform:scaleX(1)}
