/* VerbaQuest Bible Quest (quest.js). Colours, sizes and timings come from
   tokens.css; the pictures carry their own colours and look the same in light
   and dark. Breakpoints as in style.css: tablet >= 640px, desktop >= 960px. */

/* ---------- Pictures ---------- */
.bq-hero-art { position: absolute; inset: 0; }
.bq-hero-art svg, .bq-map-art svg, .bq-scene-art svg, .bq-scene > svg, .bq-briefing-art svg { display: block; width: 100%; height: 100%; }
.bq-hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(4, 48, 37, 0.94) 0%, rgba(4, 48, 37, 0.82) 55%, rgba(4, 48, 37, 0.35) 100%);
}
.bq-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Landing ---------- */
.bq-hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--green); color: #ffffff; box-shadow: var(--shadow-md); }
.bq-hero-art::after { background: linear-gradient(180deg, rgba(4, 48, 37, 0.55) 0%, rgba(4, 48, 37, 0.9) 60%, rgba(4, 48, 37, 0.97) 100%); }
.bq-hero-body { position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-7) var(--space-5) var(--space-5); }
.bq-hero-title { font: var(--text-display); font-size: 2.25rem; }
.bq-hero-sub { color: rgba(255, 255, 255, 0.86); }
.bq-hero .progress { margin-top: var(--space-2); background: rgba(255, 255, 255, 0.2); }
.bq-hero-count, .bq-hero-next { font: var(--text-small); color: rgba(255, 255, 255, 0.86); }
.bq-hero .btn { margin-top: var(--space-2); }
.bq-hero-next { text-align: center; }

.bq-player { display: flex; align-items: center; gap: var(--space-3); }
.bq-player .avatar { box-shadow: none; }
.bq-player-xp { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 2px; }

.bq-chapter-strip { display: flex; gap: var(--space-2); margin: 0; padding: 2px 0 var(--space-2); overflow-x: auto; list-style: none; scrollbar-width: none; }
.bq-chapter-strip::-webkit-scrollbar { display: none; }
.bq-chapter-strip li { flex: none; }
.bq-chapter-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap, 44px);
  padding: 6px var(--space-3) 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font: var(--text-small);
  font-weight: 700;
  cursor: pointer;
}
.bq-chapter-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-full); background: var(--surface-soft); color: var(--primary-ink); font-weight: 800; }
.bq-chapter-chip.open .bq-chapter-num { background: var(--primary); color: var(--on-primary); }
.bq-chapter-chip.done .bq-chapter-num { background: var(--reward); color: var(--charcoal); }
.bq-chapter-chip.locked { color: var(--text-muted); }
.bq-chapter-chip.locked .bq-chapter-num { color: var(--text-muted); }

.bq-mission { width: 100%; text-align: left; color: var(--text); }
.bq-mission .badge-row { margin-top: var(--space-1); }
.bq-mission.locked { background: var(--surface-soft); box-shadow: none; }
.bq-mission.locked .list-title { color: var(--text-muted); }
.bq-mission-mark { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); }
.bq-mission-mark.done { background: var(--reward); color: var(--charcoal); }
.bq-mission-mark.locked { background: var(--border); color: var(--text-muted); }

/* ---------- The world map ---------- */
.bq-map { position: relative; width: 100%; max-width: 480px; margin: 0 auto; aspect-ratio: 360 / 560; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.bq-map-art { position: absolute; inset: 0; }
.bq-pin {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 132px;
  margin: -30px 0 0 -66px;
  padding: 0;
  border: 0;
  background: none;
  color: #ffffff;
  cursor: pointer;
}
.bq-pin-dot {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 3px solid #ffffff;
  border-radius: var(--radius-full);
  background: var(--green);
  font: 800 1.25rem/1 var(--font);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform var(--fast);
}
.bq-pin:active .bq-pin-dot { transform: scale(0.94); }
.bq-pin-label { max-width: 100%; padding: 3px 10px; border-radius: var(--radius-full); background: rgba(8, 28, 22, 0.82); font: 800 0.75rem/1.3 var(--font); text-align: center; }
.bq-pin.done .bq-pin-dot { background: var(--gold); color: var(--charcoal); }
.bq-pin.current .bq-pin-dot { animation: bq-pulse 2s ease-out infinite; }
.bq-pin.soon .bq-pin-dot { background: #2f6f5c; border-style: dashed; }
.bq-pin.locked .bq-pin-dot { background: #5d6b66; border-color: rgba(255, 255, 255, 0.7); color: rgba(255, 255, 255, 0.9); }
.bq-pin.locked .bq-pin-label { color: rgba(255, 255, 255, 0.8); }
.bq-pin.chosen .bq-pin-dot { outline: 3px solid var(--gold); outline-offset: 3px; }
.bq-pin.chosen .bq-pin-label { background: var(--gold); color: var(--charcoal); }
@keyframes bq-pulse {
  0% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(212, 167, 44, 0.75); }
  70%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 16px rgba(212, 167, 44, 0); }
}

.bq-chapter-panel { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.bq-chapter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.bq-chapter-head h2 { font: var(--text-h1); }
.bq-chapter-panel .notice { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.bq-chapter-panel .notice .icon { flex: none; }
.bq-notice-done { background: var(--reward-soft); color: var(--reward-ink); }

/* ---------- A mission ---------- */
.bq-briefing { display: flex; flex-direction: column; gap: var(--space-3); }
.bq-briefing h1 { font: var(--text-display); }
.bq-briefing-art { height: 168px; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.bq-briefing-text { font-size: 1.0625rem; }
.bq-briefing .context-link { align-self: center; }

.bq-step, .bq-widget, .bq-results { display: flex; flex-direction: column; gap: var(--space-4); }
.bq-step .question { padding: 0; }
.bq-step-actions { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.bq-step-actions [hidden], .bq-feedback:empty, .bq-hint-box:empty { display: none; }
.bq-hint { display: flex; gap: var(--space-2); margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--reward-soft); color: var(--reward-ink); font: var(--text-small); }
.bq-hint .icon { flex: none; margin-top: 2px; }
.bq-retry { display: flex; align-items: center; justify-content: center; gap: var(--space-1); margin: 0; color: var(--gentle); font: var(--text-small); font-weight: 700; text-align: center; }
.bq-feedback .feedback { display: flex; flex-direction: column; gap: var(--space-3); }

/* Places and the cards that fill them: ordering, matching, completing a verse. */
.bq-slots { display: flex; flex-direction: column; gap: var(--space-4); }
.bq-places { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.bq-slot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: var(--text-answer);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}
.bq-slot-label { display: grid; flex: none; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius-full); background: var(--surface-soft); color: var(--primary-ink); font: 800 0.875rem/1 var(--font); }
.bq-slot-text { flex: 1; min-width: 0; }
.bq-slot:not(.filled) .bq-slot-text { color: var(--text-muted); font: var(--text-small); }
.bq-slot.active { border-color: var(--gold); background: var(--reward-soft); }
.bq-slot.filled { border-style: solid; border-color: var(--primary-ink); }
.bq-slot.locked { border-color: var(--success); background: var(--success-soft); color: var(--text); opacity: 1; cursor: default; }
.bq-slot.locked .icon { flex: none; color: var(--success); }
.bq-slot.locked .bq-slot-label { background: var(--success); color: var(--surface); }
.bq-slot:disabled { opacity: 1; }
.bq-slot.shake { animation: bq-shake 0.4s ease-in-out; border-color: var(--gentle); }
@keyframes bq-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
/* Matching: the thing on the left is the label, and takes the room it needs. */
.bq-match .bq-slot { flex-wrap: wrap; }
.bq-match .bq-slot-label { height: auto; min-height: 30px; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.8125rem; line-height: 1.3; text-align: center; }
.bq-match .bq-slot-text { flex: 1 1 140px; }

.bq-pool { display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 52px; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-soft); }
.bq-pool-empty { align-self: center; font: var(--text-small); }
.bq-card {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: var(--text-answer);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--fast), border-color var(--fast);
}
.bq-card:hover:not(:disabled) { border-color: var(--primary-ink); }
.bq-card:active:not(:disabled) { transform: scale(0.96); }
.bq-slots.wide .bq-card { flex: 1 1 100%; }

.bq-sentence { margin: 0; padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); font: 600 1.125rem/2.3 var(--font); }
.bq-slots.inline .bq-slot { display: inline-flex; justify-content: center; width: auto; min-width: 84px; min-height: 40px; margin: 0 4px; padding: 2px var(--space-3); vertical-align: middle; line-height: 1.3; }
.bq-slots.inline .bq-slot-text { flex: none; color: var(--text); font: var(--text-answer); font-weight: 800; }

/* The first day: lit a stage at a time (data-stage 0 to 5; no stage shows it all). */
.bq-scene { position: relative; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.bq-creation { aspect-ratio: 320 / 120; }
.bq-scene.bq-creation { position: relative; }
.bq-scene-caption { position: absolute; inset: auto var(--space-3) var(--space-2); margin: 0; color: rgba(255, 255, 255, 0.86); font: var(--text-small); text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); pointer-events: none; }
.bq-creation[data-stage="5"] .bq-scene-caption { color: rgba(30, 40, 30, 0.75); text-shadow: none; }
.bq-briefing-art.bq-creation { aspect-ratio: auto; }
.bq-creation g { transition: opacity 0.9s ease; }
.bq-creation[data-stage="0"] :is(.bqc-1, .bqc-2, .bqc-3, .bqc-4, .bqc-5),
.bq-creation[data-stage="1"] :is(.bqc-2, .bqc-3, .bqc-4, .bqc-5),
.bq-creation[data-stage="2"] :is(.bqc-3, .bqc-4, .bqc-5),
.bq-creation[data-stage="3"] :is(.bqc-4, .bqc-5),
.bq-creation[data-stage="4"] .bqc-5 { opacity: 0; }

