/* All Aboard — chunky preschool UI */

.aa-root {
  --aa-ink: #263238;
  --aa-teal: #2a9d8f;
  --aa-teal-deep: #1f7a6f;
  --aa-sun: #ffd54f;
  --aa-orange: #ff9800;
  --aa-sky: #81d4fa;
  --aa-grass: #7cb342;
  --aa-white: #ffffff;
  --outline: 5px;
  --radius-chunky: 1.75rem;
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
  --bar-h: 9.5rem;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #5dade2;
  overflow: hidden;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: white;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.aa-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0.45rem;
  pointer-events: none;
}

.aa-chrome > * {
  pointer-events: auto;
}

.aa-exit {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--aa-orange);
  border: var(--outline) solid var(--aa-white);
  color: var(--aa-white);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 5px 0 rgba(38, 50, 56, 0.18);
}

.aa-exit:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-hud-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.aa-hearts {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2.4rem;
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(38, 50, 56, 0.22));
}

.aa-heart {
  color: #e53935;
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
}

/* Shared chunky outlined counter text (hearts / coins / wood / readouts) */
.aa-heart-count,
.aa-badge [data-hud-coins],
.aa-badge [data-hud-wood],
.aa-readouts {
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow:
    1px 0 0 #fff,
    -1px 0 0 #fff,
    0 1px 0 #fff,
    0 -1px 0 #fff,
    0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-heart-count {
  color: #e53935;
  font-size: 1.05rem;
}

/* Currency counts — icon + number, no pill containers */
.aa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2.4rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-weight: 800;
  font-size: 1.05rem;
  color: #e53935;
  box-shadow: none;
  filter: drop-shadow(0 2px 0 rgba(38, 50, 56, 0.22));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.aa-badge--coins {
  background: transparent;
  color: #e53935;
}

.aa-badge--coins [data-hud-coins] {
  color: #e53935;
}

.aa-badge.is-pulse {
  animation: aa-hud-pulse 0.45s var(--ease-pop);
}

.aa-coin-icon {
  flex-shrink: 0;
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  overflow: visible;
}

.aa-overlay__sub .jg-coin-icon {
  display: inline-block;
  vertical-align: -0.35em;
}

.aa-shop__btn .jg-coin-cost {
  color: inherit;
}

.aa-badge [data-hud-coins],
.aa-badge [data-hud-wood] {
  min-width: 1.1ch;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.aa-badge--wood {
  background: transparent;
  color: #e53935;
}

.aa-badge--wood [data-hud-wood] {
  color: #e53935;
}

@keyframes aa-hud-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

.aa-stage {
  flex: 1;
  position: relative;
  min-height: 0;
}

.aa-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.aa-toast {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  min-width: 10rem;
  max-width: min(90vw, 16rem);
  padding: 0.55rem 1rem;
  border-radius: 1rem;
  background: rgba(38, 50, 56, 0.82);
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.2);
}

.aa-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.45rem;
  min-height: var(--bar-h);
  padding: 0.45rem 0.65rem max(0.55rem, env(safe-area-inset-bottom));
  background: transparent;
  pointer-events: none;
}

.aa-bar > * {
  pointer-events: auto;
}

.aa-bar--action {
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* Stats + follow stacked above GO / throttle / STOP (bottom-right) */
.aa-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.aa-controls__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

/* World-anchored station actions (below Meadow Loop Station / track) */
.aa-station-menu {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 9.5rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border-radius: 1.15rem;
  background: rgba(255, 248, 231, 0.96);
  border: var(--outline) solid var(--aa-ink);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.18);
  pointer-events: auto;
  will-change: transform;
}

.aa-station-menu[hidden] {
  display: none !important;
}

.aa-station-menu__btn[disabled] {
  opacity: 0.45;
  cursor: default;
}

.aa-station-menu__btn[data-station-upgrade="speed"] {
  background: var(--aa-teal);
  color: var(--aa-white);
}

.aa-station-menu__btn[data-station-upgrade="heart"] {
  background: #e57373;
  color: var(--aa-white);
}

.aa-station-menu__btn[data-station-upgrade="repair"] {
  background: var(--aa-sun);
  color: var(--aa-ink);
}

.aa-station-menu__btn[data-station-upgrade="depot"] {
  background: #8d6e63;
  color: var(--aa-white);
}

.aa-station-menu__btn[data-station-upgrade="unload-wood"] {
  background: #a1887f;
  color: var(--aa-white);
}

.aa-station-menu__btn[data-station-upgrade="helpers"],
.aa-station-menu__btn[data-station-upgrade="board"] {
  background: #42a5f5;
  color: var(--aa-white);
}

.aa-station-menu__btn[data-station-upgrade="dropoff"] {
  background: #66bb6a;
  color: var(--aa-white);
}

.aa-station-menu__cost {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.85em;
  opacity: 0.95;
}

.aa-station-menu__cost .jg-coin-cost {
  display: inline-flex;
}

/* Invisible hit target over fallen trees — count only, no ring chrome */
.aa-track-taps {
  position: absolute;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  overflow: hidden;
}

.aa-track-tap {
  appearance: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.aa-track-tap--tree {
  animation: aa-track-tap-pulse 1.1s ease-in-out infinite;
}

.aa-track-tap[hidden] {
  display: none !important;
}

.aa-track-tap__count {
  display: none !important;
}

.aa-track-tap:active {
  transform: translate(-50%, -50%) scale(0.94);
}

@keyframes aa-track-tap-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

/* Screen-space juice (stars / flying coins) */
.aa-fx {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  overflow: hidden;
}

.aa-fx-star {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: #ffd54f;
  text-shadow:
    0 0 0 #fff,
    1px 1px 0 #f9a825,
    0 2px 0 rgba(38, 50, 56, 0.2);
  transform: translate(-50%, -50%);
  animation: aa-star-burst 0.65s var(--ease-pop) forwards;
  animation-delay: var(--aa-fx-delay, 0ms);
}

.aa-fx-fly-coin,
.aa-fx-pop-coin {
  position: fixed;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  margin: 0;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 0 rgba(38, 50, 56, 0.2));
  will-change: transform, opacity;
}

.aa-fx-fly-wood {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 1.7rem;
  line-height: 1;
}

.aa-fx-fly-coin.is-flying {
  animation: aa-coin-fly-hud 0.62s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

.aa-fx-pop-coin {
  animation: aa-coin-pop 0.4s var(--ease-pop) forwards;
}

.aa-fx-fly-coin .jg-coin-icon,
.aa-fx-pop-coin .jg-coin-icon,
.aa-fx-fly-coin svg,
.aa-fx-pop-coin svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes aa-star-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--aa-fx-dx, 0px)),
        calc(-50% + var(--aa-fx-dy, 0px))
      )
      scale(0.85) rotate(var(--aa-fx-rot, 40deg));
  }
}

