* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --lip: 22px;
  --wi: 46px;
  --counter: calc(var(--lip) + var(--wi) + 4px);
  --bar: 48px;
  --pw: min(26dvw, 13dvh, 118px);
  --row: min(8.4dvw, 4.5dvh, 40px);
  --trow: min(8dvw, 4.4dvh, 30px);
  --line: 3px;
  --stripe: repeating-linear-gradient(135deg, var(--ak-accent) 0 8px, var(--ak-outline) 8px 16px);
}

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--ak-font-body);
  font-weight: 700;
  color: var(--ak-ink);
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer, var(--ak-bg-art));
  background-size: cover;
  background-position: center;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; touch-action: manipulation; }
button:focus-visible { outline: 3px solid var(--ak-focus); outline-offset: 3px; }

/* ---------- frame ---------- */

.app {
  height: 100dvh;
  width: min(100dvw, 540px);
  margin-inline: auto;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  touch-action: manipulation;
}

.bar {
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo { height: 100%; max-height: 44px; width: auto; max-width: 100%; display: block; }

.board { display: grid; gap: 8px; align-content: start; min-width: 0; }
.controls { min-width: 0; min-height: 0; display: grid; }
.pick { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 8px; min-height: 0; }

/* ---------- mute ---------- */

.mute {
  position: fixed;
  z-index: 35;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  width: 48px;
  height: 48px;
  padding: 0;
  border: var(--line) solid var(--ak-outline);
  border-radius: var(--ak-radius);
  background: var(--ak-surface);
  cursor: pointer;
}
.mute svg { width: 28px; height: 28px; display: block; margin: auto; }
.mute .spk { fill: var(--ak-ink); stroke: var(--ak-ink); stroke-width: 1.5; stroke-linejoin: round; }
.mute .wave, .mute .slash { fill: none; stroke: var(--ak-ink); stroke-width: 2.4; stroke-linecap: round; }
.mute .slash { display: none; stroke: var(--ak-accent); }
.mute.is-muted .slash { display: block; }
.mute.is-muted .wave { display: none; }

/* ---------- today ---------- */

.today {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 6px;
  padding: 8px;
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  border-top-width: 10px;
  border-image: var(--stripe) 10 3 3 3 / 10px 3px 3px 3px stretch;
}

.dayhead {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: var(--line) solid var(--ak-outline);
  font-family: var(--ak-font-display);
  letter-spacing: 0.06em;
  line-height: 1;
}
.dayhead-day { font-size: 28px; }
.dayhead-of { font-size: 17px; color: var(--ak-ink-muted); }
.chev-run { margin-left: auto; width: 48px; height: 16px; align-self: center; fill: none; stroke: var(--ak-accent); stroke-width: 4; stroke-linejoin: miter; }

.plates { display: flex; gap: 8px; }
.slot { margin: 0; width: var(--pw); }
.slot-cap {
  font-family: var(--ak-font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.1;
  padding-bottom: 2px;
  margin-bottom: 3px;
  border-bottom: var(--line) solid var(--ak-accent);
}
.slot-note { margin: 2px 0 0; font-size: 12px; line-height: 1.1; color: var(--ak-ink-muted); }
.plate { width: 100%; }
.sp { display: block; width: 100%; background-repeat: no-repeat; }
.plate-art { width: 100%; }
.crowd-svg { display: block; width: 100%; height: auto; }
.c-frame { fill: var(--ak-surface); stroke: var(--ak-outline); stroke-width: 4; }
.c-field { fill: var(--ak-accent-2); stroke: var(--ak-outline); stroke-width: 3; }
.who { fill: var(--ak-surface); stroke: var(--ak-outline); stroke-width: 3; stroke-linejoin: round; }
.c-word { font-family: var(--ak-font-display); font-size: 21px; letter-spacing: 0.04em; fill: var(--ak-ink); }

.money {
  margin: 0;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  border: var(--line) solid var(--ak-outline);
  background: var(--ak-surface);
  min-width: 0;
}
.money-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1px 8px;
  min-width: 0;
  min-height: 0;
}
.money-row + .money-row { border-top: var(--line) solid var(--ak-outline); }
.money dt, .money dd { margin: 0; }
.money dt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ak-font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--ak-ink-muted);
}
.money dt b { color: var(--ak-ink); font-weight: 400; }
.cup { height: 22px; width: auto; display: block; }
.money-val {
  font-family: var(--ak-font-display);
  font-size: 24px;
  letter-spacing: 0.04em;
  line-height: 1.05;
}
#cash { font-size: 28px; }
.money-cost { font-size: 20px; }

