/* Errands — Saint Lucian Kwéyòl shopping game. Mobile-first. */
.kw-page-errands .kw-container { max-width: 620px; }
.err-seo-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.err-preview { font-size: 11px; font-weight: 800; background: var(--gold, #FCD116); color: #241; padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.err-loading { text-align: center; padding: 60px 16px; font-size: 16px; color: var(--muted, #6b7785); }
.err-intro { max-width: 540px; margin: 10px auto; background: var(--card,#fff); border-radius: 18px; padding: 22px 20px; box-shadow: 0 6px 18px rgba(20,33,61,0.08); border: 2px solid rgba(245,166,35,0.35); text-align: center; }
.err-intro-emoji { font-size: 40px; letter-spacing: 4px; }
.err-intro h2 { font-size: 24px; margin: 6px 0 10px; }
.err-intro p { color: var(--ink,#222); line-height: 1.6; font-size: 14.5px; text-align: left; }
.err-intro-points { text-align: left; margin: 14px 0 18px; padding-left: 20px; color: var(--ink,#222); font-size: 14px; line-height: 1.6; }
.err-intro-points li { margin-bottom: 6px; }
.err-start { width: 100%; justify-content: center; font-size: 16px; padding: 13px; text-decoration: none; }

#err-app { padding-bottom: 150px; }

/* MaMa's list */
.err-list { background: linear-gradient(135deg, #2a1535, #3a1730); color: #fff; border-radius: 16px; margin: 4px 0 14px; overflow: hidden; border: 2px solid rgba(245,166,35,0.4); }
.err-list-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: transparent; border: 0; color: #fff; font-weight: 800; font-size: 15px; padding: 12px 14px; cursor: pointer; }
.err-list-caret { transition: transform 0.2s; }
.err-list.open .err-list-caret { transform: rotate(180deg); }
.err-list-body { display: none; padding: 0 10px 10px; }
.err-list.open .err-list-body { display: block; }
.err-litem { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; background: rgba(255,255,255,0.06); margin-bottom: 6px; }
.err-litem.met { background: rgba(46,230,110,0.18); }
.err-litem.over, .err-litem.wrong { background: rgba(232,80,58,0.2); }
.err-liemoji { font-size: 26px; flex: none; }
.err-liname { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 15px; }
.err-liname b { font-weight: 800; }
.err-lien { font-size: 11px; color: rgba(255,255,255,0.6); }
.err-dot { display: inline-block; width: 11px; height: 11px; border-radius: 999px; margin-right: 5px; border: 1.5px solid rgba(255,255,255,0.8); vertical-align: middle; }
.err-pill { flex: none; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.err-pill.met { background: #2ee66e; color: #063; }
.err-pill.part { background: #FCD116; color: #241; }
.err-pill.miss { background: rgba(255,255,255,0.14); color: #fff; }
.err-pill.bad { background: #e8503a; color: #fff; }

/* Shop floor */
.err-shopname { text-align: center; font-weight: 800; font-size: 14px; color: var(--sea, #1769C0); margin: 2px 0 10px; }
.err-shop { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 520px) { .err-shop { grid-template-columns: repeat(2, 1fr); } }
.err-shelf { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 10px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(160deg, #fff, #f3f7fb); border: 2px solid rgba(20,33,61,0.08); box-shadow: 0 4px 12px rgba(20,33,61,0.08); transition: transform 0.12s; }
.err-shelf:active { transform: scale(0.97); }
.err-shelf-emoji { font-size: 44px; }
.err-shelf-label { font-weight: 800; font-size: 15px; }

/* Basket bottom sheet */
.err-basket { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 2px solid var(--gold, #FCD116);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.14); border-radius: 18px 18px 0 0; max-width: 620px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); }
.err-basket-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: transparent; border: 0; cursor: pointer; font-weight: 800; font-size: 15px; padding: 12px 16px; }
.err-basket-head #err-basket-total { color: var(--sea, #1769C0); }
.err-basket-body { display: none; max-height: 40vh; overflow: auto; padding: 0 14px; }
.err-basket.open .err-basket-body { display: block; }
.err-basket-empty { color: var(--muted, #6b7785); font-size: 13px; padding: 8px 2px 14px; text-align: center; }
.err-brow { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid rgba(20,33,61,0.07); }
.err-bemoji { font-size: 24px; }
.err-bname { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 700; font-size: 14px; }
.err-qty { display: inline-flex; align-items: center; gap: 10px; }
.err-qty button { width: 30px; height: 30px; border-radius: 999px; border: 1.5px solid rgba(20,33,61,0.2); background: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
.err-checkout { display: block; width: calc(100% - 28px); margin: 10px 14px 14px; justify-content: center; background: #e6e9ee; color: #556; }
.err-checkout.ready { background: linear-gradient(135deg, #2ee66e, #1E7A34); color: #fff; }

/* Overlays (shelf closeup, pay, results) */
.err-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10,8,20,0.55); display: flex; align-items: flex-end; justify-content: center; }
.err-sheet { background: var(--card, #fff); width: 100%; max-width: 620px; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; animation: err-up 0.3s cubic-bezier(0.2,1,0.3,1); }
@keyframes err-up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.err-sheet-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 17px; margin-bottom: 12px; }
.err-x { border: 0; background: rgba(20,33,61,0.08); width: 34px; height: 34px; border-radius: 999px; font-size: 22px; cursor: pointer; line-height: 1; }
.err-pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 520px) { .err-pgrid { grid-template-columns: repeat(3, 1fr); } }
.err-pcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 14px; background: #f6f8fb; border: 1.5px solid rgba(20,33,61,0.08); text-align: center; touch-action: none; }
.err-pemoji { font-size: 52px; width: 72px; height: 72px; line-height: 72px; border-radius: 999px; background: #fff; margin-bottom: 2px; }
.err-pname { font-weight: 800; font-size: 15px; }
.err-pen { font-size: 11px; color: var(--muted, #6b7785); }
.err-pprice { font-weight: 800; color: var(--sea, #1769C0); font-size: 13px; margin: 2px 0 6px; }
.err-add { width: 100%; justify-content: center; padding: 8px; font-size: 14px; }

/* Pay + results */
.err-pay { text-align: center; }
.err-pay-emoji { font-size: 46px; }
.err-pay-title { font-size: 20px; margin: 4px 0; }
.err-pay-text { color: var(--muted, #6b7785); margin: 0 0 16px; }
.err-pay .kw-btn { width: 100%; justify-content: center; margin-bottom: 8px; }
.err-results { text-align: center; }
.err-confetti { font-size: 46px; }
.err-res-title { font-size: 26px; margin: 2px 0; }
.err-stars { font-size: 40px; letter-spacing: 6px; margin: 4px 0; }
.err-star { color: rgba(20,33,61,0.15); }
.err-star.on { color: #FCD116; text-shadow: 0 2px 6px rgba(252,209,22,0.5); }
.err-res-score { font-size: 32px; font-weight: 800; color: var(--sea, #1769C0); }
.err-res-score span { font-size: 14px; color: var(--muted, #6b7785); font-weight: 600; }
.err-res-line { font-size: 13px; color: var(--muted, #6b7785); margin: 8px 0 14px; }
.err-words-wrap { background: #f6f8fb; border-radius: 14px; padding: 12px; margin-bottom: 16px; }
.err-words-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sea, #1769C0); margin-bottom: 8px; }
.err-words { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.err-word { background: var(--gold, #FCD116); color: #241; font-weight: 800; font-size: 14px; padding: 5px 12px; border-radius: 999px; }
.err-res-actions .kw-btn { width: 100%; justify-content: center; margin-bottom: 8px; }

/* Juice: ghost drag, fly-to-basket, toast */
.err-ghost { position: fixed; z-index: 80; font-size: 40px; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.3)); }
.err-ghost.over { transform: translate(-50%, -50%) scale(1.25); }
.err-fly { position: fixed; left: 50%; bottom: 90px; z-index: 80; font-size: 34px; transform: translateX(-50%); transition: transform 0.6s cubic-bezier(0.3,0.9,0.3,1), opacity 0.6s; pointer-events: none; }
.err-fly.go { transform: translate(-50%, 40px) scale(0.4); opacity: 0; }
.err-toast { position: fixed; left: 50%; bottom: 160px; z-index: 90; transform: translate(-50%, 20px); background: #141f2e; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; max-width: 90%; text-align: center; opacity: 0; transition: opacity 0.25s, transform 0.25s; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.err-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .err-sheet, .err-fly, .err-ghost { animation: none; transition: none; } }

/* MaMa Fin card (intro + between stages) */
.err-mama-card { display: flex; align-items: flex-end; gap: 12px; max-width: 540px; margin: 12px auto; }
.err-mama-fig { flex: none; width: 92px; }
.err-mama-svg { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.22)); }
.err-mama-bubble { flex: 1; background: #fff; border: 2px solid var(--sea, #1769C0); border-radius: 16px 16px 16px 4px; padding: 14px 16px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.err-mama-name { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sea, #1769C0); margin-bottom: 4px; }
.err-mama-bubble p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
.err-mama-bubble .kw-btn { width: 100%; justify-content: center; }
.err-diff { display: flex; flex-direction: column; gap: 8px; }
.err-diff .kw-btn { display: flex; justify-content: space-between; align-items: center; }
.err-diff .kw-btn span { font-size: 12px; font-weight: 600; opacity: 0.85; }

/* Map */
.err-map { max-width: 440px; margin: 4px auto 80px; background: #cfe9f7; border-radius: 16px; padding: 12px; box-shadow: inset 0 2px 8px rgba(0,0,0,0.12); }
.err-mapsvg { width: 100%; height: auto; display: block; }
.err-dist { fill: #8fd18a; stroke: #fff; stroke-width: 0.5; cursor: pointer; transition: fill 0.12s; }
.err-dist:hover { fill: #b6e4a9; }
.err-dist.right { fill: #2ee66e; }
.err-dist.wrong { fill: #e8503a; }

/* Greeting */
.err-greet { display: flex; flex-direction: column; gap: 8px; }
.err-greet-opt { background: #f6f8fb; border: 1.5px solid rgba(20,33,61,0.15); color: var(--ink,#222); font-weight: 800; font-size: 17px; justify-content: center; }
.err-greet-opt.right { background: #2ee66e; color: #063; border-color: #2ee66e; }
.err-greet-opt.wrong { background: #e8503a; color: #fff; border-color: #e8503a; }

/* Results item breakdown */
.err-res-items { text-align: left; margin: 10px 0 16px; }
.err-res-item { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; margin-bottom: 5px; font-weight: 700; font-size: 14px; }
.err-res-item.ok { background: rgba(46,230,110,0.16); }
.err-res-item.no { background: rgba(232,80,58,0.16); }