@keyframes aa-coin-fly-hud {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
    transform: translate(
        calc(-50% + var(--aa-fx-dx, 0px)),
        calc(-50% + var(--aa-fx-dy, 0px))
      )
      scale(0.45);
  }
}

@keyframes aa-coin-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.2);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Soft-fail fade */
.aa-fade {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #0d1518;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

.aa-fade.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.aa-fade[hidden] {
  display: none !important;
}

.aa-station-menu__title {
  margin: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--aa-ink);
  text-align: center;
  line-height: 1.15;
}

.aa-station-menu__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.aa-station-menu__btn {
  appearance: none;
  min-height: 2.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 4px solid var(--aa-ink);
  background: var(--aa-teal);
  color: var(--aa-white);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.16);
  cursor: pointer;
}

.aa-station-menu__btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(38, 50, 56, 0.16);
}


.aa-drive-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.aa-bar__label {
  width: 100%;
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.35);
}

.aa-bar__actions {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.aa-readouts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.1rem;
  font-size: 0.95rem;
  text-align: right;
  color: #e53935;
  min-width: 0;
}

.aa-readouts .aa-cargo {
  color: #e53935;
}

/* Vertical throttle — chunky Sesame chrome (matches design system) */
.aa-throttle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3.4rem;
  height: 6.75rem;
  user-select: none;
  touch-action: none;
}

.aa-throttle--disabled {
  opacity: 0.45;
}

.aa-throttle__track {
  position: relative;
  width: 2.85rem;
  height: 100%;
  border-radius: 1.5rem;
  background: #fff8e7;
  border: var(--outline) solid var(--aa-white);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.16);
  overflow: hidden;
}

.aa-throttle--go .aa-throttle__track {
  background: #e8f5e9;
}

.aa-throttle--stop .aa-throttle__track {
  background: #fff3f3;
}

.aa-throttle__fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: #43a047;
  pointer-events: none;
  transition: height 80ms linear;
}

.aa-throttle--dragging .aa-throttle__fill {
  transition: none;
}

.aa-throttle--stop .aa-throttle__fill {
  background: #e53935;
}

.aa-throttle__knob {
  appearance: none;
  position: absolute;
  left: 50%;
  bottom: 4px;
  margin-left: -1.15rem;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border-radius: 999px;
  border: var(--outline) solid var(--aa-white);
  background: #ffd54f;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.18);
  cursor: grab;
  touch-action: none;
  z-index: 2;
}

.aa-throttle--dragging .aa-throttle__knob {
  cursor: grabbing;
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-btn {
  appearance: none;
  border: var(--outline) solid var(--aa-white);
  border-radius: 1.1rem;
  min-width: 3.1rem;
  min-height: 3.1rem;
  padding: 0.35rem 0.7rem;
  background: var(--aa-teal);
  color: white;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.16);
  cursor: pointer;
  transition:
    transform 160ms var(--ease-pop),
    box-shadow 160ms ease;
}

.aa-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-btn--go {
  background: #43a047;
  min-width: 4.2rem;
  border-radius: 999px;
}

.aa-btn--go-full {
  min-width: 3.2rem;
  min-height: 2.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #43a047;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.16);
}

.aa-btn--ghost {
  background: #546e7a;
  font-size: 1.1rem;
  border-radius: 999px;
}

.aa-btn--warn {
  background: var(--aa-orange);
}

/* Compact stop CTA stacked under the throttle */
.aa-btn--stop {
  align-self: center;
  min-width: 3.2rem;
  min-height: 2.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: var(--outline) solid var(--aa-white);
  background: #e53935;
  color: var(--aa-white);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.05;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.16);
}

.aa-btn--stop:active {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-btn--stop:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Reverse cruise — fixed-speed backwards under STOP */
.aa-btn--reverse {
  align-self: center;
  min-width: 3.2rem;
  min-height: 2.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: var(--outline) solid var(--aa-white);
  background: #5c6bc0;
  color: var(--aa-white);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.05;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.16);
}

.aa-btn--reverse:active {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-btn--reverse-on {
  background: #3949ab;
  box-shadow:
    0 4px 0 rgba(38, 50, 56, 0.16),
    inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.aa-btn--reverse:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.aa-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  align-content: center;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem
    max(0.5rem, env(safe-area-inset-bottom));
  background: rgba(38, 50, 56, 0.45);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.aa-overlay[hidden],
.aa-bar[hidden],
.aa-answers[hidden],
.aa-shop[hidden],
.aa-logs[hidden],
.aa-overlay__action[hidden],
.aa-overlay__hero[hidden] {
  display: none !important;
}

.aa-overlay__card {
  width: min(92vw, 22rem);
  max-height: calc(
    100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  box-sizing: border-box;
  padding: 0.9rem 0.9rem 0.8rem;
  border-radius: var(--radius-chunky);
  background: var(--aa-white);
  border: var(--outline) solid var(--aa-ink);
  color: var(--aa-ink);
  box-shadow: 0 10px 0 rgba(38, 50, 56, 0.2);
  text-align: center;
  overflow-y: auto;
  touch-action: pan-y;
}

.aa-overlay__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin: 0 0 0.35rem;
}

.aa-overlay__icon {
  display: block;
  font-size: clamp(1.85rem, 9vw, 2.5rem);
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(38, 50, 56, 0.12));
}

.aa-overlay__eyebrow {
  margin: 0;
  font-size: clamp(0.85rem, 2.8vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #546e7a;
}

.aa-overlay__prompt {
  margin: 0 0 0.65rem;
  font-size: clamp(1.85rem, 8.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--aa-ink);
}

.aa-overlay__card--math .aa-overlay__prompt,
.aa-overlay__card--fuel .aa-overlay__prompt {
  font-variant-numeric: tabular-nums;
}

.aa-overlay__prompt[hidden],
.aa-overlay__eyebrow:empty,
.aa-overlay__prompt:empty {
  display: none !important;
}

.aa-overlay__sub {
  margin: 0.2rem 0 0.65rem;
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.85;
}

.aa-overlay__sub[hidden] {
  display: none !important;
}

.aa-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.aa-answer {
  appearance: none;
  min-height: 3rem;
  border-radius: 1.1rem;
  border: var(--outline) solid var(--aa-ink);
  background: var(--aa-sun);
  color: var(--aa-ink);
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(1.2rem, 5vw, 1.4rem);
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.18);
  cursor: pointer;
}

.aa-answer:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.aa-answer[disabled] {
  opacity: 0.35;
}

.aa-overlay__action {
  appearance: none;
  width: 100%;
  min-height: 2.85rem;
  margin-top: 0.2rem;
  border-radius: 1.15rem;
  border: var(--outline) solid var(--aa-ink);
  background: var(--aa-teal);
  color: white;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.18);
  cursor: pointer;
}

