/* Hero demo (demo.js): a phone frame playing three small Garden boards. Hand-written; loaded on the
   landing pages only. Colours from the game: Garden theme #1E511E, plate/well Backdrop.kt, gold Palette. */
.demo { justify-self: center; margin: 0 auto; width: 310px; max-width: calc(100vw - 48px); }
.demo-phone { position: relative; aspect-ratio: 9 / 19.5; border-radius: 42px; padding: 9px;
  background: linear-gradient(160deg, #2c1b66, #0d0340); border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 70px rgba(5, 0, 30, 0.6), 0 0 0 7px rgba(232, 179, 92, 0.16); }
.demo-phone::before { content: ""; position: absolute; z-index: 3; top: 17px; left: 50%; width: 76px; height: 20px;
  margin-left: -38px; border-radius: 12px; background: #0d0340; }
.demo .screen { container-type: inline-size; position: relative; min-width: 0; height: 100%; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column;
  align-items: center; background: #1e511e url(img/bg.webp) center / cover no-repeat; color: var(--ink);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.demo button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.demo img { pointer-events: none; }
.demo .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* Start */
/* Content sits high, so on a phone the Play button is on screen as soon as the frame's top is. */
.demo .start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 18px; padding: 64px 16px 24px; text-align: center; }
.demo .start .logo { width: 86%; height: auto; filter: drop-shadow(0 8px 12px rgba(5, 20, 5, 0.45)); }
.demo .pair { display: flex; gap: 8px; }
.demo .pair .face { width: 64px; height: 64px; }
.demo .play { border: 0; border-radius: 999px; padding: 10px 30px; font: 400 22px var(--display); color: #2a1300;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 5px 0 var(--gold-lo); }
.demo .play.big { font-size: 28px; padding: 12px 44px; }
.demo .play:active, .demo .again:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--gold-lo); }
.demo .hint, .demo .tip { margin: 0; background: rgba(0, 0, 0, 0.32); border-radius: 999px; padding: 3px 14px; font-weight: 700;
  font-size: 15px; line-height: 1.3; text-align: center; }

/* Board screen */
.demo .bar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 44px 16px 0; }
.demo .pill { font: 400 16px var(--display); background: rgba(0, 0, 0, 0.32); border-radius: 999px; padding: 3px 12px; }
.demo .icon { width: 40px; height: 40px; border-radius: 12px; padding: 4px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; }
.demo .icon img { width: 100%; height: 100%; }
.demo .goal { width: calc(100% - 32px); margin: 12px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.32); border: 1.5px solid rgba(232, 179, 92, 0.55); }
.demo .goal .what { font-weight: 800; font-size: 16px; line-height: 1.2; }
.demo .moves { display: flex; align-items: center; gap: 4px; }
.demo .moves img { width: 30px; height: 30px; }
.demo .moves b { font: 400 28px var(--display); line-height: 1; }

.demo .board { --gap: 5px; --cw: 56px; position: relative; flex: none; width: calc(4 * var(--cw) + 5 * var(--gap));
  height: calc(4 * var(--cw) + 5 * var(--gap)); margin: auto 0; border-radius: 18px;
  background: rgba(0, 0, 0, 0.2); touch-action: none; cursor: grab; outline-offset: 4px; }
/* Safari: a fixed cell size from the screen's width (container units), never aspect-ratio or 1fr tracks. */
@container (min-width: 1px) { .demo .board { --cw: calc((100cqw - 24px - 5 * var(--gap)) / 4); } }
.demo .board:active { cursor: grabbing; }
.demo .board > * { position: absolute; left: var(--gap); top: var(--gap); width: var(--cw); height: var(--cw); overflow: hidden;
  transform: translate(calc(var(--c) * (var(--cw) + var(--gap))), calc(var(--r) * (var(--cw) + var(--gap)))); }
.demo .well { border-radius: 12px; background: rgba(0, 0, 0, 0.18); }
.demo .wall { border-radius: 12px; background: center / cover no-repeat; }
.demo .tile { z-index: 1; overflow: visible; transition: transform 150ms cubic-bezier(.4, 0, .2, 1); }
.demo .face { box-sizing: border-box; display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 12px; border: 1px solid; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22); }
.demo .face img { display: block; width: 80%; height: 80%; min-width: 0; object-fit: contain; }
.demo .tile.pop .face { animation: demo-pop 260ms ease-in forwards; }
.demo .board.bump { animation: demo-bump 260ms ease-out; }
.demo .tip { margin: 0 16px 26px; }

.demo .banner, .demo .overlay { position: absolute; z-index: 4; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; }
.demo .banner { font: 400 40px var(--display); color: var(--gold-hi); text-shadow: 0 4px 0 rgba(21, 4, 98, 0.75), 0 0 18px rgba(0, 0, 0, 0.4);
  animation: demo-in 360ms cubic-bezier(.3, 1.6, .6, 1); }
.demo .overlay { padding: 22px 16px; background: rgba(13, 3, 64, 0.85); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.demo .out { margin: 0; font: 400 26px var(--display); }

/* End */
.demo .won { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 36px 16px 20px;
  text-align: center; background: rgba(13, 3, 64, 0.55); width: 100%; }
.demo .won h3 { font-size: 38px; color: var(--gold-hi); text-shadow: 0 3px 0 rgba(21, 4, 98, 0.7); }
.demo .won p { margin: 0; font-weight: 700; font-size: 16px; line-height: 1.3; }
.demo .stars { display: flex; align-items: flex-end; }
.demo .stars img { width: 56px; animation: demo-in-star .5s cubic-bezier(.3, 1.6, .6, 1) backwards; }
.demo .stars img:nth-child(2) { width: 74px; animation-delay: .15s; }
.demo .stars img:nth-child(3) { animation-delay: .3s; }
.demo .get { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.demo .get .store { justify-content: center; padding: 6px 14px; background: rgba(0, 0, 0, 0.35); }
.demo .get .store b { font-size: 16px; }
.demo .get .store svg { width: 22px; height: 22px; }
.demo .get a.store { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1300; border-color: transparent; box-shadow: 0 4px 0 var(--gold-lo); }
.demo .get a.store small { color: #5a3a10; }
.demo .again { display: flex; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.3);
  border-radius: 999px; padding: 4px 16px 4px 6px; font-weight: 700; font-size: 16px; }
.demo .again img { width: 28px; height: 28px; }

@keyframes demo-pop { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(0.2) rotate(18deg); opacity: 0; } }
@keyframes demo-bump { 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes demo-in { from { transform: translateY(-50%) scale(0.5); opacity: 0; } }
@keyframes demo-in-star { from { transform: scale(0.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .demo * { animation: none !important; transition: none !important; }
}

/* The clip that used to sit in the hero now sits beside "How it plays". */
.how-grid { display: grid; gap: 32px; align-items: center; }
.how-grid > * { min-width: 0; }
@media (min-width: 1000px) { .how-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; } .how-grid .steps { grid-template-columns: 1fr; } .how-grid .step { grid-template-columns: 120px minmax(0, 1fr); } .how-grid .step .mini { width: auto; margin: 0; } }
