/* Cookie Fit's own bands (six shopfronts as a deck on Paper, twelve tins on Mist, three postcards on Night), loaded only by
   /games/cookie-fit/. They show the game and list nothing. They use the site's grounds and type (assets/css/site.css)
   and the same band head as Zombie Rodeo's line-ups (assets/css/rodeo.css); the pictures are the game's own
   (tools/cookiefit.mjs). */

.cf { padding: clamp(84px, 13vh, 150px) var(--pad-r) clamp(84px, 13vh, 150px) var(--pad-l); }
.cf--mist { background: var(--mist); }
.cf--night { background: var(--night); color: #fff; --focus: #fff; }
.cf--night ::selection { background: var(--red); color: #fff; }
.cf__in { max-width: 1440px; margin: 0 auto; }
.cf__head { margin-bottom: clamp(36px, 6vh, 72px); }
.cf h2 { margin: 0; max-width: 18ch; font: 800 clamp(2.4rem, 5vw, 4.6rem)/0.95 var(--head); letter-spacing: -0.02em; text-wrap: balance; }
.cf__lead { margin: 18px 0 0; max-width: 40ch; font: 600 clamp(1.15rem, 1.8vw, 1.6rem)/1.3 var(--head); color: var(--soft); text-wrap: pretty; }
.cf--night .cf__lead { color: rgba(255, 255, 255, 0.78); }
.cf h3 { margin: 16px 0 0; font: 800 clamp(1.2rem, 1.55vw, 1.6rem)/1.05 var(--head); letter-spacing: -0.01em; }

/* ---------- the bakeries: a deck of arched shopfronts on the game's own lilac, held low. One stands in front, big and
   upright; two fan out behind it on each side, smaller and tilted; the rest wait out of sight behind it. The deck deals
   the next one forward every few seconds (assets/js/cookiefit.js); without the script it stands as the fan it starts as. ---------- */
.cf-deck { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); grid-template-areas: "head stage" "now stage"; column-gap: clamp(28px, 5vw, 96px); }
.cf-deck__head { grid-area: head; margin-bottom: 0; }
.cf-deck__stage { grid-area: stage; position: relative; list-style: none; margin: 0; padding: 0; height: clamp(480px, 72vh, 700px); border-radius: var(--r-l); overflow: clip;
  background-color: #EFE5F9; background-color: color-mix(in oklab, #C4A3E8 30%, var(--paper)); touch-action: pan-y; }
.cf-shop { position: absolute; left: 50%; top: 50%; height: 82%; aspect-ratio: 2 / 3; translate: calc(-50% + var(--x, 0%)) -50%; rotate: var(--r, 0deg); scale: var(--s, 1); z-index: var(--z, 1); opacity: var(--o, 1);
  transition: translate 900ms var(--ease-out), rotate 900ms var(--ease-out), scale 900ms var(--ease-out), opacity 500ms ease; }
.cf-shop[data-pos="0"] { --z: 6; }
.cf-shop[data-pos="1"] { --x: 62%; --r: 7deg; --s: 0.8; --z: 5; }
.cf-shop[data-pos="2"] { --x: 110%; --r: 12deg; --s: 0.64; --z: 4; }
.cf-shop[data-pos="-1"] { --x: -62%; --r: -7deg; --s: 0.8; --z: 5; }
.cf-shop[data-pos="-2"] { --x: -110%; --r: -12deg; --s: 0.64; --z: 4; }
.cf-shop[data-pos="back"] { --s: 0.5; --o: 0; --z: 1; pointer-events: none; }
/* a shop window: a round arch over a straight foot */
.cf-shop__card { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50% 50% 20px 20px / 33.4% 33.4% 13.4px 13.4px; overflow: hidden; background: var(--mist); cursor: pointer;
  box-shadow: 0 30px 44px -26px rgba(18, 14, 11, 0.55); }
.cf-shop__card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale 900ms var(--ease-out); }
.cf-shop__card:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 50% 50% 20px 20px / 33.4% 33.4% 13.4px 13.4px; }
@media (hover: hover) { .cf-shop:not([data-pos="0"]) .cf-shop__card:hover img { scale: 1.05; } }
/* the shop in front, by name, and the two ways to turn the deck */
.cf-deck__now { grid-area: now; align-self: end; display: grid; gap: 18px; justify-items: start; }
.cf-deck__name { margin: 0; font: 800 clamp(2rem, 3.6vw, 3.4rem)/0.95 var(--head); letter-spacing: -0.02em; text-wrap: balance; }
.cf-deck__name.is-in { animation: cf-name 420ms var(--ease-out); }
@keyframes cf-name { from { opacity: 0; translate: 0 10px; } }
.cf-deck__nav { display: flex; gap: 10px; margin: 0; }
html:not(.live) .cf-deck__nav { display: none; }
.cf-deck__btn { display: inline-grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; transition: background-color 160ms ease, translate 200ms var(--ease-out); }
.cf-deck__btn:hover { background: var(--red); translate: 0 -2px; }
.cf-deck__btn:focus-visible { border-radius: 50%; }
.cf-deck__btn svg { width: 22px; height: 22px; }

/* ---------- the tins: twelve in one row, no labels ---------- */
.cf-tins { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(6px, 1vw, 18px); }
.cf-tins img { display: block; width: 100%; height: auto; }

/* ---------- the postcards: three across, each in a card's white edge ---------- */
.cf-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 36px); }
.cf-card__fig { display: block; padding: clamp(6px, 0.7vw, 10px); border-radius: var(--r-s); background: #fff; }
.cf-card__fig img { display: block; width: 100%; height: auto; border-radius: 6px; }

@media (max-width: 1099px) {
  .cf-tins { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: clamp(14px, 2.4vw, 28px); }
}
/* one column: the words, the deck, then the shop's name beside the two buttons */
@media (max-width: 900px) {
  .cf-deck { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "now"; row-gap: clamp(28px, 5vh, 44px); }
  .cf-deck__stage { height: clamp(380px, 54vh, 480px); }
  .cf-deck__now { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
}
@media (max-width: 699px) {
  .cf { padding-top: 72px; padding-bottom: 72px; }
  .cf-deck__stage { margin-right: calc(var(--pad-r) * -1); margin-left: calc(var(--pad-l) * -1); border-radius: 0; }
  .cf-shop[data-pos="2"], .cf-shop[data-pos="-2"] { --o: 0; }
  .cf h2 { font-size: clamp(2.2rem, 10.4vw, 3rem); }
  /* the postcards become a sideways shelf that runs to the screen's edges */
  .cf-cards { display: flex; margin-right: calc(var(--pad-r) * -1); margin-left: calc(var(--pad-l) * -1); padding: 0 var(--pad-r) 6px var(--pad-l); overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cf-cards::-webkit-scrollbar { display: none; }
  .cf-cards { gap: 14px; }
  .cf-card { flex: none; width: 82vw; scroll-snap-align: start; scroll-margin-left: var(--pad-l); }
  /* the tins: four rows of three, each big enough to read */
  .cf-tins { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-shop, .cf-shop__card img, .cf-deck__btn { transition: none; }
  .cf-deck__name.is-in { animation: none; }
}
