/* Feel and juice: layered background, fox, suspense, power-up, letters of the finale and effect layers. Only picture files; the CSS moves and fades them. */

/* ---- layered background (the darkening stays in here: it never covers the game) */
.bg {
  position: absolute;
  inset: calc(var(--u) * -3);
  overflow: hidden;
}
.bg img,
.bg canvas {
  position: absolute;
}
#bg-city,
#bg-stage {
  inset: calc(var(--u) * 3);
  width: calc(100% - var(--u) * 6);
  height: calc(100% - var(--u) * 6);
  object-fit: cover;
  object-position: 50% 60%;
  transform: scale(1.035);
}
#bgfx,
#bgfx2 {
  left: calc(var(--u) * 3);
  width: calc(100% - var(--u) * 6);
  pointer-events: none;
}
#wheel {
  margin: calc(var(--u) * 3);
  animation: turn 60s steps(600) infinite;
} /* steps of 0.6 degree: continuous, it rebuilt all the layers above on Safari */
@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}
.beam {
  top: calc(var(--u) * -10);
  height: 118%;
  width: calc(var(--u) * 38);
  margin-left: calc(var(--u) * -19);
  transform-origin: 50% 0;
  opacity: 0;
  pointer-events: none;
}
#dim {
  position: absolute;
  inset: 0;
  background: #06031f;
  opacity: 0;
  transition: opacity 0.9s;
  pointer-events: none;
}
.reduced #wheel,
[data-lite] #wheel {
  animation: none;
}

/* ---- layers outside #app */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}
#fxd {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}
#curtain {
  position: fixed;
  inset: 0;
  z-index: 20;
  visibility: hidden;
  overflow: hidden;
}
#curtain i {
  position: absolute;
  top: -2%;
  bottom: -3%;
  width: 52%;
  background: url(../../assets/stage/curtain.webp) 0 100% / 100% 100% no-repeat;
  will-change: transform;
}
#curtain i:first-child {
  left: 0;
  transform: translateX(-103%);
  transform-origin: 0 0;
}
#curtain i:last-child {
  right: 0;
  transform: translateX(103%) scaleX(-1);
  transform-origin: 50% 0;
}

/* ---- logo hanging on chains */
.logo canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.chain {
  position: absolute;
  z-index: -1;
  bottom: 90%;
  width: calc(var(--u) * 2.2);
  height: 60vh;
  background: url(../../assets/ui/chain.webp) 50% 100% / 100% auto repeat-y;
}
.chain:nth-child(1) {
  left: 14%;
}
.chain:nth-child(2) {
  right: 14%;
}

/* ---- fox: grows from the feet; one own loop per pose; the shadow stays on the floor */
.fox {
  aspect-ratio: 1054 / 1250;
  pointer-events: none;
}
.fbody {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform-origin: 50% 99%;
  animation: fox-idle 3.2s ease-in-out infinite;
}
.fox:is([data-pose='hype'], [data-pose='cheer'], [data-pose='toss']) .seq {
  display: none;
}
.fbody canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* only the middle of the body receives touch (the open arms do not steal the touch from the card) */
.fbody::after {
  content: '';
  position: absolute;
  inset: 2% 34% 2% 34%;
  pointer-events: auto;
  cursor: pointer;
}
.fshade {
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: -1.5%;
  height: 5%;
  background: url(../../assets/fx/orb.webp) center / 100% 100% no-repeat;
  filter: brightness(0);
  opacity: 0.5;
}
@keyframes fox-idle {
  50% {
    scale: 1.012 1.026;
  }
}
@keyframes fox-talk {
  0%,
  100% {
    rotate: -0.5deg;
    scale: 1 1;
  }
  50% {
    rotate: 0.6deg;
    scale: 1.008 1.02;
  }
}
@keyframes fox-hype {
  0%,
  100% {
    rotate: -1.1deg;
    scale: 1.01 1.02;
  }
  50% {
    rotate: 1.1deg;
    scale: 1.025 1;
  }
}
@keyframes fox-cheer {
  0%,
  100% {
    translate: 0 0;
    scale: 1.03 0.97;
  }
  18% {
    translate: 0 0;
    scale: 0.98 1.04;
  }
  50% {
    translate: 0 -4.5%;
    scale: 0.99 1.03;
  }
  82% {
    translate: 0 0;
    scale: 1.04 0.96;
  }
}
@keyframes fox-soft {
  50% {
    scale: 1.01 1.018;
    rotate: 0.6deg;
  }
}
.fox[data-pose='talk'] .fbody {
  animation: fox-talk 1.1s ease-in-out infinite;
}
.fox[data-pose='hype'] .fbody {
  animation: fox-hype 0.42s ease-in-out infinite;
}
.fox[data-pose='cheer'] .fbody,
.fox[data-pose='toss'] .fbody {
  animation: fox-cheer 0.62s ease-in-out infinite;
}
.fox:is(
    [data-pose='shrug'],
    [data-pose='gasp'],
    [data-pose='point'],
    [data-pose='bow'],
    [data-pose='tie'],
    [data-pose='tap'],
    [data-pose='wink']
  )
  .fbody {
  animation: fox-soft 1.6s ease-in-out infinite;
}
.reduced .fbody,
.reduced .fox[data-pose] .fbody {
  animation: none;
}
canvas.globe {
  pointer-events: auto;
  cursor: grab;
  transform-origin: 50% 98%;
  touch-action: none;
}
.land #g-side {
  pointer-events: none;
}

