/* ================= Werewolf (and its theme skins) =================
   A village under a sky that turns: night is deep blue with a rising moon, stars, fog, and glowing eyes in the dark;
   day is warm with a sun. Lantern tokens for the living, dimmed graves for the fallen, a story card that narrates. */
.wf { position: relative; flex: 1; margin: -1.5vh -3vw -2.5vh; padding: 1.5vh 3vw 2.5vh; min-height: 0; display: grid; overflow: hidden; overflow: clip; font-family: var(--display); --sky1: #0a0c2a; --sky2: #1a1750; }
.wf i, .wf b, .wf em { font-style: normal; }
.wf-sky { position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, var(--sky1), var(--sky2) 60%, #2a1f45); transition: background 2s; }
.wf.daylight .wf-sky { background: linear-gradient(180deg, #4a8bd8, #9ac7f0 55%, #f6d9a0); }
.wf-stars { position: absolute; inset: 0; opacity: 1; transition: opacity 2s;
    background: radial-gradient(circle, #fff 0 .15vh, transparent .3vh) 12vw 8vh / 37vw 23vh, radial-gradient(circle, #fff 0 .12vh, transparent .25vh) 5vw 20vh / 29vw 31vh, radial-gradient(circle, #fff 0 .18vh, transparent .3vh) 22vw 3vh / 41vw 19vh; }
.wf.daylight .wf-stars { opacity: 0; }
.wf-moon { position: absolute; right: 14vw; top: 9vh; width: 12vh; height: 12vh; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fffbe0, #e8dca8 60%, #c9bb85); box-shadow: 0 0 6vh 2vh rgba(255, 250, 220, .28); transition: transform 2.4s ease, opacity 2s; }
.wf.daylight .wf-moon { transform: translateY(40vh); opacity: 0; }
.wf-sun { position: absolute; left: 14vw; top: 8vh; width: 14vh; height: 14vh; border-radius: 50%; background: radial-gradient(circle, #fff6c4, #ffd166 60%, #ff9f3b); box-shadow: 0 0 8vh 3vh rgba(255, 210, 110, .5); transform: translateY(40vh); opacity: 0; transition: transform 2.4s ease, opacity 2s; }
.wf.daylight .wf-sun { transform: none; opacity: 1; }
.wf-fog { position: absolute; left: -20%; right: -20%; bottom: 8vh; height: 22vh; opacity: .55; pointer-events: none;
    background: radial-gradient(ellipse 30% 60% at 20% 60%, rgba(180, 190, 230, .35), transparent 70%), radial-gradient(ellipse 25% 60% at 60% 50%, rgba(180, 190, 230, .3), transparent 70%), radial-gradient(ellipse 30% 60% at 90% 65%, rgba(180, 190, 230, .32), transparent 70%);
    animation: wf-fog 22s ease-in-out infinite alternate; }
.wf.daylight .wf-fog { opacity: .18; }
@keyframes wf-fog { to { transform: translateX(8vw); } }
/* eyes in the dark, only while the foes are choosing */
.wf-eyes { position: absolute; left: 0; right: 0; bottom: 20vh; height: 8vh; pointer-events: none; }
.wf-eyes i { position: absolute; left: calc(8vw + var(--k) * 19vw); bottom: calc(var(--k) * 1.2vh); display: flex; gap: 1.6vh; opacity: 0; transition: opacity .8s; }
.wf-eyes b { width: 1.6vh; height: 1vh; border-radius: 50%; background: #ffd23a; box-shadow: 0 0 1.4vh #ffb400, 0 0 3vh #ff7a00; animation: wf-blink 4s ease-in-out infinite; animation-delay: calc(var(--k) * -1.1s); }
.wf.eyes .wf-eyes i { opacity: 1; }
@keyframes wf-blink { 0%, 44%, 52%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
/* the village */
.wf-ground { position: absolute; left: -4vw; right: -4vw; bottom: 0; height: 22vh; z-index: 1; border-radius: 50% 50% 0 0 / 30% 30% 0 0; background: linear-gradient(180deg, #1c2a12, #0d150a); transition: background 2s; }
.wf.daylight .wf-ground { background: linear-gradient(180deg, #5c8a34, #3a5c22); }
.wf-village { position: absolute; left: 0; right: 0; bottom: 14vh; z-index: 2; display: flex; justify-content: space-around; align-items: flex-end; padding: 0 3vw; pointer-events: none; }
.wf-cot { width: 11vh; transform: translateY(calc((var(--k) - 3) * (var(--k) - 3) * .6vh)); }
.wf-cot svg { display: block; width: 100%; height: auto; }
.wf-cot .rf { fill: #4a2c2a; } .wf-cot .wl { fill: #9d8464; } .wf-cot .dr { fill: #3a2a1a; } .wf-cot .ch { fill: #4a4a52; }
.wf-cot .wn { fill: #ffd27a; filter: drop-shadow(0 0 1vh rgba(255, 200, 100, .9)); animation: wf-window 3s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -.7s); }
.wf.daylight .wf-cot .wn { fill: #cfe8ff; filter: none; animation: none; }
.wf.daylight .wf-cot .wl { fill: #e6d3b0; } .wf.daylight .wf-cot .rf { fill: #a8493f; }
@keyframes wf-window { to { opacity: .55; } }

/* in the lobby the moon and sun keep clear of the sign and the QR panel, and the cottages stay out from under the panel */
.wf.is-wait .wf-moon { right: calc(3vw + 46vh + 4vw); top: 3vh; }
.wf.is-wait .wf-sun { left: 3vw; top: 3vh; }
.wf.is-wait .wf-village { right: calc(46vh + 5vw); }
/* in the game the moon and sun hang in the top bar, between the phase and the clock, clear of the player tokens */
.wf.is-play .wf-moon, .wf.is-play .wf-sun { top: .5vh; left: auto; right: calc(3vw + 11vh + 4vw); width: 10vh; height: 10vh; }

/* ---------- waiting ---------- */
.wf-wait { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2vw; align-items: start; min-height: 0; padding-top: 4vh; }
.wf-wait .wt-qr { z-index: 50; }
.wf-wmain { position: relative; z-index: 3; display: grid; justify-items: center; gap: 2.4vh; min-width: 0; }
.wf-sign { display: flex; align-items: center; justify-content: center; gap: 1.6vw; max-width: 100%; }
.wf-ico { font-size: 12vh; line-height: 1; filter: drop-shadow(0 1vh 2vh rgba(0, 0, 0, .6)); animation: wf-bob 2.6s ease-in-out infinite alternate; }
@keyframes wf-bob { to { transform: translateY(-1.4vh) rotate(-4deg); } }
.wf-sign b { min-width: 0; font-weight: 900; font-size: 11vh; line-height: 1; text-align: center; color: #fff; text-shadow: 0 .8vh 0 rgba(0, 0, 0, .5), 0 0 5vh rgba(140, 120, 255, .6); }
.wf-roster { max-width: 100%; text-align: center; line-height: 1.25; padding: 1vh 2.4vw; border-radius: 99px; font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 2.8vh; color: #e8e0ff; background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 .25vh rgba(255, 255, 255, .15); }
.wf-roster b { color: var(--gold); font-family: var(--display); font-size: 3.4vh; }
.wf-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1vh 1.2vw; width: min(100%, 100vh); }
.wf-how span { line-height: 1.25; padding: 1.2vh 1.4vw; border-radius: 1.6vh; font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 2.3vh; color: #fff; background: rgba(10, 8, 30, .7); box-shadow: inset 0 0 0 .2vh rgba(255, 255, 255, .12); }

/* ---------- playing ---------- */
.wf-play { position: relative; z-index: 3; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 1.2vh; min-height: 0; }
.wf-top, .wf-tokens, .wf-story, .wf-foot { position: relative; z-index: 3; }
.wf-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2vw; }
/* the marquee sign: room above and below the letters for the bulb rows, so the bulbs frame the title instead of crossing it */
.wf .wf-top .wg-title { max-width: 100%; min-width: 0; gap: 1vw; padding: 2.9vh 2vw 3vh 1.5vw; }
.wf .wf-top .wg-title span { flex: none; font-size: 4.6vh; line-height: 1; }
.wf .wf-top .wg-title b { min-width: 0; font-size: 4.4vh; line-height: 1; white-space: nowrap; }
.wf-phase { justify-self: center; max-width: 100%; text-align: center; line-height: 1.15; padding: 1vh 2.6vw; border-radius: 99px; font-weight: 900; font-size: 3.6vh; color: #fff; background: rgba(10, 8, 30, .75); box-shadow: 0 0 0 .3vh var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.wf-clock { display: grid; justify-items: center; width: 11vh; height: 11vh; align-content: center; border-radius: 50%; background: rgba(10, 8, 30, .8); box-shadow: 0 0 0 .4vh var(--gold); }
.wf-clock b { font-weight: 900; font-size: 5vh; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.wf-clock small { font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 1.5vh; color: var(--gold); }
.wf-clock.low { box-shadow: 0 0 0 .4vh var(--blood), 0 0 4vh var(--blood); animation: wf-tick .5s ease-in-out infinite alternate; }
@keyframes wf-tick { to { transform: scale(1.08); } }
.wf-tokens { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 1.2vh 1vw; padding: .5vh 4vw; min-height: 0; overflow: hidden; }
.wf-tok { position: relative; display: grid; justify-items: center; align-content: start; gap: .3vh; width: 18.5vh; padding: 1vh .4vw .8vh; border-radius: 1.6vh; background: rgba(10, 8, 30, .7); box-shadow: inset 0 0 0 .2vh rgba(255, 255, 255, .12); transition: filter .6s, opacity .6s; animation: wf-tokin .5s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--k) * .04s); }
@keyframes wf-tokin { from { transform: translateY(2vh) scale(.8); opacity: 0; } }
.wf-tok b { max-width: 100%; font-weight: 900; font-size: 2vh; line-height: 1.1; text-align: center; color: #fff; overflow-wrap: break-word; }
.wf-tok small { font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 1.5vh; color: #cfc4e8; text-align: center; line-height: 1.1; }
.wf-lamp { width: 3.4vh; height: 4.4vh; border-radius: .8vh .8vh 1.4vh 1.4vh; background: linear-gradient(180deg, #ffe08a, #ff9a2e); box-shadow: 0 0 2vh #ffb347, 0 0 4vh rgba(255, 160, 60, .55); animation: wf-lamp 2.2s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -.3s); }
@keyframes wf-lamp { to { box-shadow: 0 0 1vh #ffb347, 0 0 2vh rgba(255, 160, 60, .35); } }
.wf-tok.off { opacity: .55; filter: grayscale(.9); }
.wf-tok.off .wf-lamp { background: #3a3a4a; box-shadow: none; animation: none; }
.wf-tok.off::after { content: "✕"; position: absolute; right: .4vw; top: .3vh; font-size: 2vh; color: var(--blood); }
.wf-tok.foe { box-shadow: inset 0 0 0 .3vh var(--blood); opacity: .8; }
/* a big village: smaller tokens so every player still fits */
.wf-tokens.many { gap: 1vh .8vw; } .wf-tokens.many .wf-tok { width: 16vh; } .wf-tokens.many .wf-tok b { font-size: 1.75vh; } .wf-tokens.many .wf-lamp { width: 2.8vh; height: 3.6vh; }
.wf-tokens.lots .wf-tok { width: 14vh; padding: .7vh .3vw .6vh; } .wf-tokens.lots .wf-tok b { font-size: 1.55vh; } .wf-tokens.lots .wf-tok small { font-size: 1.3vh; } .wf-tokens.lots .wf-lamp { width: 2.4vh; height: 3vh; }
.wf-story { justify-self: center; display: grid; justify-items: center; gap: .6vh; width: min(100%, 120vh); padding: 2vh 3vw; border-radius: 2.4vh; text-align: center;
    background: linear-gradient(180deg, #0e0a22, #080512); box-shadow: 0 0 0 .4vh var(--gold), 0 2vh 6vh rgba(0, 0, 0, .6); }
.wf-story.on { animation: wf-storyin .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes wf-storyin { from { transform: translateY(3vh) scale(.94); opacity: 0; } }
.wf-story b { max-width: 100%; font-weight: 900; font-size: 6vh; line-height: 1.05; color: #fff; overflow-wrap: break-word; }
.wf-story span { font-family: var(--body, Inter), sans-serif; font-weight: 700; font-size: 2.8vh; color: #e8e0ff; line-height: 1.3; max-width: 100vh; }
.wf-story em { margin-top: .6vh; padding: .6vh 1.8vw; border-radius: 99px; font-weight: 900; font-size: 3.2vh; color: #1a1000; background: linear-gradient(180deg, #fff6c8, var(--gold)); animation: wf-rolein .6s cubic-bezier(.2, 1.7, .4, 1) .8s both; }
.wf-story em.foe { color: #fff; background: linear-gradient(180deg, #ff6b6b, var(--blood)); box-shadow: 0 0 4vh var(--blood); }
@keyframes wf-rolein { from { transform: scale(2.4) rotate(-6deg); opacity: 0; } }
.wf-story.night b, .wf-story.dawn b { text-shadow: 0 0 4vh rgba(140, 120, 255, .8); }
.wf-story .wf-sub { font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 2.3vh; line-height: 1.3; color: var(--gold); }
/* the counts sit centered under the story, clear of the sound button in the corner */
.wf-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 1vh 1.4vw; font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 2.3vh; line-height: 1.2; color: #e8e0ff; }
.wf-foot span { padding: .6vh 1.6vw; border-radius: 99px; background: rgba(8, 6, 22, .72); box-shadow: inset 0 0 0 .2vh rgba(255, 255, 255, .12); }
.wf-foot span[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .wf *, .wfp * { animation: none !important; } }

/* ================= phone ================= */
.wfp { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.wfp > * { min-width: 0; }
.wfp-head { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 900; font-size: 1.3rem; line-height: 1.1; }
.wfp-head .ic { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; font-size: 1.3rem; background: linear-gradient(180deg, #2a2360, #0d0a2a); }
.wfp-head small { display: block; font-family: var(--body, Inter), sans-serif; font-weight: 700; font-size: .8rem; color: var(--muted, #a7a2b0); }
.wfp-head > b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--gold); }
.wfp-big { font-family: var(--display); font-weight: 900; font-size: 1.6rem; margin-bottom: .3rem; }
.wfp-in { text-align: center; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ecto) 55%, transparent); } .wfp-out { text-align: center; }
/* the role card: face down until tapped */
.wfp-role { perspective: 900px; height: 11.5rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wfp-rin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); }
.wfp-role.open .wfp-rin { transform: rotateY(180deg); }
.wfp-rf, .wfp-rb { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: .3rem; padding: 1rem; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; }
.wfp-rf { background: repeating-linear-gradient(45deg, #2a2360 0 10px, #201a4c 10px 20px); box-shadow: inset 0 0 0 3px var(--gold); }
.wfp-rf b { font-family: var(--display); font-size: 1.4rem; } .wfp-rf span { font-size: .85rem; color: #cfc4e8; }
.wfp-rb { transform: rotateY(180deg); background: linear-gradient(180deg, #fffdf6, #efe6d2); color: #150c2c; box-shadow: inset 0 0 0 3px var(--gold); }
.wfp-rb small { font-weight: 800; color: #6b5a8a; } .wfp-rb b { font-family: var(--display); font-size: 1.8rem; line-height: 1; } .wfp-rb span { font-size: .85rem; line-height: 1.3; } .wfp-rb em { font-style: normal; font-weight: 800; font-size: .85rem; color: #7a1f1f; }
.wfp-role.wolf .wfp-rb { background: linear-gradient(180deg, #ffe5e5, #f5c7c7); box-shadow: inset 0 0 0 3px var(--blood); }
.wfp-turn { padding: .75rem .9rem; border-radius: 12px; font-weight: 900; text-align: center; background: var(--panel2, #24242b); }
.wfp-turn.go { color: #140a00; background: linear-gradient(180deg, #fff6c8, var(--gold)); }
.wfp-list { display: grid; gap: .45rem; }
.wfp-list button { min-height: 52px; padding: .6rem 1rem; border: 0; border-radius: 12px; font: inherit; font-weight: 800; font-size: 1.05rem; color: #fff; background: var(--panel2, #24242b); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08); cursor: pointer; text-align: left; }
.wfp-list button.on { background: color-mix(in srgb, var(--pumpkin) 28%, var(--panel2, #24242b)); box-shadow: inset 0 0 0 3px var(--pumpkin); }
.wfp-sleep { padding: 1.4rem 1rem; border-radius: 14px; text-align: center; font-weight: 800; color: #cfc4e8; background: linear-gradient(180deg, #0d0a2a, #060418); box-shadow: inset 0 0 0 2px #2a2360; }
.wfp-seen { padding: .8rem 1rem; border-radius: 12px; font-weight: 900; text-align: center; background: color-mix(in srgb, var(--ecto) 22%, #0b0b10); box-shadow: inset 0 0 0 2px var(--ecto); }
.wfp-seen.foe { background: color-mix(in srgb, var(--blood) 28%, #0b0b10); box-shadow: inset 0 0 0 2px var(--blood); }
.wfp-result { display: grid; justify-items: center; gap: .3rem; padding: 1.3rem 1rem; border-radius: 16px; text-align: center; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 30%, #1a1030), #0a0612); box-shadow: 0 0 0 3px var(--gold); }
.wfp-result.lost { background: linear-gradient(180deg, #2a1830, #0a0612); box-shadow: 0 0 0 3px #4a3a5a; }
.wfp-result span { color: var(--gold); font-weight: 800; }

/* the preshow: a role card dealing itself, lanterns, eyes */
.wf-demo { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2vw; }
.wf-dcard { display: grid; justify-items: center; gap: .4vh; width: 34vh; padding: 2vh 1.5vw; border-radius: 2vh; text-align: center; background: linear-gradient(180deg, #fffdf6, #efe6d2); color: #150c2c; box-shadow: 0 0 0 .4vh var(--gold), 0 2vh 5vh rgba(0, 0, 0, .6); transition: transform .35s; }
.wf-dcard.flip { transform: rotateY(90deg); }
.wf-dcard small { font-family: var(--body, Inter), sans-serif; font-weight: 800; font-size: 1.8vh; color: #6b5a8a; text-transform: uppercase; letter-spacing: .08em; }
.wf-dcard b { font-weight: 900; font-size: 4.6vh; line-height: 1; } .wf-dcard span { font-family: var(--body, Inter), sans-serif; font-weight: 700; font-size: 2vh; color: #4a3a6a; }
.wf-dcard.wolf { background: linear-gradient(180deg, #ffe5e5, #f5c7c7); box-shadow: 0 0 0 .4vh var(--blood), 0 0 6vh var(--blood); }
.wf-dtok { display: grid; grid-template-columns: repeat(3, auto); gap: 1.6vh; }
.wf-dtok .wf-lamp { width: 4.4vh; height: 5.6vh; transition: filter .6s, opacity .6s; }
.wf-dtok .wf-lamp.out { filter: grayscale(1) brightness(.4); opacity: .5; animation: none; box-shadow: none; }

.wf-cot.dark { filter: brightness(.35) saturate(.4); transition: filter 1.2s; }

/* readability pass (Oct 28): the small projector text one size up so it reads from the back of the room */
.wf-tok small { font-size: 1.9vh; }
.wf-tok b { font-size: 2.3vh; }
.wf-foot { font-size: 2.6vh; }
