/* Yaffle — the gallery (home page): white glass cards; at the bottom of each, a stack of three tinted glass cards
   showing a glimpse of the game. The stack is cut off by the card's lower edge, and tapping it throws the front
   card back behind the others (see games/gallery.js). */

/* header */
section.block.gal-head { position: relative; z-index: 5; padding-bottom: clamp(28px, 4vw, 48px); }
.gal-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.snd-btn { display: inline-flex; align-items: center; gap: 9px; font: 400 14px/1 var(--body); color: var(--ink); background: var(--ground); border: 1px solid var(--hair); border-radius: 999px; padding: 12px 18px; cursor: pointer; }
.snd-btn:hover { border-color: var(--muted); }
.snd-btn svg { width: 17px; height: 17px; }
.snd-btn .x { display: none; } .snd-btn.off .w { display: none; } .snd-btn.off .x { display: inline; }
.snd-btn.off .lbl { color: var(--muted); }
.gal-pack .snd-btn .pi svg { width: 17px; height: 17px; display: block; }
.gal-pack .snd-btn .pc { opacity: .5; font-size: 11px; margin-left: 2px; }
.gal-pack .g-packmenu { left: 0; right: auto; }


/* grid */
.gallery { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 22px;
  padding: 0 var(--gutter) clamp(56px, 8vw, 96px); max-width: calc(1120px + 2 * var(--gutter)); margin: 0 auto; }

/* one game */
.gxc {
  --pad: clamp(24px, 4vw, 44px);
  --cw: min(66cqw, 350px);                      /* width of a stack card */
  container-type: inline-size;
  position: relative; overflow: hidden; isolation: isolate; scroll-margin-top: 90px;
  display: flex; flex-direction: column;
  padding: var(--pad) var(--pad) 0; border-radius: 40px;
  background: linear-gradient(170deg, rgba(255,255,255,.92), rgba(255,255,255,.66));
  box-shadow: var(--gl-rim), var(--gl-edge), 0 24px 48px -28px rgba(20,22,40,.35);
}
:root:not(.glass) .gxc { background: var(--surface); box-shadow: none; border: 1px solid var(--hair); }
.gxc-body { display: grid; justify-items: start; gap: 12px; position: relative; z-index: 4; }
/* icon tile: frosted matte glass in the game's own colour — soft light-to-deep fill, fine grain, a white rim, a soft glow */
.gxc-ic { position: relative; isolation: isolate; overflow: hidden; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 8px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 58%, #fff), color-mix(in srgb, var(--k) 74%, #fff) 55%, color-mix(in srgb, var(--k) 80%, #fff));
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.42), inset 0 1.5px 2px rgba(255,255,255,.55), inset 0 -2px 6px -2px color-mix(in srgb, var(--k) 45%, transparent),
    0 0 0 1px rgba(255,255,255,.7), 0 12px 24px -12px color-mix(in srgb, var(--k) 70%, transparent), 0 2px 6px -2px color-mix(in srgb, var(--k) 40%, transparent); }