.today-cell { position: relative; margin: 0; display: flex; align-items: center; justify-content: center; min-height: 1.4em; overflow: hidden; }
.today-val {
  position: relative;
  margin: 2px 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  font-family: var(--ak-font-display);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0.04em;
}
.is-pow .today-val { background: var(--ak-surface); border: 2px solid var(--ak-outline); }

.tri { width: 0.62em; height: 0.62em; flex: none; fill: currentColor; }

.burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(0);
  fill: var(--ak-accent);
  stroke: var(--ak-outline);
  stroke-width: 5;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.is-pow .burst { transform: translate(-50%, -50%) scale(1); }

/* ---------- ledger ---------- */

.ledger {
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
}
.row {
  display: grid;
  grid-template-columns: 0.7fr 1.15fr 1.3fr 0.95fr 0.75fr 1.1fr;
  height: var(--row);
  position: relative;
}
.row + .row { border-top: 2px solid var(--ak-outline); }
.row-head { height: calc(var(--row) * 0.72); border-bottom: 4px solid var(--ak-accent); }
.row-head .cell { font-size: max(12px, calc(var(--row) * 0.36)); color: var(--ak-ink-muted); }
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 2px;
  font-family: var(--ak-font-display);
  font-size: max(13px, calc(var(--row) * 0.42));
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}
.cell + .cell { border-left: 2px solid var(--ak-outline); }
.row-head .cell + .cell { border-left-color: transparent; }
.v { display: inline-flex; align-items: center; justify-content: center; }
.v.is-guess { color: var(--ak-ink-muted); }
.row.is-today { outline: 4px solid var(--ak-accent); outline-offset: -4px; z-index: 1; }
.row.is-today .cell:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -7px;
  border: 7px solid transparent;
  border-left: 9px solid var(--ak-accent);
}

/* ledger stamps: the picture part of each plate, in place of squeezed lettering */
.stamp {
  position: relative;
  display: block;
  height: max(20px, calc(var(--row) * 0.74));
  aspect-ratio: 110 / 82;
  border: 2px solid var(--ak-outline);
  background: var(--ak-surface);
}
.stamp .sp { height: 100%; }
.stamp .crowd-svg { height: 100%; }
.stamp.is-guess { border-style: dashed; }
.stamp-q {
  position: absolute;
  right: -7px;
  bottom: -6px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ak-outline);
  border-radius: 50%;
  background: var(--ak-surface);
  font-family: var(--ak-font-display);
  font-size: 11px;
  line-height: 1;
}

/* ---------- the stand: kid waiting, jug on the shelf ---------- */

.stall {
  container-type: size;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.awning {
  display: none;
  flex: none;
  height: 96px;
  background: url("art/lemonade-stand.png") 0 0 / 100% 341px no-repeat;
}
.stall-row { flex: none; height: 58px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 6%; }
.jug { height: 54px; aspect-ratio: 250 / 112; }
.jug-art { height: 100%; }
.kid-spot { position: relative; height: 56px; width: 78px; }
.kid { position: absolute; left: 50%; bottom: 0; width: 64px; height: 60px; margin-left: -32px; overflow: visible; }
.kid-fill { fill: var(--ak-ink); }
.drop { fill: var(--ak-accent-2); stroke: var(--ak-outline); stroke-width: 1.5; }
.served { position: absolute; right: -14px; bottom: 0; height: 40px; width: auto; display: none; }
.stall[data-mood="served"] .served { display: block; }
.stall[data-mood="served"] .drop, .stall[data-mood="dry"] .drop { display: none; }
.stall[data-mood="dry"] .kid { bottom: -14px; }
@container (max-height: 57px) { .stall-row { display: none; } }
@container (min-height: 156px) { .awning { display: block; } }

/* ---------- controls: status, price signs, next ---------- */

.status {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: calc(3 * 1.25em + 16px);
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  font-size: 16px;
  line-height: 1.25;
}
.status-ico { background: var(--ak-accent); border-right: var(--line) solid var(--ak-outline); display: grid; place-items: center; }
.status-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--ak-btn-ink); stroke-width: 4; stroke-linecap: square; stroke-linejoin: miter; transform: rotate(90deg); }
.pick.is-result .status-ico svg { transform: none; }
.status-text { margin: 0; padding: 8px 10px; align-self: center; font-weight: 700; }