/* A scene to explore. */
.bq-explore { aspect-ratio: 360 / 300; }
.bq-scene-art { position: absolute; inset: 0; }
.bq-spot { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; margin: -26px 0 0 -26px; padding: 0; border: 0; border-radius: var(--radius-full); background: none; cursor: pointer; }
.bq-spot-dot { display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid #ffffff; border-radius: var(--radius-full); background: rgba(212, 167, 44, 0.55); color: var(--charcoal); animation: bq-pulse 1.8s ease-out infinite; }
.bq-spot.found .bq-spot-dot { background: var(--gold); animation: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.bq-spot.open .bq-spot-dot { outline: 3px solid var(--green); outline-offset: 2px; }
.bq-found-count:empty { display: none; }
.bq-discovery-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--reward); border-radius: var(--radius-md); background: var(--reward-soft); color: var(--text); }
.bq-discovery-card .label, .bq-discovery-card .reference { color: var(--reward-ink); }
.bq-discovery-card h2 { font: var(--text-h2); }
.bq-discovery-card p { margin: 0; }
.bq-discovery-empty { margin: 0; text-align: center; }
.bq-objectives { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.bq-objectives li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-full); background: var(--surface-soft); color: var(--text-muted); font: var(--text-small); font-weight: 700; }
.bq-objectives li.found { background: var(--success-soft); color: var(--success); }

/* ---------- Results ---------- */
.bq-review { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.bq-review-item { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.bq-review-item p { margin: 0; }
.bq-review-head { display: flex; align-items: flex-start; gap: var(--space-2); }
.bq-review-head .feedback-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-full); color: var(--surface); }
.bq-review-item.good .feedback-icon { background: var(--success); }
.bq-review-item.gentle .feedback-icon { background: var(--gentle); }
.bq-review-prompt { font-weight: 800; }
.bq-review-line { display: flex; flex-direction: column; gap: 2px; font: var(--text-small); }
.bq-review-line .label { color: var(--text-muted); }

@media (min-width: 640px) {
  .bq-hero-body { padding: var(--space-7) var(--space-6) var(--space-6); }
  .bq-slots.wide .bq-card { flex: 1 1 calc(50% - var(--space-2)); }
  .bq-briefing-art { height: 220px; }
}
/* On a wide screen the picture stands beside the briefing at its own shape, so nothing of it is cut away. */
@media (min-width: 900px) {
  .bq-briefing { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--space-6); row-gap: var(--space-3); align-content: start; }
  .bq-briefing > * { grid-column: 2; }
  .bq-briefing > .bq-briefing-art { grid-column: 1; grid-row: 1 / span 12; align-self: start; height: auto; aspect-ratio: 6 / 5; }
  .bq-briefing > .bq-briefing-art.bq-story { aspect-ratio: 360 / 220; }
  .bq-briefing > .bq-briefing-art.bq-creation { aspect-ratio: 320 / 120; }
}
@media (prefers-reduced-motion: reduce) {
  .bq-pin.current .bq-pin-dot, .bq-spot-dot, .bq-slot.shake { animation: none; }
  .bq-creation g { transition: none; }
}

/* ---------- Touches that make it feel alive ---------- */

/* Sparks when something goes right (bqBurst). */
.bq-burst { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
.bq-burst span { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--gold); animation: bq-spark 0.7s ease-out forwards; }
.bq-burst span:nth-child(3n) { background: var(--success); }
.bq-burst span:nth-child(4n) { width: 5px; height: 5px; background: #ffffff; box-shadow: 0 0 0 1px var(--gold); }
@keyframes bq-spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }

/* A step slides in; answers right first time, in a row, are counted. */
.bq-step.arriving { animation: bq-arrive 0.32s ease-out; }
@keyframes bq-arrive { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
.bq-step .quiz-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.bq-how { font: var(--text-small); }
.bq-streak { display: inline-flex; flex: none; align-items: center; gap: 2px; padding: 4px 8px; border-radius: var(--radius-full); background: var(--reward-soft); color: var(--reward-ink); font: 800 0.8125rem/1 var(--font); }
.bq-streak.pop, .bq-discovery-card.pop { animation: bq-pop 0.35s ease-out; }
@keyframes bq-pop { from { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } to { transform: none; } }
.answer.bq-shake { animation: bq-shake 0.4s ease-in-out; }

/* Dragging a card to a place. */
.bq-card, .bq-slot.filled:not(.locked) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bq-card { cursor: grab; }
.bq-card.held, .bq-slot.held { transform: scale(1.04); border-color: var(--gold); box-shadow: var(--shadow-md); }
.bq-card.dragging, .bq-slot.dragging { opacity: 0.35; }
.bq-ghost { position: fixed; z-index: 60; margin: 0; transform: translate(-50%, -60%) rotate(-2deg); border-color: var(--gold); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3); pointer-events: none; cursor: grabbing; }
.bq-slot.drop { border-style: solid; border-color: var(--gold); background: var(--reward-soft); transform: scale(1.02); }

/* The player's marker on the map. */
.bq-you { position: absolute; z-index: 2; display: block; margin: -62px 0 0 14px; padding: 3px; border-radius: var(--radius-full); background: var(--gold); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); pointer-events: none; animation: bq-bob 2.4s ease-in-out infinite; transition: left 1.3s ease-in-out, top 1.3s ease-in-out; }
.bq-you::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: var(--gold); transform: rotate(45deg); z-index: -1; }
.bq-you .avatar { display: block; box-shadow: none; }
.bq-you.walking { animation: bq-walk 0.3s ease-in-out infinite; }
@keyframes bq-bob { 50% { transform: translateY(-5px); } }
@keyframes bq-walk { 50% { transform: translateY(-7px) rotate(4deg); } }

/* The map breathes: the first light turns, the stars come and go, the ark
   rides the flood, the fire burns and the way ahead beckons. */