/* ---- tray: the hole the ball comes out of when the globe is not on screen (the animation is in fx/hole.js) */
#hole {
  display: none;
  position: relative;
  flex: none;
  width: calc(var(--u) * 16);
  aspect-ratio: 1;
  background: url(../../assets/fx/hole.webp) center / contain no-repeat;
}
#hole i {
  position: absolute;
  inset: -24%;
  background: url(../../assets/fx/glow.webp) center / 100% 100% no-repeat;
  opacity: 0;
}
#app:not(.one) #hole,
.port:not(.tall) #hole {
  display: block;
}
/* with the hole, the five balls have to fit in the tray */
.port:not(.tall) #tray,
.port:not(.one) #tray {
  --pb: calc(var(--u) * 10.8);
  gap: calc(var(--u) * 1.8);
}
.port:not(.tall) #prev,
.port:not(.one) #prev {
  gap: calc(var(--u) * 1.2);
  min-width: calc(var(--pb) * 4 + var(--u) * 3.6);
}
.land:not(.one) #tray {
  width: calc(var(--u) * 88);
}
.land #hole {
  width: calc(var(--u) * 12.6);
}
#ball,
#prev .ball {
  will-change: transform;
}
#tray {
  position: relative;
  cursor: pointer;
}
#tray:focus {
  outline: none;
}
#tray:focus-visible {
  outline: calc(var(--u) * 0.5) solid #fff9;
  outline-offset: calc(var(--u) * 0.4);
}
#tray > * {
  pointer-events: none;
}
#pull {
  position: absolute;
  right: calc(var(--u) * 2);
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--u) * 27);
  text-align: center;
  text-wrap: balance;
  font-size: calc(var(--u) * 3.2);
  line-height: 1.1;
  color: #ffe9a8;
  opacity: 0;
  transition: opacity 0.3s;
}
#tray[data-hint] #pull {
  opacity: 1;
}
#count i {
  display: inline-block;
  font-style: normal;
  transform-origin: 50% 50%;
}
#count[data-last] {
  color: #fff1b0;
  text-shadow: 0 0 0.3em #ffc93c;
}

/* ---- lamps around the card and the button */
.lamps {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
.card {
  position: relative;
}

/* the BINGO button really sinks, like a game-show button */
#b-bingo:active {
  transform: translateY(6px) scale(0.985);
}

