/* Styles for the reference games: count, meteors, memory. */
.g-count { min-height: 260px; background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.12)), radial-gradient(circle at 50% 120%, #8be07a 0 40%, transparent 41%); }
.g-count .critter { position: absolute; transform: translate(-50%, -50%); font-size: clamp(40px, 10.5vw, 62px); line-height: 1; animation: popIn .4s backwards; transition: transform .2s; filter: drop-shadow(0 4px 3px rgba(0,0,0,.18)); }
.g-count .critter:active { transform: translate(-50%, -50%) scale(.9); }
.g-count .critter.counted { transform: translate(-50%, -50%) scale(1.15); }
.g-count .critter.counted::after { content: attr(data-n); position: absolute; top: -10px; right: -12px; font-family: var(--font); font-size: 18px; font-weight: 700; color: #fff;
  background: #ff5ca8; border-radius: 99px; min-width: 28px; height: 28px; display: grid; place-items: center; box-shadow: 0 2px 0 #c2307a; animation: popIn .3s; }

.g-meteors { min-height: 330px; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.15) 0 1px, transparent 2px) 0 0/40px 40px,
  radial-gradient(circle at 70% 60%, rgba(255,255,255,.2) 0 1px, transparent 2px) 0 0/55px 55px, linear-gradient(180deg, #0c0f3a, #2d1b6b); }
.g-meteors .planet { position: absolute; left: -10%; right: -10%; bottom: -60%; height: 80%; border-radius: 50%;
  background: radial-gradient(circle at 50% 10%, #7cf2c0, #1aa37a 45%, #0d6b52); box-shadow: 0 -10px 40px rgba(124,242,192,.6); }
.g-meteors.shake { animation: shake .5s; }
.g-meteors .meteor { position: absolute; transform: translateX(-50%); width: 96px; height: 96px; }
.g-meteors .rock { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 46% 54% 50% 50%; font-size: 36px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ffb36b, #e0602a 55%, #8a2c12); box-shadow: 0 0 0 4px rgba(255,255,255,.2), 0 0 30px #ff8a3d; text-shadow: 0 2px 0 rgba(0,0,0,.3); position: relative; }
.g-meteors .rock::before { content: ''; position: absolute; left: 50%; bottom: 80%; width: 26px; height: 90px; transform: translateX(-50%); border-radius: 99px;
  background: linear-gradient(0deg, rgba(255,180,90,.9), rgba(255,120,40,0)); z-index: -1; }
.g-meteors .meteor.zapped .rock { animation: zap .5s forwards; }
.g-meteors .meteor.reveal .rock { box-shadow: 0 0 0 6px #ffe066, 0 0 40px #ffe066; }
@keyframes zap { 40% { transform: scale(1.4); filter: brightness(2); } 100% { transform: scale(0); opacity: 0; } }

.g-memory { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 620px; }
.g-memory .mcard { aspect-ratio: 3 / 4; perspective: 800px; animation: popIn .4s backwards; max-height: 150px; }
.g-memory .mcard-inner { position: relative; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d; }
.g-memory .mcard.flipped .mcard-inner { transform: rotateY(180deg); }
.g-memory .mcard-back, .g-memory .mcard-front { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 5px 0 rgba(0,0,0,.15); }
.g-memory .mcard-back { background: repeating-linear-gradient(45deg, #ff8ac2 0 12px, #ff6fb1 12px 24px); color: #fff; font-size: 34px; border: 4px solid #fff; }
.g-memory .mcard-front { background: #fff; transform: rotateY(180deg); font-size: clamp(30px, 8vw, 52px); }
.g-memory .mcard.matched .mcard-front { background: #dcffe9; box-shadow: 0 0 0 4px #22c983; animation: correctPop .5s; }

/* ---- v2: Pip's Tricks demos + accessibility (count, meteors, memory) ---- */
.g-count-demo span, .g-feed-demo span { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.g-count-demo b { font-size: .55em; color: #ff5ca8; }
.g-count-dice span { font-size: 1.3em; line-height: 1; }
.demo-rock { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 46% 54% 50% 50%; font-size: .7em; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ffb36b, #e0602a 55%, #8a2c12); box-shadow: 0 0 18px #ff8a3d; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.g-met-hops span { font-weight: 700; font-size: .8em; }
.g-met-hops .demo-arrow { font-size: .6em; color: #6a5cff; }
/* motor: a wider invisible hit area around each falling meteor */
.g-meteors .meteor::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
body.a11y-motor .g-meteors .meteor { width: 116px; height: 116px; }
body.a11y-motor .g-meteors .meteor::after { inset: -22px; }
body.a11y-calm .g-meteors.shake { animation: none !important; }
.demo-card { display: inline-grid; place-items: center; width: 1.3em; height: 1.6em; margin: 0 3px; border-radius: 10px; font-size: .8em; color: #fff;
  background: repeating-linear-gradient(45deg, #ff8ac2 0 8px, #ff6fb1 8px 16px); border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.demo-card.demo-hl { background: #fff; color: inherit; }
.g-memory-demo { display: flex; flex-direction: column; gap: 6px; font-size: clamp(30px, 8vw, 44px); }
.g-memory-demo > div { display: flex; justify-content: center; }
