/* Shopping Cart Bingo — one screen, up to four shoppers, one trip round WinCo.

   The look is the store itself: a polished blue-gray floor going off into the
   distance, cream shelf cards with little price tags on them, and the yellow
   and red of a sale sign for anything that wants shouting about. */

:root {
  --floor: #12324a;        /* the floor, way off down the aisle */
  --floor-2: #0a1e2e;
  --line: #23516f;

  --card: #fdf7ea;         /* shelf card stock */
  --card-2: #f2e6cd;       /* a card being pressed */
  --ink: #16324a;
  --shelf: #1c4661;        /* the metal the cards sit on */
  --shelf-lift: #2a6083;
  --tag: #ffd23f;          /* price-tag yellow */
  --sale: #e8483a;         /* sale red, spent sparingly */
  --fresh: #4cc46b;        /* produce green, for anything already got */
  --wet: #39a0d8;          /* the puddle */
  --quiet: #7f96a8;        /* a gray with the floor left in it */
  --pale: #c6dcea;

  /* Luckiest Guy does the shouting, the way a sale sign does; Baloo 2 does
     the talking, same as the rest of Remi's games. */
  --display: "Luckiest Guy", "Segoe Print", "Comic Sans MS", cursive;
  --body: "Baloo 2", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;        /* iOS ignores the meta tag; this it obeys */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body);
  color: #eaf4fb;
  background: var(--floor);
  user-select: none;
}

button { font-family: inherit; cursor: pointer; }

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--tag);
  outline-offset: 2px;
}

#game {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, #1d4f70 0%, #12324a 46%, #0a1e2e 100%);
  transition: background 0.5s ease;
  overflow: hidden;
}

/* A trap going off shakes the whole store, so it's impossible to miss even if
   you were reading your own list at the time. */
#game.jolt { animation: jolt 0.42s ease; }
@keyframes jolt {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 2px); }
  45% { transform: translate(5px, -3px); }
  70% { transform: translate(-3px, 1px); }
}

/* ============================== the top bar ============================== */

#hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) clamp(10px, 3vw, 20px) 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 30, 46, 0.55);
}

#hud-title {
  font-family: var(--display);
  font-size: clamp(15px, 4vw, 25px);
  line-height: 1.15;
  color: var(--tag);
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-item.stat { flex: none; }

.stat-label {
  font-size: clamp(11px, 2.6vw, 14px);
  font-weight: 500;
  color: var(--pale);
  white-space: nowrap;
}
.stat-label b {
  font-weight: 800;
  color: var(--tag);
}

.hud-btn {
  flex: none;
  background: transparent;
  color: var(--pale);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: clamp(11px, 2.6vw, 13px);
  font-weight: 700;
  padding: 7px 14px;
  white-space: nowrap;
}
.hud-btn:hover { border-color: var(--shelf-lift); color: #fff; }

/* ================================ the stage ============================== */

#stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(258px, 26vw, 340px);
  gap: clamp(10px, 2vw, 18px);
  padding: clamp(10px, 2vw, 18px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(10px, 2vw, 18px));
  overflow: hidden;
}

/* =============================== the store =============================== */

#store {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vw, 16px);
  padding-right: 4px;

  /* Nobody but the shopper gets to touch the shelves, and while a trap is
     going off nobody does. */
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#game.shopping #store {
  opacity: 1;
  pointer-events: auto;
}

.dept {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 70, 97, 0.75), rgba(15, 42, 62, 0.75));
  padding: 10px clamp(8px, 1.6vw, 14px) clamp(10px, 1.6vw, 14px);
}

.dept-sign {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}
.dept-emoji { font-size: clamp(15px, 3vw, 20px); }
.dept-name {
  font-family: var(--display);
  font-size: clamp(12px, 2.6vw, 16px);
  letter-spacing: 0.03em;
  color: var(--tag);
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(72px, 11vw, 96px), 1fr));
  gap: clamp(6px, 1.2vw, 10px);
}

.spot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: clamp(78px, 11.5vw, 100px);
  padding: 7px 4px 6px;
  border: 2px solid #e3d3ae;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}
.spot:hover { background: #fffdf6; transform: translateY(-2px); }
.spot:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }

.spot .pic {
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1;
}
/* The little price tag. It gets two lines rather than an ellipsis, because
   "A Laundry Bask…" is no help at all when you are hunting for one. */