/* Short phones / landscape — keep the whole card on screen */
@media (max-height: 700px) {
  .aa-overlay {
    padding: max(0.35rem, env(safe-area-inset-top)) 0.55rem
      max(0.35rem, env(safe-area-inset-bottom));
  }

  .aa-overlay__card {
    padding: 0.65rem 0.7rem 0.55rem;
    border-radius: 1.35rem;
    box-shadow: 0 6px 0 rgba(38, 50, 56, 0.2);
  }

  .aa-overlay__hero {
    margin-bottom: 0.2rem;
  }

  .aa-overlay__icon {
    font-size: 1.65rem;
  }

  .aa-overlay__prompt {
    font-size: clamp(1.45rem, 6.5vw, 1.9rem);
    margin-bottom: 0.4rem;
  }

  .aa-answers {
    gap: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .aa-answer {
    min-height: 2.55rem;
    font-size: 1.15rem;
    border-radius: 0.95rem;
    box-shadow: 0 3px 0 rgba(38, 50, 56, 0.18);
  }

  .aa-overlay__action {
    min-height: 2.45rem;
    font-size: 0.95rem;
    box-shadow: 0 3px 0 rgba(38, 50, 56, 0.18);
  }
}

@media (max-height: 520px) {
  .aa-overlay__icon {
    font-size: 1.35rem;
  }

  .aa-overlay__eyebrow {
    font-size: 0.75rem;
  }

  .aa-answers {
    grid-template-columns: repeat(4, 1fr);
  }

  .aa-answer {
    min-height: 2.35rem;
    font-size: 1.05rem;
  }
}

.aa-shop {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  text-align: left;
}

.aa-shop__btn {
  appearance: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.45rem 0.75rem;
  border-radius: 1rem;
  border: 4px solid var(--aa-ink);
  background: #e0f2f1;
  color: var(--aa-ink);
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.aa-shop__btn:disabled {
  opacity: 0.45;
}

.aa-logs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  min-height: 4rem;
}

.aa-mill-stage {
  position: relative;
  width: min(100%, 14rem);
  height: 5.5rem;
  margin: 0 auto 0.85rem;
  border-radius: 1.1rem;
  border: 4px solid var(--aa-ink);
  background: linear-gradient(180deg, #b3e5fc 0%, #81c784 70%);
  overflow: hidden;
}

.aa-mill-stage[hidden] {
  display: none !important;
}

.aa-mill-stage__car {
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  transform: translateX(-50%);
  width: 7.5rem;
  height: 2.6rem;
  border-radius: 0.75rem;
  border: 3px solid var(--aa-ink);
  background: #ffb74d;
  box-shadow: 0 3px 0 rgba(38, 50, 56, 0.18);
}

.aa-mill-stage__bed {
  position: absolute;
  inset: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  background: #6d4c41;
  border: 2px solid var(--aa-ink);
}

.aa-mill-stage__fill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display, Fredoka, sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff8e7;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.aa-mill-stage__log {
  position: absolute;
  left: 1rem;
  top: 0.35rem;
  font-size: 1.75rem;
  opacity: 0;
  transform: translate(0, 0) scale(0.7);
  pointer-events: none;
}

.aa-mill-stage--load .aa-mill-stage__log {
  animation: aa-mill-load 0.5s var(--ease-pop, cubic-bezier(0.34, 1.56, 0.64, 1)) forwards;
}

@keyframes aa-mill-load {
  0% {
    opacity: 0;
    transform: translate(0, -0.4rem) scale(0.6);
  }
  35% {
    opacity: 1;
    transform: translate(3.2rem, 0.6rem) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(5.2rem, 1.6rem) scale(0.85);
  }
}

.aa-clock {
  display: grid;
  place-items: center;
  margin: 0 auto 0.85rem;
}

.aa-clock[hidden] {
  display: none !important;
}

.aa-clock__dial {
  position: relative;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  border: 5px solid var(--aa-ink);
  background: radial-gradient(circle at 35% 30%, #fffde7, #ffe082 70%, #ffca28);
  box-shadow: 0 5px 0 rgba(38, 50, 56, 0.16);
}

.aa-clock__mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.28rem;
  height: 0.7rem;
  margin-left: -0.14rem;
  background: var(--aa-ink);
  border-radius: 2px;
  transform: rotate(calc(var(--i) * 30deg)) translateY(-4.1rem);
}

.aa-clock__hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: 50% 100%;
  background: var(--aa-ink);
  border-radius: 999px;
}

.aa-clock__hand--hour {
  width: 0.42rem;
  height: 2.4rem;
  margin-left: -0.21rem;
}

.aa-clock__hand--minute {
  width: 0.28rem;
  height: 3.4rem;
  margin-left: -0.14rem;
}

.aa-clock__hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin: -0.35rem 0 0 -0.35rem;
  border-radius: 50%;
  background: var(--aa-ink);
  border: 3px solid #fff8e7;
}

.aa-log {
  appearance: none;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1rem;
  border: 4px solid var(--aa-ink);
  background: #a1887f;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.18);
  animation: aa-pop 0.35s var(--ease-pop);
}

.aa-log:active {
  transform: scale(0.9);
}

@keyframes aa-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ═════════ Visual refresh (2026-09) — chunky mobile HUD ═════════ */

