*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
/* only the flight canvas swallows touch; menus and shop lists must still scroll */
#game-canvas { touch-action: none; }
body, html { width: 100%; height: 100%; overflow: hidden; background: #05070d; font-family: 'Nunito', sans-serif; color: #dfe9fb; }
.font-fredoka { font-family: 'Fredoka One', cursive, sans-serif; }
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}
.animate-float { animation: float 3s ease-in-out infinite; }
@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255,221,68,0.8)); }
    50% { filter: drop-shadow(0 0 16px rgba(255,221,68,1)); }
}
.animate-glow { animation: pulse-glow 2s ease-in-out infinite; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }

/* ---- toasts (replace alert()) ---- */
#toast-host { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.ff-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; width: 100%; background: #fff; color: #1e1b4b; border-radius: 22px; padding: 8px 16px 8px 8px; box-shadow: 0 10px 30px rgba(30, 27, 75, .35); border: 3px solid #fde68a; font-weight: 700; font-size: 15px; line-height: 1.3; transform: translateY(30px) scale(.9); opacity: 0; transition: transform .3s cubic-bezier(.2, 1.4, .4, 1), opacity .25s; }
.ff-toast.show { transform: none; opacity: 1; }
.ff-toast-happy { border-color: #6ee7b7; }
.ff-toast-gentle { border-color: #c4b5fd; }
.ff-toast-art { width: 52px; height: 52px; flex: none; background: linear-gradient(135deg, #fef3c7, #fed7aa); border-radius: 16px; }
.ff-toast-text { flex: 1; }

/* ---- achievement badge ---- */
.ff-badge { position: absolute; top: 16px; left: 50%; z-index: 90; display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #fbbf24, #f97316); color: #fff; padding: 10px 18px 10px 10px; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transform: translate(-50%, -140%); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; }
.ff-badge.show { transform: translate(-50%, 0); }
.ff-badge-icon { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 26px; }
.ff-badge-kicker { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .9; }
.ff-badge-title { font-family: 'Fredoka One', cursive, sans-serif; font-size: 18px; }

/* ---- grown-up gate ---- */
.ff-gate { position: absolute; inset: 0; z-index: 100; background: rgba(15, 23, 42, .75); display: grid; place-items: center; padding: 16px; }
.ff-gate-card { background: #fff; color: #1e293b; border-radius: 24px; padding: 20px; width: 100%; max-width: 300px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.ff-gate-lock { font-size: 30px; }
.ff-gate-title { font-family: 'Fredoka One', cursive, sans-serif; font-size: 22px; color: #312e81; }
.ff-gate-reason { font-size: 12px; color: #64748b; margin: 4px 0 10px; }
.ff-gate-q { font-size: 16px; }
.ff-gate-display { margin: 8px auto; height: 44px; width: 120px; border-radius: 12px; background: #f1f5f9; border: 2px solid #cbd5e1; font-size: 26px; font-weight: 800; display: grid; place-items: center; letter-spacing: 2px; }
.ff-gate-hint { min-height: 16px; font-size: 12px; color: #be123c; margin-bottom: 6px; }
.ff-gate-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ff-gate-keys button { height: 44px; border-radius: 12px; background: #e0e7ff; color: #312e81; font-size: 18px; font-weight: 800; cursor: pointer; border: none; }
.ff-gate-keys button.ok { background: #10b981; color: #fff; }
.ff-gate-cancel { margin-top: 10px; width: 100%; padding: 8px; border-radius: 12px; background: #e2e8f0; color: #334155; font-weight: 700; cursor: pointer; border: none; }

/* ---- hold-to-confirm ---- */
.ff-hold { position: relative; overflow: hidden; }
.ff-hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: rgba(255, 255, 255, .35); pointer-events: none; }