.prices {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  min-height: 0;
}
/* The counter: a slice of the painted stand, so the signs stand on its lip and the what-if cells sit on its front. */
.prices::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--counter);
  background: url("art/lemonade-stand.png") 0 calc(var(--counter) * -3.216) / 100% calc(var(--counter) * 5.189) no-repeat;
}
.price {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0 0;
  margin: 0;
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--lip);
  padding-bottom: 4px;
  cursor: pointer;
}
.price:disabled { cursor: default; }
.price-art { flex: 1 0 auto; display: flex; align-items: flex-end; justify-content: center; }
.price-sign { flex: none; }
.price:active:not(:disabled) .price-art { transform: translateY(3px); }
.price:disabled:not(.is-chosen) .price-art { opacity: 0.5; }
.price.is-chosen .price-art { transform: translateY(-4px); }

.wi {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: var(--wi);
  padding: 2px;
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  text-align: center;
  line-height: 1;
}
.wi-v {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--ak-font-display);
  font-size: 18px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.wi-t { min-height: 12px; font-family: var(--ak-font-display); font-size: 12px; letter-spacing: 0.06em; white-space: nowrap; }
.price.is-chosen .wi {
  background: var(--ak-choice-selected-bg);
  color: var(--ak-choice-selected-ink);
  border-color: var(--ak-choice-selected-border);
}
.price.is-best .wi { box-shadow: 0 0 0 3px var(--ak-accent-2); }

.foot { min-height: 56px; display: grid; align-items: center; }
.note { margin: 0; font-size: 14px; line-height: 1.25; color: var(--ak-ink-muted); }

.sign-btn {
  appearance: none;
  min-height: 56px;
  padding: 0 20px;
  border: var(--line) solid var(--ak-outline);
  border-radius: var(--ak-radius);
  background: var(--ak-btn-fill);
  color: var(--ak-btn-ink);
  font-family: var(--ak-font-display);
  font-size: 26px;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 10px 0 0 var(--ak-btn-active);
  padding-left: 28px;
}
.sign-btn:active { background: var(--ak-btn-active); }
.sign-alt { background: var(--ak-choice-bg); color: var(--ak-choice-ink); box-shadow: inset 10px 0 0 var(--ak-accent-2); }
.sign-alt:active { background: var(--ak-surface); }

.next {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  padding: 0 34px 0 28px;
  background: var(--ak-outline);
  box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
}
.next::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--ak-btn-fill);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%);
}
.next:active { background: var(--ak-outline); }
.next:active::before { background: var(--ak-btn-active); }
.next > * { position: relative; }
.next-arrow { width: 34px; height: 28px; fill: none; stroke: var(--ak-btn-ink); stroke-width: 3.4; stroke-linecap: square; }
.next:focus-visible { outline: none; }
.next:focus-visible::after {
  content: "";
  position: absolute;
  inset: 8px 24px 8px 8px;
  border: 3px dashed var(--ak-btn-ink);
  pointer-events: none;
}

/* ---------- worked example ---------- */

.app.is-teaching .ledger { display: none; }

.example {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px 12px 12px;
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  border-top-width: 10px;
  border-image: var(--stripe) 10 3 3 3 / 10px 3px 3px 3px stretch;
}
.example-head { margin: 0; font-family: var(--ak-font-display); font-size: 20px; letter-spacing: 0.08em; line-height: 1; }
.example-line { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 700; color: var(--ak-ink); }
.example-rows { display: grid; gap: 6px; }
.ex-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 56px; }
.ex-row p { margin: 0; font-size: 18px; line-height: 1.2; }
.ex-sign { width: calc(var(--scale) * 100%); justify-self: center; }

/* ---------- the ending ---------- */