/* Top bar: white pills with ink borders (matches Word Hunt / Cup Hunt) */
.aa-hud-right {
  gap: 0.4rem;
}
.aa-hearts,
.aa-badge {
  min-height: 2.6rem;
  padding: 0.15rem 0.7rem 0.15rem 0.5rem;
  gap: 0.3rem;
  border-radius: 999px;
  background: #fff;
  border: 4px solid var(--aa-ink);
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.25);
  filter: none;
  color: var(--aa-ink);
  font-size: 1.15rem;
}
.aa-badge[hidden] {
  display: none;
}
.aa-heart {
  -webkit-text-stroke: 0;
  font-size: 1.3rem;
}
.aa-heart-count,
.aa-badge [data-hud-coins],
.aa-badge [data-hud-wood],
.aa-badge [data-hud-riders] {
  color: var(--aa-ink);
  text-shadow: none;
  font-size: 1.15rem;
}
.aa-badge--wood {
  background: #fff3c4;
}
.aa-badge--riders {
  background: #e3f2fd;
}
/* JG-038: debug mode tag */
.aa-badge--debug {
  background: #ffcdd2;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
/* JG-071: debug "Fill spots" button */
.aa-badge--btn {
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  background: #fff9c4;
}
.aa-badge--water {
  background: #b3e5fc;
}
.aa-badge--stone {
  background: #eceff1;
}
.aa-exit {
  border: 4px solid #fff;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
}
.aa-toast {
  top: calc(max(0.75rem, env(safe-area-inset-top)) + 3.6rem);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: #fff;
  color: var(--aa-ink);
  border: 4px solid var(--aa-ink);
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.25);
  max-width: min(88vw, 22rem);
  font-size: 1.05rem;
}

/* Drive controls: speed numbers hidden (kids steer by feel), TOOT on top */
.aa-readouts {
  display: none;
}
.aa-controls__meta {
  flex-direction: row;
  gap: 0.35rem;
}
.aa-btn--ghost {
  width: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0;
  border: 4px solid #fff;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
}
.aa-btn--toot {
  min-height: 3rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 4px solid #fff;
  background: #ffb300;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.45);
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
}
.aa-btn--toot.is-tooting {
  animation: aa-toot 0.45s var(--ease-pop);
}
@keyframes aa-toot {
  30% { transform: scale(1.18) rotate(-6deg); }
  60% { transform: scale(0.95) rotate(4deg); }
}
.aa-drive-stack {
  padding: 0.4rem 0.35rem 0.45rem;
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.55);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.15);
}
.aa-btn--go-full,
.aa-btn--stop,
.aa-btn--reverse {
  border-width: 4px;
}

/* Station menu: a bottom card (left of the drive controls) instead of floating */
.aa-station-menu {
  position: absolute;
  left: max(0.6rem, env(safe-area-inset-left));
  right: calc(6.4rem + env(safe-area-inset-right));
  top: auto !important;
  bottom: max(0.6rem, env(safe-area-inset-bottom));
  transform: none !important;
  max-width: 34rem;
  min-width: 0;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.6rem 0.65rem 0.7rem;
  border-radius: 1.4rem;
  background: #fffaf0;
  border: 4px solid var(--aa-ink);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.3);
  animation: aa-card-up 0.35s var(--ease-pop);
}
@keyframes aa-card-up {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.aa-station-menu__title {
  font-size: 1.1rem;
  text-align: left;
  padding-left: 0.2rem;
}
.aa-station-menu__actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr));
  gap: 0.45rem;
}
.aa-station-menu__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 2.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.98rem;
  text-align: left;
  box-shadow: 0 4px 0 var(--aa-ink);
}
.aa-station-menu__btn:active {
  box-shadow: 0 1px 0 var(--aa-ink);
}
.aa-station-menu__btn[disabled] {
  opacity: 0.5;
}

/* Non-station stops (mill, home…) — bottom action bar as a card too */
.aa-bar--action {
  left: max(0.6rem, env(safe-area-inset-left));
  right: max(0.6rem, env(safe-area-inset-right));
  bottom: max(0.6rem, env(safe-area-inset-bottom));
  min-height: 0;
  margin: 0 auto;
  max-width: 30rem;
  padding: 0.6rem 0.7rem 0.7rem;
  gap: 0.5rem;
  border-radius: 1.4rem;
  background: #fffaf0;
  border: 4px solid var(--aa-ink);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.3);
  pointer-events: auto;
}
.aa-bar__label {
  color: var(--aa-ink);
  text-shadow: none;
  font-size: 1.15rem;
}
.aa-bar--action .aa-btn {
  border-color: var(--aa-ink);
  box-shadow: 0 4px 0 var(--aa-ink);
  border-radius: 999px;
  min-height: 3.2rem;
  padding: 0.3rem 1.1rem;
}

/* Phones: compact stat badges, and they wrap to a second row rather than
   running off the screen (tank + hopper + debug make it long) */
@media (max-width: 560px) {
  .aa-hearts,
  .aa-badge {
    min-height: 2.25rem;
    padding: 0.1rem 0.5rem 0.1rem 0.35rem;
    border-width: 3px;
    font-size: 1rem;
  }
  .aa-hud-right {
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .aa-badge--debug .aa-badge__txt {
    display: none; /* just the 🐞 */
  }
}

/* Small phones: tighter top bar */
@media (max-width: 380px) {
  .aa-hearts,
  .aa-badge {
    min-height: 2.3rem;
    padding: 0.1rem 0.5rem 0.1rem 0.35rem;
    font-size: 1rem;
  }
  .aa-hud-right {
    gap: 0.25rem;
  }
}

/* Phone on its side: card stays short */
@media (max-height: 500px) and (orientation: landscape) {
  .aa-station-menu {
    max-width: 40rem;
    padding: 0.4rem 0.55rem 0.5rem;
  }
  .aa-station-menu__btn {
    min-height: 2.5rem;
  }
  .aa-drive-stack {
    padding: 0.25rem;
    gap: 0.2rem;
  }
}

/* "Find the train" sits under the exit button (keeps the control column slim) */
.aa-btn--ghost[data-find-train] {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left));
  top: calc(max(0.75rem, env(safe-area-inset-top)) + 3.7rem);
  z-index: 21;
}
.aa-station-menu {
  right: calc(6.2rem + env(safe-area-inset-right));
}
.aa-station-menu__actions {
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
}
@media (max-width: 430px) {
  .aa-station-menu__btn {
    min-height: 2.6rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.88rem;
  }
}