.spot .tag {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: clamp(8.5px, 1.7vw, 10.5px);
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  color: #5c4a2a;
  background: var(--tag);
  border-radius: 4px;
  padding: 1px 4px;
  max-width: 100%;
  overflow: hidden;
}

/* Into the cart. */
.spot.hit { animation: hit 0.34s ease; border-color: var(--fresh); }
@keyframes hit {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); background: #e6ffe9; }
  100% { transform: scale(1); }
}

.fly {
  position: absolute;
  left: 50%;
  top: 40%;
  font-size: clamp(18px, 3.4vw, 26px);
  pointer-events: none;
  animation: fly 0.7s ease-out forwards;
}
@keyframes fly {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(1.3); }
}

/* Not on your page. */
.spot.nope { animation: nope 0.4s ease; border-color: var(--sale); }
@keyframes nope {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-3deg); }
  50% { transform: translateX(6px) rotate(3deg); }
  80% { transform: translateX(-3px); }
}

/* Everything moved. */
.spot.moved { animation: moved 0.5s ease; }
@keyframes moved {
  0% { opacity: 0.15; transform: translateY(-8px) scale(0.9); }
  100% { opacity: 1; transform: none; }
}

/* Under the puddle. */
.spot.wet {
  background: linear-gradient(180deg, rgba(57, 160, 216, 0.9), rgba(28, 96, 138, 0.95));
  border-color: var(--wet);
  color: #eaf6ff;
}
.spot.wet .tag { background: rgba(255, 255, 255, 0.28); color: #eaf6ff; }
.spot.wet .pic { opacity: 0.35; }

.puddle {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 4.4vw, 32px);
  pointer-events: none;
}
.spot.wet .puddle { display: flex; }

.spot.splash { animation: splash 0.4s ease; }
@keyframes splash {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.08) rotate(-2deg); }
}

.dept.wet-aisle { box-shadow: inset 0 0 0 2px var(--wet); }

/* ============================== the side rail ============================ */

#side {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vw, 14px);
}

#page-card,
#traps-box,
#others {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(9px, 1.6vw, 14px);
  background: rgba(10, 30, 46, 0.62);
}

/* The page of the list, which is the thing you are actually reading. It gets
   the cream card stock, because it is a piece of paper. */
#page-card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border-color: #e3d3ae;
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}
#page-card.arrive { animation: arrive 0.34s ease; }
@keyframes arrive {
  0% { opacity: 0; transform: translateY(-10px) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}
#page-card.turn { animation: turn 0.52s ease; }
@keyframes turn {
  0% { transform: perspective(700px) rotateY(0); }
  50% { transform: perspective(700px) rotateY(-88deg); }
  100% { transform: perspective(700px) rotateY(0); }
}

#page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 2px dashed #d6c49c;
}
#page-who {
  font-family: var(--display);
  font-size: clamp(13px, 2.8vw, 17px);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cart-count {
  flex: none;
  font-weight: 800;
  font-size: clamp(12px, 2.6vw, 15px);
  color: #6b5730;
  background: var(--tag);
  border-radius: 999px;
  padding: 2px 10px;
}

#page-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(22, 50, 74, 0.07);
  transition: opacity 0.2s ease;
}
.tick-pic { font-size: clamp(17px, 3.4vw, 23px); line-height: 1; }
.tick-name {
  font-weight: 700;
  font-size: clamp(12px, 2.5vw, 15px);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tick.got { background: rgba(76, 196, 107, 0.22); }
.tick.got .tick-name { text-decoration: line-through; opacity: 0.55; }
.tick.got .tick-pic { opacity: 0.45; }

#page-items.in-car .tick:not(.got) .tick-name { color: #9a8862; font-style: italic; }

#page-hint {
  margin: 8px 0 0;
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  font-weight: 600;
  color: #8a764c;
  text-align: center;
}

/* The traps you are holding. */
#traps-head {
  font-family: var(--display);
  font-size: clamp(11px, 2.4vw, 14px);
  color: var(--tag);
  margin-bottom: 7px;
}
#traps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.none {
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  color: var(--quiet);
}

