/* The Games page showcase: a half circle from the left, one game at a time, all games lined up underneath. */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 360deg; }

.show { --top: 82px; --R: min(47vw, calc((100vh - var(--top)) * .58)); position: relative; height: calc(100vh - var(--top)); min-height: 600px; overflow: hidden; isolation: isolate; }
.show button { font: inherit; color: inherit; cursor: pointer; border: 0; padding: 0; background: none; }
.show-title { position: absolute; top: 10px; left: calc(var(--R) * 1.12); right: 4vw; margin: 0; text-align: center; font-size: clamp(26px, 5.4vh, 46px); line-height: 1.2; }
.show-title span { color: var(--yellow); }
.show-title img { display: inline-block; vertical-align: baseline; }
.show .empty { position: absolute; top: 40%; left: 0; right: 0; margin: 0; text-align: center; }

/* ---------- the circle ---------- */
.show-disc { position: absolute; z-index: -1; width: calc(var(--R) * 2); height: calc(var(--R) * 2); left: calc(var(--R) * -1); top: calc(50% - var(--R)); border-radius: 50%; --from: #ef4242; --to: #ef4242; --sweep: 360deg; background: conic-gradient(var(--to) var(--sweep), var(--from) 0); }
.show-disc.go { animation: sweep 1s cubic-bezier(.55, 0, .25, 1); }
@keyframes sweep { from { --sweep: 0deg; } to { --sweep: 180deg; } }

/* ---------- one game's price and details ---------- */
.game { display: none; }
.game.active { display: contents; }
.game__cost { position: absolute; z-index: 3; left: calc(var(--R) * .06); width: calc(var(--R) * .7); top: calc(50% + var(--R) * .46); text-align: center; color: var(--ink, #fff); transition: opacity .3s, transform .4s; }
.game__cost .price { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; }
.game__cost strong { font-size: calc(var(--R) * .13); line-height: 1.15; white-space: nowrap; }
.game__cost del { opacity: .75; font-size: calc(var(--R) * .05); }
.game__cost .show-off { background: var(--navy); color: var(--yellow); font: 800 max(11px, calc(var(--R) * .036))/1.6 "Segoe UI", system-ui, sans-serif; border-radius: 99px; padding: 2px 11px; }
.game__info { position: absolute; left: calc(var(--R) * 1.12); right: 4vw; top: 80px; bottom: 150px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; transition: opacity .3s, transform .4s; }
.show.is-swapping .game__cost, .show.is-swapping .game__info { opacity: 0; transform: translateY(16px); }
.game__label { margin: 0 0 8px; border: 1.5px solid var(--yellow); color: var(--yellow); border-radius: 99px; padding: 3px 14px; font-size: 12.5px; font-weight: 700; }
.game h2 { margin: 0; font-size: clamp(26px, min(4vw, 6vh), 56px); line-height: 1.15; }
.game__text { margin: 10px 0 0; max-width: 440px; color: #d5d3ee; font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.game__note { margin: 8px 0 0; max-width: 540px; font-size: 12.5px; line-height: 1.65; color: #bcb9e0; }
.game__note b { color: var(--yellow); }
.game__thumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 1.8vh; }
.game__thumbs button { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: #28245f; font-size: 17px; }
.game__thumbs button[aria-pressed="true"] { border-color: var(--yellow); }
.game__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.game__stock { margin: 1.4vh 0 0; font-size: .85rem; font-weight: 600; color: #8fe0a1; }
.game__stock.is-out { color: #ff8a8a; }
.game .btn { margin-top: 1.6vh; padding: 12px 42px; border-radius: 99px; background: var(--yellow); color: var(--navy); font-size: 18px; text-decoration: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.game .btn:hover { background: #fff; }
.game .btn[aria-disabled="true"] { background: #8d89b8; color: #1b1851; pointer-events: none; }

/* ---------- all the games, underneath ---------- */
.dock { position: absolute; left: calc(var(--R) * 1.12); right: 4vw; bottom: 6px; display: flex; justify-content: center; align-items: flex-end; gap: 3vw; overflow-x: auto; padding-top: 8px; }
.dock button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: 130px; font-family: bb, serif; font-size: 13px; line-height: 1.3; color: #bcb9e0; opacity: .62; transition: opacity .25s, transform .35s cubic-bezier(.2, .9, .25, 1.4); }
.dock button:hover { opacity: 1; transform: translateY(-5px); }
.dock button[aria-pressed="true"] { opacity: 1; color: #fff; transform: translateY(-6px); }
.dock button::after { content: ''; width: 28px; height: 3px; border-radius: 3px; background: var(--yellow); opacity: 0; }
.dock button[aria-pressed="true"]::after { opacity: 1; }
.mini { position: relative; display: block; width: min(92px, 11vh); aspect-ratio: 1; overflow: hidden; pointer-events: none; }
.mini > img { position: absolute; left: 15%; top: 6%; width: 70%; height: 88%; object-fit: contain; }
.mini > .shutmini { left: 4%; top: -49%; width: auto; height: 147%; max-width: none; }

/* laptops: bigger game buttons in a frame, yellow, and red around the chosen one */
@media (min-width: 861px) and (orientation: landscape) {
  .show { --top: 88px; min-height: 540px; }
  .dock { gap: 18px; padding: 8px 4px 4px; bottom: 6px; }
  .dock button { justify-content: center; width: max(124px, 17vh); max-width: none; padding: 6px 10px 7px; border: 3px solid var(--yellow); border-radius: 20px; font-size: 14px; color: #fff; opacity: .88; }
  .dock button[aria-pressed="true"] { border-color: var(--red); background: rgba(239, 66, 66, .14); opacity: 1; }
  .dock button::after { display: none; }
  .dock .mini { width: min(108px, 12.5vh); }
  .game__info { bottom: calc(min(108px, 12.5vh) + 70px); }
}

/* ---------- the stage: the leaving game drops away, the new one swings in ---------- */
.stage { container-type: inline-size; position: absolute; width: calc(var(--R) * 1.05); height: calc(var(--R) * 1.05); left: 0; top: calc(50% - var(--R) * .66); }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translate(-45%, -50%) rotate(28deg) scale(.6); transition: transform .75s cubic-bezier(.25, .9, .25, 1), opacity .45s, visibility 0s .75s; }
.scene.on { opacity: 1; visibility: visible; transform: none; transition: transform .85s .18s cubic-bezier(.2, .9, .25, 1.08), opacity .5s .18s, visibility 0s; }
.scene.off { transform: translate(-55%, 48%) rotate(-32deg) scale(.6); }
.show:not(.is-live) .scene:first-child { opacity: 1; visibility: visible; transform: none; }
.show .reset, .show .reset * { transition: none !important; }
.scene .plain { position: absolute; left: 18%; top: 14%; width: 64%; height: 68%; object-fit: contain; filter: drop-shadow(0 2cqw 3cqw rgba(0, 0, 0, .45)); }
.viewer { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: cover; border-radius: 20px; z-index: 8; opacity: 0; visibility: hidden; transform: scale(.9); transition: .35s; box-shadow: 0 20px 40px rgba(0, 0, 0, .4); }
.viewer.show-it { opacity: 1; visibility: visible; transform: none; }

/* ---------- Double Game: cards rise from behind the box, then keep turning to their questions ---------- */
.deck { position: absolute; inset: 0; transform: translateY(-3cqw); }
.deck .box, .deck .card { position: absolute; }
.deck .box { z-index: 2; width: 34cqw; left: 33cqw; top: 26cqw; border-radius: 1.2cqw; cursor: pointer; filter: drop-shadow(1.6cqw 2.6cqw 2.6cqw rgba(0, 0, 0, .45)); transition: transform .7s .3s cubic-bezier(.2, .9, .25, 1.1), opacity .4s .2s; }
.deck .card { z-index: 1; width: 28cqw; height: 39.2cqw; left: 36cqw; top: 30.4cqw; transform-origin: 50% 135%; transition: transform .75s cubic-bezier(.2, .9, .25, 1.15), z-index 0s; }
.deck .card svg, .deck .card img { display: block; width: 100%; height: 100%; border-radius: 1.6cqw; box-shadow: -.4cqw .4cqw 1.4cqw rgba(0, 0, 0, .35); }
.inner, .cf, .cb { display: block; width: 100%; height: 100%; }
.inner { position: relative; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.35, .8, .3, 1.1); transition-delay: var(--f); }
.cf, .cb { position: absolute; inset: 0; backface-visibility: hidden; }
.cb { transform: rotateY(180deg); container-type: inline-size; }
.cb p { position: absolute; left: 15%; right: 7%; top: 37%; height: 24%; margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; font: 600 5.8cqw/1.5 "Segoe UI", Tahoma, sans-serif; color: #17163b; }
.deck.turned .inner { transform: rotateY(180deg); }
.on .deck .box { transform: translateY(9.9cqw); }
.on .deck .card { transform: translateY(-13.1cqw) rotate(var(--fan)); }
.on .deck:not(.turned) .card { transition-delay: calc(var(--d) + .6s); }
/* the middle card steps forward so its question can be read */
.on .deck.turned .card { transform: translateY(-5cqw) rotate(var(--fan)); transition-delay: .3s; }
.on .deck.turned .box { transform: translateY(24cqw) scale(.5); opacity: 0; transition-delay: .2s; }
.on .deck.turned .card[data-i="4"] { z-index: 3; transform: translateY(18cqw) scale(1.6); transition-delay: .45s; }

/* ---------- The Last 7: the closed box comes down, then the value cards fan out on both sides ---------- */
.ground { position: absolute; left: 26cqw; top: 76cqw; width: 50cqw; height: 9cqw; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .4), transparent); transition: transform .8s .15s cubic-bezier(.2, .9, .25, 1.05); }
.pbox { position: absolute; z-index: 2; left: 24cqw; top: -4.7cqw; width: 46cqw; aspect-ratio: 300 / 550; pointer-events: none; transition: transform .8s .15s cubic-bezier(.2, .9, .25, 1.1); filter: drop-shadow(1.2cqw 1.8cqw 2cqw rgba(0, 0, 0, .35)); }
.pbox .shut { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; cursor: pointer; }
.scene > .v { position: absolute; z-index: 1; display: block; width: 30cqw; left: 35cqw; top: 41cqw; border-radius: 1.4cqw; box-shadow: 0 .4cqw 1.4cqw rgba(0, 0, 0, .35); transform-origin: 50% 100%; opacity: 0; transition: transform .75s cubic-bezier(.2, .9, .25, 1.15), opacity .15s; transition-delay: calc(var(--d) + .8s); }
.on .pbox, .on .ground { transform: translateY(6cqw); }
.scene.on > .v { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--a)); }

/* ---------- phones and tall screens ---------- */
/* The circle and the name sit side by side, everything else is underneath.
   --p is one pixel of the 390 x 844 design; --x centres the design when the screen is short and wide. */
@media (max-width: 860px), (orientation: portrait) {
  .show { --p: min(.2564vw, .125vh, 1.4px); --p: min(.2564vw, .125svh, 1.4px); --x: calc((100vw - 390 * var(--p)) / 2); height: auto; min-height: 0; display: flex; flex-direction: column; overflow: visible; overflow-x: clip; padding-bottom: 8px; }

  /* the circle: comes out of the left edge, ends at 212 across and 350 down */
  .show-disc { left: calc(-132 * var(--p)); top: calc(6 * var(--p) - var(--x)); width: calc(344 * var(--p) + var(--x)); height: calc(344 * var(--p) + var(--x)); }
  /* here the whole width of the circle shows, so the new colour goes all the way round */
  .show-disc.go { animation-name: sweep-all; }
  /* the game inside it */
  .stage { left: calc(var(--x) - 14 * var(--p)); top: calc(22 * var(--p)); width: calc(232 * var(--p)); height: calc(232 * var(--p)); }

  .game.active { display: block; }
  .show.is-swapping .game__info { transform: none; }
  /* the price, at the bottom of the circle */
  .game__cost { left: calc(var(--x) + 22 * var(--p)); top: calc(240 * var(--p)); width: auto; text-align: left; }
  .game__cost .price { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 0 8px; }
  .game__cost strong { grid-column: 1 / -1; font-size: calc(31 * var(--p)); }
  .game__cost del { font-size: calc(13 * var(--p)); }
  .game__cost .show-off { font-size: calc(10 * var(--p)); padding: 0 9px; }
  /* beside the circle: label, name, "blissify Games" */
  .game__label, .game h2, .show-title { position: absolute; left: calc(var(--x) + 217 * var(--p)); right: 8px; text-align: left; }
  .game__label { top: calc(128 * var(--p)); right: auto; margin: 0; padding: 0 calc(10 * var(--p)); font-size: calc(10.5 * var(--p)); line-height: 1.9; white-space: nowrap; }
  .game h2 { top: calc(155 * var(--p)); right: 0; margin: 0; font-size: calc(25.5 * var(--p)); line-height: 1.2; white-space: nowrap; }
  .show-title { top: calc(192 * var(--p)); padding: 0; font-size: calc(15 * var(--p)); color: var(--yellow); }

  /* underneath */
  .game__info { position: static; display: flex; padding: calc(372 * var(--p)) 24px 0; }
  .game__text { margin: 0; font-size: max(11.5px, calc(13.5 * var(--p))); line-height: 1.5; }
  .game__note { margin-top: calc(8 * var(--p)); font-size: max(10.5px, calc(12 * var(--p))); line-height: 1.5; }
  .game__thumbs { flex-wrap: nowrap; gap: calc(7 * var(--p)); margin-top: calc(16 * var(--p)); }
  .game__thumbs button { width: calc(40 * var(--p)); height: calc(40 * var(--p)); border-radius: calc(10 * var(--p)); font-size: calc(13 * var(--p)); }
  .game__stock { margin-top: calc(6 * var(--p)); font-size: .75rem; }
  .game .btn { margin-top: calc(10 * var(--p)); min-width: calc(180 * var(--p)); padding: calc(7 * var(--p)) 20px; font-size: calc(18 * var(--p)); text-align: center; }
  .dock { position: static; justify-content: safe center; gap: calc(56 * var(--p)); padding: calc(18 * var(--p)) 18px 4px; }
  .dock button { font-size: calc(12 * var(--p)); gap: 3px; }
  .mini { width: calc(66 * var(--p)); }
  .show .empty { position: static; margin: 40px 0 60px; }
}
/* tablets: the circle is stretched sideways instead of growing, so it ends where it should and never covers the name */
@media (min-width: 601px) and (max-width: 860px), (min-width: 601px) and (orientation: portrait) {
  .show-disc { top: calc(6 * var(--p)); height: calc(344 * var(--p)); border-radius: 999px; }
}
/* short phones: a shorter description, so the order button and the games stay on the first screen */
@media (max-width: 860px) and (max-height: 740px), (orientation: portrait) and (max-height: 740px) {
  .game__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: normal; }
  .game__note { display: none; }
}
@keyframes sweep-all { from { --sweep: 0deg; } to { --sweep: 360deg; } }
@media (prefers-reduced-motion: reduce) { .show *, .show-disc { animation: none !important; transition: none !important; } }