/* Narrow phones: 4 HUD pills + exit fit on one row */
.aa-exit {
  flex-shrink: 0;
}
@media (max-width: 430px) {
  .aa-chrome {
    gap: 0.3rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .aa-exit {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.25rem;
  }
  .aa-hud-right {
    gap: 0.22rem;
    min-width: 0;
  }
  .aa-hearts,
  .aa-badge {
    min-height: 2.25rem;
    padding: 0.05rem 0.45rem 0.05rem 0.32rem;
    gap: 0.15rem;
    border-width: 3px;
    font-size: 0.98rem;
  }
  .aa-heart {
    font-size: 1.05rem;
  }
  .aa-heart-count,
  .aa-badge [data-hud-coins],
  .aa-badge [data-hud-wood],
  .aa-badge [data-hud-riders] {
    font-size: 0.98rem;
  }
  .aa-coin-icon,
  .aa-badge .jg-coin-icon {
    width: 1.2rem;
    height: 1.2rem;
  }
  .aa-btn--ghost[data-find-train] {
    top: calc(max(0.75rem, env(safe-area-inset-top)) + 3.1rem);
    width: 2.6rem;
    min-width: 2.6rem;
    min-height: 2.6rem;
  }
}

/* ═════════ Stop bubbles · follow button · stop card extras ═════════ */

/* Follow-train button back beside TOOT (overrides the earlier top-left spot) */
.aa-btn--ghost[data-find-train] {
  position: static;
  width: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0;
  display: grid;
  place-items: center;
  background: #26a69a;
  color: #fff;
}
.aa-follow-icon {
  width: 1.75rem;
  height: 1.75rem;
}
.aa-btn--ghost[data-find-train].is-free {
  background: #ff7043;
  animation: aa-follow-pulse 1.1s ease-in-out infinite;
}
@keyframes aa-follow-pulse {
  50% { transform: scale(1.12); }
}
.aa-btn--toot {
  width: 3rem;
  min-width: 3rem;
  padding: 0;
  font-size: 0.72rem;
  letter-spacing: 0;
}
.aa-controls__meta {
  gap: 0.3rem;
}
.aa-station-menu {
  right: calc(7rem + env(safe-area-inset-right));
  padding-right: 2.6rem;
}
@media (max-width: 430px) {
  .aa-btn--ghost[data-find-train] {
    top: auto;
    width: 2.8rem;
    min-width: 2.8rem;
    min-height: 2.8rem;
  }
  .aa-btn--toot {
    width: 2.8rem;
    min-width: 2.8rem;
    min-height: 2.8rem;
  }
  .aa-station-menu {
    right: calc(6.5rem + env(safe-area-inset-right));
  }
}
.aa-station-menu__close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 3px solid var(--aa-ink);
  background: #fff;
  color: var(--aa-ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.aa-station-menu__note {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6d4c41;
}
.aa-station-menu__note[hidden] {
  display: none;
}
.aa-station-menu__btn[data-station-upgrade="chop"] {
  background: #8d6e63;
  color: #fff;
}

/* Chat bubbles over stops — tap to stop the train here */
.aa-bubbles {
  position: absolute;
  inset: 0;
  z-index: 27; /* above the fallen-tree tap targets */
  pointer-events: none;
}
.aa-bubble {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem 0.4rem 0.55rem;
  border-radius: 999px;
  border: 4px solid var(--aa-ink);
  background: #fff;
  color: var(--aa-ink);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  box-shadow: 0 5px 0 rgba(38, 50, 56, 0.35);
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.aa-bubble[hidden] {
  display: none;
}
/* speech-bubble tail */
.aa-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  background: inherit;
  border-right: 4px solid var(--aa-ink);
  border-bottom: 4px solid var(--aa-ink);
  transform: rotate(45deg);
  border-radius: 0 0 4px 0;
}
.aa-bubble__icon {
  font-size: 1.35rem;
  line-height: 1;
}
.aa-bubble.is-mill {
  background: #ffe0b2;
}
.aa-bubble.is-water {
  background: #b3e5fc;
}
.aa-bubble.is-stone {
  background: #e0e0e0;
}
.aa-bubble.is-riders {
  background: #e3f2fd;
}
.aa-bubble.is-drop {
  background: #c8e6c9;
}
.aa-bubble.is-home {
  background: #fff3c4;
}
/* Train stopped nearby: bounce to say "tap me!" */
.aa-bubble.is-ready .aa-bubble__label,
.aa-bubble.is-ready .aa-bubble__icon {
  display: inline-block;
  animation: aa-bubble-hop 0.9s ease-in-out infinite;
}
.aa-bubble.is-drop .aa-bubble__icon {
  display: inline-block;
  animation: aa-wave 0.8s ease-in-out infinite;
}
@keyframes aa-bubble-hop {
  50% { transform: translateY(-4px) scale(1.06); }
}
@keyframes aa-wave {
  50% { transform: rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .aa-bubble.is-ready .aa-bubble__label,
  .aa-bubble.is-ready .aa-bubble__icon,
  .aa-bubble.is-drop .aa-bubble__icon,
  .aa-btn--ghost[data-find-train].is-free {
    animation: none;
  }
}

/* ═════════ Settings (⚙️) — same pattern as Cup Hunt / Number Dash ═════════ */
.aa-settings-btn {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 4px solid #fff;
  background: #7e57c2;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
  cursor: pointer;
}
.aa-settings-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.3);
}
.aa-settings {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  background: rgba(38, 50, 56, 0.45);
  overflow-y: auto;
}
.aa-settings[hidden] {
  display: none;
}
.aa-settings__card {
  width: min(26rem, 100%);
  box-sizing: border-box;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 1.6rem;
  background: #fffaf0;
  color: var(--aa-ink);
  border: 5px solid var(--aa-ink);
  box-shadow: 0 8px 0 rgba(38, 50, 56, 0.35);
  animation: aa-set-pop 0.32s var(--ease-pop);
}
@keyframes aa-set-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.aa-settings__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.aa-settings__head h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}
.aa-settings__close {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 4px solid var(--aa-ink);
  background: #fff;
  color: var(--aa-ink);
  font: inherit;
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.aa-settings__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.aa-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.2rem;
  border-radius: 1rem;
  border: 3px solid var(--aa-ink);
  background: #e3f2fd;
}
.aa-stat b {
  font-size: 1.3rem;
  line-height: 1.1;
}
.aa-stat span {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.8;
}
.aa-settings__section {
  padding: 0.6rem 0 0.2rem;
  border-top: 2px dashed rgba(38, 50, 56, 0.15);
  margin-top: 0.5rem;
}
.aa-settings__label {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 1.05rem;
}
.aa-settings__help,
.aa-settings__hint {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.75;
}
.aa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.aa-chip {
  flex: 1 1 auto;
  min-height: 2.6rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 3px solid var(--aa-ink);
  background: #fff;
  color: var(--aa-ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 var(--aa-ink);
  cursor: pointer;
}
.aa-chip.is-on {
  background: #26a69a;
  color: #fff;
}
.aa-chip:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--aa-ink);
}
.aa-settings__wide {
  width: 100%;
  min-height: 3rem;
  border-radius: 999px;
  border: 4px solid var(--aa-ink);
  background: #ffd54f;
  color: var(--aa-ink);
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 0 var(--aa-ink);
  cursor: pointer;
}
.aa-hold {
  position: relative;
  width: 100%;
  min-height: 3.2rem;
  margin-top: 0.4rem;
  overflow: hidden;
  border-radius: 999px;
  border: 4px solid var(--aa-ink);
  background: #ffcdd2;
  color: #b71c1c;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 0 var(--aa-ink);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.aa-hold__fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: #ef5350;
}
.aa-hold.is-holding .aa-hold__fill {
  width: 100%;
  transition: width 2s linear;
}
.aa-hold.is-done .aa-hold__fill {
  width: 100%;
}
.aa-hold__text {
  position: relative;
}
.aa-hold.is-holding,
.aa-hold.is-done {
  color: #fff;
}
@media (max-width: 430px) {
  .aa-settings-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-width: 3px;
    font-size: 1rem;
  }
}
@media (max-width: 380px) {
  .aa-hearts,
  .aa-badge {
    padding: 0.05rem 0.38rem 0.05rem 0.28rem;
    font-size: 0.9rem;
  }
  .aa-heart-count,
  .aa-badge [data-hud-coins],
  .aa-badge [data-hud-wood],
  .aa-badge [data-hud-riders] {
    font-size: 0.9rem;
  }
  .aa-chrome {
    gap: 0.2rem;
  }
}
/* Phone on its side: two columns so the card fits */
@media (max-height: 500px) and (orientation: landscape) {
  .aa-settings {
    place-items: start center;
  }
  .aa-settings__card {
    width: min(46rem, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
    padding: 0.7rem 0.9rem 0.8rem;
  }
  .aa-settings__head,
  .aa-settings__stats {
    grid-column: 1 / -1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .aa-settings__card {
    animation: none;
  }
}

/* Layering: fallen-tree tap targets (26) and stop bubbles (27) must never
   cover the HUD, drive controls or the stop card */
.aa-chrome {
  z-index: 30;
}
.aa-bar {
  z-index: 30;
}
.aa-station-menu {
  z-index: 29;
}

/* Settings: pop by scale only (never see-through), compact 3-column landscape */
@keyframes aa-set-pop {
  0% { transform: scale(0.85); }
  100% { transform: scale(1); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .aa-settings {
    place-items: center;
    padding: 0.4rem;
  }
  .aa-settings__card {
    width: min(52rem, 100%);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 0.8rem;
    padding: 0.5rem 0.8rem 0.6rem;
  }
  .aa-settings__head {
    margin-bottom: 0.3rem;
  }
  .aa-settings__head h2 {
    font-size: 1.25rem;
  }
  .aa-settings__close {
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
  }
  .aa-stat {
    flex-direction: row;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.15rem 0.3rem;
  }
  .aa-stat b {
    font-size: 1.05rem;
  }
  .aa-settings__section {
    padding-top: 0.35rem;
    margin-top: 0.3rem;
  }
  .aa-settings__label {
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
  }
  .aa-settings__help {
    display: none;
  }
  .aa-chips {
    gap: 0.3rem;
  }
  .aa-chip {
    min-height: 2.1rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.82rem;
  }
  .aa-settings__wide,
  .aa-hold {
    min-height: 2.5rem;
    font-size: 0.95rem;
    margin-top: 0;
  }
  /* last row: Stuck? + Start over (wide) */
  .aa-settings__section:nth-last-of-type(1) {
    grid-column: span 2;
  }
  .aa-settings__hint {
    font-size: 0.75rem;
  }
}

/* ═════════ Pop-up groups: several action bubbles per stop ═════════ */
.aa-bubble-group {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  pointer-events: none;
  will-change: transform;
}
.aa-bubble-group[hidden] {
  display: none;
}
/* Station pop-ups pinned to their own part of the building (JG-007):
   the group sits at the stop's spot, each pin is offset from there */
.aa-bubble-group.is-split {
  display: block;
  width: 0;
  height: 0;
}
.aa-bubble-pin {
  position: absolute;
  left: 0;
  bottom: 0;
  translate: -50% 0;
  will-change: transform;
}
.aa-bubble-group.is-split .aa-bubble {
  margin: 0 !important;
}
.aa-bubble-group.is-split[hidden] {
  display: none;
}
.aa-bubble-group .aa-bubble {
  position: relative;
  pointer-events: auto;
  white-space: nowrap;
}
.aa-bubble-group .aa-bubble:nth-child(2) { margin-bottom: 0.9rem; }
.aa-bubble-group .aa-bubble:nth-child(3) { margin-bottom: 0.2rem; }
.aa-bubble.is-new {
  animation: aa-bubble-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.aa-bubble.is-dim {
  background: #eceff1;
  color: #607d8b;
}
.aa-bubble.is-dim .aa-bubble__icon,
.aa-bubble.is-dim .aa-bubble__label {
  animation: none;
}
@keyframes aa-bubble-pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (max-width: 420px) {
  .aa-bubble-group { gap: 0.25rem; }
  .aa-bubble-group .aa-bubble { padding: 0.25rem 0.6rem 0.3rem 0.4rem; font-size: 0.9rem; }
  .aa-bubble-group .aa-bubble__icon { font-size: 1.1rem; }
}

/* ═════════ Big TOOT horn (bottom-left, hold for a long toot) ═════════ */
.aa-horn {
  position: absolute;
  left: max(0.75rem, env(safe-area-inset-left));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 28; /* under the stop card (29), over pop-ups (27) */
  width: 5.6rem;
  height: 5.6rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  padding: 0;
  border-radius: 50%;
  border: 5px solid #fff;
  background: radial-gradient(circle at 35% 30%, #ffd54f, #ffa000 70%);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.45);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.35), 0 0 0 4px var(--aa-ink);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.aa-horn__icon {
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: -0.2rem;
  overflow: visible;
}
.aa-horn__steam {
  opacity: 0;
}
.aa-horn__label {
  line-height: 1;
}
.aa-horn.is-down {
  transform: translateY(4px) scale(0.94);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.35), 0 0 0 4px var(--aa-ink);
}
.aa-horn.is-down .aa-horn__steam {
  opacity: 1;
  animation: aa-horn-steam 0.45s ease-in-out infinite;
}
.aa-horn.is-down .aa-horn__icon {
  animation: aa-horn-shake 0.12s linear infinite;
}
@keyframes aa-horn-steam {
  0% { transform: translateY(2px); opacity: 0.4; }
  50% { transform: translateY(-3px); opacity: 1; }
  100% { transform: translateY(2px); opacity: 0.4; }
}
@keyframes aa-horn-shake {
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}
/* Hint: herd is waiting — the horn glows and pulses */
.aa-horn.is-hint:not(.is-down) {
  animation: aa-horn-hint 0.9s ease-in-out infinite;
}
@keyframes aa-horn-hint {
  50% {
    transform: scale(1.1);
    box-shadow: 0 6px 0 rgba(38, 50, 56, 0.35), 0 0 0 4px var(--aa-ink), 0 0 0 14px rgba(255, 213, 79, 0.55);
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .aa-horn {
    width: 4.6rem;
    height: 4.6rem;
    font-size: 0.9rem;
  }
  .aa-horn__icon {
    width: 2.1rem;
    height: 2.1rem;
  }
}
@media (max-width: 380px) {
  .aa-horn {
    width: 5rem;
    height: 5rem;
  }
}

/* ═════════ Hint finger (tap the log / toot the horn) ═════════ */
.aa-hint {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 35;
  width: 0;
  height: 0;
  pointer-events: none;
}
.aa-hint[hidden] {
  display: none;
}
.aa-hint__hand {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 3rem;
  line-height: 1;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 3px 0 rgba(38, 50, 56, 0.35));
  animation: aa-hint-tap 1s ease-in-out infinite;
}
.aa-hint__ring {
  position: absolute;
  left: -1.6rem;
  top: -1.6rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px rgba(38, 50, 56, 0.4);
  opacity: 0;
  animation: aa-hint-ring 1s ease-out infinite;
}
.aa-hint.is-horn .aa-hint__ring {
  display: none;
}
@keyframes aa-hint-tap {
  0%, 100% { transform: translate(-50%, -135%); }
  45% { transform: translate(-50%, -100%) scale(0.92); }
}
@keyframes aa-hint-ring {
  0%, 40% { transform: scale(0.4); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aa-hint__hand,
  .aa-hint__ring,
  .aa-horn.is-hint:not(.is-down) {
    animation: none;
  }
}
.aa-bubble.is-hall {
  background: #d1c4e9;
}
.aa-bubble.is-yard {
  background: #b2dfdb;
}
.aa-bubble.is-shop {
  background: #ffe0b2;
}
.aa-bubble.is-friends {
  background: #f8bbd0;
}

/* Board pop-up counts (👋 getting off · 🎫 waiting) */
.aa-bubble__counts {
  margin-left: 0.2rem;
  font-size: 0.85em;
}

/* ═════════ Riverbend sign board, close up (JG-015) ═════════ */
.rb-board {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: max(0.6rem, env(safe-area-inset-top)) 0.6rem max(0.6rem, env(safe-area-inset-bottom));
  background: rgba(38, 50, 56, 0.4);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: #3e2723;
}
.rb-board[hidden] {
  display: none;
}
.rb-board__sign {
  position: relative;
  width: min(34rem, 100%);
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 1.2rem;
  /* planks */
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 3.2rem, rgba(78, 52, 46, 0.35) 3.2rem 3.35rem),
    linear-gradient(180deg, #e0be93, #d2a877);
  border: 6px solid #6d4c41;
  box-shadow: 0 0 0 4px #3e2723, 0 10px 0 rgba(38, 50, 56, 0.35);
}
.rb-board__sign.is-in {
  animation: rb-zoom 0.42s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes rb-zoom {
  from {
    transform: translate(var(--rb-from-x, 0), var(--rb-from-y, 0)) scale(0.15) rotate(-4deg);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.rb-board__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 4px solid #3e2723;
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.rb-board__title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 900;
  color: #0d47a1;
  letter-spacing: 0.02em;
  margin: 0.1rem 2.4rem 0.6rem;
}
.rb-board__note {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}
.rb-board__owl {
  flex: 0 0 5.4rem;
  height: 5.4rem;
  border-radius: 50%;
  overflow: hidden;
  background: #fff3e0;
  border: 4px solid #3e2723;
  cursor: pointer;
}
.rb-board__paper {
  flex: 1;
  position: relative;
  padding: 0.6rem 0.8rem;
  background: #fffaf0;
  border-radius: 0.6rem;
  box-shadow: 0 3px 0 rgba(62, 39, 35, 0.3);
  transform: rotate(-0.8deg);
  font-size: 1.02rem;
  line-height: 1.35;
}
.rb-board__paper p {
  margin: 0 0 0.3rem;
}
.rb-board__sig {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  font-weight: 800;
  color: #6d4c41;
}
.rb-board__say {
  border: 3px solid #3e2723;
  background: #fff;
  border-radius: 999px;
  font-size: 0.95rem;
  padding: 0.05rem 0.45rem;
  cursor: pointer;
}
.rb-board__jobs {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.rb-job {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  grid-template-areas: "icon body count" "icon act act";
  align-items: center;
  gap: 0.2rem 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.8rem;
  background: rgba(255, 250, 240, 0.9);
  border: 3px solid #6d4c41;
}
.rb-job.is-done {
  background: #e8f5e9;
  border-color: #43a047;
}
.rb-job__icon {
  grid-area: icon;
  font-size: 2rem;
  text-align: center;
}
.rb-job__body {
  grid-area: body;
  display: grid;
  gap: 0.3rem;
}
.rb-job__label {
  font-weight: 800;
}
.rb-job__bar {
  height: 0.75rem;
  border-radius: 999px;
  background: #bcaaa4;
  border: 2px solid #4e342e;
  overflow: hidden;
}
.rb-job__bar span {
  display: block;
  height: 100%;
  background: #ffb300;
}
.rb-job.is-done .rb-job__bar span {
  background: #43a047;
}
.rb-job__count {
  grid-area: count;
  font-weight: 900;
  font-size: 1.1rem;
}
.rb-job__give,
.rb-job__hint {
  grid-area: act;
  justify-self: end;
}
.rb-job__give {
  border: 4px solid #263238;
  border-radius: 999px;
  background: #43a047;
  color: #fff;
  font: inherit;
  font-weight: 900;
  padding: 0.3rem 1rem;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.35);
  cursor: pointer;
}
.rb-job__give:disabled {
  background: #b0bec5;
  box-shadow: none;
  cursor: default;
}
.rb-job__hint {
  font-size: 0.85rem;
  color: #6d4c41;
}
/* "Tap the sign!" tip over the Riverbend sign as the train goes by */
.aa-bubble.aa-tip {
  animation: aa-tip-bob 1.1s ease-in-out infinite;
}
@keyframes aa-tip-bob {
  50% {
    margin-top: -6px;
  }
}
.rb-job__icon svg {
  width: 2.3rem;
  height: 2.3rem;
  vertical-align: middle;
}

/* ── JG-035: loading screen ── */
.aa-loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 2vh, 1rem);
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: linear-gradient(180deg, #b3e5fc 0%, #e1f5fe 70%, #fff8e7 100%);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: var(--aa-ink);
  transition: opacity 0.45s ease;
}
.aa-loading.is-done {
  opacity: 0;
  pointer-events: none;
}
.aa-loading__exit {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff9800;
  border: 4px solid #fff;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
}
.aa-loading__title {
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  text-shadow:
    -3px -3px 0 var(--aa-ink), 3px -3px 0 var(--aa-ink), -3px 3px 0 var(--aa-ink), 3px 3px 0 var(--aa-ink),
    0 6px 0 var(--aa-ink);
  letter-spacing: 0.02em;
}
.aa-loading__train {
  width: min(92vw, 560px);
  height: min(56vw, 320px, 40vh);
}
.aa-loading__train canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.aa-loading__msg {
  margin: 0;
  padding: 6px 18px;
  background: #fff;
  border: 4px solid var(--aa-ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
  font-weight: 700;
  font-size: clamp(1rem, 4.4vw, 1.25rem);
}
.aa-loading__dots i {
  font-style: normal;
  animation: aa-loading-dot 1.2s infinite;
}
.aa-loading__dots i:nth-child(2) { animation-delay: 0.2s; }
.aa-loading__dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes aa-loading-dot {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}
.aa-loading__toot {
  width: 96px;
  height: 96px;
  margin-top: clamp(0.4rem, 2vh, 1rem);
  display: grid;
  place-items: center;
  align-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd54f, #ffa000 70%);
  box-shadow:
    0 0 0 4px var(--aa-ink),
    0 6px 0 4px var(--aa-ink);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s;
}
.aa-loading__toot svg {
  width: 44px;
  height: 44px;
}
.aa-loading__toot.is-down,
.aa-loading__toot:active {
  transform: translateY(4px) scale(0.95);
  box-shadow:
    0 0 0 4px var(--aa-ink),
    0 2px 0 4px var(--aa-ink);
}
/* the train console (and the HUD) wait until the world is built */
.aa-root.is-loading .aa-chrome,
.aa-root.is-loading [data-control-bar] {
  visibility: hidden;
}
@media (max-height: 480px) and (orientation: landscape) {
  .aa-loading__title { font-size: 2rem; }
  .aa-loading__train { height: 42vh; }
  .aa-loading__toot { position: absolute; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); width: 80px; height: 80px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aa-loading { transition: none; }
  .aa-loading__dots i { animation: none; opacity: 1; }
}

/* ═════════ JG-039: 🧍 riders list (tap the riders badge) ═════════ */
.aa-badge--riders.is-tappable {
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.aa-badge--riders.is-tappable:active {
  transform: translateY(2px);
}
.aa-riders {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 3.6rem);
  right: 12px;
  z-index: 40;
  width: min(20rem, calc(100vw - 24px));
  max-height: min(26rem, 62vh);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fffaf0;
  border: 4px solid var(--aa-ink);
  border-radius: 1.2rem;
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.3);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: var(--aa-ink);
  overflow: hidden;
  animation: aa-riders-in 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
  transform-origin: top right;
}
.aa-riders[hidden] {
  display: none;
}
@keyframes aa-riders-in {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.aa-riders__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem 0.45rem 0.85rem;
  background: #e3f2fd;
  border-bottom: 3px solid var(--aa-ink);
  font-size: 1.1rem;
}
.aa-riders__n {
  flex: 1;
  font-weight: 700;
  color: #546e7a;
}
.aa-riders__close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #ff9800;
  color: #fff;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.3);
  cursor: pointer;
}
.aa-riders__list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
  display: grid;
  gap: 0.4rem;
}
.aa-riders__empty {
  margin: 0.4rem 0.3rem;
  font-weight: 600;
  text-align: center;
}
.aa-riders__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  border-radius: 0.9rem;
  border: 3px solid var(--aa-ink);
  background: #fff;
  box-shadow: 0 3px 0 var(--aa-ink);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aa-riders__row:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--aa-ink);
}
.aa-riders__face {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #e3f2fd;
  border: 2.5px solid var(--aa-ink);
}
.aa-riders__who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.aa-riders__who b {
  font-size: 1.05rem;
}
.aa-riders__to {
  font-weight: 600;
  font-size: 0.95rem;
  color: #455a64;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aa-riders__go {
  font-size: 1.5rem;
  font-weight: 800;
  color: #90a4ae;
}
@media (prefers-reduced-motion: reduce) {
  .aa-riders {
    animation: none;
  }
}

/* JG-075 debug: who's out on foot */
.aa-dbg-folk {
  position: fixed;
  z-index: 30;
  left: max(0.6rem, env(safe-area-inset-left));
  top: max(4.6rem, calc(env(safe-area-inset-top) + 4rem));
  width: min(19rem, calc(100vw - 1.2rem));
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.5rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #263238;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
  font-size: 0.78rem;
  line-height: 1.3;
  color: #263238;
  text-shadow: none;
}
.aa-dbg-folk p {
  margin: 0 0 0.35rem;
  font-weight: 700;
}
.aa-dbg-folk__lines,
.aa-dbg-folk__none {
  opacity: 0.75;
}
.aa-dbg-folk [data-folk] {
  display: block;
  width: 100%;
  margin: 0 0 0.25rem;
  padding: 0.3rem 0.45rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f1f8e9;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.aa-dbg-folk__now {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.35rem;
  border-radius: 0.6rem;
  border: 2px solid #263238;
  background: #fff9c4;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 600px) {
  .aa-dbg-folk {
    top: max(7.6rem, calc(env(safe-area-inset-top) + 7rem));
    max-height: 42vh;
  }
}

/* JG-079: the 🎁 Gift Bag drop-down (same shell as the riders list) */
.aa-giftbag .aa-riders__head {
  background: #fce4ec;
}
.aa-giftbag__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding: 0.5rem;
}
.aa-giftbag__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0.15rem;
  border-radius: 0.8rem;
  border: 3px solid var(--aa-ink);
  background: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.aa-giftbag__item b {
  font-size: 1.7rem;
  line-height: 1.15;
}
.aa-giftbag__tip {
  margin: 0 0.6rem 0.6rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #546e7a;
}

/* gift bag: gift art (giftArt.js) */
.aa-giftbag__item b img {
  display: block;
  width: 2.8rem;
  height: 2.5rem;
  object-fit: contain;
}
