/* Passport to English — Kids-slide look (apps/kids-slide-studio/engine/style.css + PLAYBOOK §5 text styling):
   Fredoka bubble headings (candy fill, fat white outline, darker solid base + soft shadow), ABeeZee body,
   cream paper plates with white border and soft hard-shadow. Logical stage 540x960, scaled by game.js. */
:root {
  --cream: #fff8ee; --paper: #fffdf8; --ink: #1d2550; --ink2: #4a5280; --mute: #8a90b5; --line: #e6e3f2;
  --candy: #ff4f7b; --candy-lo: #c41f55; --sky: #2f8cff; --sky-lo: #1857c2; --grape: #5b3fc4; --grape-lo: #36238a;
  --mint: #1fb57a; --mint-lo: #107a50; --sun: #ffb21f; --sun-lo: #c97a00;
  --spring: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2550; touch-action: manipulation; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; font-family: ABeeZee, system-ui, sans-serif; color: var(--ink); }
#stage { position: absolute; left: 0; top: 0; width: 540px; height: 960px; transform-origin: 0 0; overflow: hidden; border-radius: 22px; background: var(--cream); }
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ---- bubble type ---- */
.bub { font-family: Fredoka, sans-serif; font-weight: 700; letter-spacing: .5px; color: var(--c); -webkit-text-stroke: .16em #fff; paint-order: stroke fill;
  filter: drop-shadow(0 .07em 0 var(--lo)) drop-shadow(0 .16em .18em rgba(29,37,80,.25)); display: inline-block; }
.c-candy { --c: var(--candy); --lo: var(--candy-lo); } .c-sky { --c: var(--sky); --lo: var(--sky-lo); } .c-grape { --c: var(--grape); --lo: var(--grape-lo); }
.c-mint { --c: var(--mint); --lo: var(--mint-lo); } .c-sun { --c: var(--sun); --lo: var(--sun-lo); }
.plate { background: var(--paper); border: 5px solid #fff; border-radius: 26px; box-shadow: 0 8px 0 rgba(29,37,80,.12), 0 20px 40px rgba(29,37,80,.18); }
.btn { font: 700 22px/1 Fredoka, sans-serif; color: #fff; padding: 14px 26px 13px; border-radius: 99px; background: linear-gradient(180deg, var(--hi), var(--c));
  box-shadow: 0 6px 0 var(--lo), 0 12px 22px rgba(29,37,80,.18); transition: transform .08s, box-shadow .08s, opacity .2s; letter-spacing: .5px; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lo), 0 6px 12px rgba(29,37,80,.18); }