.trap-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 7px;
  border: 1px solid var(--sale);
  border-radius: 999px;
  background: rgba(232, 72, 58, 0.16);
  color: #ffe2de;
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  font-weight: 700;
}
.trap-btn:hover { background: rgba(232, 72, 58, 0.3); }
.trap-emoji { font-size: clamp(13px, 2.7vw, 16px); }
.trap-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Everybody at the table. */
#others {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.other {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border-radius: 9px;
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  color: var(--pale);
}
.other.now {
  background: rgba(255, 210, 63, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 63, 0.4);
  color: #fff;
}
.other-cart { font-size: clamp(13px, 2.7vw, 16px); }
.other-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pips { display: inline-flex; gap: 3px; margin-left: auto; }
.pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: rgba(198, 220, 234, 0.25);
}
.pip.here { background: var(--tag); }
.pip.done { background: var(--fresh); }

.other-bits { display: inline-flex; gap: 4px; flex: none; }
.owns { color: var(--pale); }
.incoming { color: var(--sale); font-weight: 800; }

/* ================================ banner ================================= */

#banner {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 62px);
  transform: translate(-50%, -14px);
  max-width: min(92vw, 620px);
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--sale);
  color: #fff;
  font-weight: 800;
  font-size: clamp(12px, 2.8vw, 16px);
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
}
#banner.show { opacity: 1; transform: translate(-50%, 0); }

/* ================================ confetti =============================== */

#fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

/* ================================ overlays =============================== */

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 26px);
  background: rgba(6, 20, 32, 0.82);
  backdrop-filter: blur(3px);
  z-index: 10;
  overflow-y: auto;
}
.overlay.show { display: flex; }

.card-box {
  width: min(100%, 480px);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(16px, 3.4vw, 28px);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 2px solid #e3d3ae;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.card-box.wide { width: min(100%, 720px); }
.card-box.till { width: min(100%, 520px); }

.kicker {
  margin: 0 0 4px;
  font-size: clamp(10.5px, 2.3vw, 13px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a98f57;
}
.title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(26px, 7vw, 44px);
  line-height: 1.05;
  color: var(--sale);
}
.shout {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(21px, 5.4vw, 33px);
  line-height: 1.1;
  color: var(--sale);
}
.blurb {
  margin: 0 0 14px;
  font-size: clamp(12.5px, 2.7vw, 15px);
  font-weight: 500;
  line-height: 1.45;
  color: #4a3d26;
}
.tip {
  margin: 12px 0 0;
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  color: #8a764c;
}

/* the names screen */
.who { margin: 0 0 14px; text-align: left; }
.who-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
  font-size: clamp(12px, 2.5vw, 14px);
  color: #4a3d26;
}
.who-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.pin { flex: none; font-size: clamp(19px, 4vw, 25px); width: 1.4em; text-align: center; }
.who-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 2px solid #d6c49c;
  border-radius: 11px;
  background: #fffdf6;
  color: var(--ink);
  font-size: clamp(13px, 2.8vw, 16px);
  font-weight: 700;
}

/* the chunky action button */
.big {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px 18px;
  border: none;
  border-radius: 14px;
  background: var(--sale);
  color: #fff;
  font-family: var(--display);
  font-size: clamp(15px, 3.4vw, 21px);
  letter-spacing: 0.02em;
  box-shadow: 0 6px 0 #a8291d;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.big:hover { filter: brightness(1.06); }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #a8291d; }

.ghost {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 9px 14px;
  border: 1px solid #d6c49c;
  border-radius: 11px;
  background: transparent;
  color: #7a663f;
  font-weight: 700;
  font-size: clamp(11.5px, 2.4vw, 13.5px);
}
.ghost:hover { background: rgba(0, 0, 0, 0.05); }

/* picking a prize, a trap, or somebody to trap */
.picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
  margin-top: 4px;
}
.picks.tight { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }

.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 9px;
  border: 2px solid #d6c49c;
  border-radius: 14px;
  background: #fffdf6;
  color: var(--ink);
  text-align: center;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.pick:hover { transform: translateY(-2px); border-color: var(--sale); }
