/* =========================================================
   Phase 7 games (19–30).

   Same conventions as css/games-lib.css: one prefix per game, a
   flex column wrapper, and every playfield is position:relative with
   overflow:hidden so an absolutely positioned sprite can never widen
   the document. Sizes use clamp() so 320px is a first-class width
   rather than something that merely survives.
   ========================================================= */

/* ---------- shared bits for this batch ---------- */
.pg-wrap, .df-wrap, .ch-wrap, .br-wrap, .ac-wrap,
.sc-wrap, .tj-wrap, .wc-wrap, .vm-wrap, .gs-wrap,
.le-wrap, .dl-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Every playfield clips its own contents. */
.pg-field, .df-lane, .sc-track, .wc-hall, .gs-field {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
}

/* The big hold/tap controls. 56px min so a thumb always lands. */
.hg-hide, .sc-reach, .dl-lift, .br-button {
  font-family: var(--font-display);
  letter-spacing: .06em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ---------- 19 · Do Not Feed The Pigeon ---------- */
.pg-sign {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(13px, 3.4vw, 18px);
  letter-spacing: .1em;
  color: var(--ink-dim);
  border: 2px dashed var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
}
.pg-demand {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(16px, 4.4vw, 24px);
  color: var(--game-accent, var(--accent));
}
.pg-field { height: clamp(96px, 26vw, 140px); }
.pg-band {
  position: absolute; top: 0; bottom: 0;
  background: rgba(255, 255, 255, .06);
  border-left: 2px dashed var(--line);
  border-right: 2px dashed var(--line);
  transition: background .12s ease;
}
.pg-band.is-live { background: rgba(155, 183, 212, .22); }
.pg-bird {
  position: absolute; bottom: 10px;
  transform: translateX(-50%);
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1;
  transition: filter .1s ease;
}
.pg-bird.is-target { filter: drop-shadow(0 0 10px var(--game-accent, #9bb7d4)); }
.pg-hand {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--surface);
}
.pg-hand.is-junk { border-color: #7a3b4a; }
.pg-hand-em { font-size: 26px; line-height: 1; }
.pg-hand-name { font-size: 13.5px; color: var(--ink-dim); }
.pg-controls { display: flex; flex-direction: column; gap: 8px; }
.pg-react, .df-react, .ch-react, .br-react, .ac-react,
.sc-react, .tj-react, .wc-react, .vm-react, .gs-say,
.le-react, .dl-react {
  margin: 0;
  min-height: 2.6em;
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ---------- 20 · Definitely Don't Touch The Floor ---------- */
.df-warn {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  font-size: clamp(14px, 3.8vw, 20px);
  letter-spacing: .08em;
  color: var(--game-accent, var(--accent));
}
.df-lane { height: clamp(92px, 24vw, 130px); }
.df-marker {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; margin-left: -1px;
  background: var(--line);
}
.df-marker.is-live { background: var(--game-accent, var(--accent)); width: 4px; margin-left: -2px; }
.df-plat {
  position: absolute; bottom: 18px; height: 14px;
  transform: translateX(-50%);
  background: var(--surface-2, #2a2a35);
  border: 2px solid var(--line);
  border-radius: 6px;
  display: grid; place-items: center;
}
.df-plat.is-under { border-color: var(--game-accent, var(--accent)); }
.df-plat-em { font-size: 16px; line-height: 1; transform: translateY(-14px); }
.df-guy {
  position: absolute; left: 50%; bottom: 32px;
  transform: translateX(-50%);
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1;
  transition: bottom .16s ease;
}
.df-guy.is-jumping { bottom: 58px; }
.df-floor {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  letter-spacing: .5em;
  font-size: 12px;
  color: var(--ink-dim);
  border-top: 4px solid var(--line);
  padding-top: 8px;
}
.df-floor.is-hit { color: #ff6b8a; border-top-color: #ff6b8a; }

/* ---------- 21 · Who Touched My Cheese? ---------- */
.ch-headline {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  font-size: clamp(16px, 4.2vw, 22px);
}
.ch-clock, .br-clock, .tj-clock, .dl-clock {
  margin: 0; text-align: center;
  font-size: 12px; letter-spacing: .06em;
  color: var(--ink-dim); font-weight: bold;
}
.ch-list { display: flex; flex-direction: column; gap: 8px; }
.ch-row {
  display: flex; gap: 10px; align-items: flex-start;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  min-height: 48px;
  cursor: pointer;
}
.ch-row:hover { border-color: var(--game-accent, var(--accent)); }
.ch-row.is-guilty { border-color: #ffd166; background: rgba(255, 209, 102, .12); }
.ch-row.is-innocent { border-color: #7a3b4a; opacity: .7; }
.ch-em { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.ch-said { display: flex; flex-direction: column; gap: 2px; }
.ch-who {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--game-accent, var(--accent));
}
.ch-quote { font-size: 14px; overflow-wrap: anywhere; }
.ch-excuse { font-size: 12.5px; color: var(--ink-dim); font-style: italic; }

/* ---------- 22 · Button Repair Department ---------- */
.br-order {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  font-size: clamp(15px, 4vw, 21px);
  letter-spacing: .04em;
  color: var(--game-accent, var(--accent));
}
.br-fault { margin: 0; text-align: center; font-size: 13.5px; color: var(--ink-dim); }
.br-bay { display: grid; place-items: center; padding: 6px 0; }
.br-button {
  width: clamp(96px, 30vw, 130px);
  height: clamp(96px, 30vw, 130px);
  border-radius: 50%;
  border: 4px solid var(--line);
  background: var(--surface);
  display: grid; place-items: center;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
}
.br-button-em { font-size: clamp(34px, 10vw, 46px); line-height: 1; }
.br-button.is-lit { border-color: #ffd166; background: rgba(255, 209, 102, .16); }
.br-button.is-down { transform: scale(.94); }
.br-button.is-fixed { border-color: #83d483; background: rgba(131, 212, 131, .16); }
.br-button.is-broken { border-color: #ff6b8a; background: rgba(255, 107, 138, .14); }
.br-progress { margin: 0; text-align: center; font-size: 13px; color: var(--ink-dim); }

/* ---------- 23 · Angry Customer Simulator ---------- */
.ac-caller {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
}
.ac-face { font-size: clamp(32px, 9vw, 44px); line-height: 1; flex: 0 0 auto; }
.ac-says { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.ac-options { display: flex; flex-direction: column; gap: 8px; }
.ac-option {
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: var(--r);
  padding: 12px 14px;
  min-height: 48px;
  font-size: 14.5px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.ac-option:hover { border-color: var(--game-accent, var(--accent)); }
.ac-option.is-good { border-color: #83d483; background: rgba(131, 212, 131, .14); }
.ac-option.is-meh { border-color: var(--ink-dim); }
.ac-option.is-bad { border-color: #ff6b8a; background: rgba(255, 107, 138, .14); }

/* ---------- 24 · Steal The Cookie ---------- */
.sc-room {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--surface);
}
.sc-cam { font-size: clamp(28px, 8vw, 38px); line-height: 1; flex: 0 0 auto; }
.sc-cam.is-watching { filter: drop-shadow(0 0 10px #ff6b8a); }
.sc-cam.is-turning { filter: drop-shadow(0 0 8px #ffd166); }
.sc-camstate {
  margin: 0; font-size: 13.5px; font-weight: bold;
  letter-spacing: .04em; overflow-wrap: anywhere;
}
.sc-track { height: clamp(58px, 16vw, 78px); }
.sc-arm {
  position: absolute; left: 0; top: 50%;
  height: 10px; margin-top: -5px;
  background: var(--game-accent, #c98b53);
  border-radius: 0 6px 6px 0;
  transition: width .1s linear;
}
.sc-wire {
  position: absolute; top: 0; bottom: 0; width: 3px;
  background: repeating-linear-gradient(180deg, #ffd166 0 6px, transparent 6px 12px);
}
.sc-cookie {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: clamp(24px, 7vw, 32px); line-height: 1;
}
.sc-label, .wc-label, .dl-meter-label {
  margin: 0; text-align: center;
  font-size: 12.5px; color: var(--ink-dim); font-weight: bold;
  overflow-wrap: anywhere;
}
.sc-reach, .hg-hide {
  width: 100%; min-height: 56px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: var(--r);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px;
}
.sc-reach.is-reaching { border-color: var(--game-accent, var(--accent)); transform: translateY(2px); }

/* ---------- 25 · Tiny Job Simulator ---------- */
.tj-order {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  font-size: clamp(15px, 4vw, 21px);
  color: var(--game-accent, var(--accent));
  overflow-wrap: anywhere;
}
.tj-bay { display: grid; place-items: center; }
.tj-item, .tj-target {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: var(--r);
  padding: 10px 14px;
  min-height: 48px;
  font-size: 14px;
  cursor: pointer;
}
.tj-item { min-width: clamp(120px, 40vw, 180px); justify-content: center; }
.tj-item.is-held { border-color: var(--game-accent, var(--accent)); transform: translateY(-3px); }
.tj-item.is-idle { opacity: .55; }
.tj-em { font-size: 24px; line-height: 1; }
.tj-name { font-size: 13.5px; overflow-wrap: anywhere; }
.tj-hint { margin: 0; text-align: center; font-size: 13px; color: var(--ink-dim); }
.tj-targets {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.tj-target { justify-content: center; }
.tj-target:hover { border-color: var(--game-accent, var(--accent)); }
.tj-target.is-right { border-color: #83d483; background: rgba(131, 212, 131, .14); }
.tj-target.is-wrong { border-color: #ff6b8a; background: rgba(255, 107, 138, .14); }
.tj-target.is-policy { font-family: var(--font-display); letter-spacing: .04em; }

/* ---------- 26 · Don't Wake The Chicken ---------- */
.wc-coop {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--surface);
}
.wc-chicken { font-size: clamp(30px, 8vw, 42px); line-height: 1; flex: 0 0 auto; }
.wc-chicken.is-checking { filter: drop-shadow(0 0 10px #ffd166); }
.wc-chicken.is-risky { filter: drop-shadow(0 0 10px #ff6b8a); }
.wc-state { margin: 0; font-size: 13.5px; font-weight: bold; overflow-wrap: anywhere; }
.wc-hall { height: clamp(54px, 15vw, 74px); }
.wc-you {
  position: absolute; bottom: 8px;
  transform: translateX(-50%);
  font-size: clamp(22px, 6vw, 30px); line-height: 1;
  transition: left .12s ease;
}
.wc-door { position: absolute; right: 6px; bottom: 8px; font-size: clamp(22px, 6vw, 30px); line-height: 1; }
.wc-next {
  margin: 0; text-align: center; font-size: 13px;
  color: var(--ink); background: var(--bg-2);
  border: 2px dashed var(--line); border-radius: var(--r);
  padding: 8px 10px; overflow-wrap: anywhere;
}
.wc-controls { display: flex; flex-direction: column; gap: 8px; }

/* ---------- 27 · The Suspicious Vending Machine ---------- */
.vm-machine {
  border: 2px solid var(--line);
  border-bottom-width: 6px;
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.vm-window {
  height: clamp(70px, 20vw, 100px);
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  display: grid; place-items: center;
  overflow: hidden;
}
.vm-window-em { font-size: clamp(34px, 11vw, 52px); line-height: 1; }
.vm-readout {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  letter-spacing: .16em;
  font-size: 12.5px;
  color: var(--game-accent, var(--accent));
}
.vm-pad { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.vm-slot {
  min-height: 62px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: var(--r);
  background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer;
}
.vm-slot:hover { border-color: var(--game-accent, var(--accent)); }
.vm-slot-letter { font-family: var(--font-display); font-size: 20px; }
.vm-slot-note { font-size: 14px; color: var(--ink-dim); }
.vm-slot.is-known-drink { border-color: #83d483; }
.vm-slot.is-known-nothing { border-color: var(--ink-dim); opacity: .8; }
.vm-slot.is-known-chaos { border-color: #ff6b8a; }

/* ---------- 28 · One Very Angry Goose ---------- */
.gs-field {
  height: clamp(230px, 58vw, 340px);
  touch-action: none;             /* dragging must not scroll the page */
  cursor: crosshair;
}
.gs-me, .gs-goose, .gs-bread {
  position: absolute;
  transform: translate(-50%, -50%);
  line-height: 1;
  pointer-events: none;
}
.gs-me { font-size: clamp(24px, 7vw, 32px); }
.gs-goose { font-size: clamp(28px, 8vw, 38px); }
.gs-bread { font-size: clamp(20px, 6vw, 26px); }
.gs-goose.is-stunned { filter: grayscale(1) brightness(1.4); }
.gs-goose.is-judging { filter: drop-shadow(0 0 10px #ff6b8a); }

/* ---------- 29 · Laundry Emergency ---------- */
.le-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
}
/* The sock's colour IS the puzzle — every sock uses the same emoji,
   so the design has to be carried by the cell, not the glyph. Tinting
   an emoji does not work (they are colour glyphs), so the colour goes
   on a band under it plus the cell wash. */
.le-cell {
  position: relative;
  min-height: 62px;
  border: 2px solid var(--line);
  border-bottom: 6px solid var(--sock, var(--line));
  border-radius: var(--r);
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--sock, #888) 22%, transparent), transparent 62%),
    var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .08s ease, border-color .12s ease;
}
.le-em {
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1;
}
.le-cell.is-picked {
  border-top-color: var(--game-accent, var(--accent));
  border-left-color: var(--game-accent, var(--accent));
  border-right-color: var(--game-accent, var(--accent));
  transform: translateY(-3px);
}
.le-cell.is-paired {
  border-color: #83d483; background: rgba(131, 212, 131, .14); opacity: .55;
}
.le-cell.is-wrong {
  border-color: #ff6b8a; background: rgba(255, 107, 138, .14);
}

/* ---------- 30 · Do You Even Lift? ---------- */
.dl-label {
  margin: 0; text-align: center;
  font-family: var(--font-display);
  letter-spacing: .12em;
  font-size: clamp(14px, 3.8vw, 19px);
  color: var(--ink-dim);
}
.dl-platform {
  position: relative;
  height: clamp(120px, 32vw, 170px);
  border: 2px solid var(--line);
  border-bottom-width: 6px;
  border-radius: var(--r);
  background: var(--bg-2);
  overflow: hidden;
}
.dl-thing {
  position: absolute; left: 50%; top: 34px;
  transform: translateX(-50%);
  font-size: clamp(34px, 10vw, 48px); line-height: 1;
  transition: transform .1s ease;
}
.dl-thing.is-flying { transform: translate(-50%, -140px) scale(.4); opacity: 0; }
.dl-guy {
  position: absolute; left: 50%; bottom: 10px;
  transform: translateX(-50%);
  font-size: clamp(28px, 8vw, 38px); line-height: 1;
}
.dl-lift {
  width: 100%; min-height: 60px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: var(--r);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px;
}
.dl-lift:active { transform: translateY(2px); }

/* ---------- reduced motion ----------
   Nothing here is load-bearing: the positions are still updated, so
   removing the tweening costs no information. */
@media (prefers-reduced-motion: reduce) {
  .pg-bird, .pg-band, .df-guy, .df-plat, .sc-arm, .wc-you,
  .br-button, .le-cell, .dl-thing, .dl-thing.is-flying,
  .tj-item, .gs-me, .gs-goose {
    transition: none !important;
    animation: none !important;
  }
  .dl-thing.is-flying { opacity: 0; transform: translateX(-50%); }
}