:where(.bq-map-art, .bq-scene, .bq-briefing-art, .bq-hero-art) :where(svg *) { transform-box: fill-box; transform-origin: center; }
.bqm-rays { transform-box: view-box; transform-origin: 92px 62px; animation: bq-turn 40s linear infinite; }
.bqm-stars circle { animation: bq-twinkle 3s ease-in-out infinite; }
.bqm-stars circle:nth-child(2n) { animation-delay: 1.1s; }
.bqm-stars circle:nth-child(3n) { animation-delay: 2s; }
.bqm-flame { transform-origin: center bottom; animation: bq-flicker 0.9s ease-in-out infinite; }
.bqm-waves { animation: bq-drift 5s ease-in-out infinite; }
.bqm-ark { animation: bq-ride 4s ease-in-out infinite; }
.bqm-bow, .bqm-walk { animation: bq-glow 5s ease-in-out infinite; }
.bqm-sword { animation: bq-glow 3s ease-in-out infinite; }
.bqm-path { animation: bq-march 1.6s linear infinite; }
@keyframes bq-turn { to { transform: rotate(360deg); } }
@keyframes bq-twinkle { 50% { opacity: 0.2; } }
@keyframes bq-flicker { 30% { transform: scale(1.08, 1.16); } 60% { transform: scale(0.94, 0.9); } }
@keyframes bq-drift { 50% { transform: translateX(10px); } }
@keyframes bq-ride { 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes bq-glow { 50% { opacity: 0.7; } }
@keyframes bq-march { to { stroke-dashoffset: -15; } }

/* The first day: the waters move, the light swells, and each stage arrives with a flash. */
.bq-creation .bqc-2 { animation: bq-drift 6s ease-in-out infinite; }
.bq-creation .bqc-3 circle { animation: bq-swell 3.5s ease-in-out infinite; }
@keyframes bq-swell { 50% { transform: scale(1.08); } }
.bq-creation.flash::after { content: ""; position: absolute; inset: 0; background: #fff6cf; animation: bq-flash 0.7s ease-out forwards; pointer-events: none; }
.bq-creation { position: relative; }
@keyframes bq-flash { from { opacity: 0.75; } to { opacity: 0; } }

/* The garden lives: the river runs, the trees stir, a bird crosses the sky. */
.bqg-sun { animation: bq-swell 5s ease-in-out infinite; }
.bqg-river { animation: bq-run 1.2s linear infinite; }
@keyframes bq-run { to { stroke-dashoffset: -22; } }
.bqg-tree-life, .bqg-tree-knowledge { transform-origin: center bottom; animation: bq-sway 5s ease-in-out infinite; }
.bqg-tree-knowledge { animation-delay: -2s; }
@keyframes bq-sway { 50% { transform: rotate(1.6deg); } }
.bqg-bird { animation: bq-fly 9s ease-in-out infinite; }
@keyframes bq-fly { 0% { transform: translate(-70px, 8px); } 50% { transform: translate(60px, -10px) scale(0.9); } 100% { transform: translate(-70px, 8px); } }
.bqg-creatures > :not(.bqg-bird) { transform-origin: center bottom; }
.bqg-havilah path:nth-child(n + 2), .bqg-havilah g { animation: bq-glint 2.6s ease-in-out infinite; }
@keyframes bq-glint { 50% { filter: brightness(1.35); } }
/* What is tapped answers. */
.bqg-tree-life.react, .bqg-tree-knowledge.react { animation: bq-rustle 0.8s ease-in-out; }
@keyframes bq-rustle { 20% { transform: rotate(-5deg); } 45% { transform: rotate(5deg); } 70% { transform: rotate(-3deg); } }
.bqg-river.react { animation: bq-run 0.25s linear 4; stroke-width: 5; }
.bqg-man.react { transform-origin: center bottom; animation: bq-rise 0.8s ease-out; }
@keyframes bq-rise { 0% { transform: scale(1, 0.6); } 60% { transform: scale(1, 1.12); } }
.bqg-creatures.react { animation: bq-hop 0.7s ease-out; }
@keyframes bq-hop { 30% { transform: translateY(-12px); } 60% { transform: translateY(0); } 80% { transform: translateY(-5px); } }
.bqg-havilah.react { animation: bq-shine 0.9s ease-out; }
/* Inside the ark, and the passover house: what is found answers too */
:is(.bqg-window, .bqg-door, .bqg-pitch, .bqg-posts, .bqg-bread, .bqg-hyssop, .bqg-stories).react { animation: bq-shine 0.9s ease-out; }
:is(.bqg-family, .bqg-staff, .bqg-food, .bqg-lamb, .bqg-herbs).react { transform-origin: center bottom; animation: bq-hop 0.7s ease-out; }
.bqg-window { animation: bq-swell 5s ease-in-out infinite; }
@keyframes bq-shine { 40% { filter: brightness(1.6) saturate(1.3); } }
.bq-ripple { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid rgba(255, 255, 255, 0.9); border-radius: var(--radius-full); pointer-events: none; animation: bq-ripple 0.55s ease-out forwards; }
@keyframes bq-ripple { to { transform: scale(4); opacity: 0; } }
.bq-explore { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .bq-map-art svg *, .bq-scene svg *, .bq-briefing-art svg *, .bq-hero-art svg *, .bq-you, .bq-step.arriving, .bq-streak.pop, .bq-discovery-card.pop, .answer.bq-shake, .bq-creation.flash::after, .bq-ripple { animation: none !important; }
  .bq-you { transition: none; }
}

/* ---------- Fitted to a phone ---------- */

/* Landing: the player, then the next thing to do, in one compact panel. */
.bq-hero-body { gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-5); }
.bq-hero-title { font-size: 1.75rem; }
.bq-hero .bq-player { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid rgba(255, 255, 255, 0.18); font: var(--text-small); color: rgba(255, 255, 255, 0.86); }
.bq-player-who { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.bq-player strong { color: #ffffff; font-size: 0.9375rem; }
.bq-player-xp strong { color: var(--gold); }

/* The map: smaller pins, standing beside the pictures. */
.bq-pin { width: 150px; margin: -17px 0 0 -75px; pointer-events: none; }
.bq-pin-dot { pointer-events: auto; }
.bq-pin-dot { width: 34px; height: 34px; border-width: 2px; font-size: 0.875rem; }
.bq-pin-label { font-size: 0.6875rem; }
.bq-you { margin: -52px 0 0 12px; }
.bq-chapter-panel { scroll-margin-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + var(--space-5)); scroll-margin-top: var(--space-4); }

/* A step: tighter, with its buttons kept at the foot of the screen. */
.bq-step { gap: var(--space-3); }
.bq-step .question { font-size: 1.1875rem; }
.bq-places { gap: 6px; }
.bq-slot { min-height: 44px; padding: 6px var(--space-3); gap: var(--space-2); font-size: 0.9375rem; line-height: 1.3; }
.bq-slot-label { min-width: 26px; height: 26px; }
.bq-pool { gap: 6px; padding: var(--space-2); }
.bq-card { min-height: 40px; padding: 6px var(--space-3); font-size: 0.9375rem; line-height: 1.3; }
.bq-slots { gap: var(--space-3); }
.bq-step-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  gap: var(--space-2);
  margin: 0 calc(var(--space-2) * -1);
  padding: var(--space-3) var(--space-2) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 14px);
}
.bq-step-actions[hidden] { display: none; }
.bq-step-actions { flex-direction: column; align-items: stretch; }
.bq-bar-buttons { display: flex; align-items: stretch; gap: var(--space-2); }
.bq-bar-buttons:not(:has(> :not([hidden]))), .bq-bar-note:empty { display: none; }
.bq-step-actions .btn-block { flex: 1; width: auto; }
.bq-step-actions .btn-secondary { flex: none; padding-inline: var(--space-4); }
/* What is brought into view stops clear of the bar at the foot of the screen. */
.bq-step .bq-hint-box, .bq-step .bq-feedback { scroll-margin-bottom: 110px; }

/* The garden: nothing is marked until it is found, or help is asked for. */
.bq-spot { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.bq-spot:not(.found):not(.shown) .bq-spot-dot { opacity: 0; animation: none; }
.bq-spot:not(.found):focus-visible .bq-spot-dot { opacity: 1; }
.bq-spot.shown .bq-spot-dot { opacity: 1; }
.bq-ripple.warm { border-color: var(--gold); border-width: 3px; }
.bq-found-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.bq-found-row .bq-found-count { margin: 0; }
.bq-said { flex: 1 1 100%; min-height: 1.2em; color: var(--text-muted); font: var(--text-small); }
.bq-said:empty { display: none; }
.bq-dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bq-dots li { width: 12px; height: 12px; border: 2px solid var(--border); border-radius: var(--radius-full); transition: background var(--fast), border-color var(--fast); }
.bq-dots li.found { border-color: var(--gold); background: var(--gold); }

/* Results: answers laid out to be read, and what comes after a chapter. */
.bq-review-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding-left: 1.3em; font: var(--text-small); }
.bq-teaser { display: flex; flex-direction: column; gap: var(--space-1); width: 100%; text-align: left; color: var(--text); }
.bq-teaser-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); font: var(--text-h2); }
.results-hero .muted { margin: 0; }

@media (min-width: 640px) {
  .bq-hero-body { padding: var(--space-5) var(--space-5) var(--space-6); }
  .bq-hero-title { font-size: 2.25rem; }
  .bq-step .question { font-size: 1.375rem; }
  .bq-pin { width: 170px; margin: -20px 0 0 -85px; }
  .bq-pin-dot { width: 40px; height: 40px; font-size: 1rem; }
  .bq-pin-label { font-size: 0.75rem; }
  .bq-you { margin: -58px 0 0 14px; }
}

