/* Jeli landing, face-wall version (prefix .jw-). The wall is drawn on a canvas;
   the story is told in plain text over it, one scene at a time. */
@font-face {
    font-family: "Super Comic";
    src: url("../games/quiz/fonts/SuperComic.woff2") format("woff2"), url("../games/quiz/fonts/SuperComic.woff") format("woff");
    font-display: swap;
}
html, body.jw-body { background: #000; margin: 0; }
.jw {
    --jw-red: #e44d3a; --jw-green: #53d690; --jw-text: #333; --jw-muted: #5f6360; --jw-line: #e4e7e4;
    color: #fff; font-family: 'Source Sans Pro', sans-serif; font-size: 18px; line-height: 28px;
    -webkit-font-smoothing: antialiased; overflow-x: clip;
}
.jw *, .jw *::before, .jw *::after { box-sizing: border-box; }
.jw p, .jw h1, .jw h2 { margin: 0; }
.jw a { color: inherit; text-decoration: none; }
.jw img { display: block; max-width: 100%; }
.jw button { font-family: inherit; }
.jw [hidden] { display: none !important; }
.jw :focus-visible { outline: 3px solid var(--jw-green); outline-offset: 3px; }
.jw-sr { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

/* the stage */
.jw-stage { align-items: center; background: #000; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; outline: none; overflow: hidden; padding: 84px 20px 90px; position: relative; }
.jw-wall { display: none; height: 100%; left: 0; position: absolute; top: 0; transition: filter .9s ease; width: 100%; }
.jw-js .jw-wall { display: block; }
/* a pool of shade behind the words, so they read over any face */
.jw-veil { background: radial-gradient(ellipse 62% 46% at 50% 50%, rgba(0, 0, 0, .86), rgba(0, 0, 0, .6) 55%, rgba(0, 0, 0, .1) 100%); inset: 0; opacity: 0; pointer-events: none; position: absolute; transition: opacity .8s ease; }
.jw-stage.is-veiled .jw-veil { opacity: 1; }
.jw-stage.is-veiled.is-soft .jw-veil { opacity: .45; }
.jw-fire { background: radial-gradient(120% 55% at 50% 118%, rgba(228, 77, 58, .5), rgba(228, 77, 58, .1) 45%, transparent 70%); inset: 0; pointer-events: none; position: absolute; animation: jwFlicker 3.2s ease-in-out infinite alternate; }
@keyframes jwFlicker { 0% { opacity: .75; } 35% { opacity: 1; } 55% { opacity: .82; } 100% { opacity: .95; } }

.jw-bar { align-items: center; display: flex; justify-content: space-between; left: 0; padding: 18px 20px; position: absolute; right: 0; top: 0; z-index: 3; }
.jw-brand { color: rgba(255, 255, 255, .75) !important; font-size: 15px; font-weight: 700; letter-spacing: .4px; text-shadow: 0 1px 6px #000; }
.jw-mute { align-items: center; appearance: none; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; color: #fff; cursor: pointer; display: inline-flex; height: 40px; justify-content: center; padding: 0; width: 40px; }
.jw-mute .jw-mute__cross { display: none; }
.jw-mute[aria-pressed="true"] .jw-mute__waves { display: none; }
.jw-mute[aria-pressed="true"] .jw-mute__cross { display: inline; }

/* scenes: without the script they read top to bottom */
.jw-scene { margin: 0 auto 56px; max-width: 760px; position: relative; text-align: center; width: 100%; z-index: 2; }
.jw-js .jw-scene { display: none; margin: auto; outline: none; }
.jw-js .jw-scene.is-on { display: block; animation: jwIn .9s cubic-bezier(.2, .8, .2, 1) both; }
.jw-js .jw-scene.is-leaving { animation: jwOut .45s ease-in both; display: block; }
@keyframes jwIn { from { filter: blur(10px); opacity: 0; transform: scale(1.04); } }
@keyframes jwOut { to { filter: blur(10px); opacity: 0; transform: scale(.97); } }

.jw-title__mark { color: var(--jw-red); display: block; font-size: 72px; line-height: 1; margin-bottom: 14px; text-shadow: 0 0 30px rgba(228, 77, 58, .6); }
.jw-title { color: #fff; font-family: "Super Comic", 'Source Sans Pro', sans-serif; font-size: 116px; font-weight: normal; letter-spacing: 2px; line-height: 1; text-shadow: 6px 6px 0 var(--jw-red), 0 0 40px rgba(0, 0, 0, .9); }
.jw-title__sub { color: #fff; font-size: 22px; font-weight: 600; letter-spacing: .6px; margin-top: 14px !important; text-shadow: 0 2px 10px #000; }
.jw-begin, .jw-go {
    appearance: none; background: var(--jw-red); border: 0; border-radius: 12px; box-shadow: 0 8px 30px rgba(228, 77, 58, .45);
    color: #fff !important; cursor: pointer; display: inline-block; font-size: 21px; font-weight: 700; line-height: 1;
    margin-top: 40px; padding: 20px 46px; transition: transform .15s, background .15s;
}
.jw-begin:hover, .jw-go:hover { background: #cf3f2d; transform: translateY(-2px); }
.jw-title__note { color: rgba(255, 255, 255, .6); font-size: 15px; margin-top: 14px !important; }

.jw-line { color: #fff; font-size: 42px; font-weight: 700; letter-spacing: -.3px; line-height: 1.3; text-shadow: 0 2px 18px rgba(0, 0, 0, .9); }
.jw-line em { font-style: normal; }
.jw-g { color: var(--jw-green); }
.jw-r { color: var(--jw-red); }

/* the telling: each word comes out of a blur */
.jw-w { display: inline-block; }
.jw-js .is-telling .jw-w { filter: blur(8px); opacity: 0; transform: translateY(.2em); transition: opacity .5s, filter .6s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.jw-js .is-telling.is-told .jw-w { filter: none; opacity: 1; transform: none; }
/* "gone" drifts away like ash */
.jw-ash.is-blown .jw-w { animation: jwAsh 2.4s ease-in forwards; }
@keyframes jwAsh { to { filter: blur(6px); opacity: 0; transform: translate(40px, -50px) rotate(8deg); } }

.jw-tap { background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; bottom: 28px; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); color: #fff; font-size: 16px; font-weight: 700; left: 50%; letter-spacing: .4px; line-height: 1; opacity: 0; padding: 12px 22px; pointer-events: none; position: absolute; transform: translateX(-50%); transition: opacity .4s; white-space: nowrap; z-index: 2; }
.jw-tap::after { content: ' \203A'; color: var(--jw-green); font-size: 20px; }
.jw-js .jw-stage.can-tap { cursor: pointer; }
.jw-js .jw-stage.can-tap .jw-tap { animation: jwNudge2 1.6s ease-in-out infinite; opacity: 1; }
@keyframes jwNudge2 { 0%, 100% { transform: translateX(-50%); } 50% { transform: translateX(-50%) translateY(-5px); } }
html:not(.jw-js) .jw-tap, html:not(.jw-js) .jw-begin, html:not(.jw-js) .jw-title__note { display: none; }

/* the first story: the "?" tile from the wall sits above it */
.jw-slot { display: none; height: 150px; margin: 0 auto 22px; width: 150px; }
.jw-slot--small { height: 92px; margin-bottom: 20px; width: 92px; }
.jw-js .jw-slot { display: block; }
.jw-kicker { color: var(--jw-green); font-size: 15px; font-weight: 700; letter-spacing: 1.2px; margin-bottom: 16px !important; text-transform: uppercase; }
.jw-clue { color: #fff; font-size: 30px; font-weight: 700; line-height: 1.35; margin-bottom: 30px !important; text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }
.jw-mask { clip-path: inset(-.3em 0 -.45em 0); display: inline-block; position: relative; transition: width .45s cubic-bezier(.2, .8, .2, 1); vertical-align: bottom; white-space: nowrap; width: 4.6em; }
.jw-mask::after { background: #fff; border-radius: 4px; bottom: .12em; content: ''; left: 0; position: absolute; right: 0; top: .14em; transform-origin: right center; transition: transform .5s cubic-bezier(.7, 0, .3, 1); }
.jw-mask::before { animation: jwShimmer 1.8s ease-in-out infinite; background: linear-gradient(100deg, transparent 15%, rgba(228, 77, 58, .5) 50%, transparent 85%); bottom: .12em; content: ''; left: 0; position: absolute; right: 0; top: .14em; transform: translateX(-100%); z-index: 1; }
.jw-mask__name { color: var(--jw-green); display: inline-block; opacity: 0; transform: translateY(.4em); transition: opacity .35s .2s, transform .45s .2s cubic-bezier(.2, .8, .2, 1); }
.jw-mask.is-lifted::after { transform: scaleX(0); }
.jw-mask.is-lifted::before { animation: none; opacity: 0; }
.jw-mask.is-lifted .jw-mask__name { opacity: 1; transform: none; }
@keyframes jwShimmer { 60%, 100% { transform: translateX(100%); } }

.jw-options { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 0 auto; max-width: 620px; }
.jw-option {
    appearance: none; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 2px solid rgba(255, 255, 255, .4); border-radius: 12px; color: #fff; cursor: pointer;
    font-size: 19px; font-weight: 700; line-height: 1.2; min-height: 62px; padding: 12px 14px;
    transition: border-color .2s, background .2s, opacity .3s, transform .5s cubic-bezier(.2, .9, .3, 1.2);
}
.jw-option:hover:enabled { background: rgba(255, 255, 255, .14); border-color: #fff; }
.jw-option:disabled { cursor: default; opacity: .35; }
.jw-option.is-right { animation: jwPop .45s cubic-bezier(.3, 1.6, .5, 1); background: var(--jw-green); border-color: var(--jw-green); color: #000; opacity: 1; }
.jw-option.is-wrong { animation: jwNudge .4s ease-in-out; border-color: var(--jw-red); color: var(--jw-red); opacity: 1; }
.jw-js .jw-scene--clue:not(.is-ready) .jw-option { opacity: 0; transform: translateY(26px) scale(.96); }
.jw-option:nth-child(2) { transition-delay: .08s; } .jw-option:nth-child(3) { transition-delay: .16s; } .jw-option:nth-child(4) { transition-delay: .24s; }
.jw-scene--clue.is-answered .jw-option { transition-delay: 0s; }
@keyframes jwPop { 40% { transform: scale(1.06); } }
@keyframes jwNudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.jw-burst { color: var(--jw-green); font-size: 24px; left: 0; line-height: 1; pointer-events: none; position: absolute; top: 0; z-index: 4; }
.jw-burst:nth-child(even) { color: #fff; }

/* the reveal: the face is drawn on the wall; the img is for readers without the script */
.jw-face { border-radius: 50%; height: 150px; margin: 0 auto 22px; object-fit: cover; width: 150px; }
.jw-js .jw-face { display: none; }
.jw-verdict { color: #fff; font-size: 34px; font-weight: 900; line-height: 1.2; margin-bottom: 16px !important; text-shadow: 0 2px 14px #000; }
.jw-story { color: #fff; font-size: 20px; line-height: 1.55; margin: 0 auto !important; max-width: 640px; text-shadow: 0 1px 10px #000; }

/* the door */
.jw-door__lead { color: #fff; font-size: 32px; font-weight: 700; line-height: 1.3; text-shadow: 0 2px 14px #000; }
.jw-scene--door .jw-go { margin-top: 30px; }
.jw-count { margin: 28px auto 0; }
.jw-count__tiles { display: grid; gap: 10px; grid-template-columns: repeat(4, 88px); justify-content: center; perspective: 600px; }
.jw-count__tile { --jw-flap: 46px; background: var(--jw-green); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); padding: 8px 6px 10px; text-align: center; }
.jw-count__tile b { color: #000; display: block; font-size: 34px; font-weight: 900; line-height: var(--jw-flap); font-variant-numeric: tabular-nums; }
.jw-count__tile > span { color: #000; display: block; font-size: 12px; font-weight: 700; letter-spacing: .4px; line-height: 1; margin-top: 5px; text-transform: uppercase; }
.jw-count .jw-count__play { margin-top: 0; }

/* split-flap digits, like a railway departure board */
.jw-flip { height: var(--jw-flap); perspective: 220px; position: relative; }
.jw-flip::after { background: rgba(0, 0, 0, .22); content: ''; height: 1px; left: 0; position: absolute; right: 0; top: 50%; z-index: 2; }
.jw-flip__half { background: var(--jw-green); height: 50%; left: 0; overflow: hidden; position: absolute; right: 0; }
.jw-flip__half > span { display: block; height: var(--jw-flap); line-height: var(--jw-flap); }
.jw-flip__top { border-radius: 6px 6px 0 0; top: 0; transform-origin: 50% 100%; }
.jw-flip__bottom { border-radius: 0 0 6px 6px; bottom: 0; transform-origin: 50% 0; }
.jw-flip__bottom > span { transform: translateY(-50%); }
.jw-flip__leaf { backface-visibility: hidden; z-index: 1; }
.jw-flip__leaf.jw-flip__top { background: linear-gradient(to bottom, var(--jw-green) 60%, #48c381); }

.jw-notify { display: flex; gap: 10px; margin: 30px auto 0; max-width: 520px; }
.jw-notify label { clip: rect(0 0 0 0); height: 1px; overflow: hidden; position: absolute; width: 1px; }
.jw-notify input { background: #fff; border: 0; border-radius: 12px; color: #000; flex: 1; font: 18px 'Source Sans Pro', sans-serif; height: 58px; margin: 0; min-width: 0; padding: 0 16px; }
.jw-notify button { background: var(--jw-red); border: 0; border-radius: 12px; color: #fff; cursor: pointer; font-size: 18px; font-weight: 700; height: 58px; padding: 0 22px; }
.jw-notify button:disabled { cursor: default; opacity: .7; }
.jw-notify__status { color: #fff; font-weight: 700; margin-top: 14px !important; min-height: 28px; text-shadow: 0 1px 8px #000; }
.jw-again { appearance: none; background: none; border: 0; color: rgba(255, 255, 255, .7); cursor: pointer; font-size: 15px; font-weight: 600; margin-top: 30px; padding: 8px; text-decoration: underline; text-shadow: 0 1px 6px #000; text-underline-offset: 3px; }
.jw-again:hover { color: #fff; }

/* below the stage */
.jw-more { background: #fff; color: var(--jw-text); padding: 64px 20px 40px; }
.jw-faq { margin: 0 auto; max-width: 760px; }
.jw-faq h2 { color: #000; font-size: 32px; font-weight: 900; line-height: 1.2; margin-bottom: 22px; }
.jw-faq details { border: 1px solid var(--jw-line); border-radius: 12px; margin-bottom: 10px; }
.jw-faq summary { color: #000; cursor: pointer; font-weight: 700; list-style-position: inside; padding: 15px 18px; }
.jw-faq details p { padding: 0 18px 16px; }
.jw-foot { color: var(--jw-muted); font-size: 15px; margin: 40px auto 0 !important; max-width: 760px; }
.jw-foot a { color: var(--jw-red) !important; font-weight: 700; }

@media (max-width: 600px) {
    .jw-stage { padding: 76px 18px 84px; }
    .jw-title { font-size: 86px; }
    .jw-title__mark { font-size: 58px; }
    .jw-title__sub { font-size: 19px; }
    .jw-line { font-size: 31px; }
    .jw-clue { font-size: 22px; margin-bottom: 24px !important; }
    .jw-slot { height: 120px; width: 120px; }
    .jw-slot--small { height: 72px; margin-bottom: 14px; width: 72px; }
    .jw-options { gap: 10px; }
    .jw-option { font-size: 17px; min-height: 58px; }
    .jw-verdict { font-size: 27px; }
    .jw-story { font-size: 18px; }
    .jw-door__lead { font-size: 26px; }
    .jw-count__tiles { gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .jw-count__tile { --jw-flap: 40px; }
    .jw-count__tile b { font-size: 28px; }
    .jw-count__tile > span { font-size: 10px; }
    .jw-notify { flex-direction: column; }
    .jw-notify input { flex: none; }
    .jw-begin, .jw-go { display: block; width: 100%; }
    .jw-faq h2 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
    .jw-fire { animation: none; }
    .jw-js .jw-scene.is-on, .jw-js .jw-scene.is-leaving { animation: none; }
    .jw-js .is-telling .jw-w, .jw-option, .jw-wall, .jw-veil { transition: none; }
    .jw-mask, .jw-mask::after, .jw-mask__name { transition: none; }
    .jw-mask::before, .jw-option.is-right, .jw-option.is-wrong, .jw-js .jw-stage.can-tap .jw-tap, .jw-ash.is-blown .jw-w { animation: none; }
}
