/* Journey to Bethlehem: game screen. Loaded after base.css (fonts and colours). */

#game {
  --bar: env(safe-area-inset-top);
  --panel-bg: #fffaf0;
  --panel-line: #ead9b4;
}
.jtb {
  position: fixed; inset: var(--bar) 0 0 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--navy); color: var(--navy);
}
@media (min-aspect-ratio: 1/1) and (min-width: 700px) {
  .jtb { grid-template-rows: none; grid-template-columns: auto minmax(300px, 1fr); }
  .jtb-board-wrap { width: min(calc((100dvh - var(--bar)) * 2000 / 1414), calc(100vw - 320px)); display: grid; align-content: center; }
}

/* ---------- Board ---------- */
.jtb-board-wrap { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; background: #1d2f4e; overscroll-behavior: contain; }
.jtb-board { position: relative; width: 100%; aspect-ratio: 2000 / 1414; }
.jtb-board > img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; pointer-events: none; }
.jtb-marks, .jtb-spaces { position: absolute; inset: 0; width: 100%; height: 100%; }
.jtb-spaces { pointer-events: none; }
.jtb-seen { fill: rgba(255,189,0,.28); stroke: #FFBD00; stroke-width: 6; }
.jtb-mark { fill: rgba(255, 189, 0, .28); stroke: var(--yellow); stroke-width: 9; cursor: pointer; }
.jtb-mark--food { fill: rgba(237, 16, 34, .16); stroke-dasharray: 18 10; }
.jtb-mark:hover, .jtb-mark:focus { fill: rgba(255, 189, 0, .55); outline: none; }
.jtb-mark-pulse { animation: jtb-pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes jtb-pulse { 50% { transform: scale(1.12); } }
.jtb-here { fill: none; stroke: var(--c, #fff); stroke-width: 10; opacity: .95; }

.jtb-donkey {
  position: absolute; width: 4.6%; transform: translate(-50%, -82%);
  transition: left .24s ease, top .24s ease; pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.45));
}
.jtb-donkey img { width: 100%; height: auto; scale: var(--face, 1) 1; transition: scale .18s ease; }
.jtb-donkey--hop img { animation: jtb-hop .26s ease-out; }
@keyframes jtb-hop { 45% { translate: 0 -32%; } 80% { translate: 0 2%; } }
.jtb-donkey--current { z-index: 2; width: 5.6%; }
.jtb-donkey--current::after {
  content: ""; position: absolute; left: 50%; bottom: -6%; width: 70%; height: 12%; transform: translateX(-50%);
  border-radius: 50%; background: var(--c); opacity: .9; z-index: -1;
}

/* ---------- Panel ---------- */
.jtb-panel { overflow-y: auto; background: var(--panel-bg); padding: 14px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.jtb-panel > * + * { margin-top: 14px; }
.jtb-panel h2 { font-size: 1.25rem; margin: 0; }

.jtb-turn { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: #fff; border: 4px solid var(--c); }
.jtb-turn img { width: 48px; height: auto; flex: none; }
.jtb-turn__who { font-family: var(--font-head); font-weight: 900; font-size: 1.35rem; line-height: 1.15; margin: 0; }
.jtb-turn__where { margin: 0; color: var(--ink-soft); font-size: 1rem; }

.jtb-res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; margin: 0; }
.jtb-res li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; min-width: 0; background: #fff; border-radius: var(--radius-sm); border: 2px solid var(--panel-line); }
.jtb-res img { width: 34px; height: 34px; flex: none; }
.jtb-res b { font-family: var(--font-head); font-size: 1.6rem; line-height: 1; }
.jtb-res span { display: block; font-size: .85rem; color: var(--ink-soft); line-height: 1.1; }

.jtb-log { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.4; }
.jtb-log li { padding: 2px 0; color: var(--ink-soft); }
.jtb-log li:first-child { color: var(--navy); font-weight: 700; }

.jtb-actions { display: grid; gap: 10px; }
.jtb-note { margin: 0; font-size: 1rem; color: var(--ink-soft); }

.jtb-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px;
  font: inherit; text-align: left; color: var(--navy); cursor: pointer;
  background: #fff; border: 3px solid var(--line); border-radius: 16px;
  touch-action: manipulation;
}
.jtb-btn:hover:not(:disabled) { border-color: var(--blue); }
.jtb-btn:disabled { opacity: .5; cursor: not-allowed; }
.jtb-btn b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 1.15rem; line-height: 1.2; }
.jtb-btn small { display: block; font-size: .95rem; color: var(--ink-soft); line-height: 1.25; }
.jtb-btn--main { background: var(--blue-text); border-color: var(--blue-text); color: #fff; }
.jtb-btn--main small { color: #e3efff; }
.jtb-btn--main:hover:not(:disabled) { background: var(--navy); border-color: var(--navy); }
.jtb-btn--win { background: var(--yellow); border-color: var(--yellow); }
.jtb-btn__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; font-size: 1.6rem; }
.jtb-btn__icon img { width: 36px; height: 36px; }
.jtb-btn--small { min-height: 48px; padding: 6px 14px; justify-content: center; text-align: center; font-family: var(--font-head); font-weight: 800; }

.jtb-dir { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 3px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.jtb-dir button { min-height: 48px; font: 800 1rem var(--font-head); border: 0; background: transparent; color: var(--navy); cursor: pointer; }
.jtb-dir button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.jtb-dest { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.jtb-dest .jtb-btn { min-height: 52px; padding: 8px 12px; }

.jtb-swaps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.jtb-swap { justify-content: center; gap: 6px; font-family: var(--font-head); font-weight: 900; font-size: 1.2rem; }
.jtb-swap img { width: 32px; height: 32px; }

.jtb-rolling { display: flex; align-items: center; gap: 14px; }
.jtb-die {
  width: 64px; height: 64px; flex: none; padding: 9px; border-radius: 14px; background: #fff; border: 3px solid var(--navy);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
}
.jtb-die i { width: 12px; height: 12px; border-radius: 50%; background: var(--red); place-self: center; visibility: hidden; }
.jtb-die--spin { animation: jtb-spin .5s ease-out; }
@keyframes jtb-spin { from { transform: rotate(-200deg) scale(.6); } }

.jtb-players { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.jtb-players li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--panel-line); font-size: .95rem; }
.jtb-players li[aria-current="true"] { border-color: var(--c); box-shadow: inset 6px 0 0 var(--c); }
.jtb-players img.d { width: 30px; flex: none; }
.jtb-players .n { font-family: var(--font-head); font-weight: 800; flex: 1; min-width: 0; line-height: 1.2; }
.jtb-players .n small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--ink-soft); }
.jtb-players .r { display: flex; gap: 8px; white-space: nowrap; font-weight: 700; }
.jtb-players .r img { width: 20px; height: 20px; display: inline; vertical-align: -4px; margin-right: 2px; }

.jtb-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.jtb-tools .jtb-btn { width: auto; flex: 1; }

/* ---------- Overlays (setup, win) and dialogs ---------- */
.jtb-overlay {
  position: fixed; inset: var(--bar, 0px) 0 0 0; z-index: 2; overflow-y: auto;
  background: linear-gradient(180deg, rgba(6,36,73,.35), rgba(6,36,73,.8)), url("../art/title.webp") center / cover;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}
.jtb-overlay[hidden] { display: none; }
.jtb-card { max-width: 560px; margin: 0 auto; background: var(--panel-bg); color: var(--navy); border-radius: var(--radius); padding: clamp(18px, 4vw, 28px); box-shadow: var(--shadow); }
.jtb-card h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 0 0 .2em; }
.jtb-card h2 { font-size: 1.3rem; margin: 1.1em 0 .5em; }
.jtb-card > p { margin: 0 0 .8em; }
.jtb-card .jtb-btn + .jtb-btn { margin-top: 10px; }

