/* ---- Hummi the doctor bird (public/js/buddy.js) ---- */
.buddy { position: fixed; right: 14px; bottom: 14px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.buddy-bird { pointer-events: auto; position: relative; width: 92px; height: 92px; border: 0; padding: 0; background: none; cursor: pointer; animation: buddy-hover 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.buddy-bird img { width: 100%; height: 100%; display: block; transform-origin: 50% 60%; }
.buddy-bird:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 50%; }
.buddy-fx { position: absolute; top: -6px; left: -4px; font-size: 26px; }
.buddy-bubble { pointer-events: none; max-width: min(260px, 70vw); background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px 18px 4px 18px; padding: 9px 13px; font-weight: 800; font-size: 15px; line-height: 1.3; box-shadow: 0 6px 16px rgba(0, 0, 0, .15); animation: buddy-bubble .25s ease-out; }
.buddy.pop .buddy-bird img { animation: buddy-pop .5s ease-out; }
.buddy[data-mood="cheer"] .buddy-bird img, .buddy[data-mood="wow"] .buddy-bird img { animation: buddy-loop .8s ease-in-out; }
.buddy[data-mood="oops"] .buddy-bird img { animation: buddy-shake .5s ease-in-out; }
.buddy[data-mood="think"] .buddy-bird img { transform: rotate(-10deg); }
.buddy.is-away .buddy-bird { width: 44px; height: 44px; opacity: .55; animation: none; }
.buddy.is-away .buddy-bubble { display: none; }
@keyframes buddy-hover { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes buddy-pop { 0% { transform: scale(1) } 40% { transform: scale(1.18) } 100% { transform: scale(1) } }
@keyframes buddy-loop { 0% { transform: rotate(0) translateY(0) } 30% { transform: rotate(-20deg) translateY(-18px) } 60% { transform: rotate(340deg) translateY(-10px) } 100% { transform: rotate(360deg) translateY(0) } }
@keyframes buddy-shake { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-7px) rotate(-6deg) } 75% { transform: translateX(7px) rotate(6deg) } }
@keyframes buddy-bubble { from { opacity: 0; transform: translateY(6px) scale(.95) } to { opacity: 1; transform: none } }
@media (max-width: 600px) { .buddy-bird { width: 64px; height: 64px; } .buddy-bubble { font-size: 14px; opacity: .97; } .tf-claim img { width: 30px; height: 30px; } .hud { flex-wrap: wrap; gap: 6px; } }