.pick:active { transform: translateY(1px); }
.pick.danger { border-color: var(--sale); background: #fff2f0; }

/* Choosing a trap should look like choosing a trap. */
.pick.trap-pick { border-color: #e0b7b1; background: #fff7f5; }
.pick.trap-pick:hover { border-color: var(--sale); }
.card-box.fork { border-color: var(--sale); }

.pick-emoji { font-size: clamp(26px, 5.6vw, 36px); line-height: 1; }
.pick-name { font-weight: 800; font-size: clamp(12px, 2.5vw, 14.5px); }
.pick-blurb {
  font-size: clamp(10px, 2.1vw, 12px);
  font-weight: 500;
  line-height: 1.3;
  color: #6b5730;
}

/* the two little slots that fill up as you choose your traps */
.chosen { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.slot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px dashed #d6c49c;
  border-radius: 12px;
  font-size: 25px;
  color: #c3b18a;
}
.slot.full { border-style: solid; border-color: var(--sale); background: #fff2f0; }

/* everybody-else-picks-a-trap, after a wrong shelf */
.trap-row {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #d6c49c;
  text-align: left;
}
.trap-row:last-of-type { border-bottom: none; }
.trap-who {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: clamp(12.5px, 2.6vw, 15px);
  color: var(--ink);
}
.trap-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 6px;
}
.mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  border: 2px solid #d6c49c;
  border-radius: 11px;
  background: #fffdf6;
  color: var(--ink);
}
.mini:hover { border-color: var(--sale); }
.mini.taken { border-color: var(--sale); background: var(--sale); color: #fff; }
.mini-emoji { font-size: clamp(18px, 3.6vw, 24px); line-height: 1; }
.mini-name { font-size: clamp(9px, 1.9vw, 10.5px); font-weight: 700; text-align: center; line-height: 1.15; }

/* the fork */
.big-fork {
  font-size: clamp(52px, 13vw, 84px);
  line-height: 1;
  margin: 2px 0 12px;
  animation: hover 1.6s ease-in-out infinite;
}
@keyframes hover {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-9px) rotate(6deg); }
}

/* a prize in your hands */
.got-prize {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 4px 0 16px;
}
.got-emoji { font-size: clamp(54px, 13vw, 80px); line-height: 1; animation: pop 0.44s ease; }
@keyframes pop {
  0% { transform: scale(0.3) rotate(-16deg); opacity: 0; }
  70% { transform: scale(1.14) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.got-name {
  font-family: var(--display);
  font-size: clamp(15px, 3.4vw, 21px);
  color: var(--ink);
}

.shelf-of-prizes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}
.prize-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(22, 50, 74, 0.08);
  font-size: clamp(14px, 2.8vw, 17px);
}
.prize-name { font-size: clamp(10px, 2.1vw, 11.5px); font-weight: 700; color: #6b5730; }

/* the receipt */
.receipt {
  margin: 0 0 14px;
  padding: 14px 16px 16px;
  background: #fffdf6;
  border: 1px dashed #c3b18a;
  border-radius: 4px;
  text-align: left;
  font-family: "Courier New", ui-monospace, monospace;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}
.receipt-head {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  color: #4a3d26;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed #c3b18a;
}
.receipt-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(10.5px, 2.2vw, 12.5px);
  color: #4a3d26;
  padding: 1px 0;
}
.receipt-pic { font-size: clamp(13px, 2.6vw, 16px); }
.receipt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-tick { color: var(--fresh); font-weight: 700; }
.receipt-rule { border-top: 1px dashed #c3b18a; margin: 8px 0; }
.receipt-total {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: clamp(10px, 2.1vw, 12px);
  color: #4a3d26;
}

/* ============================== fitting in =============================== */

/* Narrow enough and the shelves need the whole width, so the list slides up
   on top of them and the store scrolls underneath it. */
@media (max-width: 900px) {
  #stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  #side {
    order: -1;
    max-height: 44vh;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  #page-card { flex: 1 1 240px; }
  #traps-box, #others { flex: 1 1 160px; }
  #page-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 560px) {
  #side { max-height: 46vh; flex-direction: column; }
  #page-card, #traps-box, #others { flex: none; }
}

@media (max-width: 430px) {
  .hud-word { display: none; }
}

/* A short landscape phone: the list would eat the whole screen. */
@media (max-height: 520px) and (orientation: landscape) {
  #side { max-height: none; }
  #stage { grid-template-columns: minmax(0, 1fr) clamp(200px, 30vw, 260px); grid-template-rows: none; }
  #side { order: 0; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