/* A chapter's name stays on one line under its pin. */
.bq-pin-label { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

ol.bq-review-list { list-style: decimal; }
ul.bq-review-list { list-style: disc; }

/* ---------- Depth: pictures lean towards the pointer, or a phone's tilt ---------- */
.bq-depth { transform: perspective(900px) rotateY(calc(var(--px, 0) * 3deg)) rotateX(calc(var(--py, 0) * -2.5deg)); transition: transform 0.3s ease-out; }
.bq-depth :where(.d1, .d2, .d3) { transition: transform 0.35s ease-out; }
.bq-depth .d1 { transform: translate(calc(var(--px, 0) * -4px), calc(var(--py, 0) * -2px)); }
.bq-depth .d2 { transform: translate(calc(var(--px, 0) * 3px), calc(var(--py, 0) * 2px)); }
.bq-depth .d3 { transform: translate(calc(var(--px, 0) * 8px), calc(var(--py, 0) * 4px)); }

/* ---------- Stories: a picture that acts out each moment ---------- */
.bq-story { aspect-ratio: 360 / 220; }
.bq-briefing-art.bq-story { aspect-ratio: auto; }
.bq-story :is(.from-0, .from-1, .from-2, .from-3, .from-4, .until-1, .until-2, .until-3, .until-4) { transition: opacity 0.9s ease; }
.bq-story :is(.from-0, .from-1, .from-2, .from-3, .from-4) { opacity: 0; }
.bq-story.at-0 .from-0, .bq-story.at-1 .from-1, .bq-story.at-2 .from-2, .bq-story.at-3 .from-3, .bq-story.at-4 .from-4 { opacity: 1; }
.bq-story.at-1 .until-1, .bq-story.at-2 .until-2, .bq-story.at-3 .until-3, .bq-story.at-4 .until-4 { opacity: 0; }

/* The garden (Genesis 3) */
.bqs-eden .bqs-serpent { animation: bqs-sway 4s ease-in-out infinite; }
.bqs-eden.at-0:not(.at-1) .bqs-serpent { animation: bqs-slide 1.4s ease-out, bqs-sway 4s ease-in-out 1.4s infinite; }
.bqs-eden .bqs-ring { animation: bq-swell 1.6s ease-in-out infinite; }
.bq-story.at-4 .bqs-dusk { opacity: 0.72; }
.bqs-eden .bqs-voice { animation: bq-swell 3s ease-in-out infinite; }
.bqs-eden :is(.bqs-woman, .bqs-man) { transition: transform 1.2s ease; }
.bqs-eden.at-4 .bqs-woman { transform: translate(-10px, 6px); }
.bqs-eden.at-4 .bqs-man { transform: translate(6px, 6px); }
@keyframes bqs-slide { from { transform: translate(40px, -10px); opacity: 0; } }
@keyframes bqs-sway { 50% { transform: translate(-2px, 2px) rotate(-1.5deg); } }

/* The two altars (Genesis 4) */
.bqs-altars .bqs-smoke circle { animation: bqs-rise 3s ease-in infinite; }
.bqs-altars .bqs-smoke circle:nth-child(2) { animation-delay: 1s; }
.bqs-altars .bqs-smoke circle:nth-child(3) { animation-delay: 2s; }
.bqs-altars .bqs-fire > path { animation: bq-flicker 0.9s ease-in-out infinite; transform-origin: center bottom; }
.bq-story.at-3 .bqs-gloom { opacity: 0.3; }
.bqs-altars .bqs-cain circle { transition: transform 1s ease, fill 1s ease; }
.bqs-altars.at-3 .bqs-cain circle { transform: translate(2px, 4px); fill: #6e4a3a; }
@keyframes bqs-rise { from { transform: translateY(14px) scale(0.6); opacity: 0; } 30% { opacity: 0.85; } to { transform: translateY(-26px) scale(1.3); opacity: 0; } }

/* Building the ark (Genesis 6) */
.bqs-flood .bqs-clouds { animation: bqs-drift 8s ease-in-out infinite; }
.bqs-flood .bqs-bolt { animation: bqs-flash 3.2s steps(1) infinite; }
.bqs-flood .bqs-planks > * { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.bqs-flood.acted-3 .bqs-planks > * { opacity: 1; transform: none; }
.bqs-flood.acted-3 .bqs-planks .p2 { transition-delay: 0.25s; }
.bqs-flood.acted-3 .bqs-planks .p3 { transition-delay: 0.5s; }
.bqs-flood.acted-3 .bqs-planks .p4 { transition-delay: 0.75s; }
.bqs-flood.acted-3 .bqs-planks .p5 { transition-delay: 1s; }
.bqs-flood.at-3:not(.acted-3) .bqs-hammer { animation: bqs-hammer 0.6s ease-in-out infinite; }
@keyframes bqs-flash { 0%, 86%, 92%, 100% { opacity: 0; } 88%, 94% { opacity: 1; } }
@keyframes bqs-hammer { 50% { transform: rotate(-24deg); } }
@keyframes bqs-drift { 50% { transform: translateX(10px); } }

/* The waters fall; the raven and the dove (Genesis 8) */
.bqs-covenant :is(.bqs-ark, .bqs-waters) { transition: transform 2.2s ease-in-out; }
.bqs-covenant .bqs-ark { animation: bqs-bob 3.5s ease-in-out infinite; }
.bqs-covenant.at-1 .bqs-ark { animation: none; transform: translateY(14px); }
.bqs-covenant.at-1 .bqs-waters { transform: translateY(40px); }
.bqs-covenant .bqs-wind path { animation: bqs-drift 3s ease-in-out infinite; }
.bq-story.at-4 .bqs-evening { opacity: 0.35; }
.bqs-covenant .bqs-raven { transform: translate(176px, 112px); }
.bqs-covenant.at-2:not(.at-3) .bqs-raven { animation: bqs-raven 5s ease-in-out infinite; }
.bqs-covenant.at-3 .bqs-raven { opacity: 0; }
.bqs-covenant .bqs-dove { opacity: 0; transform: translate(162px, 112px); }
.bqs-covenant.acted-3:not(.at-4) .bqs-dove { animation: bqs-dove-out 2.6s ease-in-out forwards; }
.bqs-covenant.at-4 .bqs-dove { animation: bqs-dove-back 2.6s ease-in-out forwards; }
.bqs-covenant.at-3:not(.acted-3) .bqs-window { animation: bqs-glow 1.2s ease-in-out infinite; }
@keyframes bqs-bob { 50% { transform: translateY(-3px); } }
@keyframes bqs-raven { 0% { transform: translate(176px, 112px); opacity: 0; } 15% { opacity: 1; } 40% { transform: translate(310px, 50px); } 70% { transform: translate(40px, 70px); } 100% { transform: translate(176px, 112px); opacity: 1; } }
@keyframes bqs-dove-out { 0% { transform: translate(162px, 112px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(330px, 30px) scale(0.6); opacity: 0; } }
@keyframes bqs-dove-back { 0% { transform: translate(340px, 50px) scale(0.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(162px, 100px); opacity: 1; } }
@keyframes bqs-glow { 50% { fill: #fff6cf; } }

/* The bow in the cloud (Genesis 9): drawn as far as the player has traced */
.bqs-bow .bqs-bow path { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--trace, 0)); transition: stroke-dashoffset 0.15s linear; }
.bqs-bow.at-4 .bqs-bow { filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8)); }
.bqs-bow .bqs-guide { opacity: 0; transition: opacity 0.4s; }
.bqs-bow.tracing .bqs-guide { opacity: 0.85; animation: bqs-march 1s linear infinite; }
.bqs-bow .bqs-family { transition: transform 2s ease, opacity 0.9s ease; transform: translateX(-60px); }
.bqs-bow.at-0 .bqs-family { transform: none; }
.bqs-bow .bqs-smoke circle { animation: bqs-rise 3s ease-in infinite; }
.bqs-bow .bqs-smoke circle:nth-child(2) { animation-delay: 1.5s; }
.bqs-bow.tracing { touch-action: none; cursor: crosshair; }
@keyframes bqs-march { to { stroke-dashoffset: -12; } }

/* Abram's tent under the stars (Genesis 15): looked to, the sky fills */
.bqs-stars .bqs-tent-door { animation: bqs-door 3s ease-in-out infinite alternate; }
.bqs-stars .bqs-many circle { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.2); transition: opacity 0.6s ease, transform 0.6s ease; }
.bqs-stars.acted-2 .bqs-many circle { opacity: 1; transform: none; }
.bqs-stars.acted-2 .bqs-many circle:nth-child(3n) { transition-delay: 0.3s; }
.bqs-stars.acted-2 .bqs-many circle:nth-child(3n + 1) { transition-delay: 0.6s; }
.bqs-stars.at-3 .bqs-many circle { animation: bqs-twinkle 2.4s ease-in-out infinite alternate; }
.bqs-stars.at-3 .bqs-many circle:nth-child(2n) { animation-delay: 1.2s; }
@keyframes bqs-door { to { opacity: 0.75; } }
@keyframes bqs-twinkle { to { opacity: 0.35; } }

/* The mountain in Moriah (Genesis 22): the fire, the call, and the ram in the thicket */
.bqs-moriah .bqs-fire { transform-box: fill-box; transform-origin: center bottom; animation: bqs-flicker 1.4s ease-in-out infinite alternate; }
.bqs-moriah .bqs-ram { opacity: 0; transition: opacity 0.8s ease, transform 1.2s ease; }
.bqs-moriah.at-4 .bqs-ram { opacity: 0.3; }
.bqs-moriah.acted-4 .bqs-ram { opacity: 1; transform: translate(-46px, 6px); }
.bqs-moriah.at-4:not(.acted-4) .bqs-thicket { animation: bqs-rustle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes bqs-flicker { to { transform: scaleY(1.15); } }
@keyframes bqs-rustle { 50% { transform: rotate(2deg); } }

/* Joseph's dream (Genesis 37): his sheaf rises, the others bend to it, then the heavens */
.bqs-sheaves :is(.bqs-bend, .bqs-josephs) { transform-box: fill-box; transform-origin: center bottom; transition: transform 1s ease; }
.bqs-sheaves:is(.acted-2, .at-3) .bqs-josephs { transform: translateY(-10px) scale(1.12); }
.bqs-sheaves.at-3 :is(.b1, .b2, .b5) { transform: rotate(16deg); }
.bqs-sheaves.at-3 :is(.b3, .b4, .b6) { transform: rotate(-16deg); }
.bqs-sheaves.at-3 :is(.b2, .b3) { transition-delay: 0.2s; }
.bqs-sheaves.at-3 :is(.b5, .b6) { transition-delay: 0.4s; }
.bqs-sheaves .bqs-heavens circle { animation: bqs-twinkle 2.6s ease-in-out infinite alternate; }

/* The flood (Genesis 7): the waters bear up the ark, then cover the hills */
.bqs-deluge .bqs-rain { animation: bqs-fall 0.7s linear infinite; }
.bqs-deluge .bqs-fount path { transform-origin: center bottom; animation: bqs-flicker 0.8s ease-in-out infinite alternate; }
.bqs-deluge :is(.bqs-water, .bqs-ark, .bqs-hills, .bqs-gloom, .bqs-rain) { transition: transform 2s ease-in-out, opacity 1.4s ease; }
.bqs-deluge .bqs-water { transform: translateY(44px); }
.bqs-deluge .bqs-ark { transform: translateY(30px); }
.bqs-deluge.acted-1 .bqs-water { transform: translateY(18px); }
.bqs-deluge.acted-1 .bqs-ark { transform: translateY(2px); }
.bqs-deluge.at-2 .bqs-water { transform: translateY(-12px); }
.bqs-deluge.at-2 .bqs-ark { transform: translateY(-14px); animation: bqs-bob 3.5s ease-in-out 2s infinite; }
.bqs-deluge.at-2 .bqs-hills { opacity: 0.12; }
.bqs-deluge.at-3 .bqs-gloom { opacity: 0.38; }
.bqs-deluge.at-4 .bqs-gloom { opacity: 0.2; }
.bqs-deluge.at-4 .bqs-rain { opacity: 0.15; }
@keyframes bqs-fall { from { transform: translateY(-24px); } to { transform: translateY(24px); } }

/* The river's brink (Exodus 2): the ark of bulrushes laid in the flags */
.bqs-nile .bqs-flow { stroke-dasharray: 14 10; animation: bq-run 1.6s linear infinite; }
.bqs-nile .bqs-basket { opacity: 0; transform: translateY(-16px); transition: opacity 0.8s ease, transform 1s ease; }
.bqs-nile.acted-2 .bqs-basket { opacity: 1; transform: none; animation: bqs-bob 3s ease-in-out 1s infinite; }
.bqs-nile .bqs-princess { transition: opacity 0.9s ease, transform 1.6s ease; transform: translateX(40px); }
.bqs-nile.at-4 .bqs-princess { transform: none; }

/* The bush at Horeb (Exodus 3): it burns, and is not consumed */
.bqs-bush .bqs-flames { opacity: 0; transform-box: fill-box; transform-origin: center bottom; transition: opacity 0.8s ease; }
.bqs-bush.acted-1 .bqs-flames { opacity: 1; animation: bqs-flicker 0.7s ease-in-out infinite alternate; }
.bqs-bush.at-1:not(.acted-1) .bqs-bush > circle { animation: bq-rustle 2.4s ease-in-out infinite; transform-origin: center bottom; }
.bqs-bush .bqs-moses { transition: transform 1.4s ease; }
.bqs-bush.at-2 .bqs-moses { transform: translateX(12px); }
.bqs-bush.at-4 .bqs-glory { animation: bq-swell 3s ease-in-out infinite; }

/* The sea (Exodus 14): divided as it is traced, crossed, and returned */
.bqs-sea .bqs-pillar { transform-origin: center bottom; animation: bqs-flicker 1.6s ease-in-out infinite alternate; }
.bqs-sea :is(.bqs-wl, .bqs-wr) { transition: transform 0.2s linear; }
.bqs-sea .bqs-wl { transform: translateX(calc(var(--trace, 0) * -86px)); }
.bqs-sea .bqs-wr { transform: translateX(calc(var(--trace, 0) * 86px)); }
.bqs-sea.at-4 :is(.bqs-wl, .bqs-wr) { transform: none; transition: transform 2.4s ease-in; }
.bqs-sea .bqs-crowd { transition: transform 2.6s ease-in-out, opacity 0.9s ease; }
.bqs-sea.at-3 .bqs-crowd { transform: translateX(110px); }
.bqs-sea.at-4 .bqs-crowd { transform: translateX(210px); }
.bqs-sea.tracing { touch-action: none; cursor: crosshair; }

/* The tower of Babel (Genesis 11): it rises brick by brick, then the people scatter */
.bqs-babel :is(.bqs-t2, .bqs-t3, .bqs-t4) { opacity: 0; transform: translateY(10px); transition: opacity 0.6s ease, transform 0.6s ease; }
.bqs-babel.acted-1 :is(.bqs-t2, .bqs-t3, .bqs-t4) { opacity: 1; transform: none; }
.bqs-babel.acted-1 .bqs-t3 { transition-delay: 0.35s; }
.bqs-babel.acted-1 .bqs-t4 { transition-delay: 0.7s; }
.bqs-babel :is(.bqs-pl, .bqs-pr) { transition: transform 2s ease-in, opacity 2s ease-in; }
.bqs-babel.at-4 .bqs-pl { transform: translateX(-90px); opacity: 0.4; }
.bqs-babel.at-4 .bqs-pr { transform: translateX(90px); opacity: 0.4; }
.bqs-babel .bqs-light { animation: bq-swell 3s ease-in-out infinite; }

/* The wilderness (Exodus 16): quails at even, manna in the morning */
.bqs-manna .bqs-quails { animation: bqs-drift 4s ease-in-out infinite; }
.bqs-manna .bqs-dew circle { opacity: 0; transform: scale(0.2); transition: opacity 0.6s ease, transform 0.6s ease; }
.bqs-manna.acted-3 .bqs-dew circle { opacity: 1; transform: none; }
.bqs-manna.acted-3 .bqs-dew circle:nth-child(2n) { transition-delay: 0.3s; }
.bqs-manna.acted-3 .bqs-dew circle:nth-child(3n) { transition-delay: 0.6s; }

/* Sinai (Exodus 19): the cloud, the thunders and the fire upon the mount */
.bqs-sinai :is(.bqs-cloud, .bqs-bolt, .bqs-gloom) { opacity: 0; transition: opacity 1s ease; }
.bqs-sinai.acted-2 .bqs-cloud { opacity: 0.95; animation: bqs-drift 5s ease-in-out infinite; }
.bqs-sinai.acted-2 .bqs-bolt { opacity: 1; animation: bqs-flash 2.6s steps(1) infinite; }
.bqs-sinai.acted-2 .bqs-gloom { opacity: 0.3; }
.bqs-sinai .bqs-fire { transform-origin: center bottom; animation: bqs-flicker 0.8s ease-in-out infinite alternate; }
.bqs-sinai.acted-2 .bqs-folk { animation: bq-rustle 0.6s ease-in-out 3; transform-origin: center bottom; }

/* Jordan (Joshua 3): the waters stand upon an heap, and Israel goes over */
.bqs-jordan .bqs-heap { opacity: 0; transform: translateY(20px); transition: opacity 1s ease, transform 1.2s ease; }
.bqs-jordan.acted-2 .bqs-heap { opacity: 1; transform: none; }
.bqs-jordan .bqs-flow { transition: opacity 1.4s ease; }
.bqs-jordan.acted-2 .bqs-flow { opacity: 0.15; }
.bqs-jordan .bqs-crowd { transition: transform 2.4s ease-in-out; }
.bqs-jordan.at-3 .bqs-crowd { transform: translateX(150px); }

/* Jericho (Joshua 6): the trumpets go round, and the wall falls down flat */
.bqs-jericho.at-2 .bqs-priests { animation: bqs-round 4s ease-in-out infinite; }
.bqs-jericho .bqs-walls rect { transform-box: fill-box; transform-origin: center bottom; transition: transform 1s ease-in, opacity 1s ease-in; }
.bqs-jericho.acted-3 .bqs-walls rect { transform: translateY(40px) scaleY(0.2) rotate(6deg); opacity: 0.35; }
.bqs-jericho.acted-3 .bqs-walls .w2 { transition-delay: 0.2s; }
.bqs-jericho.acted-3 .bqs-walls .w3 { transition-delay: 0.4s; }
@keyframes bqs-round { 50% { transform: translateX(160px); } }

/* What the player does in a story */
.bq-act-target { position: absolute; display: grid; place-items: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; padding: 0; border: 0; border-radius: var(--radius-full); background: none; cursor: pointer; }
.bq-act-ring { width: 40px; height: 40px; border: 3px solid #ffffff; border-radius: var(--radius-full); background: rgba(212, 167, 44, 0.6); animation: bq-pulse 1.4s ease-out infinite; }
.bq-act-target:focus-visible .bq-act-ring { outline: 3px solid var(--green); outline-offset: 3px; }
.bq-trace-hint {
  position: absolute;
  left: 50%;
  bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(23, 32, 29, 0.72);
  color: #ffffff;
  font: var(--text-small);
  font-weight: 700;
  transform: translateX(-50%);
  white-space: nowrap;
  cursor: pointer;
}
.bq-trace-finger { display: inline-grid; transform: rotate(90deg); animation: bqs-swipe 1.6s ease-in-out infinite; }
@keyframes bqs-swipe { 50% { translate: 0 -8px; } }
.bq-panel { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.bq-panel.pop { animation: bq-pop 0.35s ease-out; }
.bq-panel .label { color: var(--reward-ink); }
.bq-panel-text { font: 600 1.0625rem/1.6 var(--font); }
.bq-panel-act { display: flex; align-items: center; gap: var(--space-1); color: var(--primary-ink); font: var(--text-small); font-weight: 700; }
.bq-panel-dots { justify-content: center; }
.bq-panel-nav { display: flex; gap: var(--space-2); }
.bq-panel-nav .btn-lg { flex: 1; }

/* The narrator's switch, and questions asked inside a story */
.bq-panel-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.bq-speaker { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--primary-ink); font: var(--text-label); cursor: pointer; }
.bq-speaker[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.bq-ask { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-1); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.bq-ask-prompt { display: flex; align-items: center; gap: var(--space-2); color: var(--reward-ink); font: var(--text-h2); font-size: 1rem; }
.bq-ask .answers { gap: var(--space-2); }
.bq-ask-said { min-height: 1.2em; color: var(--text-muted); font: var(--text-small); }
.bq-ask.done .bq-ask-said { color: var(--success); font-weight: 700; }

/* ---------- Two and two: the animals brought into the ark ---------- */
.bq-gather { aspect-ratio: 360 / 280; --storm: 0; }
.bq-gather .bqk-dark { opacity: calc(var(--storm) * 0.55); transition: opacity 1.2s ease; }
.bq-gather .bqk-clouds { opacity: calc(0.15 + var(--storm) * 0.85); transition: opacity 1.2s ease; }
.bq-gather .bqk-rain { opacity: 0; transition: opacity 1s ease; }
.bq-gather.raining .bqk-rain { opacity: 0.8; animation: bqk-fall 0.6s linear infinite; }
.bq-gather .bqk-door { transform-box: fill-box; transform-origin: center bottom; transform: scaleY(0.05); transition: transform 1.2s ease 1.2s; }
.bq-gather.shut .bqk-door { transform: none; }
@keyframes bqk-fall { from { transform: translate(0, -20px); } to { transform: translate(-6px, 14px); } }
.bq-animal {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
  margin: -20px 0 0 -28px;
  padding: 2px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  animation: bq-graze 2.6s ease-in-out infinite;
  transition: left 1.3s ease-in, top 1.3s ease-in, transform 1.3s ease-in, opacity 0.5s ease 1s;
}
.bq-animal-art { display: block; width: 42px; height: 35px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25)); }
.bq-animal-art svg { display: block; width: 100%; height: 100%; }
.bq-animal-letter { display: grid; place-items: center; border-radius: var(--radius-full); background: var(--surface); color: var(--text); font: var(--text-h2); }
/* A name is shown on the animal chosen, or on the pair a hint points to. */
.bq-animal-name { position: absolute; top: 100%; z-index: 1; padding: 1px 6px; border-radius: var(--radius-full); background: rgba(23, 32, 29, 0.75); color: #ffffff; font: var(--text-label); white-space: nowrap; opacity: 0; transition: opacity var(--fast); pointer-events: none; }
.bq-animal.picked .bq-animal-name, .bq-animal.shown .bq-animal-name, .bq-animal:focus-visible .bq-animal-name { opacity: 1; }
.bq-animal.picked { z-index: 2; }
.bq-animal.picked { outline: 3px solid var(--gold); outline-offset: 1px; background: rgba(255, 246, 207, 0.55); animation: none; transform: translateY(-4px) scale(1.08); }
.bq-animal.shown { outline: 3px dashed var(--gold); outline-offset: 1px; }
.bq-animal.in { left: var(--door-x) !important; top: var(--door-y) !important; transform: scale(0.35); opacity: 0; animation: none; pointer-events: none; }
.bq-animal.bq-shake { animation: bq-shake 0.4s ease-in-out; }
.bq-animal:focus-visible { outline: 3px solid var(--green); }
@keyframes bq-graze { 50% { translate: 0 -2px; } }
.bq-gather-note { min-height: 1.3em; color: var(--text-muted); font: var(--text-small); font-weight: 700; text-align: center; }
.bq-gather-shut { display: flex; align-items: center; gap: var(--space-1); color: var(--primary-ink); font: var(--text-small); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .bq-animal { animation: none; transition: opacity 0.3s; }
  .bq-gather.raining .bqk-rain { animation: none; }
}

/* ---------- Sorting into groups ---------- */
.bq-sort { display: flex; flex-direction: column; gap: var(--space-3); }
.bq-how-sort { font: var(--text-small); }
.bq-bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); }
.bq-bin { display: flex; flex-direction: column; gap: var(--space-2); min-height: 112px; padding: var(--space-2); border: 2px dashed var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color var(--fast), background var(--fast); }
.bq-bin.ready, .bq-bin.drop { border-color: var(--gold); background: var(--reward-soft); }
.bq-bin-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text); font: var(--text-h2); font-size: 0.9375rem; text-align: left; cursor: pointer; }
.bq-bin-head:disabled { cursor: default; opacity: 1; }
.bq-bin-count { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font: var(--text-label); }
.bq-bin-cards { display: flex; flex-direction: column; gap: 6px; }
.bq-bin-cards .bq-card { width: 100%; text-align: left; }
.bq-bin-empty { padding: var(--space-2); font: var(--text-small); text-align: center; }
.bq-card.picked { border-color: var(--gold); background: var(--reward-soft); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bq-card.locked { border-color: var(--success); }
.bq-card.bq-shake { animation: bq-shake 0.4s ease-in-out; }

/* ---------- Measures, and the ark in three dimensions ---------- */
.bq-dials { display: flex; flex-direction: column; gap: var(--space-3); }
.bq-dial { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.bq-dial.locked { border-color: var(--success); background: var(--success-soft); }
.bq-dial.bq-shake { animation: bq-shake 0.4s ease-in-out; }
.bq-dial-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.bq-dial-label { font: var(--text-h2); font-size: 1rem; }
.bq-dial-value { color: var(--text-muted); font: var(--text-small); white-space: nowrap; }
.bq-dial-value strong { color: var(--text); font: var(--text-number); font-variant-numeric: tabular-nums; }
.bq-dial-controls { display: flex; align-items: center; gap: var(--space-2); }
.bq-dial-controls input[type="range"] { flex: 1; min-width: 0; height: 32px; accent-color: var(--primary); }
.bq-dial-controls .btn { flex: none; width: 40px; padding: 0; font-size: 1.25rem; }

.bq-ark { display: flex; flex-direction: column; gap: var(--space-2); }
.bq-ark-stage {
  position: relative;
  height: 210px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #bcd9ea 0%, #e8f1f4 58%, #3f7fa6 58%, #2c6489 100%);
  box-shadow: var(--shadow-sm);
  perspective: 700px;
  touch-action: pan-y;
  cursor: grab;
}
.bq-ark-stage:active { cursor: grabbing; }
.bq-ark-sea { position: absolute; left: 15%; top: 64%; width: 70%; height: 26px; border-radius: 50%; background: rgba(10, 30, 50, 0.28); filter: blur(4px); }
.bq-ark-turn { position: absolute; right: var(--space-2); bottom: var(--space-2); display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-full); background: rgba(23, 32, 29, 0.6); color: #ffffff; font: var(--text-label); }
.bq-ark3d { position: absolute; left: 50%; top: 52%; width: 0; height: 0; transform-style: preserve-3d; transform: rotateX(-22deg) rotateY(var(--turn, -30deg)); }
.bq-ark3d.spin { animation: bq-ark-spin 18s linear infinite; }
@keyframes bq-ark-spin { from { transform: rotateX(-22deg) rotateY(-30deg); } to { transform: rotateX(-22deg) rotateY(330deg); } }
.ark-box { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.ark-hull { --w: calc(var(--l, 165) * 1px); --d: calc(var(--b, 27.5) * 1px); --t: calc(var(--h, 16.5) * 1px); }
.ark-house { --w: calc(var(--l, 165) * 0.62px); --d: calc(var(--b, 27.5) * 0.7px); --t: calc(var(--h, 16.5) * 0.55px); transform: translateY(calc(var(--h, 16.5) * -0.775px)); }
.ark-face { position: absolute; left: 0; top: 0; transition: width 0.3s ease, height 0.3s ease, transform 0.3s ease; }
.ark-front, .ark-back { width: var(--w); height: var(--t); }
.ark-left, .ark-right { width: var(--d); height: var(--t); }
.ark-top, .ark-bottom { width: var(--w); height: var(--d); }
.ark-front { transform: translate(-50%, -50%) translateZ(calc(var(--d) / 2)); }
.ark-back { transform: translate(-50%, -50%) rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.ark-left { transform: translate(-50%, -50%) rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.ark-right { transform: translate(-50%, -50%) rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.ark-top { transform: translate(-50%, -50%) rotateX(90deg) translateZ(calc(var(--t) / 2)); }
.ark-bottom { transform: translate(-50%, -50%) rotateX(-90deg) translateZ(calc(var(--t) / 2)); }
/* Gopher wood in three stories, pitched within and without */
.ark-hull .ark-face { background: repeating-linear-gradient(180deg, #7a5530 0 calc(33.3% - 1px), #4a311a calc(33.3% - 1px) 33.3%); outline: 1px solid #3b2714; }
.ark-hull .ark-top { background: repeating-linear-gradient(90deg, #8a6238 0 9px, #6b4a2b 9px 10px); }
.ark-hull .ark-front::after { content: ""; position: absolute; left: 62%; top: 34%; width: 9%; height: 66%; border-radius: 2px 2px 0 0; background: #2e1e0f; }
.ark-house .ark-face { background: #8a6238; outline: 1px solid #5a3d22; }
.ark-house .ark-top { background: #5a3d22; }
.ark-house :is(.ark-front, .ark-back)::after { content: ""; position: absolute; left: 8%; right: 8%; top: 16%; height: 22%; border-radius: 2px; background: #f6dc8a; }
.bq-ark3d.built .ark-face { animation: bq-ark-built 1.2s ease-out; }
@keyframes bq-ark-built { 30% { box-shadow: inset 0 0 0 3px #f6dc8a, 0 0 18px #f6dc8a; } }
.bq-ark-sizes { margin: 0; color: var(--text-muted); font: var(--text-small); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .bq-depth, .bq-depth :where(.d1, .d2, .d3) { transform: none !important; }
  .bq-story svg *, .bq-act-ring, .bq-trace-finger, .bq-panel.pop, .bq-ark3d.spin, .bq-ark3d.built .ark-face, .bq-card.bq-shake, .bq-dial.bq-shake { animation: none !important; }
  .bqs-covenant.at-4 .bqs-dove { opacity: 1; transform: translate(162px, 100px); }
  .bqs-covenant.at-2:not(.at-3) .bqs-raven { opacity: 1; transform: translate(240px, 70px); }
}

/* ---------- Missions on the map, keepsakes and stars ---------- */
/* Every mission has a pin on the dotted way. The dot takes the tap (with a
   little room around it); the label shows under the chosen one only. */
.bq-pin-dot { position: relative; }
.bq-pin-dot::after { content: ""; position: absolute; inset: -6px; border-radius: var(--radius-full); }
.bq-pin:focus-visible { outline: none; }
.bq-pin:focus-visible .bq-pin-dot { outline: 3px solid #ffffff; outline-offset: 3px; }
.bq-pin.open .bq-pin-dot { background: #2e7552; }
.bq-pin.side:not(.done):not(.locked) .bq-pin-dot { background: #2f6f86; }
.bq-pin.finale:not(.done) .bq-pin-dot { border-color: var(--gold); background: #8a3b2e; }
.bq-pin.finale.locked .bq-pin-dot { background: #5d6b66; }
.bq-pin.chosen { z-index: 1; }

.bq-map-key { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; font: var(--text-small); color: var(--text-muted); }
.bq-map-key li { display: inline-flex; align-items: center; gap: 6px; }
.bq-key-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: var(--radius-full); background: var(--green); color: #ffffff; box-shadow: 0 0 0 1px var(--border); }
.bq-key-dot.done { background: var(--gold); color: var(--charcoal); }
.bq-key-dot.side { background: #2f6f86; }
.bq-key-dot.finale { border-color: var(--gold); background: #8a3b2e; }
.bq-key-dot.locked { background: #5d6b66; }

.bq-mission-panel .badge-row { flex-wrap: wrap; }
.bq-preview-text { margin: 0; }
.bq-preview-rewards { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* The stars a mission can earn, and which are earned (BqObjectives). */
.bq-objectives { display: grid; gap: var(--space-2); }
.bq-objectives ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bq-goal { display: flex; align-items: center; gap: var(--space-2); font: var(--text-small); color: var(--text-muted); }
.bq-goal-mark { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-full); background: var(--surface-soft); color: var(--text-muted); }
.bq-goal.earned { color: var(--text); }
.bq-goal.earned .bq-goal-mark { background: var(--success-soft); color: var(--success); }
.bq-goal-text { flex: 1; }
.bq-preview-chapter { margin: 0; }
.bq-preview-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.bq-hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.bq-hero-links .btn { color: #ffffff; }
.bq-mission-mark.side { background: #2f6f86; }
.bq-mission-mark.finale { background: #8a3b2e; color: var(--gold); }

/* Stars: lit for what has been earned. */
.bq-stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.bq-star { display: inline-flex; color: var(--border); }
.bq-star.lit { color: var(--gold); }

/* A keepsake's picture; one not found yet is a shadow of itself. */
.bq-keepsake { display: inline-grid; flex: none; place-items: center; }
.bq-keepsake svg { display: block; }
.bq-keepsake.unfound svg { filter: grayscale(1) brightness(0.55); opacity: 0.45; }
.bq-reward-keepsake { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: var(--radius-full); background: var(--surface-soft); font: 700 0.8125rem/1.4 var(--font); color: var(--text); }
.bq-reward-keepsake.held { background: var(--reward-soft); color: var(--reward-ink); }

.bq-keepsakes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.bq-keepsake-tile { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); width: 100%; height: 100%; padding: var(--space-3) var(--space-2); border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--surface-soft); font: inherit; color: var(--text-muted); text-align: center; }
.bq-keepsake-tile.held { border-style: solid; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); cursor: pointer; }
.bq-keepsake-tile.held:active { transform: scale(0.97); }
.bq-keepsake-name { font: 800 0.8125rem/1.3 var(--font); }
.bq-keepsake-from { font: var(--text-small); }
.bq-keepsake-detail { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.bq-keepsake-detail p { margin: 0; }
.bq-new-keepsake { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.bq-new-keepsake-body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 180px; }
.bq-new-keepsake-body p { margin: 0; }

.bq-mastery { display: flex; flex-direction: column; gap: var(--space-2); }
.bq-mastery h3 { margin: var(--space-2) 0 0; }
.bq-mastery ul { margin: 0; padding: 0; list-style: none; }
.bq-mastery-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.bq-mastery-row .list-body { flex: 1; min-width: 0; }
/* In a row, a keepsake is a small square: held, it opens; still to find, it waits. */
.bq-mastery-row .bq-keepsake-tile { flex: none; justify-content: center; width: 52px; height: 52px; padding: 0; }
.bq-row-stars { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); }
.bq-collection-story { margin: var(--space-2) 0 0; font: var(--text-h3); }
.bq-collection-story .muted { font: var(--text-small); }
.bq-chip-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.topic-chip[aria-pressed="true"] .bq-chip-count { color: inherit; }
.bq-kept { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.bq-kept .bq-keepsake-tile { width: 56px; height: 56px; justify-content: center; padding: 0; }
.bq-mastery-note { display: flex; align-items: center; gap: var(--space-2); }

/* Scripture quoted word for word, set apart from the words that retell it. */
q.bq-quote { font-style: italic; quotes: "\201C" "\201D"; }
.bq-translation { margin: 0; font: var(--text-small); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .bq-keepsake-tile.held:active { transform: none; }
}

/* The Journey before signing in: the world, and every mission in it */
.bq-guest-lead { color: rgba(255, 255, 255, 0.88); }
.bq-preview-summary { margin: calc(var(--space-2) * -1) 0 var(--space-2); }
.bq-preview-row .list-detail { color: var(--text-muted); }

/* ---------- The hub's ways in: Explore worlds, the library, My Journey ---------- */
.bq-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.bq-link { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--tap); padding: var(--space-3); border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--fast); }
.bq-link:hover { border-color: var(--primary-ink); }
.bq-link-icon { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--surface-soft); color: var(--primary-ink); }
.bq-link-body { display: grid; gap: 2px; min-width: 0; }
.bq-link-body span { font: var(--text-small); color: var(--text-muted); }
.bq-recent { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Explore worlds: the lands on one road ---------- */
.bq-lands { aspect-ratio: 360 / 600; }
.bq-land { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.bq-land-dot { display: grid; place-items: center; width: 40px; height: 40px; border: 3px solid #ffffff; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-md); }
.bq-land.done .bq-land-dot { background: var(--reward); color: var(--reward-ink); }
.bq-land.chosen .bq-land-dot { outline: 3px solid var(--reward); outline-offset: 2px; }
.bq-land:focus-visible .bq-land-dot { outline: 3px solid var(--green); outline-offset: 3px; }
.bq-land-name { padding: 2px var(--space-2); border-radius: var(--radius-full); background: rgba(255, 252, 240, 0.92); color: #23301f; font: var(--text-label); white-space: nowrap; box-shadow: var(--shadow-sm); }
.bq-land.later { cursor: default; opacity: 0.8; }
.bq-land.later .bq-land-name { border: 1px dashed #8a826a; background: rgba(255, 252, 240, 0.75); color: #4a4636; }
.bq-region-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.bq-region-row { display: grid; gap: 2px; width: 100%; min-height: var(--tap); padding: var(--space-3); border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; text-align: left; }
button.bq-region-row { cursor: pointer; }
.bq-region-row.chosen { border-color: var(--reward); background: var(--reward-soft); }
.bq-region-row.later { border-style: dashed; background: var(--surface-soft); }

/* ---------- The story library ---------- */
.bq-library-tools { display: grid; gap: var(--space-3); }
.bq-search { width: 100%; min-height: var(--tap); padding: 0 var(--space-4); border: 1.5px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text); font: var(--text-body); }
.bq-search:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.bq-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-2); }
.bq-filter { display: grid; gap: 4px; }
.bq-filter select { min-height: 44px; padding: 0 var(--space-2); border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; }
.bq-library-count { margin: var(--space-3) 0 0; }
.bq-story-list { display: grid; gap: var(--space-3); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.bq-story-card { display: flex; gap: var(--space-3); padding: var(--space-3); border: 1.5px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.bq-story-art { position: relative; flex: none; width: 84px; align-self: stretch; min-height: 128px; overflow: hidden; border-radius: var(--radius-md); }
.bq-story-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
:is(.bq-story-art, .bq-world-art) .bqm-path { display: none; }
.bq-story-body { display: grid; flex: 1; align-content: start; gap: var(--space-2); min-width: 0; }
.bq-story-body p { margin: 0; }
.bq-story-title { margin: 0; font: var(--text-h2); }
.bq-story-people { font: var(--text-small); color: var(--text-muted); }
.bq-story-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.bq-planned { margin: var(--space-3) 0 0; padding: var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--text-muted); font: var(--text-small); }
.bq-library-empty { display: grid; justify-items: start; gap: var(--space-2); margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-soft); }
.bq-library-empty p { margin: 0; }

/* ---------- A story's own page, and My Journey ---------- */
.bq-story-facts { display: grid; gap: var(--space-1); margin: var(--space-4) 0 0; }
.bq-story-facts p { margin: 0; }
.bq-story-done { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.bq-story-done > div { display: grid; flex: 1; gap: 2px; min-width: 160px; }
.bq-story-done p { margin: 0; }
.bq-badges { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.bq-badge { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-soft); }
.bq-badge-body { display: grid; gap: 2px; min-width: 0; }
.bq-badge-body .muted { font: var(--text-small); }
@media (max-width: 400px) {
  .bq-story-card { flex-direction: column; }
  .bq-story-art { width: 100%; min-height: 96px; }
}

/* ---------- Stories in a list (each campaign, with its map) ---------- */
.bq-worlds { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.bq-world { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-2); border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color var(--fast); }
.bq-world:hover { border-color: var(--primary-ink); }
.bq-world.here { border-color: var(--reward); background: var(--reward-soft); cursor: default; }
.bq-world-art { position: relative; flex: none; width: 56px; height: 84px; overflow: hidden; border-radius: var(--radius-sm); }
.bq-world-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bq-world-art .bqm-path { display: none; }
.bq-world-body { display: grid; flex: 1; gap: 4px; min-width: 0; }
.bq-world-name { font: var(--text-h2); }
.bq-world-detail { font: var(--text-small); color: var(--text-muted); }
.bq-world-title { display: grid; gap: 2px; margin: var(--space-6) 0 0; font: var(--text-h1); }
/* The other worlds' maps move as Beginnings' does. */
.bq-map-art .bqm-camels, .bq-hero-art .bqm-camels { animation: bqm-walk 6s ease-in-out infinite alternate; }
.bq-map-art .bqm-river, .bq-hero-art .bqm-river { animation: bqm-flow 7s ease-in-out infinite alternate; }
@keyframes bqm-walk { to { transform: translateX(-10px); } }
@keyframes bqm-flow { to { transform: translateX(6px); } }

/* ---------- Clues: something to find in a story's picture (BqStory) ---------- */
.bq-clue { position: absolute; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; border-radius: var(--radius-full); background: rgba(255, 246, 214, 0.18); color: #fff6d6; cursor: pointer; animation: bq-glint 2.6s ease-in-out infinite; }
.bq-clue svg { opacity: 0.85; }
.bq-clue.found { background: rgba(79, 199, 154, 0.35); animation: none; }
.bq-clue:focus-visible { outline: 3px solid var(--reward); outline-offset: 2px; }
@keyframes bq-glint { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 246, 214, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(255, 246, 214, 0); } }
.bq-clue-note { display: grid; gap: 6px; margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--reward-soft); }
.bq-clue-note p { margin: 0; }
.bq-clue-label { color: var(--reward-ink); }
.bq-clue-count { display: flex; align-items: flex-start; gap: 6px; margin: 0; font: var(--text-small); color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .bq-clue { animation: none; } }

/* The results and the record, said in words rather than a grid of figures. */
.bq-results-summary { margin: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: center; }
.bq-results-quiet { justify-content: center; }
.bq-results-quiet:empty { display: none; }
.bq-record { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.bq-record p { margin: 0; }
.bq-record-lead { font: var(--text-h2); font-variant-numeric: tabular-nums; }

/* Asked for less motion, the pictures stop moving but keep their light: stars,
   glows and a clue to find still fade gently, which moves nothing on the screen. */
@media (prefers-reduced-motion: reduce) {
  .bq-map-art svg .bqm-stars circle, .bq-hero-art svg .bqm-stars circle { animation: bq-twinkle 4s ease-in-out infinite !important; }
  .bq-map-art svg :is(.bqm-bow, .bqm-walk, .bqm-sword), .bq-hero-art svg :is(.bqm-bow, .bqm-walk, .bqm-sword) { animation: bq-glow 6s ease-in-out infinite !important; }
  .bq-clue { animation: bq-glint 3s ease-in-out infinite; }
}

/* ---------- Scenes in three dimensions (scene3d.js) ---------- */
/* The canvas fills its scene; the buttons over it are placed by scene3d.js
   (a transform from the top left) and hidden when their point is off screen. */
.scene3d-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.off-stage { visibility: hidden; }

/* A story's own world (journey3d.js): its map, and its moments acted out. The
   flat picture stays under it until it is drawn; then the same buttons are
   placed over their points by a transform, so their own offsets are dropped. */
.bq-map.is3d .bq-map-art, .bq-scene.is3d .bq-scene-art { visibility: hidden; }
.bq-map.is3d, .bq-scene.is3d { background: #c9d2cc; }
.bq-map.is3d .scene3d-canvas { cursor: grab; }
.bq-map.is3d .scene3d-canvas:active { cursor: grabbing; }
.bq-map.is3d :is(.bq-pin, .bq-you, .bq-map3d-place), .bq-scene.is3d :is(.bq-act-target, .bq-clue, .bq-spot) { left: 0 !important; top: 0 !important; margin: 0; will-change: transform; }
.bq-map.is3d .bq-you { z-index: 3; animation: none; transition: none; }
.bq-map.is3d .bq-you .avatar { animation: bq-bob 2.4s ease-in-out infinite; }
.bq-map3d-place { position: absolute; z-index: 1; padding: 2px 9px; border-radius: var(--radius-full); background: rgba(8, 28, 22, 0.78); color: #ffffff; font: 800 0.6875rem/1.3 var(--font); white-space: nowrap; pointer-events: none; }
.bq-map:not(.is3d) .bq-map3d-place { display: none; }
.bq-map3d-tip { font-size: 0.75rem; }
@media (prefers-reduced-motion: reduce) { .bq-map.is3d .bq-you .avatar { animation: none; } }

/* The map of the lands. */
.bq-map3d { position: relative; width: 100%; height: min(64vh, 560px); min-height: 340px; overflow: hidden; border-radius: var(--radius-lg); background: #cfe6ee; box-shadow: var(--shadow-md); outline: none; }
.bq-map3d:focus-visible { box-shadow: 0 0 0 3px var(--green), var(--shadow-md); }
.bq-map3d .scene3d-canvas { cursor: grab; }
.bq-map3d .scene3d-canvas:active { cursor: grabbing; }
.bq-map3d-labels { position: absolute; inset: 0; pointer-events: none; }
.bq-map3d.loading .bq-map3d-labels, .bq-map3d.loading .bq-map3d-controls { visibility: hidden; }
.bq-map3d-labels > * { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.bq-map3d-land { padding: 4px 10px; border: 2px solid #ffffff; border-radius: var(--radius-full); background: var(--green); color: #ffffff; font: var(--text-label); font-weight: 800; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow-sm); }
.bq-map3d-land.chosen { background: var(--gold); color: var(--charcoal); }
.bq-map3d-land.later { padding: 0 4px; border: 0; background: none; box-shadow: none; color: #1f2d27; font-weight: 700; opacity: 0.7; text-shadow: 0 0 3px rgba(255, 255, 255, 0.9); pointer-events: none; }
.bq-map3d-land:focus-visible, .bq-map3d-pin:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bq-map3d-pin { display: inline-flex; align-items: center; gap: 4px; min-width: 30px; min-height: 30px; justify-content: center; padding: 0 6px; border: 2px solid #ffffff; border-radius: var(--radius-full); background: #f3ecd9; color: var(--charcoal); font: var(--text-label); cursor: pointer; box-shadow: var(--shadow-sm); }
.bq-map3d-pin.done { background: var(--gold); }
.bq-map3d-pin.progress { background: #34d399; animation: bq-pin-glow 2.2s ease-in-out infinite; }
.bq-map3d-pin.locked { background: #8a8f8c; color: #ffffff; }
.bq-map3d-pin.chosen { outline: 3px solid var(--green); outline-offset: 1px; }
.bq-map3d-pin-name { font-weight: 800; white-space: nowrap; }
@keyframes bq-pin-glow { 50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.35); } }
.bq-map3d-controls { position: absolute; right: var(--space-2); top: var(--space-2); display: flex; flex-direction: column; gap: 6px; }
.bq-map3d-btn { width: 40px; height: 40px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.92); color: var(--green); font-size: 22px; font-weight: 800; box-shadow: var(--shadow-sm); }
.bq-map3d-loading { position: absolute; inset: 0; display: none; place-items: center; margin: 0; color: var(--green); font-weight: 700; }
.bq-map3d.loading .bq-map3d-loading { display: grid; }
.bq-map3d-note { position: absolute; left: var(--space-2); bottom: var(--space-2); margin: 0; padding: 2px 8px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.8); color: #2a3a34; font: var(--text-label); pointer-events: none; }
.bq-map3d-hint { position: absolute; left: 50%; top: 50%; margin: 0; padding: 8px 14px; border-radius: var(--radius-md); background: rgba(23, 32, 29, 0.8); color: #ffffff; font-weight: 700; transform: translate(-50%, -50%); opacity: 0; transition: opacity var(--fast); pointer-events: none; }
.bq-map3d-hint.shown { opacity: 1; }
.bq-map-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); }
.bq-pin-dot { display: inline-block; width: 14px; height: 14px; border: 2px solid #ffffff; border-radius: var(--radius-full); background: #f3ecd9; box-shadow: 0 0 0 1px var(--border); }
.bq-pin-dot.done { background: var(--gold); }
.bq-pin-dot.progress { background: #34d399; }
.bq-pin-dot.locked { background: #8a8f8c; }
.bq-story-chosen > .bq-world { box-shadow: 0 0 0 3px var(--gold); }

/* The field before the ark: the scene draws the animals; their buttons stand
   over them, plain until chosen or shown. */
.bq-gather.is3d > .bq-scene-art { visibility: hidden; }
.bq-gather.is3d .bq-animal, .bq-gather.is3d .bq-animal.in { left: 0 !important; top: 0 !important; width: 52px; height: 52px; margin: 0; border-radius: var(--radius-full); animation: none; transition: opacity 0.4s; background: none; outline-offset: -4px; }
.bq-gather.is3d .bq-animal-art { opacity: 0; }
.bq-gather.is3d .bq-animal.picked { outline: none; background: none; }
.bq-gather.is3d .bq-animal.picked .bq-animal-name, .bq-gather.is3d .bq-animal.shown .bq-animal-name { opacity: 1; }
.bq-gather.is3d .bq-animal.in { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .bq-map3d-pin.progress { animation: none; }
}