.jtb-travellers { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.jtb-travellers li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 48px; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--panel-line); border-radius: 14px; padding: 6px 8px; }
.jtb-travellers .colour { width: 52px; height: 52px; border: 3px solid var(--c); border-radius: 12px; background: #fff; padding: 3px; cursor: pointer; }
.jtb-travellers .colour img { width: 100%; height: 100%; object-fit: contain; }
.jtb-travellers input { width: 100%; min-height: 48px; font: 700 1.05rem var(--font-body); color: var(--navy); border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.jtb-travellers .remove { width: 48px; height: 48px; border: 0; background: transparent; font-size: 1.5rem; color: var(--ink-soft); cursor: pointer; border-radius: 10px; }
.jtb-travellers .remove:hover { background: var(--sky); }
.jtb-who { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.jtb-who button { min-height: 44px; padding: 0 10px; font: 800 .9rem var(--font-head); border: 0; background: #fff; color: var(--navy); cursor: pointer; }
.jtb-who button[aria-pressed="true"] { background: var(--navy); color: #fff; }
@media (max-width: 420px) {
  .jtb-travellers li { grid-template-columns: 52px minmax(0, 1fr) 44px; }
  .jtb-travellers .jtb-who { grid-column: 2 / 3; grid-row: 2; }
}

.jtb-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jtb-levels button { min-height: 64px; padding: 8px; font: inherit; border: 3px solid var(--line); border-radius: 14px; background: #fff; color: var(--navy); cursor: pointer; }
.jtb-levels button b { display: block; font-family: var(--font-head); font-weight: 900; }
.jtb-levels button small { display: block; font-size: .8rem; color: var(--ink-soft); line-height: 1.2; }
.jtb-levels button[aria-pressed="true"] { border-color: var(--blue-text); box-shadow: inset 0 0 0 2px var(--blue-text); }

.jtb-win-donkey { width: 120px; margin: 0 auto 8px; }
.jtb-bible { background: #fff; border-radius: 16px; padding: 16px 18px; border: 2px solid var(--panel-line); margin-top: 16px; }
.jtb-bible h2 { margin-top: 0; }
.jtb-bible ul { margin: 0; padding-left: 1.2em; }
.jtb-bible li + li { margin-top: 6px; }
.jtb-small { font-size: .95rem; color: var(--ink-soft); }

.jtb-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); border: 0; border-radius: var(--radius); padding: 0; color: var(--navy); background: var(--panel-bg); box-shadow: var(--shadow); }
.jtb-dialog::backdrop { background: rgba(6, 36, 73, .7); }
.jtb-dialog__body { padding: 20px clamp(16px, 4vw, 26px) 22px; }
.jtb-dialog h2 { font-size: 1.4rem; margin: 0 0 .5em; }
.jtb-dialog h3 { font-size: 1.1rem; margin: 1em 0 .3em; }
.jtb-dialog p, .jtb-dialog li { font-size: 1rem; }
.jtb-dialog table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.jtb-dialog td { padding: 6px 4px; border-top: 1px solid var(--panel-line); vertical-align: top; }
.jtb-dialog td:first-child { font-weight: 800; white-space: nowrap; padding-right: 10px; }
.jtb-dialog__actions { display: flex; gap: 10px; margin-top: 18px; }
.jtb-dialog__actions .jtb-btn { justify-content: center; text-align: center; }

.jtb-trade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jtb-trade h3 { margin: 0 0 6px; font-size: 1rem; }
.jtb-step { display: grid; grid-template-columns: 32px 44px 1fr 44px; align-items: center; gap: 4px; margin-bottom: 6px; }
.jtb-step img { width: 30px; height: 30px; }
.jtb-step output { text-align: center; font: 900 1.3rem var(--font-head); }
.jtb-step button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font: 900 1.3rem var(--font-head); color: var(--navy); cursor: pointer; }
.jtb-step button:disabled { opacity: .35; }
@media (max-width: 420px) { .jtb-trade { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .jtb-mark-pulse, .jtb-die--spin { animation: none; }
  .jtb-donkey, .jtb-donkey img { transition: none; }
  .jtb-donkey--hop img, .jtb-pop { animation: none; }
}

.jtb-moment-eyebrow { font: 800 .85rem var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--blue-text); margin: 0 0 .3em; }
.jtb-moment-title { font: 900 1.1rem var(--font-head); margin: 0 0 .4em; }
.jtb-verse { margin: 0 0 12px; padding: 14px 16px; background: #fff; border-left: 6px solid var(--yellow); border-radius: 10px; font-size: 1.15rem; line-height: 1.5; }
.jtb-verse footer { margin-top: 6px; font: 800 .9rem var(--font-head); color: var(--ink-soft); }
.jtb-logo { margin: 0 auto 8px; max-width: 360px; }
.jtb-logo img { width: 100%; height: auto; }

/* ---------- Effects: flying tokens, the big die, pops ---------- */
.jtb-fx { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.jtb-token { position: fixed; width: 44px; height: 44px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); will-change: transform; }

.jtb-bigdie { position: fixed; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 12px; }
.jtb-bigdie__cube {
  --s: clamp(84px, 15vmin, 140px);
  width: var(--s); height: var(--s); padding: calc(var(--s) * .14); border-radius: calc(var(--s) * .22);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  background: radial-gradient(circle at 30% 25%, #fff 0 40%, #f3ead9 100%);
  box-shadow: inset 0 -6px 0 rgba(140, 110, 60, .25), inset 0 3px 0 #fff, 0 14px 22px rgba(0,0,0,.4);
}
.jtb-bigdie__cube i { width: 64%; aspect-ratio: 1; border-radius: 50%; place-self: center; visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #ff5361, #c50a19); box-shadow: inset 0 2px 2px rgba(0,0,0,.25); }
.jtb-bigdie__cube i.on { visibility: visible; }
.jtb-bigdie__label { margin: 0; min-height: 1.4em; padding: 4px 16px; border-radius: 999px; font: 900 clamp(1.1rem, 3vmin, 1.5rem) var(--font-head);
  color: var(--navy); background: var(--yellow); box-shadow: 0 4px 0 rgba(0,0,0,.2); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.jtb-bigdie--landed .jtb-bigdie__label { opacity: 1; transform: none; }
.jtb-bigdie--landed .jtb-bigdie__cube { animation: jtb-thump .3s ease-out; }
@keyframes jtb-thump { 40% { transform: scale(1.12); } }

.jtb-pop { animation: jtb-pop .35s ease-out; }
@keyframes jtb-pop { 40% { transform: scale(1.18); } }
.jtb-players .r b { font-weight: 700; }
.jtb-players .r > span { display: inline-block; }

.jtb-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.jtb-toggles button { min-height: 44px; font: 800 .95rem var(--font-head); border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); cursor: pointer; }
.jtb-toggles button[aria-pressed="false"] { color: var(--ink-soft); background: #f1f1ee; text-decoration: line-through; text-decoration-thickness: 2px; }

/* ---------- Bible moment card (same layout as the printed 63 × 94 mm card) ---------- */
.jtb-dialog--card { background: transparent; box-shadow: none; width: auto; max-width: 100vw; overflow: visible; }
.jtb-dialog--card .jtb-dialog__body { padding: 8px; display: grid; justify-items: center; gap: 10px; }
.jtb-dialog--card .jtb-dialog__actions { margin-top: 0; }
.jtb-dialog--card .jtb-btn { min-width: 200px; box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.jtb-mcard__hint { margin: 0; color: #fff; font-weight: 700; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.jtb-mcard {
  --h: min(calc(100dvh - 150px), 640px, calc((100vw - 32px) * 94 / 63));
  height: var(--h); width: calc(var(--h) * 63 / 94); perspective: 1600px;
}
.jtb-mcard__flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.4,.1,.3,1); }
.jtb-mcard--open .jtb-mcard__flip { transform: rotateY(180deg); }
.jtb-mcard__face { position: absolute; inset: 0; border-radius: calc(var(--h) * .035); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.45); background: #f4ead6; }
.jtb-mcard__face > img { width: 100%; height: 100%; object-fit: fill; }
.jtb-mcard__front { transform: rotateY(180deg); }
.jtb-mcard__back span { position: absolute; left: 17.5%; right: 17.5%; top: 77%; height: 9.6%; display: grid; place-items: center;
  font: 900 calc(var(--h) * .041) var(--font-head); color: #5a3214; }
.jtb-mcard__txt { position: absolute; left: 10.3%; right: 10.3%; top: 51.6%; bottom: 6.4%; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; color: var(--navy); font-size: calc(var(--h) * .0315); line-height: 1.32; }
.jtb-mcard__txt.long { font-size: calc(var(--h) * .028); line-height: 1.27; }
.jtb-mcard__txt p { margin: 0; }
.jtb-mcard__txt .num { font: 800 calc(var(--h) * .024) var(--font-head); color: #8a5a00; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .3em; }
.jtb-mcard__txt .ttl { font: 900 calc(var(--h) * .039)/1.12 var(--font-head); color: #5a3214; margin: 0 0 .4em; }
.jtb-mcard__txt .ref { font: 900 calc(var(--h) * .03) var(--font-head); margin-top: .4em; }
.jtb-mcard__txt .ref abbr { text-decoration: none; font-weight: 800; font-size: .8em; color: var(--ink-soft); }
.jtb-mcard__txt .nt { font-size: calc(var(--h) * .023); color: var(--ink-soft); margin-top: .4em; }
@media (prefers-reduced-motion: reduce) { .jtb-mcard__flip { transition: none; } }

/* ---------- Menus: clay buttons, title screen, "Who is travelling?" ---------- */
.jtb-clay {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px 30px; border: 0; border-radius: 999px; cursor: pointer;
  font: 900 1.2rem/1.1 var(--font-head); color: var(--navy); touch-action: manipulation;
  background: linear-gradient(180deg, #fffdf7, #f2e4c8);
  box-shadow: inset 0 -5px 0 rgba(120, 85, 40, .22), inset 0 2px 0 #fff, 0 5px 0 rgba(6, 36, 73, .28), 0 10px 18px rgba(0, 0, 0, .22);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.jtb-clay:hover { filter: brightness(1.04); }
.jtb-clay:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgba(120, 85, 40, .22), 0 1px 0 rgba(6, 36, 73, .28), 0 4px 8px rgba(0, 0, 0, .2); }
.jtb-clay--go { min-height: 68px; padding: 12px 52px; font-size: 1.7rem; background: linear-gradient(180deg, #ffd95a, #ffb000); box-shadow: inset 0 -6px 0 rgba(160, 90, 0, .35), inset 0 3px 0 rgba(255,255,255,.6), 0 6px 0 #9a5a00, 0 12px 22px rgba(0, 0, 0, .3); }
.jtb-clay--go:active { box-shadow: inset 0 -3px 0 rgba(160, 90, 0, .35), 0 2px 0 #9a5a00, 0 4px 8px rgba(0,0,0,.2); }
.jtb-clay--small { min-height: 48px; padding: 8px 22px; font-size: 1rem; }

/* Title: the picture fills the screen and drifts slowly */
.jtb-overlay--title { padding: 0; background: #0b2342; overflow: hidden auto; display: grid; }
.jtb-title__bg { position: fixed; inset: -3%; background: url("../art/title.webp") 62% 50% / cover no-repeat; animation: jtb-drift 38s ease-in-out infinite alternate; }
.jtb-title__bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(6,36,73,.15), rgba(6,36,73,.55) 85%), linear-gradient(180deg, rgba(6,36,73,.35), transparent 40%, rgba(6,36,73,.45)); }
@keyframes jtb-drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.09) translate(-1.5%, 1%); } }
.jtb-title { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 18px);
  min-height: 100%; padding: max(24px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.jtb-title__logo { margin: 0; width: min(620px, 86vw, calc(48dvh * 760 / 547)); filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); animation: jtb-bob 5s ease-in-out infinite; }
.jtb-title__logo img { width: 100%; height: auto; }
@keyframes jtb-bob { 50% { transform: translateY(-6px) rotate(-.6deg); } }
.jtb-title__line { margin: 0; max-width: 34em; color: #fff; font: 800 clamp(1rem, 2.4vmin, 1.25rem)/1.4 var(--font-head); text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.jtb-title__buttons { display: grid; justify-items: center; gap: 14px; margin-top: 6px; }
.jtb-title__corner { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 1; }
.jtb-toggles--round { display: flex; gap: 10px; margin: 0; }
.jtb-toggles--round button { width: 52px; height: 52px; padding: 0; font-size: 1.4rem; border: 0; border-radius: 50%;
  background: rgba(255, 250, 240, .92); box-shadow: 0 4px 0 rgba(6,36,73,.3), 0 6px 14px rgba(0,0,0,.25); text-decoration: none; }
.jtb-toggles--round button[aria-pressed="false"] { opacity: .6; background: rgba(230, 230, 225, .9); text-decoration: none; }

/* The cream clay sheet used for "Who is travelling?" and the end screen */
.jtb-overlay:not(.jtb-overlay--title) { background: linear-gradient(180deg, rgba(6,36,73,.45), rgba(6,36,73,.8)), url("../art/title.webp") 62% 50% / cover; }
.jtb-card { background: #fcf5e6; border-radius: 30px; box-shadow: inset 0 0 0 4px #ecd9b2, inset 0 -8px 0 rgba(150, 110, 60, .12), 0 10px 0 rgba(70, 40, 10, .25), 0 24px 50px rgba(0,0,0,.4); }
.jtb-setup { max-width: 780px; text-align: center; }
.jtb-setup h2 { margin: 1.1em 0 .25em; font-size: clamp(1.3rem, 3.4vw, 1.6rem); }
.jtb-setup > .jtb-small { margin: 0 auto 12px; max-width: 34em; }
.jtb-setup__logo { width: min(260px, 60vw); margin: -6px auto 0; }
.jtb-setup__go { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; }
.jtb-overlay--leaving { animation: jtb-fade-out .45s ease-in forwards; }
.jtb-overlay--leaving .jtb-card, .jtb-overlay--leaving .jtb-title { transition: transform .45s ease-in; transform: translateY(40px) scale(.96); }
@keyframes jtb-fade-out { to { opacity: 0; } }

/* Families: a donkey on a coloured stepping stone, a wooden name tag, person or computer */
.jtb-fams { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.jtb-fam { position: relative; display: grid; justify-items: center; gap: 8px; padding: 26px 10px 12px; border-radius: 22px;
  background: linear-gradient(180deg, #fffaf0, #f3e6cb); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 55%, #ecd9b2), 0 4px 0 rgba(120, 85, 40, .15); }
.jtb-fam__order { position: absolute; top: 8px; left: 12px; font: 800 .8rem var(--font-head); color: var(--ink-soft); }
.jtb-fam__donkey { position: relative; width: 100%; height: clamp(84px, 13vh, 130px); padding: 0; border: 0; background: none; cursor: pointer; }
.jtb-fam__donkey::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 62%; height: 18%; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--c) 75%, #fff) 0 55%, color-mix(in srgb, var(--c) 60%, #000) 100%); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.jtb-fam__donkey img { position: relative; height: 92%; width: auto; margin: 0 auto; filter: drop-shadow(0 4px 3px rgba(0,0,0,.3)); }
.jtb-fam__donkey:hover img { transform: translateY(-3px); }
.jtb-hopnow img { animation: jtb-hop .32s ease-out; }
.jtb-fam__x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 1.2rem; cursor: pointer; }
.jtb-fam__x:hover { background: rgba(6,36,73,.08); }
.jtb-fam__tag { width: 100%; min-height: 46px; padding: 6px 10px; border: 0; border-radius: 10px; text-align: center;
  font: 900 1.05rem var(--font-head); color: #fff8ea; background: linear-gradient(180deg, #a36a37, #84522a);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.22), inset 0 -3px 0 rgba(0,0,0,.18), 0 3px 0 #5b3716; }
.jtb-fam__tag::placeholder { color: #ffe6c2; opacity: 1; }
.jtb-fam__tag:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
.jtb-fam__who { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 2px #e2cfa8; }
.jtb-fam__who button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 3px 2px; border: 0; background: transparent; font: 800 .8rem/1.1 var(--font-head); color: var(--navy); cursor: pointer; }
.jtb-fam__who button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.jtb-fam--add { padding: 0; background: none; box-shadow: none; }
.jtb-fam--add button { width: 100%; height: 100%; min-height: 200px; display: grid; place-content: center; gap: 4px; border: 3px dashed #d9c39a; border-radius: 22px;
  background: rgba(255,255,255,.4); font: 900 1.05rem var(--font-head); color: var(--ink-soft); cursor: pointer; }
.jtb-fam--add button span { font-size: 2.6rem; line-height: 1; color: var(--blue-text); }
.jtb-fam--add button:hover { background: #fff; border-color: var(--blue); }
.jtb-fam--new { animation: jtb-trot-in .5s cubic-bezier(.3,1.3,.5,1); }
.jtb-fam--leaving { animation: jtb-trot-out .28s ease-in forwards; }
@keyframes jtb-trot-in { from { transform: translateX(70px) scale(.9); opacity: 0; } }
@keyframes jtb-trot-out { to { transform: translateX(90px) scale(.9); opacity: 0; } }

/* Saddlebags: the real tokens you start with */
.jtb-bags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.jtb-bags button { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 12px; border: 0; border-radius: 18px; cursor: pointer; color: var(--navy);
  background: linear-gradient(180deg, #fffaf0, #f3e6cb); box-shadow: inset 0 0 0 3px #ecd9b2, 0 4px 0 rgba(120,85,40,.15); font: inherit; }
.jtb-bags button[aria-pressed="true"] { background: linear-gradient(180deg, #fff6cf, #ffe28a); box-shadow: inset 0 0 0 4px var(--yellow), 0 4px 0 #b07a00; }
.jtb-bags b { font: 900 1.1rem var(--font-head); }
.jtb-bags small { font-size: .85rem; color: var(--ink-soft); margin-bottom: 2px; }
.jtb-stack { display: flex; justify-content: center; min-height: 26px; }
.jtb-stack img { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.jtb-stack img + img { margin-left: -14px; }

.jtb-scroll { display: inline-flex; align-items: center; gap: 12px; max-width: 460px; width: 100%; padding: 8px 18px 8px 10px; border: 0; border-radius: 18px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, #fffaf0, #f3e6cb); box-shadow: inset 0 0 0 3px #ecd9b2, 0 4px 0 rgba(120,85,40,.15); color: var(--navy); font: inherit; }
.jtb-scroll[aria-pressed="true"] { background: linear-gradient(180deg, #fff6cf, #ffe28a); box-shadow: inset 0 0 0 4px var(--yellow), 0 4px 0 #b07a00; }
.jtb-scroll[aria-pressed="false"] img { filter: grayscale(1); opacity: .6; }
.jtb-scroll img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.jtb-scroll b { display: block; font: 900 1.15rem var(--font-head); }
.jtb-scroll small { display: block; font-size: .9rem; color: var(--ink-soft); line-height: 1.3; }

.jtb-win .jtb-win-donkey { animation: jtb-bob 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .jtb-title__bg, .jtb-title__logo, .jtb-hopnow img, .jtb-fam--new, .jtb-win .jtb-win-donkey { animation: none; }
}
/* Wide screens: title on the open hills, the donkey and Bethlehem stay in view */
@media (min-aspect-ratio: 5/4) {
  .jtb-title { width: 56vw; justify-self: start; }
  .jtb-title__logo { width: min(560px, 46vw, calc(50dvh * 760 / 547)); }
}
.jtb-stack em { font: 900 .95rem/26px var(--font-head); font-style: normal; margin-left: 5px; min-width: .8em; text-align: left; }
@media (max-width: 600px) { .jtb-wide { display: none; } .jtb-fam--add button { min-height: 150px; } }
@media (max-width: 480px) {
  .jtb-fam { padding: 24px 7px 10px; }
  .jtb-fam__tag { font-size: .86rem; padding: 6px 4px; }
  .jtb-fam__who button { font-size: .7rem; }
  .jtb-stack img { width: 20px; height: 20px; }
  .jtb-stack img + img { margin-left: -13px; }
  .jtb-stack em { line-height: 20px; font-size: .85rem; margin-left: 3px; }
  .jtb-stack { min-height: 20px; }
  .jtb-bags button { padding: 8px 4px 10px; }
  .jtb-clay--go { padding: 12px 34px; font-size: 1.5rem; }
  .jtb-setup__go { gap: 10px; }
}