/* ---- suspense: a ring that breathes in light (without changing size). ::after only changes the opacity */
.cell::after {
  content: '';
  position: absolute;
  inset: -3%;
  background: url(../../assets/ui/ring.webp) center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.cell[data-need]::after {
  inset: -14%;
  background:
    url(../../assets/ui/ring.webp) center / 82% 82% no-repeat,
    url(../../assets/fx/glow.webp) center / 100% 100% no-repeat;
  opacity: 1;
  animation: breathe-light 1.8s ease-in-out infinite;
  animation-delay: var(--sync, 0ms);
}
.cell[data-need] {
  background: #ffefb0;
  box-shadow: inset 0 0 0 calc(var(--c) * 0.065) #ffae12;
}
.cell[data-late]:not([data-need])::after {
  animation: breathe-late 2.8s ease-in-out infinite;
}
@keyframes breathe-light {
  0%,
  100% {
    opacity: 0.95;
  }
  50% {
    opacity: 0.25;
  }
}
.cell[data-need] span {
  z-index: 1;
}
@keyframes breathe-late {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
}
.reduced .cell[data-need]::after,
[data-lite] .cell[data-need]::after {
  animation: none;
  opacity: 1;
}
[data-lite] .seq {
  display: none;
}
[data-lite] .cell[data-late]:not([data-need])::after {
  animation: none;
  opacity: 0.35;
}
.reduced .cell[data-late]::after {
  animation: none;
  opacity: 0.35;
}

/* ---- rivals: three stacked faces, only the opacity changes */
.face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.16s;
}
.face {
  transform-origin: 90% 50%;
}
[data-mood='calm'] .face img:nth-child(1),
[data-mood='hot'] .face img:nth-child(2),
[data-mood='win'] .face img:nth-child(3) {
  opacity: 1;
}
.rival {
  position: relative;
}
.rival[data-mood='hot'] u b,
.rival[data-mood='win'] u b {
  background: var(--gold);
}
.rival[data-mood='hot'] .face::before,
.rival[data-mood='win'] .face::before {
  content: '';
  position: absolute;
  inset: -28%;
  background: url(../../assets/fx/glow.webp) center / 100% 100% no-repeat;
  opacity: 0.75;
}
[data-lead] .face::after,
#info .plate[data-lead]::before,
.plate[data-record]::before {
  content: '';
  position: absolute;
  background: url(../../assets/ui/crown.webp) center / contain no-repeat;
}
[data-lead] .face::after {
  left: 18%;
  top: -34%;
  width: 64%;
  height: 50%;
  rotate: -8deg;
}
#info .plate {
  position: relative;
}
#info .plate[data-lead]::before {
  left: calc(var(--u) * -1.6);
  top: calc(var(--u) * -4);
  width: calc(var(--u) * 6);
  height: calc(var(--u) * 4.8);
  rotate: -14deg;
}
.plate[data-record]::before {
  right: calc(var(--u) * -1.6);
  top: calc(var(--u) * -4);
  width: calc(var(--u) * 6);
  height: calc(var(--u) * 4.8);
  rotate: 14deg;
}
.emote {
  position: absolute;
  width: calc(var(--u) * 8.4);
}
.bubble {
  position: absolute;
  width: calc(var(--u) * 27);
  aspect-ratio: 340 / 230;
  display: grid;
  place-items: center;
  transform-origin: 14% 100%;
  background: url(../../assets/ui/bubble.webp) center / 100% 100% no-repeat;
  color: var(--ink);
  font-size: calc(var(--u) * 4.8);
  line-height: 1;
}
.bubble span {
  margin-bottom: 14%;
}
.bubble[data-flip='1'] {
  transform-origin: 86% 100%;
  background: none;
}
.bubble[data-flip='1']::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url(../../assets/ui/bubble.webp) center / 100% 100% no-repeat;
  transform: scaleX(-1);
}

/* ---- power-up: dim below, lit on top with a mask in 16 pieces, energy turning when full */
.pw {
  position: absolute;
  inset: 0;
  background: url(../../assets/ui/pw-off.webp) center / contain no-repeat;
}
.pw.lit {
  background-image: url(../../assets/ui/pw-on.webp);
  -webkit-mask: conic-gradient(#000 calc(var(--p, 0) * 360deg), #0000 0);
  mask: conic-gradient(#000 calc(var(--p, 0) * 360deg), #0000 0);
}
.pw.bolt {
  inset: 27%;
  background-image: url(../../assets/ui/pw-bolt.webp);
  filter: brightness(0.55) saturate(0.6);
  transition: filter 0.25s;
}
.pw.orbit {
  inset: 2%;
  background: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.pw.orbit::before {
  content: '';
  position: absolute;
  left: 34%;
  top: 0;
  width: 32%;
  height: 18%;
  background: url(../../assets/fx/comet.webp) center / 100% 100% no-repeat;
}
.power[data-full] .pw.bolt {
  filter: none;
}
.power[data-full] .pw.orbit {
  opacity: 1;
  animation: turn 1.5s linear infinite;
}
.reduced .power[data-full] .pw.orbit {
  animation: none;
  opacity: 0;
}

/* ---- phone with small squares: one big card and the others as thumbnails (layout.js, data-mode=focus) */
#cards[data-mode='focus']:not([data-side]) {
  grid-template-columns: repeat(var(--m), max-content);
}
#cards[data-mode='focus']:not([data-side]) .card {
  grid-row: 1;
  place-self: center;
}
#cards[data-mode='focus']:not([data-side]) .card:not([data-thumb]) {
  grid-row: 2;
  grid-column: 1 / -1;
}
#cards[data-side] {
  grid-template-columns: max-content max-content;
  grid-template-rows: repeat(var(--m), auto);
  column-gap: calc(var(--u) * 3);
}
#cards[data-side] .card {
  grid-column: 1;
  place-self: center;
}
#cards[data-side] .card:not([data-thumb]) {
  grid-column: 2;
  grid-row: 1 / -1;
}
.card[data-thumb] {
  cursor: pointer;
}
.card[data-thumb] .grid {
  pointer-events: none;
}
.card[data-thumb] .cell:not(.free) span {
  visibility: hidden;
} /* too small to read: shows only the stamps and what is left to mark */
.card[data-thumb] .cell.called,
.card[data-thumb] .cell[data-late] {
  background: var(--gold);
  box-shadow: none;
}
.due {
  display: none;
}
/* the warning follows the size of the thumbnail, so it does not cover everything on a small screen */
.card[data-thumb] .due[data-l] {
  --d: clamp(var(--u) * 7, var(--c) * 2.8, var(--u) * 10);
  display: flex;
  position: absolute;
  z-index: 3;
  right: calc(var(--d) * -0.42);
  top: calc(var(--d) * -0.36);
  width: var(--d);
  pointer-events: none;
}
.due small {
  font-size: calc(var(--d) * 0.22);
}
.due b {
  font-size: calc(var(--d) * 0.42);
}
.card[data-thumb]::after {
  content: '';
  position: absolute;
  inset: calc(var(--u) * -2.2);
} /* touch area bigger than the thumbnail */