.end {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer, var(--ak-bg-art));
  background-size: cover;
  background-position: center;
}
.end-top { min-height: var(--bar); margin: 0 60px 8px; display: flex; align-items: center; justify-content: center; }
.reason {
  margin: 0;
  width: 100%;
  padding: 6px 10px 6px 14px;
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  border-left: 12px solid var(--ak-accent);
  font-family: var(--ak-font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-align: center;
}
.end-main {
  width: min(100%, 520px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}
.end-left { min-width: 0; }
.end-right { display: grid; align-content: start; gap: 8px; min-width: 0; min-height: 0; }
.end-right.is-waiting { visibility: hidden; }

.sign {
  display: grid;
  background: var(--ak-surface);
  border: 4px solid var(--ak-outline);
  border-top-width: 12px;
  border-image: var(--stripe) 12 4 4 4 / 12px 4px 4px 4px stretch;
  transform-origin: 50% 50%;
}
.sign > * { grid-area: 1 / 1; }
.sign[data-face="front"] .sign-back { visibility: hidden; }
.sign[data-face="back"] .sign-front { visibility: hidden; }
.sign.is-turning { transform: scaleY(0.04); }

.sign-front { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px; }
.sign-stand { height: min(20dvh, 130px); width: auto; display: block; }
.sign-closed { margin: 0; font-family: var(--ak-font-display); font-size: min(14dvw, 9dvh, 60px); letter-spacing: 0.08em; line-height: 1; }

.sign-back { display: grid; justify-items: center; gap: 6px; padding: 8px 10px; }
.sign-head { margin: 0; font-family: var(--ak-font-display); font-size: 26px; letter-spacing: 0.1em; line-height: 1; }
.sign-num { position: relative; width: 100%; min-height: min(17dvh, 118px); display: grid; place-items: center; overflow: hidden; }
.sign-num .burst { display: none; }
.sign.has-pow .sign-num .burst { display: block; }
.sign.is-popped .sign-num .burst { transform: translate(-50%, -50%) scale(1); }
.sign-cash {
  position: relative;
  z-index: 1;
  padding: 0 14px;
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  font-family: var(--ak-font-display);
  font-size: min(15dvw, 10dvh, 68px);
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.sign-pow {
  display: none;
  position: absolute;
  z-index: 2;
  left: 6%;
  top: 4px;
  padding: 2px 8px;
  background: var(--ak-surface);
  border: var(--line) solid var(--ak-outline);
  font-family: var(--ak-font-display);
  font-size: 20px;
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.sign.has-pow .sign-pow { display: block; }
.sign-delta { display: flex; align-items: center; gap: 6px; font-size: 16px; line-height: 1.1; margin: 0; }

.end-says { margin: 0; font-size: 16px; line-height: 1.3; }
.end-miss { margin: 0; padding-left: 8px; border-left: 4px solid var(--ak-accent-2); font-size: 14px; line-height: 1.3; }

.trade { background: var(--ak-surface); border: var(--line) solid var(--ak-outline); }
.trow { display: grid; grid-template-columns: 0.6fr 1.2fr 1fr 1fr 1.1fr; height: var(--trow); }
.trow + .trow { border-top: 2px solid var(--ak-outline); }
.trow-head { border-bottom: 4px solid var(--ak-accent); }
.tcell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ak-font-display);
  font-size: max(13px, calc(var(--trow) * 0.5));
  letter-spacing: 0.04em;
  line-height: 1;
}
.tcell + .tcell { border-left: 2px solid var(--ak-outline); }
.trow-head .tcell { color: var(--ak-ink-muted); border-left-color: transparent; }

.end-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.end-btns .sign-btn { font-size: 22px; padding-inline: 12px 8px; }

/* ---------- most phones held upright: the ledger names the day, so the stand gets the room ---------- */

@media (orientation: portrait) and (max-height: 880px) {
  .today { padding: 6px 8px; border-top-width: 8px; }
  .dayhead { display: none; }
  .status { min-height: calc(2 * 1.25em + 14px); font-size: 15px; }
  .status-text { padding: 6px 10px; }
}

/* ---------- short phones held upright ---------- */

@media (orientation: portrait) and (max-height: 780px) {
  :root {
    --pw: min(21dvw, 11.5dvh, 118px);
    --row: min(9dvw, 4.4dvh, 42px);
    --trow: min(8dvw, 4.2dvh, 30px);
  }
  .app { gap: 6px; }
  .today { padding: 6px 8px; border-top-width: 8px; }
  .dayhead { display: none; }
  .status { min-height: calc(2 * 1.25em + 14px); }
  .status-text { padding: 6px 10px; }
  .foot { min-height: 48px; }
  .money-val { font-size: 22px; }
  #cash { font-size: 25px; }
}

@media (orientation: portrait) and (max-height: 700px) {
  :root { --lip: 14px; --wi: 38px; --trow: min(8dvw, 3.7dvh, 30px); --row: min(9dvw, 3.9dvh, 42px); --pw: min(21dvw, 11dvh, 118px); }
  .app { gap: 4px; }
  .board { gap: 6px; }
  .money-row { padding-block: 0; }
  .money dt { font-size: 12px; }
  .money-val { font-size: 19px; }
  #cash { font-size: 21px; }
  .money-cost { font-size: 17px; }
  .cup { height: 18px; }
  .today-val { font-size: 20px; margin: 0; }
  .status-text { font-size: 15px; }
  .wi-v { font-size: 16px; }
  .price { padding-top: 0; }
  .end-top { margin-bottom: 4px; }
  .end-main { gap: 6px; }
  .end-right { gap: 6px; }
  .reason { font-size: 16px; }
  .sign-back { gap: 2px; padding: 4px 10px 6px; }
  .sign-head { font-size: 22px; }
  .sign-num { min-height: 88px; }
  .sign-cash { font-size: min(13dvw, 50px); }
  .sign-delta { font-size: 15px; }
  .end-says { font-size: 15px; line-height: 1.25; }
  .end-miss { font-size: 13px; }
  .end-btns .sign-btn { font-size: 19px; min-height: 48px; }
}

/* ---------- phone turned sideways ---------- */

@media (orientation: landscape) {
  :root {
    --bar: 40px;
    --pw: min(12dvw, 18dvh, 118px);
    --row: min(5dvw, 5.7dvh, 42px);
    --trow: min(4.4dvw, 6dvh, 28px);
  }
  .app {
    width: min(100dvw, 980px);
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 14px;
  }
  .bar { grid-column: 1; grid-row: 1; }
  .board { grid-column: 1; grid-row: 2; }
  .controls { grid-column: 2; grid-row: 1 / span 2; padding-top: 48px; }
  .today { padding: 6px 8px; row-gap: 4px; border-top-width: 8px; }
  .dayhead { padding-bottom: 2px; }
  .dayhead-day { font-size: 22px; }
  .dayhead-of { font-size: 15px; }
  .slot-cap { font-size: 13px; margin-bottom: 2px; }
  .money-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; }
  .money-val { font-size: 22px; }
  #cash { font-size: 24px; }
  .money-cost { font-size: 20px; }
  .today-cell { flex: 1; }
  .example { gap: 6px; padding: 6px 10px 8px; border-top-width: 8px; }
  .example-head { font-size: 17px; }
  .ex-row { min-height: 48px; }
  .logo { max-height: 36px; }
  .end-top { margin-inline: 60px; }
  .end-main {
    width: min(100%, 900px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
  }
  .end-says { font-size: 15px; }
  .end-miss { font-size: 13px; }
  .sign-num { min-height: min(24dvh, 100px); }
  .sign-cash { font-size: min(8dvw, 14dvh, 60px); }
  .sign-front { flex-direction: column; gap: 4px; }
  .sign-stand { height: min(24dvh, 100px); }
  .sign-closed { font-size: min(6dvw, 10dvh, 48px); }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .flip { transform-origin: 50% 50%; }
  .flip.is-flipping { animation: flap 340ms ease-in-out; }
  @keyframes flap {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0.05); }
    100% { transform: scaleY(1); }
  }
  .price-art { transition: transform 200ms ease-out, opacity 200ms; }
  .kid { transition: bottom 300ms ease-out; }
  .stall[data-mood="waiting"] .kid { animation: peek 1800ms ease-in-out infinite; }
  .stall[data-mood="waiting"] .drop { animation: sweat 1800ms ease-in-out infinite; }
  @keyframes peek { 0%, 100% { bottom: -3px; } 50% { bottom: 2px; } }
  @keyframes sweat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
  .burst { transition: transform 360ms cubic-bezier(0.3, 1.7, 0.5, 1); }
  .sign { transition: transform 260ms ease-in; }
  .pick:not(.is-result) .status-ico svg { animation: nudge 900ms ease-in-out infinite; }
  .pick.is-first:not(.is-result) .prices { animation: slide-in 420ms ease-out; }
  @keyframes nudge {
    0%, 100% { transform: rotate(90deg) translateX(-2px); }
    50% { transform: rotate(90deg) translateX(4px); }
  }
  @keyframes slide-in {
    from { transform: translateX(-24px); }
    to { transform: none; }
  }
  @media (hover: hover) {
    .price:hover:not(:disabled) .price-art { transform: translateY(-4px); }
  }
}

@media (hover: hover) {
  .sign-btn:hover { background: var(--ak-btn-hover); }
  .sign-alt:hover { background: var(--ak-surface); }
  .next:hover { background: var(--ak-outline); }
  .next:hover::before { background: var(--ak-btn-hover); }
}