/* ---- Missions (quiz story framing) ---- */
.mission-card { max-width: 640px; margin: 0 auto; text-align: center; }
.mission-scene { position: relative; border-radius: 22px; overflow: hidden; background: linear-gradient(160deg, #FFE08A, #FFB86B 55%, #FF8A65); min-height: 170px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.mission-scene img { width: 100%; height: 220px; object-fit: cover; display: block; }
.mission-scene .scene-emoji { font-size: 84px; filter: drop-shadow(0 6px 4px rgba(0,0,0,.15)); }
.low-data .mission-scene img { display: none; }
.mission-tag { display: inline-block; margin-top: 14px; background: var(--ink); color: #fff; border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mission-card h2 { margin: 8px 0 4px; font-size: clamp(24px, 4.5vw, 34px); }
.mission-card .story { font-size: 17px; font-weight: 600; color: var(--ink-soft); margin: 0 auto 14px; max-width: 520px; }

/* Journey bar: one stop per question, the bird flies along it. */
.journey { position: relative; display: flex; align-items: center; gap: 4px; margin: 34px 0 16px; padding: 0 4px; }
.journey .stop { flex: 1; height: 10px; border-radius: 99px; background: #E3E9F2; transition: background .3s; }
.journey .stop.done { background: #3FBF6F; }
.journey .stop.miss { background: #F6A04D; }
.journey .stop.now { background: #9AD6FF; box-shadow: 0 0 0 3px rgba(43, 140, 230, .25); }
.journey .goal { font-size: 22px; margin-left: 4px; }
.journey-bird { position: absolute; top: -26px; width: 34px; height: 34px; transition: left .6s cubic-bezier(.5, 1.6, .5, 1); pointer-events: none; }

/* Combo meter */
.combo { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-family: var(--font-head); padding: 2px 10px; border-radius: 99px; background: #FFF1D6; color: #9A4B00; transition: transform .2s; }
.combo[hidden] { display: none; }
.combo.hot { background: linear-gradient(90deg, #FF7A45, #FFC53D); color: #fff; animation: combo-pulse .6s ease-out; }
@keyframes combo-pulse { 0% { transform: scale(1) } 40% { transform: scale(1.3) } 100% { transform: scale(1) } }

/* Answer feedback */
.burst { position: fixed; pointer-events: none; z-index: 70; font-weight: 800; font-family: var(--font-head); font-size: 26px; color: #2E9E5B; animation: burst-up 1s ease-out forwards; text-shadow: 0 2px 0 #fff; }
@keyframes burst-up { from { opacity: 1; transform: translate(-50%, 0) scale(.8) } to { opacity: 0; transform: translate(-50%, -70px) scale(1.2) } }
.q-wobble { animation: buddy-shake .45s ease-in-out; }
.q-glow { animation: q-glow .6s ease-out; }
@keyframes q-glow { 0% { box-shadow: 0 0 0 0 rgba(63, 191, 111, .7) } 100% { box-shadow: 0 0 0 18px rgba(63, 191, 111, 0) } }

/* Type-in and true/false formats */
.type-answer { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.type-answer input { font: 800 32px var(--font-head); width: 180px; text-align: center; padding: 8px 12px; border-radius: 16px; border: 3px solid var(--line); color: var(--ink); background: #fff; }
.type-answer input:focus { outline: none; border-color: #2B8CE6; }
.type-answer input.right { border-color: #3FBF6F; background: #EAFBF0; }
.type-answer input.wrong { border-color: #F6A04D; background: #FFF4E8; }
.numpad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; margin-top: 10px; }
.numpad button { height: 54px; border-radius: 14px; border: 0; background: #EEF3FA; font: 800 24px var(--font-head); color: var(--ink); cursor: pointer; }
.numpad button:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .numpad { display: none; } }
.tf-claim { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 21px; font-weight: 700; background: #F6F9FE; border: 3px dashed #C7D5EA; border-radius: 18px; padding: 14px; margin: 8px 0 12px; }
.tf-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-buttons .option { font-size: 22px; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .buddy-bird, .buddy.pop .buddy-bird img, .buddy[data-mood] .buddy-bird img, .combo.hot, .q-wobble, .q-glow, .burst { animation: none !important; }
  .journey-bird { transition: none; }
}
.mission-card .small-title { font-size: 16px; margin: 6px 0 4px; }
.mission-card #hear-story { margin-bottom: 10px; }

/* Buddy outfits: an emoji worn on Hummi's head (or over the eyes for shades). */
.buddy-bird, .buddy-preview { position: relative; }
.buddy-hat { position: absolute; left: 16%; top: -10%; font-size: 34%; line-height: 1; pointer-events: none; transform: rotate(-14deg); }
.buddy-bird .buddy-hat { font-size: 30px; }
.buddy-preview .buddy-hat { font-size: 44px; }
.buddy-hat[data-outfit="🕶️"] { top: 16%; left: 18%; transform: rotate(-8deg) scale(.8); }
.buddy-hat[data-outfit="🌺"], .buddy-hat[data-outfit="🎀"] { left: 40%; top: -4%; transform: rotate(10deg) scale(.8); }
.buddy-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.buddy-preview { width: 120px; height: 120px; flex: none; animation: buddy-hover 2.4s ease-in-out infinite; }
.buddy-preview img { width: 100%; height: 100%; }
.buddy-name input { font: 700 18px var(--font-body, inherit); padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); width: 180px; }
@media (prefers-reduced-motion: reduce) { .buddy-preview { animation: none; } }

/* Home: choose your mission */
.missions-pick .mp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mp-bird { position: relative; width: 64px; height: 64px; flex: none; animation: buddy-hover 2.4s ease-in-out infinite; }
.mp-bird img { width: 100%; height: 100%; }
.mp-bird .buddy-hat { font-size: 24px; }
.mp-bubble { background: #fff; border: 3px solid var(--ink); border-radius: 18px 18px 18px 4px; padding: 8px 14px; font-weight: 700; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mp-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #fff; border: 2px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.mp-card:hover, .mp-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); }
.mp-scene { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 8; background: linear-gradient(160deg, #FFE08A, #FFB86B 55%, #FF8A65); font-size: 46px; overflow: hidden; }
.mp-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.mp-body b { font-family: var(--font-head); font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .mp-bird { animation: none; } .mp-card { transition: none; } }
@media (max-width: 600px) { .mp-card { flex-direction: row; align-items: stretch; } .mp-scene { width: 112px; flex: none; aspect-ratio: auto; min-height: 84px; font-size: 32px; } .mp-body b { font-size: 16px; } }

/* My Jamaica map */
.jm-score { display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-head); font-size: 17px; margin: 0 0 12px; } .jm-score span { background: #fff; border-radius: 99px; padding: 4px 14px; box-shadow: var(--shadow); }
.jm-score b { font-size: 22px; }
.jm-map-box { padding: 10px; }
.jm-map { width: 100%; height: auto; display: block; }
.jm-pin-bg { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.jm-pin-emoji { font-size: 26px; }
.jm-tick { font-size: 18px; }
.jm-label { font: 800 17px var(--font-head, sans-serif); fill: #13284A; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.jm-pin.is-locked .jm-pin-bg { fill: #E6ECF4; stroke: #9AA9BF; }
.jm-pin.is-locked .jm-label { fill: #5E6E86; }
.jm-pin.is-stamped .jm-pin-bg { fill: #FFF4C2; stroke: #E0A100; }
.jm-pin.is-next .jm-pin-bg { stroke: #E8590C; stroke-width: 5; animation: jm-pulse 1.6s ease-in-out infinite; }
@keyframes jm-pulse { 0%, 100% { stroke-opacity: 1 } 50% { stroke-opacity: .35 } }
.jm-bird { animation: buddy-hover 2.4s ease-in-out infinite; }
.jm-next { display: flex; gap: 16px; align-items: flex-start; }
.jm-next-emoji { font-size: 56px; line-height: 1; }
.jm-passport { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.jm-stamp { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 16px; border: 3px dashed #C7D5EA; background: #F8FAFD; }
.jm-stamp.is-stamped { border: 3px solid #E0A100; background: #FFF8DB; transform: rotate(-2deg); }
.jm-stamp.is-open { border-color: #E8590C; }
.jm-stamp-emoji { font-size: 32px; }
@media (max-width: 600px) { .jm-label { font-size: 22px; } .jm-pin-emoji { font-size: 30px; } .jm-next { flex-direction: column; } .jm-score { text-align: left; } }
@media (prefers-reduced-motion: reduce) { .jm-pin.is-next .jm-pin-bg, .jm-bird { animation: none; } }
.jm-link { margin-left: auto; white-space: nowrap; } @media (max-width: 600px) { .missions-pick .mp-head { flex-wrap: wrap; } .jm-link { margin-left: 0; } }
@media (max-width: 700px) { .jm-map-box { overflow-x: auto; -webkit-overflow-scrolling: touch; } .jm-map { min-width: 640px; } .jm-label { font-size: 19px; } }

/* Ghost race */
.journey-ghost { position: absolute; top: 12px; font-size: 26px; opacity: .8; transition: left .5s linear; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.ghost-line { font-weight: 700; background: #F1ECFF; color: #4B2E99; border-radius: 99px; display: inline-block; padding: 4px 14px; }
.ghost-result { font-weight: 800; background: #F1ECFF; color: #4B2E99; border-radius: 14px; padding: 8px 14px; display: inline-block; }
.ghost-result.won { background: #E7F8EC; color: #1E7B3E; }
@media (prefers-reduced-motion: reduce) { .journey-ghost { transition: none; } }
.journey:has(.journey-ghost) { margin-bottom: 38px; }

/* Class quest */
.quest-card { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow); border-left: 8px solid #7B5CE0; }
.quest-card.is-done { border-left-color: #3FBF6F; background: #F2FBF5; }
.quest-emoji { font-size: 40px; }
.quest-card .ev-bar span { background: linear-gradient(90deg, #7B5CE0, #B49CFF); }
.quest-card.is-done .ev-bar span { background: #3FBF6F; }
.quest-teacher { background: #F1ECFF; color: #4B2E99; border-radius: 12px; padding: 8px 14px; margin: 0 0 12px; }

/* Game feel for every activity (public/js/gamefeel.js) */
.play-mission { display: flex; align-items: center; gap: 12px; max-width: 900px; margin: 0 auto 10px; padding: 8px 12px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.play-mission img { width: 96px; height: 54px; object-fit: cover; border-radius: 10px; flex: none; }
.play-mission .pm-emoji { font-size: 34px; flex: none; }
.play-mission .pm-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.play-mission .pm-text b { font-family: var(--font-head); font-size: 17px; }
@media (max-width: 600px) { .play-mission .pm-text .small { display: none; } .play-mission img { width: 72px; height: 40px; } }
.gf-streak { position: fixed; top: 84px; right: 16px; z-index: 55; font-weight: 800; font-family: var(--font-head); padding: 4px 12px; border-radius: 99px; background: #FFF1D6; color: #9A4B00; box-shadow: var(--shadow); }
.gf-streak.hot { background: linear-gradient(90deg, #FF7A45, #FFC53D); color: #fff; animation: combo-pulse .6s ease-out; }
.gf-result { margin: 6px 0; }
/* The bird rides along every progress bar. */
.progress { overflow: visible; position: relative; margin-top: 18px; }
.progress span { position: relative; min-width: 12px; }
.progress span::after { content: ''; position: absolute; right: -16px; top: -14px; width: 30px; height: 30px; background: url(/img/buddy/hummi.svg) center / contain no-repeat; transition: right .3s; }
@media (prefers-reduced-motion: reduce) { .gf-streak.hot { animation: none; } }

/* Teacher getting-started checklist */
.start-list { border-left: 6px solid var(--primary); }
.start-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.start-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #F6F9FE; }
.start-steps li.is-done { opacity: .7; }
.start-steps li.is-next { background: #EAF4FF; box-shadow: inset 0 0 0 2px var(--primary); }
.ss-tick { font-size: 18px; line-height: 1.3; }
.ss-tick { color: var(--ink-soft); min-width: 22px; text-align: center; }

/* "Get the XVH app" card (public/js/install.js) */
.install-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 12px 16px; margin: 0 0 16px; box-shadow: var(--shadow); border: 2px solid #CFE6FF; }
.install-card img { border-radius: 14px; flex: none; }
.install-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
/* Installed (standalone) on a phone: leave room for the status bar and the iPhone home bar. */
@media (display-mode: standalone) { body { padding-bottom: env(safe-area-inset-bottom); } .flag-strip { padding-top: env(safe-area-inset-top); } }