/* phone in landscape: power-up and BINGO within reach of the left thumb, with the fox behind (like on a counter) */
.short #actions {
  position: absolute;
  z-index: 3;
  left: calc(var(--u) * 2.5);
  bottom: calc(var(--u) * 2.5);
  width: calc(var(--u) * 35);
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--u) * 1.2);
}
.short.one #actions {
  width: calc(var(--u) * 42);
}
.short .power {
  width: calc(var(--u) * 13);
}
.short #b-bingo.big {
  flex: none;
  width: 100%;
  min-width: 0;
  font-size: calc(var(--u) * 5.8);
  border-width: calc(var(--u) * 4);
}

/* ---- intro and end */
.bigpat {
  position: absolute;
  left: 50%;
  top: 46%;
  width: calc(var(--u) * 42);
  transform: translate(-50%, -50%);
  padding: calc(var(--u) * 3);
  border-radius: calc(var(--u) * 4);
  background: #14104f;
  box-shadow:
    inset 0 0 0 calc(var(--u) * 0.7) var(--gold),
    0 calc(var(--u) * 1) calc(var(--u) * 4) #000a;
  gap: 6%;
  box-sizing: border-box;
}
.countball {
  position: absolute;
  left: 50%;
  top: 46%;
  width: calc(var(--u) * 34);
  transform: translate(-50%, -50%);
}
.countball b {
  font-size: calc(var(--u) * 16);
}
.letters {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: calc(var(--u) * 1);
}
.letters .ball {
  width: calc(var(--u) * 18.4);
  transform-origin: 50% 92%;
}
.letters b {
  font-size: calc(var(--u) * 10.5);
}
.land ~ #fxd .letters .ball {
  width: calc(var(--u) * 17);
}
.land ~ #fxd .letters b {
  font-size: calc(var(--u) * 9.5);
}
.ghost {
  position: absolute;
}

/* ---- panels */
.pick,
#langs {
  position: relative;
}
.selbox {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  border-radius: calc(var(--u) * 2);
  background: linear-gradient(#3fd257, #1f9d38);
  box-shadow: inset 0 0 0 calc(var(--u) * 0.5) var(--gold);
  transition:
    transform 0.3s var(--pop),
    width 0.2s,
    height 0.2s;
  pointer-events: none;
}
#langs .selbox {
  border-radius: 99px;
}
.pick button,
#langs .pill {
  position: relative;
  z-index: 1;
  overflow: visible;
}
.runner {
  position: absolute;
  bottom: 6%;
  width: calc(var(--u) * 2.6);
  height: calc(var(--u) * 2.6);
  background: url(../../assets/fx/mini-3.webp) center / contain no-repeat;
}
/* switch: the knob slides with a spring over the two pictures */
.tog::before {
  content: '';
  position: absolute;
  z-index: 1;
  left: 6.25%;
  top: 50%;
  width: 29.5%;
  aspect-ratio: 1;
  background: url(../../assets/ui/tog-knob.webp) center / contain no-repeat;
  transform: translate(0, -50%);
  transition: transform 0.3s var(--pop);
}
.tog[aria-checked='true']::before {
  transform: translate(196.7%, -50%);
}
.reduced .tog::before,
.reduced .selbox {
  transition: none;
}
.slider u {
  transition: scale 0.18s var(--pop);
}
.slider[data-drag] u {
  scale: 1.22;
}
.reduced .slider u {
  transition: none;
}