.gxc-ic::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .32; mix-blend-mode: soft-light;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='96'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.gxc-ic svg { width: 30px; height: 30px; }
.gxc-ic .gic-line { stroke-width: 2.4px; color: #fff; }
.gxc-ic .gic-color { width: 40px; height: auto; }
.gxc-ic .blob { width: 44px; height: 44px; }   /* ONE LIFE: Ray, a little larger (his drawing leaves room for antennae) */
/* energy count: the logo's four marks side by side */
.gxc-ic:has(.mk) { display: flex; align-items: center; justify-content: center; gap: 1px; }
.gxc-ic .mk { width: 8px !important; height: 14px !important; background: #fff; rotate: -20deg !important; }
.gxc-ic .mk:nth-child(2) { width: 7px !important; height: 12px !important; rotate: 25deg !important; }
.gxc-ic .mk:nth-child(3) { width: 9px !important; height: 17px !important; rotate: 0deg !important; }
.gxc-ic .mk:nth-child(4) { width: 6px !important; height: 11px !important; rotate: -35deg !important; }
.gxc-t { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(40px, 6vw, 56px); line-height: 1; letter-spacing: -.045em; text-transform: lowercase; }
.gxc-d { margin: 0; max-width: 34ch; font-size: clamp(17px, 2vw, 20px); line-height: 1.4; color: color-mix(in srgb, var(--ink) 78%, transparent); text-wrap: pretty; }
/* the stack: it runs to the card's edges, and the card's lower edge cuts it off */
.deck { filter: saturate(1.2);   /* the stack's colours, 20% more saturated */
  position: relative; display: block; flex: none; height: calc(var(--cw) * (.36 + 1.25 * .85)); margin: 28px calc(-1 * var(--pad)) 0; padding: 0; border: 0; background: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.deck:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; border-radius: 0 0 36px 36px; }
.dc {
  position: absolute; left: calc(100% - var(--cw) * 1.46); top: calc(var(--cw) * .32); width: var(--cw); aspect-ratio: 4 / 5;
  display: flex; flex-direction: column; gap: 9px; padding: 12px; border-radius: 26px; text-align: left; color: #fff;
  min-height: 0; overflow: hidden;   /* text never stretches the card past 4:5 */
  background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,.05) 30%, rgba(255,255,255,0) 36%),
    linear-gradient(165deg, color-mix(in srgb, var(--c) 68%, transparent), color-mix(in srgb, color-mix(in srgb, var(--c) 86%, #000) 76%, transparent));
  -webkit-backdrop-filter: blur(10px) saturate(1.6); backdrop-filter: blur(10px) saturate(1.6);   /* frosted: colours show through, text does not */
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7), inset 0 0 0 1.5px rgba(255,255,255,.3), inset 14px 0 24px -18px rgba(255,255,255,.85),
    inset 0 -18px 28px -22px rgba(255,255,255,.6), 0 18px 36px -20px color-mix(in srgb, var(--c) 70%, #000);
  text-shadow: 0 1px 2px color-mix(in srgb, var(--c) 50%, rgba(0,0,0,.35));
  transform-origin: 50% 100%;
  transition: transform .6s cubic-bezier(.3,1.3,.5,1), filter .4s;
}
.dc[data-slot="0"] { z-index: 3; transform: translate(0%, 0%) rotate(-2deg) scale(1); }
.dc[data-slot="1"] { z-index: 2; transform: translate(30%, -9%) rotate(4deg) scale(.96); }
.dc[data-slot="2"] { z-index: 1; transform: translate(60%, -18%) rotate(9deg) scale(.92); }
.deck:hover .dc[data-slot="0"] { transform: translate(0%, -4%) rotate(-3deg) scale(1.01); }
/* cards behind show only their top (label and picture); their big value and text fade out so nothing reads through the glass */
.dc .dc-foot, .dc .dc-d { transition: opacity .35s; }
.dc:not([data-slot="0"]) .dc-foot, .dc:not([data-slot="0"]) .dc-d { opacity: 0; }

/* card face: label + page on top, a frosted panel with the game's picture, a big value with a round arrow, one line under it */
.dc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dc-k { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; border-radius: 999px; min-width: 0;
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  background: rgba(255,255,255,.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 0 0 1px rgba(255,255,255,.18); }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.dc-big { min-width: 0; font: 500 clamp(18px, 6cqw, 28px)/1.05 var(--display); letter-spacing: -.035em; font-variant-numeric: tabular-nums;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.dc-d { padding: 0 2px; font-size: 13px; line-height: 1.35; opacity: .92; }

/* the frosted panel that holds the game's picture */
.ms { position: relative; flex: none; height: 50%; overflow: hidden; border-radius: 18px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff;
  background: linear-gradient(170deg, rgba(255,255,255,.26), rgba(255,255,255,.08)), color-mix(in srgb, color-mix(in srgb, var(--c) 70%, #000) 22%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(255,255,255,.2), inset 0 -10px 20px -14px rgba(0,0,0,.25); }

.m-strip { display: flex; gap: 6px; width: 92%; height: 64%; }
.m-strip i { flex: 1; border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -8px rgba(0,0,0,.5); }
.m-strip i:nth-child(odd) { transform: translateY(-6%); }
.m-sw { width: 82%; height: 72%; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 24px -8px rgba(0,0,0,.6); }
.m-sl { width: 100%; display: grid; gap: 12px; }
.m-sl > span { display: flex; align-items: center; gap: 8px; }
.m-sl b { width: 10px; font-size: 10px; font-weight: 500; opacity: .6; }
.m-sl i { position: relative; flex: 1; height: 7px; border-radius: 999px; }
.m-sl u { position: absolute; top: 50%; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.55); }
.m-cmp { display: flex; width: 84%; height: 58%; border-radius: 12px; overflow: hidden; }
.m-cmp i { flex: 1; }
.m-row { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 11px; opacity: .85; }
.m-row em { font-style: normal; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.14); }
.m-orb { position: relative; width: 58%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.35), transparent 45%), linear-gradient(0deg, color-mix(in srgb, var(--c) 90%, #fff) 0 48%, rgba(255,255,255,.06) 48%);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35), 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.m-orb .mk, .m-flash .mk { width: 22%; aspect-ratio: 219 / 384; height: auto; background: #fff; }
.m-ring { width: auto; height: 86%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(color-mix(in srgb, var(--c) 70%, #fff) var(--p), rgba(255,255,255,.12) 0); }
.m-ring b { width: 80%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 65%, #000); }
.m-ring .mk { width: 18%; aspect-ratio: 219 / 384; height: auto; background: #fff; }
.m-ring small, .m-big small { font-size: .5em; opacity: .6; margin-left: 2px; }
.m-bars { width: 100%; display: grid; gap: 12px; }
.m-bars > span { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 11px; }
.m-bars > span > span { opacity: .7; }
.m-bars i { grid-column: 1 / -1; order: 3; height: 8px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #fff) var(--w), rgba(255,255,255,.12) var(--w)); }
.m-bars b { font-weight: 600; font-variant-numeric: tabular-nums; }
.m-eq { display: flex; align-items: flex-end; gap: 4%; width: 90%; height: 70%; }
.m-eq i { flex: 1; border-radius: 3px; background: linear-gradient(0deg, color-mix(in srgb, var(--c) 80%, #fff), rgba(255,255,255,.9)); }
.m-big { font: 500 clamp(26px, 9cqw, 40px)/1 var(--display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.m-big.s { font-size: clamp(20px, 6cqw, 28px); }
.m-line { position: relative; width: 86%; height: 4px; border-radius: 999px; background: rgba(255,255,255,.2); }
.m-line u { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; }
.m-wave { width: 100%; height: 44%; overflow: visible; }
.m-wave polyline { fill: none; stroke: color-mix(in srgb, var(--c) 60%, #fff); stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 80%, transparent)); }
.m-field { position: absolute; inset: 0; }
.m-field .mk { position: absolute; width: 9px; height: 16px; background: color-mix(in srgb, var(--c) 55%, #fff); }
.m-flash { width: 74%; height: 76%; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 85%, #fff); box-shadow: 0 0 36px color-mix(in srgb, var(--c) 70%, transparent); }
.m-flash .mk { width: 18%; }
.m-step { display: flex; align-items: center; gap: 12px; }
.m-step i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 18px; background: rgba(255,255,255,.14); }
.m-step b { font: 500 34px/1 var(--display); min-width: 2ch; text-align: center; }

@media (prefers-reduced-motion: reduce) { .dc { transition: none; } }
@media (max-width: 480px) { .gxc { border-radius: 30px; } }


/* categories on the home page */
.cat + .cat { margin-top: 8px; }
.cat { scroll-margin-top: 76px; }
.cat-head { display: grid; gap: 6px; padding: 0 var(--gutter) 22px; max-width: calc(1120px + 2 * var(--gutter)); margin: 0 auto; }   /* the same edge as the cards below */
.cat-t { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.03em; }
.cat-d { margin: 0; color: var(--muted); font-size: 15px; }
.cat-chaos .cat-t::after { content: ""; display: inline-block; width: .5em; height: .86em; margin-left: .28em; vertical-align: -.1em; rotate: 10deg;   /* an energy mark, as in the logo */
  background: linear-gradient(170deg, #7fcb9f, #3fae70); -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; }
/* ONE LIFE stack pictures */
.m-ray { display: grid; place-items: center; width: 70%; aspect-ratio: 4 / 3; border-radius: 16px; background: linear-gradient(165deg, #bfe6cf, #7fcb9f); box-shadow: inset 0 2px 0 rgba(255,255,255,.8); }
.m-ray .blob { width: 64%; height: auto; }
.m-rules { width: 92%; display: grid; gap: 5px; }
.m-rules i { display: flex; align-items: center; gap: 6px; }
.m-rules b { width: 14px; height: 14px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #16171b; font-size: 8px; font-style: normal; }
.m-rules u { height: 5px; width: var(--w); border-radius: 999px; background: rgba(255,255,255,.75); text-decoration: none; }
.m-banner { display: flex; align-items: center; gap: 8px; width: 92%; padding: 7px; border-radius: 999px; background: rgba(255,255,255,.9); }
.m-banner b { padding: 4px 7px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 8px; letter-spacing: .12em; }
.m-banner i { flex: 1; height: 5px; border-radius: 999px; background: #e5484d; opacity: .6; }

/* the categories right under the page title, so both are on screen as soon as the page opens */
.cat-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 580px; margin-top: 26px; }
.cat-pill { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 24px; text-decoration: none; color: var(--ink);
  background: linear-gradient(170deg, rgba(255,255,255,.9), rgba(255,255,255,.6)); box-shadow: var(--gl-rim), var(--gl-edge), 0 16px 32px -20px rgba(20,22,40,.3);
  transition: transform .25s cubic-bezier(.3,1.6,.5,1), box-shadow .3s; }
.cat-pill:hover { transform: translateY(-2px); box-shadow: var(--gl-rim), var(--gl-edge), 0 22px 40px -20px rgba(20,22,40,.38); }
.cp-ic { width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center; gap: 1px; border-radius: 16px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 58%, #fff), color-mix(in srgb, var(--k) 80%, #fff));
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.42), inset 0 1.5px 2px rgba(255,255,255,.55), 0 0 0 1px rgba(255,255,255,.7), 0 10px 20px -10px color-mix(in srgb, var(--k) 70%, transparent); }
.cp-ic .mk { width: 6px; height: 11px; background: #fff; rotate: -20deg; }
.cp-ic .mk:nth-child(2) { width: 5px; height: 9px; rotate: 25deg; } .cp-ic .mk:nth-child(3) { width: 7px; height: 13px; rotate: 0deg; } .cp-ic .mk:nth-child(4) { width: 5px; height: 9px; rotate: -35deg; }
.cp-ray { background: linear-gradient(165deg, #bfe6cf, #7fcb9f); }
.cp-t { display: grid; gap: 2px; min-width: 0; }
.cp-t b { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.cp-t small { font-size: 13px; color: var(--muted); }
.cp-go { margin-left: auto; width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #16171b; color: #fff; font-size: 14px; }
.cp-t small { white-space: nowrap; }
@media (max-width: 480px) { .cat-pill { gap: 10px; padding: 10px 12px 10px 10px; border-radius: 20px; } .cp-ic { width: 40px; height: 40px; border-radius: 13px; } .cp-go { display: none; } .cp-t b { font-size: 18px; } }
@media (max-width: 330px) { .cat-nav { grid-template-columns: 1fr; } }

/* the sound pack menu opens over everything under it (the category buttons used to cover it) */
.gal-tools { position: relative; z-index: 30; }
.cat-nav { position: relative; z-index: 1; }
.page-head, .gal-head { position: relative; z-index: 5; }
.g-packmenu { z-index: 80; }

/* ---------- Yaffle home: the name, the slogan, the studio credit ---------- */
.yh .wrap { display: grid; justify-items: start; }
.yh-word { margin: 6px 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(64px, 13vw, 156px); line-height: .92; letter-spacing: -.065em; }
.yh-word .yb-dot { color: #ff9a8a; }
.yh-slogan { margin: 18px 0 0; font-family: var(--display); font-size: clamp(22px, 3.2vw, 34px); letter-spacing: -.03em; line-height: 1.15; color: var(--ink); }
.yh-by { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.yh-by a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: color .2s; }
.yh-by a:hover { color: var(--ink); }
.yh .gal-tools { margin-top: 26px; }

/* the category filter: glass pills, the chosen one dark */
.cat-head { grid-template-columns: 1fr; gap: 16px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.cf { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 14px/1 var(--body); color: var(--ink);
  background: linear-gradient(170deg, rgba(255,255,255,.9), rgba(255,255,255,.6)); box-shadow: var(--gl-rim), var(--gl-edge), 0 10px 22px -16px rgba(20,22,40,.3);
  transition: background .25s, color .25s, box-shadow .25s, transform .2s; }
.cf small { font-size: 11px; font-variant-numeric: tabular-nums; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: rgba(20,22,40,.07); color: var(--muted); }
.cf:hover { transform: translateY(-1px); }
.cf[aria-pressed="true"] { background: #16171b; color: #fff; box-shadow: inset 0 1.5px 0 rgba(255,255,255,.22), 0 12px 24px -14px rgba(20,22,40,.55); }
.cf[aria-pressed="true"] small { background: rgba(255,255,255,.16); color: rgba(255,255,255,.85); }
.cf:focus-visible { outline: 2px solid #ff9a8a; outline-offset: 2px; }
:root:not(.glass) .cf:not([aria-pressed="true"]) { background: var(--surface); box-shadow: none; border: 1px solid var(--hair); }
@media (max-width: 560px) { .cat-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; scroll-snap-type: x proximity; } .cat-filter::-webkit-scrollbar { display: none; } .cf { flex: none; scroll-snap-align: start; } }

/* the card: one link over the whole card (the stack keeps its own toss), a small category label, a quiet arrow */
.gxc { transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s; }
.gxc-body { position: static; }
.gxc-body > * { position: relative; z-index: 4; pointer-events: none; }   /* clicks on the text fall through to the card's link */
.gxc-body > .gxc-t { position: static; }
.gxc-link { color: inherit; text-decoration: none; outline: none; }
.gxc-link::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.gxc .deck { z-index: 5; }
.gxc-cat { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; margin: -2px 0 -2px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--k) 70%, #16171b);
  background: color-mix(in srgb, var(--k) 12%, rgba(255,255,255,.7)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 22%, transparent); pointer-events: none; }
.gxc-t .gxc-link { pointer-events: auto; }
@media (hover: hover) {
  .gxc:hover { transform: translateY(-3px); box-shadow: var(--gl-rim), var(--gl-edge), 0 34px 60px -30px rgba(20,22,40,.42); }
}
.gxc:has(.gxc-link:focus-visible) { outline: 2px solid #ff9a8a; outline-offset: 4px; }
.gxc:active:not(:has(.deck:active)) { transform: translateY(-1px) scale(.995); }
@media (prefers-reduced-motion: reduce) { .gxc, .cf { transition: none; } .gxc:hover, .gxc:active { transform: none; } }


/* ---------- the stack cards' faces: a label with its own icon, the game's icon, and a clear Play button ---------- */
.dc-k { gap: 6px; padding: 4px 11px 4px 5px; font-size: 10.5px; letter-spacing: .12em; }
.dc-k i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: color-mix(in srgb, var(--c) 78%, #000); flex: none; }
.dc-k i svg { width: 11px; height: 11px; }


/* =====================================================================================================================
   Compact gallery (v3): a 1080 px column, a wide first card under "All", then three across on laptops and desktops,
   two on tablets, one on phones. Every card keeps its white glass and its tinted glass stack; on top of them a single
   type and spacing system: icon tile + category, the name, one line, a Play button, and the stack cut off by the edge.
   ===================================================================================================================== */
.gallery { --gap: clamp(14px, 1.8vw, 22px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--gap);
  max-width: calc(1080px + 2 * var(--gutter)); }
.cat-head { max-width: calc(1080px + 2 * var(--gutter)); }
.gxc { --pad: clamp(20px, 2.2vw, 28px); --cw: min(54cqw, 212px); border-radius: 30px; padding: var(--pad) var(--pad) 0; }
.gxc-body { gap: 0; }
.gxc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.gxc-ic { width: 46px; height: 46px; border-radius: 15px; margin: 0; }
.gxc-ic svg { width: 23px; height: 23px; }
.gxc-ic .gic-color { width: 30px; }
.gxc-ic .blob { width: 34px; height: 34px; }
.gxc-cat { margin: 0; height: 24px; font-size: 10.5px; letter-spacing: .1em; }
.gxc-t { font-size: clamp(30px, 2.9vw, 36px); line-height: 1; letter-spacing: -.04em; text-transform: none; }
.gxc-d { margin-top: 10px; max-width: 32ch; font-size: 15px; line-height: 1.45; color: color-mix(in srgb, var(--ink) 70%, transparent);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* Play: dark, solid, unmistakable — the whole card is the link, this is what tells you so */
.gxc-play { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px 0 14px; border-radius: 999px;
  font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: #fff; background: #16171b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 10px 22px -12px rgba(20,22,40,.55);
  transition: transform .3s cubic-bezier(.3,1.5,.5,1), background .25s, box-shadow .3s; }
.gxc-play svg { width: 15px; height: 15px; color: #ff9a8a; }
@media (hover: hover) {
  .gxc:hover .gxc-play { transform: translateX(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 14px 26px -12px rgba(20,22,40,.6); }
}
.gxc:active:not(:has(.deck:active)) .gxc-play { transform: scale(.96); }

/* the stack: shorter than before (the card's lower edge cuts it off sooner), and it can be dragged sideways */
.deck { height: calc(var(--cw) * 1.02); margin-top: 16px; perspective: 1100px; touch-action: pan-y; }
.deck .dc { top: calc(var(--cw) * .15); }
.deck.dragging { cursor: grabbing; }
.dc { gap: 7px; padding: 10px; border-radius: 22px; will-change: auto; }
.deck.dragging .dc[data-slot="0"] { box-shadow: inset 0 2px 0 rgba(255,255,255,.7), inset 0 0 0 1.5px rgba(255,255,255,.3), 0 28px 44px -18px color-mix(in srgb, var(--c) 80%, #000); }

/* stack card face: label left, "1/3" right; the picture; the big value with the ENERGIFY mark; one line */
.dc-top { padding: 0 2px; }
.dc-k { gap: 6px; padding: 0; background: none; box-shadow: none; font-size: 10px; letter-spacing: .14em; }
.dc-k i { width: 18px; height: 18px; background: rgba(255,255,255,.95); }
.dc-k i svg { width: 10px; height: 10px; }
.dc-n { font: 600 10px/1 var(--body); letter-spacing: .08em; font-variant-numeric: tabular-nums; opacity: .85; }
.dc-n i { font-style: normal; opacity: .55; margin: 0 1px; }
.ms { height: 48%; border-radius: 15px; }
.dc-foot { align-items: flex-end; padding: 2px 2px 0; }
.dc-big { font-size: clamp(17px, 6.4cqw, 24px); letter-spacing: -.03em; }
/* the ENERGIFY logo, small, once per stack (only the front card shows its foot) */
.dc-eb { flex: none; width: 11px; height: 16px; margin-bottom: 3px; background: currentColor; opacity: .9;
  -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; }
.dc-d { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* the pictures, redrawn without the old marks */
.m-orb b, .m-ring b { font: 600 clamp(14px, 6cqw, 22px)/1 var(--name); letter-spacing: -.03em; color: #fff; }
.m-orb { width: 54%; }
.m-ring b { font-size: clamp(11px, 4.4cqw, 16px); }
.m-tap { position: relative; width: 74%; aspect-ratio: 1; max-height: 92%; display: grid; place-items: center; }
.m-tap i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5); }
.m-tap i + i { inset: 18%; border-color: rgba(255,255,255,.75); }
.m-tap b { width: 34%; aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 40%, transparent), 0 0 26px rgba(255,255,255,.6); }
.m-field .mk { width: 10px; height: 15px; background: rgba(255,255,255,.92); }
.m-flash .mk { width: 16%; height: auto; aspect-ratio: 302 / 454; }

/* the wide first card (only under "All", tablets and up): words on the left, the stack fanned out on the right */
@media (min-width: 760px) {
  .gallery[data-cat="all"] > .gxc:first-child { grid-column: 1 / -1; flex-direction: row; align-items: stretch; min-height: 0;
    --cw: min(25cqw, 236px); padding-bottom: var(--pad); }
  .gallery[data-cat="all"] > .gxc:first-child .gxc-body { flex: 0 0 44%; align-content: start; }
  .gallery[data-cat="all"] > .gxc:first-child .gxc-t { font-size: clamp(38px, 4vw, 52px); }
  .gallery[data-cat="all"] > .gxc:first-child .gxc-d { -webkit-line-clamp: 3; font-size: 16px; }
  .gallery[data-cat="all"] > .gxc:first-child .deck { flex: 1; height: auto; min-height: calc(var(--cw) * 1.08); margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0; }
  .gallery[data-cat="all"] > .gxc:first-child .dc { top: auto; bottom: calc(var(--cw) * -.16); left: calc(100% - var(--cw) * 1.62); }
}

/* the home page head: the name, the slogan and the tools take less room, so the first cards are on screen at once */
.yh.gal-head { padding-bottom: clamp(18px, 2.6vw, 30px); }
.yh-word { font-size: clamp(56px, 8.6vw, 108px); line-height: .9; letter-spacing: -.055em; }
.yh-slogan { margin-top: 12px; font-size: clamp(20px, 2.4vw, 28px); }
.yh .gal-tools { margin-top: 20px; }
.cat-head { gap: 12px; padding-bottom: 18px; }
.cat-t { font-size: clamp(24px, 2.6vw, 30px); }
@media (max-width: 480px) { .gxc { border-radius: 26px; } .yh .gal-tools { margin-top: 16px; } }

/* rise on scroll: a card waits a little lower and transparent until it comes into view, then rises once; its stack waits
   gathered and fans out just after it, back card first. Only transform and opacity move (no layout shift). */
.gallery.rv .gxc:not(.in) { opacity: 0; transform: translateY(34px) scale(.97); }
.gallery.rv .gxc:not(.in) .dc { transform: translate(28%, 6%) rotate(0deg) scale(.9); }
.gallery.rv .gxc.rising { will-change: transform, opacity;
  transition: opacity .55s cubic-bezier(.2,.7,.2,1) var(--rd, 0ms), transform .85s cubic-bezier(.16,1,.3,1) var(--rd, 0ms); }
.gallery.rv .gxc.rising .dc { transition: transform .9s cubic-bezier(.24,1.2,.32,1), filter .4s; }
.gallery.rv .gxc.rising .dc[data-slot="2"] { transition-delay: calc(var(--rd, 0ms) + 140ms); }
.gallery.rv .gxc.rising .dc[data-slot="1"] { transition-delay: calc(var(--rd, 0ms) + 220ms); }
.gallery.rv .gxc.rising .dc[data-slot="0"] { transition-delay: calc(var(--rd, 0ms) + 300ms); }
@media (prefers-reduced-motion: reduce) { .gallery.rv .gxc:not(.in), .gallery.rv .gxc:not(.in) .dc { opacity: 1; transform: none; } .gxc-play { transition: none; } }

/* desktop head: the name and slogan on the left, the sound tools on the right; "Games" and the filter share one row */
.yh.gal-head { padding-top: clamp(26px, 4.4vw, 60px); }
@media (min-width: 900px) {
  .yh .wrap { grid-template-columns: 1fr auto; column-gap: 32px; }
  .yh .wrap > * { grid-column: 1; }
  .yh .wrap > .gal-tools { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin: 0; }
  .cat-head { grid-template-columns: auto 1fr; align-items: center; column-gap: 28px; }
  .cat-head .cat-filter { justify-content: flex-end; }
}

/* stack pictures for Distance and Curve */
.m-dist { position: relative; display: flex; align-items: center; width: 88%; height: 30%; }
.m-dist i { width: 14px; height: 14px; flex: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent); }
.m-dist b { width: var(--w); height: 2px; border-radius: 2px; background: rgba(255,255,255,.55); margin: 0 2px; }
.m-dist.drag b { background: rgba(255,255,255,.9); }
.m-dist.drag .mv { box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 0 0 9px color-mix(in srgb, var(--c) 30%, transparent); }
.m-lines { width: 88%; display: grid; gap: 14px; }
.m-lines u { display: block; width: var(--w); height: 4px; border-radius: 4px; text-decoration: none; background: repeating-linear-gradient(90deg, rgba(255,255,255,.9) 0 8px, transparent 8px 13px); }
.m-lines u.you { background: #fff; height: 5px; }
.m-curve { width: 92%; height: auto; overflow: visible; }
.m-curve path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.m-curve path.ref { stroke-dasharray: 5 5; opacity: .85; }
.m-curve path.you { stroke-width: 3.4; }
.m-curve circle { fill: #fff; }
.m-curve .g { stroke: rgba(255,255,255,.35); stroke-width: 1.4; stroke-dasharray: 2 3; }
.m-curve .h { fill: #fff; stroke: color-mix(in srgb, var(--c) 45%, transparent); stroke-width: 4; }

/* the home page's one call to action: Reaction, Yaffle's signature game (the same dark pill as each card's Play) */
.yh-play { margin-top: 18px; display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px 0 18px; border-radius: 999px; text-decoration: none;
  font: 650 16px/1 var(--name); letter-spacing: -.01em; color: #fff; background: #16171b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 26px -14px rgba(20,22,40,.6); transition: transform .3s cubic-bezier(.3,1.5,.5,1), box-shadow .3s; }
.yh-play svg { width: 16px; height: 16px; color: #ff9a8a; }
.yh-play:hover { transform: translateX(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 16px 30px -14px rgba(20,22,40,.65); }
.yh-play:active { transform: scale(.97); }
.yh-play:focus-visible { outline: 2px solid #ff9a8a; outline-offset: 3px; }
@media (min-width: 900px) { .yh .wrap > .yh-play { grid-column: 1; } .yh .wrap > .gal-tools { grid-row: 1 / span 4; } }
@media (prefers-reduced-motion: reduce) { .yh-play { transition: none; } }