.btn:disabled { opacity: .45; pointer-events: none; }
.b-candy { --c: var(--candy); --lo: var(--candy-lo); --hi: #ff7ea0; } .b-sky { --c: var(--sky); --lo: var(--sky-lo); --hi: #64a9ff; }
.b-sun { --c: var(--sun); --lo: var(--sun-lo); --hi: #ffd56b; color: var(--ink); } .b-mint { --c: var(--mint); --lo: var(--mint-lo); --hi: #4fd59d; }

/* ---- passport ---- */
#passport { background: var(--cream); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.confetti { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle, #ffd6e2 3px, transparent 4px), radial-gradient(circle, #d6ecfb 3px, transparent 4px), radial-gradient(circle, #fff0b8 3px, transparent 4px);
  background-size: 90px 90px, 70px 70px, 110px 110px; background-position: 10px 20px, 40px 60px, 70px 5px; }
.pp-head { position: relative; text-align: center; padding: 26px 20px 6px; }
.pp-crest { font-size: 34px; width: 62px; height: 62px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 5px 0 rgba(29,37,80,.1); }
.bub-title { margin: 8px 0 0; font-size: 46px; line-height: 1.05; }
.pp-rep { margin-top: 8px; font-size: 12.5px; letter-spacing: .14em; color: var(--ink2); }
.pp-id { position: relative; margin: 14px 20px 0; padding: 12px 14px; display: flex; align-items: center; gap: 14px; }
.pp-photo { width: 78px; height: 78px; border-radius: 18px; overflow: hidden; background: #ffe9c7; border: 4px solid #fff; box-shadow: 0 4px 0 rgba(29,37,80,.1); flex: none; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; }
.pp-fields { display: flex; gap: 22px; flex: 1; }
.pp-fields small { display: block; font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .1em; }
.pp-fields b { font: 600 22px Fredoka, sans-serif; }
.pp-chip { position: absolute; right: 14px; top: -14px; font: 600 13px Fredoka; background: var(--grape); color: #fff; padding: 5px 12px; border-radius: 99px; box-shadow: 0 3px 0 var(--grape-lo); transform: rotate(4deg); }
.pp-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 20px 30px; }
.slot { position: relative; height: 128px; border-radius: 20px; background: #fff; border: 4px solid #fff; box-shadow: 0 6px 0 rgba(29,37,80,.1), 0 12px 22px rgba(29,37,80,.08);
  padding: 10px 10px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; transition: transform .15s var(--spring); }
.slot:active { transform: scale(.96); }
.slot .n { font: 700 13px Fredoka; color: #fff; background: var(--ink); border-radius: 99px; padding: 3px 10px; box-shadow: 0 2px 0 #0b1035; }
.slot .ic { font-size: 34px; margin: 6px 0 2px; line-height: 1; }
.slot .t { font: 600 14px/1.15 Fredoka, sans-serif; color: var(--ink); }
.slot.locked { background: #eef0f6; border-color: #f6f7fb; box-shadow: 0 5px 0 rgba(29,37,80,.06); }
.slot.locked .ic { filter: grayscale(1); opacity: .35; }
.slot.locked .t { color: var(--mute); }
.slot.locked::after { content: "🔒"; position: absolute; right: 8px; bottom: 6px; font-size: 18px; opacity: .8; }
.slot.open { background: linear-gradient(180deg, #e6fbef, #fff); border-color: #fff; animation: glow 1.6s ease-in-out infinite; }
.slot.open .n { background: var(--mint); box-shadow: 0 2px 0 var(--mint-lo); }
.slot.open .play { position: absolute; bottom: -12px; font: 700 13px Fredoka; color: var(--ink); background: var(--sun); padding: 4px 14px; border-radius: 99px; box-shadow: 0 3px 0 var(--sun-lo); }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 0 rgba(29,37,80,.1), 0 0 0 0 rgba(31,181,122,0); } 50% { box-shadow: 0 6px 0 rgba(29,37,80,.1), 0 0 0 8px rgba(31,181,122,.25); } }
.slot.done { animation: none; background: linear-gradient(180deg, #e6fbef, #fff); }
.slot.done .t { position: relative; z-index: 1; margin-top: auto; }
.slot.done .ic { visibility: hidden; }
.slot.done .stampmark { position: absolute; left: 50%; top: 30px; margin-left: -34px; width: 68px; height: 68px; border-radius: 50%; border: 4px dashed var(--mint); color: var(--mint);
  display: grid; place-items: center; font: 700 11px/1.05 Fredoka; text-align: center; transform: rotate(-14deg); background: rgba(255,255,255,.88); box-shadow: 0 0 0 3px rgba(31,181,122,.25); }
.toast { position: absolute; left: 50%; bottom: 40px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff;
  font: 600 18px Fredoka; padding: 12px 22px; border-radius: 99px; box-shadow: 0 5px 0 #0b1035; transition: opacity .25s, transform .3s var(--spring); white-space: nowrap; z-index: 9; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- mission ---- */
#mission canvas { position: absolute; inset: 0; width: 540px; height: 960px; }
.hud { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; justify-content: space-between; z-index: 4; }
.chip-btn { font: 600 15px Fredoka; background: rgba(255,253,248,.95); padding: 9px 14px; border-radius: 99px; box-shadow: 0 4px 0 rgba(29,37,80,.15); }
.m-title { font-size: 28px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,253,248,.95); box-shadow: 0 4px 0 rgba(29,37,80,.15); font-size: 20px; }
.words { position: absolute; top: 66px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 4; }
.words span { font: 600 14px Fredoka; padding: 5px 11px 4px; border-radius: 99px; background: rgba(255,255,255,.75); color: var(--mute); box-shadow: 0 3px 0 rgba(29,37,80,.1); }
.words span.got { color: #fff; background: var(--c); box-shadow: 0 3px 0 var(--lo); }
.dlg { position: absolute; left: 14px; right: 14px; top: 104px; padding: 14px 16px 14px 14px; display: none; gap: 14px; align-items: flex-start; z-index: 6; }
.dlg.on { display: flex; animation: popin .3s var(--spring); }
.dlg img { width: 74px; height: 74px; border-radius: 50%; background: #ffe9c7; border: 4px solid var(--sc, var(--mint)); flex: none; }
.dlg b { font: 700 22px Fredoka; color: var(--sc, var(--mint)); }
.dlg p { margin: 2px 0 0; font-size: 19px; line-height: 1.35; min-height: 52px; }
.dlg-next { position: absolute; right: 16px; bottom: 8px; color: var(--sc); font-size: 14px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes popin { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wordcard, .gatecard, .quizcard, .echocard { position: absolute; left: 22px; right: 22px; top: 104px; padding: 18px 20px 20px; text-align: center; display: none; z-index: 7; }
.wordcard.on, .gatecard.on, .quizcard.on, .echocard.on { display: block; animation: popin .35s var(--spring); }
.wc-word { font: 700 64px/1 Fredoka; margin: 4px 0 6px; }
.wordcard p { font-size: 20px; margin: 0 0 16px; color: var(--ink2); }
.gc-tag { display: inline-block; font: 700 13px Fredoka; letter-spacing: .12em; color: #fff; background: var(--ink); padding: 5px 12px; border-radius: 99px; box-shadow: 0 3px 0 #0b1035; }
.gc-q { font: 600 30px/1.25 Fredoka; margin: 14px 0 16px; }
.gc-q .blank { display: inline-block; min-width: 96px; border-bottom: 4px dashed var(--sun); color: var(--sun-lo); }
.gc-btns { display: flex; justify-content: center; gap: 16px; }
.gc-hint { margin-top: 16px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink2); }
.gc-hint span { background: #f3f0ff; border-radius: 99px; padding: 5px 12px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.qz-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qz-opt { background: #fff; border-radius: 18px; padding: 10px 6px 8px; box-shadow: 0 0 0 3px #e6e3f2 inset, 0 5px 0 rgba(29,37,80,.1); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qz-opt .pic { width: 92px; height: 92px; display: grid; place-items: center; font-size: 56px; border-radius: 50%; background: #fff7e6; overflow: hidden; }
.qz-opt .pic img { width: 100%; height: 100%; object-fit: contain; }
.qz-opt span { font: 600 16px Fredoka; }
.qz-opt.right { box-shadow: 0 0 0 4px var(--mint) inset, 0 5px 0 var(--mint-lo); background: #e6fbef; }
.ec-title { font-size: 34px; margin: 10px 0 4px; }
.ec-p { font-size: 16.5px; line-height: 1.4; margin: 0 0 10px; color: var(--ink2); }
.ec-rec { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 10px; }
.rec { width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px #ffd2db, 0 5px 0 rgba(29,37,80,.12); display: grid; place-items: center; }
.rec span { width: 34px; height: 34px; border-radius: 50%; background: var(--candy); transition: border-radius .2s, width .2s, height .2s; }
.rec.on span { width: 28px; height: 28px; border-radius: 7px; }
.rec.on { animation: recpulse 1.2s infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 12px rgba(255,79,123,.25), 0 5px 0 rgba(29,37,80,.12); } }
.ec-state { font: 600 17px Fredoka; text-align: left; max-width: 220px; }
#ec-play { width: 100%; height: 38px; margin: 0 0 10px; display: none; }
#ec-play.on { display: block; }
.ec-fallback { display: none; font-size: 15px; margin: 0 0 12px; align-items: center; gap: 8px; justify-content: center; }
.ec-fallback.on { display: flex; }
.ec-fallback input { width: 22px; height: 22px; accent-color: var(--mint); }
.badge-wrap { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 120px; z-index: 8;
  background: radial-gradient(circle at 50% 30%, rgba(255,248,238,.92), rgba(255,248,238,.55) 55%, rgba(255,248,238,0) 75%); }
.badge-wrap.on { display: flex; }
.badge { width: 250px; height: 250px; animation: stampin .6s var(--spring) both; }
@keyframes stampin { from { transform: scale(2.4) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(-10deg); opacity: 1; } }
.b-ring { width: 100%; height: 100%; border-radius: 50%; background: var(--mint); padding: 12px; box-shadow: 0 10px 0 var(--mint-lo), 0 24px 40px rgba(29,37,80,.25); }
.b-in { width: 100%; height: 100%; border-radius: 50%; border: 5px dashed rgba(255,255,255,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.b-ic { font-size: 70px; line-height: 1; } .b-t { font: 700 40px/1 Fredoka; letter-spacing: 2px; } .b-s { font: 600 20px Fredoka; letter-spacing: 6px; opacity: .9; }
.badge-p { font: 600 20px Fredoka; margin: 22px 0 18px; }
.pad { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 12px; z-index: 5; }
.pad.left { left: 16px; } .pad.right { right: 16px; }
.pbtn { width: 82px; height: 82px; border-radius: 50%; border: 4px solid #fff; background: rgba(29,37,80,.5); color: #fff; font: 700 28px/1 Fredoka;
  display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0,0,0,.25); touch-action: none; }
.pbtn.jump { background: var(--sky); font-size: 18px; } .pbtn.talk { background: var(--candy); font-size: 18px; }
.pbtn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
body.desktop .pad { display: none; }
.keys { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font: 600 15px Fredoka; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.5); z-index: 4; display: none; }
body.desktop .keys { display: block; }