.stampb .lockic {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(var(--u) * 4.4);
  width: calc(var(--u) * 7.4);
  height: calc(var(--u) * 9);
  margin-left: calc(var(--u) * -3.7);
  background: url(../../assets/ui/lock.webp) center / contain no-repeat;
  transform-origin: 50% 12%;
}
.stampb.lock .lockic {
  display: block;
}
.stampb u,
#o-stamp u {
  display: block;
  height: calc(var(--u) * 1.6);
  border-radius: 99px;
  background: #0a0730;
  overflow: hidden;
}
.stampb u {
  width: 74%;
  visibility: hidden;
}
.stampb.lock u {
  visibility: visible;
}
.stampb u b,
#o-stamp u b {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

#m-over[data-win='1'] {
  background: #0804286b;
} /* on a win, the party keeps showing around the panel */
.stat {
  position: relative;
}
#o-bonus {
  position: absolute;
  right: calc(var(--u) * 26);
  top: 50%;
  margin-top: -0.5em;
  font-style: normal;
  line-height: 1;
  font-size: calc(var(--u) * 4.4);
  color: #8dffa6;
  opacity: 0;
}
#o-stamp {
  gap: calc(var(--u) * 2);
}
#o-stamp img {
  height: calc(var(--u) * 7.4);
  width: calc(var(--u) * 7.4);
  object-fit: contain;
}
#o-stamp u {
  flex: 1;
  height: calc(var(--u) * 2.2);
}
#o-stamp i {
  font-style: normal;
  font-size: calc(var(--u) * 3.8);
  color: var(--gold);
  transform: translateY(calc(var(--cap) * -1));
}
#o-card {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 5);
}
#o-grid {
  display: grid;
  grid-template-columns: repeat(5, calc(var(--u) * 5.4));
  gap: calc(var(--u) * 0.5);
  padding: calc(var(--u) * 0.7);
  border-radius: calc(var(--u) * 1.4);
  background: #2a2491;
  box-shadow: 0 0 0 calc(var(--u) * 0.5) var(--gold);
}
#o-grid b {
  height: calc(var(--u) * 5.4);
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-size: calc(var(--u) * 3);
  line-height: 1;
  font-weight: 600;
}
#o-grid b[data-s='m'] {
  background: #fff url(../../assets/ui/stamp.webp) center / 92% no-repeat;
}
#o-grid b[data-s='miss'] {
  background: #ffe58a;
  box-shadow:
    0 0 0 calc(var(--u) * 0.5) #ffc93c,
    0 0 calc(var(--u) * 2) #ffc93c;
  z-index: 1;
}
#o-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 1.2);
  max-width: calc(var(--u) * 26);
}
#o-next .lbl {
  font-size: calc(var(--u) * 3.2);
  color: #b9c2ff;
}
#o-next .ball {
  width: calc(var(--u) * 15);
}
#o-next small {
  font-size: calc(var(--u) * 3.2);
}
#o-next b {
  font-size: calc(var(--u) * 6);
}
#o-next[data-hit='1'] .ball {
  filter: drop-shadow(0 0 calc(var(--u) * 1.6) #ffd23e);
}

.prize {
  position: relative;
  align-self: center;
  width: calc(var(--u) * 46);
  height: calc(var(--u) * 52);
  display: grid;
  place-items: end center;
}
.prize .rays {
  position: absolute;
  inset: 0 -6% 20%;
  background: url(../../assets/fx/glow.webp) center / 100% 100% no-repeat;
  opacity: 0.9;
}
#p-box {
  position: relative;
  width: calc(var(--u) * 30);
  height: calc(var(--u) * 30);
  background: url(../../assets/ui/box.webp) 50% 100% / contain no-repeat;
  transform-origin: 50% 100%;
}
#p-box[data-open='1'] {
  background-image: url(../../assets/ui/box-open.webp);
}
#p-stamp {
  position: absolute;
  left: 50%;
  top: 2%;
  width: calc(var(--u) * 24);
  margin-left: calc(var(--u) * -12);
  visibility: hidden;
}
#p-box[data-open='1'] ~ #p-stamp {
  visibility: visible;
}
/* End of src/ui/fx.css (complete file). */
