/* End-of-page pixel games (pixelgame.js): a button under the "pixels swallowed" counter, and
   the game drawn over the swirl's space when it runs. */
/* The start buttons: one per game on the page, side by side under the counter. */
.pgame__starts { position: absolute; left: 50%; bottom: -70px; translate: -50% 0; z-index: 3; display: flex; justify-content: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); }
.pgame__starts[hidden] { display: none; }
.pgame__start {
  white-space: nowrap; padding: 10px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff;
  font: 800 15px var(--font-body); letter-spacing: .02em; cursor: pointer; box-shadow: 3px 4px 0 var(--accent);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}
.pgame__start:hover { transform: translate(-2px, -2px); box-shadow: 5px 6px 0 var(--accent); }
.pgame__start:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.whirl.is-feed .whirl__count { opacity: 0; }
/* The ball game: the swirl stays put and the game opens below it. */
.whirl.is-breakout, .whirl.is-menu { margin-bottom: 110px; }
.pgame.pgame--below { position: relative; inset: auto; width: min(100%, 900px); height: 480px; margin: 0 auto 220px; }
/* Room under the counter and button, so the big face in the footer rises below them. */
.whirl:has(.pgame__start) { margin-bottom: 220px; }
@media (max-width: 700px) {
  .whirl:has(.pgame__start) { margin-bottom: 170px; }
  /* Two games on a phone: the buttons stack. */
  .pgame__starts:has(.pgame__start + .pgame__start) { flex-direction: column; align-items: center; bottom: -122px; gap: 10px; }
  .whirl:has(.pgame__start + .pgame__start) { margin-bottom: 220px; }
}
.pgame { position: absolute; inset: 0; z-index: 2; }
/* A pixel flying from the swirl's drain into the wall (pixelgame.js). */
.pgame__fly { position: absolute; z-index: 3; width: 12px; height: 12px; pointer-events: none; will-change: transform; }
.pgame[hidden] { display: none; }
.pgame__cv { position: absolute; inset: 0; display: block; border: 2px dashed rgba(21, 9, 33, .18); border-radius: 22px; touch-action: none; }
.pgame--feed .pgame__cv { cursor: none; }
.pgame--breakout .pgame__cv { cursor: pointer; background: rgba(255, 255, 255, .55); }
.pgame__top { position: absolute; left: 14px; right: 14px; top: 14px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.pgame__top > * { pointer-events: auto; }
.pgame__hud {
  margin: 0; max-width: 100%;
  padding: 6px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #fff;
  font: 700 14px ui-monospace, Menlo, monospace; text-align: center; pointer-events: none;
}
.pgame__bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pgame__btn {
  display: inline-flex; align-items: center; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink); font: 800 14px var(--font-body); text-decoration: none; cursor: pointer;
}
.pgame__btn.is-main { background: var(--ink); color: #fff; }
.pgame__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
/* The menu: a small table (canvas) on top, the dishes in a grid under it. */
.pgame.pgame--below.pgame--menu { height: auto; }
.pgame__stage { position: relative; height: 300px; }
.pgame__menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.pdish {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px;
  border: 2px solid var(--ink); border-radius: 18px; background: #fff; color: var(--ink); font: 700 15px var(--font-body);
  cursor: pointer; box-shadow: 3px 4px 0 var(--ink); transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}
.pdish:hover { transform: translate(-2px, -2px) rotate(-1.5deg); box-shadow: 5px 6px 0 var(--ink); }
.pdish:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.pdish:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.pdish__art { width: 64px; height: 64px; image-rendering: pixelated; margin-bottom: 4px; }
.pdish__name { font-weight: 800; text-align: center; }
.pdish__price { font: 700 13px ui-monospace, Menlo, monospace; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; }
.pdish__need { font-size: 12px; color: #6b6573; }
.pdish.is-short { background: #f3f2f5; box-shadow: 3px 4px 0 #b9b9c0; }
.pdish.is-short .pdish__art { opacity: .45; filter: grayscale(.6); }
.pdish.is-short .pdish__price { background: #9a9aa1; }
@media (max-width: 700px) {
  .pgame.pgame--below.pgame--menu { height: auto; }
  .pgame__stage { height: 340px; }
  .pgame__menu { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pdish { transition: none; } }
@media (max-width: 700px) {
  .pgame.pgame--below { height: 400px; margin-bottom: 170px; }
  .pgame__hud { font-size: 12px; }
  }
@media (prefers-reduced-motion: reduce) { .pgame__start { transition: none; } }

/* The stream from the swirl passes behind the counter. */
.whirl__count { z-index: 5; }
